aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2011-06-26 22:00:24 +0200
committerJoakim Verona2011-06-26 22:00:24 +0200
commit76d08552619c83268f1353f449099f50ed6f93fa (patch)
tree321a375628d83d5c8aeea5876cf375ec7ad93f58
parent9fa0e291e866fb7945e18cd2ad8514090c13d510 (diff)
parent5b66d427c05eba5493c27da28c460a129b4203cc (diff)
downloademacs-76d08552619c83268f1353f449099f50ed6f93fa.tar.gz
emacs-76d08552619c83268f1353f449099f50ed6f93fa.zip
first working example of mvc. multiple views of a slider are kept in sync
-rw-r--r--ChangeLog11
-rw-r--r--INSTALL.BZR10
-rw-r--r--Makefile.in1
-rw-r--r--autogen/Makefile.in42
-rw-r--r--autogen/aclocal.m41
-rw-r--r--autogen/config.in23
-rwxr-xr-xautogen/configure454
-rw-r--r--configure.in2
-rw-r--r--doc/emacs/ChangeLog4
-rw-r--r--doc/emacs/misc.texi5
-rw-r--r--doc/lispref/ChangeLog6
-rw-r--r--doc/lispref/display.texi6
-rw-r--r--doc/lispref/keymaps.texi14
-rw-r--r--doc/man/ChangeLog4
-rw-r--r--doc/man/emacsclient.13
-rw-r--r--etc/NEWS4
-rw-r--r--lib-src/ChangeLog9
-rw-r--r--lib-src/emacsclient.c22
-rw-r--r--lib/dup2.c132
-rw-r--r--lib/getopt.c2
-rw-r--r--lib/gnulib.mk11
-rw-r--r--lib/stat.c8
-rw-r--r--lisp/ChangeLog97
-rw-r--r--lisp/allout.el2
-rw-r--r--lisp/emacs-lisp/re-builder.el3
-rw-r--r--lisp/emacs-lisp/smie.el8
-rw-r--r--lisp/erc/ChangeLog9
-rw-r--r--lisp/erc/erc.el39
-rw-r--r--lisp/gnus/ChangeLog11
-rw-r--r--lisp/gnus/auth-source.el4
-rw-r--r--lisp/gnus/nnimap.el6
-rw-r--r--lisp/loadhist.el17
-rw-r--r--lisp/mail/rmail.el93
-rw-r--r--lisp/mail/rmailmm.el12
-rw-r--r--lisp/mail/sendmail.el14
-rw-r--r--lisp/minibuffer.el35
-rw-r--r--lisp/net/ange-ftp.el1
-rw-r--r--lisp/net/browse-url.el2
-rw-r--r--lisp/net/tramp-sh.el2
-rw-r--r--lisp/proced.el10
-rw-r--r--lisp/progmodes/cperl-mode.el12
-rw-r--r--lisp/progmodes/f90.el18
-rw-r--r--lisp/progmodes/python.el11
-rw-r--r--lisp/progmodes/verilog-mode.el4
-rw-r--r--lisp/server.el20
-rw-r--r--lisp/ses.el5
-rw-r--r--lisp/window.el130
-rw-r--r--lisp/xwidget-test.el5
-rw-r--r--m4/dup2.m476
-rw-r--r--m4/gl-comp.m48
-rw-r--r--src/ChangeLog123
-rw-r--r--src/alloc.c10
-rw-r--r--src/buffer.c51
-rw-r--r--src/bytecode.c6
-rw-r--r--src/callint.c49
-rw-r--r--src/casefiddle.c3
-rw-r--r--src/casetab.c6
-rw-r--r--src/category.c12
-rw-r--r--src/ccl.c23
-rw-r--r--src/character.h3
-rw-r--r--src/cmds.c19
-rw-r--r--src/composite.c10
-rw-r--r--src/dbusbind.c144
-rw-r--r--src/dired.c22
-rw-r--r--src/dispnew.c7
-rw-r--r--src/doc.c3
-rw-r--r--src/editfns.c10
-rw-r--r--src/emacs.c6
-rw-r--r--src/eval.c56
-rw-r--r--src/fileio.c153
-rw-r--r--src/fns.c75
-rw-r--r--src/frame.c145
-rw-r--r--src/fringe.c18
-rw-r--r--src/gnutls.c78
-rw-r--r--src/image.c2
-rw-r--r--src/insdel.c3
-rw-r--r--src/keyboard.h2
-rw-r--r--src/keymap.c34
-rw-r--r--src/lisp.h8
-rw-r--r--src/lread.c259
-rw-r--r--src/macros.c25
-rw-r--r--src/minibuf.c96
-rw-r--r--src/msdos.c3
-rw-r--r--src/print.c52
-rw-r--r--src/process.c243
-rw-r--r--src/search.c6
-rw-r--r--src/sound.c12
-rw-r--r--src/syntax.c9
-rw-r--r--src/sysdep.c31
-rw-r--r--src/terminal.c6
-rw-r--r--src/textprop.c54
-rw-r--r--src/undo.c7
-rw-r--r--src/w32.c3
-rw-r--r--src/w32menu.c1
-rw-r--r--src/w32proc.c1
-rw-r--r--src/w32select.c1
-rw-r--r--src/window.c79
-rw-r--r--src/xdisp.c207
-rw-r--r--src/xfaces.c215
-rw-r--r--src/xfns.c19
-rw-r--r--src/xmenu.c3
-rw-r--r--src/xsettings.c12
-rw-r--r--src/xterm.c10
-rw-r--r--src/xwidget.c40
-rw-r--r--src/xwidget.h2
105 files changed, 1930 insertions, 1975 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b8e5f762f3..4bf89e35776 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
12011-06-25 Paul Eggert <eggert@cs.ucla.edu>
2
3 Use gnulib's dup2 module instead of rolling our own.
4 * Makefile.in (GNULIB_MODULES): Add dup2.
5 * configure.in: Do not check for dup2; gnulib does that now.
6 * lib/dup2.c, m4/dup2.m4: New files, from gnulib.
7
82011-06-23 Paul Eggert <eggert@cs.ucla.edu>
9
10 * lib/getopt.c, lib/stat.c, m4/gl-comp.m4: Merge from gnulib.
11
12011-06-22 Paul Eggert <eggert@cs.ucla.edu> 122011-06-22 Paul Eggert <eggert@cs.ucla.edu>
2 13
3 Use gnulib's alloca-opt module. 14 Use gnulib's alloca-opt module.
diff --git a/INSTALL.BZR b/INSTALL.BZR
index 93229ec7a79..664aab1c765 100644
--- a/INSTALL.BZR
+++ b/INSTALL.BZR
@@ -68,10 +68,12 @@ etc.) before "make bootstrap" or "make"; the rest of the procedure is
68applicable to those systems as well. 68applicable to those systems as well.
69 69
70Because the Bazaar version of Emacs is a work in progress, it will 70Because the Bazaar version of Emacs is a work in progress, it will
71sometimes fail to build. Please wait a day or so (and check the bug 71sometimes fail to build. Please wait a day or so (and check the
72and development mailing list archives) before reporting such problems. 72archives of the emacs-buildstatus, emacs-devel, and bug-gnu-emacs
73In most cases, the problem is known about and is just waiting for 73mailing lists) before reporting such problems. In most cases, the
74someone to fix it. 74problem is known about and is just waiting for someone to fix it.
75This is especially true for Lisp compilation errors, which are almost
76never platform-specific.
75 77
76 78
77 79
diff --git a/Makefile.in b/Makefile.in
index 40d76104397..457b5d6472e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -334,6 +334,7 @@ DOS_gnulib_comp.m4 = gl-comp.m4
334GNULIB_MODULES = \ 334GNULIB_MODULES = \
335 alloca-opt \ 335 alloca-opt \
336 careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr \ 336 careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr \
337 dup2 \
337 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink \ 338 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink \
338 socklen stdarg stdio strftime strtoumax symlink sys_stat 339 socklen stdarg stdio strftime strtoumax symlink sys_stat
339GNULIB_TOOL_FLAGS = \ 340GNULIB_TOOL_FLAGS = \
diff --git a/autogen/Makefile.in b/autogen/Makefile.in
index 18127366751..41763bc9ba3 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 careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr 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 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat
28 28
29VPATH = @srcdir@ 29VPATH = @srcdir@
30pkgdatadir = $(datadir)/@PACKAGE@ 30pkgdatadir = $(datadir)/@PACKAGE@
@@ -51,10 +51,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
51subdir = lib 51subdir = lib
52ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 52ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
53am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ 53am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
54 $(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/extensions.m4 \ 54 $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/c-strtod.m4 \
55 $(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/getloadavg.m4 \ 55 $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/filemode.m4 \
56 $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gl-comp.m4 \ 56 $(top_srcdir)/m4/getloadavg.m4 $(top_srcdir)/m4/getopt.m4 \
57 $(top_srcdir)/m4/gnulib-common.m4 \ 57 $(top_srcdir)/m4/gl-comp.m4 $(top_srcdir)/m4/gnulib-common.m4 \
58 $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inttypes.m4 \ 58 $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inttypes.m4 \
59 $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ 59 $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \
60 $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/mktime.m4 \ 60 $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/mktime.m4 \
@@ -104,6 +104,7 @@ CTAGS = ctags
104DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 104DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
105ACLOCAL = @ACLOCAL@ 105ACLOCAL = @ACLOCAL@
106ALLOCA = @ALLOCA@ 106ALLOCA = @ALLOCA@
107ALLOCA_H = @ALLOCA_H@
107ALSA_CFLAGS = @ALSA_CFLAGS@ 108ALSA_CFLAGS = @ALSA_CFLAGS@
108ALSA_LIBS = @ALSA_LIBS@ 109ALSA_LIBS = @ALSA_LIBS@
109AMTAR = @AMTAR@ 110AMTAR = @AMTAR@
@@ -732,10 +733,10 @@ x_default_search_path = @x_default_search_path@
732# statements but through direct file reference. Therefore this snippet must be 733# statements but through direct file reference. Therefore this snippet must be
733# present in all Makefile.am that need it. This is ensured by the applicability 734# present in all Makefile.am that need it. This is ensured by the applicability
734# 'all' defined above. 735# 'all' defined above.
735BUILT_SOURCES = arg-nonnull.h c++defs.h $(GETOPT_H) inttypes.h \ 736BUILT_SOURCES = $(ALLOCA_H) arg-nonnull.h c++defs.h $(GETOPT_H) \
736 $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \ 737 inttypes.h $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \
737 stdlib.h sys/stat.h time.h unistd.h warn-on-use.h 738 stdio.h stdlib.h sys/stat.h time.h unistd.h warn-on-use.h
738EXTRA_DIST = allocator.h $(top_srcdir)/./arg-nonnull.h \ 739EXTRA_DIST = alloca.in.h allocator.h $(top_srcdir)/./arg-nonnull.h \
739 $(top_srcdir)/./c++defs.h careadlinkat.h md5.h sha1.h sha256.h \ 740 $(top_srcdir)/./c++defs.h careadlinkat.h md5.h sha1.h sha256.h \
740 sha512.h dosname.h ftoastr.c ftoastr.h filemode.h getloadavg.c \ 741 sha512.h dosname.h ftoastr.c ftoastr.h filemode.h getloadavg.c \
741 getopt.c getopt.in.h getopt1.c getopt_int.h ignore-value.h \ 742 getopt.c getopt.in.h getopt1.c getopt_int.h ignore-value.h \
@@ -746,12 +747,12 @@ EXTRA_DIST = allocator.h $(top_srcdir)/./arg-nonnull.h \
746 sys_stat.in.h time.in.h time_r.c u64.h unistd.in.h verify.h \ 747 sys_stat.in.h time.in.h time_r.c u64.h unistd.in.h verify.h \
747 $(top_srcdir)/./warn-on-use.h 748 $(top_srcdir)/./warn-on-use.h
748MOSTLYCLEANDIRS = sys 749MOSTLYCLEANDIRS = sys
749MOSTLYCLEANFILES = core *.stackdump arg-nonnull.h arg-nonnull.h-t \ 750MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arg-nonnull.h \
750 c++defs.h c++defs.h-t getopt.h getopt.h-t inttypes.h \ 751 arg-nonnull.h-t c++defs.h c++defs.h-t getopt.h getopt.h-t \
751 inttypes.h-t stdarg.h stdarg.h-t stdbool.h stdbool.h-t \ 752 inttypes.h inttypes.h-t stdarg.h stdarg.h-t stdbool.h \
752 stddef.h stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t \ 753 stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t stdio.h \
753 stdlib.h stdlib.h-t sys/stat.h sys/stat.h-t time.h time.h-t \ 754 stdio.h-t stdlib.h stdlib.h-t sys/stat.h sys/stat.h-t time.h \
754 unistd.h unistd.h-t warn-on-use.h warn-on-use.h-t 755 time.h-t unistd.h unistd.h-t warn-on-use.h warn-on-use.h-t
755noinst_LIBRARIES = libgnu.a 756noinst_LIBRARIES = libgnu.a
756DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src 757DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src
757libgnu_a_SOURCES = allocator.c careadlinkat.c md5.c sha1.c sha256.c \ 758libgnu_a_SOURCES = allocator.c careadlinkat.c md5.c sha1.c sha256.c \
@@ -1052,6 +1053,17 @@ uninstall-am:
1052 mostlyclean-generic mostlyclean-local pdf pdf-am ps ps-am tags \ 1053 mostlyclean-generic mostlyclean-local pdf pdf-am ps ps-am tags \
1053 uninstall uninstall-am 1054 uninstall uninstall-am
1054 1055
1056
1057# We need the following in order to create <alloca.h> when the system
1058# doesn't have one that works with the given compiler.
1059@GL_GENERATE_ALLOCA_H_TRUE@alloca.h: alloca.in.h $(top_builddir)/config.status
1060@GL_GENERATE_ALLOCA_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \
1061@GL_GENERATE_ALLOCA_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
1062@GL_GENERATE_ALLOCA_H_TRUE@ cat $(srcdir)/alloca.in.h; \
1063@GL_GENERATE_ALLOCA_H_TRUE@ } > $@-t && \
1064@GL_GENERATE_ALLOCA_H_TRUE@ mv -f $@-t $@
1065@GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status
1066@GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@
1055# The arg-nonnull.h that gets inserted into generated .h files is the same as 1067# The arg-nonnull.h that gets inserted into generated .h files is the same as
1056# build-aux/arg-nonnull.h, except that it has the copyright header cut off. 1068# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
1057arg-nonnull.h: $(top_srcdir)/./arg-nonnull.h 1069arg-nonnull.h: $(top_srcdir)/./arg-nonnull.h
diff --git a/autogen/aclocal.m4 b/autogen/aclocal.m4
index eaa2330e9ed..08bef24413f 100644
--- a/autogen/aclocal.m4
+++ b/autogen/aclocal.m4
@@ -985,6 +985,7 @@ AC_SUBST([am__untar])
985]) # _AM_PROG_TAR 985]) # _AM_PROG_TAR
986 986
987m4_include([m4/00gnulib.m4]) 987m4_include([m4/00gnulib.m4])
988m4_include([m4/alloca.m4])
988m4_include([m4/c-strtod.m4]) 989m4_include([m4/c-strtod.m4])
989m4_include([m4/extensions.m4]) 990m4_include([m4/extensions.m4])
990m4_include([m4/filemode.m4]) 991m4_include([m4/filemode.m4])
diff --git a/autogen/config.in b/autogen/config.in
index b3e14609845..23b98d256b9 100644
--- a/autogen/config.in
+++ b/autogen/config.in
@@ -104,7 +104,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
104/* Define to 1 if you have the `alarm' function. */ 104/* Define to 1 if you have the `alarm' function. */
105#undef HAVE_ALARM 105#undef HAVE_ALARM
106 106
107/* Define to 1 if you have `alloca', as a function or macro. */ 107/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
108 may be supplied by this distribution. */
108#undef HAVE_ALLOCA 109#undef HAVE_ALLOCA
109 110
110/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). 111/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
@@ -1290,6 +1291,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1290#undef volatile 1291#undef volatile
1291 1292
1292 1293
1294/* On AIX 3 this must be included before any other include file. */
1295#include <alloca.h>
1296#if ! HAVE_ALLOCA
1297# error "alloca not available on this machine"
1298#endif
1299
1293/* Define AMPERSAND_FULL_NAME if you use the convention 1300/* Define AMPERSAND_FULL_NAME if you use the convention
1294 that & in the full name stands for the login id. */ 1301 that & in the full name stands for the login id. */
1295/* Turned on June 1996 supposing nobody will mind it. */ 1302/* Turned on June 1996 supposing nobody will mind it. */
@@ -1366,20 +1373,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1366#include <string.h> 1373#include <string.h>
1367#include <stdlib.h> 1374#include <stdlib.h>
1368 1375
1369#ifdef HAVE_ALLOCA_H
1370# include <alloca.h>
1371#elif defined __GNUC__
1372# define alloca __builtin_alloca
1373#elif defined _AIX
1374# define alloca __alloca
1375#else
1376# include <stddef.h>
1377# ifdef __cplusplus
1378extern "C"
1379# endif
1380void *alloca (size_t);
1381#endif
1382
1383#ifndef HAVE_STRCHR 1376#ifndef HAVE_STRCHR
1384#define strchr(a, b) index (a, b) 1377#define strchr(a, b) index (a, b)
1385#endif 1378#endif
diff --git a/autogen/configure b/autogen/configure
index 6957f9adff6..06e293b170b 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -1070,12 +1070,15 @@ GNULIB_CANONICALIZE_FILE_NAME
1070GNULIB_CALLOC_POSIX 1070GNULIB_CALLOC_POSIX
1071GNULIB_ATOLL 1071GNULIB_ATOLL
1072GNULIB__EXIT 1072GNULIB__EXIT
1073GL_GENERATE_ALLOCA_H_FALSE
1074GL_GENERATE_ALLOCA_H_TRUE
1075ALLOCA_H
1076ALLOCA
1073GL_COND_LIBTOOL_FALSE 1077GL_COND_LIBTOOL_FALSE
1074GL_COND_LIBTOOL_TRUE 1078GL_COND_LIBTOOL_TRUE
1075BLESSMAIL_TARGET 1079BLESSMAIL_TARGET
1076LIBS_MAIL 1080LIBS_MAIL
1077liblockfile 1081liblockfile
1078ALLOCA
1079LIBXML2_LIBS 1082LIBXML2_LIBS
1080LIBXML2_CFLAGS 1083LIBXML2_CFLAGS
1081LIBXSM 1084LIBXSM
@@ -6535,6 +6538,7 @@ esac
6535 6538
6536 6539
6537 6540
6541 # Code from module alloca-opt:
6538 # Code from module allocator: 6542 # Code from module allocator:
6539 # Code from module arg-nonnull: 6543 # Code from module arg-nonnull:
6540 # Code from module c++defs: 6544 # Code from module c++defs:
@@ -13313,201 +13317,6 @@ $as_echo "#define HAVE_H_ERRNO 1" >>confdefs.h
13313 13317
13314fi 13318fi
13315 13319
13316# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
13317# for constant arguments. Useless!
13318{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
13319$as_echo_n "checking for working alloca.h... " >&6; }
13320if test "${ac_cv_working_alloca_h+set}" = set; then :
13321 $as_echo_n "(cached) " >&6
13322else
13323 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13324/* end confdefs.h. */
13325#include <alloca.h>
13326int
13327main ()
13328{
13329char *p = (char *) alloca (2 * sizeof (int));
13330 if (p) return 0;
13331 ;
13332 return 0;
13333}
13334_ACEOF
13335if ac_fn_c_try_link "$LINENO"; then :
13336 ac_cv_working_alloca_h=yes
13337else
13338 ac_cv_working_alloca_h=no
13339fi
13340rm -f core conftest.err conftest.$ac_objext \
13341 conftest$ac_exeext conftest.$ac_ext
13342fi
13343{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
13344$as_echo "$ac_cv_working_alloca_h" >&6; }
13345if test $ac_cv_working_alloca_h = yes; then
13346
13347$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
13348
13349fi
13350
13351{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
13352$as_echo_n "checking for alloca... " >&6; }
13353if test "${ac_cv_func_alloca_works+set}" = set; then :
13354 $as_echo_n "(cached) " >&6
13355else
13356 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13357/* end confdefs.h. */
13358#ifdef __GNUC__
13359# define alloca __builtin_alloca
13360#else
13361# ifdef _MSC_VER
13362# include <malloc.h>
13363# define alloca _alloca
13364# else
13365# ifdef HAVE_ALLOCA_H
13366# include <alloca.h>
13367# else
13368# ifdef _AIX
13369 #pragma alloca
13370# else
13371# ifndef alloca /* predefined by HP cc +Olibcalls */
13372char *alloca ();
13373# endif
13374# endif
13375# endif
13376# endif
13377#endif
13378
13379int
13380main ()
13381{
13382char *p = (char *) alloca (1);
13383 if (p) return 0;
13384 ;
13385 return 0;
13386}
13387_ACEOF
13388if ac_fn_c_try_link "$LINENO"; then :
13389 ac_cv_func_alloca_works=yes
13390else
13391 ac_cv_func_alloca_works=no
13392fi
13393rm -f core conftest.err conftest.$ac_objext \
13394 conftest$ac_exeext conftest.$ac_ext
13395fi
13396{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
13397$as_echo "$ac_cv_func_alloca_works" >&6; }
13398
13399if test $ac_cv_func_alloca_works = yes; then
13400
13401$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
13402
13403else
13404 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
13405# that cause trouble. Some versions do not even contain alloca or
13406# contain a buggy version. If you still want to use their alloca,
13407# use ar to extract alloca.o from them instead of compiling alloca.c.
13408
13409ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
13410
13411$as_echo "#define C_ALLOCA 1" >>confdefs.h
13412
13413
13414{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
13415$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
13416if test "${ac_cv_os_cray+set}" = set; then :
13417 $as_echo_n "(cached) " >&6
13418else
13419 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13420/* end confdefs.h. */
13421#if defined CRAY && ! defined CRAY2
13422webecray
13423#else
13424wenotbecray
13425#endif
13426
13427_ACEOF
13428if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13429 $EGREP "webecray" >/dev/null 2>&1; then :
13430 ac_cv_os_cray=yes
13431else
13432 ac_cv_os_cray=no
13433fi
13434rm -f conftest*
13435
13436fi
13437{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
13438$as_echo "$ac_cv_os_cray" >&6; }
13439if test $ac_cv_os_cray = yes; then
13440 for ac_func in _getb67 GETB67 getb67; do
13441 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13442ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13443eval as_val=\$$as_ac_var
13444 if test "x$as_val" = x""yes; then :
13445
13446cat >>confdefs.h <<_ACEOF
13447#define CRAY_STACKSEG_END $ac_func
13448_ACEOF
13449
13450 break
13451fi
13452
13453 done
13454fi
13455
13456{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
13457$as_echo_n "checking stack direction for C alloca... " >&6; }
13458if test "${ac_cv_c_stack_direction+set}" = set; then :
13459 $as_echo_n "(cached) " >&6
13460else
13461 if test "$cross_compiling" = yes; then :
13462 ac_cv_c_stack_direction=0
13463else
13464 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13465/* end confdefs.h. */
13466$ac_includes_default
13467int
13468find_stack_direction ()
13469{
13470 static char *addr = 0;
13471 auto char dummy;
13472 if (addr == 0)
13473 {
13474 addr = &dummy;
13475 return find_stack_direction ();
13476 }
13477 else
13478 return (&dummy > addr) ? 1 : -1;
13479}
13480
13481int
13482main ()
13483{
13484 return find_stack_direction () < 0;
13485}
13486_ACEOF
13487if ac_fn_c_try_run "$LINENO"; then :
13488 ac_cv_c_stack_direction=1
13489else
13490 ac_cv_c_stack_direction=-1
13491fi
13492rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13493 conftest.$ac_objext conftest.beam conftest.$ac_ext
13494fi
13495
13496fi
13497{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
13498$as_echo "$ac_cv_c_stack_direction" >&6; }
13499cat >>confdefs.h <<_ACEOF
13500#define STACK_DIRECTION $ac_cv_c_stack_direction
13501_ACEOF
13502
13503
13504fi
13505
13506
13507if test x"$ac_cv_func_alloca_works" != xyes; then
13508 as_fn_error "a system implementation of alloca is required " "$LINENO" 5
13509fi
13510
13511# fmod, logb, and frexp are found in -lm on most systems. 13320# fmod, logb, and frexp are found in -lm on most systems.
13512# On HPUX 9.01, -lm does not contain logb, so check for sqrt. 13321# On HPUX 9.01, -lm does not contain logb, so check for sqrt.
13513{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 13322{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
@@ -13962,6 +13771,197 @@ fi
13962 LIBC_FATAL_STDERR_=1 13771 LIBC_FATAL_STDERR_=1
13963 export LIBC_FATAL_STDERR_ 13772 export LIBC_FATAL_STDERR_
13964 13773
13774# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
13775# for constant arguments. Useless!
13776{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
13777$as_echo_n "checking for working alloca.h... " >&6; }
13778if test "${ac_cv_working_alloca_h+set}" = set; then :
13779 $as_echo_n "(cached) " >&6
13780else
13781 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13782/* end confdefs.h. */
13783#include <alloca.h>
13784int
13785main ()
13786{
13787char *p = (char *) alloca (2 * sizeof (int));
13788 if (p) return 0;
13789 ;
13790 return 0;
13791}
13792_ACEOF
13793if ac_fn_c_try_link "$LINENO"; then :
13794 ac_cv_working_alloca_h=yes
13795else
13796 ac_cv_working_alloca_h=no
13797fi
13798rm -f core conftest.err conftest.$ac_objext \
13799 conftest$ac_exeext conftest.$ac_ext
13800fi
13801{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
13802$as_echo "$ac_cv_working_alloca_h" >&6; }
13803if test $ac_cv_working_alloca_h = yes; then
13804
13805$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
13806
13807fi
13808
13809{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
13810$as_echo_n "checking for alloca... " >&6; }
13811if test "${ac_cv_func_alloca_works+set}" = set; then :
13812 $as_echo_n "(cached) " >&6
13813else
13814 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13815/* end confdefs.h. */
13816#ifdef __GNUC__
13817# define alloca __builtin_alloca
13818#else
13819# ifdef _MSC_VER
13820# include <malloc.h>
13821# define alloca _alloca
13822# else
13823# ifdef HAVE_ALLOCA_H
13824# include <alloca.h>
13825# else
13826# ifdef _AIX
13827 #pragma alloca
13828# else
13829# ifndef alloca /* predefined by HP cc +Olibcalls */
13830char *alloca ();
13831# endif
13832# endif
13833# endif
13834# endif
13835#endif
13836
13837int
13838main ()
13839{
13840char *p = (char *) alloca (1);
13841 if (p) return 0;
13842 ;
13843 return 0;
13844}
13845_ACEOF
13846if ac_fn_c_try_link "$LINENO"; then :
13847 ac_cv_func_alloca_works=yes
13848else
13849 ac_cv_func_alloca_works=no
13850fi
13851rm -f core conftest.err conftest.$ac_objext \
13852 conftest$ac_exeext conftest.$ac_ext
13853fi
13854{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
13855$as_echo "$ac_cv_func_alloca_works" >&6; }
13856
13857if test $ac_cv_func_alloca_works = yes; then
13858
13859$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
13860
13861else
13862 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
13863# that cause trouble. Some versions do not even contain alloca or
13864# contain a buggy version. If you still want to use their alloca,
13865# use ar to extract alloca.o from them instead of compiling alloca.c.
13866
13867
13868
13869
13870
13871ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
13872
13873$as_echo "#define C_ALLOCA 1" >>confdefs.h
13874
13875
13876{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
13877$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
13878if test "${ac_cv_os_cray+set}" = set; then :
13879 $as_echo_n "(cached) " >&6
13880else
13881 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13882/* end confdefs.h. */
13883#if defined CRAY && ! defined CRAY2
13884webecray
13885#else
13886wenotbecray
13887#endif
13888
13889_ACEOF
13890if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13891 $EGREP "webecray" >/dev/null 2>&1; then :
13892 ac_cv_os_cray=yes
13893else
13894 ac_cv_os_cray=no
13895fi
13896rm -f conftest*
13897
13898fi
13899{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
13900$as_echo "$ac_cv_os_cray" >&6; }
13901if test $ac_cv_os_cray = yes; then
13902 for ac_func in _getb67 GETB67 getb67; do
13903 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13904ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13905eval as_val=\$$as_ac_var
13906 if test "x$as_val" = x""yes; then :
13907
13908cat >>confdefs.h <<_ACEOF
13909#define CRAY_STACKSEG_END $ac_func
13910_ACEOF
13911
13912 break
13913fi
13914
13915 done
13916fi
13917
13918{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
13919$as_echo_n "checking stack direction for C alloca... " >&6; }
13920if test "${ac_cv_c_stack_direction+set}" = set; then :
13921 $as_echo_n "(cached) " >&6
13922else
13923 if test "$cross_compiling" = yes; then :
13924 ac_cv_c_stack_direction=0
13925else
13926 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13927/* end confdefs.h. */
13928$ac_includes_default
13929int
13930find_stack_direction (int *addr, int depth)
13931{
13932 int dir, dummy = 0;
13933 if (! addr)
13934 addr = &dummy;
13935 *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
13936 dir = depth ? find_stack_direction (addr, depth - 1) : 0;
13937 return dir + dummy;
13938}
13939
13940int
13941main (int argc, char **argv)
13942{
13943 return find_stack_direction (0, argc + !argv + 20) < 0;
13944}
13945_ACEOF
13946if ac_fn_c_try_run "$LINENO"; then :
13947 ac_cv_c_stack_direction=1
13948else
13949 ac_cv_c_stack_direction=-1
13950fi
13951rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13952 conftest.$ac_objext conftest.beam conftest.$ac_ext
13953fi
13954
13955fi
13956{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
13957$as_echo "$ac_cv_c_stack_direction" >&6; }
13958cat >>confdefs.h <<_ACEOF
13959#define STACK_DIRECTION $ac_cv_c_stack_direction
13960_ACEOF
13961
13962
13963fi
13964
13965 13965
13966 13966
13967 13967
@@ -16682,6 +16682,61 @@ fi
16682 gl_source_base='lib' 16682 gl_source_base='lib'
16683 16683
16684 16684
16685 if test $ac_cv_func_alloca_works = no; then
16686 :
16687 fi
16688
16689 # Define an additional variable used in the Makefile substitution.
16690 if test $ac_cv_working_alloca_h = yes; then
16691 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
16692$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
16693if test "${gl_cv_rpl_alloca+set}" = set; then :
16694 $as_echo_n "(cached) " >&6
16695else
16696
16697 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16698/* end confdefs.h. */
16699
16700#if defined __GNUC__ || defined _AIX || defined _MSC_VER
16701 Need own alloca
16702#endif
16703
16704_ACEOF
16705if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16706 $EGREP "Need own alloca" >/dev/null 2>&1; then :
16707 gl_cv_rpl_alloca=yes
16708else
16709 gl_cv_rpl_alloca=no
16710fi
16711rm -f conftest*
16712
16713
16714fi
16715{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
16716$as_echo "$gl_cv_rpl_alloca" >&6; }
16717 if test $gl_cv_rpl_alloca = yes; then
16718
16719$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
16720
16721 ALLOCA_H=alloca.h
16722 else
16723 ALLOCA_H=
16724 fi
16725 else
16726 ALLOCA_H=alloca.h
16727 fi
16728
16729 if test -n "$ALLOCA_H"; then
16730 GL_GENERATE_ALLOCA_H_TRUE=
16731 GL_GENERATE_ALLOCA_H_FALSE='#'
16732else
16733 GL_GENERATE_ALLOCA_H_TRUE='#'
16734 GL_GENERATE_ALLOCA_H_FALSE=
16735fi
16736
16737
16738
16739
16685 16740
16686 16741
16687 : 16742 :
@@ -18798,6 +18853,9 @@ fi
18798 if $condition; then 18853 if $condition; then
18799 func_gl_gnulib_m4code_dosname 18854 func_gl_gnulib_m4code_dosname
18800 fi 18855 fi
18856 if $condition; then
18857 func_gl_gnulib_m4code_verify
18858 fi
18801 fi 18859 fi
18802 } 18860 }
18803 func_gl_gnulib_m4code_strtoull () 18861 func_gl_gnulib_m4code_strtoull ()
@@ -21098,6 +21156,10 @@ if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
21098 as_fn_error "conditional \"GL_COND_LIBTOOL\" was never defined. 21156 as_fn_error "conditional \"GL_COND_LIBTOOL\" was never defined.
21099Usually this means the macro was only invoked conditionally." "$LINENO" 5 21157Usually this means the macro was only invoked conditionally." "$LINENO" 5
21100fi 21158fi
21159if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
21160 as_fn_error "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
21161Usually this means the macro was only invoked conditionally." "$LINENO" 5
21162fi
21101 21163
21102if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then 21164if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
21103 as_fn_error "conditional \"GL_GENERATE_STDINT_H\" was never defined. 21165 as_fn_error "conditional \"GL_GENERATE_STDINT_H\" was never defined.
diff --git a/configure.in b/configure.in
index dcf565b4567..e7930e3987b 100644
--- a/configure.in
+++ b/configure.in
@@ -2645,7 +2645,7 @@ esac
2645AC_SUBST(BLESSMAIL_TARGET) 2645AC_SUBST(BLESSMAIL_TARGET)
2646 2646
2647 2647
2648AC_CHECK_FUNCS(gethostname getdomainname dup2 \ 2648AC_CHECK_FUNCS(gethostname getdomainname \
2649rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ 2649rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
2650random lrand48 logb frexp fmod rint cbrt ftime setsid \ 2650random lrand48 logb frexp fmod rint cbrt ftime setsid \
2651strerror fpathconf select euidaccess getpagesize tzset setlocale \ 2651strerror fpathconf select euidaccess getpagesize tzset setlocale \
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 8853eb099d6..ab0abcd43d3 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,7 @@
12011-06-25 Andreas Rottmann <a.rottmann@gmx.at>
2
3 * misc.texi (emacsclient Options): Mention --frame-parameters.
4
12011-06-09 Glenn Morris <rgm@gnu.org> 52011-06-09 Glenn Morris <rgm@gnu.org>
2 6
3 * custom.texi (Specifying File Variables): 7 * custom.texi (Specifying File Variables):
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 290e5dc53bf..f83ac38469a 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -1623,6 +1623,11 @@ text-only terminal frame (@pxref{Frames}). If you omit a filename
1623argument while supplying the @samp{-c} option, the new frame displays 1623argument while supplying the @samp{-c} option, the new frame displays
1624the @samp{*scratch*} buffer (@pxref{Buffers}). 1624the @samp{*scratch*} buffer (@pxref{Buffers}).
1625 1625
1626@item -F
1627@itemx --frame-parameters=@var{alist}
1628Set the parameters for a newly-created graphical frame
1629(@pxref{Frame Parameters}).
1630
1626@item -d @var{display} 1631@item -d @var{display}
1627@itemx --display=@var{display} 1632@itemx --display=@var{display}
1628Tell Emacs to open the given files on the X display @var{display} 1633Tell Emacs to open the given files on the X display @var{display}
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index b6b02686caf..7946e4b91ff 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
12011-06-25 Chong Yidong <cyd@stupidchicken.com>
2
3 * keymaps.texi (Searching Keymaps):
4 * display.texi (Overlay Properties): Fix errors in 2011-05-29
5 change. Suggested by Johan Bockgård.
6
12011-06-15 Chong Yidong <cyd@stupidchicken.com> 72011-06-15 Chong Yidong <cyd@stupidchicken.com>
2 8
3 * text.texi (Special Properties): Clarify role of font-lock-face. 9 * text.texi (Special Properties): Clarify role of font-lock-face.
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 199a20cc2cd..069b3c91d7b 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1441,9 +1441,9 @@ specify a particular attribute for certain text. @xref{Face
1441Attributes}. 1441Attributes}.
1442 1442
1443@item 1443@item
1444A cons cell, either of the form @code{(fg-color . @var{color-name})} 1444A cons cell, of the form @code{(foreground-color . @var{color-name})}
1445or @code{(bg-color . @var{color-name})}. These elements specify just 1445or @code{(background-color . @var{color-name})}. These elements
1446the foreground color or just the background color. 1446specify just the foreground color or just the background color.
1447 1447
1448@code{(foreground-color . @var{color-name})} has the same effect as 1448@code{(foreground-color . @var{color-name})} has the same effect as
1449@code{(:foreground @var{color-name})}; likewise for the background. 1449@code{(:foreground @var{color-name})}; likewise for the background.
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index d55cb299771..cf1db5b7fce 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -723,13 +723,13 @@ them:
723 (@var{find-in} overriding-terminal-local-map)) 723 (@var{find-in} overriding-terminal-local-map))
724 (overriding-local-map 724 (overriding-local-map
725 (@var{find-in} overriding-local-map)) 725 (@var{find-in} overriding-local-map))
726 (or (@var{find-in} (get-char-property (point) 'keymap)) 726 ((or (@var{find-in} (get-char-property (point) 'keymap))
727 (@var{find-in-any} emulation-mode-map-alists) 727 (@var{find-in-any} emulation-mode-map-alists)
728 (@var{find-in-any} minor-mode-overriding-map-alist) 728 (@var{find-in-any} minor-mode-overriding-map-alist)
729 (@var{find-in-any} minor-mode-map-alist) 729 (@var{find-in-any} minor-mode-map-alist)
730 (if (get-text-property (point) 'local-map) 730 (if (get-text-property (point) 'local-map)
731 (@var{find-in} (get-char-property (point) 'local-map)) 731 (@var{find-in} (get-char-property (point) 'local-map))
732 (@var{find-in} (current-local-map))))) 732 (@var{find-in} (current-local-map))))))
733 (@var{find-in} (current-global-map))) 733 (@var{find-in} (current-global-map)))
734@end lisp 734@end lisp
735 735
diff --git a/doc/man/ChangeLog b/doc/man/ChangeLog
index 06ff5782003..88f70e410c8 100644
--- a/doc/man/ChangeLog
+++ b/doc/man/ChangeLog
@@ -1,3 +1,7 @@
12011-06-25 Andreas Rottmann <a.rottmann@gmx.at>
2
3 * emacsclient.1: Mention --frame-parameters.
4
12011-03-07 Chong Yidong <cyd@stupidchicken.com> 52011-03-07 Chong Yidong <cyd@stupidchicken.com>
2 6
3 * Version 23.3 released. 7 * Version 23.3 released.
diff --git a/doc/man/emacsclient.1 b/doc/man/emacsclient.1
index cae4d76634b..4843053666a 100644
--- a/doc/man/emacsclient.1
+++ b/doc/man/emacsclient.1
@@ -58,6 +58,9 @@ daemon mode and emacsclient will try to connect to it.
58.B -c, \-\-create-frame 58.B -c, \-\-create-frame
59create a new frame instead of trying to use the current Emacs frame 59create a new frame instead of trying to use the current Emacs frame
60.TP 60.TP
61.B \-F, \-\-frame-parameters=ALIST
62set the parameters of a newly-created frame.
63.TP
61.B \-d, \-\-display=DISPLAY 64.B \-d, \-\-display=DISPLAY
62tell the server to display the files on the given display. 65tell the server to display the files on the given display.
63.TP 66.TP
diff --git a/etc/NEWS b/etc/NEWS
index 243058a46b2..32e4a0dc11f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -84,6 +84,10 @@ client frame in parent X window ID, via XEmbed. This works like the
84+++ 84+++
85*** New emacsclient argument -q/--quiet suppresses some status messages. 85*** New emacsclient argument -q/--quiet suppresses some status messages.
86 86
87+++
88*** New emacsclient argument --frame-parameters can be used to set the
89frame parameters of a newly-created graphical frame.
90
87*** If emacsclient shuts down as a result of Emacs signalling an 91*** If emacsclient shuts down as a result of Emacs signalling an
88error, its exit status is 1. 92error, its exit status is 1.
89 93
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index ec123e85036..b7a95fe8043 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,12 @@
12011-06-25 Glenn Morris <rgm@gnu.org>
2
3 * emacsclient.c (decode_options) <opt>: Add `F:'.
4 (print_help_and_exit): Mention --frame-parameters.
5
62011-06-25 Andreas Rottmann <a.rottmann@gmx.at>
7
8 * emacsclient.c (longopts, decode_options, main): Add frame-parameters.
9
12011-06-10 Paul Eggert <eggert@cs.ucla.edu> 102011-06-10 Paul Eggert <eggert@cs.ucla.edu>
2 11
3 * movemail.c: Fix race condition and related bugs (Bug#8836). 12 * movemail.c: Fix race condition and related bugs (Bug#8836).
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index c334fb6a196..c78a42bffe8 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -160,6 +160,10 @@ const char *server_file = NULL;
160/* PID of the Emacs server process. */ 160/* PID of the Emacs server process. */
161int emacs_pid = 0; 161int emacs_pid = 0;
162 162
163/* If non-NULL, a string that should form a frame parameter alist to
164 be used for the new frame */
165const char *frame_parameters = NULL;
166
163static void print_help_and_exit (void) NO_RETURN; 167static void print_help_and_exit (void) NO_RETURN;
164static void fail (void) NO_RETURN; 168static void fail (void) NO_RETURN;
165 169
@@ -175,6 +179,7 @@ struct option longopts[] =
175 { "nw", no_argument, NULL, 't' }, 179 { "nw", no_argument, NULL, 't' },
176 { "create-frame", no_argument, NULL, 'c' }, 180 { "create-frame", no_argument, NULL, 'c' },
177 { "alternate-editor", required_argument, NULL, 'a' }, 181 { "alternate-editor", required_argument, NULL, 'a' },
182 { "frame-parameters", required_argument, NULL, 'F' },
178#ifndef NO_SOCKETS_IN_FILE_SYSTEM 183#ifndef NO_SOCKETS_IN_FILE_SYSTEM
179 { "socket-name", required_argument, NULL, 's' }, 184 { "socket-name", required_argument, NULL, 's' },
180#endif 185#endif
@@ -526,9 +531,9 @@ decode_options (int argc, char **argv)
526 { 531 {
527 int opt = getopt_long_only (argc, argv, 532 int opt = getopt_long_only (argc, argv,
528#ifndef NO_SOCKETS_IN_FILE_SYSTEM 533#ifndef NO_SOCKETS_IN_FILE_SYSTEM
529 "VHneqa:s:f:d:tc", 534 "VHneqa:s:f:d:F:tc",
530#else 535#else
531 "VHneqa:f:d:tc", 536 "VHneqa:f:d:F:tc",
532#endif 537#endif
533 longopts, 0); 538 longopts, 0);
534 539
@@ -599,6 +604,10 @@ decode_options (int argc, char **argv)
599 print_help_and_exit (); 604 print_help_and_exit ();
600 break; 605 break;
601 606
607 case 'F':
608 frame_parameters = optarg;
609 break;
610
602 default: 611 default:
603 message (TRUE, "Try `%s --help' for more information\n", progname); 612 message (TRUE, "Try `%s --help' for more information\n", progname);
604 exit (EXIT_FAILURE); 613 exit (EXIT_FAILURE);
@@ -665,6 +674,8 @@ The following OPTIONS are accepted:\n\
665-nw, -t, --tty Open a new Emacs frame on the current terminal\n\ 674-nw, -t, --tty Open a new Emacs frame on the current terminal\n\
666-c, --create-frame Create a new frame instead of trying to\n\ 675-c, --create-frame Create a new frame instead of trying to\n\
667 use the current Emacs frame\n\ 676 use the current Emacs frame\n\
677-F ALIST, --frame-parameters=ALIST\n\
678 Set the parameters of a new frame\n\
668-e, --eval Evaluate the FILE arguments as ELisp expressions\n\ 679-e, --eval Evaluate the FILE arguments as ELisp expressions\n\
669-n, --no-wait Don't wait for the server to return\n\ 680-n, --no-wait Don't wait for the server to return\n\
670-q, --quiet Don't display messages on success\n\ 681-q, --quiet Don't display messages on success\n\
@@ -1630,6 +1641,13 @@ main (int argc, char **argv)
1630 send_to_emacs (emacs_socket, " "); 1641 send_to_emacs (emacs_socket, " ");
1631 } 1642 }
1632 1643
1644 if (frame_parameters && !current_frame)
1645 {
1646 send_to_emacs (emacs_socket, "-frame-parameters ");
1647 quote_argument (emacs_socket, frame_parameters);
1648 send_to_emacs (emacs_socket, " ");
1649 }
1650
1633 /* If using the current frame, send tty information to Emacs anyway. 1651 /* If using the current frame, send tty information to Emacs anyway.
1634 In daemon mode, Emacs may need to occupy this tty if no other 1652 In daemon mode, Emacs may need to occupy this tty if no other
1635 frame is available. */ 1653 frame is available. */
diff --git a/lib/dup2.c b/lib/dup2.c
new file mode 100644
index 00000000000..e00dc7b2e3c
--- /dev/null
+++ b/lib/dup2.c
@@ -0,0 +1,132 @@
1/* Duplicate an open file descriptor to a specified file descriptor.
2
3 Copyright (C) 1999, 2004-2007, 2009-2011 Free Software Foundation, Inc.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18/* written by Paul Eggert */
19
20#include <config.h>
21
22/* Specification. */
23#include <unistd.h>
24
25#include <errno.h>
26#include <fcntl.h>
27
28#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
29/* Get declarations of the Win32 API functions. */
30# define WIN32_LEAN_AND_MEAN
31# include <windows.h>
32#endif
33
34#if HAVE_DUP2
35
36# undef dup2
37
38int
39rpl_dup2 (int fd, int desired_fd)
40{
41 int result;
42# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
43 /* If fd is closed, mingw hangs on dup2 (fd, fd). If fd is open,
44 dup2 (fd, fd) returns 0, but all further attempts to use fd in
45 future dup2 calls will hang. */
46 if (fd == desired_fd)
47 {
48 if ((HANDLE) _get_osfhandle (fd) == INVALID_HANDLE_VALUE)
49 {
50 errno = EBADF;
51 return -1;
52 }
53 return fd;
54 }
55 /* Wine 1.0.1 return 0 when desired_fd is negative but not -1:
56 http://bugs.winehq.org/show_bug.cgi?id=21289 */
57 if (desired_fd < 0)
58 {
59 errno = EBADF;
60 return -1;
61 }
62# elif !defined __linux__
63 /* On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC. */
64 if (fd == desired_fd)
65 return fcntl (fd, F_GETFL) == -1 ? -1 : fd;
66# endif
67 result = dup2 (fd, desired_fd);
68# ifdef __linux__
69 /* Correct a Linux return value.
70 <http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.30.y.git;a=commitdiff;h=2b79bc4f7ebbd5af3c8b867968f9f15602d5f802>
71 */
72 if (fd == desired_fd && result == (unsigned int) -EBADF)
73 {
74 errno = EBADF;
75 result = -1;
76 }
77# endif
78 if (result == 0)
79 result = desired_fd;
80 /* Correct a cygwin 1.5.x errno value. */
81 else if (result == -1 && errno == EMFILE)
82 errno = EBADF;
83# if REPLACE_FCHDIR
84 if (fd != desired_fd && result != -1)
85 result = _gl_register_dup (fd, result);
86# endif
87 return result;
88}
89
90#else /* !HAVE_DUP2 */
91
92/* On older platforms, dup2 did not exist. */
93
94# ifndef F_DUPFD
95static int
96dupfd (int fd, int desired_fd)
97{
98 int duplicated_fd = dup (fd);
99 if (duplicated_fd < 0 || duplicated_fd == desired_fd)
100 return duplicated_fd;
101 else
102 {
103 int r = dupfd (fd, desired_fd);
104 int e = errno;
105 close (duplicated_fd);
106 errno = e;
107 return r;
108 }
109}
110# endif
111
112int
113dup2 (int fd, int desired_fd)
114{
115 int result = fcntl (fd, F_GETFL) < 0 ? -1 : fd;
116 if (result == -1 || fd == desired_fd)
117 return result;
118 close (desired_fd);
119# ifdef F_DUPFD
120 result = fcntl (fd, F_DUPFD, desired_fd);
121# if REPLACE_FCHDIR
122 if (0 <= result)
123 result = _gl_register_dup (fd, result);
124# endif
125# else
126 result = dupfd (fd, desired_fd);
127# endif
128 if (result == -1 && (errno == EMFILE || errno == EINVAL))
129 errno = EBADF;
130 return result;
131}
132#endif /* !HAVE_DUP2 */
diff --git a/lib/getopt.c b/lib/getopt.c
index 23510d8afec..2af8352ee9c 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -829,7 +829,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
829 return '?'; 829 return '?';
830 } 830 }
831 /* Convenience. Treat POSIX -W foo same as long option --foo */ 831 /* Convenience. Treat POSIX -W foo same as long option --foo */
832 if (temp[0] == 'W' && temp[1] == ';') 832 if (temp[0] == 'W' && temp[1] == ';' && longopts)
833 { 833 {
834 char *nameend; 834 char *nameend;
835 const struct option *p; 835 const struct option *p;
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index 0fd7f520acb..18abe4536fa 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -9,7 +9,7 @@
9# the same distribution terms as the rest of that program. 9# the same distribution terms as the rest of that program.
10# 10#
11# Generated by gnulib-tool. 11# Generated by gnulib-tool.
12# 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 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat 12# 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
13 13
14 14
15MOSTLYCLEANFILES += core *.stackdump 15MOSTLYCLEANFILES += core *.stackdump
@@ -159,6 +159,15 @@ EXTRA_libgnu_a_SOURCES += ftoastr.c
159 159
160## end gnulib module dtoastr 160## end gnulib module dtoastr
161 161
162## begin gnulib module dup2
163
164
165EXTRA_DIST += dup2.c
166
167EXTRA_libgnu_a_SOURCES += dup2.c
168
169## end gnulib module dup2
170
162## begin gnulib module filemode 171## begin gnulib module filemode
163 172
164libgnu_a_SOURCES += filemode.c 173libgnu_a_SOURCES += filemode.c
diff --git a/lib/stat.c b/lib/stat.c
index cbc9100fd4d..f07370dd06b 100644
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -38,6 +38,7 @@ orig_stat (const char *filename, struct stat *buf)
38#include <stdbool.h> 38#include <stdbool.h>
39#include <string.h> 39#include <string.h>
40#include "dosname.h" 40#include "dosname.h"
41#include "verify.h"
41 42
42/* Store information about NAME into ST. Work around bugs with 43/* Store information about NAME into ST. Work around bugs with
43 trailing slashes. Mingw has other bugs (such as st_ino always 44 trailing slashes. Mingw has other bugs (such as st_ino always
@@ -63,6 +64,12 @@ rpl_stat (char const *name, struct stat *st)
63 } 64 }
64#endif /* REPLACE_FUNC_STAT_FILE */ 65#endif /* REPLACE_FUNC_STAT_FILE */
65#if REPLACE_FUNC_STAT_DIR 66#if REPLACE_FUNC_STAT_DIR
67 /* The only known systems where REPLACE_FUNC_STAT_DIR is needed also
68 have a constant PATH_MAX. */
69# ifndef PATH_MAX
70# error "Please port this replacement to your platform"
71# endif
72
66 if (result == -1 && errno == ENOENT) 73 if (result == -1 && errno == ENOENT)
67 { 74 {
68 /* Due to mingw's oddities, there are some directories (like 75 /* Due to mingw's oddities, there are some directories (like
@@ -77,6 +84,7 @@ rpl_stat (char const *name, struct stat *st)
77 char fixed_name[PATH_MAX + 1] = {0}; 84 char fixed_name[PATH_MAX + 1] = {0};
78 size_t len = strlen (name); 85 size_t len = strlen (name);
79 bool check_dir = false; 86 bool check_dir = false;
87 verify (PATH_MAX <= 4096);
80 if (PATH_MAX <= len) 88 if (PATH_MAX <= len)
81 errno = ENAMETOOLONG; 89 errno = ENAMETOOLONG;
82 else if (len) 90 else if (len)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 66336413e27..f9f47e6a52b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,100 @@
12011-06-25 Glenn Morris <rgm@gnu.org>
2
3 * progmodes/f90.el (f90-keywords-re, f90-procedures-re)
4 (f90-constants-re): Add some F2008 stuff.
5
62011-06-25 Eli Zaretskii <eliz@gnu.org>
7
8 * net/ange-ftp.el (ange-ftp-insert-file-contents): Let-bind
9 buffer-file-type before setting its value, to avoid disastrous
10 global effects on decoding files for DOS/Windows systems. (Bug#8780)
11
122011-06-25 Juanma Barranquero <lekktu@gmail.com>
13
14 * allout.el (allout-unload-function): Pass -1 to `allout-mode'.
15
16 * ses.el (ses-unload-function):
17 * emacs-lisp/re-builder.el (re-builder-unload-function): Simplify.
18
19 * proced.el (proced-unload-function):
20 * progmodes/cperl-mode.el (cperl-mode-unload-function): Remove.
21
222011-06-25 Andreas Rottmann <a.rottmann@gmx.at>
23
24 * server.el (server-create-window-system-frame): Add parameters arg.
25 (server-process-filter): Doc fix. Handle frame-parameters.
26
272011-06-25 Juanma Barranquero <lekktu@gmail.com>
28
29 Fix bug#8730, bug#8781.
30
31 * loadhist.el (unload--set-major-mode): New function.
32 (unload-feature): Use it.
33
34 * progmodes/python.el (python-after-info-look): Add autoload cookie.
35 (python-unload-function): New function.
36
372011-06-25 Stefan Monnier <monnier@iro.umontreal.ca>
38
39 * mail/rmail.el (rmail-show-message-1): Use restore-buffer-modified-p.
40
412011-06-25 Giuseppe Scrivano <gscrivano@gnu.org>
42
43 * net/browse-url.el (browse-url-firefox-program): Add icecat to
44 the candidates list.
45
462011-06-24 Juanma Barranquero <lekktu@gmail.com>
47
48 * progmodes/verilog-mode.el (verilog-mode): Fix test for bound variable.
49
502011-06-23 Richard Stallman <rms@gnu.org>
51
52 * mail/rmail.el: Going to grep hit in Rmail buffer finds the message.
53 (rmail-variables): Set next-error-move-function.
54 (rmail-what-message): Take argument POS.
55 (rmail-next-error-move): New function.
56
572011-06-23 Stefan Monnier <monnier@iro.umontreal.ca>
58
59 * emacs-lisp/smie.el (smie-bnf->prec2): Give more understandable error
60 messages for adjacent non-terminals.
61
622011-06-23 Richard Stallman <rms@gnu.org>
63
64 * mail/rmail.el (rmail-retry-ignored-headers): Add message-id.
65 (rmail-show-message-1): Preserve buffer modified flag.
66 (rmail-start-mail): Don't specify use of rmail-mail-return;
67 that's done by mail-bury now.
68 (rmail-mail-return): Handle arg NEWBUF.
69
702011-06-23 Michael Albinus <michael.albinus@gmx.de>
71
72 * net/tramp-sh.el (tramp-method-out-of-band-p): Check, whether
73 SIZE is a number.
74
752011-06-23 Martin Rudalics <rudalics@gmx.at>
76
77 * window.el (get-lru-window, get-mru-window)
78 (get-largest-window): Never return a minibuffer window.
79 (display-buffer-pop-up-window): Fix a bug that could lead to
80 reusing the minibuffer window.
81 (display-buffer): Pass original specifier argument to
82 display-buffer-function instead of the normalized one.
83 Reported by Thierry Volpiatto <thierry.volpiatto@gmail.com>.
84
852011-06-22 Leo Liu <sdl.web@gmail.com>
86
87 * minibuffer.el (completing-read-function)
88 (completing-read-default): Move from minibuf.c
89
902011-06-22 Richard Stallman <rms@gnu.org>
91
92 * mail/sendmail.el (mail-bury): If Rmail is in use, return nicely
93 to Rmail even if not started by a special Rmail command.
94
95 * mail/rmailmm.el (rmail-insert-mime-forwarded-message):
96 Copy the buffer currently showing just one message.
97
12011-06-22 Roland Winkler <winkler@gnu.org> 982011-06-22 Roland Winkler <winkler@gnu.org>
2 99
3 * textmodes/bibtex.el (bibtex-entry-update): Use mapc. 100 * textmodes/bibtex.el (bibtex-entry-update): Use mapc.
diff --git a/lisp/allout.el b/lisp/allout.el
index 8cdf24176b0..1d4d4a20e11 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -2085,7 +2085,7 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be."
2085 (save-current-buffer 2085 (save-current-buffer
2086 (dolist (buffer (buffer-list)) 2086 (dolist (buffer (buffer-list))
2087 (set-buffer buffer) 2087 (set-buffer buffer)
2088 (when (allout-mode-p) (allout-mode)))) 2088 (when (allout-mode-p) (allout-mode -1))))
2089 ;; continue standard unloading 2089 ;; continue standard unloading
2090 nil) 2090 nil)
2091 2091
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 5ce18d020c9..ebbd6ff1fdf 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -714,8 +714,7 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
714 (remove-hook 'after-change-functions 'reb-auto-update t) 714 (remove-hook 'after-change-functions 'reb-auto-update t)
715 (remove-hook 'kill-buffer-hook 'reb-kill-buffer t) 715 (remove-hook 'kill-buffer-hook 'reb-kill-buffer t)
716 (when (reb-mode-buffer-p) 716 (when (reb-mode-buffer-p)
717 (reb-delete-overlays) 717 (reb-delete-overlays))))
718 (funcall (or (default-value 'major-mode) 'fundamental-mode)))))
719 ;; continue standard unloading 718 ;; continue standard unloading
720 nil) 719 nil)
721 720
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 17cc5668b5f..0206abb9f53 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -229,14 +229,18 @@ one of those elements share the same precedence level and associativity."
229 ;; the trouble, and it lets the writer of the BNF 229 ;; the trouble, and it lets the writer of the BNF
230 ;; be a bit more sloppy by skipping uninteresting base 230 ;; be a bit more sloppy by skipping uninteresting base
231 ;; cases which are terminals but not OPs. 231 ;; cases which are terminals but not OPs.
232 (assert (not (member (cadr rhs) nts))) 232 (when (member (cadr rhs) nts)
233 (error "Adjacent non-terminals: %s %s"
234 (car rhs) (cadr rhs)))
233 (pushnew (cadr rhs) first-ops))) 235 (pushnew (cadr rhs) first-ops)))
234 (let ((shr (reverse rhs))) 236 (let ((shr (reverse rhs)))
235 (if (not (member (car shr) nts)) 237 (if (not (member (car shr) nts))
236 (pushnew (car shr) last-ops) 238 (pushnew (car shr) last-ops)
237 (pushnew (car shr) last-nts) 239 (pushnew (car shr) last-nts)
238 (when (consp (cdr shr)) 240 (when (consp (cdr shr))
239 (assert (not (member (cadr shr) nts))) 241 (when (member (cadr rhs) nts)
242 (error "Adjacent non-terminals: %s %s"
243 (cadr rhs) (car rhs)))
240 (pushnew (cadr shr) last-ops))))) 244 (pushnew (cadr shr) last-ops)))))
241 (push (cons nt first-ops) first-ops-table) 245 (push (cons nt first-ops) first-ops-table)
242 (push (cons nt last-ops) last-ops-table) 246 (push (cons nt last-ops) last-ops-table)
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index f1c0b2d1c65..3d9b0c8646f 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,12 @@
12011-06-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * erc.el (erc-ssl): Made into a synonym for erc-tls, which
4 provides a superset of the same functionality.
5 (erc-open-ssl-stream): Removed.
6 (erc-open-tls-stream): Use `open-network-stream' instead of
7 `open-tls-stream' directly to be able to use the built-in TLS
8 support.
9
12011-05-28 Stefan Monnier <monnier@iro.umontreal.ca> 102011-05-28 Stefan Monnier <monnier@iro.umontreal.ca>
2 11
3 * erc-pcomplete.el (erc-pcompletions-at-point): Mark the completion 12 * erc-pcomplete.el (erc-pcompletions-at-point): Mark the completion
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index a8c592696ad..36097cf0c12 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2164,34 +2164,7 @@ be invoked for the values of the other parameters."
2164 2164
2165;;;###autoload 2165;;;###autoload
2166(defalias 'erc-select 'erc) 2166(defalias 'erc-select 'erc)
2167 2167(defalias 'erc-ssl 'erc-tls)
2168(defun erc-ssl (&rest r)
2169 "Interactively select SSL connection parameters and run ERC.
2170Arguments are the same as for `erc'."
2171 (interactive (erc-select-read-args))
2172 (let ((erc-server-connect-function 'erc-open-ssl-stream))
2173 (apply 'erc r)))
2174
2175(defalias 'erc-select-ssl 'erc-ssl)
2176
2177(declare-function open-ssl-stream "ext:ssl" (name buffer host service))
2178
2179(defun erc-open-ssl-stream (name buffer host port)
2180 "Open an SSL stream to an IRC server.
2181The process will be given the name NAME, its target buffer will be
2182BUFFER. HOST and PORT specify the connection target."
2183 (when (condition-case nil
2184 (require 'ssl)
2185 (error (message "You don't have ssl.el. %s"
2186 "Try using `erc-tls' instead.")
2187 nil))
2188 (let ((proc (open-ssl-stream name buffer host port)))
2189 ;; Ugly hack, but it works for now. Problem is it is
2190 ;; very hard to detect when ssl is established, because s_client
2191 ;; doesn't give any CONNECTIONESTABLISHED kind of message, and
2192 ;; most IRC servers send nothing and wait for you to identify.
2193 (sit-for 5)
2194 proc)))
2195 2168
2196(defun erc-tls (&rest r) 2169(defun erc-tls (&rest r)
2197 "Interactively select TLS connection parameters and run ERC. 2170 "Interactively select TLS connection parameters and run ERC.
@@ -2200,18 +2173,12 @@ Arguments are the same as for `erc'."
2200 (let ((erc-server-connect-function 'erc-open-tls-stream)) 2173 (let ((erc-server-connect-function 'erc-open-tls-stream))
2201 (apply 'erc r))) 2174 (apply 'erc r)))
2202 2175
2203(declare-function open-tls-stream "tls" (name buffer host port))
2204
2205(defun erc-open-tls-stream (name buffer host port) 2176(defun erc-open-tls-stream (name buffer host port)
2206 "Open an TLS stream to an IRC server. 2177 "Open an TLS stream to an IRC server.
2207The process will be given the name NAME, its target buffer will be 2178The process will be given the name NAME, its target buffer will be
2208BUFFER. HOST and PORT specify the connection target." 2179BUFFER. HOST and PORT specify the connection target."
2209 (when (condition-case nil 2180 (open-network-stream name buffer host port
2210 (require 'tls) 2181 :type 'tls))
2211 (error (message "You don't have tls.el. %s"
2212 "Try using `erc-ssl' instead.")
2213 nil))
2214 (open-tls-stream name buffer host port)))
2215 2182
2216;;; Displaying error messages 2183;;; Displaying error messages
2217 2184
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 5a6ad584438..e08d52ddbde 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,14 @@
12011-06-23 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * auth-source.el (auth-source-netrc-cache): Move forward.
4
52011-06-22 Lars Magne Ingebrigtsen <larsi@gnus.org>
6
7 * auth-source.el (auth-source-netrc-create): Don't query the bits that
8 we already know.
9 (auth-source-forget-all-cached): Clear auth-source-netrc-cache, too.
10 (auth-source-netrc-create): Don't prompt for the stuff we already know.
11
12011-06-21 Lars Magne Ingebrigtsen <larsi@gnus.org> 122011-06-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 13
3 * auth-source.el (auth-source-netrc-create): Don't print all tokens in 14 * auth-source.el (auth-source-netrc-create): Don't print all tokens in
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index 6fe033fea79..66497cd9a0c 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -705,6 +705,8 @@ Returns the deleted entries."
705 (equal collection value) 705 (equal collection value)
706 (member value collection))) 706 (member value collection)))
707 707
708(defvar auth-source-netrc-cache nil)
709
708(defun auth-source-forget-all-cached () 710(defun auth-source-forget-all-cached ()
709 "Forget all cached auth-source data." 711 "Forget all cached auth-source data."
710 (interactive) 712 (interactive)
@@ -816,8 +818,6 @@ while \(:host t) would find all host entries."
816 818
817;;; Backend specific parsing: netrc/authinfo backend 819;;; Backend specific parsing: netrc/authinfo backend
818 820
819(defvar auth-source-netrc-cache nil)
820
821;;; (auth-source-netrc-parse "~/.authinfo.gpg") 821;;; (auth-source-netrc-parse "~/.authinfo.gpg")
822(defun* auth-source-netrc-parse (&rest 822(defun* auth-source-netrc-parse (&rest
823 spec 823 spec
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 1bbd76f345e..2cfc88987f6 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -420,9 +420,9 @@ textual parts.")
420 (nnimap-login (car credentials) (cadr credentials)))) 420 (nnimap-login (car credentials) (cadr credentials))))
421 (if (car login-result) 421 (if (car login-result)
422 (progn 422 (progn
423 ;; Save the credentials if a save function exists 423 ;; Save the credentials if a save function exists
424 ;; (such a function will only be passed if a new 424 ;; (such a function will only be passed if a new
425 ;; token was created). 425 ;; token was created).
426 (when (functionp (nth 2 credentials)) 426 (when (functionp (nth 2 credentials))
427 (funcall (nth 2 credentials))) 427 (funcall (nth 2 credentials)))
428 ;; See if CAPABILITY is set as part of login 428 ;; See if CAPABILITY is set as part of login
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 8e00c33cd81..943eac42b02 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -143,6 +143,19 @@ documentation of `unload-feature' for details.")
143(define-obsolete-variable-alias 'unload-hook-features-list 143(define-obsolete-variable-alias 'unload-hook-features-list
144 'unload-function-defs-list "22.2") 144 'unload-function-defs-list "22.2")
145 145
146(defun unload--set-major-mode ()
147 (save-current-buffer
148 (dolist (buffer (buffer-list))
149 (set-buffer buffer)
150 (let ((proposed major-mode))
151 ;; Look for an antecessor mode not defined in the feature we're processing
152 (while (and proposed (rassq proposed unload-function-defs-list))
153 (setq proposed (get proposed 'derived-mode-parent)))
154 (unless (eq proposed major-mode)
155 ;; Two cases: either proposed is nil, and we want to switch to fundamental
156 ;; mode, or proposed is not nil and not major-mode, and so we use it.
157 (funcall (or proposed 'fundamental-mode)))))))
158
146;;;###autoload 159;;;###autoload
147(defun unload-feature (feature &optional force) 160(defun unload-feature (feature &optional force)
148 "Unload the library that provided FEATURE. 161 "Unload the library that provided FEATURE.
@@ -222,6 +235,10 @@ something strange, such as redefining an Emacs function."
222 (not (get (cdr y) 'autoload))) 235 (not (get (cdr y) 'autoload)))
223 (setq auto-mode-alist 236 (setq auto-mode-alist
224 (rassq-delete-all (cdr y) auto-mode-alist))))) 237 (rassq-delete-all (cdr y) auto-mode-alist)))))
238
239 ;; Change major mode in all buffers using one defined in the feature being unloaded.
240 (unload--set-major-mode)
241
225 (when (fboundp 'elp-restore-function) ; remove ELP stuff first 242 (when (fboundp 'elp-restore-function) ; remove ELP stuff first
226 (dolist (elt unload-function-defs-list) 243 (dolist (elt unload-function-defs-list)
227 (when (symbolp elt) 244 (when (symbolp elt)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 200aadda651..640f1dfff29 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -349,7 +349,7 @@ If nil, display all header fields except those matched by
349 :group 'rmail-headers) 349 :group 'rmail-headers)
350 350
351;;;###autoload 351;;;###autoload
352(defcustom rmail-retry-ignored-headers (purecopy "^x-authentication-warning:\\|^x-detected-operating-system:\\|^x-spam[-a-z]*:\\|content-type:\\|content-transfer-encoding:\\|mime-version:") 352(defcustom rmail-retry-ignored-headers (purecopy "^x-authentication-warning:\\|^x-detected-operating-system:\\|^x-spam[-a-z]*:\\|content-type:\\|content-transfer-encoding:\\|mime-version:\\|message-id:")
353 "Headers that should be stripped when retrying a failed message." 353 "Headers that should be stripped when retrying a failed message."
354 :type '(choice regexp (const nil :tag "None")) 354 :type '(choice regexp (const nil :tag "None"))
355 :group 'rmail-headers 355 :group 'rmail-headers
@@ -1444,7 +1444,8 @@ If so restore the actual mbox message collection."
1444 (make-local-variable 'file-precious-flag) 1444 (make-local-variable 'file-precious-flag)
1445 (setq file-precious-flag t) 1445 (setq file-precious-flag t)
1446 (make-local-variable 'desktop-save-buffer) 1446 (make-local-variable 'desktop-save-buffer)
1447 (setq desktop-save-buffer t)) 1447 (setq desktop-save-buffer t)
1448 (setq next-error-move-function 'rmail-next-error-move))
1448 1449
1449;; Handle M-x revert-buffer done in an rmail-mode buffer. 1450;; Handle M-x revert-buffer done in an rmail-mode buffer.
1450(defun rmail-revert (arg noconfirm) 1451(defun rmail-revert (arg noconfirm)
@@ -2669,8 +2670,11 @@ The current mail message becomes the message displayed."
2669 (t (setq rmail-current-message msg))) 2670 (t (setq rmail-current-message msg)))
2670 (with-current-buffer rmail-buffer 2671 (with-current-buffer rmail-buffer
2671 (setq header-style rmail-header-style) 2672 (setq header-style rmail-header-style)
2672 ;; Mark the message as seen 2673 ;; Mark the message as seen, but preserve buffer modified flag.
2673 (rmail-set-attribute rmail-unseen-attr-index nil) 2674 (let ((modiff (buffer-modified-p)))
2675 (rmail-set-attribute rmail-unseen-attr-index nil)
2676 (unless modiff
2677 (restore-buffer-modified-p modiff)))
2674 ;; bracket the message in the mail 2678 ;; bracket the message in the mail
2675 ;; buffer and determine the coding system the transfer encoding. 2679 ;; buffer and determine the coding system the transfer encoding.
2676 (rmail-swap-buffers-maybe) 2680 (rmail-swap-buffers-maybe)
@@ -3016,15 +3020,73 @@ or forward if N is negative."
3016 (rmail-maybe-set-message-counters) 3020 (rmail-maybe-set-message-counters)
3017 (rmail-show-message rmail-total-messages)) 3021 (rmail-show-message rmail-total-messages))
3018 3022
3019(defun rmail-what-message () 3023(defun rmail-next-error-move (msg-pos bad-marker)
3020 "For debugging Rmail: find the message number that point is in." 3024 "Move to an error locus (probably grep hit) in an Rmail buffer.
3025MSG-POS is a marker pointing at the error message in the grep buffer.
3026BAD-MARKER is a marker that ought to point at where to move to,
3027but probably is garbage."
3028 (let* ((message (car (get-text-property msg-pos 'message (marker-buffer msg-pos))))
3029 (column (car message))
3030 (linenum (cadr message))
3031 pos
3032 msgnum msgbeg msgend
3033 header-field
3034 line-number-within)
3035
3036 ;; Look at the whole Rmail file.
3037 (rmail-swap-buffers-maybe)
3038
3039 (save-restriction
3040 (widen)
3041 (save-excursion
3042 ;; Find the line that the error message points at.
3043 (goto-char (point-min))
3044 (forward-line linenum)
3045 (setq pos (point))
3046
3047 ;; Find which message that's in,
3048 ;; and the limits of that message.
3049 (setq msgnum (rmail-what-message pos))
3050 (setq msgbeg (rmail-msgbeg msgnum))
3051 (setq msgend (rmail-msgend msgnum))
3052
3053 ;; Find which header this locus is in,
3054 ;; or if it's in the message body,
3055 ;; and the line-based position within that.
3056 (goto-char msgbeg)
3057 (let ((header-end msgend))
3058 (if (search-forward "\n\n" nil t)
3059 (setq header-end (point)))
3060 (if (>= pos header-end)
3061 (setq line-number-within
3062 (count-lines header-end pos))
3063 (goto-char pos)
3064 (unless (looking-at "^[^ \t]")
3065 (re-search-backward "^[^ \t]"))
3066 (looking-at "[^:\n]*[:\n]")
3067 (setq header-field (match-string 0)
3068 line-number-within (count-lines (point) pos))))))
3069
3070 ;; Display the right message.
3071 (rmail-show-message msgnum)
3072
3073 ;; Move to the right position within the displayed message.
3074 (if header-field
3075 (re-search-forward (concat "^" (regexp-quote header-field)) nil t)
3076 (search-forward "\n\n" nil t))
3077 (forward-line line-number-within)
3078 (forward-char column)))
3079
3080(defun rmail-what-message (&optional pos)
3081 "Return message number POS (or point) is in."
3021 (let* ((high rmail-total-messages) 3082 (let* ((high rmail-total-messages)
3022 (mid (/ high 2)) 3083 (mid (/ high 2))
3023 (low 1) 3084 (low 1)
3024 (where (with-current-buffer (if (rmail-buffers-swapped-p) 3085 (where (or pos
3025 rmail-view-buffer 3086 (with-current-buffer (if (rmail-buffers-swapped-p)
3026 (current-buffer)) 3087 rmail-view-buffer
3027 (point)))) 3088 (current-buffer))
3089 (point)))))
3028 (while (> (- high low) 1) 3090 (while (> (- high low) 1)
3029 (if (>= where (rmail-msgbeg mid)) 3091 (if (>= where (rmail-msgbeg mid))
3030 (setq low mid) 3092 (setq low mid)
@@ -3455,15 +3517,15 @@ does not pop any summary buffer."
3455 (if (stringp subject) (setq subject (rfc2047-decode-string subject))) 3517 (if (stringp subject) (setq subject (rfc2047-decode-string subject)))
3456 (prog1 3518 (prog1
3457 (compose-mail to subject other-headers noerase 3519 (compose-mail to subject other-headers noerase
3458 switch-function yank-action sendactions 3520 switch-function yank-action sendactions)
3459 '(rmail-mail-return))
3460 (if (eq switch-function 'switch-to-buffer-other-frame) 3521 (if (eq switch-function 'switch-to-buffer-other-frame)
3461 ;; This is not a standard frame parameter; nothing except 3522 ;; This is not a standard frame parameter; nothing except
3462 ;; sendmail.el looks at it. 3523 ;; sendmail.el looks at it.
3463 (modify-frame-parameters (selected-frame) 3524 (modify-frame-parameters (selected-frame)
3464 '((mail-dedicated-frame . t))))))) 3525 '((mail-dedicated-frame . t)))))))
3465 3526
3466(defun rmail-mail-return () 3527(defun rmail-mail-return (&optional newbuf)
3528 "NEWBUF is a buffer to switch to."
3467 (cond 3529 (cond
3468 ;; If there is only one visible frame with no special handling, 3530 ;; If there is only one visible frame with no special handling,
3469 ;; consider deleting the mail window to return to Rmail. 3531 ;; consider deleting the mail window to return to Rmail.
@@ -3488,7 +3550,8 @@ does not pop any summary buffer."
3488 (if rmail-flag 3550 (if rmail-flag
3489 ;; If the Rmail buffer has a summary, show that. 3551 ;; If the Rmail buffer has a summary, show that.
3490 (if summary-buffer (switch-to-buffer summary-buffer) 3552 (if summary-buffer (switch-to-buffer summary-buffer)
3491 (delete-window))))) 3553 (delete-window))
3554 (switch-to-buffer newbuf))))
3492 ;; If the frame was probably made for this buffer, the user 3555 ;; If the frame was probably made for this buffer, the user
3493 ;; probably wants to delete it now. 3556 ;; probably wants to delete it now.
3494 ((display-multi-frame-p) 3557 ((display-multi-frame-p)
@@ -4316,7 +4379,7 @@ With prefix argument N moves forward N messages with these labels.
4316 4379
4317;;;*** 4380;;;***
4318 4381
4319;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "c530622b53038152ca84f2ec9313bd7a") 4382;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "5e3ff91cc650ca2c5c147dcf3397dfcf")
4320;;; Generated autoloads from rmailmm.el 4383;;; Generated autoloads from rmailmm.el
4321 4384
4322(autoload 'rmail-mime "rmailmm" "\ 4385(autoload 'rmail-mime "rmailmm" "\
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 96132739b20..a02d388a6f7 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -1333,12 +1333,16 @@ attachments as specfied by `rmail-mime-attachment-dirs-alist'."
1333(setq rmail-show-mime-function 'rmail-show-mime) 1333(setq rmail-show-mime-function 'rmail-show-mime)
1334 1334
1335(defun rmail-insert-mime-forwarded-message (forward-buffer) 1335(defun rmail-insert-mime-forwarded-message (forward-buffer)
1336 "Function to set in `rmail-insert-mime-forwarded-message-function' (which see)." 1336 "Insert the message in FORWARD-BUFFER as a forwarded message.
1337 (let ((rmail-mime-mbox-buffer 1337This is the usual value of `rmail-insert-mime-forwarded-message-function'."
1338 (with-current-buffer forward-buffer rmail-view-buffer))) 1338 (let ((message-buffer
1339 (with-current-buffer forward-buffer
1340 (if rmail-buffer-swapped
1341 forward-buffer
1342 rmail-view-buffer))))
1339 (save-restriction 1343 (save-restriction
1340 (narrow-to-region (point) (point)) 1344 (narrow-to-region (point) (point))
1341 (message-forward-make-body-mime rmail-mime-mbox-buffer)))) 1345 (message-forward-make-body-mime message-buffer))))
1342 1346
1343(setq rmail-insert-mime-forwarded-message-function 1347(setq rmail-insert-mime-forwarded-message-function
1344 'rmail-insert-mime-forwarded-message) 1348 'rmail-insert-mime-forwarded-message)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index f4ef9b91903..c1405ec5ff3 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -806,10 +806,18 @@ Prefix arg means don't delete this window."
806 806
807(defun mail-bury (&optional arg) 807(defun mail-bury (&optional arg)
808 "Bury this mail buffer." 808 "Bury this mail buffer."
809 (let ((newbuf (other-buffer (current-buffer)))) 809 (let ((newbuf (other-buffer (current-buffer)))
810 (return-action mail-return-action)
811 some-rmail)
810 (bury-buffer (current-buffer)) 812 (bury-buffer (current-buffer))
811 (if (and (null arg) mail-return-action) 813 ;; If there is an Rmail buffer, return to it nicely
812 (apply (car mail-return-action) (cdr mail-return-action)) 814 ;; even if this message was not started by an Rmail command.
815 (unless return-action
816 (dolist (buffer (buffer-list))
817 (if (eq (buffer-local-value 'major-mode buffer) 'rmail-mode)
818 (setq return-action `(rmail-mail-return ,newbuf)))))
819 (if (and (null arg) return-action)
820 (apply (car return-action) (cdr return-action))
813 (switch-to-buffer newbuf)))) 821 (switch-to-buffer newbuf))))
814 822
815(defcustom mail-send-hook nil 823(defcustom mail-send-hook nil
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index a7ffc8d061a..32ddfe99707 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2710,7 +2710,40 @@ filter out additional entries (because TABLE migth not obey PRED)."
2710 (let ((newstr (completion-initials-expand string table pred))) 2710 (let ((newstr (completion-initials-expand string table pred)))
2711 (when newstr 2711 (when newstr
2712 (completion-pcm-try-completion newstr table pred (length newstr))))) 2712 (completion-pcm-try-completion newstr table pred (length newstr)))))
2713 2713
2714(defvar completing-read-function 'completing-read-default
2715 "The function called by `completing-read' to do its work.
2716It should accept the same arguments as `completing-read'.")
2717
2718(defun completing-read-default (prompt collection &optional predicate
2719 require-match initial-input
2720 hist def inherit-input-method)
2721 "Default method for reading from the minibuffer with completion.
2722See `completing-read' for the meaning of the arguments."
2723
2724 (when (consp initial-input)
2725 (setq initial-input
2726 (cons (car initial-input)
2727 ;; `completing-read' uses 0-based index while
2728 ;; `read-from-minibuffer' uses 1-based index.
2729 (1+ (cdr initial-input)))))
2730
2731 (let* ((minibuffer-completion-table collection)
2732 (minibuffer-completion-predicate predicate)
2733 (minibuffer-completion-confirm (unless (eq require-match t)
2734 require-match))
2735 (keymap (if require-match
2736 (if (memq minibuffer-completing-file-name '(nil lambda))
2737 minibuffer-local-must-match-map
2738 minibuffer-local-filename-must-match-map)
2739 (if (memq minibuffer-completing-file-name '(nil lambda))
2740 minibuffer-local-completion-map
2741 minibuffer-local-filename-completion-map)))
2742 (result (read-from-minibuffer prompt initial-input keymap
2743 nil hist def inherit-input-method)))
2744 (when (and (equal result "") def)
2745 (setq result (if (consp def) (car def) def)))
2746 result))
2714 2747
2715;; Miscellaneous 2748;; Miscellaneous
2716 2749
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 0493ead7bbf..1282f86d503 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -3278,6 +3278,7 @@ system TYPE.")
3278 (name (ange-ftp-quote-string (nth 2 parsed))) 3278 (name (ange-ftp-quote-string (nth 2 parsed)))
3279 (temp (ange-ftp-make-tmp-name host)) 3279 (temp (ange-ftp-make-tmp-name host))
3280 (binary (ange-ftp-binary-file filename)) 3280 (binary (ange-ftp-binary-file filename))
3281 (buffer-file-type buffer-file-type)
3281 (abbr (ange-ftp-abbreviate-filename filename)) 3282 (abbr (ange-ftp-abbreviate-filename filename))
3282 (coding-system-used last-coding-system-used) 3283 (coding-system-used last-coding-system-used)
3283 size) 3284 size)
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index d9e6827d2df..ac12030471e 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -322,7 +322,7 @@ Defaults to the value of `browse-url-mozilla-arguments' at the time
322 :group 'browse-url) 322 :group 'browse-url)
323 323
324(defcustom browse-url-firefox-program 324(defcustom browse-url-firefox-program
325 (let ((candidates '("firefox" "iceweasel"))) 325 (let ((candidates '("firefox" "iceweasel" "icecat")))
326 (while (and candidates (not (executable-find (car candidates)))) 326 (while (and candidates (not (executable-find (car candidates))))
327 (setq candidates (cdr candidates))) 327 (setq candidates (cdr candidates)))
328 (or (car candidates) "firefox")) 328 (or (car candidates) "firefox"))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 025b4ab6cf3..e340ddc6cb0 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4661,6 +4661,8 @@ This is used internally by `tramp-file-mode-from-int'."
4661 (and 4661 (and
4662 ;; It shall be an out-of-band method. 4662 ;; It shall be an out-of-band method.
4663 (tramp-get-method-parameter (tramp-file-name-method vec) 'tramp-copy-program) 4663 (tramp-get-method-parameter (tramp-file-name-method vec) 'tramp-copy-program)
4664 ;; There must be a size, otherwise the file doesn't exist.
4665 (numberp size)
4664 ;; Either the file size is large enough, or (in rare cases) there 4666 ;; Either the file size is large enough, or (in rare cases) there
4665 ;; does not exist a remote encoding. 4667 ;; does not exist a remote encoding.
4666 (or (null tramp-copy-size-limit) 4668 (or (null tramp-copy-size-limit)
diff --git a/lisp/proced.el b/lisp/proced.el
index 4436129ce16..11598d7350f 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -1869,16 +1869,6 @@ buffer. You can use it to recover marks."
1869 (message "Change in Proced buffer undone. 1869 (message "Change in Proced buffer undone.
1870Killed processes cannot be recovered by Emacs.")) 1870Killed processes cannot be recovered by Emacs."))
1871 1871
1872(defun proced-unload-function ()
1873 "Unload the Proced library."
1874 (save-current-buffer
1875 (dolist (buf (buffer-list))
1876 (set-buffer buf)
1877 (when (eq major-mode 'proced-mode)
1878 (funcall (or (default-value 'major-mode) 'fundamental-mode)))))
1879 ;; continue standard unloading
1880 nil)
1881
1882(provide 'proced) 1872(provide 'proced)
1883 1873
1884;;; proced.el ends here 1874;;; proced.el ends here
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 2cce5e13fb0..8eb2d01c097 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -8971,18 +8971,6 @@ do extra unwind via `cperl-unwind-to-safe'."
8971 (substring v (match-beginning 1) (match-end 1))) 8971 (substring v (match-beginning 1) (match-end 1)))
8972 "Version of IZ-supported CPerl package this file is based on.") 8972 "Version of IZ-supported CPerl package this file is based on.")
8973 8973
8974(defun cperl-mode-unload-function ()
8975 "Unload the Cperl mode library."
8976 (let ((new-mode (if (eq (symbol-function 'perl-mode) 'cperl-mode)
8977 'fundamental-mode
8978 'perl-mode)))
8979 (dolist (buf (buffer-list))
8980 (with-current-buffer buf
8981 (when (eq major-mode 'cperl-mode)
8982 (funcall new-mode)))))
8983 ;; continue standard unloading
8984 nil)
8985
8986(provide 'cperl-mode) 8974(provide 'cperl-mode)
8987 8975
8988;;; cperl-mode.el ends here 8976;;; cperl-mode.el ends here
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 849b9c0c3f7..e5a62780ad6 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -310,6 +310,8 @@ The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil."
310 "deferred" "enum" "enumerator" "extends" "extends_type_of" 310 "deferred" "enum" "enumerator" "extends" "extends_type_of"
311 "final" "generic" "import" "non_intrinsic" "non_overridable" 311 "final" "generic" "import" "non_intrinsic" "non_overridable"
312 "nopass" "pass" "protected" "same_type_as" "value" "volatile" 312 "nopass" "pass" "protected" "same_type_as" "value" "volatile"
313 ;; F2008
314 "contiguous"
313 ) 'words) 315 ) 'words)
314 "Regexp used by the function `f90-change-keywords'.") 316 "Regexp used by the function `f90-change-keywords'.")
315 317
@@ -365,6 +367,18 @@ The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil."
365 ;; F2003 iso_c_binding intrinsic module. 367 ;; F2003 iso_c_binding intrinsic module.
366 "c_loc" "c_funloc" "c_associated" "c_f_pointer" 368 "c_loc" "c_funloc" "c_associated" "c_f_pointer"
367 "c_f_procpointer" 369 "c_f_procpointer"
370 ;; F2008.
371 "bge" "bgt" "ble" "blt" "dshiftl" "dshiftr" "leadz" "popcnt"
372 "poppar" "trailz" "maskl" "maskr" "shifta" "shiftl" "shiftr"
373 "merge_bits" "iall" "iany" "iparity" "storage_size"
374 "bessel_j0" "bessel_j1" "bessel_jn"
375 "bessel_y0" "bessel_y1" "bessel_yn"
376 "erf" "erfc" "erfc_scaled" "gamma" "hypot" "log_gamma"
377 "norm2" "parity" "findloc"
378 ;; F2008 iso_fortran_env module.
379 "compiler_options" "compiler_version"
380 ;; F2008 iso_c_binding module.
381 "c_sizeof"
368 ) t) 382 ) t)
369 ;; A left parenthesis to avoid highlighting non-procedures. 383 ;; A left parenthesis to avoid highlighting non-procedures.
370 "[ \t]*(") 384 "[ \t]*(")
@@ -427,6 +441,10 @@ The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil."
427 "ieee_exceptions" 441 "ieee_exceptions"
428 "ieee_arithmetic" 442 "ieee_arithmetic"
429 "ieee_features" 443 "ieee_features"
444 ;; F2008 iso_fortran_env constants.
445 "character_kinds" "int8" "int16" "int32" "int64"
446 "integer_kinds" "iostat_inquire_internal_unit"
447 "logical_kinds" "real_kinds" "real32" "real64" "real128"
430 ) 'words) 448 ) 'words)
431 "Regexp for Fortran intrinsic constants.") 449 "Regexp for Fortran intrinsic constants.")
432 450
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 3d243f14f07..4d2f15c69d8 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1868,6 +1868,7 @@ instance. Assumes an inferior Python is running."
1868 1868
1869(declare-function info-lookup-maybe-add-help "info-look" (&rest arg)) 1869(declare-function info-lookup-maybe-add-help "info-look" (&rest arg))
1870 1870
1871;;;###autoload
1871(defun python-after-info-look () 1872(defun python-after-info-look ()
1872 "Set up info-look for Python. 1873 "Set up info-look for Python.
1873Used with `eval-after-load'." 1874Used with `eval-after-load'."
@@ -2731,6 +2732,16 @@ comint believe the user typed this string so that
2731(defun python-sentinel (_proc _msg) 2732(defun python-sentinel (_proc _msg)
2732 (setq overlay-arrow-position nil)) 2733 (setq overlay-arrow-position nil))
2733 2734
2735(defun python-unload-function ()
2736 "Unload the Python library."
2737 (remove-hook 'comint-output-filter-functions 'python-pdbtrack-track-stack-file)
2738 (setq minor-mode-alist (assq-delete-all 'python-pdbtrack-is-tracking-p
2739 minor-mode-alist))
2740 (dolist (error '("^No symbol" "^Can't shift all lines enough"))
2741 (setq debug-ignored-errors (delete error debug-ignored-errors)))
2742 ;; continue standard unloading
2743 nil)
2744
2734(provide 'python) 2745(provide 'python)
2735(provide 'python-21) 2746(provide 'python-21)
2736 2747
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index eab34f6f026..f7cb1318dc0 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -3110,7 +3110,7 @@ Key bindings specific to `verilog-mode-map' are:
3110 #'verilog-indent-line-relative) 3110 #'verilog-indent-line-relative)
3111 (setq comment-indent-function 'verilog-comment-indent) 3111 (setq comment-indent-function 'verilog-comment-indent)
3112 (set (make-local-variable 'parse-sexp-ignore-comments) nil) 3112 (set (make-local-variable 'parse-sexp-ignore-comments) nil)
3113 3113
3114 (set (make-local-variable 'comment-start) "// ") 3114 (set (make-local-variable 'comment-start) "// ")
3115 (set (make-local-variable 'comment-end) "") 3115 (set (make-local-variable 'comment-end) "")
3116 (set (make-local-variable 'comment-start-skip) "/\\*+ *\\|// *") 3116 (set (make-local-variable 'comment-start-skip) "/\\*+ *\\|// *")
@@ -3157,7 +3157,7 @@ Key bindings specific to `verilog-mode-map' are:
3157 (set (make-local-variable 'imenu-generic-expression) 3157 (set (make-local-variable 'imenu-generic-expression)
3158 verilog-imenu-generic-expression) 3158 verilog-imenu-generic-expression)
3159 ;; Tell which-func-modes that imenu knows about verilog 3159 ;; Tell which-func-modes that imenu knows about verilog
3160 (when (boundp 'which-function-modes) 3160 (when (boundp 'which-func-modes)
3161 (add-to-list 'which-func-modes 'verilog-mode)) 3161 (add-to-list 'which-func-modes 'verilog-mode))
3162 ;; hideshow support 3162 ;; hideshow support
3163 (when (boundp 'hs-special-modes-alist) 3163 (when (boundp 'hs-special-modes-alist)
diff --git a/lisp/server.el b/lisp/server.el
index 04d35695c57..42da7a210c5 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -736,7 +736,8 @@ Server mode runs a process that accepts commands from the
736 736
737 frame)) 737 frame))
738 738
739(defun server-create-window-system-frame (display nowait proc parent-id) 739(defun server-create-window-system-frame (display nowait proc parent-id
740 &optional parameters)
740 (add-to-list 'frame-inherited-parameters 'client) 741 (add-to-list 'frame-inherited-parameters 'client)
741 (if (not (fboundp 'make-frame-on-display)) 742 (if (not (fboundp 'make-frame-on-display))
742 (progn 743 (progn
@@ -751,7 +752,8 @@ Server mode runs a process that accepts commands from the
751 ;; killing emacs on that frame. 752 ;; killing emacs on that frame.
752 (let* ((params `((client . ,(if nowait 'nowait proc)) 753 (let* ((params `((client . ,(if nowait 'nowait proc))
753 ;; This is a leftover, see above. 754 ;; This is a leftover, see above.
754 (environment . ,(process-get proc 'env)))) 755 (environment . ,(process-get proc 'env))
756 ,@parameters))
755 (display (or display 757 (display (or display
756 (frame-parameter nil 'display) 758 (frame-parameter nil 'display)
757 (getenv "DISPLAY") 759 (getenv "DISPLAY")
@@ -832,6 +834,9 @@ The following commands are accepted by the server:
832`-current-frame' 834`-current-frame'
833 Forbid the creation of new frames. 835 Forbid the creation of new frames.
834 836
837`-frame-parameters ALIST'
838 Set the parameters of the created frame.
839
835`-nowait' 840`-nowait'
836 Request that the next frame created should not be 841 Request that the next frame created should not be
837 associated with this client. 842 associated with this client.
@@ -940,6 +945,7 @@ The following commands are accepted by the client:
940 commands 945 commands
941 dir 946 dir
942 use-current-frame 947 use-current-frame
948 frame-parameters ;parameters for newly created frame
943 tty-name ; nil, `window-system', or the tty name. 949 tty-name ; nil, `window-system', or the tty name.
944 tty-type ; string. 950 tty-type ; string.
945 files 951 files
@@ -960,6 +966,13 @@ The following commands are accepted by the client:
960 ;; -current-frame: Don't create frames. 966 ;; -current-frame: Don't create frames.
961 (`"-current-frame" (setq use-current-frame t)) 967 (`"-current-frame" (setq use-current-frame t))
962 968
969 ;; -frame-parameters: Set frame parameters
970 (`"-frame-parameters"
971 (let ((alist (pop args-left)))
972 (if coding-system
973 (setq alist (decode-coding-string alist coding-system)))
974 (setq frame-parameters (car (read-from-string alist)))))
975
963 ;; -display DISPLAY: 976 ;; -display DISPLAY:
964 ;; Open X frames on the given display instead of the default. 977 ;; Open X frames on the given display instead of the default.
965 (`"-display" 978 (`"-display"
@@ -1075,7 +1088,8 @@ The following commands are accepted by the client:
1075 (if display (server-select-display display))) 1088 (if display (server-select-display display)))
1076 ((eq tty-name 'window-system) 1089 ((eq tty-name 'window-system)
1077 (server-create-window-system-frame display nowait proc 1090 (server-create-window-system-frame display nowait proc
1078 parent-id)) 1091 parent-id
1092 frame-parameters))
1079 ;; When resuming on a tty, tty-name is nil. 1093 ;; When resuming on a tty, tty-name is nil.
1080 (tty-name 1094 (tty-name
1081 (server-create-tty-frame tty-name tty-type proc)))) 1095 (server-create-tty-frame tty-name tty-type proc))))
diff --git a/lisp/ses.el b/lisp/ses.el
index 2fc85d27df9..b52d3e23c73 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -3006,11 +3006,6 @@ current column and continues until the next nonblank column."
3006 (dolist (fun '(copy-region-as-kill yank)) 3006 (dolist (fun '(copy-region-as-kill yank))
3007 (ad-remove-advice fun 'around (intern (concat "ses-" (symbol-name fun)))) 3007 (ad-remove-advice fun 'around (intern (concat "ses-" (symbol-name fun))))
3008 (ad-update fun)) 3008 (ad-update fun))
3009 (save-current-buffer
3010 (dolist (buf (buffer-list))
3011 (set-buffer buf)
3012 (when (eq major-mode 'ses-mode)
3013 (funcall (or (default-value 'major-mode) 'fundamental-mode)))))
3014 ;; continue standard unloading 3009 ;; continue standard unloading
3015 nil) 3010 nil)
3016 3011
diff --git a/lisp/window.el b/lisp/window.el
index ac43fe7703c..e8278bb9986 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1231,7 +1231,7 @@ have special meanings:
1231Any other value of ALL-FRAMES means consider all windows on the 1231Any other value of ALL-FRAMES means consider all windows on the
1232selected frame and no others." 1232selected frame and no others."
1233 (let (best-window best-time second-best-window second-best-time time) 1233 (let (best-window best-time second-best-window second-best-time time)
1234 (dolist (window (window-list-1 nil nil all-frames)) 1234 (dolist (window (window-list-1 nil 'nomini all-frames))
1235 (when (or dedicated (not (window-dedicated-p window))) 1235 (when (or dedicated (not (window-dedicated-p window)))
1236 (setq time (window-use-time window)) 1236 (setq time (window-use-time window))
1237 (if (or (eq window (selected-window)) 1237 (if (or (eq window (selected-window))
@@ -1264,7 +1264,7 @@ have special meanings:
1264Any other value of ALL-FRAMES means consider all windows on the 1264Any other value of ALL-FRAMES means consider all windows on the
1265selected frame and no others." 1265selected frame and no others."
1266 (let (best-window best-time time) 1266 (let (best-window best-time time)
1267 (dolist (window (window-list-1 nil nil all-frames)) 1267 (dolist (window (window-list-1 nil 'nomini all-frames))
1268 (setq time (window-use-time window)) 1268 (setq time (window-use-time window))
1269 (when (or (not best-time) (> time best-time)) 1269 (when (or (not best-time) (> time best-time))
1270 (setq best-time time) 1270 (setq best-time time)
@@ -1294,7 +1294,7 @@ Any other value of ALL-FRAMES means consider all windows on the
1294selected frame and no others." 1294selected frame and no others."
1295 (let ((best-size 0) 1295 (let ((best-size 0)
1296 best-window size) 1296 best-window size)
1297 (dolist (window (window-list-1 nil nil all-frames)) 1297 (dolist (window (window-list-1 nil 'nomini all-frames))
1298 (when (or dedicated (not (window-dedicated-p window))) 1298 (when (or dedicated (not (window-dedicated-p window)))
1299 (setq size (* (window-total-size window) 1299 (setq size (* (window-total-size window)
1300 (window-total-size window t))) 1300 (window-total-size window t)))
@@ -5012,65 +5012,69 @@ specifiers, see the doc-string of `display-buffer-alist' for a
5012description." 5012description."
5013 (let* ((frame (display-buffer-frame)) 5013 (let* ((frame (display-buffer-frame))
5014 (selected-window (frame-selected-window frame)) 5014 (selected-window (frame-selected-window frame))
5015 window side atomic) 5015 cand window side atomic)
5016 (unless (and (cdr (assq 'unsplittable (frame-parameters frame))) 5016 (unless (and (cdr (assq 'unsplittable (frame-parameters frame)))
5017 ;; Don't split an unsplittable frame unless 5017 ;; Don't split an unsplittable frame unless
5018 ;; SPECIFIERS allow it. 5018 ;; SPECIFIERS allow it.
5019 (not (cdr (assq 'split-unsplittable-frame specifiers)))) 5019 (not (cdr (assq 'split-unsplittable-frame specifiers))))
5020 (catch 'done 5020 (catch 'done
5021 (dolist (method methods) 5021 (dolist (method methods)
5022 (setq window (car method)) 5022 (setq cand (car method))
5023 (setq side (cdr method)) 5023 (setq side (cdr method))
5024 (and (setq window 5024 (setq window
5025 (cond 5025 (cond
5026 ((eq window 'largest) 5026 ((eq cand 'largest)
5027 (get-largest-window frame t)) 5027 ;; The largest window.
5028 ((eq window 'lru) 5028 (get-largest-window frame t))
5029 (get-lru-window frame t)) 5029 ((eq cand 'lru)
5030 ((eq window 'selected) 5030 ;; The least recently used window.
5031 (frame-selected-window frame)) 5031 (get-lru-window frame t))
5032 ((eq window 'root) 5032 ((eq cand 'selected)
5033 ;; If there are side windows, split the main 5033 ;; The selected window.
5034 ;; window else the frame root window. 5034 (frame-selected-window frame))
5035 (or (window-with-parameter 'window-side 'none nil t) 5035 ((eq cand 'root)
5036 (frame-root-window frame))) 5036 ;; If there are side windows, split the main window
5037 ((memq window window-sides) 5037 ;; else the frame's root window.
5038 ;; This should gets us the "root" side 5038 (or (window-with-parameter 'window-side 'none nil t)
5039 ;; window if there exists more than one. 5039 (frame-root-window frame)))
5040 (window-with-parameter 'window-side window nil t)) 5040 ((memq cand window-sides)
5041 ((windowp window) 5041 ;; This should gets us the "root" side window if there
5042 ;; A window, directly specified. 5042 ;; exists more than one window on that side.
5043 window))) 5043 (window-with-parameter 'window-side cand nil t))
5044 ;; The window must be on the selected frame, 5044 ((windowp cand)
5045 (eq (window-frame window) frame) 5045 ;; A window, directly specified.
5046 ;; and must be neither a minibuffer window, 5046 cand)))
5047 (not (window-minibuffer-p window)) 5047
5048 ;; nor a side window. 5048 (when (and (window-live-p window)
5049 (not (eq (window-parameter window 'window-side) 'side)) 5049 ;; The window must be on the correct frame,
5050 (setq window 5050 (eq (window-frame window) frame)
5051 (cond 5051 ;; and must be neither a minibuffer window
5052 ((memq side display-buffer-side-specifiers) 5052 (not (window-minibuffer-p window))
5053 (if (and (window-buffer window) 5053 ;; nor a side window.
5054 (setq atomic (cdr (assq 'atomic specifiers)))) 5054 (not (eq (window-parameter window 'window-side) 'side)))
5055 (display-buffer-split-atom-window 5055 (setq window
5056 window side (eq atomic 'nest) specifiers) 5056 (cond
5057 (display-buffer-split-window window side specifiers))) 5057 ((memq side display-buffer-side-specifiers)
5058 ((functionp side) 5058 (if (and (window-buffer window)
5059 (ignore-errors 5059 (setq atomic (cdr (assq 'atomic specifiers))))
5060 ;; Don't pass any specifiers to this function. 5060 (display-buffer-split-atom-window
5061 (funcall side window))))) 5061 window side (eq atomic 'nest) specifiers)
5062 (throw 'done window)))) 5062 (display-buffer-split-window window side specifiers)))
5063 5063 ((functionp side)
5064 (when window 5064 (ignore-errors
5065 ;; Adjust sizes if asked for. 5065 ;; Don't pass any specifiers to this function.
5066 (display-buffer-set-height window specifiers) 5066 (funcall side window)))))
5067 (display-buffer-set-width window specifiers) 5067
5068 (set-window-parameter 5068 (when window
5069 window 'quit-restore (list 'new-window buffer selected-window)) 5069 ;; Adjust sizes if asked for.
5070 (setq display-buffer-window (cons window 'new-window)) 5070 (display-buffer-set-height window specifiers)
5071 (display-buffer-in-window buffer window specifiers) 5071 (display-buffer-set-width window specifiers)
5072 (set-window-prev-buffers window nil) 5072 (set-window-parameter
5073 window)))) 5073 window 'quit-restore (list 'new-window buffer selected-window))
5074 (setq display-buffer-window (cons window 'new-window))
5075 (display-buffer-in-window buffer window specifiers)
5076 (set-window-prev-buffers window nil)
5077 (throw 'done window))))))))
5074 5078
5075(defun display-buffer-pop-up-frame (buffer &optional graphic-only specifiers) 5079(defun display-buffer-pop-up-frame (buffer &optional graphic-only specifiers)
5076 "Make a new frame for displaying BUFFER. 5080 "Make a new frame for displaying BUFFER.
@@ -5632,7 +5636,7 @@ this list as arguments."
5632 (interactive "BDisplay buffer:\nP") 5636 (interactive "BDisplay buffer:\nP")
5633 (let* ((buffer (normalize-buffer-to-display buffer-or-name)) 5637 (let* ((buffer (normalize-buffer-to-display buffer-or-name))
5634 (buffer-name (buffer-name buffer)) 5638 (buffer-name (buffer-name buffer))
5635 (specifiers 5639 (normalized
5636 ;; Normalize specifiers. 5640 ;; Normalize specifiers.
5637 (display-buffer-normalize-specifiers buffer-name specifiers label)) 5641 (display-buffer-normalize-specifiers buffer-name specifiers label))
5638 ;; Don't use a minibuffer frame. 5642 ;; Don't use a minibuffer frame.
@@ -5646,24 +5650,24 @@ this list as arguments."
5646 (funcall display-buffer-function buffer specifiers) 5650 (funcall display-buffer-function buffer specifiers)
5647 ;; Retrieve the next location specifier while there a specifiers 5651 ;; Retrieve the next location specifier while there a specifiers
5648 ;; left and we don't have a valid window. 5652 ;; left and we don't have a valid window.
5649 (while (and specifiers (not (window-live-p window))) 5653 (while (and normalized (not (window-live-p window)))
5650 (setq specifier (car specifiers)) 5654 (setq specifier (car normalized))
5651 (setq specifiers (cdr specifiers)) 5655 (setq normalized (cdr normalized))
5652 (setq method (car specifier)) 5656 (setq method (car specifier))
5653 (setq window 5657 (setq window
5654 (cond 5658 (cond
5655 ((eq method 'reuse-window) 5659 ((eq method 'reuse-window)
5656 (display-buffer-reuse-window 5660 (display-buffer-reuse-window
5657 buffer (cdr specifier) specifiers)) 5661 buffer (cdr specifier) normalized))
5658 ((eq method 'pop-up-window) 5662 ((eq method 'pop-up-window)
5659 (display-buffer-pop-up-window 5663 (display-buffer-pop-up-window
5660 buffer (cdr specifier) specifiers)) 5664 buffer (cdr specifier) normalized))
5661 ((eq method 'pop-up-frame) 5665 ((eq method 'pop-up-frame)
5662 (display-buffer-pop-up-frame 5666 (display-buffer-pop-up-frame
5663 buffer (cdr specifier) specifiers)) 5667 buffer (cdr specifier) normalized))
5664 ((eq method 'use-side-window) 5668 ((eq method 'use-side-window)
5665 (display-buffer-in-side-window 5669 (display-buffer-in-side-window
5666 buffer (nth 1 specifier) (nth 2 specifier) specifiers)) 5670 buffer (nth 1 specifier) (nth 2 specifier) normalized))
5667 ((eq method 'fun-with-args) 5671 ((eq method 'fun-with-args)
5668 (apply (cadr specifier) buffer (cddr specifier)))))) 5672 (apply (cadr specifier) buffer (cddr specifier))))))
5669 5673
diff --git a/lisp/xwidget-test.el b/lisp/xwidget-test.el
index 69f7cfff82b..b9291c66853 100644
--- a/lisp/xwidget-test.el
+++ b/lisp/xwidget-test.el
@@ -48,6 +48,11 @@
48 (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) 48 (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic))
49 49
50 50
51(xwidget-demo "a-slider"
52 (xwidget-insert (point-min) 'slider "slider" 500 100 5)
53 (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic))
54
55
51(xwidget-demo "basic" 56(xwidget-demo "basic"
52 (xwidget-insert (point-min) 'button "button" 40 50 1) 57 (xwidget-insert (point-min) 'button "button" 40 50 1)
53 (xwidget-insert 15 'toggle "toggle" 60 30 2) 58 (xwidget-insert 15 'toggle "toggle" 60 30 2)
diff --git a/m4/dup2.m4 b/m4/dup2.m4
new file mode 100644
index 00000000000..8d7f62c8876
--- /dev/null
+++ b/m4/dup2.m4
@@ -0,0 +1,76 @@
1#serial 13
2dnl Copyright (C) 2002, 2005, 2007, 2009-2011 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_FUNC_DUP2],
8[
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10 AC_REQUIRE([AC_CANONICAL_HOST])
11 m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [
12 AC_CHECK_FUNCS_ONCE([dup2])
13 if test $ac_cv_func_dup2 = no; then
14 HAVE_DUP2=0
15 AC_LIBOBJ([dup2])
16 fi
17 ], [
18 AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
19 ])
20 if test $HAVE_DUP2 = 1; then
21 AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
22 [AC_RUN_IFELSE([
23 AC_LANG_PROGRAM([[#include <unistd.h>
24#include <fcntl.h>
25#include <errno.h>]],
26 [int result = 0;
27#ifdef FD_CLOEXEC
28 if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
29 result |= 1;
30#endif
31 if (dup2 (1, 1) == 0)
32 result |= 2;
33#ifdef FD_CLOEXEC
34 if (fcntl (1, F_GETFD) != FD_CLOEXEC)
35 result |= 4;
36#endif
37 close (0);
38 if (dup2 (0, 0) != -1)
39 result |= 8;
40 /* Many gnulib modules require POSIX conformance of EBADF. */
41 if (dup2 (2, 1000000) == -1 && errno != EBADF)
42 result |= 16;
43 return result;
44 ])
45 ],
46 [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
47 [case "$host_os" in
48 mingw*) # on this platform, dup2 always returns 0 for success
49 gl_cv_func_dup2_works=no;;
50 cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
51 gl_cv_func_dup2_works=no;;
52 linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
53 # closed fd may yield -EBADF instead of -1 / errno=EBADF.
54 gl_cv_func_dup2_works=no;;
55 freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
56 gl_cv_func_dup2_works=no;;
57 haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
58 gl_cv_func_dup2_works=no;;
59 *) gl_cv_func_dup2_works=yes;;
60 esac])
61 ])
62 if test "$gl_cv_func_dup2_works" = no; then
63 gl_REPLACE_DUP2
64 fi
65 fi
66])
67
68AC_DEFUN([gl_REPLACE_DUP2],
69[
70 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
71 AC_CHECK_FUNCS_ONCE([dup2])
72 if test $ac_cv_func_dup2 = yes; then
73 REPLACE_DUP2=1
74 fi
75 AC_LIBOBJ([dup2])
76])
diff --git a/m4/gl-comp.m4 b/m4/gl-comp.m4
index 24141a2639b..16bb02e686f 100644
--- a/m4/gl-comp.m4
+++ b/m4/gl-comp.m4
@@ -37,6 +37,7 @@ AC_DEFUN([gl_EARLY],
37 # Code from module crypto/sha512: 37 # Code from module crypto/sha512:
38 # Code from module dosname: 38 # Code from module dosname:
39 # Code from module dtoastr: 39 # Code from module dtoastr:
40 # Code from module dup2:
40 # Code from module extensions: 41 # Code from module extensions:
41 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 42 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
42 # Code from module filemode: 43 # Code from module filemode:
@@ -102,6 +103,8 @@ gl_SHA1
102gl_SHA256 103gl_SHA256
103gl_SHA512 104gl_SHA512
104AC_REQUIRE([gl_C99_STRTOLD]) 105AC_REQUIRE([gl_C99_STRTOLD])
106gl_FUNC_DUP2
107gl_UNISTD_MODULE_INDICATOR([dup2])
105gl_FILEMODE 108gl_FILEMODE
106gl_GETLOADAVG 109gl_GETLOADAVG
107if test $HAVE_GETLOADAVG = 0; then 110if test $HAVE_GETLOADAVG = 0; then
@@ -206,6 +209,9 @@ gl_SYS_STAT_MODULE_INDICATOR([stat])
206 if $condition; then 209 if $condition; then
207 func_gl_gnulib_m4code_dosname 210 func_gl_gnulib_m4code_dosname
208 fi 211 fi
212 if $condition; then
213 func_gl_gnulib_m4code_verify
214 fi
209 fi 215 fi
210 } 216 }
211 func_gl_gnulib_m4code_strtoull () 217 func_gl_gnulib_m4code_strtoull ()
@@ -401,6 +407,7 @@ AC_DEFUN([gl_FILE_LIST], [
401 lib/careadlinkat.h 407 lib/careadlinkat.h
402 lib/dosname.h 408 lib/dosname.h
403 lib/dtoastr.c 409 lib/dtoastr.c
410 lib/dup2.c
404 lib/filemode.c 411 lib/filemode.c
405 lib/filemode.h 412 lib/filemode.h
406 lib/ftoastr.c 413 lib/ftoastr.c
@@ -450,6 +457,7 @@ AC_DEFUN([gl_FILE_LIST], [
450 m4/00gnulib.m4 457 m4/00gnulib.m4
451 m4/alloca.m4 458 m4/alloca.m4
452 m4/c-strtod.m4 459 m4/c-strtod.m4
460 m4/dup2.m4
453 m4/extensions.m4 461 m4/extensions.m4
454 m4/filemode.m4 462 m4/filemode.m4
455 m4/getloadavg.m4 463 m4/getloadavg.m4
diff --git a/src/ChangeLog b/src/ChangeLog
index 78fca60ca28..e21412187c7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,124 @@
12011-06-25 Paul Eggert <eggert@cs.ucla.edu>
2
3 Use gnulib's dup2 module instead of rolling our own.
4 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
5
62011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7
8 * dispnew.c (scrolling_window): Before scrolling, turn off a
9 mouse-highlight in the window being scrolled.
10
112011-06-24 Juanma Barranquero <lekktu@gmail.com>
12
13 Move DEFSYM to lisp.h and use everywhere.
14
15 * character.h (DEFSYM): Move declaration...
16 * lisp.h (DEFSYM): ...here.
17
18 * gnutls.c:
19 * minibuf.c:
20 * w32menu.c:
21 * w32proc.c:
22 * w32select.c: Don't include character.h.
23
24 * alloc.c (syms_of_alloc):
25 * buffer.c (syms_of_buffer):
26 * bytecode.c (syms_of_bytecode):
27 * callint.c (syms_of_callint):
28 * casefiddle.c (syms_of_casefiddle):
29 * casetab.c (init_casetab_once):
30 * category.c (init_category_once, syms_of_category):
31 * ccl.c (syms_of_ccl):
32 * cmds.c (syms_of_cmds):
33 * composite.c (syms_of_composite):
34 * dbusbind.c (syms_of_dbusbind):
35 * dired.c (syms_of_dired):
36 * dispnew.c (syms_of_display):
37 * doc.c (syms_of_doc):
38 * editfns.c (syms_of_editfns):
39 * emacs.c (syms_of_emacs):
40 * eval.c (syms_of_eval):
41 * fileio.c (syms_of_fileio):
42 * fns.c (syms_of_fns):
43 * frame.c (syms_of_frame):
44 * fringe.c (syms_of_fringe):
45 * insdel.c (syms_of_insdel):
46 * keymap.c (syms_of_keymap):
47 * lread.c (init_obarray, syms_of_lread):
48 * macros.c (syms_of_macros):
49 * msdos.c (syms_of_msdos):
50 * print.c (syms_of_print):
51 * process.c (syms_of_process):
52 * search.c (syms_of_search):
53 * sound.c (syms_of_sound):
54 * syntax.c (init_syntax_once, syms_of_syntax):
55 * terminal.c (syms_of_terminal):
56 * textprop.c (syms_of_textprop):
57 * undo.c (syms_of_undo):
58 * w32.c (globals_of_w32):
59 * window.c (syms_of_window):
60 * xdisp.c (syms_of_xdisp):
61 * xfaces.c (syms_of_xfaces):
62 * xfns.c (syms_of_xfns):
63 * xmenu.c (syms_of_xmenu):
64 * xsettings.c (syms_of_xsettings):
65 * xterm.c (syms_of_xterm): Use DEFSYM.
66
672011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
68
69 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
70
712011-06-23 Paul Eggert <eggert@cs.ucla.edu>
72
73 Integer and buffer overflow fixes (Bug#8873).
74
75 * print.c (printchar, strout): Check for string overflow.
76 (PRINTPREPARE, printchar, strout):
77 Don't set size unless allocation succeeds.
78
79 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
80 for sizes. Check for string overflow more accurately.
81 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
82
83 * macros.c: Integer and buffer overflow fixes.
84 * keyboard.h (struct keyboard.kbd_macro_bufsize):
85 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
86 Use ptrdiff_t, not int, for sizes.
87 Don't increment bufsize until after realloc succeeds.
88 Check for size-calculation overflow.
89 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
90
91 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
92
93 * lread.c: Integer overflow fixes.
94 (read_integer): Radix is now EMACS_INT, not int,
95 to improve quality of diagnostics for out-of-range radices.
96 Calculate buffer size correctly for out-of-range radices.
97 (read1): Check for integer overflow in radices, and in
98 read-circle numbers.
99 (read_escape): Avoid int overflow.
100 (Fload, openp, read_buffer_size, read1)
101 (substitute_object_recurse, read_vector, read_list, map_obarray):
102 Use ptrdiff_t, not int, for sizes.
103 (read1): Use EMACS_INT, not int, for sizes.
104 Check for size overflow.
105
106 * image.c (cache_image): Check for size arithmetic overflow.
107
108 * lread.c: Integer overflow issues.
109 (saved_doc_string_size, saved_doc_string_length)
110 (prev_saved_doc_string_size, prev_saved_doc_string_length):
111 Now ptrdiff_t, not int.
112 (read1): Don't assume doc string length fits in int. Check for
113 out-of-range doc string lengths.
114 (read_list): Don't assume file position fits in int.
115 (read_escape): Check for hex character overflow.
116
1172011-06-22 Leo Liu <sdl.web@gmail.com>
118
119 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
120 Move to minibuffer.el.
121
12011-06-22 Paul Eggert <eggert@cs.ucla.edu> 1222011-06-22 Paul Eggert <eggert@cs.ucla.edu>
2 123
3 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking. 124 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
@@ -250,7 +371,7 @@
250 371
251 * fns.c (secure_hash): Rename from crypto_hash_function and change 372 * fns.c (secure_hash): Rename from crypto_hash_function and change
252 the first arg to accept symbols. 373 the first arg to accept symbols.
253 (Fsecure_hash): New primtive. 374 (Fsecure_hash): New primitive.
254 (syms_of_fns): New symbols. 375 (syms_of_fns): New symbols.
255 376
2562011-06-20 Deniz Dogan <deniz@dogan.se> 3772011-06-20 Deniz Dogan <deniz@dogan.se>
diff --git a/src/alloc.c b/src/alloc.c
index 69623d103c3..43befd722bb 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6251,8 +6251,7 @@ do hash-consing of the objects allocated to pure space. */);
6251 DEFVAR_LISP ("post-gc-hook", Vpost_gc_hook, 6251 DEFVAR_LISP ("post-gc-hook", Vpost_gc_hook,
6252 doc: /* Hook run after garbage collection has finished. */); 6252 doc: /* Hook run after garbage collection has finished. */);
6253 Vpost_gc_hook = Qnil; 6253 Vpost_gc_hook = Qnil;
6254 Qpost_gc_hook = intern_c_string ("post-gc-hook"); 6254 DEFSYM (Qpost_gc_hook, "post-gc-hook");
6255 staticpro (&Qpost_gc_hook);
6256 6255
6257 DEFVAR_LISP ("memory-signal-data", Vmemory_signal_data, 6256 DEFVAR_LISP ("memory-signal-data", Vmemory_signal_data,
6258 doc: /* Precomputed `signal' argument for memory-full error. */); 6257 doc: /* Precomputed `signal' argument for memory-full error. */);
@@ -6266,11 +6265,8 @@ do hash-consing of the objects allocated to pure space. */);
6266 doc: /* Non-nil means Emacs cannot get much more Lisp memory. */); 6265 doc: /* Non-nil means Emacs cannot get much more Lisp memory. */);
6267 Vmemory_full = Qnil; 6266 Vmemory_full = Qnil;
6268 6267
6269 staticpro (&Qgc_cons_threshold); 6268 DEFSYM (Qgc_cons_threshold, "gc-cons-threshold");
6270 Qgc_cons_threshold = intern_c_string ("gc-cons-threshold"); 6269 DEFSYM (Qchar_table_extra_slots, "char-table-extra-slots");
6271
6272 staticpro (&Qchar_table_extra_slots);
6273 Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots");
6274 6270
6275 DEFVAR_LISP ("gc-elapsed", Vgc_elapsed, 6271 DEFVAR_LISP ("gc-elapsed", Vgc_elapsed,
6276 doc: /* Accumulated time elapsed in garbage collections. 6272 doc: /* Accumulated time elapsed in garbage collections.
diff --git a/src/buffer.c b/src/buffer.c
index 238923a2ba0..006153b0424 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5209,39 +5209,26 @@ syms_of_buffer (void)
5209 staticpro (&Vbuffer_alist); 5209 staticpro (&Vbuffer_alist);
5210 staticpro (&Qprotected_field); 5210 staticpro (&Qprotected_field);
5211 staticpro (&Qpermanent_local); 5211 staticpro (&Qpermanent_local);
5212 Qpermanent_local_hook = intern_c_string ("permanent-local-hook");
5213 staticpro (&Qpermanent_local_hook);
5214 staticpro (&Qkill_buffer_hook); 5212 staticpro (&Qkill_buffer_hook);
5215 Qoverlayp = intern_c_string ("overlayp"); 5213
5216 staticpro (&Qoverlayp); 5214 DEFSYM (Qpermanent_local_hook, "permanent-local-hook");
5217 Qevaporate = intern_c_string ("evaporate"); 5215 DEFSYM (Qoverlayp, "overlayp");
5218 staticpro (&Qevaporate); 5216 DEFSYM (Qevaporate, "evaporate");
5219 Qmodification_hooks = intern_c_string ("modification-hooks"); 5217 DEFSYM (Qmodification_hooks, "modification-hooks");
5220 staticpro (&Qmodification_hooks); 5218 DEFSYM (Qinsert_in_front_hooks, "insert-in-front-hooks");
5221 Qinsert_in_front_hooks = intern_c_string ("insert-in-front-hooks"); 5219 DEFSYM (Qinsert_behind_hooks, "insert-behind-hooks");
5222 staticpro (&Qinsert_in_front_hooks); 5220 DEFSYM (Qget_file_buffer, "get-file-buffer");
5223 Qinsert_behind_hooks = intern_c_string ("insert-behind-hooks"); 5221 DEFSYM (Qpriority, "priority");
5224 staticpro (&Qinsert_behind_hooks); 5222 DEFSYM (Qbefore_string, "before-string");
5225 Qget_file_buffer = intern_c_string ("get-file-buffer"); 5223 DEFSYM (Qafter_string, "after-string");
5226 staticpro (&Qget_file_buffer); 5224 DEFSYM (Qfirst_change_hook, "first-change-hook");
5227 Qpriority = intern_c_string ("priority"); 5225 DEFSYM (Qbefore_change_functions, "before-change-functions");
5228 staticpro (&Qpriority); 5226 DEFSYM (Qafter_change_functions, "after-change-functions");
5229 Qbefore_string = intern_c_string ("before-string"); 5227 DEFSYM (Qkill_buffer_query_functions, "kill-buffer-query-functions");
5230 staticpro (&Qbefore_string); 5228
5231 Qafter_string = intern_c_string ("after-string");
5232 staticpro (&Qafter_string);
5233 Qfirst_change_hook = intern_c_string ("first-change-hook");
5234 staticpro (&Qfirst_change_hook);
5235 Qbefore_change_functions = intern_c_string ("before-change-functions");
5236 staticpro (&Qbefore_change_functions);
5237 Qafter_change_functions = intern_c_string ("after-change-functions");
5238 staticpro (&Qafter_change_functions);
5239 /* The next one is initialized in init_buffer_once. */ 5229 /* The next one is initialized in init_buffer_once. */
5240 staticpro (&Qucs_set_table_for_input); 5230 staticpro (&Qucs_set_table_for_input);
5241 5231
5242 Qkill_buffer_query_functions = intern_c_string ("kill-buffer-query-functions");
5243 staticpro (&Qkill_buffer_query_functions);
5244
5245 Fput (Qprotected_field, Qerror_conditions, 5232 Fput (Qprotected_field, Qerror_conditions,
5246 pure_cons (Qprotected_field, pure_cons (Qerror, Qnil))); 5233 pure_cons (Qprotected_field, pure_cons (Qerror, Qnil)));
5247 Fput (Qprotected_field, Qerror_message, 5234 Fput (Qprotected_field, Qerror_message,
@@ -6035,8 +6022,7 @@ If any of them returns nil, the buffer is not killed. */);
6035 doc: /* Normal hook run before changing the major mode of a buffer. 6022 doc: /* Normal hook run before changing the major mode of a buffer.
6036The function `kill-all-local-variables' runs this before doing anything else. */); 6023The function `kill-all-local-variables' runs this before doing anything else. */);
6037 Vchange_major_mode_hook = Qnil; 6024 Vchange_major_mode_hook = Qnil;
6038 Qchange_major_mode_hook = intern_c_string ("change-major-mode-hook"); 6025 DEFSYM (Qchange_major_mode_hook, "change-major-mode-hook");
6039 staticpro (&Qchange_major_mode_hook);
6040 6026
6041 DEFVAR_LISP ("buffer-list-update-hook", Vbuffer_list_update_hook, 6027 DEFVAR_LISP ("buffer-list-update-hook", Vbuffer_list_update_hook,
6042 doc: /* Hook run when the buffer list changes. 6028 doc: /* Hook run when the buffer list changes.
@@ -6044,8 +6030,7 @@ Functions running this hook are `get-buffer-create',
6044`make-indirect-buffer', `rename-buffer', `kill-buffer', 6030`make-indirect-buffer', `rename-buffer', `kill-buffer',
6045`record-buffer' and `unrecord-buffer'. */); 6031`record-buffer' and `unrecord-buffer'. */);
6046 Vbuffer_list_update_hook = Qnil; 6032 Vbuffer_list_update_hook = Qnil;
6047 Qbuffer_list_update_hook = intern_c_string ("buffer-list-update-hook"); 6033 DEFSYM (Qbuffer_list_update_hook, "buffer-list-update-hook");
6048 staticpro (&Qbuffer_list_update_hook);
6049 6034
6050 defsubr (&Sbuffer_live_p); 6035 defsubr (&Sbuffer_live_p);
6051 defsubr (&Sbuffer_list); 6036 defsubr (&Sbuffer_list);
diff --git a/src/bytecode.c b/src/bytecode.c
index 58b26c79b84..9ed29e94b54 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1840,8 +1840,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
1840void 1840void
1841syms_of_bytecode (void) 1841syms_of_bytecode (void)
1842{ 1842{
1843 Qbytecode = intern_c_string ("byte-code"); 1843 DEFSYM (Qbytecode, "byte-code");
1844 staticpro (&Qbytecode);
1845 1844
1846 defsubr (&Sbyte_code); 1845 defsubr (&Sbyte_code);
1847 1846
@@ -1863,8 +1862,7 @@ integer, it is incremented each time that symbol's function is called. */);
1863 1862
1864 byte_metering_on = 0; 1863 byte_metering_on = 0;
1865 Vbyte_code_meter = Fmake_vector (make_number (256), make_number (0)); 1864 Vbyte_code_meter = Fmake_vector (make_number (256), make_number (0));
1866 Qbyte_code_meter = intern_c_string ("byte-code-meter"); 1865 DEFSYM (Qbyte_code_meter, "byte-code-meter");
1867 staticpro (&Qbyte_code_meter);
1868 { 1866 {
1869 int i = 256; 1867 int i = 256;
1870 while (i--) 1868 while (i--)
diff --git a/src/callint.c b/src/callint.c
index dc5e6a4c37a..4d0a2a07921 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -896,41 +896,20 @@ syms_of_callint (void)
896 pure_cons (intern_c_string ("point"), 896 pure_cons (intern_c_string ("point"),
897 pure_cons (intern_c_string ("mark"), Qnil)))); 897 pure_cons (intern_c_string ("mark"), Qnil))));
898 898
899 Qlist = intern_c_string ("list"); 899 DEFSYM (Qlist, "list");
900 staticpro (&Qlist); 900 DEFSYM (Qlet, "let");
901 Qlet = intern_c_string ("let"); 901 DEFSYM (Qif, "if");
902 staticpro (&Qlet); 902 DEFSYM (Qwhen, "when");
903 Qif = intern_c_string ("if"); 903 DEFSYM (Qletx, "let*");
904 staticpro (&Qif); 904 DEFSYM (Qsave_excursion, "save-excursion");
905 Qwhen = intern_c_string ("when"); 905 DEFSYM (Qprogn, "progn");
906 staticpro (&Qwhen); 906 DEFSYM (Qminus, "-");
907 Qletx = intern_c_string ("let*"); 907 DEFSYM (Qplus, "+");
908 staticpro (&Qletx); 908 DEFSYM (Qhandle_shift_selection, "handle-shift-selection");
909 Qsave_excursion = intern_c_string ("save-excursion"); 909 DEFSYM (Qcall_interactively, "call-interactively");
910 staticpro (&Qsave_excursion); 910 DEFSYM (Qcommand_debug_status, "command-debug-status");
911 Qprogn = intern_c_string ("progn"); 911 DEFSYM (Qenable_recursive_minibuffers, "enable-recursive-minibuffers");
912 staticpro (&Qprogn); 912 DEFSYM (Qmouse_leave_buffer_hook, "mouse-leave-buffer-hook");
913
914 Qminus = intern_c_string ("-");
915 staticpro (&Qminus);
916
917 Qplus = intern_c_string ("+");
918 staticpro (&Qplus);
919
920 Qhandle_shift_selection = intern_c_string ("handle-shift-selection");
921 staticpro (&Qhandle_shift_selection);
922
923 Qcall_interactively = intern_c_string ("call-interactively");
924 staticpro (&Qcall_interactively);
925
926 Qcommand_debug_status = intern_c_string ("command-debug-status");
927 staticpro (&Qcommand_debug_status);
928
929 Qenable_recursive_minibuffers = intern_c_string ("enable-recursive-minibuffers");
930 staticpro (&Qenable_recursive_minibuffers);
931
932 Qmouse_leave_buffer_hook = intern_c_string ("mouse-leave-buffer-hook");
933 staticpro (&Qmouse_leave_buffer_hook);
934 913
935 DEFVAR_KBOARD ("prefix-arg", Vprefix_arg, 914 DEFVAR_KBOARD ("prefix-arg", Vprefix_arg,
936 doc: /* The value of the prefix argument for the next editing command. 915 doc: /* The value of the prefix argument for the next editing command.
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 1a0a62f273c..50ad4eeda74 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -417,8 +417,7 @@ With negative argument, capitalize previous words but do not move. */)
417void 417void
418syms_of_casefiddle (void) 418syms_of_casefiddle (void)
419{ 419{
420 Qidentity = intern_c_string ("identity"); 420 DEFSYM (Qidentity, "identity");
421 staticpro (&Qidentity);
422 defsubr (&Supcase); 421 defsubr (&Supcase);
423 defsubr (&Sdowncase); 422 defsubr (&Sdowncase);
424 defsubr (&Scapitalize); 423 defsubr (&Scapitalize);
diff --git a/src/casetab.c b/src/casetab.c
index 29120dd08ce..3433b313c03 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -244,8 +244,7 @@ init_casetab_once (void)
244{ 244{
245 register int i; 245 register int i;
246 Lisp_Object down, up; 246 Lisp_Object down, up;
247 Qcase_table = intern_c_string ("case-table"); 247 DEFSYM (Qcase_table, "case-table");
248 staticpro (&Qcase_table);
249 248
250 /* Intern this now in case it isn't already done. 249 /* Intern this now in case it isn't already done.
251 Setting this variable twice is harmless. 250 Setting this variable twice is harmless.
@@ -288,8 +287,7 @@ init_casetab_once (void)
288void 287void
289syms_of_casetab (void) 288syms_of_casetab (void)
290{ 289{
291 Qcase_table_p = intern_c_string ("case-table-p"); 290 DEFSYM (Qcase_table_p, "case-table-p");
292 staticpro (&Qcase_table_p);
293 291
294 staticpro (&Vascii_canon_table); 292 staticpro (&Vascii_canon_table);
295 staticpro (&Vascii_downcase_table); 293 staticpro (&Vascii_downcase_table);
diff --git a/src/category.c b/src/category.c
index 23fd874c824..08eadb04730 100644
--- a/src/category.c
+++ b/src/category.c
@@ -453,8 +453,7 @@ void
453init_category_once (void) 453init_category_once (void)
454{ 454{
455 /* This has to be done here, before we call Fmake_char_table. */ 455 /* This has to be done here, before we call Fmake_char_table. */
456 Qcategory_table = intern_c_string ("category-table"); 456 DEFSYM (Qcategory_table, "category-table");
457 staticpro (&Qcategory_table);
458 457
459 /* Intern this now in case it isn't already done. 458 /* Intern this now in case it isn't already done.
460 Setting this variable twice is harmless. 459 Setting this variable twice is harmless.
@@ -475,12 +474,9 @@ init_category_once (void)
475void 474void
476syms_of_category (void) 475syms_of_category (void)
477{ 476{
478 Qcategoryp = intern_c_string ("categoryp"); 477 DEFSYM (Qcategoryp, "categoryp");
479 staticpro (&Qcategoryp); 478 DEFSYM (Qcategorysetp, "categorysetp");
480 Qcategorysetp = intern_c_string ("categorysetp"); 479 DEFSYM (Qcategory_table_p, "category-table-p");
481 staticpro (&Qcategorysetp);
482 Qcategory_table_p = intern_c_string ("category-table-p");
483 staticpro (&Qcategory_table_p);
484 480
485 DEFVAR_LISP ("word-combining-categories", Vword_combining_categories, 481 DEFVAR_LISP ("word-combining-categories", Vword_combining_categories,
486 doc: /* List of pair (cons) of categories to determine word boundary. 482 doc: /* List of pair (cons) of categories to determine word boundary.
diff --git a/src/ccl.c b/src/ccl.c
index 30d151f00a0..9cfcbfe8703 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -2305,23 +2305,12 @@ syms_of_ccl (void)
2305 staticpro (&Vccl_program_table); 2305 staticpro (&Vccl_program_table);
2306 Vccl_program_table = Fmake_vector (make_number (32), Qnil); 2306 Vccl_program_table = Fmake_vector (make_number (32), Qnil);
2307 2307
2308 Qccl = intern_c_string ("ccl"); 2308 DEFSYM (Qccl, "ccl");
2309 staticpro (&Qccl); 2309 DEFSYM (Qcclp, "cclp");
2310 2310 DEFSYM (Qccl_program, "ccl-program");
2311 Qcclp = intern_c_string ("cclp"); 2311 DEFSYM (Qccl_program_idx, "ccl-program-idx");
2312 staticpro (&Qcclp); 2312 DEFSYM (Qcode_conversion_map, "code-conversion-map");
2313 2313 DEFSYM (Qcode_conversion_map_id, "code-conversion-map-id");
2314 Qccl_program = intern_c_string ("ccl-program");
2315 staticpro (&Qccl_program);
2316
2317 Qccl_program_idx = intern_c_string ("ccl-program-idx");
2318 staticpro (&Qccl_program_idx);
2319
2320 Qcode_conversion_map = intern_c_string ("code-conversion-map");
2321 staticpro (&Qcode_conversion_map);
2322
2323 Qcode_conversion_map_id = intern_c_string ("code-conversion-map-id");
2324 staticpro (&Qcode_conversion_map_id);
2325 2314
2326 DEFVAR_LISP ("code-conversion-map-vector", Vcode_conversion_map_vector, 2315 DEFVAR_LISP ("code-conversion-map-vector", Vcode_conversion_map_vector,
2327 doc: /* Vector of code conversion maps. */); 2316 doc: /* Vector of code conversion maps. */);
diff --git a/src/character.h b/src/character.h
index 9a45e7f0033..3bc21ac0f2b 100644
--- a/src/character.h
+++ b/src/character.h
@@ -628,7 +628,4 @@ extern Lisp_Object string_escape_byte8 (Lisp_Object);
628#define GET_TRANSLATION_TABLE(id) \ 628#define GET_TRANSLATION_TABLE(id) \
629 (XCDR(XVECTOR(Vtranslation_table_vector)->contents[(id)])) 629 (XCDR(XVECTOR(Vtranslation_table_vector)->contents[(id)]))
630 630
631#define DEFSYM(sym, name) \
632 do { (sym) = intern_c_string ((name)); staticpro (&(sym)); } while (0)
633
634#endif /* EMACS_CHARACTER_H */ 631#endif /* EMACS_CHARACTER_H */
diff --git a/src/cmds.c b/src/cmds.c
index 5dc4d2bfe30..f49cfc221be 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -511,20 +511,11 @@ internal_self_insert (int c, EMACS_INT n)
511void 511void
512syms_of_cmds (void) 512syms_of_cmds (void)
513{ 513{
514 Qkill_backward_chars = intern_c_string ("kill-backward-chars"); 514 DEFSYM (Qkill_backward_chars, "kill-backward-chars");
515 staticpro (&Qkill_backward_chars); 515 DEFSYM (Qkill_forward_chars, "kill-forward-chars");
516 516 DEFSYM (Qoverwrite_mode_binary, "overwrite-mode-binary");
517 Qkill_forward_chars = intern_c_string ("kill-forward-chars"); 517 DEFSYM (Qexpand_abbrev, "expand-abbrev");
518 staticpro (&Qkill_forward_chars); 518 DEFSYM (Qpost_self_insert_hook, "post-self-insert-hook");
519
520 Qoverwrite_mode_binary = intern_c_string ("overwrite-mode-binary");
521 staticpro (&Qoverwrite_mode_binary);
522
523 Qexpand_abbrev = intern_c_string ("expand-abbrev");
524 staticpro (&Qexpand_abbrev);
525
526 Qpost_self_insert_hook = intern_c_string ("post-self-insert-hook");
527 staticpro (&Qpost_self_insert_hook);
528 519
529 DEFVAR_LISP ("post-self-insert-hook", Vpost_self_insert_hook, 520 DEFVAR_LISP ("post-self-insert-hook", Vpost_self_insert_hook,
530 doc: /* Hook run at the end of `self-insert-command'. 521 doc: /* Hook run at the end of `self-insert-command'.
diff --git a/src/composite.c b/src/composite.c
index 796c5a58de6..de9775d18f5 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1937,8 +1937,7 @@ syms_of_composite (void)
1937{ 1937{
1938 int i; 1938 int i;
1939 1939
1940 Qcomposition = intern_c_string ("composition"); 1940 DEFSYM (Qcomposition, "composition");
1941 staticpro (&Qcomposition);
1942 1941
1943 /* Make a hash table for static composition. */ 1942 /* Make a hash table for static composition. */
1944 { 1943 {
@@ -1997,11 +1996,8 @@ valid.
1997The default value is the function `compose-chars-after'. */); 1996The default value is the function `compose-chars-after'. */);
1998 Vcompose_chars_after_function = intern_c_string ("compose-chars-after"); 1997 Vcompose_chars_after_function = intern_c_string ("compose-chars-after");
1999 1998
2000 Qauto_composed = intern_c_string ("auto-composed"); 1999 DEFSYM (Qauto_composed, "auto-composed");
2001 staticpro (&Qauto_composed); 2000 DEFSYM (Qauto_composition_function, "auto-composition-function");
2002
2003 Qauto_composition_function = intern_c_string ("auto-composition-function");
2004 staticpro (&Qauto_composition_function);
2005 2001
2006 DEFVAR_LISP ("auto-composition-mode", Vauto_composition_mode, 2002 DEFVAR_LISP ("auto-composition-mode", Vauto_composition_mode,
2007 doc: /* Non-nil if Auto-Composition mode is enabled. 2003 doc: /* Non-nil if Auto-Composition mode is enabled.
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 302b93146fd..4828f4e968d 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -2189,142 +2189,76 @@ void
2189syms_of_dbusbind (void) 2189syms_of_dbusbind (void)
2190{ 2190{
2191 2191
2192 Qdbus_init_bus = intern_c_string ("dbus-init-bus"); 2192 DEFSYM (Qdbus_init_bus, "dbus-init-bus");
2193 staticpro (&Qdbus_init_bus);
2194 defsubr (&Sdbus_init_bus); 2193 defsubr (&Sdbus_init_bus);
2195 2194
2196 Qdbus_close_bus = intern_c_string ("dbus-close-bus"); 2195 DEFSYM (Qdbus_close_bus, "dbus-close-bus");
2197 staticpro (&Qdbus_close_bus);
2198 defsubr (&Sdbus_close_bus); 2196 defsubr (&Sdbus_close_bus);
2199 2197
2200 Qdbus_get_unique_name = intern_c_string ("dbus-get-unique-name"); 2198 DEFSYM (Qdbus_get_unique_name, "dbus-get-unique-name");
2201 staticpro (&Qdbus_get_unique_name);
2202 defsubr (&Sdbus_get_unique_name); 2199 defsubr (&Sdbus_get_unique_name);
2203 2200
2204 Qdbus_call_method = intern_c_string ("dbus-call-method"); 2201 DEFSYM (Qdbus_call_method, "dbus-call-method");
2205 staticpro (&Qdbus_call_method);
2206 defsubr (&Sdbus_call_method); 2202 defsubr (&Sdbus_call_method);
2207 2203
2208 Qdbus_call_method_asynchronously 2204 DEFSYM (Qdbus_call_method_asynchronously, "dbus-call-method-asynchronously");
2209 = intern_c_string ("dbus-call-method-asynchronously");
2210 staticpro (&Qdbus_call_method_asynchronously);
2211 defsubr (&Sdbus_call_method_asynchronously); 2205 defsubr (&Sdbus_call_method_asynchronously);
2212 2206
2213 Qdbus_method_return_internal 2207 DEFSYM (Qdbus_method_return_internal, "dbus-method-return-internal");
2214 = intern_c_string ("dbus-method-return-internal");
2215 staticpro (&Qdbus_method_return_internal);
2216 defsubr (&Sdbus_method_return_internal); 2208 defsubr (&Sdbus_method_return_internal);
2217 2209
2218 Qdbus_method_error_internal = intern_c_string ("dbus-method-error-internal"); 2210 DEFSYM (Qdbus_method_error_internal, "dbus-method-error-internal");
2219 staticpro (&Qdbus_method_error_internal);
2220 defsubr (&Sdbus_method_error_internal); 2211 defsubr (&Sdbus_method_error_internal);
2221 2212
2222 Qdbus_send_signal = intern_c_string ("dbus-send-signal"); 2213 DEFSYM (Qdbus_send_signal, "dbus-send-signal");
2223 staticpro (&Qdbus_send_signal);
2224 defsubr (&Sdbus_send_signal); 2214 defsubr (&Sdbus_send_signal);
2225 2215
2226 Qdbus_register_service = intern_c_string ("dbus-register-service"); 2216 DEFSYM (Qdbus_register_service, "dbus-register-service");
2227 staticpro (&Qdbus_register_service);
2228 defsubr (&Sdbus_register_service); 2217 defsubr (&Sdbus_register_service);
2229 2218
2230 Qdbus_register_signal = intern_c_string ("dbus-register-signal"); 2219 DEFSYM (Qdbus_register_signal, "dbus-register-signal");
2231 staticpro (&Qdbus_register_signal);
2232 defsubr (&Sdbus_register_signal); 2220 defsubr (&Sdbus_register_signal);
2233 2221
2234 Qdbus_register_method = intern_c_string ("dbus-register-method"); 2222 DEFSYM (Qdbus_register_method, "dbus-register-method");
2235 staticpro (&Qdbus_register_method);
2236 defsubr (&Sdbus_register_method); 2223 defsubr (&Sdbus_register_method);
2237 2224
2238 Qdbus_error = intern_c_string ("dbus-error"); 2225 DEFSYM (Qdbus_error, "dbus-error");
2239 staticpro (&Qdbus_error);
2240 Fput (Qdbus_error, Qerror_conditions, 2226 Fput (Qdbus_error, Qerror_conditions,
2241 list2 (Qdbus_error, Qerror)); 2227 list2 (Qdbus_error, Qerror));
2242 Fput (Qdbus_error, Qerror_message, 2228 Fput (Qdbus_error, Qerror_message,
2243 make_pure_c_string ("D-Bus error")); 2229 make_pure_c_string ("D-Bus error"));
2244 2230
2245 QCdbus_system_bus = intern_c_string (":system"); 2231 DEFSYM (QCdbus_system_bus, ":system");
2246 staticpro (&QCdbus_system_bus); 2232 DEFSYM (QCdbus_session_bus, ":session");
2247 2233 DEFSYM (QCdbus_request_name_allow_replacement, ":allow-replacement");
2248 QCdbus_session_bus = intern_c_string (":session"); 2234 DEFSYM (QCdbus_request_name_replace_existing, ":replace-existing");
2249 staticpro (&QCdbus_session_bus); 2235 DEFSYM (QCdbus_request_name_do_not_queue, ":do-not-queue");
2250 2236 DEFSYM (QCdbus_request_name_reply_primary_owner, ":primary-owner");
2251 QCdbus_request_name_allow_replacement 2237 DEFSYM (QCdbus_request_name_reply_exists, ":exists");
2252 = intern_c_string (":allow-replacement"); 2238 DEFSYM (QCdbus_request_name_reply_in_queue, ":in-queue");
2253 staticpro (&QCdbus_request_name_allow_replacement); 2239 DEFSYM (QCdbus_request_name_reply_already_owner, ":already-owner");
2254 2240 DEFSYM (QCdbus_timeout, ":timeout");
2255 QCdbus_request_name_replace_existing = intern_c_string (":replace-existing"); 2241 DEFSYM (QCdbus_type_byte, ":byte");
2256 staticpro (&QCdbus_request_name_replace_existing); 2242 DEFSYM (QCdbus_type_boolean, ":boolean");
2257 2243 DEFSYM (QCdbus_type_int16, ":int16");
2258 QCdbus_request_name_do_not_queue = intern_c_string (":do-not-queue"); 2244 DEFSYM (QCdbus_type_uint16, ":uint16");
2259 staticpro (&QCdbus_request_name_do_not_queue); 2245 DEFSYM (QCdbus_type_int32, ":int32");
2260 2246 DEFSYM (QCdbus_type_uint32, ":uint32");
2261 QCdbus_request_name_reply_primary_owner = intern_c_string (":primary-owner"); 2247 DEFSYM (QCdbus_type_int64, ":int64");
2262 staticpro (&QCdbus_request_name_reply_primary_owner); 2248 DEFSYM (QCdbus_type_uint64, ":uint64");
2263 2249 DEFSYM (QCdbus_type_double, ":double");
2264 QCdbus_request_name_reply_exists = intern_c_string (":exists"); 2250 DEFSYM (QCdbus_type_string, ":string");
2265 staticpro (&QCdbus_request_name_reply_exists); 2251 DEFSYM (QCdbus_type_object_path, ":object-path");
2266 2252 DEFSYM (QCdbus_type_signature, ":signature");
2267 QCdbus_request_name_reply_in_queue = intern_c_string (":in-queue");
2268 staticpro (&QCdbus_request_name_reply_in_queue);
2269
2270 QCdbus_request_name_reply_already_owner = intern_c_string (":already-owner");
2271 staticpro (&QCdbus_request_name_reply_already_owner);
2272
2273 QCdbus_timeout = intern_c_string (":timeout");
2274 staticpro (&QCdbus_timeout);
2275
2276 QCdbus_type_byte = intern_c_string (":byte");
2277 staticpro (&QCdbus_type_byte);
2278
2279 QCdbus_type_boolean = intern_c_string (":boolean");
2280 staticpro (&QCdbus_type_boolean);
2281
2282 QCdbus_type_int16 = intern_c_string (":int16");
2283 staticpro (&QCdbus_type_int16);
2284
2285 QCdbus_type_uint16 = intern_c_string (":uint16");
2286 staticpro (&QCdbus_type_uint16);
2287
2288 QCdbus_type_int32 = intern_c_string (":int32");
2289 staticpro (&QCdbus_type_int32);
2290
2291 QCdbus_type_uint32 = intern_c_string (":uint32");
2292 staticpro (&QCdbus_type_uint32);
2293
2294 QCdbus_type_int64 = intern_c_string (":int64");
2295 staticpro (&QCdbus_type_int64);
2296
2297 QCdbus_type_uint64 = intern_c_string (":uint64");
2298 staticpro (&QCdbus_type_uint64);
2299
2300 QCdbus_type_double = intern_c_string (":double");
2301 staticpro (&QCdbus_type_double);
2302
2303 QCdbus_type_string = intern_c_string (":string");
2304 staticpro (&QCdbus_type_string);
2305
2306 QCdbus_type_object_path = intern_c_string (":object-path");
2307 staticpro (&QCdbus_type_object_path);
2308
2309 QCdbus_type_signature = intern_c_string (":signature");
2310 staticpro (&QCdbus_type_signature);
2311 2253
2312#ifdef DBUS_TYPE_UNIX_FD 2254#ifdef DBUS_TYPE_UNIX_FD
2313 QCdbus_type_unix_fd = intern_c_string (":unix-fd"); 2255 DEFSYM (QCdbus_type_unix_fd, ":unix-fd");
2314 staticpro (&QCdbus_type_unix_fd);
2315#endif 2256#endif
2316 2257
2317 QCdbus_type_array = intern_c_string (":array"); 2258 DEFSYM (QCdbus_type_array, ":array");
2318 staticpro (&QCdbus_type_array); 2259 DEFSYM (QCdbus_type_variant, ":variant");
2319 2260 DEFSYM (QCdbus_type_struct, ":struct");
2320 QCdbus_type_variant = intern_c_string (":variant"); 2261 DEFSYM (QCdbus_type_dict_entry, ":dict-entry");
2321 staticpro (&QCdbus_type_variant);
2322
2323 QCdbus_type_struct = intern_c_string (":struct");
2324 staticpro (&QCdbus_type_struct);
2325
2326 QCdbus_type_dict_entry = intern_c_string (":dict-entry");
2327 staticpro (&QCdbus_type_dict_entry);
2328 2262
2329 DEFVAR_LISP ("dbus-registered-buses", 2263 DEFVAR_LISP ("dbus-registered-buses",
2330 Vdbus_registered_buses, 2264 Vdbus_registered_buses,
diff --git a/src/dired.c b/src/dired.c
index 3ab1ba8a900..415f9ac5ae5 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -1017,21 +1017,13 @@ Comparison is in lexicographic order and case is significant. */)
1017void 1017void
1018syms_of_dired (void) 1018syms_of_dired (void)
1019{ 1019{
1020 Qdirectory_files = intern_c_string ("directory-files"); 1020 DEFSYM (Qdirectory_files, "directory-files");
1021 Qdirectory_files_and_attributes = intern_c_string ("directory-files-and-attributes"); 1021 DEFSYM (Qdirectory_files_and_attributes, "directory-files-and-attributes");
1022 Qfile_name_completion = intern_c_string ("file-name-completion"); 1022 DEFSYM (Qfile_name_completion, "file-name-completion");
1023 Qfile_name_all_completions = intern_c_string ("file-name-all-completions"); 1023 DEFSYM (Qfile_name_all_completions, "file-name-all-completions");
1024 Qfile_attributes = intern_c_string ("file-attributes"); 1024 DEFSYM (Qfile_attributes, "file-attributes");
1025 Qfile_attributes_lessp = intern_c_string ("file-attributes-lessp"); 1025 DEFSYM (Qfile_attributes_lessp, "file-attributes-lessp");
1026 Qdefault_directory = intern_c_string ("default-directory"); 1026 DEFSYM (Qdefault_directory, "default-directory");
1027
1028 staticpro (&Qdirectory_files);
1029 staticpro (&Qdirectory_files_and_attributes);
1030 staticpro (&Qfile_name_completion);
1031 staticpro (&Qfile_name_all_completions);
1032 staticpro (&Qfile_attributes);
1033 staticpro (&Qfile_attributes_lessp);
1034 staticpro (&Qdefault_directory);
1035 1027
1036 defsubr (&Sdirectory_files); 1028 defsubr (&Sdirectory_files);
1037 defsubr (&Sdirectory_files_and_attributes); 1029 defsubr (&Sdirectory_files_and_attributes);
diff --git a/src/dispnew.c b/src/dispnew.c
index 52fec0305fb..bde90d847ce 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4551,6 +4551,7 @@ scrolling_window (struct window *w, int header_line_p)
4551 /* Copy on the display. */ 4551 /* Copy on the display. */
4552 if (r->current_y != r->desired_y) 4552 if (r->current_y != r->desired_y)
4553 { 4553 {
4554 rif->clear_window_mouse_face (w);
4554 rif->scroll_run_hook (w, r); 4555 rif->scroll_run_hook (w, r);
4555 4556
4556 /* Invalidate runs that copy from where we copied to. */ 4557 /* Invalidate runs that copy from where we copied to. */
@@ -6446,10 +6447,8 @@ syms_of_display (void)
6446 frame_and_buffer_state = Fmake_vector (make_number (20), Qlambda); 6447 frame_and_buffer_state = Fmake_vector (make_number (20), Qlambda);
6447 staticpro (&frame_and_buffer_state); 6448 staticpro (&frame_and_buffer_state);
6448 6449
6449 Qdisplay_table = intern_c_string ("display-table"); 6450 DEFSYM (Qdisplay_table, "display-table");
6450 staticpro (&Qdisplay_table); 6451 DEFSYM (Qredisplay_dont_pause, "redisplay-dont-pause");
6451 Qredisplay_dont_pause = intern_c_string ("redisplay-dont-pause");
6452 staticpro (&Qredisplay_dont_pause);
6453 6452
6454 DEFVAR_INT ("baud-rate", baud_rate, 6453 DEFVAR_INT ("baud-rate", baud_rate,
6455 doc: /* *The output baud rate of the terminal. 6454 doc: /* *The output baud rate of the terminal.
diff --git a/src/doc.c b/src/doc.c
index 48e0936510b..69646f5af51 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -945,8 +945,7 @@ a new string, without any text properties, is returned. */)
945void 945void
946syms_of_doc (void) 946syms_of_doc (void)
947{ 947{
948 Qfunction_documentation = intern_c_string ("function-documentation"); 948 DEFSYM (Qfunction_documentation, "function-documentation");
949 staticpro (&Qfunction_documentation);
950 949
951 DEFVAR_LISP ("internal-doc-file-name", Vdoc_file_name, 950 DEFVAR_LISP ("internal-doc-file-name", Vdoc_file_name,
952 doc: /* Name of file containing documentation strings of built-in symbols. */); 951 doc: /* Name of file containing documentation strings of built-in symbols. */);
diff --git a/src/editfns.c b/src/editfns.c
index c0c0e530265..5328b714b0f 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -4738,9 +4738,7 @@ syms_of_editfns (void)
4738 environbuf = 0; 4738 environbuf = 0;
4739 initial_tz = 0; 4739 initial_tz = 0;
4740 4740
4741 Qbuffer_access_fontify_functions 4741 DEFSYM (Qbuffer_access_fontify_functions, "buffer-access-fontify-functions");
4742 = intern_c_string ("buffer-access-fontify-functions");
4743 staticpro (&Qbuffer_access_fontify_functions);
4744 4742
4745 DEFVAR_LISP ("inhibit-field-text-motion", Vinhibit_field_text_motion, 4743 DEFVAR_LISP ("inhibit-field-text-motion", Vinhibit_field_text_motion,
4746 doc: /* Non-nil means text motion commands don't notice fields. */); 4744 doc: /* Non-nil means text motion commands don't notice fields. */);
@@ -4802,10 +4800,8 @@ functions if all the text being accessed has this property. */);
4802 defsubr (&Sregion_beginning); 4800 defsubr (&Sregion_beginning);
4803 defsubr (&Sregion_end); 4801 defsubr (&Sregion_end);
4804 4802
4805 staticpro (&Qfield); 4803 DEFSYM (Qfield, "field");
4806 Qfield = intern_c_string ("field"); 4804 DEFSYM (Qboundary, "boundary");
4807 staticpro (&Qboundary);
4808 Qboundary = intern_c_string ("boundary");
4809 defsubr (&Sfield_beginning); 4805 defsubr (&Sfield_beginning);
4810 defsubr (&Sfield_end); 4806 defsubr (&Sfield_end);
4811 defsubr (&Sfield_string); 4807 defsubr (&Sfield_string);
diff --git a/src/emacs.c b/src/emacs.c
index ba76adf7192..bfefa2bfa51 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2378,10 +2378,8 @@ from the parent process and its tty file descriptors. */)
2378void 2378void
2379syms_of_emacs (void) 2379syms_of_emacs (void)
2380{ 2380{
2381 Qfile_name_handler_alist = intern_c_string ("file-name-handler-alist"); 2381 DEFSYM (Qfile_name_handler_alist, "file-name-handler-alist");
2382 staticpro (&Qfile_name_handler_alist); 2382 DEFSYM (Qrisky_local_variable, "risky-local-variable");
2383 Qrisky_local_variable = intern_c_string ("risky-local-variable");
2384 staticpro (&Qrisky_local_variable);
2385 2383
2386#ifndef CANNOT_DUMP 2384#ifndef CANNOT_DUMP
2387 defsubr (&Sdump_emacs); 2385 defsubr (&Sdump_emacs);
diff --git a/src/eval.c b/src/eval.c
index be582775fea..6ca8eacb100 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -3694,46 +3694,23 @@ To prevent this happening, set `quit-flag' to nil
3694before making `inhibit-quit' nil. */); 3694before making `inhibit-quit' nil. */);
3695 Vinhibit_quit = Qnil; 3695 Vinhibit_quit = Qnil;
3696 3696
3697 Qinhibit_quit = intern_c_string ("inhibit-quit"); 3697 DEFSYM (Qinhibit_quit, "inhibit-quit");
3698 staticpro (&Qinhibit_quit); 3698 DEFSYM (Qautoload, "autoload");
3699 3699 DEFSYM (Qdebug_on_error, "debug-on-error");
3700 Qautoload = intern_c_string ("autoload"); 3700 DEFSYM (Qmacro, "macro");
3701 staticpro (&Qautoload); 3701 DEFSYM (Qdeclare, "declare");
3702
3703 Qdebug_on_error = intern_c_string ("debug-on-error");
3704 staticpro (&Qdebug_on_error);
3705
3706 Qmacro = intern_c_string ("macro");
3707 staticpro (&Qmacro);
3708
3709 Qdeclare = intern_c_string ("declare");
3710 staticpro (&Qdeclare);
3711 3702
3712 /* Note that the process handling also uses Qexit, but we don't want 3703 /* Note that the process handling also uses Qexit, but we don't want
3713 to staticpro it twice, so we just do it here. */ 3704 to staticpro it twice, so we just do it here. */
3714 Qexit = intern_c_string ("exit"); 3705 DEFSYM (Qexit, "exit");
3715 staticpro (&Qexit);
3716
3717 Qinteractive = intern_c_string ("interactive");
3718 staticpro (&Qinteractive);
3719
3720 Qcommandp = intern_c_string ("commandp");
3721 staticpro (&Qcommandp);
3722
3723 Qdefun = intern_c_string ("defun");
3724 staticpro (&Qdefun);
3725
3726 Qand_rest = intern_c_string ("&rest");
3727 staticpro (&Qand_rest);
3728
3729 Qand_optional = intern_c_string ("&optional");
3730 staticpro (&Qand_optional);
3731
3732 Qclosure = intern_c_string ("closure");
3733 staticpro (&Qclosure);
3734 3706
3735 Qdebug = intern_c_string ("debug"); 3707 DEFSYM (Qinteractive, "interactive");
3736 staticpro (&Qdebug); 3708 DEFSYM (Qcommandp, "commandp");
3709 DEFSYM (Qdefun, "defun");
3710 DEFSYM (Qand_rest, "&rest");
3711 DEFSYM (Qand_optional, "&optional");
3712 DEFSYM (Qclosure, "closure");
3713 DEFSYM (Qdebug, "debug");
3737 3714
3738 DEFVAR_LISP ("debug-on-error", Vdebug_on_error, 3715 DEFVAR_LISP ("debug-on-error", Vdebug_on_error,
3739 doc: /* *Non-nil means enter debugger if an error is signaled. 3716 doc: /* *Non-nil means enter debugger if an error is signaled.
@@ -3807,9 +3784,7 @@ The value the function returns is not used. */);
3807 Every element of this list can be either a cons (VAR . VAL) 3784 Every element of this list can be either a cons (VAR . VAL)
3808 specifying a lexical binding, or a single symbol VAR indicating 3785 specifying a lexical binding, or a single symbol VAR indicating
3809 that this variable should use dynamic scoping. */ 3786 that this variable should use dynamic scoping. */
3810 Qinternal_interpreter_environment 3787 DEFSYM (Qinternal_interpreter_environment, "internal-interpreter-environment");
3811 = intern_c_string ("internal-interpreter-environment");
3812 staticpro (&Qinternal_interpreter_environment);
3813 DEFVAR_LISP ("internal-interpreter-environment", 3788 DEFVAR_LISP ("internal-interpreter-environment",
3814 Vinternal_interpreter_environment, 3789 Vinternal_interpreter_environment,
3815 doc: /* If non-nil, the current lexical environment of the lisp interpreter. 3790 doc: /* If non-nil, the current lexical environment of the lisp interpreter.
@@ -3821,8 +3796,7 @@ alist of active lexical bindings. */);
3821 (Just imagine if someone makes it buffer-local). */ 3796 (Just imagine if someone makes it buffer-local). */
3822 Funintern (Qinternal_interpreter_environment, Qnil); 3797 Funintern (Qinternal_interpreter_environment, Qnil);
3823 3798
3824 Vrun_hooks = intern_c_string ("run-hooks"); 3799 DEFSYM (Vrun_hooks, "run-hooks");
3825 staticpro (&Vrun_hooks);
3826 3800
3827 staticpro (&Vautoload_queue); 3801 staticpro (&Vautoload_queue);
3828 Vautoload_queue = Qnil; 3802 Vautoload_queue = Qnil;
diff --git a/src/fileio.c b/src/fileio.c
index 824df8172e7..27fef42960a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5425,92 +5425,50 @@ Fread_file_name (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filena
5425void 5425void
5426syms_of_fileio (void) 5426syms_of_fileio (void)
5427{ 5427{
5428 Qoperations = intern_c_string ("operations"); 5428 DEFSYM (Qoperations, "operations");
5429 Qexpand_file_name = intern_c_string ("expand-file-name"); 5429 DEFSYM (Qexpand_file_name, "expand-file-name");
5430 Qsubstitute_in_file_name = intern_c_string ("substitute-in-file-name"); 5430 DEFSYM (Qsubstitute_in_file_name, "substitute-in-file-name");
5431 Qdirectory_file_name = intern_c_string ("directory-file-name"); 5431 DEFSYM (Qdirectory_file_name, "directory-file-name");
5432 Qfile_name_directory = intern_c_string ("file-name-directory"); 5432 DEFSYM (Qfile_name_directory, "file-name-directory");
5433 Qfile_name_nondirectory = intern_c_string ("file-name-nondirectory"); 5433 DEFSYM (Qfile_name_nondirectory, "file-name-nondirectory");
5434 Qunhandled_file_name_directory = intern_c_string ("unhandled-file-name-directory"); 5434 DEFSYM (Qunhandled_file_name_directory, "unhandled-file-name-directory");
5435 Qfile_name_as_directory = intern_c_string ("file-name-as-directory"); 5435 DEFSYM (Qfile_name_as_directory, "file-name-as-directory");
5436 Qcopy_file = intern_c_string ("copy-file"); 5436 DEFSYM (Qcopy_file, "copy-file");
5437 Qmake_directory_internal = intern_c_string ("make-directory-internal"); 5437 DEFSYM (Qmake_directory_internal, "make-directory-internal");
5438 Qmake_directory = intern_c_string ("make-directory"); 5438 DEFSYM (Qmake_directory, "make-directory");
5439 Qdelete_directory_internal = intern_c_string ("delete-directory-internal"); 5439 DEFSYM (Qdelete_directory_internal, "delete-directory-internal");
5440 Qdelete_file = intern_c_string ("delete-file"); 5440 DEFSYM (Qdelete_file, "delete-file");
5441 Qrename_file = intern_c_string ("rename-file"); 5441 DEFSYM (Qrename_file, "rename-file");
5442 Qadd_name_to_file = intern_c_string ("add-name-to-file"); 5442 DEFSYM (Qadd_name_to_file, "add-name-to-file");
5443 Qmake_symbolic_link = intern_c_string ("make-symbolic-link"); 5443 DEFSYM (Qmake_symbolic_link, "make-symbolic-link");
5444 Qfile_exists_p = intern_c_string ("file-exists-p"); 5444 DEFSYM (Qfile_exists_p, "file-exists-p");
5445 Qfile_executable_p = intern_c_string ("file-executable-p"); 5445 DEFSYM (Qfile_executable_p, "file-executable-p");
5446 Qfile_readable_p = intern_c_string ("file-readable-p"); 5446 DEFSYM (Qfile_readable_p, "file-readable-p");
5447 Qfile_writable_p = intern_c_string ("file-writable-p"); 5447 DEFSYM (Qfile_writable_p, "file-writable-p");
5448 Qfile_symlink_p = intern_c_string ("file-symlink-p"); 5448 DEFSYM (Qfile_symlink_p, "file-symlink-p");
5449 Qaccess_file = intern_c_string ("access-file"); 5449 DEFSYM (Qaccess_file, "access-file");
5450 Qfile_directory_p = intern_c_string ("file-directory-p"); 5450 DEFSYM (Qfile_directory_p, "file-directory-p");
5451 Qfile_regular_p = intern_c_string ("file-regular-p"); 5451 DEFSYM (Qfile_regular_p, "file-regular-p");
5452 Qfile_accessible_directory_p = intern_c_string ("file-accessible-directory-p"); 5452 DEFSYM (Qfile_accessible_directory_p, "file-accessible-directory-p");
5453 Qfile_modes = intern_c_string ("file-modes"); 5453 DEFSYM (Qfile_modes, "file-modes");
5454 Qset_file_modes = intern_c_string ("set-file-modes"); 5454 DEFSYM (Qset_file_modes, "set-file-modes");
5455 Qset_file_times = intern_c_string ("set-file-times"); 5455 DEFSYM (Qset_file_times, "set-file-times");
5456 Qfile_selinux_context = intern_c_string("file-selinux-context"); 5456 DEFSYM (Qfile_selinux_context, "file-selinux-context");
5457 Qset_file_selinux_context = intern_c_string("set-file-selinux-context"); 5457 DEFSYM (Qset_file_selinux_context, "set-file-selinux-context");
5458 Qfile_newer_than_file_p = intern_c_string ("file-newer-than-file-p"); 5458 DEFSYM (Qfile_newer_than_file_p, "file-newer-than-file-p");
5459 Qinsert_file_contents = intern_c_string ("insert-file-contents"); 5459 DEFSYM (Qinsert_file_contents, "insert-file-contents");
5460 Qwrite_region = intern_c_string ("write-region"); 5460 DEFSYM (Qwrite_region, "write-region");
5461 Qverify_visited_file_modtime = intern_c_string ("verify-visited-file-modtime"); 5461 DEFSYM (Qverify_visited_file_modtime, "verify-visited-file-modtime");
5462 Qset_visited_file_modtime = intern_c_string ("set-visited-file-modtime"); 5462 DEFSYM (Qset_visited_file_modtime, "set-visited-file-modtime");
5463 Qauto_save_coding = intern_c_string ("auto-save-coding"); 5463 DEFSYM (Qauto_save_coding, "auto-save-coding");
5464 5464
5465 staticpro (&Qoperations); 5465 DEFSYM (Qfile_name_history, "file-name-history");
5466 staticpro (&Qexpand_file_name);
5467 staticpro (&Qsubstitute_in_file_name);
5468 staticpro (&Qdirectory_file_name);
5469 staticpro (&Qfile_name_directory);
5470 staticpro (&Qfile_name_nondirectory);
5471 staticpro (&Qunhandled_file_name_directory);
5472 staticpro (&Qfile_name_as_directory);
5473 staticpro (&Qcopy_file);
5474 staticpro (&Qmake_directory_internal);
5475 staticpro (&Qmake_directory);
5476 staticpro (&Qdelete_directory_internal);
5477 staticpro (&Qdelete_file);
5478 staticpro (&Qrename_file);
5479 staticpro (&Qadd_name_to_file);
5480 staticpro (&Qmake_symbolic_link);
5481 staticpro (&Qfile_exists_p);
5482 staticpro (&Qfile_executable_p);
5483 staticpro (&Qfile_readable_p);
5484 staticpro (&Qfile_writable_p);
5485 staticpro (&Qaccess_file);
5486 staticpro (&Qfile_symlink_p);
5487 staticpro (&Qfile_directory_p);
5488 staticpro (&Qfile_regular_p);
5489 staticpro (&Qfile_accessible_directory_p);
5490 staticpro (&Qfile_modes);
5491 staticpro (&Qset_file_modes);
5492 staticpro (&Qset_file_times);
5493 staticpro (&Qfile_selinux_context);
5494 staticpro (&Qset_file_selinux_context);
5495 staticpro (&Qfile_newer_than_file_p);
5496 staticpro (&Qinsert_file_contents);
5497 staticpro (&Qwrite_region);
5498 staticpro (&Qverify_visited_file_modtime);
5499 staticpro (&Qset_visited_file_modtime);
5500 staticpro (&Qauto_save_coding);
5501
5502 Qfile_name_history = intern_c_string ("file-name-history");
5503 Fset (Qfile_name_history, Qnil); 5466 Fset (Qfile_name_history, Qnil);
5504 staticpro (&Qfile_name_history);
5505 5467
5506 Qfile_error = intern_c_string ("file-error"); 5468 DEFSYM (Qfile_error, "file-error");
5507 staticpro (&Qfile_error); 5469 DEFSYM (Qfile_already_exists, "file-already-exists");
5508 Qfile_already_exists = intern_c_string ("file-already-exists"); 5470 DEFSYM (Qfile_date_error, "file-date-error");
5509 staticpro (&Qfile_already_exists); 5471 DEFSYM (Qexcl, "excl");
5510 Qfile_date_error = intern_c_string ("file-date-error");
5511 staticpro (&Qfile_date_error);
5512 Qexcl = intern_c_string ("excl");
5513 staticpro (&Qexcl);
5514 5472
5515 DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system, 5473 DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system,
5516 doc: /* *Coding system for encoding file names. 5474 doc: /* *Coding system for encoding file names.
@@ -5528,15 +5486,10 @@ instead use `file-name-coding-system' to get a constant encoding
5528of file names regardless of the current language environment. */); 5486of file names regardless of the current language environment. */);
5529 Vdefault_file_name_coding_system = Qnil; 5487 Vdefault_file_name_coding_system = Qnil;
5530 5488
5531 Qformat_decode = intern_c_string ("format-decode"); 5489 DEFSYM (Qformat_decode, "format-decode");
5532 staticpro (&Qformat_decode); 5490 DEFSYM (Qformat_annotate_function, "format-annotate-function");
5533 Qformat_annotate_function = intern_c_string ("format-annotate-function"); 5491 DEFSYM (Qafter_insert_file_set_coding, "after-insert-file-set-coding");
5534 staticpro (&Qformat_annotate_function); 5492 DEFSYM (Qcar_less_than_car, "car-less-than-car");
5535 Qafter_insert_file_set_coding = intern_c_string ("after-insert-file-set-coding");
5536 staticpro (&Qafter_insert_file_set_coding);
5537
5538 Qcar_less_than_car = intern_c_string ("car-less-than-car");
5539 staticpro (&Qcar_less_than_car);
5540 5493
5541 Fput (Qfile_error, Qerror_conditions, 5494 Fput (Qfile_error, Qerror_conditions,
5542 Fpurecopy (list2 (Qfile_error, Qerror))); 5495 Fpurecopy (list2 (Qfile_error, Qerror)));
@@ -5615,9 +5568,7 @@ After `write-region' completes, Emacs calls the function stored in
5615current when building the annotations (i.e., at least once), with that 5568current when building the annotations (i.e., at least once), with that
5616buffer current. */); 5569buffer current. */);
5617 Vwrite_region_annotate_functions = Qnil; 5570 Vwrite_region_annotate_functions = Qnil;
5618 staticpro (&Qwrite_region_annotate_functions); 5571 DEFSYM (Qwrite_region_annotate_functions, "write-region-annotate-functions");
5619 Qwrite_region_annotate_functions
5620 = intern_c_string ("write-region-annotate-functions");
5621 5572
5622 DEFVAR_LISP ("write-region-post-annotation-function", 5573 DEFVAR_LISP ("write-region-post-annotation-function",
5623 Vwrite_region_post_annotation_function, 5574 Vwrite_region_post_annotation_function,
@@ -5681,12 +5632,10 @@ This includes interactive calls to `delete-file' and
5681`delete-directory' and the Dired deletion commands. */); 5632`delete-directory' and the Dired deletion commands. */);
5682 delete_by_moving_to_trash = 0; 5633 delete_by_moving_to_trash = 0;
5683 Qdelete_by_moving_to_trash = intern_c_string ("delete-by-moving-to-trash"); 5634 Qdelete_by_moving_to_trash = intern_c_string ("delete-by-moving-to-trash");
5684 Qmove_file_to_trash = intern_c_string ("move-file-to-trash"); 5635
5685 staticpro (&Qmove_file_to_trash); 5636 DEFSYM (Qmove_file_to_trash, "move-file-to-trash");
5686 Qcopy_directory = intern_c_string ("copy-directory"); 5637 DEFSYM (Qcopy_directory, "copy-directory");
5687 staticpro (&Qcopy_directory); 5638 DEFSYM (Qdelete_directory, "delete-directory");
5688 Qdelete_directory = intern_c_string ("delete-directory");
5689 staticpro (&Qdelete_directory);
5690 5639
5691 defsubr (&Sfind_file_name_handler); 5640 defsubr (&Sfind_file_name_handler);
5692 defsubr (&Sfile_name_directory); 5641 defsubr (&Sfile_name_directory);
diff --git a/src/fns.c b/src/fns.c
index 5bf274030a3..b6fe2a7f7b6 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4854,34 +4854,20 @@ syms_of_fns (void)
4854 DEFSYM (Qsha512, "sha512"); 4854 DEFSYM (Qsha512, "sha512");
4855 4855
4856 /* Hash table stuff. */ 4856 /* Hash table stuff. */
4857 Qhash_table_p = intern_c_string ("hash-table-p"); 4857 DEFSYM (Qhash_table_p, "hash-table-p");
4858 staticpro (&Qhash_table_p); 4858 DEFSYM (Qeq, "eq");
4859 Qeq = intern_c_string ("eq"); 4859 DEFSYM (Qeql, "eql");
4860 staticpro (&Qeq); 4860 DEFSYM (Qequal, "equal");
4861 Qeql = intern_c_string ("eql"); 4861 DEFSYM (QCtest, ":test");
4862 staticpro (&Qeql); 4862 DEFSYM (QCsize, ":size");
4863 Qequal = intern_c_string ("equal"); 4863 DEFSYM (QCrehash_size, ":rehash-size");
4864 staticpro (&Qequal); 4864 DEFSYM (QCrehash_threshold, ":rehash-threshold");
4865 QCtest = intern_c_string (":test"); 4865 DEFSYM (QCweakness, ":weakness");
4866 staticpro (&QCtest); 4866 DEFSYM (Qkey, "key");
4867 QCsize = intern_c_string (":size"); 4867 DEFSYM (Qvalue, "value");
4868 staticpro (&QCsize); 4868 DEFSYM (Qhash_table_test, "hash-table-test");
4869 QCrehash_size = intern_c_string (":rehash-size"); 4869 DEFSYM (Qkey_or_value, "key-or-value");
4870 staticpro (&QCrehash_size); 4870 DEFSYM (Qkey_and_value, "key-and-value");
4871 QCrehash_threshold = intern_c_string (":rehash-threshold");
4872 staticpro (&QCrehash_threshold);
4873 QCweakness = intern_c_string (":weakness");
4874 staticpro (&QCweakness);
4875 Qkey = intern_c_string ("key");
4876 staticpro (&Qkey);
4877 Qvalue = intern_c_string ("value");
4878 staticpro (&Qvalue);
4879 Qhash_table_test = intern_c_string ("hash-table-test");
4880 staticpro (&Qhash_table_test);
4881 Qkey_or_value = intern_c_string ("key-or-value");
4882 staticpro (&Qkey_or_value);
4883 Qkey_and_value = intern_c_string ("key-and-value");
4884 staticpro (&Qkey_and_value);
4885 4871
4886 defsubr (&Ssxhash); 4872 defsubr (&Ssxhash);
4887 defsubr (&Smake_hash_table); 4873 defsubr (&Smake_hash_table);
@@ -4900,18 +4886,12 @@ syms_of_fns (void)
4900 defsubr (&Smaphash); 4886 defsubr (&Smaphash);
4901 defsubr (&Sdefine_hash_table_test); 4887 defsubr (&Sdefine_hash_table_test);
4902 4888
4903 Qstring_lessp = intern_c_string ("string-lessp"); 4889 DEFSYM (Qstring_lessp, "string-lessp");
4904 staticpro (&Qstring_lessp); 4890 DEFSYM (Qprovide, "provide");
4905 Qprovide = intern_c_string ("provide"); 4891 DEFSYM (Qrequire, "require");
4906 staticpro (&Qprovide); 4892 DEFSYM (Qyes_or_no_p_history, "yes-or-no-p-history");
4907 Qrequire = intern_c_string ("require"); 4893 DEFSYM (Qcursor_in_echo_area, "cursor-in-echo-area");
4908 staticpro (&Qrequire); 4894 DEFSYM (Qwidget_type, "widget-type");
4909 Qyes_or_no_p_history = intern_c_string ("yes-or-no-p-history");
4910 staticpro (&Qyes_or_no_p_history);
4911 Qcursor_in_echo_area = intern_c_string ("cursor-in-echo-area");
4912 staticpro (&Qcursor_in_echo_area);
4913 Qwidget_type = intern_c_string ("widget-type");
4914 staticpro (&Qwidget_type);
4915 4895
4916 staticpro (&string_char_byte_cache_string); 4896 staticpro (&string_char_byte_cache_string);
4917 string_char_byte_cache_string = Qnil; 4897 string_char_byte_cache_string = Qnil;
@@ -4925,18 +4905,13 @@ syms_of_fns (void)
4925 doc: /* A list of symbols which are the features of the executing Emacs. 4905 doc: /* A list of symbols which are the features of the executing Emacs.
4926Used by `featurep' and `require', and altered by `provide'. */); 4906Used by `featurep' and `require', and altered by `provide'. */);
4927 Vfeatures = Fcons (intern_c_string ("emacs"), Qnil); 4907 Vfeatures = Fcons (intern_c_string ("emacs"), Qnil);
4928 Qsubfeatures = intern_c_string ("subfeatures"); 4908 DEFSYM (Qsubfeatures, "subfeatures");
4929 staticpro (&Qsubfeatures);
4930 4909
4931#ifdef HAVE_LANGINFO_CODESET 4910#ifdef HAVE_LANGINFO_CODESET
4932 Qcodeset = intern_c_string ("codeset"); 4911 DEFSYM (Qcodeset, "codeset");
4933 staticpro (&Qcodeset); 4912 DEFSYM (Qdays, "days");
4934 Qdays = intern_c_string ("days"); 4913 DEFSYM (Qmonths, "months");
4935 staticpro (&Qdays); 4914 DEFSYM (Qpaper, "paper");
4936 Qmonths = intern_c_string ("months");
4937 staticpro (&Qmonths);
4938 Qpaper = intern_c_string ("paper");
4939 staticpro (&Qpaper);
4940#endif /* HAVE_LANGINFO_CODESET */ 4915#endif /* HAVE_LANGINFO_CODESET */
4941 4916
4942 DEFVAR_BOOL ("use-dialog-box", use_dialog_box, 4917 DEFVAR_BOOL ("use-dialog-box", use_dialog_box,
diff --git a/src/frame.c b/src/frame.c
index 27a31fac3e7..635996ca424 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -4240,104 +4240,58 @@ selected frame. This is useful when `make-pointer-invisible' is set. */)
4240void 4240void
4241syms_of_frame (void) 4241syms_of_frame (void)
4242{ 4242{
4243 Qframep = intern_c_string ("framep"); 4243 DEFSYM (Qframep, "framep");
4244 staticpro (&Qframep); 4244 DEFSYM (Qframe_live_p, "frame-live-p");
4245 Qframe_live_p = intern_c_string ("frame-live-p"); 4245 DEFSYM (Qexplicit_name, "explicit-name");
4246 staticpro (&Qframe_live_p); 4246 DEFSYM (Qheight, "height");
4247 Qexplicit_name = intern_c_string ("explicit-name"); 4247 DEFSYM (Qicon, "icon");
4248 staticpro (&Qexplicit_name); 4248 DEFSYM (Qminibuffer, "minibuffer");
4249 Qheight = intern_c_string ("height"); 4249 DEFSYM (Qmodeline, "modeline");
4250 staticpro (&Qheight); 4250 DEFSYM (Qonly, "only");
4251 Qicon = intern_c_string ("icon"); 4251 DEFSYM (Qwidth, "width");
4252 staticpro (&Qicon); 4252 DEFSYM (Qgeometry, "geometry");
4253 Qminibuffer = intern_c_string ("minibuffer"); 4253 DEFSYM (Qicon_left, "icon-left");
4254 staticpro (&Qminibuffer); 4254 DEFSYM (Qicon_top, "icon-top");
4255 Qmodeline = intern_c_string ("modeline"); 4255 DEFSYM (Qtooltip, "tooltip");
4256 staticpro (&Qmodeline); 4256 DEFSYM (Qleft, "left");
4257 Qonly = intern_c_string ("only"); 4257 DEFSYM (Qright, "right");
4258 staticpro (&Qonly); 4258 DEFSYM (Quser_position, "user-position");
4259 Qwidth = intern_c_string ("width"); 4259 DEFSYM (Quser_size, "user-size");
4260 staticpro (&Qwidth); 4260 DEFSYM (Qwindow_id, "window-id");
4261 Qgeometry = intern_c_string ("geometry");
4262 staticpro (&Qgeometry);
4263 Qicon_left = intern_c_string ("icon-left");
4264 staticpro (&Qicon_left);
4265 Qicon_top = intern_c_string ("icon-top");
4266 staticpro (&Qicon_top);
4267 Qtooltip = intern_c_string ("tooltip");
4268 staticpro (&Qtooltip);
4269 Qleft = intern_c_string ("left");
4270 staticpro (&Qleft);
4271 Qright = intern_c_string ("right");
4272 staticpro (&Qright);
4273 Quser_position = intern_c_string ("user-position");
4274 staticpro (&Quser_position);
4275 Quser_size = intern_c_string ("user-size");
4276 staticpro (&Quser_size);
4277 Qwindow_id = intern_c_string ("window-id");
4278 staticpro (&Qwindow_id);
4279#ifdef HAVE_X_WINDOWS 4261#ifdef HAVE_X_WINDOWS
4280 Qouter_window_id = intern_c_string ("outer-window-id"); 4262 DEFSYM (Qouter_window_id, "outer-window-id");
4281 staticpro (&Qouter_window_id);
4282#endif 4263#endif
4283 Qparent_id = intern_c_string ("parent-id"); 4264 DEFSYM (Qparent_id, "parent-id");
4284 staticpro (&Qparent_id); 4265 DEFSYM (Qx, "x");
4285 Qx = intern_c_string ("x"); 4266 DEFSYM (Qw32, "w32");
4286 staticpro (&Qx); 4267 DEFSYM (Qpc, "pc");
4287 Qw32 = intern_c_string ("w32"); 4268 DEFSYM (Qmac, "mac");
4288 staticpro (&Qw32); 4269 DEFSYM (Qns, "ns");
4289 Qpc = intern_c_string ("pc"); 4270 DEFSYM (Qvisible, "visible");
4290 staticpro (&Qpc); 4271 DEFSYM (Qbuffer_predicate, "buffer-predicate");
4291 Qmac = intern_c_string ("mac"); 4272 DEFSYM (Qbuffer_list, "buffer-list");
4292 staticpro (&Qmac); 4273 DEFSYM (Qburied_buffer_list, "buried-buffer-list");
4293 Qns = intern_c_string ("ns"); 4274 DEFSYM (Qdisplay_type, "display-type");
4294 staticpro (&Qns); 4275 DEFSYM (Qbackground_mode, "background-mode");
4295 Qvisible = intern_c_string ("visible"); 4276 DEFSYM (Qnoelisp, "noelisp");
4296 staticpro (&Qvisible); 4277 DEFSYM (Qtty_color_mode, "tty-color-mode");
4297 Qbuffer_predicate = intern_c_string ("buffer-predicate"); 4278 DEFSYM (Qtty, "tty");
4298 staticpro (&Qbuffer_predicate); 4279 DEFSYM (Qtty_type, "tty-type");
4299 Qbuffer_list = intern_c_string ("buffer-list"); 4280
4300 staticpro (&Qbuffer_list); 4281 DEFSYM (Qface_set_after_frame_default, "face-set-after-frame-default");
4301 Qburied_buffer_list = intern_c_string ("buried-buffer-list"); 4282
4302 staticpro (&Qburied_buffer_list); 4283 DEFSYM (Qfullwidth, "fullwidth");
4303 Qdisplay_type = intern_c_string ("display-type"); 4284 DEFSYM (Qfullheight, "fullheight");
4304 staticpro (&Qdisplay_type); 4285 DEFSYM (Qfullboth, "fullboth");
4305 Qbackground_mode = intern_c_string ("background-mode"); 4286 DEFSYM (Qmaximized, "maximized");
4306 staticpro (&Qbackground_mode); 4287 DEFSYM (Qx_resource_name, "x-resource-name");
4307 Qnoelisp = intern_c_string ("noelisp"); 4288 DEFSYM (Qx_frame_parameter, "x-frame-parameter");
4308 staticpro (&Qnoelisp); 4289
4309 Qtty_color_mode = intern_c_string ("tty-color-mode"); 4290 DEFSYM (Qterminal, "terminal");
4310 staticpro (&Qtty_color_mode); 4291 DEFSYM (Qterminal_live_p, "terminal-live-p");
4311 Qtty = intern_c_string ("tty");
4312 staticpro (&Qtty);
4313 Qtty_type = intern_c_string ("tty-type");
4314 staticpro (&Qtty_type);
4315
4316 Qface_set_after_frame_default = intern_c_string ("face-set-after-frame-default");
4317 staticpro (&Qface_set_after_frame_default);
4318
4319 Qfullwidth = intern_c_string ("fullwidth");
4320 staticpro (&Qfullwidth);
4321 Qfullheight = intern_c_string ("fullheight");
4322 staticpro (&Qfullheight);
4323 Qfullboth = intern_c_string ("fullboth");
4324 staticpro (&Qfullboth);
4325 Qmaximized = intern_c_string ("maximized");
4326 staticpro (&Qmaximized);
4327 Qx_resource_name = intern_c_string ("x-resource-name");
4328 staticpro (&Qx_resource_name);
4329
4330 Qx_frame_parameter = intern_c_string ("x-frame-parameter");
4331 staticpro (&Qx_frame_parameter);
4332
4333 Qterminal = intern_c_string ("terminal");
4334 staticpro (&Qterminal);
4335 Qterminal_live_p = intern_c_string ("terminal-live-p");
4336 staticpro (&Qterminal_live_p);
4337 4292
4338#ifdef HAVE_NS 4293#ifdef HAVE_NS
4339 Qns_parse_geometry = intern_c_string ("ns-parse-geometry"); 4294 DEFSYM (Qns_parse_geometry, "ns-parse-geometry");
4340 staticpro (&Qns_parse_geometry);
4341#endif 4295#endif
4342 4296
4343 { 4297 {
@@ -4451,8 +4405,7 @@ actually deleted, or some time later (or even both when an earlier function
4451in `delete-frame-functions' (indirectly) calls `delete-frame' 4405in `delete-frame-functions' (indirectly) calls `delete-frame'
4452recursively). */); 4406recursively). */);
4453 Vdelete_frame_functions = Qnil; 4407 Vdelete_frame_functions = Qnil;
4454 Qdelete_frame_functions = intern_c_string ("delete-frame-functions"); 4408 DEFSYM (Qdelete_frame_functions, "delete-frame-functions");
4455 staticpro (&Qdelete_frame_functions);
4456 4409
4457 DEFVAR_LISP ("menu-bar-mode", Vmenu_bar_mode, 4410 DEFVAR_LISP ("menu-bar-mode", Vmenu_bar_mode,
4458 doc: /* Non-nil if Menu-Bar mode is enabled. 4411 doc: /* Non-nil if Menu-Bar mode is enabled.
diff --git a/src/fringe.c b/src/fringe.c
index d886ac48852..a4dc9433aff 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1738,18 +1738,12 @@ Return nil if POS is not visible in WINDOW. */)
1738void 1738void
1739syms_of_fringe (void) 1739syms_of_fringe (void)
1740{ 1740{
1741 Qtruncation = intern_c_string ("truncation"); 1741 DEFSYM (Qtruncation, "truncation");
1742 staticpro (&Qtruncation); 1742 DEFSYM (Qcontinuation, "continuation");
1743 Qcontinuation = intern_c_string ("continuation"); 1743 DEFSYM (Qoverlay_arrow, "overlay-arrow");
1744 staticpro (&Qcontinuation); 1744 DEFSYM (Qempty_line, "empty-line");
1745 Qoverlay_arrow = intern_c_string ("overlay-arrow"); 1745 DEFSYM (Qtop_bottom, "top-bottom");
1746 staticpro (&Qoverlay_arrow); 1746 DEFSYM (Qhollow_small, "hollow-small");
1747 Qempty_line = intern_c_string ("empty-line");
1748 staticpro (&Qempty_line);
1749 Qtop_bottom = intern_c_string ("top-bottom");
1750 staticpro (&Qtop_bottom);
1751 Qhollow_small = intern_c_string ("hollow-small");
1752 staticpro (&Qhollow_small);
1753 1747
1754 defsubr (&Sdestroy_fringe_bitmap); 1748 defsubr (&Sdestroy_fringe_bitmap);
1755 defsubr (&Sdefine_fringe_bitmap); 1749 defsubr (&Sdefine_fringe_bitmap);
diff --git a/src/gnutls.c b/src/gnutls.c
index 9342ce7912e..b59d0b265f2 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1101,72 +1101,36 @@ syms_of_gnutls (void)
1101{ 1101{
1102 gnutls_global_initialized = 0; 1102 gnutls_global_initialized = 0;
1103 1103
1104 Qgnutls_dll = intern_c_string ("gnutls"); 1104 DEFSYM(Qgnutls_dll, "gnutls");
1105 staticpro (&Qgnutls_dll); 1105 DEFSYM(Qgnutls_log_level, "gnutls-log-level");
1106 1106 DEFSYM(Qgnutls_code, "gnutls-code");
1107 Qgnutls_log_level = intern_c_string ("gnutls-log-level"); 1107 DEFSYM(Qgnutls_anon, "gnutls-anon");
1108 staticpro (&Qgnutls_log_level); 1108 DEFSYM(Qgnutls_x509pki, "gnutls-x509pki");
1109 1109 DEFSYM(Qgnutls_bootprop_hostname, ":hostname");
1110 Qgnutls_code = intern_c_string ("gnutls-code"); 1110 DEFSYM(Qgnutls_bootprop_priority, ":priority");
1111 staticpro (&Qgnutls_code); 1111 DEFSYM(Qgnutls_bootprop_trustfiles, ":trustfiles");
1112 1112 DEFSYM(Qgnutls_bootprop_keylist, ":keylist");
1113 Qgnutls_anon = intern_c_string ("gnutls-anon"); 1113 DEFSYM(Qgnutls_bootprop_crlfiles, ":crlfiles");
1114 staticpro (&Qgnutls_anon); 1114 DEFSYM(Qgnutls_bootprop_callbacks, ":callbacks");
1115 1115 DEFSYM(Qgnutls_bootprop_callbacks_verify, "verify");
1116 Qgnutls_x509pki = intern_c_string ("gnutls-x509pki"); 1116 DEFSYM(Qgnutls_bootprop_loglevel, ":loglevel");
1117 staticpro (&Qgnutls_x509pki); 1117 DEFSYM(Qgnutls_bootprop_verify_flags, ":verify-flags");
1118 1118 DEFSYM(Qgnutls_bootprop_verify_hostname_error, ":verify-error");
1119 Qgnutls_bootprop_hostname = intern_c_string (":hostname"); 1119 DEFSYM(Qgnutls_bootprop_verify_hostname_error, ":verify-hostname-error");
1120 staticpro (&Qgnutls_bootprop_hostname); 1120
1121 1121 DEFSYM(Qgnutls_e_interrupted, "gnutls-e-interrupted");
1122 Qgnutls_bootprop_priority = intern_c_string (":priority");
1123 staticpro (&Qgnutls_bootprop_priority);
1124
1125 Qgnutls_bootprop_trustfiles = intern_c_string (":trustfiles");
1126 staticpro (&Qgnutls_bootprop_trustfiles);
1127
1128 Qgnutls_bootprop_keylist = intern_c_string (":keylist");
1129 staticpro (&Qgnutls_bootprop_keylist);
1130
1131 Qgnutls_bootprop_crlfiles = intern_c_string (":crlfiles");
1132 staticpro (&Qgnutls_bootprop_crlfiles);
1133
1134 Qgnutls_bootprop_callbacks = intern_c_string (":callbacks");
1135 staticpro (&Qgnutls_bootprop_callbacks);
1136
1137 Qgnutls_bootprop_callbacks_verify = intern_c_string ("verify");
1138 staticpro (&Qgnutls_bootprop_callbacks_verify);
1139
1140 Qgnutls_bootprop_loglevel = intern_c_string (":loglevel");
1141 staticpro (&Qgnutls_bootprop_loglevel);
1142
1143 Qgnutls_bootprop_verify_flags = intern_c_string (":verify-flags");
1144 staticpro (&Qgnutls_bootprop_verify_flags);
1145
1146 Qgnutls_bootprop_verify_hostname_error = intern_c_string (":verify-error");
1147 staticpro (&Qgnutls_bootprop_verify_error);
1148
1149 Qgnutls_bootprop_verify_hostname_error = intern_c_string (":verify-hostname-error");
1150 staticpro (&Qgnutls_bootprop_verify_hostname_error);
1151
1152 Qgnutls_e_interrupted = intern_c_string ("gnutls-e-interrupted");
1153 staticpro (&Qgnutls_e_interrupted);
1154 Fput (Qgnutls_e_interrupted, Qgnutls_code, 1122 Fput (Qgnutls_e_interrupted, Qgnutls_code,
1155 make_number (GNUTLS_E_INTERRUPTED)); 1123 make_number (GNUTLS_E_INTERRUPTED));
1156 1124
1157 Qgnutls_e_again = intern_c_string ("gnutls-e-again"); 1125 DEFSYM(Qgnutls_e_again, "gnutls-e-again");
1158 staticpro (&Qgnutls_e_again);
1159 Fput (Qgnutls_e_again, Qgnutls_code, 1126 Fput (Qgnutls_e_again, Qgnutls_code,
1160 make_number (GNUTLS_E_AGAIN)); 1127 make_number (GNUTLS_E_AGAIN));
1161 1128
1162 Qgnutls_e_invalid_session = intern_c_string ("gnutls-e-invalid-session"); 1129 DEFSYM(Qgnutls_e_invalid_session, "gnutls-e-invalid-session");
1163 staticpro (&Qgnutls_e_invalid_session);
1164 Fput (Qgnutls_e_invalid_session, Qgnutls_code, 1130 Fput (Qgnutls_e_invalid_session, Qgnutls_code,
1165 make_number (GNUTLS_E_INVALID_SESSION)); 1131 make_number (GNUTLS_E_INVALID_SESSION));
1166 1132
1167 Qgnutls_e_not_ready_for_handshake = 1133 DEFSYM(Qgnutls_e_not_ready_for_handshake, "gnutls-e-not-ready-for-handshake");
1168 intern_c_string ("gnutls-e-not-ready-for-handshake");
1169 staticpro (&Qgnutls_e_not_ready_for_handshake);
1170 Fput (Qgnutls_e_not_ready_for_handshake, Qgnutls_code, 1134 Fput (Qgnutls_e_not_ready_for_handshake, Qgnutls_code,
1171 make_number (GNUTLS_E_APPLICATION_ERROR_MIN)); 1135 make_number (GNUTLS_E_APPLICATION_ERROR_MIN));
1172 1136
diff --git a/src/image.c b/src/image.c
index a9785e5d00f..6e8440fb431 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1836,6 +1836,8 @@ cache_image (struct frame *f, struct image *img)
1836 /* If no free slot found, maybe enlarge c->images. */ 1836 /* If no free slot found, maybe enlarge c->images. */
1837 if (i == c->used && c->used == c->size) 1837 if (i == c->used && c->used == c->size)
1838 { 1838 {
1839 if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *c->images / 2 < c->size)
1840 memory_full (SIZE_MAX);
1839 c->size *= 2; 1841 c->size *= 2;
1840 c->images = (struct image **) xrealloc (c->images, 1842 c->images = (struct image **) xrealloc (c->images,
1841 c->size * sizeof *c->images); 1843 c->size * sizeof *c->images);
diff --git a/src/insdel.c b/src/insdel.c
index 64fd4797dc0..b6639f3ad8b 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -2222,8 +2222,7 @@ syms_of_insdel (void)
2222This affects `before-change-functions' and `after-change-functions', 2222This affects `before-change-functions' and `after-change-functions',
2223as well as hooks attached to text properties and overlays. */); 2223as well as hooks attached to text properties and overlays. */);
2224 inhibit_modification_hooks = 0; 2224 inhibit_modification_hooks = 0;
2225 Qinhibit_modification_hooks = intern_c_string ("inhibit-modification-hooks"); 2225 DEFSYM (Qinhibit_modification_hooks, "inhibit-modification-hooks");
2226 staticpro (&Qinhibit_modification_hooks);
2227 2226
2228 defsubr (&Scombine_after_change_execute); 2227 defsubr (&Scombine_after_change_execute);
2229} 2228}
diff --git a/src/keyboard.h b/src/keyboard.h
index 20763c35f3a..91008a3ea24 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -123,7 +123,7 @@ struct kboard
123 Lisp_Object *kbd_macro_end; 123 Lisp_Object *kbd_macro_end;
124 124
125 /* Allocated size of kbd_macro_buffer. */ 125 /* Allocated size of kbd_macro_buffer. */
126 int kbd_macro_bufsize; 126 ptrdiff_t kbd_macro_bufsize;
127 127
128 /* Last anonymous kbd macro defined. */ 128 /* Last anonymous kbd macro defined. */
129 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_kbd_macro); 129 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_kbd_macro);
diff --git a/src/keymap.c b/src/keymap.c
index 6ef2a716b6d..ac7f651e283 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3774,15 +3774,13 @@ Return list of symbols found. */)
3774void 3774void
3775syms_of_keymap (void) 3775syms_of_keymap (void)
3776{ 3776{
3777 Qkeymap = intern_c_string ("keymap"); 3777 DEFSYM (Qkeymap, "keymap");
3778 staticpro (&Qkeymap);
3779 staticpro (&apropos_predicate); 3778 staticpro (&apropos_predicate);
3780 staticpro (&apropos_accumulate); 3779 staticpro (&apropos_accumulate);
3781 apropos_predicate = Qnil; 3780 apropos_predicate = Qnil;
3782 apropos_accumulate = Qnil; 3781 apropos_accumulate = Qnil;
3783 3782
3784 Qkeymap_canonicalize = intern_c_string ("keymap-canonicalize"); 3783 DEFSYM (Qkeymap_canonicalize, "keymap-canonicalize");
3785 staticpro (&Qkeymap_canonicalize);
3786 3784
3787 /* Now we are ready to set up this property, so we can 3785 /* Now we are ready to set up this property, so we can
3788 create char tables. */ 3786 create char tables. */
@@ -3902,27 +3900,13 @@ preferred. */);
3902 pure_cons (intern_c_string ("mouse-5"), 3900 pure_cons (intern_c_string ("mouse-5"),
3903 Qnil))))))))); 3901 Qnil)))))))));
3904 3902
3905 3903 DEFSYM (Qsingle_key_description, "single-key-description");
3906 Qsingle_key_description = intern_c_string ("single-key-description"); 3904 DEFSYM (Qkey_description, "key-description");
3907 staticpro (&Qsingle_key_description); 3905 DEFSYM (Qkeymapp, "keymapp");
3908 3906 DEFSYM (Qnon_ascii, "non-ascii");
3909 Qkey_description = intern_c_string ("key-description"); 3907 DEFSYM (Qmenu_item, "menu-item");
3910 staticpro (&Qkey_description); 3908 DEFSYM (Qremap, "remap");
3911 3909 DEFSYM (QCadvertised_binding, ":advertised-binding");
3912 Qkeymapp = intern_c_string ("keymapp");
3913 staticpro (&Qkeymapp);
3914
3915 Qnon_ascii = intern_c_string ("non-ascii");
3916 staticpro (&Qnon_ascii);
3917
3918 Qmenu_item = intern_c_string ("menu-item");
3919 staticpro (&Qmenu_item);
3920
3921 Qremap = intern_c_string ("remap");
3922 staticpro (&Qremap);
3923
3924 QCadvertised_binding = intern_c_string (":advertised-binding");
3925 staticpro (&QCadvertised_binding);
3926 3910
3927 command_remapping_vector = Fmake_vector (make_number (2), Qremap); 3911 command_remapping_vector = Fmake_vector (make_number (2), Qremap);
3928 staticpro (&command_remapping_vector); 3912 staticpro (&command_remapping_vector);
diff --git a/src/lisp.h b/src/lisp.h
index 4c9543bdfe8..762d34abb9c 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1162,6 +1162,9 @@ struct Lisp_Symbol
1162 1162
1163#define SYMBOL_CONSTANT_P(sym) XSYMBOL (sym)->constant 1163#define SYMBOL_CONSTANT_P(sym) XSYMBOL (sym)->constant
1164 1164
1165#define DEFSYM(sym, name) \
1166 do { (sym) = intern_c_string ((name)); staticpro (&(sym)); } while (0)
1167
1165 1168
1166/*********************************************************************** 1169/***********************************************************************
1167 Hash Tables 1170 Hash Tables
@@ -1980,10 +1983,7 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
1980#define DEFVAR_KBOARD(lname, vname, doc) \ 1983#define DEFVAR_KBOARD(lname, vname, doc) \
1981 do { \ 1984 do { \
1982 static struct Lisp_Kboard_Objfwd ko_fwd; \ 1985 static struct Lisp_Kboard_Objfwd ko_fwd; \
1983 defvar_kboard (&ko_fwd, \ 1986 defvar_kboard (&ko_fwd, lname, offsetof (KBOARD, vname ## _)); \
1984 lname, \
1985 (int)((char *)(&current_kboard->vname ## _) \
1986 - (char *)current_kboard)); \
1987 } while (0) 1987 } while (0)
1988 1988
1989 1989
diff --git a/src/lread.c b/src/lread.c
index e75d61ae985..f937fa39f0f 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -120,9 +120,9 @@ static EMACS_INT readchar_count;
120/* This contains the last string skipped with #@. */ 120/* This contains the last string skipped with #@. */
121static char *saved_doc_string; 121static char *saved_doc_string;
122/* Length of buffer allocated in saved_doc_string. */ 122/* Length of buffer allocated in saved_doc_string. */
123static int saved_doc_string_size; 123static ptrdiff_t saved_doc_string_size;
124/* Length of actual data in saved_doc_string. */ 124/* Length of actual data in saved_doc_string. */
125static int saved_doc_string_length; 125static ptrdiff_t saved_doc_string_length;
126/* This is the file position that string came from. */ 126/* This is the file position that string came from. */
127static file_offset saved_doc_string_position; 127static file_offset saved_doc_string_position;
128 128
@@ -131,9 +131,9 @@ static file_offset saved_doc_string_position;
131 is put in saved_doc_string. */ 131 is put in saved_doc_string. */
132static char *prev_saved_doc_string; 132static char *prev_saved_doc_string;
133/* Length of buffer allocated in prev_saved_doc_string. */ 133/* Length of buffer allocated in prev_saved_doc_string. */
134static int prev_saved_doc_string_size; 134static ptrdiff_t prev_saved_doc_string_size;
135/* Length of actual data in prev_saved_doc_string. */ 135/* Length of actual data in prev_saved_doc_string. */
136static int prev_saved_doc_string_length; 136static ptrdiff_t prev_saved_doc_string_length;
137/* This is the file position that string came from. */ 137/* This is the file position that string came from. */
138static file_offset prev_saved_doc_string_position; 138static file_offset prev_saved_doc_string_position;
139 139
@@ -1069,9 +1069,9 @@ Return t if the file exists and loads successfully. */)
1069 1069
1070 /* Avoid weird lossage with null string as arg, 1070 /* Avoid weird lossage with null string as arg,
1071 since it would try to load a directory as a Lisp file */ 1071 since it would try to load a directory as a Lisp file */
1072 if (SCHARS (file) > 0) 1072 if (SBYTES (file) > 0)
1073 { 1073 {
1074 int size = SBYTES (file); 1074 ptrdiff_t size = SBYTES (file);
1075 1075
1076 found = Qnil; 1076 found = Qnil;
1077 GCPRO2 (file, found); 1077 GCPRO2 (file, found);
@@ -1472,7 +1472,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
1472 for (tail = NILP (suffixes) ? Fcons (empty_unibyte_string, Qnil) : suffixes; 1472 for (tail = NILP (suffixes) ? Fcons (empty_unibyte_string, Qnil) : suffixes;
1473 CONSP (tail); tail = XCDR (tail)) 1473 CONSP (tail); tail = XCDR (tail))
1474 { 1474 {
1475 int lsuffix = SBYTES (XCAR (tail)); 1475 ptrdiff_t lsuffix = SBYTES (XCAR (tail));
1476 Lisp_Object handler; 1476 Lisp_Object handler;
1477 int exists; 1477 int exists;
1478 1478
@@ -2037,7 +2037,7 @@ read0 (Lisp_Object readcharfun)
2037 Fmake_string (make_number (1), make_number (c))); 2037 Fmake_string (make_number (1), make_number (c)));
2038} 2038}
2039 2039
2040static int read_buffer_size; 2040static ptrdiff_t read_buffer_size;
2041static char *read_buffer; 2041static char *read_buffer;
2042 2042
2043/* Read a \-escape sequence, assuming we already read the `\'. 2043/* Read a \-escape sequence, assuming we already read the `\'.
@@ -2208,7 +2208,9 @@ read_escape (Lisp_Object readcharfun, int stringp)
2208 UNREAD (c); 2208 UNREAD (c);
2209 break; 2209 break;
2210 } 2210 }
2211 count++; 2211 if (MAX_CHAR < i)
2212 error ("Hex character out of range: \\x%x...", i);
2213 count += count < 3;
2212 } 2214 }
2213 2215
2214 if (count < 3 && i >= 0x80) 2216 if (count < 3 && i >= 0x80)
@@ -2236,10 +2238,7 @@ read_escape (Lisp_Object readcharfun, int stringp)
2236 else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10; 2238 else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10;
2237 else if (c >= 'A' && c <= 'F') i = (i << 4) + (c - 'A') + 10; 2239 else if (c >= 'A' && c <= 'F') i = (i << 4) + (c - 'A') + 10;
2238 else 2240 else
2239 { 2241 error ("Non-hex digit used for Unicode escape");
2240 error ("Non-hex digit used for Unicode escape");
2241 break;
2242 }
2243 } 2242 }
2244 if (i > 0x10FFFF) 2243 if (i > 0x10FFFF)
2245 error ("Non-Unicode character: 0x%x", i); 2244 error ("Non-Unicode character: 0x%x", i);
@@ -2278,10 +2277,12 @@ digit_to_number (int character, int base)
2278 range. */ 2277 range. */
2279 2278
2280static Lisp_Object 2279static Lisp_Object
2281read_integer (Lisp_Object readcharfun, int radix) 2280read_integer (Lisp_Object readcharfun, EMACS_INT radix)
2282{ 2281{
2283 /* Room for sign, leading 0, other digits, trailing null byte. */ 2282 /* Room for sign, leading 0, other digits, trailing null byte.
2284 char buf[1 + 1 + sizeof (uintmax_t) * CHAR_BIT + 1]; 2283 Also, room for invalid syntax diagnostic. */
2284 char buf[max (1 + 1 + sizeof (uintmax_t) * CHAR_BIT + 1,
2285 sizeof "integer, radix " + INT_STRLEN_BOUND (EMACS_INT))];
2285 2286
2286 int valid = -1; /* 1 if valid, 0 if not, -1 if incomplete. */ 2287 int valid = -1; /* 1 if valid, 0 if not, -1 if incomplete. */
2287 2288
@@ -2333,7 +2334,7 @@ read_integer (Lisp_Object readcharfun, int radix)
2333 2334
2334 if (! valid) 2335 if (! valid)
2335 { 2336 {
2336 sprintf (buf, "integer, radix %d", radix); 2337 sprintf (buf, "integer, radix %"pI"d", radix);
2337 invalid_syntax (buf); 2338 invalid_syntax (buf);
2338 } 2339 }
2339 2340
@@ -2471,7 +2472,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2471 if (c == '[') 2472 if (c == '[')
2472 { 2473 {
2473 Lisp_Object tmp; 2474 Lisp_Object tmp;
2474 int depth, size; 2475 EMACS_INT depth, size;
2475 2476
2476 tmp = read_vector (readcharfun, 0); 2477 tmp = read_vector (readcharfun, 0);
2477 if (!INTEGERP (AREF (tmp, 0))) 2478 if (!INTEGERP (AREF (tmp, 0)))
@@ -2497,7 +2498,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2497 if (c == '"') 2498 if (c == '"')
2498 { 2499 {
2499 Lisp_Object tmp, val; 2500 Lisp_Object tmp, val;
2500 int size_in_chars 2501 EMACS_INT size_in_chars
2501 = ((XFASTINT (length) + BOOL_VECTOR_BITS_PER_CHAR - 1) 2502 = ((XFASTINT (length) + BOOL_VECTOR_BITS_PER_CHAR - 1)
2502 / BOOL_VECTOR_BITS_PER_CHAR); 2503 / BOOL_VECTOR_BITS_PER_CHAR);
2503 2504
@@ -2569,13 +2570,16 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2569 and function definitions. */ 2570 and function definitions. */
2570 if (c == '@') 2571 if (c == '@')
2571 { 2572 {
2572 int i, nskip = 0; 2573 enum { extra = 100 };
2574 ptrdiff_t i, nskip = 0;
2573 2575
2574 load_each_byte = 1; 2576 load_each_byte = 1;
2575 /* Read a decimal integer. */ 2577 /* Read a decimal integer. */
2576 while ((c = READCHAR) >= 0 2578 while ((c = READCHAR) >= 0
2577 && c >= '0' && c <= '9') 2579 && c >= '0' && c <= '9')
2578 { 2580 {
2581 if ((STRING_BYTES_BOUND - extra) / 10 <= nskip)
2582 string_overflow ();
2579 nskip *= 10; 2583 nskip *= 10;
2580 nskip += c - '0'; 2584 nskip += c - '0';
2581 } 2585 }
@@ -2594,9 +2598,9 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2594 with prev_saved_doc_string, so we save two strings. */ 2598 with prev_saved_doc_string, so we save two strings. */
2595 { 2599 {
2596 char *temp = saved_doc_string; 2600 char *temp = saved_doc_string;
2597 int temp_size = saved_doc_string_size; 2601 ptrdiff_t temp_size = saved_doc_string_size;
2598 file_offset temp_pos = saved_doc_string_position; 2602 file_offset temp_pos = saved_doc_string_position;
2599 int temp_len = saved_doc_string_length; 2603 ptrdiff_t temp_len = saved_doc_string_length;
2600 2604
2601 saved_doc_string = prev_saved_doc_string; 2605 saved_doc_string = prev_saved_doc_string;
2602 saved_doc_string_size = prev_saved_doc_string_size; 2606 saved_doc_string_size = prev_saved_doc_string_size;
@@ -2611,12 +2615,12 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2611 2615
2612 if (saved_doc_string_size == 0) 2616 if (saved_doc_string_size == 0)
2613 { 2617 {
2614 saved_doc_string_size = nskip + 100; 2618 saved_doc_string_size = nskip + extra;
2615 saved_doc_string = (char *) xmalloc (saved_doc_string_size); 2619 saved_doc_string = (char *) xmalloc (saved_doc_string_size);
2616 } 2620 }
2617 if (nskip > saved_doc_string_size) 2621 if (nskip > saved_doc_string_size)
2618 { 2622 {
2619 saved_doc_string_size = nskip + 100; 2623 saved_doc_string_size = nskip + extra;
2620 saved_doc_string = (char *) xrealloc (saved_doc_string, 2624 saved_doc_string = (char *) xrealloc (saved_doc_string,
2621 saved_doc_string_size); 2625 saved_doc_string_size);
2622 } 2626 }
@@ -2661,49 +2665,60 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2661 /* Reader forms that can reuse previously read objects. */ 2665 /* Reader forms that can reuse previously read objects. */
2662 if (c >= '0' && c <= '9') 2666 if (c >= '0' && c <= '9')
2663 { 2667 {
2664 int n = 0; 2668 EMACS_INT n = 0;
2665 Lisp_Object tem; 2669 Lisp_Object tem;
2666 2670
2667 /* Read a non-negative integer. */ 2671 /* Read a non-negative integer. */
2668 while (c >= '0' && c <= '9') 2672 while (c >= '0' && c <= '9')
2669 { 2673 {
2670 n *= 10; 2674 if (MOST_POSITIVE_FIXNUM / 10 < n
2671 n += c - '0'; 2675 || MOST_POSITIVE_FIXNUM < n * 10 + c - '0')
2676 n = MOST_POSITIVE_FIXNUM + 1;
2677 else
2678 n = n * 10 + c - '0';
2672 c = READCHAR; 2679 c = READCHAR;
2673 } 2680 }
2674 /* #n=object returns object, but associates it with n for #n#. */ 2681
2675 if (c == '=' && !NILP (Vread_circle)) 2682 if (n <= MOST_POSITIVE_FIXNUM)
2676 { 2683 {
2677 /* Make a placeholder for #n# to use temporarily */ 2684 if (c == 'r' || c == 'R')
2678 Lisp_Object placeholder; 2685 return read_integer (readcharfun, n);
2679 Lisp_Object cell;
2680 2686
2681 placeholder = Fcons (Qnil, Qnil); 2687 if (! NILP (Vread_circle))
2682 cell = Fcons (make_number (n), placeholder); 2688 {
2683 read_objects = Fcons (cell, read_objects); 2689 /* #n=object returns object, but associates it with
2690 n for #n#. */
2691 if (c == '=')
2692 {
2693 /* Make a placeholder for #n# to use temporarily */
2694 Lisp_Object placeholder;
2695 Lisp_Object cell;
2684 2696
2685 /* Read the object itself. */ 2697 placeholder = Fcons (Qnil, Qnil);
2686 tem = read0 (readcharfun); 2698 cell = Fcons (make_number (n), placeholder);
2699 read_objects = Fcons (cell, read_objects);
2687 2700
2688 /* Now put it everywhere the placeholder was... */ 2701 /* Read the object itself. */
2689 substitute_object_in_subtree (tem, placeholder); 2702 tem = read0 (readcharfun);
2690 2703
2691 /* ...and #n# will use the real value from now on. */ 2704 /* Now put it everywhere the placeholder was... */
2692 Fsetcdr (cell, tem); 2705 substitute_object_in_subtree (tem, placeholder);
2693 2706
2694 return tem; 2707 /* ...and #n# will use the real value from now on. */
2695 } 2708 Fsetcdr (cell, tem);
2696 /* #n# returns a previously read object. */ 2709
2697 if (c == '#' && !NILP (Vread_circle)) 2710 return tem;
2698 { 2711 }
2699 tem = Fassq (make_number (n), read_objects);
2700 if (CONSP (tem))
2701 return XCDR (tem);
2702 /* Fall through to error message. */
2703 }
2704 else if (c == 'r' || c == 'R')
2705 return read_integer (readcharfun, n);
2706 2712
2713 /* #n# returns a previously read object. */
2714 if (c == '#')
2715 {
2716 tem = Fassq (make_number (n), read_objects);
2717 if (CONSP (tem))
2718 return XCDR (tem);
2719 }
2720 }
2721 }
2707 /* Fall through to error message. */ 2722 /* Fall through to error message. */
2708 } 2723 }
2709 else if (c == 'x' || c == 'X') 2724 else if (c == 'x' || c == 'X')
@@ -2846,14 +2861,16 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2846 a single-byte character. */ 2861 a single-byte character. */
2847 int force_singlebyte = 0; 2862 int force_singlebyte = 0;
2848 int cancel = 0; 2863 int cancel = 0;
2849 int nchars = 0; 2864 ptrdiff_t nchars = 0;
2850 2865
2851 while ((ch = READCHAR) >= 0 2866 while ((ch = READCHAR) >= 0
2852 && ch != '\"') 2867 && ch != '\"')
2853 { 2868 {
2854 if (end - p < MAX_MULTIBYTE_LENGTH) 2869 if (end - p < MAX_MULTIBYTE_LENGTH)
2855 { 2870 {
2856 int offset = p - read_buffer; 2871 ptrdiff_t offset = p - read_buffer;
2872 if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size)
2873 memory_full (SIZE_MAX);
2857 read_buffer = (char *) xrealloc (read_buffer, 2874 read_buffer = (char *) xrealloc (read_buffer,
2858 read_buffer_size *= 2); 2875 read_buffer_size *= 2);
2859 p = read_buffer + offset; 2876 p = read_buffer + offset;
@@ -2996,7 +3013,9 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2996 { 3013 {
2997 if (end - p < MAX_MULTIBYTE_LENGTH) 3014 if (end - p < MAX_MULTIBYTE_LENGTH)
2998 { 3015 {
2999 int offset = p - read_buffer; 3016 ptrdiff_t offset = p - read_buffer;
3017 if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size)
3018 memory_full (SIZE_MAX);
3000 read_buffer = (char *) xrealloc (read_buffer, 3019 read_buffer = (char *) xrealloc (read_buffer,
3001 read_buffer_size *= 2); 3020 read_buffer_size *= 2);
3002 p = read_buffer + offset; 3021 p = read_buffer + offset;
@@ -3023,7 +3042,9 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
3023 3042
3024 if (p == end) 3043 if (p == end)
3025 { 3044 {
3026 int offset = p - read_buffer; 3045 ptrdiff_t offset = p - read_buffer;
3046 if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < read_buffer_size)
3047 memory_full (SIZE_MAX);
3027 read_buffer = (char *) xrealloc (read_buffer, 3048 read_buffer = (char *) xrealloc (read_buffer,
3028 read_buffer_size *= 2); 3049 read_buffer_size *= 2);
3029 p = read_buffer + offset; 3050 p = read_buffer + offset;
@@ -3135,7 +3156,7 @@ substitute_object_recurse (Lisp_Object object, Lisp_Object placeholder, Lisp_Obj
3135 { 3156 {
3136 case Lisp_Vectorlike: 3157 case Lisp_Vectorlike:
3137 { 3158 {
3138 int i, length = 0; 3159 ptrdiff_t i, length = 0;
3139 if (BOOL_VECTOR_P (subtree)) 3160 if (BOOL_VECTOR_P (subtree))
3140 return subtree; /* No sub-objects anyway. */ 3161 return subtree; /* No sub-objects anyway. */
3141 else if (CHAR_TABLE_P (subtree) || SUB_CHAR_TABLE_P (subtree) 3162 else if (CHAR_TABLE_P (subtree) || SUB_CHAR_TABLE_P (subtree)
@@ -3358,8 +3379,7 @@ string_to_number (char const *string, int base, int ignore_trailing)
3358static Lisp_Object 3379static Lisp_Object
3359read_vector (Lisp_Object readcharfun, int bytecodeflag) 3380read_vector (Lisp_Object readcharfun, int bytecodeflag)
3360{ 3381{
3361 register int i; 3382 ptrdiff_t i, size;
3362 register int size;
3363 register Lisp_Object *ptr; 3383 register Lisp_Object *ptr;
3364 register Lisp_Object tem, item, vector; 3384 register Lisp_Object tem, item, vector;
3365 register struct Lisp_Cons *otem; 3385 register struct Lisp_Cons *otem;
@@ -3528,15 +3548,15 @@ read_list (int flag, register Lisp_Object readcharfun)
3528 doc string, caller must make it 3548 doc string, caller must make it
3529 multibyte. */ 3549 multibyte. */
3530 3550
3531 int pos = XINT (XCDR (val)); 3551 EMACS_INT pos = XINT (XCDR (val));
3532 /* Position is negative for user variables. */ 3552 /* Position is negative for user variables. */
3533 if (pos < 0) pos = -pos; 3553 if (pos < 0) pos = -pos;
3534 if (pos >= saved_doc_string_position 3554 if (pos >= saved_doc_string_position
3535 && pos < (saved_doc_string_position 3555 && pos < (saved_doc_string_position
3536 + saved_doc_string_length)) 3556 + saved_doc_string_length))
3537 { 3557 {
3538 int start = pos - saved_doc_string_position; 3558 ptrdiff_t start = pos - saved_doc_string_position;
3539 int from, to; 3559 ptrdiff_t from, to;
3540 3560
3541 /* Process quoting with ^A, 3561 /* Process quoting with ^A,
3542 and find the end of the string, 3562 and find the end of the string,
@@ -3567,8 +3587,9 @@ read_list (int flag, register Lisp_Object readcharfun)
3567 && pos < (prev_saved_doc_string_position 3587 && pos < (prev_saved_doc_string_position
3568 + prev_saved_doc_string_length)) 3588 + prev_saved_doc_string_length))
3569 { 3589 {
3570 int start = pos - prev_saved_doc_string_position; 3590 ptrdiff_t start =
3571 int from, to; 3591 pos - prev_saved_doc_string_position;
3592 ptrdiff_t from, to;
3572 3593
3573 /* Process quoting with ^A, 3594 /* Process quoting with ^A,
3574 and find the end of the string, 3595 and find the end of the string,
@@ -3891,7 +3912,7 @@ hash_string (const char *ptr, size_t len)
3891void 3912void
3892map_obarray (Lisp_Object obarray, void (*fn) (Lisp_Object, Lisp_Object), Lisp_Object arg) 3913map_obarray (Lisp_Object obarray, void (*fn) (Lisp_Object, Lisp_Object), Lisp_Object arg)
3893{ 3914{
3894 register int i; 3915 ptrdiff_t i;
3895 register Lisp_Object tail; 3916 register Lisp_Object tail;
3896 CHECK_VECTOR (obarray); 3917 CHECK_VECTOR (obarray);
3897 for (i = ASIZE (obarray) - 1; i >= 0; i--) 3918 for (i = ASIZE (obarray) - 1; i >= 0; i--)
@@ -3962,8 +3983,7 @@ init_obarray (void)
3962 /* Qt is correct even if CANNOT_DUMP. loadup.el will set to nil at end. */ 3983 /* Qt is correct even if CANNOT_DUMP. loadup.el will set to nil at end. */
3963 Vpurify_flag = Qt; 3984 Vpurify_flag = Qt;
3964 3985
3965 Qvariable_documentation = intern_c_string ("variable-documentation"); 3986 DEFSYM (Qvariable_documentation, "variable-documentation");
3966 staticpro (&Qvariable_documentation);
3967 3987
3968 read_buffer_size = 100 + MAX_MULTIBYTE_LENGTH; 3988 read_buffer_size = 100 + MAX_MULTIBYTE_LENGTH;
3969 read_buffer = (char *) xmalloc (read_buffer_size); 3989 read_buffer = (char *) xmalloc (read_buffer_size);
@@ -3991,7 +4011,7 @@ defalias (sname, string)
3991#endif /* NOTDEF */ 4011#endif /* NOTDEF */
3992 4012
3993/* Define an "integer variable"; a symbol whose value is forwarded to a 4013/* Define an "integer variable"; a symbol whose value is forwarded to a
3994 C variable of type int. Sample call (munged w "xx" to fool make-docfile): 4014 C variable of type EMACS_INT. Sample call (with "xx" to fool make-docfile):
3995 DEFxxVAR_INT ("emacs-priority", &emacs_priority, "Documentation"); */ 4015 DEFxxVAR_INT ("emacs-priority", &emacs_priority, "Documentation"); */
3996void 4016void
3997defvar_int (struct Lisp_Intfwd *i_fwd, 4017defvar_int (struct Lisp_Intfwd *i_fwd,
@@ -4371,8 +4391,7 @@ customize `jka-compr-load-suffixes' rather than the present variable. */);
4371 4391
4372 DEFVAR_BOOL ("load-in-progress", load_in_progress, 4392 DEFVAR_BOOL ("load-in-progress", load_in_progress,
4373 doc: /* Non-nil if inside of `load'. */); 4393 doc: /* Non-nil if inside of `load'. */);
4374 Qload_in_progress = intern_c_string ("load-in-progress"); 4394 DEFSYM (Qload_in_progress, "load-in-progress");
4375 staticpro (&Qload_in_progress);
4376 4395
4377 DEFVAR_LISP ("after-load-alist", Vafter_load_alist, 4396 DEFVAR_LISP ("after-load-alist", Vafter_load_alist,
4378 doc: /* An alist of expressions to be evalled when particular files are loaded. 4397 doc: /* An alist of expressions to be evalled when particular files are loaded.
@@ -4503,67 +4522,34 @@ This variable is automatically set from the file variables of an interpreted
4503 DEFVAR_LISP ("old-style-backquotes", Vold_style_backquotes, 4522 DEFVAR_LISP ("old-style-backquotes", Vold_style_backquotes,
4504 doc: /* Set to non-nil when `read' encounters an old-style backquote. */); 4523 doc: /* Set to non-nil when `read' encounters an old-style backquote. */);
4505 Vold_style_backquotes = Qnil; 4524 Vold_style_backquotes = Qnil;
4506 Qold_style_backquotes = intern_c_string ("old-style-backquotes"); 4525 DEFSYM (Qold_style_backquotes, "old-style-backquotes");
4507 staticpro (&Qold_style_backquotes);
4508 4526
4509 /* Vsource_directory was initialized in init_lread. */ 4527 /* Vsource_directory was initialized in init_lread. */
4510 4528
4511 load_descriptor_list = Qnil; 4529 load_descriptor_list = Qnil;
4512 staticpro (&load_descriptor_list); 4530 staticpro (&load_descriptor_list);
4513 4531
4514 Qcurrent_load_list = intern_c_string ("current-load-list"); 4532 DEFSYM (Qcurrent_load_list, "current-load-list");
4515 staticpro (&Qcurrent_load_list); 4533 DEFSYM (Qstandard_input, "standard-input");
4516 4534 DEFSYM (Qread_char, "read-char");
4517 Qstandard_input = intern_c_string ("standard-input"); 4535 DEFSYM (Qget_file_char, "get-file-char");
4518 staticpro (&Qstandard_input); 4536 DEFSYM (Qget_emacs_mule_file_char, "get-emacs-mule-file-char");
4519 4537 DEFSYM (Qload_force_doc_strings, "load-force-doc-strings");
4520 Qread_char = intern_c_string ("read-char"); 4538
4521 staticpro (&Qread_char); 4539 DEFSYM (Qbackquote, "`");
4522 4540 DEFSYM (Qcomma, ",");
4523 Qget_file_char = intern_c_string ("get-file-char"); 4541 DEFSYM (Qcomma_at, ",@");
4524 staticpro (&Qget_file_char); 4542 DEFSYM (Qcomma_dot, ",.");
4525 4543
4526 Qget_emacs_mule_file_char = intern_c_string ("get-emacs-mule-file-char"); 4544 DEFSYM (Qinhibit_file_name_operation, "inhibit-file-name-operation");
4527 staticpro (&Qget_emacs_mule_file_char); 4545 DEFSYM (Qascii_character, "ascii-character");
4528 4546 DEFSYM (Qfunction, "function");
4529 Qload_force_doc_strings = intern_c_string ("load-force-doc-strings"); 4547 DEFSYM (Qload, "load");
4530 staticpro (&Qload_force_doc_strings); 4548 DEFSYM (Qload_file_name, "load-file-name");
4531 4549 DEFSYM (Qeval_buffer_list, "eval-buffer-list");
4532 Qbackquote = intern_c_string ("`"); 4550 DEFSYM (Qfile_truename, "file-truename");
4533 staticpro (&Qbackquote); 4551 DEFSYM (Qdir_ok, "dir-ok");
4534 Qcomma = intern_c_string (","); 4552 DEFSYM (Qdo_after_load_evaluation, "do-after-load-evaluation");
4535 staticpro (&Qcomma);
4536 Qcomma_at = intern_c_string (",@");
4537 staticpro (&Qcomma_at);
4538 Qcomma_dot = intern_c_string (",.");
4539 staticpro (&Qcomma_dot);
4540
4541 Qinhibit_file_name_operation = intern_c_string ("inhibit-file-name-operation");
4542 staticpro (&Qinhibit_file_name_operation);
4543
4544 Qascii_character = intern_c_string ("ascii-character");
4545 staticpro (&Qascii_character);
4546
4547 Qfunction = intern_c_string ("function");
4548 staticpro (&Qfunction);
4549
4550 Qload = intern_c_string ("load");
4551 staticpro (&Qload);
4552
4553 Qload_file_name = intern_c_string ("load-file-name");
4554 staticpro (&Qload_file_name);
4555
4556 Qeval_buffer_list = intern_c_string ("eval-buffer-list");
4557 staticpro (&Qeval_buffer_list);
4558
4559 Qfile_truename = intern_c_string ("file-truename");
4560 staticpro (&Qfile_truename) ;
4561
4562 Qdir_ok = intern_c_string ("dir-ok");
4563 staticpro (&Qdir_ok);
4564
4565 Qdo_after_load_evaluation = intern_c_string ("do-after-load-evaluation");
4566 staticpro (&Qdo_after_load_evaluation) ;
4567 4553
4568 staticpro (&dump_path); 4554 staticpro (&dump_path);
4569 4555
@@ -4575,18 +4561,11 @@ This variable is automatically set from the file variables of an interpreted
4575 Vloads_in_progress = Qnil; 4561 Vloads_in_progress = Qnil;
4576 staticpro (&Vloads_in_progress); 4562 staticpro (&Vloads_in_progress);
4577 4563
4578 Qhash_table = intern_c_string ("hash-table"); 4564 DEFSYM (Qhash_table, "hash-table");
4579 staticpro (&Qhash_table); 4565 DEFSYM (Qdata, "data");
4580 Qdata = intern_c_string ("data"); 4566 DEFSYM (Qtest, "test");
4581 staticpro (&Qdata); 4567 DEFSYM (Qsize, "size");
4582 Qtest = intern_c_string ("test"); 4568 DEFSYM (Qweakness, "weakness");
4583 staticpro (&Qtest); 4569 DEFSYM (Qrehash_size, "rehash-size");
4584 Qsize = intern_c_string ("size"); 4570 DEFSYM (Qrehash_threshold, "rehash-threshold");
4585 staticpro (&Qsize);
4586 Qweakness = intern_c_string ("weakness");
4587 staticpro (&Qweakness);
4588 Qrehash_size = intern_c_string ("rehash-size");
4589 staticpro (&Qrehash_size);
4590 Qrehash_threshold = intern_c_string ("rehash-threshold");
4591 staticpro (&Qrehash_threshold);
4592} 4571}
diff --git a/src/macros.c b/src/macros.c
index 3523e513d6a..60f30c3fbbe 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -71,10 +71,10 @@ macro before appending to it. */)
71 { 71 {
72 if (current_kboard->kbd_macro_bufsize > 200) 72 if (current_kboard->kbd_macro_bufsize > 200)
73 { 73 {
74 current_kboard->kbd_macro_bufsize = 30;
75 current_kboard->kbd_macro_buffer 74 current_kboard->kbd_macro_buffer
76 = (Lisp_Object *)xrealloc (current_kboard->kbd_macro_buffer, 75 = (Lisp_Object *)xrealloc (current_kboard->kbd_macro_buffer,
77 30 * sizeof (Lisp_Object)); 76 30 * sizeof (Lisp_Object));
77 current_kboard->kbd_macro_bufsize = 30;
78 } 78 }
79 current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_buffer; 79 current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_buffer;
80 current_kboard->kbd_macro_end = current_kboard->kbd_macro_buffer; 80 current_kboard->kbd_macro_end = current_kboard->kbd_macro_buffer;
@@ -82,7 +82,8 @@ macro before appending to it. */)
82 } 82 }
83 else 83 else
84 { 84 {
85 int i, len; 85 ptrdiff_t i;
86 EMACS_INT len;
86 int cvt; 87 int cvt;
87 88
88 /* Check the type of last-kbd-macro in case Lisp code changed it. */ 89 /* Check the type of last-kbd-macro in case Lisp code changed it. */
@@ -94,10 +95,13 @@ macro before appending to it. */)
94 has put another macro there. */ 95 has put another macro there. */
95 if (current_kboard->kbd_macro_bufsize < len + 30) 96 if (current_kboard->kbd_macro_bufsize < len + 30)
96 { 97 {
97 current_kboard->kbd_macro_bufsize = len + 30; 98 if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof (Lisp_Object) - 30
99 < current_kboard->kbd_macro_bufsize)
100 memory_full (SIZE_MAX);
98 current_kboard->kbd_macro_buffer 101 current_kboard->kbd_macro_buffer
99 = (Lisp_Object *)xrealloc (current_kboard->kbd_macro_buffer, 102 = (Lisp_Object *)xrealloc (current_kboard->kbd_macro_buffer,
100 (len + 30) * sizeof (Lisp_Object)); 103 (len + 30) * sizeof (Lisp_Object));
104 current_kboard->kbd_macro_bufsize = len + 30;
101 } 105 }
102 106
103 /* Must convert meta modifier when copying string to vector. */ 107 /* Must convert meta modifier when copying string to vector. */
@@ -191,14 +195,17 @@ store_kbd_macro_char (Lisp_Object c)
191 { 195 {
192 if (kb->kbd_macro_ptr - kb->kbd_macro_buffer == kb->kbd_macro_bufsize) 196 if (kb->kbd_macro_ptr - kb->kbd_macro_buffer == kb->kbd_macro_bufsize)
193 { 197 {
194 int ptr_offset, end_offset, nbytes; 198 ptrdiff_t ptr_offset, end_offset, nbytes;
195 199
196 ptr_offset = kb->kbd_macro_ptr - kb->kbd_macro_buffer; 200 ptr_offset = kb->kbd_macro_ptr - kb->kbd_macro_buffer;
197 end_offset = kb->kbd_macro_end - kb->kbd_macro_buffer; 201 end_offset = kb->kbd_macro_end - kb->kbd_macro_buffer;
198 kb->kbd_macro_bufsize *= 2; 202 if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *kb->kbd_macro_buffer / 2
199 nbytes = kb->kbd_macro_bufsize * sizeof *kb->kbd_macro_buffer; 203 < kb->kbd_macro_bufsize)
204 memory_full (SIZE_MAX);
205 nbytes = kb->kbd_macro_bufsize * 2 * sizeof *kb->kbd_macro_buffer;
200 kb->kbd_macro_buffer 206 kb->kbd_macro_buffer
201 = (Lisp_Object *) xrealloc (kb->kbd_macro_buffer, nbytes); 207 = (Lisp_Object *) xrealloc (kb->kbd_macro_buffer, nbytes);
208 kb->kbd_macro_bufsize *= 2;
202 kb->kbd_macro_ptr = kb->kbd_macro_buffer + ptr_offset; 209 kb->kbd_macro_ptr = kb->kbd_macro_buffer + ptr_offset;
203 kb->kbd_macro_end = kb->kbd_macro_buffer + end_offset; 210 kb->kbd_macro_end = kb->kbd_macro_buffer + end_offset;
204 } 211 }
@@ -360,15 +367,13 @@ init_macros (void)
360void 367void
361syms_of_macros (void) 368syms_of_macros (void)
362{ 369{
363 Qexecute_kbd_macro = intern_c_string ("execute-kbd-macro"); 370 DEFSYM (Qexecute_kbd_macro, "execute-kbd-macro");
364 staticpro (&Qexecute_kbd_macro);
365 371
366 DEFVAR_LISP ("kbd-macro-termination-hook", Vkbd_macro_termination_hook, 372 DEFVAR_LISP ("kbd-macro-termination-hook", Vkbd_macro_termination_hook,
367 doc: /* Normal hook run whenever a keyboard macro terminates. 373 doc: /* Normal hook run whenever a keyboard macro terminates.
368This is run whether the macro ends normally or prematurely due to an error. */); 374This is run whether the macro ends normally or prematurely due to an error. */);
369 Vkbd_macro_termination_hook = Qnil; 375 Vkbd_macro_termination_hook = Qnil;
370 Qkbd_macro_termination_hook = intern_c_string ("kbd-macro-termination-hook"); 376 DEFSYM (Qkbd_macro_termination_hook, "kbd-macro-termination-hook");
371 staticpro (&Qkbd_macro_termination_hook);
372 377
373 defsubr (&Sstart_kbd_macro); 378 defsubr (&Sstart_kbd_macro);
374 defsubr (&Send_kbd_macro); 379 defsubr (&Send_kbd_macro);
diff --git a/src/minibuf.c b/src/minibuf.c
index ca2f22df9ed..cf37c337be4 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -25,7 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include "lisp.h" 25#include "lisp.h"
26#include "commands.h" 26#include "commands.h"
27#include "buffer.h" 27#include "buffer.h"
28#include "character.h"
29#include "dispextern.h" 28#include "dispextern.h"
30#include "keyboard.h" 29#include "keyboard.h"
31#include "frame.h" 30#include "frame.h"
@@ -72,7 +71,6 @@ Lisp_Object Qcompletion_ignore_case;
72static Lisp_Object Qminibuffer_completion_table; 71static Lisp_Object Qminibuffer_completion_table;
73static Lisp_Object Qminibuffer_completion_predicate; 72static Lisp_Object Qminibuffer_completion_predicate;
74static Lisp_Object Qminibuffer_completion_confirm; 73static Lisp_Object Qminibuffer_completion_confirm;
75static Lisp_Object Qcompleting_read_default;
76static Lisp_Object Quser_variable_p; 74static Lisp_Object Quser_variable_p;
77 75
78static Lisp_Object Qminibuffer_default; 76static Lisp_Object Qminibuffer_default;
@@ -237,7 +235,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
237 Lisp_Object defalt, 235 Lisp_Object defalt,
238 int allow_props, int inherit_input_method) 236 int allow_props, int inherit_input_method)
239{ 237{
240 size_t size, len; 238 ptrdiff_t size, len;
241 char *line, *s; 239 char *line, *s;
242 Lisp_Object val; 240 Lisp_Object val;
243 241
@@ -247,12 +245,12 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
247 val = Qnil; 245 val = Qnil;
248 size = 100; 246 size = 100;
249 len = 0; 247 len = 0;
250 line = (char *) xmalloc (size * sizeof *line); 248 line = (char *) xmalloc (size);
251 while ((s = fgets (line + len, size - len, stdin)) != NULL 249 while ((s = fgets (line + len, size - len, stdin)) != NULL
252 && (len = strlen (line), 250 && (len = strlen (line),
253 len == size - 1 && line[len - 1] != '\n')) 251 len == size - 1 && line[len - 1] != '\n'))
254 { 252 {
255 if ((size_t) -1 / 2 < size) 253 if (STRING_BYTES_BOUND / 2 < size)
256 memory_full (SIZE_MAX); 254 memory_full (SIZE_MAX);
257 size *= 2; 255 size *= 2;
258 line = (char *) xrealloc (line, size); 256 line = (char *) xrealloc (line, size);
@@ -260,11 +258,9 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
260 258
261 if (s) 259 if (s)
262 { 260 {
263 len = strlen (line); 261 char *nl = strchr (line, '\n');
264 262 if (nl)
265 if (len > 0 && line[len - 1] == '\n') 263 *nl = '\0';
266 line[--len] = '\0';
267
268 val = build_string (line); 264 val = build_string (line);
269 xfree (line); 265 xfree (line);
270 } 266 }
@@ -1694,7 +1690,7 @@ See also `completing-read-function'. */)
1694 (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method) 1690 (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method)
1695{ 1691{
1696 Lisp_Object args[9]; 1692 Lisp_Object args[9];
1697 args[0] = Vcompleting_read_function; 1693 args[0] = Fsymbol_value (intern ("completing-read-function"));
1698 args[1] = prompt; 1694 args[1] = prompt;
1699 args[2] = collection; 1695 args[2] = collection;
1700 args[3] = predicate; 1696 args[3] = predicate;
@@ -1705,76 +1701,6 @@ See also `completing-read-function'. */)
1705 args[8] = inherit_input_method; 1701 args[8] = inherit_input_method;
1706 return Ffuncall (9, args); 1702 return Ffuncall (9, args);
1707} 1703}
1708
1709DEFUN ("completing-read-default", Fcompleting_read_default, Scompleting_read_default, 2, 8, 0,
1710 doc: /* Default method for reading from the minibuffer with completion.
1711See `completing-read' for the meaning of the arguments. */)
1712 (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method)
1713{
1714 Lisp_Object val, histvar, histpos, position;
1715 Lisp_Object init;
1716 int pos = 0;
1717 int count = SPECPDL_INDEX ();
1718 struct gcpro gcpro1;
1719
1720 init = initial_input;
1721 GCPRO1 (def);
1722
1723 specbind (Qminibuffer_completion_table, collection);
1724 specbind (Qminibuffer_completion_predicate, predicate);
1725 specbind (Qminibuffer_completion_confirm,
1726 EQ (require_match, Qt) ? Qnil : require_match);
1727
1728 position = Qnil;
1729 if (!NILP (init))
1730 {
1731 if (CONSP (init))
1732 {
1733 position = Fcdr (init);
1734 init = Fcar (init);
1735 }
1736 CHECK_STRING (init);
1737 if (!NILP (position))
1738 {
1739 CHECK_NUMBER (position);
1740 /* Convert to distance from end of input. */
1741 pos = XINT (position) - SCHARS (init);
1742 }
1743 }
1744
1745 if (SYMBOLP (hist))
1746 {
1747 histvar = hist;
1748 histpos = Qnil;
1749 }
1750 else
1751 {
1752 histvar = Fcar_safe (hist);
1753 histpos = Fcdr_safe (hist);
1754 }
1755 if (NILP (histvar))
1756 histvar = Qminibuffer_history;
1757 if (NILP (histpos))
1758 XSETFASTINT (histpos, 0);
1759
1760 val = read_minibuf (NILP (require_match)
1761 ? (NILP (Vminibuffer_completing_file_name)
1762 || EQ (Vminibuffer_completing_file_name, Qlambda)
1763 ? Vminibuffer_local_completion_map
1764 : Vminibuffer_local_filename_completion_map)
1765 : (NILP (Vminibuffer_completing_file_name)
1766 || EQ (Vminibuffer_completing_file_name, Qlambda)
1767 ? Vminibuffer_local_must_match_map
1768 : Vminibuffer_local_filename_must_match_map),
1769 init, prompt, make_number (pos), 0,
1770 histvar, histpos, def, 0,
1771 !NILP (inherit_input_method));
1772
1773 if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (def))
1774 val = CONSP (def) ? XCAR (def) : def;
1775
1776 RETURN_UNGCPRO (unbind_to (count, val));
1777}
1778 1704
1779Lisp_Object Fassoc_string (register Lisp_Object key, Lisp_Object list, Lisp_Object case_fold); 1705Lisp_Object Fassoc_string (register Lisp_Object key, Lisp_Object list, Lisp_Object case_fold);
1780 1706
@@ -2013,7 +1939,6 @@ syms_of_minibuf (void)
2013 minibuf_save_list = Qnil; 1939 minibuf_save_list = Qnil;
2014 staticpro (&minibuf_save_list); 1940 staticpro (&minibuf_save_list);
2015 1941
2016 DEFSYM (Qcompleting_read_default, "completing-read-default");
2017 DEFSYM (Qcompletion_ignore_case, "completion-ignore-case"); 1942 DEFSYM (Qcompletion_ignore_case, "completion-ignore-case");
2018 DEFSYM (Qread_file_name_internal, "read-file-name-internal"); 1943 DEFSYM (Qread_file_name_internal, "read-file-name-internal");
2019 DEFSYM (Qminibuffer_default, "minibuffer-default"); 1944 DEFSYM (Qminibuffer_default, "minibuffer-default");
@@ -2132,12 +2057,6 @@ If the value is `confirm-after-completion', the user may exit with an
2132 doc: /* Non-nil means completing file names. */); 2057 doc: /* Non-nil means completing file names. */);
2133 Vminibuffer_completing_file_name = Qnil; 2058 Vminibuffer_completing_file_name = Qnil;
2134 2059
2135 DEFVAR_LISP ("completing-read-function",
2136 Vcompleting_read_function,
2137 doc: /* The function called by `completing-read' to do the work.
2138It should accept the same arguments as `completing-read'. */);
2139 Vcompleting_read_function = Qcompleting_read_default;
2140
2141 DEFVAR_LISP ("minibuffer-help-form", Vminibuffer_help_form, 2060 DEFVAR_LISP ("minibuffer-help-form", Vminibuffer_help_form,
2142 doc: /* Value that `help-form' takes on inside the minibuffer. */); 2061 doc: /* Value that `help-form' takes on inside the minibuffer. */);
2143 Vminibuffer_help_form = Qnil; 2062 Vminibuffer_help_form = Qnil;
@@ -2214,5 +2133,4 @@ properties. */);
2214 defsubr (&Stest_completion); 2133 defsubr (&Stest_completion);
2215 defsubr (&Sassoc_string); 2134 defsubr (&Sassoc_string);
2216 defsubr (&Scompleting_read); 2135 defsubr (&Scompleting_read);
2217 defsubr (&Scompleting_read_default);
2218} 2136}
diff --git a/src/msdos.c b/src/msdos.c
index 73804df55cc..3f12bc85cbe 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -4267,8 +4267,7 @@ syms_of_msdos (void)
4267#ifndef HAVE_X_WINDOWS 4267#ifndef HAVE_X_WINDOWS
4268 4268
4269 /* The following two are from xfns.c: */ 4269 /* The following two are from xfns.c: */
4270 Qreverse = intern_c_string ("reverse"); 4270 DEFSYM (Qreverse, "reverse");
4271 staticpro (&Qreverse);
4272 4271
4273 DEFVAR_LISP ("dos-unsupported-char-glyph", Vdos_unsupported_char_glyph, 4272 DEFVAR_LISP ("dos-unsupported-char-glyph", Vdos_unsupported_char_glyph,
4274 doc: /* *Glyph to display instead of chars not supported by current codepage. 4273 doc: /* *Glyph to display instead of chars not supported by current codepage.
diff --git a/src/print.c b/src/print.c
index d07f89702cc..14b4326bb6f 100644
--- a/src/print.c
+++ b/src/print.c
@@ -159,8 +159,9 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
159 } \ 159 } \
160 else \ 160 else \
161 { \ 161 { \
162 print_buffer_size = 1000; \ 162 ptrdiff_t new_size = 1000; \
163 print_buffer = (char *) xmalloc (print_buffer_size); \ 163 print_buffer = (char *) xmalloc (new_size); \
164 print_buffer_size = new_size; \
164 free_print_buffer = 1; \ 165 free_print_buffer = 1; \
165 } \ 166 } \
166 print_buffer_pos = 0; \ 167 print_buffer_pos = 0; \
@@ -235,9 +236,15 @@ printchar (unsigned int ch, Lisp_Object fun)
235 236
236 if (NILP (fun)) 237 if (NILP (fun))
237 { 238 {
238 if (print_buffer_pos_byte + len >= print_buffer_size) 239 if (print_buffer_size - len <= print_buffer_pos_byte)
239 print_buffer = (char *) xrealloc (print_buffer, 240 {
240 print_buffer_size *= 2); 241 ptrdiff_t new_size;
242 if (STRING_BYTES_BOUND / 2 < print_buffer_size)
243 string_overflow ();
244 new_size = print_buffer_size * 2;
245 print_buffer = (char *) xrealloc (print_buffer, new_size);
246 print_buffer_size = new_size;
247 }
241 memcpy (print_buffer + print_buffer_pos_byte, str, len); 248 memcpy (print_buffer + print_buffer_pos_byte, str, len);
242 print_buffer_pos += 1; 249 print_buffer_pos += 1;
243 print_buffer_pos_byte += len; 250 print_buffer_pos_byte += len;
@@ -280,11 +287,14 @@ strout (const char *ptr, EMACS_INT size, EMACS_INT size_byte,
280 287
281 if (NILP (printcharfun)) 288 if (NILP (printcharfun))
282 { 289 {
283 if (print_buffer_pos_byte + size_byte > print_buffer_size) 290 if (print_buffer_size - size_byte < print_buffer_pos_byte)
284 { 291 {
285 print_buffer_size = print_buffer_size * 2 + size_byte; 292 ptrdiff_t new_size;
286 print_buffer = (char *) xrealloc (print_buffer, 293 if (STRING_BYTES_BOUND / 2 - size_byte < print_buffer_size)
287 print_buffer_size); 294 string_overflow ();
295 new_size = print_buffer_size * 2 + size_byte;
296 print_buffer = (char *) xrealloc (print_buffer, new_size);
297 print_buffer_size = new_size;
288 } 298 }
289 memcpy (print_buffer + print_buffer_pos_byte, ptr, size_byte); 299 memcpy (print_buffer + print_buffer_pos_byte, ptr, size_byte);
290 print_buffer_pos += size; 300 print_buffer_pos += size;
@@ -2059,8 +2069,7 @@ print_interval (INTERVAL interval, Lisp_Object printcharfun)
2059void 2069void
2060syms_of_print (void) 2070syms_of_print (void)
2061{ 2071{
2062 Qtemp_buffer_setup_hook = intern_c_string ("temp-buffer-setup-hook"); 2072 DEFSYM (Qtemp_buffer_setup_hook, "temp-buffer-setup-hook");
2063 staticpro (&Qtemp_buffer_setup_hook);
2064 2073
2065 DEFVAR_LISP ("standard-output", Vstandard_output, 2074 DEFVAR_LISP ("standard-output", Vstandard_output,
2066 doc: /* Output stream `print' uses by default for outputting a character. 2075 doc: /* Output stream `print' uses by default for outputting a character.
@@ -2069,8 +2078,7 @@ It may also be a buffer (output is inserted before point)
2069or a marker (output is inserted and the marker is advanced) 2078or a marker (output is inserted and the marker is advanced)
2070or the symbol t (output appears in the echo area). */); 2079or the symbol t (output appears in the echo area). */);
2071 Vstandard_output = Qt; 2080 Vstandard_output = Qt;
2072 Qstandard_output = intern_c_string ("standard-output"); 2081 DEFSYM (Qstandard_output, "standard-output");
2073 staticpro (&Qstandard_output);
2074 2082
2075 DEFVAR_LISP ("float-output-format", Vfloat_output_format, 2083 DEFVAR_LISP ("float-output-format", Vfloat_output_format,
2076 doc: /* The format descriptor string used to print floats. 2084 doc: /* The format descriptor string used to print floats.
@@ -2089,8 +2097,7 @@ decimal point. 0 is not allowed with `e' or `g'.
2089A value of nil means to use the shortest notation 2097A value of nil means to use the shortest notation
2090that represents the number without losing information. */); 2098that represents the number without losing information. */);
2091 Vfloat_output_format = Qnil; 2099 Vfloat_output_format = Qnil;
2092 Qfloat_output_format = intern_c_string ("float-output-format"); 2100 DEFSYM (Qfloat_output_format, "float-output-format");
2093 staticpro (&Qfloat_output_format);
2094 2101
2095 DEFVAR_LISP ("print-length", Vprint_length, 2102 DEFVAR_LISP ("print-length", Vprint_length,
2096 doc: /* Maximum length of list to print before abbreviating. 2103 doc: /* Maximum length of list to print before abbreviating.
@@ -2195,17 +2202,10 @@ priorities. */);
2195 defsubr (&Sredirect_debugging_output); 2202 defsubr (&Sredirect_debugging_output);
2196#endif 2203#endif
2197 2204
2198 Qexternal_debugging_output = intern_c_string ("external-debugging-output"); 2205 DEFSYM (Qexternal_debugging_output, "external-debugging-output");
2199 staticpro (&Qexternal_debugging_output); 2206 DEFSYM (Qprint_escape_newlines, "print-escape-newlines");
2200 2207 DEFSYM (Qprint_escape_multibyte, "print-escape-multibyte");
2201 Qprint_escape_newlines = intern_c_string ("print-escape-newlines"); 2208 DEFSYM (Qprint_escape_nonascii, "print-escape-nonascii");
2202 staticpro (&Qprint_escape_newlines);
2203
2204 Qprint_escape_multibyte = intern_c_string ("print-escape-multibyte");
2205 staticpro (&Qprint_escape_multibyte);
2206
2207 Qprint_escape_nonascii = intern_c_string ("print-escape-nonascii");
2208 staticpro (&Qprint_escape_nonascii);
2209 2209
2210 print_prune_charset_plist = Qnil; 2210 print_prune_charset_plist = Qnil;
2211 staticpro (&print_prune_charset_plist); 2211 staticpro (&print_prune_charset_plist);
diff --git a/src/process.c b/src/process.c
index 0040d14a0f6..c46437fe8cb 100644
--- a/src/process.c
+++ b/src/process.c
@@ -7236,14 +7236,10 @@ syms_of_process (void)
7236{ 7236{
7237#ifdef subprocesses 7237#ifdef subprocesses
7238 7238
7239 Qprocessp = intern_c_string ("processp"); 7239 DEFSYM (Qprocessp, "processp");
7240 staticpro (&Qprocessp); 7240 DEFSYM (Qrun, "run");
7241 Qrun = intern_c_string ("run"); 7241 DEFSYM (Qstop, "stop");
7242 staticpro (&Qrun); 7242 DEFSYM (Qsignal, "signal");
7243 Qstop = intern_c_string ("stop");
7244 staticpro (&Qstop);
7245 Qsignal = intern_c_string ("signal");
7246 staticpro (&Qsignal);
7247 7243
7248 /* Qexit is already staticpro'd by syms_of_eval; don't staticpro it 7244 /* Qexit is already staticpro'd by syms_of_eval; don't staticpro it
7249 here again. 7245 here again.
@@ -7251,92 +7247,52 @@ syms_of_process (void)
7251 Qexit = intern_c_string ("exit"); 7247 Qexit = intern_c_string ("exit");
7252 staticpro (&Qexit); */ 7248 staticpro (&Qexit); */
7253 7249
7254 Qopen = intern_c_string ("open"); 7250 DEFSYM (Qopen, "open");
7255 staticpro (&Qopen); 7251 DEFSYM (Qclosed, "closed");
7256 Qclosed = intern_c_string ("closed"); 7252 DEFSYM (Qconnect, "connect");
7257 staticpro (&Qclosed); 7253 DEFSYM (Qfailed, "failed");
7258 Qconnect = intern_c_string ("connect"); 7254 DEFSYM (Qlisten, "listen");
7259 staticpro (&Qconnect); 7255 DEFSYM (Qlocal, "local");
7260 Qfailed = intern_c_string ("failed"); 7256 DEFSYM (Qipv4, "ipv4");
7261 staticpro (&Qfailed);
7262 Qlisten = intern_c_string ("listen");
7263 staticpro (&Qlisten);
7264 Qlocal = intern_c_string ("local");
7265 staticpro (&Qlocal);
7266 Qipv4 = intern_c_string ("ipv4");
7267 staticpro (&Qipv4);
7268#ifdef AF_INET6 7257#ifdef AF_INET6
7269 Qipv6 = intern_c_string ("ipv6"); 7258 DEFSYM (Qipv6, "ipv6");
7270 staticpro (&Qipv6); 7259#endif
7271#endif 7260 DEFSYM (Qdatagram, "datagram");
7272 Qdatagram = intern_c_string ("datagram"); 7261 DEFSYM (Qseqpacket, "seqpacket");
7273 staticpro (&Qdatagram); 7262
7274 Qseqpacket = intern_c_string ("seqpacket"); 7263 DEFSYM (QCport, ":port");
7275 staticpro (&Qseqpacket); 7264 DEFSYM (QCspeed, ":speed");
7276 7265 DEFSYM (QCprocess, ":process");
7277 QCport = intern_c_string (":port"); 7266
7278 staticpro (&QCport); 7267 DEFSYM (QCbytesize, ":bytesize");
7279 QCspeed = intern_c_string (":speed"); 7268 DEFSYM (QCstopbits, ":stopbits");
7280 staticpro (&QCspeed); 7269 DEFSYM (QCparity, ":parity");
7281 QCprocess = intern_c_string (":process"); 7270 DEFSYM (Qodd, "odd");
7282 staticpro (&QCprocess); 7271 DEFSYM (Qeven, "even");
7283 7272 DEFSYM (QCflowcontrol, ":flowcontrol");
7284 QCbytesize = intern_c_string (":bytesize"); 7273 DEFSYM (Qhw, "hw");
7285 staticpro (&QCbytesize); 7274 DEFSYM (Qsw, "sw");
7286 QCstopbits = intern_c_string (":stopbits"); 7275 DEFSYM (QCsummary, ":summary");
7287 staticpro (&QCstopbits); 7276
7288 QCparity = intern_c_string (":parity"); 7277 DEFSYM (Qreal, "real");
7289 staticpro (&QCparity); 7278 DEFSYM (Qnetwork, "network");
7290 Qodd = intern_c_string ("odd"); 7279 DEFSYM (Qserial, "serial");
7291 staticpro (&Qodd); 7280 DEFSYM (QCbuffer, ":buffer");
7292 Qeven = intern_c_string ("even"); 7281 DEFSYM (QChost, ":host");
7293 staticpro (&Qeven); 7282 DEFSYM (QCservice, ":service");
7294 QCflowcontrol = intern_c_string (":flowcontrol"); 7283 DEFSYM (QClocal, ":local");
7295 staticpro (&QCflowcontrol); 7284 DEFSYM (QCremote, ":remote");
7296 Qhw = intern_c_string ("hw"); 7285 DEFSYM (QCcoding, ":coding");
7297 staticpro (&Qhw); 7286 DEFSYM (QCserver, ":server");
7298 Qsw = intern_c_string ("sw"); 7287 DEFSYM (QCnowait, ":nowait");
7299 staticpro (&Qsw); 7288 DEFSYM (QCsentinel, ":sentinel");
7300 QCsummary = intern_c_string (":summary"); 7289 DEFSYM (QClog, ":log");
7301 staticpro (&QCsummary); 7290 DEFSYM (QCnoquery, ":noquery");
7302 7291 DEFSYM (QCstop, ":stop");
7303 Qreal = intern_c_string ("real"); 7292 DEFSYM (QCoptions, ":options");
7304 staticpro (&Qreal); 7293 DEFSYM (QCplist, ":plist");
7305 Qnetwork = intern_c_string ("network"); 7294
7306 staticpro (&Qnetwork); 7295 DEFSYM (Qlast_nonmenu_event, "last-nonmenu-event");
7307 Qserial = intern_c_string ("serial");
7308 staticpro (&Qserial);
7309 QCbuffer = intern_c_string (":buffer");
7310 staticpro (&QCbuffer);
7311 QChost = intern_c_string (":host");
7312 staticpro (&QChost);
7313 QCservice = intern_c_string (":service");
7314 staticpro (&QCservice);
7315 QClocal = intern_c_string (":local");
7316 staticpro (&QClocal);
7317 QCremote = intern_c_string (":remote");
7318 staticpro (&QCremote);
7319 QCcoding = intern_c_string (":coding");
7320 staticpro (&QCcoding);
7321 QCserver = intern_c_string (":server");
7322 staticpro (&QCserver);
7323 QCnowait = intern_c_string (":nowait");
7324 staticpro (&QCnowait);
7325 QCsentinel = intern_c_string (":sentinel");
7326 staticpro (&QCsentinel);
7327 QClog = intern_c_string (":log");
7328 staticpro (&QClog);
7329 QCnoquery = intern_c_string (":noquery");
7330 staticpro (&QCnoquery);
7331 QCstop = intern_c_string (":stop");
7332 staticpro (&QCstop);
7333 QCoptions = intern_c_string (":options");
7334 staticpro (&QCoptions);
7335 QCplist = intern_c_string (":plist");
7336 staticpro (&QCplist);
7337
7338 Qlast_nonmenu_event = intern_c_string ("last-nonmenu-event");
7339 staticpro (&Qlast_nonmenu_event);
7340 7296
7341 staticpro (&Vprocess_alist); 7297 staticpro (&Vprocess_alist);
7342#ifdef SIGCHLD 7298#ifdef SIGCHLD
@@ -7345,73 +7301,40 @@ syms_of_process (void)
7345 7301
7346#endif /* subprocesses */ 7302#endif /* subprocesses */
7347 7303
7348 QCname = intern_c_string (":name"); 7304 DEFSYM (QCname, ":name");
7349 staticpro (&QCname); 7305 DEFSYM (QCtype, ":type");
7350 QCtype = intern_c_string (":type"); 7306
7351 staticpro (&QCtype); 7307 DEFSYM (Qeuid, "euid");
7352 7308 DEFSYM (Qegid, "egid");
7353 Qeuid = intern_c_string ("euid"); 7309 DEFSYM (Quser, "user");
7354 staticpro (&Qeuid); 7310 DEFSYM (Qgroup, "group");
7355 Qegid = intern_c_string ("egid"); 7311 DEFSYM (Qcomm, "comm");
7356 staticpro (&Qegid); 7312 DEFSYM (Qstate, "state");
7357 Quser = intern_c_string ("user"); 7313 DEFSYM (Qppid, "ppid");
7358 staticpro (&Quser); 7314 DEFSYM (Qpgrp, "pgrp");
7359 Qgroup = intern_c_string ("group"); 7315 DEFSYM (Qsess, "sess");
7360 staticpro (&Qgroup); 7316 DEFSYM (Qttname, "ttname");
7361 Qcomm = intern_c_string ("comm"); 7317 DEFSYM (Qtpgid, "tpgid");
7362 staticpro (&Qcomm); 7318 DEFSYM (Qminflt, "minflt");
7363 Qstate = intern_c_string ("state"); 7319 DEFSYM (Qmajflt, "majflt");
7364 staticpro (&Qstate); 7320 DEFSYM (Qcminflt, "cminflt");
7365 Qppid = intern_c_string ("ppid"); 7321 DEFSYM (Qcmajflt, "cmajflt");
7366 staticpro (&Qppid); 7322 DEFSYM (Qutime, "utime");
7367 Qpgrp = intern_c_string ("pgrp"); 7323 DEFSYM (Qstime, "stime");
7368 staticpro (&Qpgrp); 7324 DEFSYM (Qtime, "time");
7369 Qsess = intern_c_string ("sess"); 7325 DEFSYM (Qcutime, "cutime");
7370 staticpro (&Qsess); 7326 DEFSYM (Qcstime, "cstime");
7371 Qttname = intern_c_string ("ttname"); 7327 DEFSYM (Qctime, "ctime");
7372 staticpro (&Qttname); 7328 DEFSYM (Qpri, "pri");
7373 Qtpgid = intern_c_string ("tpgid"); 7329 DEFSYM (Qnice, "nice");
7374 staticpro (&Qtpgid); 7330 DEFSYM (Qthcount, "thcount");
7375 Qminflt = intern_c_string ("minflt"); 7331 DEFSYM (Qstart, "start");
7376 staticpro (&Qminflt); 7332 DEFSYM (Qvsize, "vsize");
7377 Qmajflt = intern_c_string ("majflt"); 7333 DEFSYM (Qrss, "rss");
7378 staticpro (&Qmajflt); 7334 DEFSYM (Qetime, "etime");
7379 Qcminflt = intern_c_string ("cminflt"); 7335 DEFSYM (Qpcpu, "pcpu");
7380 staticpro (&Qcminflt); 7336 DEFSYM (Qpmem, "pmem");
7381 Qcmajflt = intern_c_string ("cmajflt"); 7337 DEFSYM (Qargs, "args");
7382 staticpro (&Qcmajflt);
7383 Qutime = intern_c_string ("utime");
7384 staticpro (&Qutime);
7385 Qstime = intern_c_string ("stime");
7386 staticpro (&Qstime);
7387 Qtime = intern_c_string ("time");
7388 staticpro (&Qtime);
7389 Qcutime = intern_c_string ("cutime");
7390 staticpro (&Qcutime);
7391 Qcstime = intern_c_string ("cstime");
7392 staticpro (&Qcstime);
7393 Qctime = intern_c_string ("ctime");
7394 staticpro (&Qctime);
7395 Qpri = intern_c_string ("pri");
7396 staticpro (&Qpri);
7397 Qnice = intern_c_string ("nice");
7398 staticpro (&Qnice);
7399 Qthcount = intern_c_string ("thcount");
7400 staticpro (&Qthcount);
7401 Qstart = intern_c_string ("start");
7402 staticpro (&Qstart);
7403 Qvsize = intern_c_string ("vsize");
7404 staticpro (&Qvsize);
7405 Qrss = intern_c_string ("rss");
7406 staticpro (&Qrss);
7407 Qetime = intern_c_string ("etime");
7408 staticpro (&Qetime);
7409 Qpcpu = intern_c_string ("pcpu");
7410 staticpro (&Qpcpu);
7411 Qpmem = intern_c_string ("pmem");
7412 staticpro (&Qpmem);
7413 Qargs = intern_c_string ("args");
7414 staticpro (&Qargs);
7415 7338
7416 DEFVAR_BOOL ("delete-exited-processes", delete_exited_processes, 7339 DEFVAR_BOOL ("delete-exited-processes", delete_exited_processes,
7417 doc: /* *Non-nil means delete processes immediately when they exit. 7340 doc: /* *Non-nil means delete processes immediately when they exit.
diff --git a/src/search.c b/src/search.c
index 6c835f2cc64..d29a51c695b 100644
--- a/src/search.c
+++ b/src/search.c
@@ -3181,10 +3181,8 @@ syms_of_search (void)
3181 } 3181 }
3182 searchbuf_head = &searchbufs[0]; 3182 searchbuf_head = &searchbufs[0];
3183 3183
3184 Qsearch_failed = intern_c_string ("search-failed"); 3184 DEFSYM (Qsearch_failed, "search-failed");
3185 staticpro (&Qsearch_failed); 3185 DEFSYM (Qinvalid_regexp, "invalid-regexp");
3186 Qinvalid_regexp = intern_c_string ("invalid-regexp");
3187 staticpro (&Qinvalid_regexp);
3188 3186
3189 Fput (Qsearch_failed, Qerror_conditions, 3187 Fput (Qsearch_failed, Qerror_conditions,
3190 pure_cons (Qsearch_failed, pure_cons (Qerror, Qnil))); 3188 pure_cons (Qsearch_failed, pure_cons (Qerror, Qnil)));
diff --git a/src/sound.c b/src/sound.c
index 0e71e66352e..07c7dab0ada 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -1477,14 +1477,10 @@ Internal use only, use `play-sound' instead. */)
1477void 1477void
1478syms_of_sound (void) 1478syms_of_sound (void)
1479{ 1479{
1480 QCdevice = intern_c_string(":device"); 1480 DEFSYM (QCdevice, ":device");
1481 staticpro (&QCdevice); 1481 DEFSYM (QCvolume, ":volume");
1482 QCvolume = intern_c_string (":volume"); 1482 DEFSYM (Qsound, "sound");
1483 staticpro (&QCvolume); 1483 DEFSYM (Qplay_sound_functions, "play-sound-functions");
1484 Qsound = intern_c_string ("sound");
1485 staticpro (&Qsound);
1486 Qplay_sound_functions = intern_c_string ("play-sound-functions");
1487 staticpro (&Qplay_sound_functions);
1488 1484
1489 defsubr (&Splay_sound_internal); 1485 defsubr (&Splay_sound_internal);
1490} 1486}
diff --git a/src/syntax.c b/src/syntax.c
index 82103cfa3d4..8c2d5ded21f 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -3362,8 +3362,7 @@ init_syntax_once (void)
3362 Lisp_Object temp; 3362 Lisp_Object temp;
3363 3363
3364 /* This has to be done here, before we call Fmake_char_table. */ 3364 /* This has to be done here, before we call Fmake_char_table. */
3365 Qsyntax_table = intern_c_string ("syntax-table"); 3365 DEFSYM (Qsyntax_table, "syntax-table");
3366 staticpro (&Qsyntax_table);
3367 3366
3368 /* Intern_C_String this now in case it isn't already done. 3367 /* Intern_C_String this now in case it isn't already done.
3369 Setting this variable twice is harmless. 3368 Setting this variable twice is harmless.
@@ -3448,8 +3447,7 @@ init_syntax_once (void)
3448void 3447void
3449syms_of_syntax (void) 3448syms_of_syntax (void)
3450{ 3449{
3451 Qsyntax_table_p = intern_c_string ("syntax-table-p"); 3450 DEFSYM (Qsyntax_table_p, "syntax-table-p");
3452 staticpro (&Qsyntax_table_p);
3453 3451
3454 staticpro (&Vsyntax_code_object); 3452 staticpro (&Vsyntax_code_object);
3455 3453
@@ -3461,8 +3459,7 @@ syms_of_syntax (void)
3461 /* Defined in regex.c */ 3459 /* Defined in regex.c */
3462 staticpro (&re_match_object); 3460 staticpro (&re_match_object);
3463 3461
3464 Qscan_error = intern_c_string ("scan-error"); 3462 DEFSYM (Qscan_error, "scan-error");
3465 staticpro (&Qscan_error);
3466 Fput (Qscan_error, Qerror_conditions, 3463 Fput (Qscan_error, Qerror_conditions,
3467 pure_cons (Qscan_error, pure_cons (Qerror, Qnil))); 3464 pure_cons (Qscan_error, pure_cons (Qerror, Qnil)));
3468 Fput (Qscan_error, Qerror_message, 3465 Fput (Qscan_error, Qerror_message,
diff --git a/src/sysdep.c b/src/sysdep.c
index 5ad3389dd8f..3a73b1a467b 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2012,37 +2012,6 @@ perror (void)
2012} 2012}
2013#endif /* HPUX and not HAVE_PERROR */ 2013#endif /* HPUX and not HAVE_PERROR */
2014 2014
2015#ifndef HAVE_DUP2
2016
2017/*
2018 * Emulate BSD dup2. First close newd if it already exists.
2019 * Then, attempt to dup oldd. If not successful, call dup2 recursively
2020 * until we are, then close the unsuccessful ones.
2021 */
2022
2023int
2024dup2 (int oldd, int newd)
2025{
2026 register int fd, ret;
2027
2028 emacs_close (newd);
2029
2030#ifdef F_DUPFD
2031 return fcntl (oldd, F_DUPFD, newd);
2032#else
2033 fd = dup (old);
2034 if (fd == -1)
2035 return -1;
2036 if (fd == new)
2037 return new;
2038 ret = dup2 (old,new);
2039 emacs_close (fd);
2040 return ret;
2041#endif
2042}
2043
2044#endif /* not HAVE_DUP2 */
2045
2046/* 2015/*
2047 * Gettimeofday. Simulate as much as possible. Only accurate 2016 * Gettimeofday. Simulate as much as possible. Only accurate
2048 * to nearest second. Emacs doesn't use tzp so ignore it for now. 2017 * to nearest second. Emacs doesn't use tzp so ignore it for now.
diff --git a/src/terminal.c b/src/terminal.c
index c135c0f93ef..67577adf3b4 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -555,10 +555,8 @@ Each function is called with argument, the terminal.
555This may be called just before actually deleting the terminal, 555This may be called just before actually deleting the terminal,
556or some time later. */); 556or some time later. */);
557 Vdelete_terminal_functions = Qnil; 557 Vdelete_terminal_functions = Qnil;
558 Qdelete_terminal_functions = intern_c_string ("delete-terminal-functions"); 558 DEFSYM (Qdelete_terminal_functions, "delete-terminal-functions");
559 staticpro (&Qdelete_terminal_functions); 559 DEFSYM (Qrun_hook_with_args, "run-hook-with-args");
560 Qrun_hook_with_args = intern_c_string ("run-hook-with-args");
561 staticpro (&Qrun_hook_with_args);
562 560
563 defsubr (&Sdelete_terminal); 561 defsubr (&Sdelete_terminal);
564 defsubr (&Sframe_terminal); 562 defsubr (&Sframe_terminal);
diff --git a/src/textprop.c b/src/textprop.c
index dd8695f7af8..87f1675047b 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -2242,45 +2242,27 @@ inherits it if NONSTICKINESS is nil. The `front-sticky' and
2242 2242
2243 /* Common attributes one might give text */ 2243 /* Common attributes one might give text */
2244 2244
2245 staticpro (&Qforeground); 2245 DEFSYM (Qforeground, "foreground");
2246 Qforeground = intern_c_string ("foreground"); 2246 DEFSYM (Qbackground, "background");
2247 staticpro (&Qbackground); 2247 DEFSYM (Qfont, "font");
2248 Qbackground = intern_c_string ("background"); 2248 DEFSYM (Qstipple, "stipple");
2249 staticpro (&Qfont); 2249 DEFSYM (Qunderline, "underline");
2250 Qfont = intern_c_string ("font"); 2250 DEFSYM (Qread_only, "read-only");
2251 staticpro (&Qstipple); 2251 DEFSYM (Qinvisible, "invisible");
2252 Qstipple = intern_c_string ("stipple"); 2252 DEFSYM (Qintangible, "intangible");
2253 staticpro (&Qunderline); 2253 DEFSYM (Qcategory, "category");
2254 Qunderline = intern_c_string ("underline"); 2254 DEFSYM (Qlocal_map, "local-map");
2255 staticpro (&Qread_only); 2255 DEFSYM (Qfront_sticky, "front-sticky");
2256 Qread_only = intern_c_string ("read-only"); 2256 DEFSYM (Qrear_nonsticky, "rear-nonsticky");
2257 staticpro (&Qinvisible); 2257 DEFSYM (Qmouse_face, "mouse-face");
2258 Qinvisible = intern_c_string ("invisible"); 2258 DEFSYM (Qminibuffer_prompt, "minibuffer-prompt");
2259 staticpro (&Qintangible);
2260 Qintangible = intern_c_string ("intangible");
2261 staticpro (&Qcategory);
2262 Qcategory = intern_c_string ("category");
2263 staticpro (&Qlocal_map);
2264 Qlocal_map = intern_c_string ("local-map");
2265 staticpro (&Qfront_sticky);
2266 Qfront_sticky = intern_c_string ("front-sticky");
2267 staticpro (&Qrear_nonsticky);
2268 Qrear_nonsticky = intern_c_string ("rear-nonsticky");
2269 staticpro (&Qmouse_face);
2270 Qmouse_face = intern_c_string ("mouse-face");
2271 staticpro (&Qminibuffer_prompt);
2272 Qminibuffer_prompt = intern_c_string ("minibuffer-prompt");
2273 2259
2274 /* Properties that text might use to specify certain actions */ 2260 /* Properties that text might use to specify certain actions */
2275 2261
2276 staticpro (&Qmouse_left); 2262 DEFSYM (Qmouse_left, "mouse-left");
2277 Qmouse_left = intern_c_string ("mouse-left"); 2263 DEFSYM (Qmouse_entered, "mouse-entered");
2278 staticpro (&Qmouse_entered); 2264 DEFSYM (Qpoint_left, "point-left");
2279 Qmouse_entered = intern_c_string ("mouse-entered"); 2265 DEFSYM (Qpoint_entered, "point-entered");
2280 staticpro (&Qpoint_left);
2281 Qpoint_left = intern_c_string ("point-left");
2282 staticpro (&Qpoint_entered);
2283 Qpoint_entered = intern_c_string ("point-entered");
2284 2266
2285 defsubr (&Stext_properties_at); 2267 defsubr (&Stext_properties_at);
2286 defsubr (&Sget_text_property); 2268 defsubr (&Sget_text_property);
diff --git a/src/undo.c b/src/undo.c
index e7e9ae5632e..7e121e8b27d 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -637,11 +637,8 @@ Return what remains of the list. */)
637void 637void
638syms_of_undo (void) 638syms_of_undo (void)
639{ 639{
640 Qinhibit_read_only = intern_c_string ("inhibit-read-only"); 640 DEFSYM (Qinhibit_read_only, "inhibit-read-only");
641 staticpro (&Qinhibit_read_only); 641 DEFSYM (Qapply, "apply");
642
643 Qapply = intern_c_string ("apply");
644 staticpro (&Qapply);
645 642
646 pending_boundary = Qnil; 643 pending_boundary = Qnil;
647 staticpro (&pending_boundary); 644 staticpro (&pending_boundary);
diff --git a/src/w32.c b/src/w32.c
index d81fdf3305d..53bf2e811e2 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -5960,8 +5960,7 @@ globals_of_w32 (void)
5960 get_process_times_fn = (GetProcessTimes_Proc) 5960 get_process_times_fn = (GetProcessTimes_Proc)
5961 GetProcAddress (kernel32, "GetProcessTimes"); 5961 GetProcAddress (kernel32, "GetProcessTimes");
5962 5962
5963 QCloaded_from = intern_c_string (":loaded-from"); 5963 DEFSYM (QCloaded_from, ":loaded-from");
5964 staticpro (&QCloaded_from);
5965 5964
5966 Vlibrary_cache = Qnil; 5965 Vlibrary_cache = Qnil;
5967 staticpro (&Vlibrary_cache); 5966 staticpro (&Vlibrary_cache);
diff --git a/src/w32menu.c b/src/w32menu.c
index e2f6de7f0c8..c31a8c1fd96 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -33,7 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
33#include "blockinput.h" 33#include "blockinput.h"
34#include "buffer.h" 34#include "buffer.h"
35#include "charset.h" 35#include "charset.h"
36#include "character.h"
37#include "coding.h" 36#include "coding.h"
38#include "menu.h" 37#include "menu.h"
39 38
diff --git a/src/w32proc.c b/src/w32proc.c
index e94d9aa3254..47cbf57d9ea 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -51,7 +51,6 @@ extern BOOL WINAPI IsValidLocale (LCID, DWORD);
51#endif 51#endif
52 52
53#include "lisp.h" 53#include "lisp.h"
54#include "character.h"
55#include "w32.h" 54#include "w32.h"
56#include "w32heap.h" 55#include "w32heap.h"
57#include "systime.h" 56#include "systime.h"
diff --git a/src/w32select.c b/src/w32select.c
index ef0cb3adc24..e3225c3f996 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -80,7 +80,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
80#include "blockinput.h" 80#include "blockinput.h"
81#include "charset.h" 81#include "charset.h"
82#include "coding.h" 82#include "coding.h"
83#include "character.h"
84#include "composite.h" 83#include "composite.h"
85 84
86 85
diff --git a/src/window.c b/src/window.c
index a5f95ea7883..ebfe318defd 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6443,69 +6443,30 @@ init_window (void)
6443void 6443void
6444syms_of_window (void) 6444syms_of_window (void)
6445{ 6445{
6446 Qscroll_up = intern_c_string ("scroll-up"); 6446 DEFSYM (Qscroll_up, "scroll-up");
6447 staticpro (&Qscroll_up); 6447 DEFSYM (Qscroll_down, "scroll-down");
6448 6448 DEFSYM (Qscroll_command, "scroll-command");
6449 Qscroll_down = intern_c_string ("scroll-down");
6450 staticpro (&Qscroll_down);
6451
6452 Qscroll_command = intern_c_string ("scroll-command");
6453 staticpro (&Qscroll_command);
6454 6449
6455 Fput (Qscroll_up, Qscroll_command, Qt); 6450 Fput (Qscroll_up, Qscroll_command, Qt);
6456 Fput (Qscroll_down, Qscroll_command, Qt); 6451 Fput (Qscroll_down, Qscroll_command, Qt);
6457 6452
6458 staticpro (&Qwindow_configuration_change_hook); 6453 DEFSYM (Qwindow_configuration_change_hook, "window-configuration-change-hook");
6459 Qwindow_configuration_change_hook 6454 DEFSYM (Qwindowp, "windowp");
6460 = intern_c_string ("window-configuration-change-hook"); 6455 DEFSYM (Qwindow_configuration_p, "window-configuration-p");
6461 6456 DEFSYM (Qwindow_live_p, "window-live-p");
6462 Qwindowp = intern_c_string ("windowp"); 6457 DEFSYM (Qwindow_deletable_p, "window-deletable-p");
6463 staticpro (&Qwindowp); 6458 DEFSYM (Qdelete_window, "delete-window");
6464 6459 DEFSYM (Qresize_root_window, "resize-root-window");
6465 Qwindow_configuration_p = intern_c_string ("window-configuration-p"); 6460 DEFSYM (Qresize_root_window_vertically, "resize-root-window-vertically");
6466 staticpro (&Qwindow_configuration_p); 6461 DEFSYM (Qsafe, "safe");
6467 6462 DEFSYM (Qdisplay_buffer, "display-buffer");
6468 Qwindow_live_p = intern_c_string ("window-live-p"); 6463 DEFSYM (Qreplace_buffer_in_windows, "replace-buffer-in-windows");
6469 staticpro (&Qwindow_live_p); 6464 DEFSYM (Qrecord_window_buffer, "record-window-buffer");
6470 6465 DEFSYM (Qget_mru_window, "get-mru-window");
6471 Qwindow_deletable_p = intern_c_string ("window-deletable-p"); 6466 DEFSYM (Qtemp_buffer_show_hook, "temp-buffer-show-hook");
6472 staticpro (&Qwindow_deletable_p); 6467 DEFSYM (Qabove, "above");
6473 6468 DEFSYM (Qbelow, "below");
6474 Qdelete_window = intern_c_string ("delete-window"); 6469 DEFSYM (Qauto_buffer_name, "auto-buffer-name");
6475 staticpro (&Qdelete_window);
6476
6477 Qresize_root_window = intern_c_string ("resize-root-window");
6478 staticpro (&Qresize_root_window);
6479
6480 Qresize_root_window_vertically = intern_c_string ("resize-root-window-vertically");
6481 staticpro (&Qresize_root_window_vertically);
6482
6483 Qsafe = intern_c_string ("safe");
6484 staticpro (&Qsafe);
6485
6486 Qdisplay_buffer = intern_c_string ("display-buffer");
6487 staticpro (&Qdisplay_buffer);
6488
6489 Qreplace_buffer_in_windows = intern_c_string ("replace-buffer-in-windows");
6490 staticpro (&Qreplace_buffer_in_windows);
6491
6492 Qrecord_window_buffer = intern_c_string ("record-window-buffer");
6493 staticpro (&Qrecord_window_buffer);
6494
6495 Qget_mru_window = intern_c_string ("get-mru-window");
6496 staticpro (&Qget_mru_window);
6497
6498 Qtemp_buffer_show_hook = intern_c_string ("temp-buffer-show-hook");
6499 staticpro (&Qtemp_buffer_show_hook);
6500
6501 Qabove = intern_c_string ("above");
6502 staticpro (&Qabove);
6503
6504 Qbelow = intern_c_string ("below");
6505 staticpro (&Qbelow);
6506
6507 Qauto_buffer_name = intern_c_string ("auto-buffer-name");
6508 staticpro (&Qauto_buffer_name);
6509 6470
6510 staticpro (&Vwindow_list); 6471 staticpro (&Vwindow_list);
6511 6472
diff --git a/src/xdisp.c b/src/xdisp.c
index c48610b37f2..44521ede97e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -26661,8 +26661,7 @@ syms_of_xdisp (void)
26661 Vmessage_stack = Qnil; 26661 Vmessage_stack = Qnil;
26662 staticpro (&Vmessage_stack); 26662 staticpro (&Vmessage_stack);
26663 26663
26664 Qinhibit_redisplay = intern_c_string ("inhibit-redisplay"); 26664 DEFSYM (Qinhibit_redisplay, "inhibit-redisplay");
26665 staticpro (&Qinhibit_redisplay);
26666 26665
26667 message_dolog_marker1 = Fmake_marker (); 26666 message_dolog_marker1 = Fmake_marker ();
26668 staticpro (&message_dolog_marker1); 26667 staticpro (&message_dolog_marker1);
@@ -26687,141 +26686,72 @@ syms_of_xdisp (void)
26687 defsubr (&Sinvisible_p); 26686 defsubr (&Sinvisible_p);
26688 defsubr (&Scurrent_bidi_paragraph_direction); 26687 defsubr (&Scurrent_bidi_paragraph_direction);
26689 26688
26690 staticpro (&Qmenu_bar_update_hook); 26689 DEFSYM (Qmenu_bar_update_hook, "menu-bar-update-hook");
26691 Qmenu_bar_update_hook = intern_c_string ("menu-bar-update-hook"); 26690 DEFSYM (Qoverriding_terminal_local_map, "overriding-terminal-local-map");
26692 26691 DEFSYM (Qoverriding_local_map, "overriding-local-map");
26693 staticpro (&Qoverriding_terminal_local_map); 26692 DEFSYM (Qwindow_scroll_functions, "window-scroll-functions");
26694 Qoverriding_terminal_local_map = intern_c_string ("overriding-terminal-local-map"); 26693 DEFSYM (Qwindow_text_change_functions, "window-text-change-functions");
26695 26694 DEFSYM (Qredisplay_end_trigger_functions, "redisplay-end-trigger-functions");
26696 staticpro (&Qoverriding_local_map); 26695 DEFSYM (Qinhibit_point_motion_hooks, "inhibit-point-motion-hooks");
26697 Qoverriding_local_map = intern_c_string ("overriding-local-map"); 26696 DEFSYM (Qeval, "eval");
26698 26697 DEFSYM (QCdata, ":data");
26699 staticpro (&Qwindow_scroll_functions); 26698 DEFSYM (Qdisplay, "display");
26700 Qwindow_scroll_functions = intern_c_string ("window-scroll-functions"); 26699 DEFSYM (Qspace_width, "space-width");
26701 26700 DEFSYM (Qraise, "raise");
26702 staticpro (&Qwindow_text_change_functions); 26701 DEFSYM (Qslice, "slice");
26703 Qwindow_text_change_functions = intern_c_string ("window-text-change-functions"); 26702 DEFSYM (Qspace, "space");
26704 26703 DEFSYM (Qmargin, "margin");
26705 staticpro (&Qredisplay_end_trigger_functions); 26704 DEFSYM (Qpointer, "pointer");
26706 Qredisplay_end_trigger_functions = intern_c_string ("redisplay-end-trigger-functions"); 26705 DEFSYM (Qleft_margin, "left-margin");
26707 26706 DEFSYM (Qright_margin, "right-margin");
26708 staticpro (&Qinhibit_point_motion_hooks); 26707 DEFSYM (Qcenter, "center");
26709 Qinhibit_point_motion_hooks = intern_c_string ("inhibit-point-motion-hooks"); 26708 DEFSYM (Qline_height, "line-height");
26710 26709 DEFSYM (QCalign_to, ":align-to");
26711 Qeval = intern_c_string ("eval"); 26710 DEFSYM (QCrelative_width, ":relative-width");
26712 staticpro (&Qeval); 26711 DEFSYM (QCrelative_height, ":relative-height");
26713 26712 DEFSYM (QCeval, ":eval");
26714 QCdata = intern_c_string (":data"); 26713 DEFSYM (QCpropertize, ":propertize");
26715 staticpro (&QCdata); 26714 DEFSYM (QCfile, ":file");
26716 Qdisplay = intern_c_string ("display"); 26715 DEFSYM (Qfontified, "fontified");
26717 staticpro (&Qdisplay); 26716 DEFSYM (Qfontification_functions, "fontification-functions");
26718 Qspace_width = intern_c_string ("space-width"); 26717 DEFSYM (Qtrailing_whitespace, "trailing-whitespace");
26719 staticpro (&Qspace_width); 26718 DEFSYM (Qescape_glyph, "escape-glyph");
26720 Qraise = intern_c_string ("raise"); 26719 DEFSYM (Qnobreak_space, "nobreak-space");
26721 staticpro (&Qraise); 26720 DEFSYM (Qimage, "image");
26722 Qslice = intern_c_string ("slice"); 26721 DEFSYM (Qtext, "text");
26723 staticpro (&Qslice); 26722 DEFSYM (Qboth, "both");
26724 Qspace = intern_c_string ("space"); 26723 DEFSYM (Qboth_horiz, "both-horiz");
26725 staticpro (&Qspace); 26724 DEFSYM (Qtext_image_horiz, "text-image-horiz");
26726 Qmargin = intern_c_string ("margin"); 26725 DEFSYM (QCmap, ":map");
26727 staticpro (&Qmargin); 26726 DEFSYM (QCpointer, ":pointer");
26728 Qpointer = intern_c_string ("pointer"); 26727 DEFSYM (Qrect, "rect");
26729 staticpro (&Qpointer); 26728 DEFSYM (Qcircle, "circle");
26730 Qleft_margin = intern_c_string ("left-margin"); 26729 DEFSYM (Qpoly, "poly");
26731 staticpro (&Qleft_margin); 26730 DEFSYM (Qmessage_truncate_lines, "message-truncate-lines");
26732 Qright_margin = intern_c_string ("right-margin"); 26731 DEFSYM (Qgrow_only, "grow-only");
26733 staticpro (&Qright_margin); 26732 DEFSYM (Qinhibit_menubar_update, "inhibit-menubar-update");
26734 Qcenter = intern_c_string ("center"); 26733 DEFSYM (Qinhibit_eval_during_redisplay, "inhibit-eval-during-redisplay");
26735 staticpro (&Qcenter); 26734 DEFSYM (Qposition, "position");
26736 Qline_height = intern_c_string ("line-height"); 26735 DEFSYM (Qbuffer_position, "buffer-position");
26737 staticpro (&Qline_height); 26736 DEFSYM (Qobject, "object");
26738 QCalign_to = intern_c_string (":align-to"); 26737 DEFSYM (Qbar, "bar");
26739 staticpro (&QCalign_to); 26738 DEFSYM (Qhbar, "hbar");
26740 QCrelative_width = intern_c_string (":relative-width"); 26739 DEFSYM (Qbox, "box");
26741 staticpro (&QCrelative_width); 26740 DEFSYM (Qhollow, "hollow");
26742 QCrelative_height = intern_c_string (":relative-height"); 26741 DEFSYM (Qhand, "hand");
26743 staticpro (&QCrelative_height); 26742 DEFSYM (Qarrow, "arrow");
26744 QCeval = intern_c_string (":eval"); 26743 DEFSYM (Qtext, "text");
26745 staticpro (&QCeval); 26744 DEFSYM (Qinhibit_free_realized_faces, "inhibit-free-realized-faces");
26746 QCpropertize = intern_c_string (":propertize");
26747 staticpro (&QCpropertize);
26748 QCfile = intern_c_string (":file");
26749 staticpro (&QCfile);
26750 Qfontified = intern_c_string ("fontified");
26751 staticpro (&Qfontified);
26752 Qfontification_functions = intern_c_string ("fontification-functions");
26753 staticpro (&Qfontification_functions);
26754 Qtrailing_whitespace = intern_c_string ("trailing-whitespace");
26755 staticpro (&Qtrailing_whitespace);
26756 Qescape_glyph = intern_c_string ("escape-glyph");
26757 staticpro (&Qescape_glyph);
26758 Qnobreak_space = intern_c_string ("nobreak-space");
26759 staticpro (&Qnobreak_space);
26760 Qimage = intern_c_string ("image");
26761 staticpro (&Qimage);
26762 Qtext = intern_c_string ("text");
26763 staticpro (&Qtext);
26764 Qboth = intern_c_string ("both");
26765 staticpro (&Qboth);
26766 Qboth_horiz = intern_c_string ("both-horiz");
26767 staticpro (&Qboth_horiz);
26768 Qtext_image_horiz = intern_c_string ("text-image-horiz");
26769 staticpro (&Qtext_image_horiz);
26770 QCmap = intern_c_string (":map");
26771 staticpro (&QCmap);
26772 QCpointer = intern_c_string (":pointer");
26773 staticpro (&QCpointer);
26774 Qrect = intern_c_string ("rect");
26775 staticpro (&Qrect);
26776 Qcircle = intern_c_string ("circle");
26777 staticpro (&Qcircle);
26778 Qpoly = intern_c_string ("poly");
26779 staticpro (&Qpoly);
26780 Qmessage_truncate_lines = intern_c_string ("message-truncate-lines");
26781 staticpro (&Qmessage_truncate_lines);
26782 Qgrow_only = intern_c_string ("grow-only");
26783 staticpro (&Qgrow_only);
26784 Qinhibit_menubar_update = intern_c_string ("inhibit-menubar-update");
26785 staticpro (&Qinhibit_menubar_update);
26786 Qinhibit_eval_during_redisplay = intern_c_string ("inhibit-eval-during-redisplay");
26787 staticpro (&Qinhibit_eval_during_redisplay);
26788 Qposition = intern_c_string ("position");
26789 staticpro (&Qposition);
26790 Qbuffer_position = intern_c_string ("buffer-position");
26791 staticpro (&Qbuffer_position);
26792 Qobject = intern_c_string ("object");
26793 staticpro (&Qobject);
26794 Qbar = intern_c_string ("bar");
26795 staticpro (&Qbar);
26796 Qhbar = intern_c_string ("hbar");
26797 staticpro (&Qhbar);
26798 Qbox = intern_c_string ("box");
26799 staticpro (&Qbox);
26800 Qhollow = intern_c_string ("hollow");
26801 staticpro (&Qhollow);
26802 Qhand = intern_c_string ("hand");
26803 staticpro (&Qhand);
26804 Qarrow = intern_c_string ("arrow");
26805 staticpro (&Qarrow);
26806 Qtext = intern_c_string ("text");
26807 staticpro (&Qtext);
26808 Qinhibit_free_realized_faces = intern_c_string ("inhibit-free-realized-faces");
26809 staticpro (&Qinhibit_free_realized_faces);
26810 26745
26811 list_of_error = Fcons (Fcons (intern_c_string ("error"), 26746 list_of_error = Fcons (Fcons (intern_c_string ("error"),
26812 Fcons (intern_c_string ("void-variable"), Qnil)), 26747 Fcons (intern_c_string ("void-variable"), Qnil)),
26813 Qnil); 26748 Qnil);
26814 staticpro (&list_of_error); 26749 staticpro (&list_of_error);
26815 26750
26816 Qlast_arrow_position = intern_c_string ("last-arrow-position"); 26751 DEFSYM (Qlast_arrow_position, "last-arrow-position");
26817 staticpro (&Qlast_arrow_position); 26752 DEFSYM (Qlast_arrow_string, "last-arrow-string");
26818 Qlast_arrow_string = intern_c_string ("last-arrow-string"); 26753 DEFSYM (Qoverlay_arrow_string, "overlay-arrow-string");
26819 staticpro (&Qlast_arrow_string); 26754 DEFSYM (Qoverlay_arrow_bitmap, "overlay-arrow-bitmap");
26820
26821 Qoverlay_arrow_string = intern_c_string ("overlay-arrow-string");
26822 staticpro (&Qoverlay_arrow_string);
26823 Qoverlay_arrow_bitmap = intern_c_string ("overlay-arrow-bitmap");
26824 staticpro (&Qoverlay_arrow_bitmap);
26825 26755
26826 echo_buffer[0] = echo_buffer[1] = Qnil; 26756 echo_buffer[0] = echo_buffer[1] = Qnil;
26827 staticpro (&echo_buffer[0]); 26757 staticpro (&echo_buffer[0]);
@@ -26855,10 +26785,8 @@ syms_of_xdisp (void)
26855 staticpro (&previous_help_echo_string); 26785 staticpro (&previous_help_echo_string);
26856 help_echo_pos = -1; 26786 help_echo_pos = -1;
26857 26787
26858 Qright_to_left = intern_c_string ("right-to-left"); 26788 DEFSYM (Qright_to_left, "right-to-left");
26859 staticpro (&Qright_to_left); 26789 DEFSYM (Qleft_to_right, "left-to-right");
26860 Qleft_to_right = intern_c_string ("left-to-right");
26861 staticpro (&Qleft_to_right);
26862 26790
26863#ifdef HAVE_WINDOW_SYSTEM 26791#ifdef HAVE_WINDOW_SYSTEM
26864 DEFVAR_BOOL ("x-stretch-cursor", x_stretch_cursor_p, 26792 DEFVAR_BOOL ("x-stretch-cursor", x_stretch_cursor_p,
@@ -27178,8 +27106,7 @@ the frame's other specifications determine how to blink the cursor off. */);
27178If non-nil, windows are automatically scrolled horizontally to make 27106If non-nil, windows are automatically scrolled horizontally to make
27179point visible. */); 27107point visible. */);
27180 automatic_hscrolling_p = 1; 27108 automatic_hscrolling_p = 1;
27181 Qauto_hscroll_mode = intern_c_string ("auto-hscroll-mode"); 27109 DEFSYM (Qauto_hscroll_mode, "auto-hscroll-mode");
27182 staticpro (&Qauto_hscroll_mode);
27183 27110
27184 DEFVAR_INT ("hscroll-margin", hscroll_margin, 27111 DEFVAR_INT ("hscroll-margin", hscroll_margin,
27185 doc: /* *How many columns away from the window edge point is allowed to get 27112 doc: /* *How many columns away from the window edge point is allowed to get
@@ -27235,8 +27162,7 @@ property.
27235 27162
27236To add a prefix to non-continuation lines, use `line-prefix'. */); 27163To add a prefix to non-continuation lines, use `line-prefix'. */);
27237 Vwrap_prefix = Qnil; 27164 Vwrap_prefix = Qnil;
27238 staticpro (&Qwrap_prefix); 27165 DEFSYM (Qwrap_prefix, "wrap-prefix");
27239 Qwrap_prefix = intern_c_string ("wrap-prefix");
27240 Fmake_variable_buffer_local (Qwrap_prefix); 27166 Fmake_variable_buffer_local (Qwrap_prefix);
27241 27167
27242 DEFVAR_LISP ("line-prefix", Vline_prefix, 27168 DEFVAR_LISP ("line-prefix", Vline_prefix,
@@ -27249,8 +27175,7 @@ property.
27249 27175
27250To add a prefix to continuation lines, use `wrap-prefix'. */); 27176To add a prefix to continuation lines, use `wrap-prefix'. */);
27251 Vline_prefix = Qnil; 27177 Vline_prefix = Qnil;
27252 staticpro (&Qline_prefix); 27178 DEFSYM (Qline_prefix, "line-prefix");
27253 Qline_prefix = intern_c_string ("line-prefix");
27254 Fmake_variable_buffer_local (Qline_prefix); 27179 Fmake_variable_buffer_local (Qline_prefix);
27255 27180
27256 DEFVAR_BOOL ("inhibit-eval-during-redisplay", inhibit_eval_during_redisplay, 27181 DEFVAR_BOOL ("inhibit-eval-during-redisplay", inhibit_eval_during_redisplay,
diff --git a/src/xfaces.c b/src/xfaces.c
index 5833633c2e7..4f06bd3ba55 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6393,153 +6393,82 @@ DEFUN ("show-face-resources", Fshow_face_resources, Sshow_face_resources,
6393void 6393void
6394syms_of_xfaces (void) 6394syms_of_xfaces (void)
6395{ 6395{
6396 Qface = intern_c_string ("face"); 6396 DEFSYM (Qface, "face");
6397 staticpro (&Qface); 6397 DEFSYM (Qface_no_inherit, "face-no-inherit");
6398 Qface_no_inherit = intern_c_string ("face-no-inherit"); 6398 DEFSYM (Qbitmap_spec_p, "bitmap-spec-p");
6399 staticpro (&Qface_no_inherit); 6399 DEFSYM (Qframe_set_background_mode, "frame-set-background-mode");
6400 Qbitmap_spec_p = intern_c_string ("bitmap-spec-p");
6401 staticpro (&Qbitmap_spec_p);
6402 Qframe_set_background_mode = intern_c_string ("frame-set-background-mode");
6403 staticpro (&Qframe_set_background_mode);
6404 6400
6405 /* Lisp face attribute keywords. */ 6401 /* Lisp face attribute keywords. */
6406 QCfamily = intern_c_string (":family"); 6402 DEFSYM (QCfamily, ":family");
6407 staticpro (&QCfamily); 6403 DEFSYM (QCheight, ":height");
6408 QCheight = intern_c_string (":height"); 6404 DEFSYM (QCweight, ":weight");
6409 staticpro (&QCheight); 6405 DEFSYM (QCslant, ":slant");
6410 QCweight = intern_c_string (":weight"); 6406 DEFSYM (QCunderline, ":underline");
6411 staticpro (&QCweight); 6407 DEFSYM (QCinverse_video, ":inverse-video");
6412 QCslant = intern_c_string (":slant"); 6408 DEFSYM (QCreverse_video, ":reverse-video");
6413 staticpro (&QCslant); 6409 DEFSYM (QCforeground, ":foreground");
6414 QCunderline = intern_c_string (":underline"); 6410 DEFSYM (QCbackground, ":background");
6415 staticpro (&QCunderline); 6411 DEFSYM (QCstipple, ":stipple");
6416 QCinverse_video = intern_c_string (":inverse-video"); 6412 DEFSYM (QCwidth, ":width");
6417 staticpro (&QCinverse_video); 6413 DEFSYM (QCfont, ":font");
6418 QCreverse_video = intern_c_string (":reverse-video"); 6414 DEFSYM (QCfontset, ":fontset");
6419 staticpro (&QCreverse_video); 6415 DEFSYM (QCbold, ":bold");
6420 QCforeground = intern_c_string (":foreground"); 6416 DEFSYM (QCitalic, ":italic");
6421 staticpro (&QCforeground); 6417 DEFSYM (QCoverline, ":overline");
6422 QCbackground = intern_c_string (":background"); 6418 DEFSYM (QCstrike_through, ":strike-through");
6423 staticpro (&QCbackground); 6419 DEFSYM (QCbox, ":box");
6424 QCstipple = intern_c_string (":stipple"); 6420 DEFSYM (QCinherit, ":inherit");
6425 staticpro (&QCstipple);
6426 QCwidth = intern_c_string (":width");
6427 staticpro (&QCwidth);
6428 QCfont = intern_c_string (":font");
6429 staticpro (&QCfont);
6430 QCfontset = intern_c_string (":fontset");
6431 staticpro (&QCfontset);
6432 QCbold = intern_c_string (":bold");
6433 staticpro (&QCbold);
6434 QCitalic = intern_c_string (":italic");
6435 staticpro (&QCitalic);
6436 QCoverline = intern_c_string (":overline");
6437 staticpro (&QCoverline);
6438 QCstrike_through = intern_c_string (":strike-through");
6439 staticpro (&QCstrike_through);
6440 QCbox = intern_c_string (":box");
6441 staticpro (&QCbox);
6442 QCinherit = intern_c_string (":inherit");
6443 staticpro (&QCinherit);
6444 6421
6445 /* Symbols used for Lisp face attribute values. */ 6422 /* Symbols used for Lisp face attribute values. */
6446 QCcolor = intern_c_string (":color"); 6423 DEFSYM (QCcolor, ":color");
6447 staticpro (&QCcolor); 6424 DEFSYM (QCline_width, ":line-width");
6448 QCline_width = intern_c_string (":line-width"); 6425 DEFSYM (QCstyle, ":style");
6449 staticpro (&QCline_width); 6426 DEFSYM (Qreleased_button, "released-button");
6450 QCstyle = intern_c_string (":style"); 6427 DEFSYM (Qpressed_button, "pressed-button");
6451 staticpro (&QCstyle); 6428 DEFSYM (Qnormal, "normal");
6452 Qreleased_button = intern_c_string ("released-button"); 6429 DEFSYM (Qultra_light, "ultra-light");
6453 staticpro (&Qreleased_button); 6430 DEFSYM (Qextra_light, "extra-light");
6454 Qpressed_button = intern_c_string ("pressed-button"); 6431 DEFSYM (Qlight, "light");
6455 staticpro (&Qpressed_button); 6432 DEFSYM (Qsemi_light, "semi-light");
6456 Qnormal = intern_c_string ("normal"); 6433 DEFSYM (Qsemi_bold, "semi-bold");
6457 staticpro (&Qnormal); 6434 DEFSYM (Qbold, "bold");
6458 Qultra_light = intern_c_string ("ultra-light"); 6435 DEFSYM (Qextra_bold, "extra-bold");
6459 staticpro (&Qultra_light); 6436 DEFSYM (Qultra_bold, "ultra-bold");
6460 Qextra_light = intern_c_string ("extra-light"); 6437 DEFSYM (Qoblique, "oblique");
6461 staticpro (&Qextra_light); 6438 DEFSYM (Qitalic, "italic");
6462 Qlight = intern_c_string ("light"); 6439 DEFSYM (Qreverse_oblique, "reverse-oblique");
6463 staticpro (&Qlight); 6440 DEFSYM (Qreverse_italic, "reverse-italic");
6464 Qsemi_light = intern_c_string ("semi-light"); 6441 DEFSYM (Qultra_condensed, "ultra-condensed");
6465 staticpro (&Qsemi_light); 6442 DEFSYM (Qextra_condensed, "extra-condensed");
6466 Qsemi_bold = intern_c_string ("semi-bold"); 6443 DEFSYM (Qcondensed, "condensed");
6467 staticpro (&Qsemi_bold); 6444 DEFSYM (Qsemi_condensed, "semi-condensed");
6468 Qbold = intern_c_string ("bold"); 6445 DEFSYM (Qsemi_expanded, "semi-expanded");
6469 staticpro (&Qbold); 6446 DEFSYM (Qexpanded, "expanded");
6470 Qextra_bold = intern_c_string ("extra-bold"); 6447 DEFSYM (Qextra_expanded, "extra-expanded");
6471 staticpro (&Qextra_bold); 6448 DEFSYM (Qultra_expanded, "ultra-expanded");
6472 Qultra_bold = intern_c_string ("ultra-bold"); 6449 DEFSYM (Qbackground_color, "background-color");
6473 staticpro (&Qultra_bold); 6450 DEFSYM (Qforeground_color, "foreground-color");
6474 Qoblique = intern_c_string ("oblique"); 6451 DEFSYM (Qunspecified, "unspecified");
6475 staticpro (&Qoblique); 6452 DEFSYM (Qignore_defface, ":ignore-defface");
6476 Qitalic = intern_c_string ("italic"); 6453
6477 staticpro (&Qitalic); 6454 DEFSYM (Qface_alias, "face-alias");
6478 Qreverse_oblique = intern_c_string ("reverse-oblique"); 6455 DEFSYM (Qdefault, "default");
6479 staticpro (&Qreverse_oblique); 6456 DEFSYM (Qtool_bar, "tool-bar");
6480 Qreverse_italic = intern_c_string ("reverse-italic"); 6457 DEFSYM (Qregion, "region");
6481 staticpro (&Qreverse_italic); 6458 DEFSYM (Qfringe, "fringe");
6482 Qultra_condensed = intern_c_string ("ultra-condensed"); 6459 DEFSYM (Qheader_line, "header-line");
6483 staticpro (&Qultra_condensed); 6460 DEFSYM (Qscroll_bar, "scroll-bar");
6484 Qextra_condensed = intern_c_string ("extra-condensed"); 6461 DEFSYM (Qmenu, "menu");
6485 staticpro (&Qextra_condensed); 6462 DEFSYM (Qcursor, "cursor");
6486 Qcondensed = intern_c_string ("condensed"); 6463 DEFSYM (Qborder, "border");
6487 staticpro (&Qcondensed); 6464 DEFSYM (Qmouse, "mouse");
6488 Qsemi_condensed = intern_c_string ("semi-condensed"); 6465 DEFSYM (Qmode_line_inactive, "mode-line-inactive");
6489 staticpro (&Qsemi_condensed); 6466 DEFSYM (Qvertical_border, "vertical-border");
6490 Qsemi_expanded = intern_c_string ("semi-expanded"); 6467 DEFSYM (Qtty_color_desc, "tty-color-desc");
6491 staticpro (&Qsemi_expanded); 6468 DEFSYM (Qtty_color_standard_values, "tty-color-standard-values");
6492 Qexpanded = intern_c_string ("expanded"); 6469 DEFSYM (Qtty_color_by_index, "tty-color-by-index");
6493 staticpro (&Qexpanded); 6470 DEFSYM (Qtty_color_alist, "tty-color-alist");
6494 Qextra_expanded = intern_c_string ("extra-expanded"); 6471 DEFSYM (Qscalable_fonts_allowed, "scalable-fonts-allowed");
6495 staticpro (&Qextra_expanded);
6496 Qultra_expanded = intern_c_string ("ultra-expanded");
6497 staticpro (&Qultra_expanded);
6498 Qbackground_color = intern_c_string ("background-color");
6499 staticpro (&Qbackground_color);
6500 Qforeground_color = intern_c_string ("foreground-color");
6501 staticpro (&Qforeground_color);
6502 Qunspecified = intern_c_string ("unspecified");
6503 staticpro (&Qunspecified);
6504 Qignore_defface = intern_c_string (":ignore-defface");
6505 staticpro (&Qignore_defface);
6506
6507 Qface_alias = intern_c_string ("face-alias");
6508 staticpro (&Qface_alias);
6509 Qdefault = intern_c_string ("default");
6510 staticpro (&Qdefault);
6511 Qtool_bar = intern_c_string ("tool-bar");
6512 staticpro (&Qtool_bar);
6513 Qregion = intern_c_string ("region");
6514 staticpro (&Qregion);
6515 Qfringe = intern_c_string ("fringe");
6516 staticpro (&Qfringe);
6517 Qheader_line = intern_c_string ("header-line");
6518 staticpro (&Qheader_line);
6519 Qscroll_bar = intern_c_string ("scroll-bar");
6520 staticpro (&Qscroll_bar);
6521 Qmenu = intern_c_string ("menu");
6522 staticpro (&Qmenu);
6523 Qcursor = intern_c_string ("cursor");
6524 staticpro (&Qcursor);
6525 Qborder = intern_c_string ("border");
6526 staticpro (&Qborder);
6527 Qmouse = intern_c_string ("mouse");
6528 staticpro (&Qmouse);
6529 Qmode_line_inactive = intern_c_string ("mode-line-inactive");
6530 staticpro (&Qmode_line_inactive);
6531 Qvertical_border = intern_c_string ("vertical-border");
6532 staticpro (&Qvertical_border);
6533 Qtty_color_desc = intern_c_string ("tty-color-desc");
6534 staticpro (&Qtty_color_desc);
6535 Qtty_color_standard_values = intern_c_string ("tty-color-standard-values");
6536 staticpro (&Qtty_color_standard_values);
6537 Qtty_color_by_index = intern_c_string ("tty-color-by-index");
6538 staticpro (&Qtty_color_by_index);
6539 Qtty_color_alist = intern_c_string ("tty-color-alist");
6540 staticpro (&Qtty_color_alist);
6541 Qscalable_fonts_allowed = intern_c_string ("scalable-fonts-allowed");
6542 staticpro (&Qscalable_fonts_allowed);
6543 6472
6544 Vparam_value_alist = Fcons (Fcons (Qnil, Qnil), Qnil); 6473 Vparam_value_alist = Fcons (Fcons (Qnil, Qnil), Qnil);
6545 staticpro (&Vparam_value_alist); 6474 staticpro (&Vparam_value_alist);
diff --git a/src/xfns.c b/src/xfns.c
index dc717f643aa..b4153973e0d 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5797,25 +5797,18 @@ syms_of_xfns (void)
5797 /* The section below is built by the lisp expression at the top of the file, 5797 /* The section below is built by the lisp expression at the top of the file,
5798 just above where these variables are declared. */ 5798 just above where these variables are declared. */
5799 /*&&& init symbols here &&&*/ 5799 /*&&& init symbols here &&&*/
5800 Qnone = intern_c_string ("none"); 5800 DEFSYM (Qnone, "none");
5801 staticpro (&Qnone); 5801 DEFSYM (Qsuppress_icon, "suppress-icon");
5802 Qsuppress_icon = intern_c_string ("suppress-icon"); 5802 DEFSYM (Qundefined_color, "undefined-color");
5803 staticpro (&Qsuppress_icon); 5803 DEFSYM (Qcompound_text, "compound-text");
5804 Qundefined_color = intern_c_string ("undefined-color"); 5804 DEFSYM (Qcancel_timer, "cancel-timer");
5805 staticpro (&Qundefined_color); 5805 DEFSYM (Qfont_param, "font-parameter");
5806 Qcompound_text = intern_c_string ("compound-text");
5807 staticpro (&Qcompound_text);
5808 Qcancel_timer = intern_c_string ("cancel-timer");
5809 staticpro (&Qcancel_timer);
5810 Qfont_param = intern_c_string ("font-parameter");
5811 staticpro (&Qfont_param);
5812 /* This is the end of symbol initialization. */ 5806 /* This is the end of symbol initialization. */
5813 5807
5814 /* Text property `display' should be nonsticky by default. */ 5808 /* Text property `display' should be nonsticky by default. */
5815 Vtext_property_default_nonsticky 5809 Vtext_property_default_nonsticky
5816 = Fcons (Fcons (Qdisplay, Qt), Vtext_property_default_nonsticky); 5810 = Fcons (Fcons (Qdisplay, Qt), Vtext_property_default_nonsticky);
5817 5811
5818
5819 Fput (Qundefined_color, Qerror_conditions, 5812 Fput (Qundefined_color, Qerror_conditions,
5820 pure_cons (Qundefined_color, pure_cons (Qerror, Qnil))); 5813 pure_cons (Qundefined_color, pure_cons (Qerror, Qnil)));
5821 Fput (Qundefined_color, Qerror_message, 5814 Fput (Qundefined_color, Qerror_message,
diff --git a/src/xmenu.c b/src/xmenu.c
index 1cb71187c0c..fc629b35104 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -2559,8 +2559,7 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_
2559void 2559void
2560syms_of_xmenu (void) 2560syms_of_xmenu (void)
2561{ 2561{
2562 Qdebug_on_next_call = intern_c_string ("debug-on-next-call"); 2562 DEFSYM (Qdebug_on_next_call, "debug-on-next-call");
2563 staticpro (&Qdebug_on_next_call);
2564 2563
2565#ifdef USE_X_TOOLKIT 2564#ifdef USE_X_TOOLKIT
2566 widget_id_tick = (1<<16); 2565 widget_id_tick = (1<<16);
diff --git a/src/xsettings.c b/src/xsettings.c
index e2575650df9..5412cf426f8 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -750,12 +750,9 @@ syms_of_xsettings (void)
750 gconf_client = NULL; 750 gconf_client = NULL;
751#endif 751#endif
752 752
753 Qmonospace_font_name = intern_c_string ("monospace-font-name"); 753 DEFSYM (Qmonospace_font_name, "monospace-font-name");
754 staticpro (&Qmonospace_font_name); 754 DEFSYM (Qfont_name, "font-name");
755 Qfont_name = intern_c_string ("font-name"); 755 DEFSYM (Qfont_render, "font-render");
756 staticpro (&Qfont_name);
757 Qfont_render = intern_c_string ("font-render");
758 staticpro (&Qfont_render);
759 defsubr (&Sfont_get_system_font); 756 defsubr (&Sfont_get_system_font);
760 defsubr (&Sfont_get_system_normal_font); 757 defsubr (&Sfont_get_system_normal_font);
761 758
@@ -778,8 +775,7 @@ If this variable is nil, Emacs ignores system font changes. */);
778#endif 775#endif
779 776
780 current_tool_bar_style = Qnil; 777 current_tool_bar_style = Qnil;
781 Qtool_bar_style = intern_c_string ("tool-bar-style"); 778 DEFSYM (Qtool_bar_style, "tool-bar-style");
782 staticpro (&Qtool_bar_style);
783 defsubr (&Stool_bar_get_system_style); 779 defsubr (&Stool_bar_get_system_style);
784 780
785 Fprovide (intern_c_string ("dynamic-setting"), Qnil); 781 Fprovide (intern_c_string ("dynamic-setting"), Qnil);
diff --git a/src/xterm.c b/src/xterm.c
index ea0bc6bd427..ea03c04ce50 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10730,11 +10730,8 @@ syms_of_xterm (void)
10730 staticpro (&last_mouse_scroll_bar); 10730 staticpro (&last_mouse_scroll_bar);
10731 last_mouse_scroll_bar = Qnil; 10731 last_mouse_scroll_bar = Qnil;
10732 10732
10733 staticpro (&Qvendor_specific_keysyms); 10733 DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms");
10734 Qvendor_specific_keysyms = intern_c_string ("vendor-specific-keysyms"); 10734 DEFSYM (Qlatin_1, "latin-1");
10735
10736 staticpro (&Qlatin_1);
10737 Qlatin_1 = intern_c_string ("latin-1");
10738 10735
10739 staticpro (&last_mouse_press_frame); 10736 staticpro (&last_mouse_press_frame);
10740 last_mouse_press_frame = Qnil; 10737 last_mouse_press_frame = Qnil;
@@ -10743,8 +10740,7 @@ syms_of_xterm (void)
10743 xg_default_icon_file = make_pure_c_string ("icons/hicolor/scalable/apps/emacs.svg"); 10740 xg_default_icon_file = make_pure_c_string ("icons/hicolor/scalable/apps/emacs.svg");
10744 staticpro (&xg_default_icon_file); 10741 staticpro (&xg_default_icon_file);
10745 10742
10746 Qx_gtk_map_stock = intern_c_string ("x-gtk-map-stock"); 10743 DEFSYM (Qx_gtk_map_stock, "x-gtk-map-stock");
10747 staticpro (&Qx_gtk_map_stock);
10748#endif 10744#endif
10749 10745
10750 DEFVAR_BOOL ("x-use-underline-position-properties", 10746 DEFVAR_BOOL ("x-use-underline-position-properties",
diff --git a/src/xwidget.c b/src/xwidget.c
index 8e8bd4ca4b4..4029adb141d 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -101,6 +101,7 @@ extern Lisp_Object QCtype;
101extern Lisp_Object QCwidth, QCheight; 101extern Lisp_Object QCwidth, QCheight;
102 102
103#define XG_XWIDGET "emacs_xwidget" 103#define XG_XWIDGET "emacs_xwidget"
104#define XG_XWIDGET_VIEW "emacs_xwidget_view"
104struct xwidget_view* xwidget_view_lookup(struct xwidget* xw, struct window *w); 105struct xwidget_view* xwidget_view_lookup(struct xwidget* xw, struct window *w);
105 106
106int 107int
@@ -201,6 +202,35 @@ gboolean xwidget_plug_removed(GtkSocket *socket,
201} 202}
202 203
203 204
205void xwidget_slider_changed (GtkRange *range,
206 gpointer user_data)
207{
208 //slider value changed. change value of siblings correspondingly. but remember that changing value will again trigger signal
209 //gtk_range_set_value ()
210 //http://developer.gnome.org/gobject/unstable/gobject-Signals.html#g-signal-handler-block
211 double v;
212 printf("slider changed val:%f\n", v=gtk_range_get_value(range));
213 //code meant to be refactored
214 struct xwidget_view* xvp = g_object_get_data (G_OBJECT (range), XG_XWIDGET_VIEW);
215 struct xwidget_view* xv;
216 for (int i = 0; i < MAX_XWIDGETS; i++)
217 {
218 xv = &xwidget_views[i];
219 if(xvp->model == xv->model){
220 g_signal_handler_block( xv->widget,xv->handler_id);
221 }
222 }
223 for (int i = 0; i < MAX_XWIDGETS; i++)
224 {
225 xv = &xwidget_views[i];
226 if(xvp->model == xv->model){
227 gtk_range_set_value(xv->widget, v);
228 g_signal_handler_unblock( xv->widget,xv->handler_id);
229 }
230 }
231
232}
233
204int xwidget_view_index=0; 234int xwidget_view_index=0;
205 235
206/* initializes and does initial placement of an xwidget view on screen */ 236/* initializes and does initial placement of an xwidget view on screen */
@@ -233,11 +263,12 @@ xwidget_init_view (
233 //gtk_widget_modify_bg(xv->widget, GTK_STATE_NORMAL, &color); 263 //gtk_widget_modify_bg(xv->widget, GTK_STATE_NORMAL, &color);
234 g_signal_connect_after(xv->widget, "plug-added", G_CALLBACK(xwidget_plug_added), "plug added"); 264 g_signal_connect_after(xv->widget, "plug-added", G_CALLBACK(xwidget_plug_added), "plug added");
235 g_signal_connect_after(xv->widget, "plug-removed", G_CALLBACK(xwidget_plug_removed), "plug removed"); 265 g_signal_connect_after(xv->widget, "plug-removed", G_CALLBACK(xwidget_plug_removed), "plug removed");
236 } else if (EQ(xww->type, Qsocket)) { 266 } else if (EQ(xww->type, Qslider)) {
237 xv->widget = 267 xv->widget =
238 gtk_hscale_new (GTK_ADJUSTMENT 268 //gtk_hscale_new (GTK_ADJUSTMENT(gtk_adjustment_new (0.0, 0.0, 100.0, 1.0, 10.0, 10.0)));
239 (gtk_adjustment_new (0, 0, 100, 1, 1, 0))); 269 gtk_hscale_new_with_range ( 0.0, 100.0, 10.0);
240 gtk_scale_set_draw_value (GTK_SCALE (xv->widget), FALSE); //i think its emacs role to show text and stuff, so disable the widgets own text 270 gtk_scale_set_draw_value (GTK_SCALE (xv->widget), FALSE); //i think its emacs role to show text and stuff, so disable the widgets own text
271 xv->handler_id = g_signal_connect_after(xv->widget, "value-changed", G_CALLBACK(xwidget_slider_changed), "slider changed");
241 } else if (EQ(xww->type, Qcairo)) { 272 } else if (EQ(xww->type, Qcairo)) {
242 //Cairo view 273 //Cairo view
243 //uhm cairo is differentish in gtk 3. 274 //uhm cairo is differentish in gtk 3.
@@ -253,7 +284,7 @@ xwidget_init_view (
253 //xw->widgetwindow = GTK_CONTAINER (gtk_offscreen_window_new ()); 284 //xw->widgetwindow = GTK_CONTAINER (gtk_offscreen_window_new ());
254 285
255 xv->widgetwindow = GTK_CONTAINER (gtk_fixed_new ()); 286 xv->widgetwindow = GTK_CONTAINER (gtk_fixed_new ());
256 gtk_widget_set_has_window( xv->widgetwindow, TRUE); //if gtk_fixed doesnt have a window it will surprisingly not honor setsize so that children gets clipped later. the documentation is not consistent regarding if its legal to call this method 287 gtk_widget_set_has_window(GTK_WIDGET ( xv->widgetwindow), TRUE); //if gtk_fixed doesnt have a window it will surprisingly not honor setsize so that children gets clipped later. the documentation is not consistent regarding if its legal to call this method
257 //xv->widgetwindow = GTK_CONTAINER (gtk_event_box_new ()); 288 //xv->widgetwindow = GTK_CONTAINER (gtk_event_box_new ());
258 289
259 //gtk_widget_set_size_request (GTK_WIDGET (xw->widget), xw->width, xw->height); 290 //gtk_widget_set_size_request (GTK_WIDGET (xw->widget), xw->width, xw->height);
@@ -267,6 +298,7 @@ xwidget_init_view (
267 //store some xwidget data in the gtk widgets 298 //store some xwidget data in the gtk widgets
268 g_object_set_data (G_OBJECT (xv->widget), XG_FRAME_DATA, (gpointer) (s->f)); //the emacs frame 299 g_object_set_data (G_OBJECT (xv->widget), XG_FRAME_DATA, (gpointer) (s->f)); //the emacs frame
269 g_object_set_data (G_OBJECT (xv->widget), XG_XWIDGET, (gpointer) (xww)); //the xwidget 300 g_object_set_data (G_OBJECT (xv->widget), XG_XWIDGET, (gpointer) (xww)); //the xwidget
301 g_object_set_data (G_OBJECT (xv->widget), XG_XWIDGET_VIEW, (gpointer) (xv)); //the xwidget
270 g_object_set_data (G_OBJECT (xv->widgetwindow), XG_XWIDGET, (gpointer) (xww)); //the xwidget 302 g_object_set_data (G_OBJECT (xv->widgetwindow), XG_XWIDGET, (gpointer) (xww)); //the xwidget
271 303
272 //this seems to enable xcomposition. later we need to paint ourselves somehow, 304 //this seems to enable xcomposition. later we need to paint ourselves somehow,
diff --git a/src/xwidget.h b/src/xwidget.h
index 9e3d4669056..3a7d92f70a7 100644
--- a/src/xwidget.h
+++ b/src/xwidget.h
@@ -41,6 +41,8 @@ struct xwidget_view{
41 int x; int y; 41 int x; int y;
42 int clipx; int clipy; 42 int clipx; int clipy;
43 struct window *w; 43 struct window *w;
44
45 long handler_id;
44}; 46};
45 47
46 48