diff options
| author | Kenichi Handa | 2012-08-28 22:44:20 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-08-28 22:44:20 +0900 |
| commit | 4eb4de01df384be9b8d811f7ab476eeb37ece748 (patch) | |
| tree | d04f0dae31dd8b533a0c3cd738430841ce7ebb84 | |
| parent | fabc1281e9cde34ff9a19d843316d2ceca8647ad (diff) | |
| parent | 4f2daf31078e2cc059710e129dffe0beed8fc7c2 (diff) | |
| download | emacs-4eb4de01df384be9b8d811f7ab476eeb37ece748.tar.gz emacs-4eb4de01df384be9b8d811f7ab476eeb37ece748.zip | |
merge trunk
98 files changed, 2384 insertions, 1253 deletions
| @@ -1,3 +1,27 @@ | |||
| 1 | 2012-08-26 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * configure.ac (CFLAGS): Prefer -g3 to -g if -g3 works | ||
| 4 | and if the user has not specified CFLAGS. -g3 simplifies | ||
| 5 | debugging, since it makes macros visible to the debugger. | ||
| 6 | |||
| 7 | 2012-08-25 Juanma Barranquero <lekktu@gmail.com> | ||
| 8 | |||
| 9 | * lib/makefile.w32-in ($(BLD)/execinfo.$(O)): Update dependencies. | ||
| 10 | |||
| 11 | 2012-08-25 Eli Zaretskii <eliz@gnu.org> | ||
| 12 | |||
| 13 | * lib/makefile.w32-in ($(BLD)/execinfo.$(O), execinfo.h): New targets. | ||
| 14 | (GNULIBOBJS): Add $(BLD)/execinfo.$(O). | ||
| 15 | |||
| 16 | 2012-08-24 Paul Eggert <eggert@cs.ucla.edu> | ||
| 17 | |||
| 18 | On assertion failure, print backtrace if available. | ||
| 19 | Merge from gnulib, incorporating: | ||
| 20 | 2012-08-24 execinfo: port to FreeBSD | ||
| 21 | 2012-08-22 execinfo: new module | ||
| 22 | * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. | ||
| 23 | * lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4: New files. | ||
| 24 | |||
| 1 | 2012-08-22 Glenn Morris <rgm@gnu.org> | 25 | 2012-08-22 Glenn Morris <rgm@gnu.org> |
| 2 | 26 | ||
| 3 | * Makefile.in (install-arch-dep): If NO_BIN_LINK is non-null, | 27 | * Makefile.in (install-arch-dep): If NO_BIN_LINK is non-null, |
diff --git a/admin/ChangeLog b/admin/ChangeLog index ea977e80cfa..0c674b91ea4 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-08-24 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | On assertion failure, print backtrace if available. | ||
| 4 | * merge-gnulib (GNULIB_MODULES): Add execinfo. | ||
| 5 | |||
| 1 | 2012-08-16 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2012-08-16 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | Use ASCII tests for character types. | 8 | Use ASCII tests for character types. |
diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 63865edf3ce..775d43e68d3 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib | |||
| @@ -28,7 +28,7 @@ GNULIB_URL=git://git.savannah.gnu.org/gnulib.git | |||
| 28 | GNULIB_MODULES=' | 28 | GNULIB_MODULES=' |
| 29 | alloca-opt c-ctype c-strcase | 29 | alloca-opt c-ctype c-strcase |
| 30 | careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 | 30 | careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 |
| 31 | dtoastr dtotimespec dup2 environ | 31 | dtoastr dtotimespec dup2 environ execinfo |
| 32 | filemode getloadavg getopt-gnu gettime gettimeofday | 32 | filemode getloadavg getopt-gnu gettime gettimeofday |
| 33 | ignore-value intprops largefile lstat | 33 | ignore-value intprops largefile lstat |
| 34 | manywarnings mktime pselect pthread_sigmask readlink | 34 | manywarnings mktime pselect pthread_sigmask readlink |
diff --git a/autogen/Makefile.in b/autogen/Makefile.in index ebcbed86fc7..58462459d6f 100644 --- a/autogen/Makefile.in +++ b/autogen/Makefile.in | |||
| @@ -36,7 +36,7 @@ | |||
| 36 | # the same distribution terms as the rest of that program. | 36 | # the same distribution terms as the rest of that program. |
| 37 | # | 37 | # |
| 38 | # Generated by gnulib-tool. | 38 | # Generated by gnulib-tool. |
| 39 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings | 39 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings |
| 40 | 40 | ||
| 41 | VPATH = @srcdir@ | 41 | VPATH = @srcdir@ |
| 42 | pkgdatadir = $(datadir)/@PACKAGE@ | 42 | pkgdatadir = $(datadir)/@PACKAGE@ |
| @@ -65,7 +65,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | |||
| 65 | am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ | 65 | am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ |
| 66 | $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/c-strtod.m4 \ | 66 | $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/c-strtod.m4 \ |
| 67 | $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/dup2.m4 \ | 67 | $(top_srcdir)/m4/clock_time.m4 $(top_srcdir)/m4/dup2.m4 \ |
| 68 | $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/extensions.m4 \ | 68 | $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/execinfo.m4 \ |
| 69 | $(top_srcdir)/m4/extensions.m4 \ | ||
| 69 | $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/filemode.m4 \ | 70 | $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/filemode.m4 \ |
| 70 | $(top_srcdir)/m4/getloadavg.m4 $(top_srcdir)/m4/getopt.m4 \ | 71 | $(top_srcdir)/m4/getloadavg.m4 $(top_srcdir)/m4/getopt.m4 \ |
| 71 | $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ | 72 | $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ |
| @@ -180,6 +181,7 @@ ECHO_C = @ECHO_C@ | |||
| 180 | ECHO_N = @ECHO_N@ | 181 | ECHO_N = @ECHO_N@ |
| 181 | ECHO_T = @ECHO_T@ | 182 | ECHO_T = @ECHO_T@ |
| 182 | EGREP = @EGREP@ | 183 | EGREP = @EGREP@ |
| 184 | EXECINFO_H = @EXECINFO_H@ | ||
| 183 | EXEEXT = @EXEEXT@ | 185 | EXEEXT = @EXEEXT@ |
| 184 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ | 186 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ |
| 185 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | 187 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ |
| @@ -556,6 +558,7 @@ LIBXTR6 = @LIBXTR6@ | |||
| 556 | LIBXT_OTHER = @LIBXT_OTHER@ | 558 | LIBXT_OTHER = @LIBXT_OTHER@ |
| 557 | LIBX_OTHER = @LIBX_OTHER@ | 559 | LIBX_OTHER = @LIBX_OTHER@ |
| 558 | LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ | 560 | LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ |
| 561 | LIB_EXECINFO = @LIB_EXECINFO@ | ||
| 559 | LIB_GCC = @LIB_GCC@ | 562 | LIB_GCC = @LIB_GCC@ |
| 560 | LIB_MATH = @LIB_MATH@ | 563 | LIB_MATH = @LIB_MATH@ |
| 561 | LIB_PTHREAD = @LIB_PTHREAD@ | 564 | LIB_PTHREAD = @LIB_PTHREAD@ |
| @@ -845,16 +848,17 @@ x_default_search_path = @x_default_search_path@ | |||
| 845 | # statements but through direct file reference. Therefore this snippet must be | 848 | # statements but through direct file reference. Therefore this snippet must be |
| 846 | # present in all Makefile.am that need it. This is ensured by the applicability | 849 | # present in all Makefile.am that need it. This is ensured by the applicability |
| 847 | # 'all' defined above. | 850 | # 'all' defined above. |
| 848 | BUILT_SOURCES = $(ALLOCA_H) $(GETOPT_H) inttypes.h signal.h \ | 851 | BUILT_SOURCES = $(ALLOCA_H) $(EXECINFO_H) $(GETOPT_H) inttypes.h \ |
| 849 | arg-nonnull.h c++defs.h warn-on-use.h $(STDALIGN_H) \ | 852 | signal.h arg-nonnull.h c++defs.h warn-on-use.h $(STDALIGN_H) \ |
| 850 | $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \ | 853 | $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \ |
| 851 | stdlib.h sys/select.h sys/stat.h sys/time.h time.h unistd.h | 854 | stdlib.h sys/select.h sys/stat.h sys/time.h time.h unistd.h |
| 852 | EXTRA_DIST = alloca.in.h allocator.h careadlinkat.h md5.h sha1.h \ | 855 | EXTRA_DIST = alloca.in.h allocator.h careadlinkat.h md5.h sha1.h \ |
| 853 | sha256.h sha512.h dosname.h ftoastr.c ftoastr.h dup2.c \ | 856 | sha256.h sha512.h dosname.h ftoastr.c ftoastr.h dup2.c \ |
| 854 | filemode.h getloadavg.c getopt.c getopt.in.h getopt1.c \ | 857 | execinfo.c execinfo.in.h filemode.h getloadavg.c getopt.c \ |
| 855 | getopt_int.h gettimeofday.c ignore-value.h intprops.h \ | 858 | getopt.in.h getopt1.c getopt_int.h gettimeofday.c \ |
| 856 | inttypes.in.h lstat.c mktime-internal.h mktime.c pathmax.h \ | 859 | ignore-value.h intprops.h inttypes.in.h lstat.c \ |
| 857 | pselect.c pthread_sigmask.c readlink.c signal.in.h \ | 860 | mktime-internal.h mktime.c pathmax.h pselect.c \ |
| 861 | pthread_sigmask.c readlink.c signal.in.h \ | ||
| 858 | $(top_srcdir)/build-aux/snippet/_Noreturn.h \ | 862 | $(top_srcdir)/build-aux/snippet/_Noreturn.h \ |
| 859 | $(top_srcdir)/build-aux/snippet/arg-nonnull.h \ | 863 | $(top_srcdir)/build-aux/snippet/arg-nonnull.h \ |
| 860 | $(top_srcdir)/build-aux/snippet/c++defs.h \ | 864 | $(top_srcdir)/build-aux/snippet/c++defs.h \ |
| @@ -866,14 +870,15 @@ EXTRA_DIST = alloca.in.h allocator.h careadlinkat.h md5.h sha1.h \ | |||
| 866 | sys_time.in.h time.in.h time_r.c timespec.h u64.h unistd.in.h \ | 870 | sys_time.in.h time.in.h time_r.c timespec.h u64.h unistd.in.h \ |
| 867 | utimens.h verify.h | 871 | utimens.h verify.h |
| 868 | MOSTLYCLEANDIRS = sys sys | 872 | MOSTLYCLEANDIRS = sys sys |
| 869 | MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t getopt.h \ | 873 | MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t execinfo.h \ |
| 870 | getopt.h-t inttypes.h inttypes.h-t signal.h signal.h-t \ | 874 | execinfo.h-t getopt.h getopt.h-t inttypes.h inttypes.h-t \ |
| 871 | arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \ | 875 | signal.h signal.h-t arg-nonnull.h arg-nonnull.h-t c++defs.h \ |
| 872 | warn-on-use.h warn-on-use.h-t stdalign.h stdalign.h-t stdarg.h \ | 876 | c++defs.h-t warn-on-use.h warn-on-use.h-t stdalign.h \ |
| 873 | stdarg.h-t stdbool.h stdbool.h-t stddef.h stddef.h-t stdint.h \ | 877 | stdalign.h-t stdarg.h stdarg.h-t stdbool.h stdbool.h-t \ |
| 874 | stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t sys/select.h \ | 878 | stddef.h stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t \ |
| 875 | sys/select.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \ | 879 | stdlib.h stdlib.h-t sys/select.h sys/select.h-t sys/stat.h \ |
| 876 | time.h time.h-t unistd.h unistd.h-t | 880 | sys/stat.h-t sys/time.h sys/time.h-t time.h time.h-t unistd.h \ |
| 881 | unistd.h-t | ||
| 877 | noinst_LIBRARIES = libgnu.a | 882 | noinst_LIBRARIES = libgnu.a |
| 878 | AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) | 883 | AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) |
| 879 | DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src | 884 | DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src |
| @@ -884,8 +889,8 @@ libgnu_a_SOURCES = allocator.c c-ctype.h c-ctype.c c-strcase.h \ | |||
| 884 | timespec-add.c timespec-sub.c u64.c utimens.c | 889 | timespec-add.c timespec-sub.c u64.c utimens.c |
| 885 | libgnu_a_LIBADD = $(gl_LIBOBJS) | 890 | libgnu_a_LIBADD = $(gl_LIBOBJS) |
| 886 | libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) | 891 | libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) |
| 887 | EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c getloadavg.c getopt.c \ | 892 | EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c execinfo.c getloadavg.c \ |
| 888 | getopt1.c gettimeofday.c lstat.c mktime.c pselect.c \ | 893 | getopt.c getopt1.c gettimeofday.c lstat.c mktime.c pselect.c \ |
| 889 | pthread_sigmask.c readlink.c stat.c strtoimax.c strtol.c \ | 894 | pthread_sigmask.c readlink.c stat.c strtoimax.c strtol.c \ |
| 890 | strtoll.c strtol.c strtoul.c strtoull.c strtoimax.c \ | 895 | strtoll.c strtol.c strtoul.c strtoull.c strtoimax.c \ |
| 891 | strtoumax.c symlink.c time_r.c | 896 | strtoumax.c symlink.c time_r.c |
| @@ -954,6 +959,7 @@ distclean-compile: | |||
| 954 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtoastr.Po@am__quote@ | 959 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtoastr.Po@am__quote@ |
| 955 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtotimespec.Po@am__quote@ | 960 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtotimespec.Po@am__quote@ |
| 956 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ | 961 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ |
| 962 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execinfo.Po@am__quote@ | ||
| 957 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemode.Po@am__quote@ | 963 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemode.Po@am__quote@ |
| 958 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftoastr.Po@am__quote@ | 964 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftoastr.Po@am__quote@ |
| 959 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getloadavg.Po@am__quote@ | 965 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getloadavg.Po@am__quote@ |
| @@ -1213,6 +1219,17 @@ uninstall-am: | |||
| 1213 | @GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status | 1219 | @GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status |
| 1214 | @GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@ | 1220 | @GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@ |
| 1215 | 1221 | ||
| 1222 | # We need the following in order to create <execinfo.h> when the system | ||
| 1223 | # doesn't have one that works. | ||
| 1224 | @GL_GENERATE_EXECINFO_H_TRUE@execinfo.h: execinfo.in.h $(top_builddir)/config.status | ||
| 1225 | @GL_GENERATE_EXECINFO_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ | ||
| 1226 | @GL_GENERATE_EXECINFO_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ | ||
| 1227 | @GL_GENERATE_EXECINFO_H_TRUE@ cat $(srcdir)/execinfo.in.h; \ | ||
| 1228 | @GL_GENERATE_EXECINFO_H_TRUE@ } > $@-t && \ | ||
| 1229 | @GL_GENERATE_EXECINFO_H_TRUE@ mv $@-t $@ | ||
| 1230 | @GL_GENERATE_EXECINFO_H_FALSE@execinfo.h: $(top_builddir)/config.status | ||
| 1231 | @GL_GENERATE_EXECINFO_H_FALSE@ rm -f $@ | ||
| 1232 | |||
| 1216 | # We need the following in order to create <getopt.h> when the system | 1233 | # We need the following in order to create <getopt.h> when the system |
| 1217 | # doesn't have one that works with the given compiler. | 1234 | # doesn't have one that works with the given compiler. |
| 1218 | getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) | 1235 | getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) |
diff --git a/autogen/aclocal.m4 b/autogen/aclocal.m4 index f7ef80bb805..38f7863ba9d 100644 --- a/autogen/aclocal.m4 +++ b/autogen/aclocal.m4 | |||
| @@ -990,6 +990,7 @@ m4_include([m4/c-strtod.m4]) | |||
| 990 | m4_include([m4/clock_time.m4]) | 990 | m4_include([m4/clock_time.m4]) |
| 991 | m4_include([m4/dup2.m4]) | 991 | m4_include([m4/dup2.m4]) |
| 992 | m4_include([m4/environ.m4]) | 992 | m4_include([m4/environ.m4]) |
| 993 | m4_include([m4/execinfo.m4]) | ||
| 993 | m4_include([m4/extensions.m4]) | 994 | m4_include([m4/extensions.m4]) |
| 994 | m4_include([m4/extern-inline.m4]) | 995 | m4_include([m4/extern-inline.m4]) |
| 995 | m4_include([m4/filemode.m4]) | 996 | m4_include([m4/filemode.m4]) |
diff --git a/autogen/config.in b/autogen/config.in index bd10c9f4076..8cda73e6cbe 100644 --- a/autogen/config.in +++ b/autogen/config.in | |||
| @@ -358,6 +358,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 358 | /* Define to 1 if you have the `euidaccess' function. */ | 358 | /* Define to 1 if you have the `euidaccess' function. */ |
| 359 | #undef HAVE_EUIDACCESS | 359 | #undef HAVE_EUIDACCESS |
| 360 | 360 | ||
| 361 | /* Define to 1 if you have the <execinfo.h> header file. */ | ||
| 362 | #undef HAVE_EXECINFO_H | ||
| 363 | |||
| 361 | /* Define to 1 if you have the <fcntl.h> header file. */ | 364 | /* Define to 1 if you have the <fcntl.h> header file. */ |
| 362 | #undef HAVE_FCNTL_H | 365 | #undef HAVE_FCNTL_H |
| 363 | 366 | ||
| @@ -1554,20 +1557,34 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 1554 | #if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__ | 1557 | #if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__ |
| 1555 | # define _GL_INLINE inline | 1558 | # define _GL_INLINE inline |
| 1556 | # define _GL_EXTERN_INLINE extern inline | 1559 | # define _GL_EXTERN_INLINE extern inline |
| 1557 | # if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ | 1560 | #elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) |
| 1558 | # define _GL_INLINE_HEADER_BEGIN \ | 1561 | # if __GNUC_GNU_INLINE__ |
| 1559 | _Pragma ("GCC diagnostic push") \ | 1562 | /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ |
| 1560 | _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ | 1563 | # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) |
| 1561 | _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") | 1564 | # else |
| 1562 | # define _GL_INLINE_HEADER_END \ | 1565 | # define _GL_INLINE extern inline |
| 1563 | _Pragma ("GCC diagnostic pop") | ||
| 1564 | # endif | 1566 | # endif |
| 1567 | # define _GL_EXTERN_INLINE extern | ||
| 1565 | #else | 1568 | #else |
| 1566 | # define _GL_INLINE static inline | 1569 | # define _GL_INLINE static inline |
| 1567 | # define _GL_EXTERN_INLINE static inline | 1570 | # define _GL_EXTERN_INLINE static inline |
| 1568 | #endif | 1571 | #endif |
| 1569 | 1572 | ||
| 1570 | #ifndef _GL_INLINE_HEADER_BEGIN | 1573 | #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) |
| 1574 | # if __GNUC_STDC_INLINE__ | ||
| 1575 | # define _GL_INLINE_HEADER_CONST_PRAGMA | ||
| 1576 | # else | ||
| 1577 | # define _GL_INLINE_HEADER_CONST_PRAGMA \ | ||
| 1578 | _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") | ||
| 1579 | # endif | ||
| 1580 | # define _GL_INLINE_HEADER_BEGIN \ | ||
| 1581 | _Pragma ("GCC diagnostic push") \ | ||
| 1582 | _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ | ||
| 1583 | _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ | ||
| 1584 | _GL_INLINE_HEADER_CONST_PRAGMA | ||
| 1585 | # define _GL_INLINE_HEADER_END \ | ||
| 1586 | _Pragma ("GCC diagnostic pop") | ||
| 1587 | #else | ||
| 1571 | # define _GL_INLINE_HEADER_BEGIN | 1588 | # define _GL_INLINE_HEADER_BEGIN |
| 1572 | # define _GL_INLINE_HEADER_END | 1589 | # define _GL_INLINE_HEADER_END |
| 1573 | #endif | 1590 | #endif |
diff --git a/autogen/configure b/autogen/configure index 7a94dcb7598..487f8de395a 100755 --- a/autogen/configure +++ b/autogen/configure | |||
| @@ -971,6 +971,10 @@ GNULIB_CANONICALIZE_FILE_NAME | |||
| 971 | GNULIB_CALLOC_POSIX | 971 | GNULIB_CALLOC_POSIX |
| 972 | GNULIB_ATOLL | 972 | GNULIB_ATOLL |
| 973 | GNULIB__EXIT | 973 | GNULIB__EXIT |
| 974 | GL_GENERATE_EXECINFO_H_FALSE | ||
| 975 | GL_GENERATE_EXECINFO_H_TRUE | ||
| 976 | LIB_EXECINFO | ||
| 977 | EXECINFO_H | ||
| 974 | UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS | 978 | UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS |
| 975 | UNISTD_H_HAVE_WINSOCK2_H | 979 | UNISTD_H_HAVE_WINSOCK2_H |
| 976 | REPLACE_WRITE | 980 | REPLACE_WRITE |
| @@ -3194,6 +3198,7 @@ as_fn_append ac_header_list " maillock.h" | |||
| 3194 | as_fn_append ac_header_list " sys/un.h" | 3198 | as_fn_append ac_header_list " sys/un.h" |
| 3195 | as_fn_append ac_func_list " tzset" | 3199 | as_fn_append ac_func_list " tzset" |
| 3196 | as_fn_append ac_func_list " readlinkat" | 3200 | as_fn_append ac_func_list " readlinkat" |
| 3201 | as_fn_append ac_header_list " execinfo.h" | ||
| 3197 | gl_getopt_required=GNU | 3202 | gl_getopt_required=GNU |
| 3198 | as_fn_append ac_header_list " getopt.h" | 3203 | as_fn_append ac_header_list " getopt.h" |
| 3199 | as_fn_append ac_func_list " gettimeofday" | 3204 | as_fn_append ac_func_list " gettimeofday" |
| @@ -6956,6 +6961,7 @@ esac | |||
| 6956 | # Code from module dtotimespec: | 6961 | # Code from module dtotimespec: |
| 6957 | # Code from module dup2: | 6962 | # Code from module dup2: |
| 6958 | # Code from module environ: | 6963 | # Code from module environ: |
| 6964 | # Code from module execinfo: | ||
| 6959 | # Code from module extensions: | 6965 | # Code from module extensions: |
| 6960 | 6966 | ||
| 6961 | # Code from module extern-inline: | 6967 | # Code from module extern-inline: |
| @@ -7021,6 +7027,55 @@ esac | |||
| 7021 | # Code from module warnings: | 7027 | # Code from module warnings: |
| 7022 | 7028 | ||
| 7023 | 7029 | ||
| 7030 | # It's helpful to have C macros available to GDB, so prefer -g3 to -g | ||
| 7031 | # if -g3 works and the user does not specify CFLAGS. | ||
| 7032 | # This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. | ||
| 7033 | if test "$ac_test_CFLAGS" != set; then | ||
| 7034 | case $CFLAGS in | ||
| 7035 | '-g') | ||
| 7036 | emacs_g3_CFLAGS='-g3';; | ||
| 7037 | '-g -O2') | ||
| 7038 | emacs_g3_CFLAGS='-g3 -O2';; | ||
| 7039 | *) | ||
| 7040 | emacs_g3_CFLAGS='';; | ||
| 7041 | esac | ||
| 7042 | if test -n "$emacs_g3_CFLAGS"; then | ||
| 7043 | emacs_save_CFLAGS=$CFLAGS | ||
| 7044 | CFLAGS=$emacs_g3_CFLAGS | ||
| 7045 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts $emacs_g3_CFLAGS" >&5 | ||
| 7046 | $as_echo_n "checking whether $CC accepts $emacs_g3_CFLAGS... " >&6; } | ||
| 7047 | if test "${emacs_cv_prog_cc_g3+set}" = set; then : | ||
| 7048 | $as_echo_n "(cached) " >&6 | ||
| 7049 | else | ||
| 7050 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
| 7051 | /* end confdefs.h. */ | ||
| 7052 | |||
| 7053 | int | ||
| 7054 | main () | ||
| 7055 | { | ||
| 7056 | |||
| 7057 | ; | ||
| 7058 | return 0; | ||
| 7059 | } | ||
| 7060 | _ACEOF | ||
| 7061 | if ac_fn_c_try_link "$LINENO"; then : | ||
| 7062 | emacs_cv_prog_cc_g3=yes | ||
| 7063 | else | ||
| 7064 | emacs_cv_prog_cc_g3=no | ||
| 7065 | fi | ||
| 7066 | rm -f core conftest.err conftest.$ac_objext \ | ||
| 7067 | conftest$ac_exeext conftest.$ac_ext | ||
| 7068 | fi | ||
| 7069 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_prog_cc_g3" >&5 | ||
| 7070 | $as_echo "$emacs_cv_prog_cc_g3" >&6; } | ||
| 7071 | if test $emacs_cv_prog_cc_g3 = yes; then | ||
| 7072 | CFLAGS=$emacs_g3_CFLAGS | ||
| 7073 | else | ||
| 7074 | CFLAGS=$emacs_save_CFLAGS | ||
| 7075 | fi | ||
| 7076 | fi | ||
| 7077 | fi | ||
| 7078 | |||
| 7024 | # Check whether --enable-gcc-warnings was given. | 7079 | # Check whether --enable-gcc-warnings was given. |
| 7025 | if test "${enable_gcc_warnings+set}" = set; then : | 7080 | if test "${enable_gcc_warnings+set}" = set; then : |
| 7026 | enableval=$enable_gcc_warnings; case $enableval in | 7081 | enableval=$enable_gcc_warnings; case $enableval in |
| @@ -16464,6 +16519,8 @@ $as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h | |||
| 16464 | 16519 | ||
| 16465 | 16520 | ||
| 16466 | 16521 | ||
| 16522 | |||
| 16523 | |||
| 16467 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_dm_mode in struct stat" >&5 | 16524 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_dm_mode in struct stat" >&5 |
| 16468 | $as_echo_n "checking for st_dm_mode in struct stat... " >&6; } | 16525 | $as_echo_n "checking for st_dm_mode in struct stat... " >&6; } |
| 16469 | if test "${ac_cv_struct_st_dm_mode+set}" = set; then : | 16526 | if test "${ac_cv_struct_st_dm_mode+set}" = set; then : |
| @@ -20100,6 +20157,99 @@ $as_echo "$gl_cv_func_dup2_works" >&6; } | |||
| 20100 | 20157 | ||
| 20101 | 20158 | ||
| 20102 | 20159 | ||
| 20160 | LIB_EXECINFO='' | ||
| 20161 | EXECINFO_H='execinfo.h' | ||
| 20162 | |||
| 20163 | if test $ac_cv_header_execinfo_h = yes; then | ||
| 20164 | gl_saved_libs=$LIBS | ||
| 20165 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing backtrace_symbols_fd" >&5 | ||
| 20166 | $as_echo_n "checking for library containing backtrace_symbols_fd... " >&6; } | ||
| 20167 | if test "${ac_cv_search_backtrace_symbols_fd+set}" = set; then : | ||
| 20168 | $as_echo_n "(cached) " >&6 | ||
| 20169 | else | ||
| 20170 | ac_func_search_save_LIBS=$LIBS | ||
| 20171 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
| 20172 | /* end confdefs.h. */ | ||
| 20173 | |||
| 20174 | /* Override any GCC internal prototype to avoid an error. | ||
| 20175 | Use char because int might match the return type of a GCC | ||
| 20176 | builtin and then its argument prototype would still apply. */ | ||
| 20177 | #ifdef __cplusplus | ||
| 20178 | extern "C" | ||
| 20179 | #endif | ||
| 20180 | char backtrace_symbols_fd (); | ||
| 20181 | int | ||
| 20182 | main () | ||
| 20183 | { | ||
| 20184 | return backtrace_symbols_fd (); | ||
| 20185 | ; | ||
| 20186 | return 0; | ||
| 20187 | } | ||
| 20188 | _ACEOF | ||
| 20189 | for ac_lib in '' execinfo; do | ||
| 20190 | if test -z "$ac_lib"; then | ||
| 20191 | ac_res="none required" | ||
| 20192 | else | ||
| 20193 | ac_res=-l$ac_lib | ||
| 20194 | LIBS="-l$ac_lib $ac_func_search_save_LIBS" | ||
| 20195 | fi | ||
| 20196 | if ac_fn_c_try_link "$LINENO"; then : | ||
| 20197 | ac_cv_search_backtrace_symbols_fd=$ac_res | ||
| 20198 | fi | ||
| 20199 | rm -f core conftest.err conftest.$ac_objext \ | ||
| 20200 | conftest$ac_exeext | ||
| 20201 | if test "${ac_cv_search_backtrace_symbols_fd+set}" = set; then : | ||
| 20202 | break | ||
| 20203 | fi | ||
| 20204 | done | ||
| 20205 | if test "${ac_cv_search_backtrace_symbols_fd+set}" = set; then : | ||
| 20206 | |||
| 20207 | else | ||
| 20208 | ac_cv_search_backtrace_symbols_fd=no | ||
| 20209 | fi | ||
| 20210 | rm conftest.$ac_ext | ||
| 20211 | LIBS=$ac_func_search_save_LIBS | ||
| 20212 | fi | ||
| 20213 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_backtrace_symbols_fd" >&5 | ||
| 20214 | $as_echo "$ac_cv_search_backtrace_symbols_fd" >&6; } | ||
| 20215 | ac_res=$ac_cv_search_backtrace_symbols_fd | ||
| 20216 | if test "$ac_res" != no; then : | ||
| 20217 | test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | ||
| 20218 | test "$ac_cv_search_backtrace_symbols_fd" = "none required" || | ||
| 20219 | LIB_EXECINFO=$ac_cv_search_backtrace_symbols_fd | ||
| 20220 | fi | ||
| 20221 | |||
| 20222 | LIBS=$gl_saved_libs | ||
| 20223 | test "$ac_cv_search_backtrace_symbols_fd" = no || EXECINFO_H='' | ||
| 20224 | fi | ||
| 20225 | |||
| 20226 | if test -n "$EXECINFO_H"; then | ||
| 20227 | |||
| 20228 | |||
| 20229 | |||
| 20230 | |||
| 20231 | |||
| 20232 | |||
| 20233 | |||
| 20234 | |||
| 20235 | gl_LIBOBJS="$gl_LIBOBJS execinfo.$ac_objext" | ||
| 20236 | |||
| 20237 | fi | ||
| 20238 | |||
| 20239 | |||
| 20240 | |||
| 20241 | if test -n "$EXECINFO_H"; then | ||
| 20242 | GL_GENERATE_EXECINFO_H_TRUE= | ||
| 20243 | GL_GENERATE_EXECINFO_H_FALSE='#' | ||
| 20244 | else | ||
| 20245 | GL_GENERATE_EXECINFO_H_TRUE='#' | ||
| 20246 | GL_GENERATE_EXECINFO_H_FALSE= | ||
| 20247 | fi | ||
| 20248 | |||
| 20249 | |||
| 20250 | |||
| 20251 | |||
| 20252 | |||
| 20103 | 20253 | ||
| 20104 | 20254 | ||
| 20105 | 20255 | ||
| @@ -24190,6 +24340,10 @@ if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FAL | |||
| 24190 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | 24340 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
| 24191 | fi | 24341 | fi |
| 24192 | 24342 | ||
| 24343 | if test -z "${GL_GENERATE_EXECINFO_H_TRUE}" && test -z "${GL_GENERATE_EXECINFO_H_FALSE}"; then | ||
| 24344 | as_fn_error "conditional \"GL_GENERATE_EXECINFO_H\" was never defined. | ||
| 24345 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | ||
| 24346 | fi | ||
| 24193 | if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then | 24347 | if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then |
| 24194 | as_fn_error "conditional \"GL_GENERATE_STDINT_H\" was never defined. | 24348 | as_fn_error "conditional \"GL_GENERATE_STDINT_H\" was never defined. |
| 24195 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | 24349 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
diff --git a/configure.ac b/configure.ac index b10cb24bab6..71ec98390aa 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -577,6 +577,34 @@ fi | |||
| 577 | # Initialize gnulib right after choosing the compiler. | 577 | # Initialize gnulib right after choosing the compiler. |
| 578 | gl_EARLY | 578 | gl_EARLY |
| 579 | 579 | ||
| 580 | # It's helpful to have C macros available to GDB, so prefer -g3 to -g | ||
| 581 | # if -g3 works and the user does not specify CFLAGS. | ||
| 582 | # This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. | ||
| 583 | if test "$ac_test_CFLAGS" != set; then | ||
| 584 | case $CFLAGS in | ||
| 585 | '-g') | ||
| 586 | emacs_g3_CFLAGS='-g3';; | ||
| 587 | '-g -O2') | ||
| 588 | emacs_g3_CFLAGS='-g3 -O2';; | ||
| 589 | *) | ||
| 590 | emacs_g3_CFLAGS='';; | ||
| 591 | esac | ||
| 592 | if test -n "$emacs_g3_CFLAGS"; then | ||
| 593 | emacs_save_CFLAGS=$CFLAGS | ||
| 594 | CFLAGS=$emacs_g3_CFLAGS | ||
| 595 | AC_CACHE_CHECK([whether $CC accepts $emacs_g3_CFLAGS], | ||
| 596 | [emacs_cv_prog_cc_g3], | ||
| 597 | [AC_LINK_IFELSE([AC_LANG_PROGRAM()], | ||
| 598 | [emacs_cv_prog_cc_g3=yes], | ||
| 599 | [emacs_cv_prog_cc_g3=no])]) | ||
| 600 | if test $emacs_cv_prog_cc_g3 = yes; then | ||
| 601 | CFLAGS=$emacs_g3_CFLAGS | ||
| 602 | else | ||
| 603 | CFLAGS=$emacs_save_CFLAGS | ||
| 604 | fi | ||
| 605 | fi | ||
| 606 | fi | ||
| 607 | |||
| 580 | AC_ARG_ENABLE([gcc-warnings], | 608 | AC_ARG_ENABLE([gcc-warnings], |
| 581 | [AS_HELP_STRING([--enable-gcc-warnings], | 609 | [AS_HELP_STRING([--enable-gcc-warnings], |
| 582 | [turn on lots of GCC warnings. This is intended for | 610 | [turn on lots of GCC warnings. This is intended for |
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index fa78cc4c502..a4f9985ad85 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-08-24 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * cmdargs.texi (General Variables): Setting | ||
| 4 | $DBUS_SESSION_BUS_ADDRESS to a dummy value suppresses connections | ||
| 5 | to the D-Bus session bus. (Bug#12112) | ||
| 6 | |||
| 1 | 2012-08-14 Eli Zaretskii <eliz@gnu.org> | 7 | 2012-08-14 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * building.texi (Debugger Operation): Correct and improve | 9 | * building.texi (Debugger Operation): Correct and improve |
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 2dea1577c04..d4573eed5a8 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi | |||
| @@ -434,6 +434,11 @@ variables to be set, but it uses their values if they are set. | |||
| 434 | @item CDPATH | 434 | @item CDPATH |
| 435 | Used by the @code{cd} command to search for the directory you specify, | 435 | Used by the @code{cd} command to search for the directory you specify, |
| 436 | when you specify a relative directory name. | 436 | when you specify a relative directory name. |
| 437 | @item DBUS_SESSION_BUS_ADDRESS | ||
| 438 | Used by D-Bus when Emacs is compiled with it. Usually, there is no | ||
| 439 | need to change it. Setting it to a dummy address, like | ||
| 440 | @samp{unix:path=/tmp/foo}, suppresses connections to the D-Bus session | ||
| 441 | bus. | ||
| 437 | @item EMACSDATA | 442 | @item EMACSDATA |
| 438 | Directory for the architecture-independent files that come with Emacs. | 443 | Directory for the architecture-independent files that come with Emacs. |
| 439 | This is used to initialize the variable @code{data-directory}. | 444 | This is used to initialize the variable @code{data-directory}. |
| @@ -23,7 +23,7 @@ so we will look at it and add it to the manual. | |||
| 23 | 23 | ||
| 24 | * Installation Changes in Emacs 24.3 | 24 | * Installation Changes in Emacs 24.3 |
| 25 | 25 | ||
| 26 | ** New configure option '--without-all' to disable additonal features. | 26 | ** New configure option '--without-all' to disable additional features. |
| 27 | This disables most of the features that are normally enabled by default. | 27 | This disables most of the features that are normally enabled by default. |
| 28 | 28 | ||
| 29 | ** New configure option '--enable-link-time-optimization' to utilize | 29 | ** New configure option '--enable-link-time-optimization' to utilize |
| @@ -179,6 +179,13 @@ end of the buffer. It defaults to t. | |||
| 179 | and `M-s _' in Isearch toggles symbol search mode. | 179 | and `M-s _' in Isearch toggles symbol search mode. |
| 180 | `M-s c' in Isearch toggles search case-sensitivity. | 180 | `M-s c' in Isearch toggles search case-sensitivity. |
| 181 | 181 | ||
| 182 | *** `search-whitespace-regexp' now acts on ordinary incremental search | ||
| 183 | as well, so that each sequence of spaces in the search string matches | ||
| 184 | any combination of one or more whitespace characters. To change this | ||
| 185 | behavior, you can give `search-whitespace-regexp' a cons cell value, | ||
| 186 | where the car and cdr specify values for ordinary and regular | ||
| 187 | expression incremental search respectively. | ||
| 188 | |||
| 182 | ** M-x move-to-column, if called interactively with no prefix arg, now | 189 | ** M-x move-to-column, if called interactively with no prefix arg, now |
| 183 | prompts for a column number. | 190 | prompts for a column number. |
| 184 | 191 | ||
| @@ -612,6 +619,19 @@ now accept a third argument to avoid choosing the selected window. | |||
| 612 | *** New display action alist `inhibit-switch-frame', if non-nil, tells | 619 | *** New display action alist `inhibit-switch-frame', if non-nil, tells |
| 613 | display action functions to avoid changing which frame is selected. | 620 | display action functions to avoid changing which frame is selected. |
| 614 | 621 | ||
| 622 | *** New display action alist `pop-up-frame-parameters', if non-nil, | ||
| 623 | specifies frame parameters to give any newly-created frame. | ||
| 624 | |||
| 625 | *** The following variables are obsolete, as they can be replaced by | ||
| 626 | appropriate entries in the `display-buffer-alist' function introduced | ||
| 627 | in Emacs 24.1: | ||
| 628 | |||
| 629 | **** `display-buffer-reuse-frames' | ||
| 630 | **** `special-display-regexps' | ||
| 631 | **** `special-display-frame-alist' | ||
| 632 | **** `special-display-buffer-names' | ||
| 633 | **** `special-display-function' | ||
| 634 | |||
| 615 | ** Completion | 635 | ** Completion |
| 616 | 636 | ||
| 617 | *** New function `completion-table-with-quoting' to handle completion | 637 | *** New function `completion-table-with-quoting' to handle completion |
diff --git a/lib/execinfo.c b/lib/execinfo.c new file mode 100644 index 00000000000..0bcd9f078ba --- /dev/null +++ b/lib/execinfo.c | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #include <config.h> | ||
| 2 | #define _GL_EXECINFO_INLINE _GL_EXTERN_INLINE | ||
| 3 | #include "execinfo.h" | ||
diff --git a/lib/execinfo.in.h b/lib/execinfo.in.h new file mode 100644 index 00000000000..d76b0e1b771 --- /dev/null +++ b/lib/execinfo.in.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /* Information about executables. | ||
| 2 | |||
| 3 | Copyright (C) 2012 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 | #ifndef _GL_EXECINFO_H | ||
| 21 | #define _GL_EXECINFO_H | ||
| 22 | |||
| 23 | _GL_INLINE_HEADER_BEGIN | ||
| 24 | #ifndef _GL_EXECINFO_INLINE | ||
| 25 | # define _GL_EXECINFO_INLINE _GL_INLINE | ||
| 26 | #endif | ||
| 27 | |||
| 28 | _GL_EXECINFO_INLINE int | ||
| 29 | backtrace (void **buffer, int size) | ||
| 30 | { | ||
| 31 | (void) buffer; | ||
| 32 | (void) size; | ||
| 33 | return 0; | ||
| 34 | } | ||
| 35 | |||
| 36 | _GL_EXECINFO_INLINE char ** | ||
| 37 | backtrace_symbols (void *const *buffer, int size) | ||
| 38 | { | ||
| 39 | (void) buffer; | ||
| 40 | (void) size; | ||
| 41 | return 0; | ||
| 42 | } | ||
| 43 | |||
| 44 | _GL_EXECINFO_INLINE void | ||
| 45 | backtrace_symbols_fd (void *const *buffer, int size, int fd) | ||
| 46 | { | ||
| 47 | (void) buffer; | ||
| 48 | (void) size; | ||
| 49 | (void) fd; | ||
| 50 | } | ||
| 51 | |||
| 52 | _GL_INLINE_HEADER_END | ||
| 53 | |||
| 54 | #endif | ||
diff --git a/lib/gnulib.mk b/lib/gnulib.mk index a90cc59bbde..d49eb4fdf7a 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | # the same distribution terms as the rest of that program. | 21 | # the same distribution terms as the rest of that program. |
| 22 | # | 22 | # |
| 23 | # Generated by gnulib-tool. | 23 | # Generated by gnulib-tool. |
| 24 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings | 24 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | MOSTLYCLEANFILES += core *.stackdump | 27 | MOSTLYCLEANFILES += core *.stackdump |
| @@ -150,6 +150,31 @@ EXTRA_libgnu_a_SOURCES += dup2.c | |||
| 150 | 150 | ||
| 151 | ## end gnulib module dup2 | 151 | ## end gnulib module dup2 |
| 152 | 152 | ||
| 153 | ## begin gnulib module execinfo | ||
| 154 | |||
| 155 | BUILT_SOURCES += $(EXECINFO_H) | ||
| 156 | |||
| 157 | # We need the following in order to create <execinfo.h> when the system | ||
| 158 | # doesn't have one that works. | ||
| 159 | if GL_GENERATE_EXECINFO_H | ||
| 160 | execinfo.h: execinfo.in.h $(top_builddir)/config.status | ||
| 161 | $(AM_V_GEN)rm -f $@-t $@ && \ | ||
| 162 | { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ | ||
| 163 | cat $(srcdir)/execinfo.in.h; \ | ||
| 164 | } > $@-t && \ | ||
| 165 | mv $@-t $@ | ||
| 166 | else | ||
| 167 | execinfo.h: $(top_builddir)/config.status | ||
| 168 | rm -f $@ | ||
| 169 | endif | ||
| 170 | MOSTLYCLEANFILES += execinfo.h execinfo.h-t | ||
| 171 | |||
| 172 | EXTRA_DIST += execinfo.c execinfo.in.h | ||
| 173 | |||
| 174 | EXTRA_libgnu_a_SOURCES += execinfo.c | ||
| 175 | |||
| 176 | ## end gnulib module execinfo | ||
| 177 | |||
| 153 | ## begin gnulib module filemode | 178 | ## begin gnulib module filemode |
| 154 | 179 | ||
| 155 | libgnu_a_SOURCES += filemode.c | 180 | libgnu_a_SOURCES += filemode.c |
diff --git a/lib/makefile.w32-in b/lib/makefile.w32-in index 11251d55f77..f0cea56f829 100644 --- a/lib/makefile.w32-in +++ b/lib/makefile.w32-in | |||
| @@ -28,6 +28,7 @@ GNULIBOBJS = $(BLD)/c-ctype.$(O) \ | |||
| 28 | $(BLD)/c-strncasecmp.$(O) \ | 28 | $(BLD)/c-strncasecmp.$(O) \ |
| 29 | $(BLD)/dtoastr.$(O) \ | 29 | $(BLD)/dtoastr.$(O) \ |
| 30 | $(BLD)/dtotimespec.$(O) \ | 30 | $(BLD)/dtotimespec.$(O) \ |
| 31 | $(BLD)/execinfo.$(O) \ | ||
| 31 | $(BLD)/getopt.$(O) \ | 32 | $(BLD)/getopt.$(O) \ |
| 32 | $(BLD)/getopt1.$(O) \ | 33 | $(BLD)/getopt1.$(O) \ |
| 33 | $(BLD)/gettime.$(O) \ | 34 | $(BLD)/gettime.$(O) \ |
| @@ -129,6 +130,11 @@ $(BLD)/dtotimespec.$(O) : \ | |||
| 129 | $(GNU_LIB)/timespec.h \ | 130 | $(GNU_LIB)/timespec.h \ |
| 130 | $(CONFIG_H) | 131 | $(CONFIG_H) |
| 131 | 132 | ||
| 133 | $(BLD)/execinfo.$(O) : \ | ||
| 134 | $(GNU_LIB)/execinfo.c \ | ||
| 135 | $(GNU_LIB)/execinfo.h \ | ||
| 136 | $(CONFIG_H) | ||
| 137 | |||
| 132 | $(BLD)/getopt.$(O) : \ | 138 | $(BLD)/getopt.$(O) : \ |
| 133 | $(GNU_LIB)/getopt.c \ | 139 | $(GNU_LIB)/getopt.c \ |
| 134 | $(GNU_LIB)/getopt.h \ | 140 | $(GNU_LIB)/getopt.h \ |
| @@ -299,3 +305,7 @@ getopt_h: | |||
| 299 | < getopt.in.h > getopt_.h-t | 305 | < getopt.in.h > getopt_.h-t |
| 300 | $(CP) getopt_.h-t getopt_.h | 306 | $(CP) getopt_.h-t getopt_.h |
| 301 | - $(DEL) getopt_.h-t | 307 | - $(DEL) getopt_.h-t |
| 308 | |||
| 309 | execinfo.h: execinfo.in.h | ||
| 310 | $(CP) execinfo.in.h $@ | ||
| 311 | |||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4296280b22e..3dd2b7b1272 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,101 @@ | |||
| 1 | 2012-08-28 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * info.el (Info-fontify-node): Hide empty lines at the end of | ||
| 4 | the node. (Bug#12272) | ||
| 5 | |||
| 6 | 2012-08-27 Drew Adams <drew.adams@oracle.com> | ||
| 7 | |||
| 8 | * dired.el (dired-pop-to-buffer): Make window start at beginning | ||
| 9 | of buffer (Bug#12281). | ||
| 10 | |||
| 11 | 2012-08-26 Chong Yidong <cyd@gnu.org> | ||
| 12 | |||
| 13 | * window.el (special-display-regexps, special-display-frame-alist) | ||
| 14 | (special-display-buffer-names, special-display-function) | ||
| 15 | (display-buffer-reuse-frames): Mark as obsolete. | ||
| 16 | |||
| 17 | * progmodes/compile.el: Don't use display-buffer-reuse-frames. | ||
| 18 | |||
| 19 | * help.el (help-print-return-message): Don't treat | ||
| 20 | display-buffer-reuse-frames specially. | ||
| 21 | |||
| 22 | 2012-08-26 Chong Yidong <cyd@gnu.org> | ||
| 23 | |||
| 24 | * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): New | ||
| 25 | variable, replacing gdb-frame-parameters. | ||
| 26 | (gdb-frame-io-buffer, gdb-frame-breakpoints-buffer) | ||
| 27 | (gdb-frame-threads-buffer, gdb-frame-memory-buffer) | ||
| 28 | (gdb-frame-disassembly-buffer, gdb-frame-stack-buffer) | ||
| 29 | (gdb-frame-locals-buffer, gdb-frame-registers-buffer): Use it. | ||
| 30 | (def-gdb-frame-for-buffer): Macro deleted. It is easier to define | ||
| 31 | the functions directly with gdb-display-buffer-other-frame-action. | ||
| 32 | (gdb-display-breakpoints-buffer, gdb-display-threads-buffer) | ||
| 33 | (gdb-display-memory-buffer, gdb-display-disassembly-buffer) | ||
| 34 | (gdb-display-stack-buffer, gdb-display-locals-buffer) | ||
| 35 | (gdb-display-registers-buffer): Define directly. | ||
| 36 | (def-gdb-display-buffer): Macro deleted. | ||
| 37 | (gdb-display-buffer): Remove second and third args, callers don't | ||
| 38 | use them. Defer to the default display-buffer behavior, apart | ||
| 39 | from making windows dedicated. | ||
| 40 | (gdb-setup-windows): Don't call display-buffer unnecessarily. | ||
| 41 | |||
| 42 | * progmodes/gud.el (gud-display-line): Just use display-buffer. | ||
| 43 | |||
| 44 | * window.el (display-buffer-pop-up-frame): Handle a | ||
| 45 | pop-up-frame-parameters alist entry. | ||
| 46 | (display-buffer): Document it. | ||
| 47 | |||
| 48 | 2012-08-26 Chong Yidong <cyd@gnu.org> | ||
| 49 | |||
| 50 | * isearch.el (search-whitespace-regexp): Make string and nil | ||
| 51 | values apply to both ordinary and regexp search. Allow a cons | ||
| 52 | cell value to distinguish between the two. | ||
| 53 | (isearch-whitespace-regexp, isearch-search-forward) | ||
| 54 | (isearch-search-backward): New functions. | ||
| 55 | (isearch-occur, isearch-search-fun-default, isearch-search) | ||
| 56 | (isearch-lazy-highlight-new-loop): Use them. | ||
| 57 | (isearch-forward, isearch-forward-regexp): Doc fix. | ||
| 58 | |||
| 59 | 2012-08-26 Chong Yidong <cyd@gnu.org> | ||
| 60 | |||
| 61 | * faces.el (help-argument-name): Always inherit from italic | ||
| 62 | (Bug#12213). | ||
| 63 | |||
| 64 | 2012-08-25 Martin Rudalics <rudalics@gmx.at> | ||
| 65 | |||
| 66 | * window.el (window--even-window-heights): Even heights when | ||
| 67 | WINDOW and the selected window form a vertical combination. | ||
| 68 | (display-buffer-use-some-window): Provide that window used gets | ||
| 69 | sized back by quit-window. (Bug#11880) and (Bug#12091) | ||
| 70 | |||
| 71 | 2012-08-24 Paul Eggert <eggert@cs.ucla.edu> | ||
| 72 | |||
| 73 | Fix file time stamp problem with bzr and CVS (Bug#12001). | ||
| 74 | * vc/vc-cvs.el (vc-cvs-parse-entry): Ignore subsecond information | ||
| 75 | in the file's time stamp, since the version control system loses | ||
| 76 | that information. | ||
| 77 | |||
| 78 | 2012-08-22 Juri Linkov <juri@jurta.org> | ||
| 79 | |||
| 80 | * info.el (Info-fontify-node): Hide the suffix of the | ||
| 81 | Info file name in the header line. (Bug#12187) | ||
| 82 | |||
| 83 | 2012-08-22 Glenn Morris <rgm@gnu.org> | ||
| 84 | |||
| 85 | * calendar/cal-tex.el (cal-tex-weekly-common): | ||
| 86 | Restore leading blank page. | ||
| 87 | |||
| 88 | 2012-08-22 Le Wang <l26wang@gmail.com> (tiny change) | ||
| 89 | |||
| 90 | * misc.el (forward-to-word, backward-to-word): Activate or extend | ||
| 91 | the region under `shift-select-mode'. (Bug#12231) | ||
| 92 | |||
| 93 | 2012-08-22 Bastien Guerry <bzg@gnu.org> | ||
| 94 | |||
| 95 | * progmodes/executable.el (executable-prefix): Set to "#!" instead | ||
| 96 | of "#! ". http://www.in-ulm.de/~mascheck/various/shebang/#details | ||
| 97 | gives details on why the space is never needed. | ||
| 98 | |||
| 1 | 2012-08-22 Martin Rudalics <rudalics@gmx.at> | 99 | 2012-08-22 Martin Rudalics <rudalics@gmx.at> |
| 2 | 100 | ||
| 3 | * window.el (walk-window-tree, window-with-parameter): New | 101 | * window.el (walk-window-tree, window-with-parameter): New |
| @@ -7,6 +105,15 @@ | |||
| 7 | (window-in-direction): Simplify and rewrite doc-string. | 105 | (window-in-direction): Simplify and rewrite doc-string. |
| 8 | (window--size-ignore): Rename to window--size-ignore-p. Update | 106 | (window--size-ignore): Rename to window--size-ignore-p. Update |
| 9 | callers. | 107 | callers. |
| 108 | (display-buffer-in-atom-window, window--major-non-side-window) | ||
| 109 | (window--major-side-window, display-buffer-in-major-side-window) | ||
| 110 | (delete-side-window, display-buffer-in-side-window): New | ||
| 111 | functions. | ||
| 112 | (window--side-check, window-deletable-p, delete-window) | ||
| 113 | (delete-other-windows, split-window): Handle side windows and | ||
| 114 | atomic windows appropriately. | ||
| 115 | (window--display-buffer): Call display-buffer-record-window also | ||
| 116 | when the window buffer did not change. | ||
| 10 | 117 | ||
| 11 | 2012-08-22 Christopher Schmidt <christopher@ch.ristopher.com> | 118 | 2012-08-22 Christopher Schmidt <christopher@ch.ristopher.com> |
| 12 | 119 | ||
| @@ -391,7 +498,7 @@ | |||
| 391 | 498 | ||
| 392 | 2012-08-13 Bastien Guerry <bzg@gnu.org> | 499 | 2012-08-13 Bastien Guerry <bzg@gnu.org> |
| 393 | 500 | ||
| 394 | * window.el (special-display-popup-frame): Small docstring | 501 | * window.el (special-display-popup-frame): Minor docstring |
| 395 | enhancement. (Bug#12172) | 502 | enhancement. (Bug#12172) |
| 396 | 503 | ||
| 397 | 2012-08-13 Andreas Schwab <schwab@linux-m68k.org> | 504 | 2012-08-13 Andreas Schwab <schwab@linux-m68k.org> |
diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index 51ea8e7b7a3..2f1c95b7668 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el | |||
| @@ -86,7 +86,7 @@ | |||
| 86 | (setq sn (math-to-underscores sn))) | 86 | (setq sn (math-to-underscores sn))) |
| 87 | sn))) | 87 | sn))) |
| 88 | 88 | ||
| 89 | ;;; Give multiplication precendence when composing to avoid | 89 | ;;; Give multiplication precedence when composing to avoid |
| 90 | ;;; writing a*(b c) instead of a b c | 90 | ;;; writing a*(b c) instead of a b c |
| 91 | (defun math-compose-expr (a prec &optional div) | 91 | (defun math-compose-expr (a prec &optional div) |
| 92 | (let ((calc-multiplication-has-precedence t) | 92 | (let ((calc-multiplication-has-precedence t) |
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index d8d2a09c871..9c01ab40c0c 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el | |||
| @@ -1080,8 +1080,8 @@ shown are hard-coded to 8-12, 13-17." | |||
| 1080 | (cal-tex-longday "weekend" "0.8in") | 1080 | (cal-tex-longday "weekend" "0.8in") |
| 1081 | (insert cal-tex-lefthead) | 1081 | (insert cal-tex-lefthead) |
| 1082 | (cal-tex-longday "leftday" "1.85in")) | 1082 | (cal-tex-longday "leftday" "1.85in")) |
| 1083 | (cal-tex-preamble "twoside,12pt") | 1083 | (cal-tex-preamble "twoside,12pt") |
| 1084 | (insert "\\textwidth 7in | 1084 | (insert "\\textwidth 7in |
| 1085 | \\textheight 10.5in | 1085 | \\textheight 10.5in |
| 1086 | \\oddsidemargin 0in | 1086 | \\oddsidemargin 0in |
| 1087 | \\evensidemargin 0in | 1087 | \\evensidemargin 0in |
| @@ -1090,13 +1090,19 @@ shown are hard-coded to 8-12, 13-17." | |||
| 1090 | \\headsep 0.125in | 1090 | \\headsep 0.125in |
| 1091 | \\footskip .125in | 1091 | \\footskip .125in |
| 1092 | ") | 1092 | ") |
| 1093 | (insert cal-tex-righthead) | 1093 | (insert cal-tex-righthead) |
| 1094 | (cal-tex-longday "rightday" "2.75in") | 1094 | (cal-tex-longday "rightday" "2.75in") |
| 1095 | (cal-tex-longday "weekend" "1.8in") | 1095 | (cal-tex-longday "weekend" "1.8in") |
| 1096 | (insert cal-tex-lefthead) | 1096 | (insert cal-tex-lefthead) |
| 1097 | (cal-tex-longday "leftday" "2.75in")) | 1097 | (cal-tex-longday "leftday" "2.75in")) |
| 1098 | (cal-tex-b-document) | 1098 | (cal-tex-b-document) |
| 1099 | (cal-tex-cmd "\\pagestyle" "empty") | 1099 | (cal-tex-cmd "\\pagestyle" "empty") |
| 1100 | ;; Let's assume this is something to with twopage documents. | ||
| 1101 | ;; It has the downside that we start with a blank page. | ||
| 1102 | ;; It doesn't make obvious sense when oddside and evenside margins | ||
| 1103 | ;; are the same (non-filofax), but consider the left and right | ||
| 1104 | ;; versions of various functions as applicable to even and odd pages. | ||
| 1105 | (cal-tex-newpage) | ||
| 1100 | (dotimes (i n) | 1106 | (dotimes (i n) |
| 1101 | (insert "\\lefthead") | 1107 | (insert "\\lefthead") |
| 1102 | (cal-tex-arg | 1108 | (cal-tex-arg |
diff --git a/lisp/dired.el b/lisp/dired.el index 6182e133726..b82b7781e39 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -2950,6 +2950,8 @@ or \"* [3 files]\"." | |||
| 2950 | (split-window-sensibly window)))) | 2950 | (split-window-sensibly window)))) |
| 2951 | pop-up-frames) | 2951 | pop-up-frames) |
| 2952 | (pop-to-buffer (get-buffer-create buf))) | 2952 | (pop-to-buffer (get-buffer-create buf))) |
| 2953 | ;; See Bug#12281. | ||
| 2954 | (set-window-start nil (point-min)) | ||
| 2953 | ;; If dired-shrink-to-fit is t, make its window fit its contents. | 2955 | ;; If dired-shrink-to-fit is t, make its window fit its contents. |
| 2954 | (when dired-shrink-to-fit | 2956 | (when dired-shrink-to-fit |
| 2955 | ;; Try to not delete window when we want to display less than | 2957 | ;; Try to not delete window when we want to display less than |
diff --git a/lisp/faces.el b/lisp/faces.el index 2e1ba7798e9..6a477e172e1 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -2444,7 +2444,7 @@ Note: Other faces cannot inherit from the cursor face." | |||
| 2444 | :group 'menu | 2444 | :group 'menu |
| 2445 | :group 'basic-faces) | 2445 | :group 'basic-faces) |
| 2446 | 2446 | ||
| 2447 | (defface help-argument-name '((((supports :slant italic)) :inherit italic)) | 2447 | (defface help-argument-name '((t :inherit italic)) |
| 2448 | "Face to highlight argument names in *Help* buffers." | 2448 | "Face to highlight argument names in *Help* buffers." |
| 2449 | :group 'help) | 2449 | :group 'help) |
| 2450 | 2450 | ||
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 7592c405076..4b56d351ac2 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2012-08-28 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-sum.el (gnus-summary-enter-digest-group): Decode content | ||
| 4 | transfer encoding first; bind gnus-newsgroup-charset to the charset | ||
| 5 | that the article specifies (Bug#12209). | ||
| 6 | |||
| 7 | 2012-08-22 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 8 | |||
| 9 | * gnus-cus.el (gnus-group-customize): Decode values posting-style holds. | ||
| 10 | (gnus-group-customize-done): Encode values posting-style holds. | ||
| 11 | |||
| 12 | * gnus-msg.el (gnus-summary-resend-message) | ||
| 13 | (gnus-configure-posting-styles): Decode values posting-style group | ||
| 14 | parameter holds. | ||
| 15 | |||
| 1 | 2012-08-21 Katsumi Yamaoka <yamaoka@jpl.org> | 16 | 2012-08-21 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 17 | ||
| 3 | * gnus-msg.el (gnus-summary-resend-message): Honor posting-style for | 18 | * gnus-msg.el (gnus-summary-resend-message): Honor posting-style for |
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el index 234d0f7ae56..3440e6310af 100644 --- a/lisp/gnus/gnus-cus.el +++ b/lisp/gnus/gnus-cus.el | |||
| @@ -417,6 +417,11 @@ category.")) | |||
| 417 | (delq elem tmp)) | 417 | (delq elem tmp)) |
| 418 | (setq tmp (cdr tmp)))) | 418 | (setq tmp (cdr tmp)))) |
| 419 | 419 | ||
| 420 | ;; Decode values posting-style holds. | ||
| 421 | (dolist (style (cdr (assq 'posting-style values))) | ||
| 422 | (when (stringp (cadr style)) | ||
| 423 | (setcdr style (list (mm-decode-coding-string (cadr style) 'utf-8))))) | ||
| 424 | |||
| 420 | (setq gnus-custom-params | 425 | (setq gnus-custom-params |
| 421 | (apply 'widget-create 'group | 426 | (apply 'widget-create 'group |
| 422 | :value values | 427 | :value values |
| @@ -487,14 +492,17 @@ form, but who cares?" | |||
| 487 | (defun gnus-group-customize-done (&rest ignore) | 492 | (defun gnus-group-customize-done (&rest ignore) |
| 488 | "Apply changes and bury the buffer." | 493 | "Apply changes and bury the buffer." |
| 489 | (interactive) | 494 | (interactive) |
| 490 | (if gnus-custom-topic | 495 | (let ((params (widget-value gnus-custom-params))) |
| 491 | (gnus-topic-set-parameters gnus-custom-topic | 496 | ;; Encode values posting-style holds. |
| 492 | (widget-value gnus-custom-params)) | 497 | (dolist (style (cdr (assq 'posting-style params))) |
| 493 | (gnus-group-edit-group-done 'params gnus-custom-group | 498 | (when (stringp (cadr style)) |
| 494 | (widget-value gnus-custom-params)) | 499 | (setcdr style (list (mm-encode-coding-string (cadr style) 'utf-8))))) |
| 495 | (gnus-group-edit-group-done 'method gnus-custom-group | 500 | (if gnus-custom-topic |
| 496 | (widget-value gnus-custom-method))) | 501 | (gnus-topic-set-parameters gnus-custom-topic params) |
| 497 | (bury-buffer)) | 502 | (gnus-group-edit-group-done 'params gnus-custom-group params) |
| 503 | (gnus-group-edit-group-done 'method gnus-custom-group | ||
| 504 | (widget-value gnus-custom-method))) | ||
| 505 | (bury-buffer))) | ||
| 498 | 506 | ||
| 499 | ;;; Score Customization: | 507 | ;;; Score Customization: |
| 500 | 508 | ||
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 07748bebb81..c2f79e70d1e 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el | |||
| @@ -1376,6 +1376,9 @@ For the \"inline\" alternatives, also see the variable | |||
| 1376 | (user-full-name user-full-name) | 1376 | (user-full-name user-full-name) |
| 1377 | (user-mail-address user-mail-address) | 1377 | (user-mail-address user-mail-address) |
| 1378 | tem) | 1378 | tem) |
| 1379 | (dolist (style styles) | ||
| 1380 | (when (stringp (cadr style)) | ||
| 1381 | (setcdr style (list (mm-decode-coding-string (cadr style) 'utf-8))))) | ||
| 1379 | (dolist (style (if styles | 1382 | (dolist (style (if styles |
| 1380 | (append gnus-posting-styles (list (cons ".*" styles))) | 1383 | (append gnus-posting-styles (list (cons ".*" styles))) |
| 1381 | gnus-posting-styles)) | 1384 | gnus-posting-styles)) |
| @@ -1807,6 +1810,10 @@ this is a reply." | |||
| 1807 | (when gnus-newsgroup-name | 1810 | (when gnus-newsgroup-name |
| 1808 | (let ((tmp-style (gnus-group-find-parameter group 'posting-style t))) | 1811 | (let ((tmp-style (gnus-group-find-parameter group 'posting-style t))) |
| 1809 | (when tmp-style | 1812 | (when tmp-style |
| 1813 | (dolist (style tmp-style) | ||
| 1814 | (when (stringp (cadr style)) | ||
| 1815 | (setcdr style (list (mm-decode-coding-string (cadr style) | ||
| 1816 | 'utf-8))))) | ||
| 1810 | (setq styles (append styles (list (cons ".*" tmp-style))))))) | 1817 | (setq styles (append styles (list (cons ".*" tmp-style))))))) |
| 1811 | ;; Go through all styles and look for matches. | 1818 | ;; Go through all styles and look for matches. |
| 1812 | (dolist (style styles) | 1819 | (dolist (style styles) |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 06f17bcf646..b44b953bec6 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -9137,7 +9137,7 @@ To control what happens when you exit the group, see the | |||
| 9137 | (list (cons 'save-article-group ogroup)))) | 9137 | (list (cons 'save-article-group ogroup)))) |
| 9138 | (case-fold-search t) | 9138 | (case-fold-search t) |
| 9139 | (buf (current-buffer)) | 9139 | (buf (current-buffer)) |
| 9140 | dig to-address) | 9140 | dig to-address charset) |
| 9141 | (with-current-buffer gnus-original-article-buffer | 9141 | (with-current-buffer gnus-original-article-buffer |
| 9142 | ;; Have the digest group inherit the main mail address of | 9142 | ;; Have the digest group inherit the main mail address of |
| 9143 | ;; the parent article. | 9143 | ;; the parent article. |
| @@ -9150,16 +9150,32 @@ To control what happens when you exit the group, see the | |||
| 9150 | to-address)))))) | 9150 | to-address)))))) |
| 9151 | (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) | 9151 | (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) |
| 9152 | (insert-buffer-substring gnus-original-article-buffer) | 9152 | (insert-buffer-substring gnus-original-article-buffer) |
| 9153 | ;; Remove lines that may lead nndoc to misinterpret the | ||
| 9154 | ;; document type. | ||
| 9155 | (narrow-to-region | 9153 | (narrow-to-region |
| 9156 | (goto-char (point-min)) | 9154 | (goto-char (point-min)) |
| 9157 | (or (search-forward "\n\n" nil t) (point))) | 9155 | (or (search-forward "\n\n" nil t) (point))) |
| 9156 | ;; Remove lines that may lead nndoc to misinterpret the | ||
| 9157 | ;; document type. | ||
| 9158 | (goto-char (point-min)) | 9158 | (goto-char (point-min)) |
| 9159 | (delete-matching-lines "^Path:\\|^From ") | 9159 | (delete-matching-lines "^Path:\\|^From ") |
| 9160 | ;; Parse charset, and decode content transfer encoding. | ||
| 9161 | (setq charset (mail-content-type-get | ||
| 9162 | (mail-header-parse-content-type | ||
| 9163 | (or (gnus-fetch-field "content-type") "")) | ||
| 9164 | 'charset)) | ||
| 9165 | (let ((encoding (gnus-fetch-field "content-transfer-encoding"))) | ||
| 9166 | (when encoding | ||
| 9167 | (message-remove-header "content-transfer-encoding") | ||
| 9168 | (goto-char (point-max)) | ||
| 9169 | (widen) | ||
| 9170 | (narrow-to-region (point) (point-max)) | ||
| 9171 | (mm-decode-content-transfer-encoding | ||
| 9172 | (intern (downcase (mail-header-strip encoding)))))) | ||
| 9160 | (widen)) | 9173 | (widen)) |
| 9161 | (unwind-protect | 9174 | (unwind-protect |
| 9162 | (if (let ((gnus-newsgroup-ephemeral-charset gnus-newsgroup-charset) | 9175 | (if (let ((gnus-newsgroup-ephemeral-charset |
| 9176 | (if charset | ||
| 9177 | (intern (downcase (gnus-strip-whitespace charset))) | ||
| 9178 | gnus-newsgroup-charset)) | ||
| 9163 | (gnus-newsgroup-ephemeral-ignored-charsets | 9179 | (gnus-newsgroup-ephemeral-ignored-charsets |
| 9164 | gnus-newsgroup-ignored-charsets)) | 9180 | gnus-newsgroup-ignored-charsets)) |
| 9165 | (gnus-group-read-ephemeral-group | 9181 | (gnus-group-read-ephemeral-group |
diff --git a/lisp/help.el b/lisp/help.el index 19cb811bcf5..19db7c255d1 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -145,10 +145,6 @@ specifies what to do when the user exits the help buffer." | |||
| 145 | ;; Secondly, the buffer has not been displayed yet, | 145 | ;; Secondly, the buffer has not been displayed yet, |
| 146 | ;; so we don't know whether its frame will be selected. | 146 | ;; so we don't know whether its frame will be selected. |
| 147 | nil) | 147 | nil) |
| 148 | (display-buffer-reuse-frames | ||
| 149 | (setq help-return-method (cons (selected-window) | ||
| 150 | 'quit-window)) | ||
| 151 | nil) | ||
| 152 | ((not (one-window-p t)) | 148 | ((not (one-window-p t)) |
| 153 | (setq help-return-method | 149 | (setq help-return-method |
| 154 | (cons (selected-window) 'quit-window)) | 150 | (cons (selected-window) 'quit-window)) |
diff --git a/lisp/info.el b/lisp/info.el index 15478f9063c..fe4afd72163 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -4527,7 +4527,17 @@ first line or header line, and for breadcrumb links.") | |||
| 4527 | ((not (bobp)) | 4527 | ((not (bobp)) |
| 4528 | ;; Hide the punctuation at the end, too. | 4528 | ;; Hide the punctuation at the end, too. |
| 4529 | (skip-chars-backward " \t,") | 4529 | (skip-chars-backward " \t,") |
| 4530 | (put-text-property (point) header-end 'invisible t)))))) | 4530 | (put-text-property (point) header-end 'invisible t) |
| 4531 | ;; Hide the suffix of the Info file name. | ||
| 4532 | (beginning-of-line) | ||
| 4533 | (if (re-search-forward | ||
| 4534 | (format "File: %s\\([^,\n\t]+\\)," | ||
| 4535 | (if (stringp Info-current-file) | ||
| 4536 | (file-name-nondirectory Info-current-file) | ||
| 4537 | Info-current-file)) | ||
| 4538 | header-end t) | ||
| 4539 | (put-text-property (match-beginning 1) (match-end 1) | ||
| 4540 | 'invisible t))))))) | ||
| 4531 | 4541 | ||
| 4532 | ;; Fontify titles | 4542 | ;; Fontify titles |
| 4533 | (goto-char (point-min)) | 4543 | (goto-char (point-min)) |
| @@ -4815,6 +4825,12 @@ first line or header line, and for breadcrumb links.") | |||
| 4815 | mouse-face highlight | 4825 | mouse-face highlight |
| 4816 | help-echo "mouse-2: go to this URL")))) | 4826 | help-echo "mouse-2: go to this URL")))) |
| 4817 | 4827 | ||
| 4828 | ;; Hide empty lines at the end of the node. | ||
| 4829 | (goto-char (point-max)) | ||
| 4830 | (skip-chars-backward "\n") | ||
| 4831 | (when (< (1+ (point)) (point-max)) | ||
| 4832 | (put-text-property (1+ (point)) (point-max) 'invisible t)) | ||
| 4833 | |||
| 4818 | (set-buffer-modified-p nil)))) | 4834 | (set-buffer-modified-p nil)))) |
| 4819 | 4835 | ||
| 4820 | ;;; Speedbar support: | 4836 | ;;; Speedbar support: |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 9271ce32484..6ea8d86336a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -111,17 +111,32 @@ string, and RET terminates editing and does a nonincremental search." | |||
| 111 | 111 | ||
| 112 | (defcustom search-whitespace-regexp (purecopy "\\s-+") | 112 | (defcustom search-whitespace-regexp (purecopy "\\s-+") |
| 113 | "If non-nil, regular expression to match a sequence of whitespace chars. | 113 | "If non-nil, regular expression to match a sequence of whitespace chars. |
| 114 | This applies to regular expression incremental search. | 114 | When you enter a space or spaces in the incremental search, it |
| 115 | When you put a space or spaces in the incremental regexp, it stands for | 115 | will match any sequence matched by this regexp. As an exception, |
| 116 | this, unless it is inside of a regexp construct such as [...] or *, + or ?. | 116 | spaces are treated normally in regexp incremental search if they |
| 117 | occur in a regexp construct like [...] or *, + or ?. | ||
| 118 | |||
| 119 | If the value is a string, it applies to both ordinary and regexp | ||
| 120 | incremental search. If the value is nil, each space you type | ||
| 121 | matches literally, against one space. | ||
| 122 | |||
| 123 | The value can also be a cons cell (REGEXP-1 . REGEXP-2). In that | ||
| 124 | case, REGEXP-1 is used as the value for ordinary incremental | ||
| 125 | search, and REGEXP-2 is used for regexp incremental search. | ||
| 126 | |||
| 117 | You might want to use something like \"[ \\t\\r\\n]+\" instead. | 127 | You might want to use something like \"[ \\t\\r\\n]+\" instead. |
| 118 | In the Customization buffer, that is `[' followed by a space, | 128 | In the Customization buffer, that is `[' followed by a space, |
| 119 | a tab, a carriage return (control-M), a newline, and `]+'. | 129 | a tab, a carriage return (control-M), a newline, and `]+'." |
| 120 | 130 | :type '(choice (const :tag "Treat Spaces Literally" nil) | |
| 121 | When this is nil, each space you type matches literally, against one space." | 131 | (cons (choice :tag "For Ordinary Isearch" |
| 122 | :type '(choice (const :tag "Find Spaces Literally" nil) | 132 | regexp |
| 133 | (const :tag "Treat Spaces Literally" nil)) | ||
| 134 | (choice :tag "For Regexp Isearch" | ||
| 135 | regexp | ||
| 136 | (const :tag "Treat Spaces Literally" nil))) | ||
| 123 | regexp) | 137 | regexp) |
| 124 | :group 'isearch) | 138 | :group 'isearch |
| 139 | :version "24.3") | ||
| 125 | 140 | ||
| 126 | (defcustom search-invisible 'open | 141 | (defcustom search-invisible 'open |
| 127 | "If t incremental search can match hidden text. | 142 | "If t incremental search can match hidden text. |
| @@ -687,6 +702,9 @@ Type \\[isearch-describe-bindings] to display all Isearch key bindings. | |||
| 687 | Type \\[isearch-describe-key] to display documentation of Isearch key. | 702 | Type \\[isearch-describe-key] to display documentation of Isearch key. |
| 688 | Type \\[isearch-describe-mode] to display documentation of Isearch mode. | 703 | Type \\[isearch-describe-mode] to display documentation of Isearch mode. |
| 689 | 704 | ||
| 705 | In incremental searches, a space or spaces normally matches any | ||
| 706 | whitespace; see the variable `search-whitespace-regexp'. | ||
| 707 | |||
| 690 | If an input method is turned on in the current buffer, that input | 708 | If an input method is turned on in the current buffer, that input |
| 691 | method is also active while you are typing characters to search. | 709 | method is also active while you are typing characters to search. |
| 692 | To toggle the input method, type \\[isearch-toggle-input-method]. \ | 710 | To toggle the input method, type \\[isearch-toggle-input-method]. \ |
| @@ -710,22 +728,19 @@ the calling function until the search is done." | |||
| 710 | (isearch-mode t (not (null regexp-p)) nil (not no-recursive-edit))) | 728 | (isearch-mode t (not (null regexp-p)) nil (not no-recursive-edit))) |
| 711 | 729 | ||
| 712 | (defun isearch-forward-regexp (&optional not-regexp no-recursive-edit) | 730 | (defun isearch-forward-regexp (&optional not-regexp no-recursive-edit) |
| 713 | "\ | 731 | "Do incremental search forward for regular expression. |
| 714 | Do incremental search forward for regular expression. | ||
| 715 | With a prefix argument, do a regular string search instead. | 732 | With a prefix argument, do a regular string search instead. |
| 716 | Like ordinary incremental search except that your input is treated | 733 | Like ordinary incremental search except that your input is treated |
| 717 | as a regexp. See the command `isearch-forward' for more information. | 734 | as a regexp. See the command `isearch-forward' for more information. |
| 718 | 735 | ||
| 719 | In regexp incremental searches, a space or spaces normally matches | 736 | In incremental searches, a space or spaces normally matches any |
| 720 | any whitespace (the variable `search-whitespace-regexp' controls | 737 | whitespace; see the variable `search-whitespace-regexp'. To |
| 721 | precisely what that means). If you want to search for a literal space | 738 | search for a literal space and nothing else, enter C-q SPC." |
| 722 | and nothing else, enter C-q SPC." | ||
| 723 | (interactive "P\np") | 739 | (interactive "P\np") |
| 724 | (isearch-mode t (null not-regexp) nil (not no-recursive-edit))) | 740 | (isearch-mode t (null not-regexp) nil (not no-recursive-edit))) |
| 725 | 741 | ||
| 726 | (defun isearch-forward-word (&optional not-word no-recursive-edit) | 742 | (defun isearch-forward-word (&optional not-word no-recursive-edit) |
| 727 | "\ | 743 | "Do incremental search forward for a sequence of words. |
| 728 | Do incremental search forward for a sequence of words. | ||
| 729 | With a prefix argument, do a regular string search instead. | 744 | With a prefix argument, do a regular string search instead. |
| 730 | Like ordinary incremental search except that your input is treated | 745 | Like ordinary incremental search except that your input is treated |
| 731 | as a sequence of words without regard to how the words are separated. | 746 | as a sequence of words without regard to how the words are separated. |
| @@ -734,8 +749,7 @@ See the command `isearch-forward' for more information." | |||
| 734 | (isearch-mode t nil nil (not no-recursive-edit) (null not-word))) | 749 | (isearch-mode t nil nil (not no-recursive-edit) (null not-word))) |
| 735 | 750 | ||
| 736 | (defun isearch-forward-symbol (&optional not-symbol no-recursive-edit) | 751 | (defun isearch-forward-symbol (&optional not-symbol no-recursive-edit) |
| 737 | "\ | 752 | "Do incremental search forward for a symbol. |
| 738 | Do incremental search forward for a symbol. | ||
| 739 | The prefix argument is currently unused. | 753 | The prefix argument is currently unused. |
| 740 | Like ordinary incremental search except that your input is treated | 754 | Like ordinary incremental search except that your input is treated |
| 741 | as a symbol surrounded by symbol boundary constructs \\_< and \\_>. | 755 | as a symbol surrounded by symbol boundary constructs \\_< and \\_>. |
| @@ -744,16 +758,14 @@ See the command `isearch-forward' for more information." | |||
| 744 | (isearch-mode t nil nil (not no-recursive-edit) 'isearch-symbol-regexp)) | 758 | (isearch-mode t nil nil (not no-recursive-edit) 'isearch-symbol-regexp)) |
| 745 | 759 | ||
| 746 | (defun isearch-backward (&optional regexp-p no-recursive-edit) | 760 | (defun isearch-backward (&optional regexp-p no-recursive-edit) |
| 747 | "\ | 761 | "Do incremental search backward. |
| 748 | Do incremental search backward. | ||
| 749 | With a prefix argument, do a regular expression search instead. | 762 | With a prefix argument, do a regular expression search instead. |
| 750 | See the command `isearch-forward' for more information." | 763 | See the command `isearch-forward' for more information." |
| 751 | (interactive "P\np") | 764 | (interactive "P\np") |
| 752 | (isearch-mode nil (not (null regexp-p)) nil (not no-recursive-edit))) | 765 | (isearch-mode nil (not (null regexp-p)) nil (not no-recursive-edit))) |
| 753 | 766 | ||
| 754 | (defun isearch-backward-regexp (&optional not-regexp no-recursive-edit) | 767 | (defun isearch-backward-regexp (&optional not-regexp no-recursive-edit) |
| 755 | "\ | 768 | "Do incremental search backward for regular expression. |
| 756 | Do incremental search backward for regular expression. | ||
| 757 | With a prefix argument, do a regular string search instead. | 769 | With a prefix argument, do a regular string search instead. |
| 758 | Like ordinary incremental search except that your input is treated | 770 | Like ordinary incremental search except that your input is treated |
| 759 | as a regexp. See the command `isearch-forward' for more information." | 771 | as a regexp. See the command `isearch-forward' for more information." |
| @@ -895,8 +907,7 @@ The last thing it does is to run `isearch-update-post-hook'." | |||
| 895 | (if (< isearch-other-end (point)) ; isearch-forward? | 907 | (if (< isearch-other-end (point)) ; isearch-forward? |
| 896 | (isearch-highlight isearch-other-end (point)) | 908 | (isearch-highlight isearch-other-end (point)) |
| 897 | (isearch-highlight (point) isearch-other-end)) | 909 | (isearch-highlight (point) isearch-other-end)) |
| 898 | (isearch-dehighlight)) | 910 | (isearch-dehighlight)))) |
| 899 | )) | ||
| 900 | (setq ;; quit-flag nil not for isearch-mode | 911 | (setq ;; quit-flag nil not for isearch-mode |
| 901 | isearch-adjusted nil | 912 | isearch-adjusted nil |
| 902 | isearch-yank-flag nil) | 913 | isearch-yank-flag nil) |
| @@ -1547,6 +1558,15 @@ See `isearch-query-replace' for more information." | |||
| 1547 | (list current-prefix-arg)) | 1558 | (list current-prefix-arg)) |
| 1548 | (isearch-query-replace delimited t)) | 1559 | (isearch-query-replace delimited t)) |
| 1549 | 1560 | ||
| 1561 | (defun isearch-whitespace-regexp () | ||
| 1562 | "Return the value of `search-whitespace-regexp' for the current search." | ||
| 1563 | (cond ((not (consp search-whitespace-regexp)) | ||
| 1564 | search-whitespace-regexp) | ||
| 1565 | (isearch-regexp | ||
| 1566 | (cdr search-whitespace-regexp)) | ||
| 1567 | (t | ||
| 1568 | (car search-whitespace-regexp)))) | ||
| 1569 | |||
| 1550 | (defun isearch-occur (regexp &optional nlines) | 1570 | (defun isearch-occur (regexp &optional nlines) |
| 1551 | "Run `occur' using the last search string as the regexp. | 1571 | "Run `occur' using the last search string as the regexp. |
| 1552 | Interactively, REGEXP is constructed using the search string from the | 1572 | Interactively, REGEXP is constructed using the search string from the |
| @@ -1586,7 +1606,7 @@ characters in that string." | |||
| 1586 | ;; Set `search-upper-case' to nil to not call | 1606 | ;; Set `search-upper-case' to nil to not call |
| 1587 | ;; `isearch-no-upper-case-p' in `occur-1'. | 1607 | ;; `isearch-no-upper-case-p' in `occur-1'. |
| 1588 | (search-upper-case nil) | 1608 | (search-upper-case nil) |
| 1589 | (search-spaces-regexp (if isearch-regexp search-whitespace-regexp))) | 1609 | (search-spaces-regexp (isearch-whitespace-regexp))) |
| 1590 | (occur regexp nlines))) | 1610 | (occur regexp nlines))) |
| 1591 | 1611 | ||
| 1592 | (declare-function hi-lock-read-face-name "hi-lock" ()) | 1612 | (declare-function hi-lock-read-face-name "hi-lock" ()) |
| @@ -2426,7 +2446,13 @@ Can be changed via `isearch-search-fun-function' for special needs." | |||
| 2426 | (isearch-regexp | 2446 | (isearch-regexp |
| 2427 | (if isearch-forward 're-search-forward 're-search-backward)) | 2447 | (if isearch-forward 're-search-forward 're-search-backward)) |
| 2428 | (t | 2448 | (t |
| 2429 | (if isearch-forward 'search-forward 'search-backward)))) | 2449 | (if isearch-forward 'isearch-search-forward 'isearch-search-backward)))) |
| 2450 | |||
| 2451 | (defun isearch-search-forward (string &optional bound noerror count) | ||
| 2452 | (re-search-forward (regexp-quote string) bound noerror count)) | ||
| 2453 | |||
| 2454 | (defun isearch-search-backward (string &optional bound noerror count) | ||
| 2455 | (re-search-backward (regexp-quote string) bound noerror count)) | ||
| 2430 | 2456 | ||
| 2431 | (defun isearch-search-string (string bound noerror) | 2457 | (defun isearch-search-string (string bound noerror) |
| 2432 | "Search for the first occurrence of STRING or its translation. | 2458 | "Search for the first occurrence of STRING or its translation. |
| @@ -2487,7 +2513,7 @@ update the match data, and return point." | |||
| 2487 | search-invisible)) | 2513 | search-invisible)) |
| 2488 | (inhibit-quit nil) | 2514 | (inhibit-quit nil) |
| 2489 | (case-fold-search isearch-case-fold-search) | 2515 | (case-fold-search isearch-case-fold-search) |
| 2490 | (search-spaces-regexp search-whitespace-regexp) | 2516 | (search-spaces-regexp (isearch-whitespace-regexp)) |
| 2491 | (retry t)) | 2517 | (retry t)) |
| 2492 | (setq isearch-error nil) | 2518 | (setq isearch-error nil) |
| 2493 | (while retry | 2519 | (while retry |
| @@ -2847,7 +2873,7 @@ by other Emacs features." | |||
| 2847 | isearch-lazy-highlight-last-string isearch-string | 2873 | isearch-lazy-highlight-last-string isearch-string |
| 2848 | isearch-lazy-highlight-case-fold-search isearch-case-fold-search | 2874 | isearch-lazy-highlight-case-fold-search isearch-case-fold-search |
| 2849 | isearch-lazy-highlight-regexp isearch-regexp | 2875 | isearch-lazy-highlight-regexp isearch-regexp |
| 2850 | isearch-lazy-highlight-space-regexp search-whitespace-regexp | 2876 | isearch-lazy-highlight-space-regexp (isearch-whitespace-regexp) |
| 2851 | isearch-lazy-highlight-word isearch-word | 2877 | isearch-lazy-highlight-word isearch-word |
| 2852 | isearch-lazy-highlight-forward isearch-forward) | 2878 | isearch-lazy-highlight-forward isearch-forward) |
| 2853 | (unless (equal isearch-string "") | 2879 | (unless (equal isearch-string "") |
diff --git a/lisp/misc.el b/lisp/misc.el index cb52ecbd36e..96b739dc2b7 100644 --- a/lisp/misc.el +++ b/lisp/misc.el | |||
| @@ -99,14 +99,14 @@ Ignores CHAR at point." | |||
| 99 | (defun forward-to-word (arg) | 99 | (defun forward-to-word (arg) |
| 100 | "Move forward until encountering the beginning of a word. | 100 | "Move forward until encountering the beginning of a word. |
| 101 | With argument, do this that many times." | 101 | With argument, do this that many times." |
| 102 | (interactive "p") | 102 | (interactive "^p") |
| 103 | (or (re-search-forward (if (> arg 0) "\\W\\b" "\\b\\W") nil t arg) | 103 | (or (re-search-forward (if (> arg 0) "\\W\\b" "\\b\\W") nil t arg) |
| 104 | (goto-char (if (> arg 0) (point-max) (point-min))))) | 104 | (goto-char (if (> arg 0) (point-max) (point-min))))) |
| 105 | 105 | ||
| 106 | (defun backward-to-word (arg) | 106 | (defun backward-to-word (arg) |
| 107 | "Move backward until encountering the end of a word. | 107 | "Move backward until encountering the end of a word. |
| 108 | With argument, do this that many times." | 108 | With argument, do this that many times." |
| 109 | (interactive "p") | 109 | (interactive "^p") |
| 110 | (forward-to-word (- arg))) | 110 | (forward-to-word (- arg))) |
| 111 | 111 | ||
| 112 | ;;;###autoload | 112 | ;;;###autoload |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 21a323d8b45..eb966e8a90d 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -2461,10 +2461,7 @@ and overlay is highlighted between MK and END-MK." | |||
| 2461 | ;; the error location if the two buffers are in two | 2461 | ;; the error location if the two buffers are in two |
| 2462 | ;; different frames. So don't do it if it's not necessary. | 2462 | ;; different frames. So don't do it if it's not necessary. |
| 2463 | pre-existing | 2463 | pre-existing |
| 2464 | (let ((display-buffer-reuse-frames t) | 2464 | (display-buffer (marker-buffer msg)))) |
| 2465 | (pop-up-windows t)) | ||
| 2466 | ;; Pop up a window. | ||
| 2467 | (display-buffer (marker-buffer msg))))) | ||
| 2468 | (highlight-regexp (with-current-buffer (marker-buffer msg) | 2465 | (highlight-regexp (with-current-buffer (marker-buffer msg) |
| 2469 | ;; also do this while we change buffer | 2466 | ;; also do this while we change buffer |
| 2470 | (compilation-set-window w msg) | 2467 | (compilation-set-window w msg) |
diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el index e5142571972..092e1a4d578 100644 --- a/lisp/progmodes/executable.el +++ b/lisp/progmodes/executable.el | |||
| @@ -84,8 +84,9 @@ When this is `function', only ask when called non-interactively." | |||
| 84 | :group 'executable) | 84 | :group 'executable) |
| 85 | 85 | ||
| 86 | 86 | ||
| 87 | (defcustom executable-prefix "#! " | 87 | (defcustom executable-prefix "#!" |
| 88 | "Interpreter magic number prefix inserted when there was no magic number." | 88 | "Interpreter magic number prefix inserted when there was no magic number." |
| 89 | :version "24.3" ; "#! " -> "#!" | ||
| 89 | :type 'string | 90 | :type 'string |
| 90 | :group 'executable) | 91 | :group 'executable) |
| 91 | 92 | ||
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 0a99c2f5c24..59c419abfc3 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -1413,29 +1413,6 @@ this trigger is subscribed to `gdb-buf-publisher' and called with | |||
| 1413 | (with-current-buffer ,buffer | 1413 | (with-current-buffer ,buffer |
| 1414 | (apply ',expr args)))) | 1414 | (apply ',expr args)))) |
| 1415 | 1415 | ||
| 1416 | ;; Used to define all gdb-frame-*-buffer functions except | ||
| 1417 | ;; `gdb-frame-io-buffer' | ||
| 1418 | (defmacro def-gdb-frame-for-buffer (name buffer &optional doc) | ||
| 1419 | "Define a function NAME which shows gdb BUFFER in a separate frame. | ||
| 1420 | |||
| 1421 | DOC is an optional documentation string." | ||
| 1422 | `(defun ,name (&optional thread) | ||
| 1423 | ,(when doc doc) | ||
| 1424 | (interactive) | ||
| 1425 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | ||
| 1426 | (special-display-frame-alist gdb-frame-parameters)) | ||
| 1427 | (display-buffer (gdb-get-buffer-create ,buffer thread))))) | ||
| 1428 | |||
| 1429 | (defmacro def-gdb-display-buffer (name buffer &optional doc) | ||
| 1430 | "Define a function NAME which shows gdb BUFFER. | ||
| 1431 | |||
| 1432 | DOC is an optional documentation string." | ||
| 1433 | `(defun ,name (&optional thread) | ||
| 1434 | ,(when doc doc) | ||
| 1435 | (interactive) | ||
| 1436 | (gdb-display-buffer | ||
| 1437 | (gdb-get-buffer-create ,buffer thread) t))) | ||
| 1438 | |||
| 1439 | ;; Used to display windows with thread-bound buffers | 1416 | ;; Used to display windows with thread-bound buffers |
| 1440 | (defmacro def-gdb-preempt-display-buffer (name buffer &optional doc | 1417 | (defmacro def-gdb-preempt-display-buffer (name buffer &optional doc |
| 1441 | split-horizontal) | 1418 | split-horizontal) |
| @@ -1511,8 +1488,7 @@ DOC is an optional documentation string." | |||
| 1511 | (defun gdb-display-io-buffer () | 1488 | (defun gdb-display-io-buffer () |
| 1512 | "Display IO of debugged program in a separate window." | 1489 | "Display IO of debugged program in a separate window." |
| 1513 | (interactive) | 1490 | (interactive) |
| 1514 | (gdb-display-buffer | 1491 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io))) |
| 1515 | (gdb-get-buffer-create 'gdb-inferior-io) t)) | ||
| 1516 | 1492 | ||
| 1517 | (defun gdb-inferior-io--init-proc (proc) | 1493 | (defun gdb-inferior-io--init-proc (proc) |
| 1518 | ;; Set up inferior I/O. Needs GDB 6.4 onwards. | 1494 | ;; Set up inferior I/O. Needs GDB 6.4 onwards. |
| @@ -1540,19 +1516,24 @@ DOC is an optional documentation string." | |||
| 1540 | (comint-exec io-buffer "gdb-inferior" nil nil nil) | 1516 | (comint-exec io-buffer "gdb-inferior" nil nil nil) |
| 1541 | (gdb-inferior-io--init-proc (get-buffer-process io-buffer)))))) | 1517 | (gdb-inferior-io--init-proc (get-buffer-process io-buffer)))))) |
| 1542 | 1518 | ||
| 1543 | (defconst gdb-frame-parameters | 1519 | (defvar gdb-display-buffer-other-frame-action |
| 1544 | '((height . 14) (width . 80) | 1520 | `((display-buffer-reuse-window display-buffer-pop-up-frame) |
| 1545 | (unsplittable . t) | 1521 | (reusable-frames . 0) |
| 1546 | (tool-bar-lines . nil) | 1522 | (inhibit-same-window . t) |
| 1547 | (menu-bar-lines . nil) | 1523 | (pop-up-frame-parameters (height . 14) |
| 1548 | (minibuffer . nil))) | 1524 | (width . 80) |
| 1525 | (unsplittable . t) | ||
| 1526 | (tool-bar-lines . nil) | ||
| 1527 | (menu-bar-lines . nil) | ||
| 1528 | (minibuffer . nil))) | ||
| 1529 | "A `display-buffer' action for displaying GDB utility frames.") | ||
| 1530 | (put 'gdb-display-buffer-other-frame-action 'risky-local-variable t) | ||
| 1549 | 1531 | ||
| 1550 | (defun gdb-frame-io-buffer () | 1532 | (defun gdb-frame-io-buffer () |
| 1551 | "Display IO of debugged program in a new frame." | 1533 | "Display IO of debugged program in another frame." |
| 1552 | (interactive) | 1534 | (interactive) |
| 1553 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 1535 | (display-buffer (gdb-get-buffer-create 'gdb-inferior-io) |
| 1554 | (special-display-frame-alist gdb-frame-parameters)) | 1536 | gdb-display-buffer-other-frame-action)) |
| 1555 | (display-buffer (gdb-get-buffer-create 'gdb-inferior-io)))) | ||
| 1556 | 1537 | ||
| 1557 | (defvar gdb-inferior-io-mode-map | 1538 | (defvar gdb-inferior-io-mode-map |
| 1558 | (let ((map (make-sparse-keymap))) | 1539 | (let ((map (make-sparse-keymap))) |
| @@ -1571,7 +1552,7 @@ DOC is an optional documentation string." | |||
| 1571 | 1552 | ||
| 1572 | (defun gdb-inferior-filter (proc string) | 1553 | (defun gdb-inferior-filter (proc string) |
| 1573 | (unless (string-equal string "") | 1554 | (unless (string-equal string "") |
| 1574 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t)) | 1555 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io))) |
| 1575 | (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) | 1556 | (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) |
| 1576 | (comint-output-filter proc string))) | 1557 | (comint-output-filter proc string))) |
| 1577 | 1558 | ||
| @@ -2615,15 +2596,16 @@ If not in a source or disassembly buffer just set point." | |||
| 2615 | (defun gdb-breakpoints-buffer-name () | 2596 | (defun gdb-breakpoints-buffer-name () |
| 2616 | (concat "*breakpoints of " (gdb-get-target-string) "*")) | 2597 | (concat "*breakpoints of " (gdb-get-target-string) "*")) |
| 2617 | 2598 | ||
| 2618 | (def-gdb-display-buffer | 2599 | (defun gdb-display-breakpoints-buffer (&optional thread) |
| 2619 | gdb-display-breakpoints-buffer | 2600 | "Display GDB breakpoints." |
| 2620 | 'gdb-breakpoints-buffer | 2601 | (interactive) |
| 2621 | "Display status of user-settable breakpoints.") | 2602 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer thread))) |
| 2622 | 2603 | ||
| 2623 | (def-gdb-frame-for-buffer | 2604 | (defun gdb-frame-breakpoints-buffer (&optional thread) |
| 2624 | gdb-frame-breakpoints-buffer | 2605 | "Display GDB breakpoints in another frame." |
| 2625 | 'gdb-breakpoints-buffer | 2606 | (interactive) |
| 2626 | "Display status of user-settable breakpoints in a new frame.") | 2607 | (display-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer thread) |
| 2608 | gdb-display-buffer-other-frame-action)) | ||
| 2627 | 2609 | ||
| 2628 | (defvar gdb-breakpoints-mode-map | 2610 | (defvar gdb-breakpoints-mode-map |
| 2629 | (let ((map (make-sparse-keymap)) | 2611 | (let ((map (make-sparse-keymap)) |
| @@ -2684,15 +2666,16 @@ corresponding to the mode line clicked." | |||
| 2684 | (defun gdb-threads-buffer-name () | 2666 | (defun gdb-threads-buffer-name () |
| 2685 | (concat "*threads of " (gdb-get-target-string) "*")) | 2667 | (concat "*threads of " (gdb-get-target-string) "*")) |
| 2686 | 2668 | ||
| 2687 | (def-gdb-display-buffer | 2669 | (defun gdb-display-threads-buffer (&optional thread) |
| 2688 | gdb-display-threads-buffer | 2670 | "Display GDB threads." |
| 2689 | 'gdb-threads-buffer | 2671 | (interactive) |
| 2690 | "Display GDB threads.") | 2672 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-threads-buffer thread))) |
| 2691 | 2673 | ||
| 2692 | (def-gdb-frame-for-buffer | 2674 | (defun gdb-frame-threads-buffer (&optional thread) |
| 2693 | gdb-frame-threads-buffer | 2675 | "Display GDB threads in another frame." |
| 2694 | 'gdb-threads-buffer | 2676 | (interactive) |
| 2695 | "Display GDB threads in a new frame.") | 2677 | (display-buffer (gdb-get-buffer-create 'gdb-threads-buffer thread) |
| 2678 | gdb-display-buffer-other-frame-action)) | ||
| 2696 | 2679 | ||
| 2697 | (def-gdb-trigger-and-handler | 2680 | (def-gdb-trigger-and-handler |
| 2698 | gdb-invalidate-threads (gdb-current-context-command "-thread-info") | 2681 | gdb-invalidate-threads (gdb-current-context-command "-thread-info") |
| @@ -2868,26 +2851,22 @@ on the current line." | |||
| 2868 | (def-gdb-thread-buffer-simple-command | 2851 | (def-gdb-thread-buffer-simple-command |
| 2869 | gdb-frame-stack-for-thread | 2852 | gdb-frame-stack-for-thread |
| 2870 | gdb-frame-stack-buffer | 2853 | gdb-frame-stack-buffer |
| 2871 | "Display a new frame with stack buffer for the thread at | 2854 | "Display another frame with stack buffer for thread at current line.") |
| 2872 | current line.") | ||
| 2873 | 2855 | ||
| 2874 | (def-gdb-thread-buffer-simple-command | 2856 | (def-gdb-thread-buffer-simple-command |
| 2875 | gdb-frame-locals-for-thread | 2857 | gdb-frame-locals-for-thread |
| 2876 | gdb-frame-locals-buffer | 2858 | gdb-frame-locals-buffer |
| 2877 | "Display a new frame with locals buffer for the thread at | 2859 | "Display another frame with locals buffer for thread at current line.") |
| 2878 | current line.") | ||
| 2879 | 2860 | ||
| 2880 | (def-gdb-thread-buffer-simple-command | 2861 | (def-gdb-thread-buffer-simple-command |
| 2881 | gdb-frame-registers-for-thread | 2862 | gdb-frame-registers-for-thread |
| 2882 | gdb-frame-registers-buffer | 2863 | gdb-frame-registers-buffer |
| 2883 | "Display a new frame with registers buffer for the thread at | 2864 | "Display another frame with registers buffer for the thread at current line.") |
| 2884 | current line.") | ||
| 2885 | 2865 | ||
| 2886 | (def-gdb-thread-buffer-simple-command | 2866 | (def-gdb-thread-buffer-simple-command |
| 2887 | gdb-frame-disassembly-for-thread | 2867 | gdb-frame-disassembly-for-thread |
| 2888 | gdb-frame-disassembly-buffer | 2868 | gdb-frame-disassembly-buffer |
| 2889 | "Display a new frame with disassembly buffer for the thread at | 2869 | "Display another frame with disassembly buffer for the thread at current line.") |
| 2890 | current line.") | ||
| 2891 | 2870 | ||
| 2892 | (defmacro def-gdb-thread-buffer-gud-command (name gud-command &optional doc) | 2871 | (defmacro def-gdb-thread-buffer-gud-command (name gud-command &optional doc) |
| 2893 | "Define a NAME which will execute GUD-COMMAND with | 2872 | "Define a NAME which will execute GUD-COMMAND with |
| @@ -3290,21 +3269,16 @@ DOC is an optional documentation string." | |||
| 3290 | (defun gdb-memory-buffer-name () | 3269 | (defun gdb-memory-buffer-name () |
| 3291 | (concat "*memory of " (gdb-get-target-string) "*")) | 3270 | (concat "*memory of " (gdb-get-target-string) "*")) |
| 3292 | 3271 | ||
| 3293 | (def-gdb-display-buffer | 3272 | (defun gdb-display-memory-buffer (&optional thread) |
| 3294 | gdb-display-memory-buffer | 3273 | "Display GDB memory contents." |
| 3295 | 'gdb-memory-buffer | 3274 | (interactive) |
| 3296 | "Display memory contents.") | 3275 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-memory-buffer thread))) |
| 3297 | 3276 | ||
| 3298 | (defun gdb-frame-memory-buffer () | 3277 | (defun gdb-frame-memory-buffer () |
| 3299 | "Display memory contents in a new frame." | 3278 | "Display memory contents in another frame." |
| 3300 | (interactive) | 3279 | (interactive) |
| 3301 | (let* ((special-display-regexps (append special-display-regexps '(".*"))) | 3280 | (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer) |
| 3302 | (special-display-frame-alist | 3281 | gdb-display-buffer-other-frame-action)) |
| 3303 | `((left-fringe . 0) | ||
| 3304 | (right-fringe . 0) | ||
| 3305 | (width . 83) | ||
| 3306 | ,@gdb-frame-parameters))) | ||
| 3307 | (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer)))) | ||
| 3308 | 3282 | ||
| 3309 | 3283 | ||
| 3310 | ;;; Disassembly view | 3284 | ;;; Disassembly view |
| @@ -3313,19 +3287,20 @@ DOC is an optional documentation string." | |||
| 3313 | (gdb-current-context-buffer-name | 3287 | (gdb-current-context-buffer-name |
| 3314 | (concat "disassembly of " (gdb-get-target-string)))) | 3288 | (concat "disassembly of " (gdb-get-target-string)))) |
| 3315 | 3289 | ||
| 3316 | (def-gdb-display-buffer | 3290 | (defun gdb-display-disassembly-buffer (&optional thread) |
| 3317 | gdb-display-disassembly-buffer | 3291 | "Display GDB disassembly information." |
| 3318 | 'gdb-disassembly-buffer | 3292 | (interactive) |
| 3319 | "Display disassembly for current stack frame.") | 3293 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-disassembly-buffer thread))) |
| 3320 | 3294 | ||
| 3321 | (def-gdb-preempt-display-buffer | 3295 | (def-gdb-preempt-display-buffer |
| 3322 | gdb-preemptively-display-disassembly-buffer | 3296 | gdb-preemptively-display-disassembly-buffer |
| 3323 | 'gdb-disassembly-buffer) | 3297 | 'gdb-disassembly-buffer) |
| 3324 | 3298 | ||
| 3325 | (def-gdb-frame-for-buffer | 3299 | (defun gdb-frame-disassembly-buffer (&optional thread) |
| 3326 | gdb-frame-disassembly-buffer | 3300 | "Display GDB disassembly information in another frame." |
| 3327 | 'gdb-disassembly-buffer | 3301 | (interactive) |
| 3328 | "Display disassembly in a new frame.") | 3302 | (display-buffer (gdb-get-buffer-create 'gdb-disassembly-buffer thread) |
| 3303 | gdb-display-buffer-other-frame-action)) | ||
| 3329 | 3304 | ||
| 3330 | (def-gdb-auto-update-trigger gdb-invalidate-disassembly | 3305 | (def-gdb-auto-update-trigger gdb-invalidate-disassembly |
| 3331 | (let* ((frame (gdb-current-buffer-frame)) | 3306 | (let* ((frame (gdb-current-buffer-frame)) |
| @@ -3560,19 +3535,20 @@ member." | |||
| 3560 | (gdb-current-context-buffer-name | 3535 | (gdb-current-context-buffer-name |
| 3561 | (concat "stack frames of " (gdb-get-target-string)))) | 3536 | (concat "stack frames of " (gdb-get-target-string)))) |
| 3562 | 3537 | ||
| 3563 | (def-gdb-display-buffer | 3538 | (defun gdb-display-stack-buffer (&optional thread) |
| 3564 | gdb-display-stack-buffer | 3539 | "Display GDB backtrace for current stack." |
| 3565 | 'gdb-stack-buffer | 3540 | (interactive) |
| 3566 | "Display backtrace of current stack.") | 3541 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-stack-buffer thread))) |
| 3567 | 3542 | ||
| 3568 | (def-gdb-preempt-display-buffer | 3543 | (def-gdb-preempt-display-buffer |
| 3569 | gdb-preemptively-display-stack-buffer | 3544 | gdb-preemptively-display-stack-buffer |
| 3570 | 'gdb-stack-buffer nil t) | 3545 | 'gdb-stack-buffer nil t) |
| 3571 | 3546 | ||
| 3572 | (def-gdb-frame-for-buffer | 3547 | (defun gdb-frame-stack-buffer (&optional thread) |
| 3573 | gdb-frame-stack-buffer | 3548 | "Display GDB backtrace for current stack in another frame." |
| 3574 | 'gdb-stack-buffer | 3549 | (interactive) |
| 3575 | "Display backtrace of current stack in a new frame.") | 3550 | (display-buffer (gdb-get-buffer-create 'gdb-stack-buffer thread) |
| 3551 | gdb-display-buffer-other-frame-action)) | ||
| 3576 | 3552 | ||
| 3577 | (defvar gdb-frames-mode-map | 3553 | (defvar gdb-frames-mode-map |
| 3578 | (let ((map (make-sparse-keymap))) | 3554 | (let ((map (make-sparse-keymap))) |
| @@ -3719,19 +3695,20 @@ member." | |||
| 3719 | (gdb-current-context-buffer-name | 3695 | (gdb-current-context-buffer-name |
| 3720 | (concat "locals of " (gdb-get-target-string)))) | 3696 | (concat "locals of " (gdb-get-target-string)))) |
| 3721 | 3697 | ||
| 3722 | (def-gdb-display-buffer | 3698 | (defun gdb-display-locals-buffer (&optional thread) |
| 3723 | gdb-display-locals-buffer | 3699 | "Display the local variables of current GDB stack." |
| 3724 | 'gdb-locals-buffer | 3700 | (interactive) |
| 3725 | "Display local variables of current stack and their values.") | 3701 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-locals-buffer thread))) |
| 3726 | 3702 | ||
| 3727 | (def-gdb-preempt-display-buffer | 3703 | (def-gdb-preempt-display-buffer |
| 3728 | gdb-preemptively-display-locals-buffer | 3704 | gdb-preemptively-display-locals-buffer |
| 3729 | 'gdb-locals-buffer nil t) | 3705 | 'gdb-locals-buffer nil t) |
| 3730 | 3706 | ||
| 3731 | (def-gdb-frame-for-buffer | 3707 | (defun gdb-frame-locals-buffer (&optional thread) |
| 3732 | gdb-frame-locals-buffer | 3708 | "Display the local variables of the current GDB stack in another frame." |
| 3733 | 'gdb-locals-buffer | 3709 | (interactive) |
| 3734 | "Display local variables of current stack and their values in a new frame.") | 3710 | (display-buffer (gdb-get-buffer-create 'gdb-locals-buffer thread) |
| 3711 | gdb-display-buffer-other-frame-action)) | ||
| 3735 | 3712 | ||
| 3736 | 3713 | ||
| 3737 | ;; Registers buffer. | 3714 | ;; Registers buffer. |
| @@ -3818,19 +3795,20 @@ member." | |||
| 3818 | (gdb-current-context-buffer-name | 3795 | (gdb-current-context-buffer-name |
| 3819 | (concat "registers of " (gdb-get-target-string)))) | 3796 | (concat "registers of " (gdb-get-target-string)))) |
| 3820 | 3797 | ||
| 3821 | (def-gdb-display-buffer | 3798 | (defun gdb-display-registers-buffer (&optional thread) |
| 3822 | gdb-display-registers-buffer | 3799 | "Display GDB register contents." |
| 3823 | 'gdb-registers-buffer | 3800 | (interactive) |
| 3824 | "Display integer register contents.") | 3801 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-registers-buffer thread))) |
| 3825 | 3802 | ||
| 3826 | (def-gdb-preempt-display-buffer | 3803 | (def-gdb-preempt-display-buffer |
| 3827 | gdb-preemptively-display-registers-buffer | 3804 | gdb-preemptively-display-registers-buffer |
| 3828 | 'gdb-registers-buffer nil t) | 3805 | 'gdb-registers-buffer nil t) |
| 3829 | 3806 | ||
| 3830 | (def-gdb-frame-for-buffer | 3807 | (defun gdb-frame-registers-buffer (&optional thread) |
| 3831 | gdb-frame-registers-buffer | 3808 | "Display GDB register contents in another frame." |
| 3832 | 'gdb-registers-buffer | 3809 | (interactive) |
| 3833 | "Display integer register contents in a new frame.") | 3810 | (display-buffer (gdb-get-buffer-create 'gdb-registers-buffer thread) |
| 3811 | gdb-display-buffer-other-frame-action)) | ||
| 3834 | 3812 | ||
| 3835 | ;; Needs GDB 6.4 onwards (used to fail with no stack). | 3813 | ;; Needs GDB 6.4 onwards (used to fail with no stack). |
| 3836 | (defun gdb-get-changed-registers () | 3814 | (defun gdb-get-changed-registers () |
| @@ -3917,26 +3895,26 @@ overlay arrow in source buffer." | |||
| 3917 | (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name))) | 3895 | (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name))) |
| 3918 | 3896 | ||
| 3919 | ;;;; Window management | 3897 | ;;;; Window management |
| 3920 | (defun gdb-display-buffer (buf dedicated &optional frame) | 3898 | (defun gdb-display-buffer (buf) |
| 3921 | "Show buffer BUF. | 3899 | "Show buffer BUF, and make that window dedicated." |
| 3922 | 3900 | (let ((window (display-buffer buf))) | |
| 3923 | If BUF is already displayed in some window, show it, deiconifying | 3901 | (set-window-dedicated-p window t) |
| 3924 | the frame if necessary. Otherwise, find least recently used | 3902 | window)) |
| 3925 | window and show BUF there, if the window is not used for GDB | 3903 | |
| 3926 | already, in which case that window is split first." | 3904 | ;; (let ((answer (get-buffer-window buf 0))) |
| 3927 | (let ((answer (get-buffer-window buf (or frame 0)))) | 3905 | ;; (if answer |
| 3928 | (if answer | 3906 | ;; (display-buffer buf nil 0) ;Deiconify frame if necessary. |
| 3929 | (display-buffer buf nil (or frame 0)) ;Deiconify frame if necessary. | 3907 | ;; (let ((window (get-lru-window))) |
| 3930 | (let ((window (get-lru-window))) | 3908 | ;; (if (eq (buffer-local-value 'gud-minor-mode (window-buffer window)) |
| 3931 | (if (eq (buffer-local-value 'gud-minor-mode (window-buffer window)) | 3909 | ;; 'gdbmi) |
| 3932 | 'gdbmi) | 3910 | ;; (let ((largest (get-largest-window))) |
| 3933 | (let ((largest (get-largest-window))) | 3911 | ;; (setq answer (split-window largest)) |
| 3934 | (setq answer (split-window largest)) | 3912 | ;; (set-window-buffer answer buf) |
| 3935 | (set-window-buffer answer buf) | 3913 | ;; (set-window-dedicated-p answer t) |
| 3936 | (set-window-dedicated-p answer dedicated) | 3914 | ;; answer) |
| 3937 | answer) | 3915 | ;; (set-window-buffer window buf) |
| 3938 | (set-window-buffer window buf) | 3916 | ;; window))))) |
| 3939 | window))))) | 3917 | |
| 3940 | 3918 | ||
| 3941 | (defun gdb-preempt-existing-or-display-buffer (buf &optional split-horizontal) | 3919 | (defun gdb-preempt-existing-or-display-buffer (buf &optional split-horizontal) |
| 3942 | "Find window displaying a buffer with the same | 3920 | "Find window displaying a buffer with the same |
| @@ -3963,7 +3941,7 @@ SPLIT-HORIZONTAL and show BUF in the new window." | |||
| 3963 | (if dedicated-window | 3941 | (if dedicated-window |
| 3964 | (set-window-buffer | 3942 | (set-window-buffer |
| 3965 | (split-window dedicated-window nil split-horizontal) buf) | 3943 | (split-window dedicated-window nil split-horizontal) buf) |
| 3966 | (gdb-display-buffer buf t)))))) | 3944 | (gdb-display-buffer buf)))))) |
| 3967 | (error "Null buffer"))) | 3945 | (error "Null buffer"))) |
| 3968 | 3946 | ||
| 3969 | ;;; Shared keymap initialization: | 3947 | ;;; Shared keymap initialization: |
| @@ -4067,7 +4045,7 @@ SPLIT-HORIZONTAL and show BUF in the new window." | |||
| 4067 | 'all-threads) | 4045 | 'all-threads) |
| 4068 | 4046 | ||
| 4069 | (defun gdb-frame-gdb-buffer () | 4047 | (defun gdb-frame-gdb-buffer () |
| 4070 | "Display GUD buffer in a new frame." | 4048 | "Display GUD buffer in another frame." |
| 4071 | (interactive) | 4049 | (interactive) |
| 4072 | (display-buffer-other-frame gud-comint-buffer)) | 4050 | (display-buffer-other-frame gud-comint-buffer)) |
| 4073 | 4051 | ||
| @@ -4089,13 +4067,12 @@ window is dedicated." | |||
| 4089 | 4067 | ||
| 4090 | (defun gdb-setup-windows () | 4068 | (defun gdb-setup-windows () |
| 4091 | "Layout the window pattern for `gdb-many-windows'." | 4069 | "Layout the window pattern for `gdb-many-windows'." |
| 4092 | (gdb-display-locals-buffer) | 4070 | (gdb-get-buffer-create 'gdb-locals-buffer) |
| 4093 | (gdb-display-stack-buffer) | 4071 | (gdb-get-buffer-create 'gdb-stack-buffer) |
| 4094 | (delete-other-windows) | 4072 | (gdb-get-buffer-create 'gdb-breakpoints-buffer) |
| 4095 | (gdb-display-breakpoints-buffer) | 4073 | (set-window-dedicated-p (selected-window) nil) |
| 4096 | (delete-other-windows) | ||
| 4097 | ;; Don't dedicate. | ||
| 4098 | (switch-to-buffer gud-comint-buffer) | 4074 | (switch-to-buffer gud-comint-buffer) |
| 4075 | (delete-other-windows) | ||
| 4099 | (let ((win0 (selected-window)) | 4076 | (let ((win0 (selected-window)) |
| 4100 | (win1 (split-window nil ( / ( * (window-height) 3) 4))) | 4077 | (win1 (split-window nil ( / ( * (window-height) 3) 4))) |
| 4101 | (win2 (split-window nil ( / (window-height) 3))) | 4078 | (win2 (split-window nil ( / (window-height) 3))) |
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 5946e93f34d..2e3858b2cc5 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -2685,7 +2685,6 @@ Obeying it means displaying in another window the specified file and line." | |||
| 2685 | (declare-function global-hl-line-highlight "hl-line" ()) | 2685 | (declare-function global-hl-line-highlight "hl-line" ()) |
| 2686 | (declare-function hl-line-highlight "hl-line" ()) | 2686 | (declare-function hl-line-highlight "hl-line" ()) |
| 2687 | (declare-function gdb-display-source-buffer "gdb-mi" (buffer)) | 2687 | (declare-function gdb-display-source-buffer "gdb-mi" (buffer)) |
| 2688 | (declare-function gdb-display-buffer "gdb-mi" (buf dedicated &optional size)) | ||
| 2689 | 2688 | ||
| 2690 | ;; Make sure the file named TRUE-FILE is in a buffer that appears on the screen | 2689 | ;; Make sure the file named TRUE-FILE is in a buffer that appears on the screen |
| 2691 | ;; and that its line LINE is visible. | 2690 | ;; and that its line LINE is visible. |
| @@ -2702,10 +2701,7 @@ Obeying it means displaying in another window the specified file and line." | |||
| 2702 | (window (and buffer | 2701 | (window (and buffer |
| 2703 | (or (get-buffer-window buffer) | 2702 | (or (get-buffer-window buffer) |
| 2704 | (if (eq gud-minor-mode 'gdbmi) | 2703 | (if (eq gud-minor-mode 'gdbmi) |
| 2705 | (or (if (get-buffer-window buffer 'visible) | 2704 | (display-buffer buffer nil 'visible)) |
| 2706 | (display-buffer buffer nil 'visible)) | ||
| 2707 | (unless (gdb-display-source-buffer buffer) | ||
| 2708 | (gdb-display-buffer buffer nil 'visible)))) | ||
| 2709 | (display-buffer buffer)))) | 2705 | (display-buffer buffer)))) |
| 2710 | (pos)) | 2706 | (pos)) |
| 2711 | (if buffer | 2707 | (if buffer |
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index 2a672623c01..c1c4b750267 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el | |||
| @@ -1178,7 +1178,11 @@ is non-nil." | |||
| 1178 | (parse-time-string (concat time " +0000"))))) | 1178 | (parse-time-string (concat time " +0000"))))) |
| 1179 | (cond ((and (not (string-match "\\+" time)) | 1179 | (cond ((and (not (string-match "\\+" time)) |
| 1180 | (car parsed-time) | 1180 | (car parsed-time) |
| 1181 | (equal mtime (apply 'encode-time parsed-time))) | 1181 | ;; Compare just the seconds part of the file time, |
| 1182 | ;; since CVS file time stamp resolution is just 1 second. | ||
| 1183 | (let ((ptime (apply 'encode-time parsed-time))) | ||
| 1184 | (and (eq (car mtime) (car ptime)) | ||
| 1185 | (eq (cadr mtime) (cadr ptime))))) | ||
| 1182 | (vc-file-setprop file 'vc-checkout-time mtime) | 1186 | (vc-file-setprop file 'vc-checkout-time mtime) |
| 1183 | (if set-state (vc-file-setprop file 'vc-state 'up-to-date))) | 1187 | (if set-state (vc-file-setprop file 'vc-state 'up-to-date))) |
| 1184 | (t | 1188 | (t |
diff --git a/lisp/window.el b/lisp/window.el index ab90d8a4bde..3599ff5527f 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -357,6 +357,45 @@ WINDOW must be an internal window. Return WINDOW." | |||
| 357 | window t) | 357 | window t) |
| 358 | window)) | 358 | window)) |
| 359 | 359 | ||
| 360 | (defun display-buffer-in-atom-window (buffer alist) | ||
| 361 | "Display BUFFER in an atomic window. | ||
| 362 | This function displays BUFFER in a new window that will be | ||
| 363 | combined with an existing window to form an atomic window. If | ||
| 364 | the existing window is already part of an atomic window, add the | ||
| 365 | new window to that atomic window. Operations like `split-window' | ||
| 366 | or `delete-window', when applied to a constituent of an atomic | ||
| 367 | window, are applied atomically to the root of that atomic window. | ||
| 368 | |||
| 369 | ALIST is an association list of symbols and values. The | ||
| 370 | following symbols can be used. | ||
| 371 | |||
| 372 | `window' specifies the existing window the new window shall be | ||
| 373 | combined with. Use `window-atom-root' to make the new window a | ||
| 374 | sibling of an atomic window's root. If an internal window is | ||
| 375 | specified here, all children of that window become part of the | ||
| 376 | atomic window too. If no window is specified, the new window | ||
| 377 | becomes a sibling of the selected window. | ||
| 378 | |||
| 379 | `side' denotes the side of the existing window where the new | ||
| 380 | window shall be located. Valid values are `below', `right', | ||
| 381 | `above' and `left'. The default is `below'. | ||
| 382 | |||
| 383 | The return value is the new window, nil when creating that window | ||
| 384 | failed." | ||
| 385 | (let ((ignore-window-parameters t) | ||
| 386 | (window-combination-limit t) | ||
| 387 | (window (cdr (assq 'window alist))) | ||
| 388 | (side (cdr (assq 'side alist))) | ||
| 389 | new) | ||
| 390 | (setq window (window-normalize-window window)) | ||
| 391 | ;; Split off new window | ||
| 392 | (when (setq new (split-window window nil side)) | ||
| 393 | ;; Make sure we have a valid atomic window. | ||
| 394 | (window-make-atom (window-parent window)) | ||
| 395 | ;; Display BUFFER in NEW and return NEW. | ||
| 396 | (window--display-buffer | ||
| 397 | buffer new 'window display-buffer-mark-dedicated)))) | ||
| 398 | |||
| 360 | (defun window--atom-check-1 (window) | 399 | (defun window--atom-check-1 (window) |
| 361 | "Subroutine of `window--atom-check'." | 400 | "Subroutine of `window--atom-check'." |
| 362 | (when window | 401 | (when window |
| @@ -446,23 +485,273 @@ number of slots on that side." | |||
| 446 | (integer :tag "Number" :value 3 :size 5))) | 485 | (integer :tag "Number" :value 3 :size 5))) |
| 447 | :group 'windows) | 486 | :group 'windows) |
| 448 | 487 | ||
| 488 | (defun window--major-non-side-window (&optional frame) | ||
| 489 | "Return the major non-side window of frame FRAME. | ||
| 490 | The optional argument FRAME must be a live frame and defaults to | ||
| 491 | the selected one. | ||
| 492 | |||
| 493 | If FRAME has at least one side window, the major non-side window | ||
| 494 | is either an internal non-side window such that all other | ||
| 495 | non-side windows on FRAME descend from it, or the single live | ||
| 496 | non-side window of FRAME. If FRAME has no side windows, return | ||
| 497 | its root window." | ||
| 498 | (let ((frame (window-normalize-frame frame)) | ||
| 499 | major sibling) | ||
| 500 | ;; Set major to the _last_ window found by `walk-window-tree' that | ||
| 501 | ;; is not a side window but has a side window as its sibling. | ||
| 502 | (walk-window-tree | ||
| 503 | (lambda (window) | ||
| 504 | (and (not (window-parameter window 'window-side)) | ||
| 505 | (or (and (setq sibling (window-prev-sibling window)) | ||
| 506 | (window-parameter sibling 'window-side)) | ||
| 507 | (and (setq sibling (window-next-sibling window)) | ||
| 508 | (window-parameter sibling 'window-side))) | ||
| 509 | (setq major window))) | ||
| 510 | frame t) | ||
| 511 | (or major (frame-root-window frame)))) | ||
| 512 | |||
| 513 | (defun window--major-side-window (side) | ||
| 514 | "Return major side window on SIDE. | ||
| 515 | SIDE must be one of the symbols `left', `top', `right' or | ||
| 516 | `bottom'. Return nil if no such window exists." | ||
| 517 | (let ((root (frame-root-window)) | ||
| 518 | window) | ||
| 519 | ;; (1) If a window on the opposite side exists, return that window's | ||
| 520 | ;; sibling. | ||
| 521 | ;; (2) If the new window shall span the entire side, return the | ||
| 522 | ;; frame's root window. | ||
| 523 | ;; (3) If a window on an orthogonal side exists, return that | ||
| 524 | ;; window's sibling. | ||
| 525 | ;; (4) Otherwise return the frame's root window. | ||
| 526 | (cond | ||
| 527 | ((or (and (eq side 'left) | ||
| 528 | (setq window (window-with-parameter 'window-side 'right nil t))) | ||
| 529 | (and (eq side 'top) | ||
| 530 | (setq window (window-with-parameter 'window-side 'bottom nil t)))) | ||
| 531 | (window-prev-sibling window)) | ||
| 532 | ((or (and (eq side 'right) | ||
| 533 | (setq window (window-with-parameter 'window-side 'left nil t))) | ||
| 534 | (and (eq side 'bottom) | ||
| 535 | (setq window (window-with-parameter 'window-side 'top nil t)))) | ||
| 536 | (window-next-sibling window)) | ||
| 537 | ((memq side '(left right)) | ||
| 538 | (cond | ||
| 539 | (window-sides-vertical | ||
| 540 | root) | ||
| 541 | ((setq window (window-with-parameter 'window-side 'top nil t)) | ||
| 542 | (window-next-sibling window)) | ||
| 543 | ((setq window (window-with-parameter 'window-side 'bottom nil t)) | ||
| 544 | (window-prev-sibling window)) | ||
| 545 | (t root))) | ||
| 546 | ((memq side '(top bottom)) | ||
| 547 | (cond | ||
| 548 | ((not window-sides-vertical) | ||
| 549 | root) | ||
| 550 | ((setq window (window-with-parameter 'window-side 'left nil t)) | ||
| 551 | (window-next-sibling window)) | ||
| 552 | ((setq window (window-with-parameter 'window-side 'right nil t)) | ||
| 553 | (window-prev-sibling window)) | ||
| 554 | (t root)))))) | ||
| 555 | |||
| 556 | (defun display-buffer-in-major-side-window (buffer side slot &optional alist) | ||
| 557 | "Display BUFFER in a new window on SIDE of the selected frame. | ||
| 558 | SIDE must be one of `left', `top', `right' or `bottom'. SLOT | ||
| 559 | specifies the slot to use. ALIST is an association list of | ||
| 560 | symbols and values as passed to `display-buffer-in-side-window'. | ||
| 561 | This function may be called only if no window on SIDE exists yet. | ||
| 562 | The new window automatically becomes the \"major\" side window on | ||
| 563 | SIDE. Return the new window, nil if its creation window failed." | ||
| 564 | (let* ((root (frame-root-window)) | ||
| 565 | (left-or-right (memq side '(left right))) | ||
| 566 | (size (or (assq 'size alist) | ||
| 567 | (/ (window-total-size (frame-root-window) left-or-right) | ||
| 568 | ;; By default use a fourth of the size of the | ||
| 569 | ;; frame's root window. This has to be made | ||
| 570 | ;; customizable via ALIST. | ||
| 571 | 4))) | ||
| 572 | (major (window--major-side-window side)) | ||
| 573 | (selected-window (selected-window)) | ||
| 574 | (on-side (cond | ||
| 575 | ((eq side 'top) 'above) | ||
| 576 | ((eq side 'bottom) 'below) | ||
| 577 | (t side))) | ||
| 578 | ;; The following two bindings will tell `split-window' to take | ||
| 579 | ;; the space for the new window from `major' and not make a new | ||
| 580 | ;; parent window unless needed. | ||
| 581 | (window-combination-resize 'side) | ||
| 582 | (window-combination-limit nil) | ||
| 583 | (new (split-window major (- size) on-side)) | ||
| 584 | fun) | ||
| 585 | (when new | ||
| 586 | ;; Initialize `window-side' parameter of new window to SIDE. | ||
| 587 | (set-window-parameter new 'window-side side) | ||
| 588 | ;; Install `window-slot' parameter of new window. | ||
| 589 | (set-window-parameter new 'window-slot slot) | ||
| 590 | ;; Install `delete-window' parameter thus making sure that when | ||
| 591 | ;; the new window is deleted, a side window on the opposite side | ||
| 592 | ;; does not get resized. | ||
| 593 | (set-window-parameter new 'delete-window 'delete-side-window) | ||
| 594 | ;; Install BUFFER in new window and return NEW. | ||
| 595 | (window--display-buffer buffer new 'window 'side)))) | ||
| 596 | |||
| 597 | (defun delete-side-window (window) | ||
| 598 | "Delete side window WINDOW." | ||
| 599 | (let ((window-combination-resize | ||
| 600 | (window-parameter (window-parent window) 'window-side)) | ||
| 601 | (ignore-window-parameters t)) | ||
| 602 | (delete-window window))) | ||
| 603 | |||
| 604 | (defun display-buffer-in-side-window (buffer alist) | ||
| 605 | "Display BUFFER in a window on side SIDE of the selected frame. | ||
| 606 | ALIST is an association list of symbols and values. The | ||
| 607 | following symbols can be used: | ||
| 608 | |||
| 609 | `side' denotes the side of the existing window where the new | ||
| 610 | window shall be located. Valid values are `bottom', `right', | ||
| 611 | `top' and `left'. The default is `bottom'. | ||
| 612 | |||
| 613 | `slot' if non-nil, specifies the window slot where to display | ||
| 614 | BUFFER. A value of zero or nil means use the middle slot on | ||
| 615 | the specified side. A negative value means use a slot | ||
| 616 | preceding (that is, above or on the left of) the middle slot. | ||
| 617 | A positive value means use a slot following (that is, below or | ||
| 618 | on the right of) the middle slot. The default is zero." | ||
| 619 | (let ((side (or (cdr (assq 'side alist)) 'bottom)) | ||
| 620 | (slot (or (cdr (assq 'slot alist)) 0)) | ||
| 621 | new) | ||
| 622 | (cond | ||
| 623 | ((not (memq side '(top bottom left right))) | ||
| 624 | (error "Invalid side %s specified" side)) | ||
| 625 | ((not (numberp slot)) | ||
| 626 | (error "Invalid slot %s specified" slot))) | ||
| 627 | |||
| 628 | (let* ((major (window-with-parameter 'window-side side nil t)) | ||
| 629 | ;; `major' is the major window on SIDE, `windows' the list of | ||
| 630 | ;; life windows on SIDE. | ||
| 631 | (windows | ||
| 632 | (when major | ||
| 633 | (let (windows) | ||
| 634 | (walk-window-tree | ||
| 635 | (lambda (window) | ||
| 636 | (when (eq (window-parameter window 'window-side) side) | ||
| 637 | (setq windows (cons window windows))))) | ||
| 638 | (nreverse windows)))) | ||
| 639 | (slots (when major (max 1 (window-child-count major)))) | ||
| 640 | (max-slots | ||
| 641 | (nth (cond | ||
| 642 | ((eq side 'left) 0) | ||
| 643 | ((eq side 'top) 1) | ||
| 644 | ((eq side 'right) 2) | ||
| 645 | ((eq side 'bottom) 3)) | ||
| 646 | window-sides-slots)) | ||
| 647 | (selected-window (selected-window)) | ||
| 648 | window this-window this-slot prev-window next-window | ||
| 649 | best-window best-slot abs-slot new-window) | ||
| 650 | |||
| 651 | (cond | ||
| 652 | ((and (numberp max-slots) (<= max-slots 0)) | ||
| 653 | ;; No side-slots available on this side. Don't create an error, | ||
| 654 | ;; just return nil. | ||
| 655 | nil) | ||
| 656 | ((not windows) | ||
| 657 | ;; No major window exists on this side, make one. | ||
| 658 | (display-buffer-in-major-side-window buffer side slot alist)) | ||
| 659 | (t | ||
| 660 | ;; Scan windows on SIDE. | ||
| 661 | (catch 'found | ||
| 662 | (dolist (window windows) | ||
| 663 | (setq this-slot (window-parameter window 'window-slot)) | ||
| 664 | (cond | ||
| 665 | ;; The following should not happen and probably be checked | ||
| 666 | ;; by window--side-check. | ||
| 667 | ((not (numberp this-slot))) | ||
| 668 | ((= this-slot slot) | ||
| 669 | ;; A window with a matching slot has been found. | ||
| 670 | (setq this-window window) | ||
| 671 | (throw 'found t)) | ||
| 672 | (t | ||
| 673 | ;; Check if this window has a better slot value wrt the | ||
| 674 | ;; slot of the window we want. | ||
| 675 | (setq abs-slot | ||
| 676 | (if (or (and (> this-slot 0) (> slot 0)) | ||
| 677 | (and (< this-slot 0) (< slot 0))) | ||
| 678 | (abs (- slot this-slot)) | ||
| 679 | (+ (abs slot) (abs this-slot)))) | ||
| 680 | (unless (and best-slot (<= best-slot abs-slot)) | ||
| 681 | (setq best-window window) | ||
| 682 | (setq best-slot abs-slot)) | ||
| 683 | (cond | ||
| 684 | ((<= this-slot slot) | ||
| 685 | (setq prev-window window)) | ||
| 686 | ((not next-window) | ||
| 687 | (setq next-window window))))))) | ||
| 688 | |||
| 689 | ;; `this-window' is the first window with the same SLOT. | ||
| 690 | ;; `prev-window' is the window with the largest slot < SLOT. A new | ||
| 691 | ;; window will be created after it. | ||
| 692 | ;; `next-window' is the window with the smallest slot > SLOT. A new | ||
| 693 | ;; window will be created before it. | ||
| 694 | ;; `best-window' is the window with the smallest absolute difference | ||
| 695 | ;; of its slot and SLOT. | ||
| 696 | |||
| 697 | ;; Note: We dedicate the window used softly to its buffer to | ||
| 698 | ;; avoid that "other" (non-side) buffer display functions steal | ||
| 699 | ;; it from us. This must eventually become customizable via | ||
| 700 | ;; ALIST (or, better, avoided in the "other" functions). | ||
| 701 | (or (and this-window | ||
| 702 | ;; Reuse `this-window'. | ||
| 703 | (window--display-buffer buffer this-window 'reuse 'side)) | ||
| 704 | (and (or (not max-slots) (< slots max-slots)) | ||
| 705 | (or (and next-window | ||
| 706 | ;; Make new window before `next-window'. | ||
| 707 | (let ((next-side | ||
| 708 | (if (memq side '(left right)) 'above 'left)) | ||
| 709 | (window-combination-resize 'side)) | ||
| 710 | (setq window (split-window next-window nil next-side)) | ||
| 711 | ;; When the new window is deleted, its space | ||
| 712 | ;; is returned to other side windows. | ||
| 713 | (set-window-parameter | ||
| 714 | window 'delete-window 'delete-side-window) | ||
| 715 | window)) | ||
| 716 | (and prev-window | ||
| 717 | ;; Make new window after `prev-window'. | ||
| 718 | (let ((prev-side | ||
| 719 | (if (memq side '(left right)) 'below 'right)) | ||
| 720 | (window-combination-resize 'side)) | ||
| 721 | (setq window (split-window prev-window nil prev-side)) | ||
| 722 | ;; When the new window is deleted, its space | ||
| 723 | ;; is returned to other side windows. | ||
| 724 | (set-window-parameter | ||
| 725 | window 'delete-window 'delete-side-window) | ||
| 726 | window))) | ||
| 727 | (set-window-parameter window 'window-slot slot) | ||
| 728 | (window--display-buffer buffer window 'window 'side)) | ||
| 729 | (and best-window | ||
| 730 | ;; Reuse `best-window'. | ||
| 731 | (progn | ||
| 732 | ;; Give best-window the new slot value. | ||
| 733 | (set-window-parameter best-window 'window-slot slot) | ||
| 734 | (window--display-buffer buffer best-window 'reuse 'side))))))))) | ||
| 735 | |||
| 449 | (defun window--side-check (&optional frame) | 736 | (defun window--side-check (&optional frame) |
| 450 | "Check the window-side parameter of all windows on FRAME. | 737 | "Check the side window configuration of FRAME. |
| 451 | FRAME defaults to the selected frame. If the configuration is | 738 | FRAME defaults to the selected frame. |
| 452 | invalid, reset all window-side parameters to nil. | 739 | |
| 453 | 740 | A valid side window configuration preserves the following two | |
| 454 | A valid configuration has to preserve the following invariant: | 741 | invariants: |
| 455 | 742 | ||
| 456 | - If a window has a non-nil window-side parameter, it must have a | 743 | - If there exists a window whose window-side parameter is |
| 457 | parent window and the parent window's window-side parameter | 744 | non-nil, there must exist at least one live window whose |
| 458 | must be either nil or the same as for window. | 745 | window-side parameter is nil. |
| 459 | 746 | ||
| 460 | - If windows with non-nil window-side parameters exist, there | 747 | - If a window W has a non-nil window-side parameter (i) it must |
| 461 | must be at most one window of each side and non-side with a | 748 | have a parent window and that parent's window-side parameter |
| 462 | parent whose window-side parameter is nil and there must be no | 749 | must be either nil or the same as for W, and (ii) any child |
| 463 | leaf window whose window-side parameter is nil." | 750 | window of W must have the same window-side parameter as W. |
| 464 | (let (normal none left top right bottom | 751 | |
| 465 | side parent parent-side) | 752 | If the configuration is invalid, reset the window-side parameters |
| 753 | of all windows on FRAME to nil." | ||
| 754 | (let (left top right bottom none side parent parent-side) | ||
| 466 | (when (or (catch 'reset | 755 | (when (or (catch 'reset |
| 467 | (walk-window-tree | 756 | (walk-window-tree |
| 468 | (lambda (window) | 757 | (lambda (window) |
| @@ -478,40 +767,34 @@ A valid configuration has to preserve the following invariant: | |||
| 478 | ;; A parent whose window-side is non-nil must | 767 | ;; A parent whose window-side is non-nil must |
| 479 | ;; have a child with the same window-side. | 768 | ;; have a child with the same window-side. |
| 480 | (throw 'reset t))) | 769 | (throw 'reset t))) |
| 481 | ;; Now check that there's more than one main window | 770 | ((not side) |
| 482 | ;; for any of none, left, top, right and bottom. | 771 | (when (window-buffer window) |
| 483 | ((eq side 'none) | 772 | ;; Record that we have at least one non-side, |
| 484 | (if none | 773 | ;; live window. |
| 485 | (throw 'reset t) | ||
| 486 | (setq none t))) | 774 | (setq none t))) |
| 775 | ((if (memq side '(left top)) | ||
| 776 | (window-prev-sibling window) | ||
| 777 | (window-next-sibling window)) | ||
| 778 | ;; Left and top major side windows must not have a | ||
| 779 | ;; previous sibling, right and bottom major side | ||
| 780 | ;; windows must not have a next sibling. | ||
| 781 | (throw 'reset t)) | ||
| 782 | ;; Now check that there's no more than one major | ||
| 783 | ;; window for any of left, top, right and bottom. | ||
| 487 | ((eq side 'left) | 784 | ((eq side 'left) |
| 488 | (if left | 785 | (if left (throw 'reset t) (setq left t))) |
| 489 | (throw 'reset t) | ||
| 490 | (setq left t))) | ||
| 491 | ((eq side 'top) | 786 | ((eq side 'top) |
| 492 | (if top | 787 | (if top (throw 'reset t) (setq top t))) |
| 493 | (throw 'reset t) | ||
| 494 | (setq top t))) | ||
| 495 | ((eq side 'right) | 788 | ((eq side 'right) |
| 496 | (if right | 789 | (if right (throw 'reset t) (setq right t))) |
| 497 | (throw 'reset t) | ||
| 498 | (setq right t))) | ||
| 499 | ((eq side 'bottom) | 790 | ((eq side 'bottom) |
| 500 | (if bottom | 791 | (if bottom (throw 'reset t) (setq bottom t))) |
| 501 | (throw 'reset t) | 792 | (t |
| 502 | (setq bottom t))) | 793 | (throw 'reset t)))) |
| 503 | ((window-buffer window) | ||
| 504 | ;; A leaf window without window-side parameter, | ||
| 505 | ;; record its existence. | ||
| 506 | (setq normal t)))) | ||
| 507 | frame t)) | 794 | frame t)) |
| 508 | (if none | 795 | ;; If there's a side window, there must be at least one |
| 509 | ;; At least one non-side window exists, so there must | 796 | ;; non-side window. |
| 510 | ;; be at least one side-window and no normal window. | 797 | (and (or left top right bottom) (not none))) |
| 511 | (or (not (or left top right bottom)) normal) | ||
| 512 | ;; No non-side window exists, so there must be no side | ||
| 513 | ;; window either. | ||
| 514 | (or left top right bottom))) | ||
| 515 | (walk-window-tree | 798 | (walk-window-tree |
| 516 | (lambda (window) | 799 | (lambda (window) |
| 517 | (set-window-parameter window 'window-side nil)) | 800 | (set-window-parameter window 'window-side nil)) |
| @@ -2393,8 +2676,7 @@ Return `frame' if deleting WINDOW should also delete its frame." | |||
| 2393 | (when (window-parameter window 'window-atom) | 2676 | (when (window-parameter window 'window-atom) |
| 2394 | (setq window (window-atom-root window)))) | 2677 | (setq window (window-atom-root window)))) |
| 2395 | 2678 | ||
| 2396 | (let ((parent (window-parent window)) | 2679 | (let ((frame (window-frame window))) |
| 2397 | (frame (window-frame window))) | ||
| 2398 | (cond | 2680 | (cond |
| 2399 | ((frame-root-window-p window) | 2681 | ((frame-root-window-p window) |
| 2400 | ;; WINDOW's frame can be deleted only if there are other frames | 2682 | ;; WINDOW's frame can be deleted only if there are other frames |
| @@ -2405,10 +2687,9 @@ Return `frame' if deleting WINDOW should also delete its frame." | |||
| 2405 | (and minibuf (eq frame (window-frame minibuf))))) | 2687 | (and minibuf (eq frame (window-frame minibuf))))) |
| 2406 | 'frame)) | 2688 | 'frame)) |
| 2407 | ((or ignore-window-parameters | 2689 | ((or ignore-window-parameters |
| 2408 | (not (eq (window-parameter window 'window-side) 'none)) | 2690 | (not (eq window (window--major-non-side-window frame)))) |
| 2409 | (and parent (eq (window-parameter parent 'window-side) 'none))) | 2691 | ;; WINDOW can be deleted unless it is the major non-side window of |
| 2410 | ;; WINDOW can be deleted unless it is the main window of its | 2692 | ;; its frame. |
| 2411 | ;; frame. | ||
| 2412 | t)))) | 2693 | t)))) |
| 2413 | 2694 | ||
| 2414 | (defun window--in-subtree-p (window root) | 2695 | (defun window--in-subtree-p (window root) |
| @@ -2459,13 +2740,13 @@ that is its frame's root window." | |||
| 2459 | ((and (window-parameter window 'window-atom) | 2740 | ((and (window-parameter window 'window-atom) |
| 2460 | (setq atom-root (window-atom-root window)) | 2741 | (setq atom-root (window-atom-root window)) |
| 2461 | (not (eq atom-root window))) | 2742 | (not (eq atom-root window))) |
| 2462 | (throw 'done (delete-window atom-root))) | 2743 | (if (eq atom-root (frame-root-window frame)) |
| 2463 | ((and (eq (window-parameter window 'window-side) 'none) | 2744 | (error "Root of atomic window is root window of its frame") |
| 2464 | (or (not parent) | 2745 | (throw 'done (delete-window atom-root)))) |
| 2465 | (not (eq (window-parameter parent 'window-side) 'none)))) | ||
| 2466 | (error "Attempt to delete last non-side window")) | ||
| 2467 | ((not parent) | 2746 | ((not parent) |
| 2468 | (error "Attempt to delete minibuffer or sole ordinary window"))) | 2747 | (error "Attempt to delete minibuffer or sole ordinary window")) |
| 2748 | ((eq window (window--major-non-side-window frame)) | ||
| 2749 | (error "Attempt to delete last non-side window"))) | ||
| 2469 | 2750 | ||
| 2470 | (let* ((horizontal (window-left-child parent)) | 2751 | (let* ((horizontal (window-left-child parent)) |
| 2471 | (size (window-total-size window horizontal)) | 2752 | (size (window-total-size window horizontal)) |
| @@ -2539,13 +2820,19 @@ window signal an error." | |||
| 2539 | ((and (window-parameter window 'window-atom) | 2820 | ((and (window-parameter window 'window-atom) |
| 2540 | (setq atom-root (window-atom-root window)) | 2821 | (setq atom-root (window-atom-root window)) |
| 2541 | (not (eq atom-root window))) | 2822 | (not (eq atom-root window))) |
| 2542 | (throw 'done (delete-other-windows atom-root))) | 2823 | (if (eq atom-root (frame-root-window frame)) |
| 2543 | ((eq window-side 'none) | 2824 | (error "Root of atomic window is root window of its frame") |
| 2544 | ;; Set side-main to the major non-side window. | 2825 | (throw 'done (delete-other-windows atom-root)))) |
| 2545 | (setq side-main (window-with-parameter 'window-side 'none frame t))) | ||
| 2546 | ((memq window-side window-sides) | 2826 | ((memq window-side window-sides) |
| 2547 | (error "Cannot make side window the only window"))) | 2827 | (error "Cannot make side window the only window")) |
| 2548 | ;; If WINDOW is the main non-side window, do nothing. | 2828 | ((and (window-minibuffer-p window) |
| 2829 | (not (eq window (frame-root-window window)))) | ||
| 2830 | (error "Can't expand minibuffer to full frame"))) | ||
| 2831 | |||
| 2832 | ;; If WINDOW is the major non-side window, do nothing. | ||
| 2833 | (if (window-with-parameter 'window-side) | ||
| 2834 | (setq side-main (window--major-non-side-window frame)) | ||
| 2835 | (setq side-main (frame-root-window frame))) | ||
| 2549 | (unless (eq window side-main) | 2836 | (unless (eq window side-main) |
| 2550 | (delete-other-windows-internal window side-main) | 2837 | (delete-other-windows-internal window side-main) |
| 2551 | (run-window-configuration-change-hook frame) | 2838 | (run-window-configuration-change-hook frame) |
| @@ -3204,14 +3491,16 @@ frame. The selected window is not changed by this function." | |||
| 3204 | ((not side) 'below) | 3491 | ((not side) 'below) |
| 3205 | ((memq side '(below above right left)) side) | 3492 | ((memq side '(below above right left)) side) |
| 3206 | (t 'right))) | 3493 | (t 'right))) |
| 3207 | (horizontal (not (memq side '(nil below above)))) | 3494 | (horizontal (not (memq side '(below above)))) |
| 3208 | (frame (window-frame window)) | 3495 | (frame (window-frame window)) |
| 3209 | (parent (window-parent window)) | 3496 | (parent (window-parent window)) |
| 3210 | (function (window-parameter window 'split-window)) | 3497 | (function (window-parameter window 'split-window)) |
| 3211 | (window-side (window-parameter window 'window-side)) | 3498 | (window-side (window-parameter window 'window-side)) |
| 3212 | ;; Rebind `window-combination-limit' since in some cases we may | 3499 | ;; Rebind `window-combination-limit' and |
| 3213 | ;; have to override its value. | 3500 | ;; `window-combination-resize' since in some cases we may have |
| 3501 | ;; to override their value. | ||
| 3214 | (window-combination-limit window-combination-limit) | 3502 | (window-combination-limit window-combination-limit) |
| 3503 | (window-combination-resize window-combination-resize) | ||
| 3215 | atom-root) | 3504 | atom-root) |
| 3216 | 3505 | ||
| 3217 | (window--check frame) | 3506 | (window--check frame) |
| @@ -3229,20 +3518,32 @@ frame. The selected window is not changed by this function." | |||
| 3229 | ((and (window-parameter window 'window-atom) | 3518 | ((and (window-parameter window 'window-atom) |
| 3230 | (setq atom-root (window-atom-root window)) | 3519 | (setq atom-root (window-atom-root window)) |
| 3231 | (not (eq atom-root window))) | 3520 | (not (eq atom-root window))) |
| 3232 | (throw 'done (split-window atom-root size side)))) | 3521 | (throw 'done (split-window atom-root size side))) |
| 3233 | 3522 | ;; If WINDOW is a side window or its first or last child is a | |
| 3234 | (when (and window-side | 3523 | ;; side window, throw an error unless `window-combination-resize' |
| 3235 | (or (not parent) | 3524 | ;; equals 'side. |
| 3236 | (not (window-parameter parent 'window-side)))) | 3525 | ((and (not (eq window-combination-resize 'side)) |
| 3237 | ;; WINDOW is a side root window. To make sure that a new parent | 3526 | (or (window-parameter window 'window-side) |
| 3238 | ;; window gets created set `window-combination-limit' to t. | 3527 | (and (window-child window) |
| 3239 | (setq window-combination-limit t)) | 3528 | (or (window-parameter |
| 3240 | 3529 | (window-child window) 'window-side) | |
| 3241 | (when (and window-combination-resize size (> size 0)) | 3530 | (window-parameter |
| 3242 | ;; If `window-combination-resize' is non-nil and SIZE is a | 3531 | (window-last-child window) 'window-side))))) |
| 3243 | ;; non-negative integer, we cannot reasonably resize other | 3532 | (error "Cannot split side window or parent of side window")) |
| 3244 | ;; windows. Rather bind `window-combination-limit' to t to make | 3533 | ;; If `window-combination-resize' is 'side and window has a side |
| 3245 | ;; sure that subsequent window deletions are handled correctly. | 3534 | ;; window sibling, bind `window-combination-limit' to t. |
| 3535 | ((and (not (eq window-combination-resize 'side)) | ||
| 3536 | (or (and (window-prev-sibling window) | ||
| 3537 | (window-parameter | ||
| 3538 | (window-prev-sibling window) 'window-side)) | ||
| 3539 | (and (window-next-sibling window) | ||
| 3540 | (window-parameter | ||
| 3541 | (window-next-sibling window) 'window-side)))) | ||
| 3542 | (setq window-combination-limit t))) | ||
| 3543 | |||
| 3544 | ;; If `window-combination-resize' is t and SIZE is non-negative, | ||
| 3545 | ;; bind `window-combination-limit' to t. | ||
| 3546 | (when (and (eq window-combination-resize t) size (> size 0)) | ||
| 3246 | (setq window-combination-limit t)) | 3547 | (setq window-combination-limit t)) |
| 3247 | 3548 | ||
| 3248 | (let* ((parent-size | 3549 | (let* ((parent-size |
| @@ -3252,7 +3553,10 @@ frame. The selected window is not changed by this function." | |||
| 3252 | ;; `resize' non-nil means we are supposed to resize other | 3553 | ;; `resize' non-nil means we are supposed to resize other |
| 3253 | ;; windows in WINDOW's combination. | 3554 | ;; windows in WINDOW's combination. |
| 3254 | (resize | 3555 | (resize |
| 3255 | (and window-combination-resize (not window-combination-limit) | 3556 | (and window-combination-resize |
| 3557 | (or (window-parameter window 'window-side) | ||
| 3558 | (not (eq window-combination-resize 'side))) | ||
| 3559 | (not window-combination-limit) | ||
| 3256 | ;; Resize makes sense in iso-combinations only. | 3560 | ;; Resize makes sense in iso-combinations only. |
| 3257 | (window-combined-p window horizontal))) | 3561 | (window-combined-p window horizontal))) |
| 3258 | ;; `old-size' is the current size of WINDOW. | 3562 | ;; `old-size' is the current size of WINDOW. |
| @@ -3363,10 +3667,21 @@ frame. The selected window is not changed by this function." | |||
| 3363 | new-normal))) | 3667 | new-normal))) |
| 3364 | 3668 | ||
| 3365 | (let* ((new (split-window-internal window new-size side new-normal))) | 3669 | (let* ((new (split-window-internal window new-size side new-normal))) |
| 3366 | ;; Inherit window-side parameters, if any. | 3670 | ;; Assign window-side parameters, if any. |
| 3367 | (when (and window-side new-parent) | 3671 | (when (eq window-combination-resize 'side) |
| 3368 | (set-window-parameter (window-parent new) 'window-side window-side) | 3672 | (let ((window-side |
| 3369 | (set-window-parameter new 'window-side window-side)) | 3673 | (cond |
| 3674 | (window-side window-side) | ||
| 3675 | ((eq side 'above) 'top) | ||
| 3676 | ((eq side 'below) 'bottom) | ||
| 3677 | (t side)))) | ||
| 3678 | ;; We made a new side window. | ||
| 3679 | (set-window-parameter new 'window-side window-side) | ||
| 3680 | (when (and new-parent (window-parameter window 'window-side)) | ||
| 3681 | ;; We've been splitting a side root window. Give the | ||
| 3682 | ;; new parent the same window-side parameter. | ||
| 3683 | (set-window-parameter | ||
| 3684 | (window-parent new) 'window-side window-side)))) | ||
| 3370 | 3685 | ||
| 3371 | (run-window-configuration-change-hook frame) | 3686 | (run-window-configuration-change-hook frame) |
| 3372 | (window--check frame) | 3687 | (window--check frame) |
| @@ -4054,12 +4369,11 @@ of the window used." | |||
| 4054 | (function :tag "function")) | 4369 | (function :tag "function")) |
| 4055 | :group 'windows) | 4370 | :group 'windows) |
| 4056 | 4371 | ||
| 4372 | ;; Eventually, we want to turn this into a defvar; instead of | ||
| 4373 | ;; customizing this, the user should use a `pop-up-frame-parameters' | ||
| 4374 | ;; alist entry in `display-buffer-base-action'. | ||
| 4057 | (defcustom pop-up-frame-alist nil | 4375 | (defcustom pop-up-frame-alist nil |
| 4058 | "Alist of parameters for automatically generated new frames. | 4376 | "Alist of parameters for automatically generated new frames. |
| 4059 | You can set this in your init file; for example, | ||
| 4060 | |||
| 4061 | (setq pop-up-frame-alist '((width . 80) (height . 20))) | ||
| 4062 | |||
| 4063 | If non-nil, the value you specify here is used by the default | 4377 | If non-nil, the value you specify here is used by the default |
| 4064 | `pop-up-frame-function' for the creation of new frames. | 4378 | `pop-up-frame-function' for the creation of new frames. |
| 4065 | 4379 | ||
| @@ -4146,8 +4460,7 @@ See also `special-display-regexps'." | |||
| 4146 | (repeat :tag "Arguments" (sexp))))) | 4460 | (repeat :tag "Arguments" (sexp))))) |
| 4147 | :group 'windows | 4461 | :group 'windows |
| 4148 | :group 'frames) | 4462 | :group 'frames) |
| 4149 | 4463 | (make-obsolete-variable 'special-display-buffer-names 'display-buffer-alist "24.3") | |
| 4150 | ;;;###autoload | ||
| 4151 | (put 'special-display-buffer-names 'risky-local-variable t) | 4464 | (put 'special-display-buffer-names 'risky-local-variable t) |
| 4152 | 4465 | ||
| 4153 | (defcustom special-display-regexps nil | 4466 | (defcustom special-display-regexps nil |
| @@ -4214,6 +4527,8 @@ See also `special-display-buffer-names'." | |||
| 4214 | (repeat :tag "Arguments" (sexp))))) | 4527 | (repeat :tag "Arguments" (sexp))))) |
| 4215 | :group 'windows | 4528 | :group 'windows |
| 4216 | :group 'frames) | 4529 | :group 'frames) |
| 4530 | (make-obsolete-variable 'special-display-regexps 'display-buffer-alist "24.3") | ||
| 4531 | (put 'special-display-regexps 'risky-local-variable t) | ||
| 4217 | 4532 | ||
| 4218 | (defun special-display-p (buffer-name) | 4533 | (defun special-display-p (buffer-name) |
| 4219 | "Return non-nil if a buffer named BUFFER-NAME gets a special frame. | 4534 | "Return non-nil if a buffer named BUFFER-NAME gets a special frame. |
| @@ -4255,6 +4570,7 @@ These supersede the values given in `default-frame-alist'." | |||
| 4255 | (symbol :tag "Parameter") | 4570 | (symbol :tag "Parameter") |
| 4256 | (sexp :tag "Value"))) | 4571 | (sexp :tag "Value"))) |
| 4257 | :group 'frames) | 4572 | :group 'frames) |
| 4573 | (make-obsolete-variable 'special-display-frame-alist 'display-buffer-alist "24.3") | ||
| 4258 | 4574 | ||
| 4259 | (defun special-display-popup-frame (buffer &optional args) | 4575 | (defun special-display-popup-frame (buffer &optional args) |
| 4260 | "Pop up a frame displaying BUFFER and return its window. | 4576 | "Pop up a frame displaying BUFFER and return its window. |
| @@ -4321,6 +4637,7 @@ with corresponding arguments to set up the quit-restore parameter | |||
| 4321 | of the window used." | 4637 | of the window used." |
| 4322 | :type 'function | 4638 | :type 'function |
| 4323 | :group 'frames) | 4639 | :group 'frames) |
| 4640 | (make-obsolete-variable 'special-display-function 'display-buffer-alist "24.3") | ||
| 4324 | 4641 | ||
| 4325 | (defcustom same-window-buffer-names nil | 4642 | (defcustom same-window-buffer-names nil |
| 4326 | "List of names of buffers that should appear in the \"same\" window. | 4643 | "List of names of buffers that should appear in the \"same\" window. |
| @@ -4393,6 +4710,7 @@ that frame." | |||
| 4393 | :type 'boolean | 4710 | :type 'boolean |
| 4394 | :version "21.1" | 4711 | :version "21.1" |
| 4395 | :group 'windows) | 4712 | :group 'windows) |
| 4713 | (make-obsolete-variable 'display-buffer-reuse-frames 'display-buffer-alist "24.3") | ||
| 4396 | 4714 | ||
| 4397 | (defcustom pop-up-windows t | 4715 | (defcustom pop-up-windows t |
| 4398 | "Non-nil means `display-buffer' should make a new window." | 4716 | "Non-nil means `display-buffer' should make a new window." |
| @@ -4596,23 +4914,19 @@ Do this only if these windows are vertically adjacent to each | |||
| 4596 | other, `even-window-heights' is non-nil, and the selected window | 4914 | other, `even-window-heights' is non-nil, and the selected window |
| 4597 | is higher than WINDOW." | 4915 | is higher than WINDOW." |
| 4598 | (when (and even-window-heights | 4916 | (when (and even-window-heights |
| 4599 | (not (eq window (selected-window))) | 4917 | ;; Even iff WINDOW forms a vertical combination with the |
| 4600 | ;; Don't resize minibuffer windows. | 4918 | ;; selected window, and WINDOW's height exceeds that of the |
| 4601 | (not (window-minibuffer-p (selected-window))) | 4919 | ;; selected window, see also bug#11880. |
| 4602 | (> (window-height (selected-window)) (window-height window)) | 4920 | (window-combined-p window) |
| 4603 | (eq (window-frame window) (window-frame (selected-window))) | 4921 | (= (window-child-count (window-parent window)) 2) |
| 4604 | (let ((sel-edges (window-edges (selected-window))) | 4922 | (eq (window-parent) (window-parent window)) |
| 4605 | (win-edges (window-edges window))) | 4923 | (> (window-total-height) (window-total-height window))) |
| 4606 | (and (= (nth 0 sel-edges) (nth 0 win-edges)) | 4924 | ;; Don't throw an error if we can't even window heights for |
| 4607 | (= (nth 2 sel-edges) (nth 2 win-edges)) | 4925 | ;; whatever reason. |
| 4608 | (or (= (nth 1 sel-edges) (nth 3 win-edges)) | 4926 | (condition-case nil |
| 4609 | (= (nth 3 sel-edges) (nth 1 win-edges)))))) | 4927 | (enlarge-window |
| 4610 | (let ((window-min-height 1)) | 4928 | (/ (- (window-total-height window) (window-total-height)) 2)) |
| 4611 | ;; Don't throw an error if we can't even window heights for | 4929 | (error nil)))) |
| 4612 | ;; whatever reason. | ||
| 4613 | (condition-case nil | ||
| 4614 | (enlarge-window (/ (- (window-height window) (window-height)) 2)) | ||
| 4615 | (error nil))))) | ||
| 4616 | 4930 | ||
| 4617 | (defun window--display-buffer (buffer window type &optional dedicated) | 4931 | (defun window--display-buffer (buffer window type &optional dedicated) |
| 4618 | "Display BUFFER in WINDOW and make its frame visible. | 4932 | "Display BUFFER in WINDOW and make its frame visible. |
| @@ -4621,9 +4935,9 @@ is passed unaltered to `display-buffer-record-window'. Set | |||
| 4621 | `window-dedicated-p' to DEDICATED if non-nil. Return WINDOW if | 4935 | `window-dedicated-p' to DEDICATED if non-nil. Return WINDOW if |
| 4622 | BUFFER and WINDOW are live." | 4936 | BUFFER and WINDOW are live." |
| 4623 | (when (and (buffer-live-p buffer) (window-live-p window)) | 4937 | (when (and (buffer-live-p buffer) (window-live-p window)) |
| 4938 | (display-buffer-record-window type window buffer) | ||
| 4624 | (unless (eq buffer (window-buffer window)) | 4939 | (unless (eq buffer (window-buffer window)) |
| 4625 | (set-window-dedicated-p window nil) | 4940 | (set-window-dedicated-p window nil) |
| 4626 | (display-buffer-record-window type window buffer) | ||
| 4627 | (set-window-buffer window buffer) | 4941 | (set-window-buffer window buffer) |
| 4628 | (when dedicated | 4942 | (when dedicated |
| 4629 | (set-window-dedicated-p window dedicated)) | 4943 | (set-window-dedicated-p window dedicated)) |
| @@ -4797,6 +5111,10 @@ Recognized alist entries include: | |||
| 4797 | window that already displays the buffer. | 5111 | window that already displays the buffer. |
| 4798 | See `display-buffer-reuse-window'. | 5112 | See `display-buffer-reuse-window'. |
| 4799 | 5113 | ||
| 5114 | `pop-up-frame-parameters' -- Value specifies an alist of frame | ||
| 5115 | parameters to give a new frame, if | ||
| 5116 | one is created. | ||
| 5117 | |||
| 4800 | The ACTION argument to `display-buffer' can also have a non-nil | 5118 | The ACTION argument to `display-buffer' can also have a non-nil |
| 4801 | and non-list value. This means to display the buffer in a window | 5119 | and non-list value. This means to display the buffer in a window |
| 4802 | other than the selected one, even if it is already displayed in | 5120 | other than the selected one, even if it is already displayed in |
| @@ -4939,9 +5257,15 @@ This works by calling `pop-up-frame-function'. If successful, | |||
| 4939 | return the window used; otherwise return nil. | 5257 | return the window used; otherwise return nil. |
| 4940 | 5258 | ||
| 4941 | If ALIST has a non-nil `inhibit-switch-frame' entry, avoid | 5259 | If ALIST has a non-nil `inhibit-switch-frame' entry, avoid |
| 4942 | raising the new frame." | 5260 | raising the new frame. |
| 4943 | (let ((fun pop-up-frame-function) | 5261 | |
| 4944 | frame window) | 5262 | If ALIST has a non-nil `pop-up-frame-parameters' entry, the |
| 5263 | corresponding value is an alist of frame parameters to give the | ||
| 5264 | new frame." | ||
| 5265 | (let* ((params (cdr (assq 'pop-up-frame-parameters alist))) | ||
| 5266 | (pop-up-frame-alist (append params pop-up-frame-alist)) | ||
| 5267 | (fun pop-up-frame-function) | ||
| 5268 | frame window) | ||
| 4945 | (when (and fun | 5269 | (when (and fun |
| 4946 | (setq frame (funcall fun)) | 5270 | (setq frame (funcall fun)) |
| 4947 | (setq window (frame-selected-window frame))) | 5271 | (setq window (frame-selected-window frame))) |
| @@ -5019,8 +5343,9 @@ that frame." | |||
| 5019 | window)) | 5343 | window)) |
| 5020 | (get-largest-window 0 not-this-window)))) | 5344 | (get-largest-window 0 not-this-window)))) |
| 5021 | (when (window-live-p window) | 5345 | (when (window-live-p window) |
| 5022 | (window--even-window-heights window) | 5346 | (prog1 |
| 5023 | (prog1 (window--display-buffer buffer window 'reuse) | 5347 | (window--display-buffer buffer window 'reuse) |
| 5348 | (window--even-window-heights window) | ||
| 5024 | (unless (cdr (assq 'inhibit-switch-frame alist)) | 5349 | (unless (cdr (assq 'inhibit-switch-frame alist)) |
| 5025 | (window--maybe-raise-frame (window-frame window))))))) | 5350 | (window--maybe-raise-frame (window-frame window))))))) |
| 5026 | 5351 | ||
diff --git a/lisp/woman.el b/lisp/woman.el index 5933d593aa5..c8cc7ea6766 100644 --- a/lisp/woman.el +++ b/lisp/woman.el | |||
| @@ -2531,7 +2531,7 @@ REQUEST is the invoking directive without the leading dot." | |||
| 2531 | (cond | 2531 | (cond |
| 2532 | ;; ((looking-at "[no]") (setq c t)) ; accept n(roff) and o(dd page) | 2532 | ;; ((looking-at "[no]") (setq c t)) ; accept n(roff) and o(dd page) |
| 2533 | ;; ((looking-at "[te]") (setq c nil)) ; reject t(roff) and e(ven page) | 2533 | ;; ((looking-at "[te]") (setq c nil)) ; reject t(roff) and e(ven page) |
| 2534 | ;; Per groff ".if v" is recognised as false (it means -Tversatec). | 2534 | ;; Per groff ".if v" is recognized as false (it means -Tversatec). |
| 2535 | ((looking-at "[ntoev]") | 2535 | ((looking-at "[ntoev]") |
| 2536 | (setq c (memq (following-char) woman-if-conditions-true))) | 2536 | (setq c (memq (following-char) woman-if-conditions-true))) |
| 2537 | ;; Unrecognized letter so reject: | 2537 | ;; Unrecognized letter so reject: |
diff --git a/m4/execinfo.m4 b/m4/execinfo.m4 new file mode 100644 index 00000000000..f1f3cd91638 --- /dev/null +++ b/m4/execinfo.m4 | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | # Check for GNU-style execinfo.h. | ||
| 2 | |||
| 3 | dnl Copyright 2012 Free Software Foundation, Inc. | ||
| 4 | dnl This file is free software; the Free Software Foundation | ||
| 5 | dnl gives unlimited permission to copy and/or distribute it, | ||
| 6 | dnl with or without modifications, as long as this notice is preserved. | ||
| 7 | |||
| 8 | AC_DEFUN([gl_EXECINFO_H], | ||
| 9 | [ | ||
| 10 | AC_CHECK_HEADERS_ONCE([execinfo.h]) | ||
| 11 | |||
| 12 | LIB_EXECINFO='' | ||
| 13 | EXECINFO_H='execinfo.h' | ||
| 14 | |||
| 15 | if test $ac_cv_header_execinfo_h = yes; then | ||
| 16 | gl_saved_libs=$LIBS | ||
| 17 | AC_SEARCH_LIBS([backtrace_symbols_fd], [execinfo], | ||
| 18 | [test "$ac_cv_search_backtrace_symbols_fd" = "none required" || | ||
| 19 | LIB_EXECINFO=$ac_cv_search_backtrace_symbols_fd]) | ||
| 20 | LIBS=$gl_saved_libs | ||
| 21 | test "$ac_cv_search_backtrace_symbols_fd" = no || EXECINFO_H='' | ||
| 22 | fi | ||
| 23 | |||
| 24 | if test -n "$EXECINFO_H"; then | ||
| 25 | AC_LIBOBJ([execinfo]) | ||
| 26 | fi | ||
| 27 | |||
| 28 | AC_SUBST([EXECINFO_H]) | ||
| 29 | AC_SUBST([LIB_EXECINFO]) | ||
| 30 | AM_CONDITIONAL([GL_GENERATE_EXECINFO_H], [test -n "$EXECINFO_H"]) | ||
| 31 | ]) | ||
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 12c8ca8734b..0d73faee8d1 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 | |||
| @@ -53,6 +53,7 @@ AC_DEFUN([gl_EARLY], | |||
| 53 | # Code from module dtotimespec: | 53 | # Code from module dtotimespec: |
| 54 | # Code from module dup2: | 54 | # Code from module dup2: |
| 55 | # Code from module environ: | 55 | # Code from module environ: |
| 56 | # Code from module execinfo: | ||
| 56 | # Code from module extensions: | 57 | # Code from module extensions: |
| 57 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | 58 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
| 58 | # Code from module extern-inline: | 59 | # Code from module extern-inline: |
| @@ -152,6 +153,7 @@ AC_DEFUN([gl_INIT], | |||
| 152 | gl_UNISTD_MODULE_INDICATOR([dup2]) | 153 | gl_UNISTD_MODULE_INDICATOR([dup2]) |
| 153 | gl_ENVIRON | 154 | gl_ENVIRON |
| 154 | gl_UNISTD_MODULE_INDICATOR([environ]) | 155 | gl_UNISTD_MODULE_INDICATOR([environ]) |
| 156 | gl_EXECINFO_H | ||
| 155 | AC_REQUIRE([gl_EXTERN_INLINE]) | 157 | AC_REQUIRE([gl_EXTERN_INLINE]) |
| 156 | gl_FILEMODE | 158 | gl_FILEMODE |
| 157 | gl_GETLOADAVG | 159 | gl_GETLOADAVG |
| @@ -534,6 +536,8 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 534 | lib/dtoastr.c | 536 | lib/dtoastr.c |
| 535 | lib/dtotimespec.c | 537 | lib/dtotimespec.c |
| 536 | lib/dup2.c | 538 | lib/dup2.c |
| 539 | lib/execinfo.c | ||
| 540 | lib/execinfo.in.h | ||
| 537 | lib/filemode.c | 541 | lib/filemode.c |
| 538 | lib/filemode.h | 542 | lib/filemode.h |
| 539 | lib/ftoastr.c | 543 | lib/ftoastr.c |
| @@ -605,6 +609,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 605 | m4/clock_time.m4 | 609 | m4/clock_time.m4 |
| 606 | m4/dup2.m4 | 610 | m4/dup2.m4 |
| 607 | m4/environ.m4 | 611 | m4/environ.m4 |
| 612 | m4/execinfo.m4 | ||
| 608 | m4/extensions.m4 | 613 | m4/extensions.m4 |
| 609 | m4/extern-inline.m4 | 614 | m4/extern-inline.m4 |
| 610 | m4/filemode.m4 | 615 | m4/filemode.m4 |
diff --git a/nt/ChangeLog b/nt/ChangeLog index 12273ec7853..7729f09d00f 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-08-22 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * config.nt: Sync with autogen/config.in. | ||
| 4 | |||
| 1 | 2012-08-17 Juanma Barranquero <lekktu@gmail.com> | 5 | 2012-08-17 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 6 | ||
| 3 | * config.nt: Sync with autogen/config.in. | 7 | * config.nt: Sync with autogen/config.in. |
diff --git a/nt/config.nt b/nt/config.nt index 5181e09e64e..34495928b92 100644 --- a/nt/config.nt +++ b/nt/config.nt | |||
| @@ -1563,20 +1563,34 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 1563 | #if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__ | 1563 | #if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__ |
| 1564 | # define _GL_INLINE inline | 1564 | # define _GL_INLINE inline |
| 1565 | # define _GL_EXTERN_INLINE extern inline | 1565 | # define _GL_EXTERN_INLINE extern inline |
| 1566 | # if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ | 1566 | #elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) |
| 1567 | # define _GL_INLINE_HEADER_BEGIN \ | 1567 | # if __GNUC_GNU_INLINE__ |
| 1568 | _Pragma ("GCC diagnostic push") \ | 1568 | /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ |
| 1569 | _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ | 1569 | # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) |
| 1570 | _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") | 1570 | # else |
| 1571 | # define _GL_INLINE_HEADER_END \ | 1571 | # define _GL_INLINE extern inline |
| 1572 | _Pragma ("GCC diagnostic pop") | ||
| 1573 | # endif | 1572 | # endif |
| 1573 | # define _GL_EXTERN_INLINE extern | ||
| 1574 | #else | 1574 | #else |
| 1575 | # define _GL_INLINE static inline | 1575 | # define _GL_INLINE static inline |
| 1576 | # define _GL_EXTERN_INLINE static inline | 1576 | # define _GL_EXTERN_INLINE static inline |
| 1577 | #endif | 1577 | #endif |
| 1578 | 1578 | ||
| 1579 | #ifndef _GL_INLINE_HEADER_BEGIN | 1579 | #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) |
| 1580 | # if __GNUC_STDC_INLINE__ | ||
| 1581 | # define _GL_INLINE_HEADER_CONST_PRAGMA | ||
| 1582 | # else | ||
| 1583 | # define _GL_INLINE_HEADER_CONST_PRAGMA \ | ||
| 1584 | _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") | ||
| 1585 | # endif | ||
| 1586 | # define _GL_INLINE_HEADER_BEGIN \ | ||
| 1587 | _Pragma ("GCC diagnostic push") \ | ||
| 1588 | _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ | ||
| 1589 | _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ | ||
| 1590 | _GL_INLINE_HEADER_CONST_PRAGMA | ||
| 1591 | # define _GL_INLINE_HEADER_END \ | ||
| 1592 | _Pragma ("GCC diagnostic pop") | ||
| 1593 | #else | ||
| 1580 | # define _GL_INLINE_HEADER_BEGIN | 1594 | # define _GL_INLINE_HEADER_BEGIN |
| 1581 | # define _GL_INLINE_HEADER_END | 1595 | # define _GL_INLINE_HEADER_END |
| 1582 | #endif | 1596 | #endif |
diff --git a/src/ChangeLog b/src/ChangeLog index c43404fa438..1040b93fe70 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,307 @@ | |||
| 1 | 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | Do not allow to set major mode for a dead buffer. | ||
| 4 | * buffer.c (Fset_buffer_major_mode): Signal an error | ||
| 5 | if the buffer is dead. | ||
| 6 | (Fother_buffer, other_buffer_safely): Remove redundant | ||
| 7 | nested declaration. | ||
| 8 | |||
| 9 | 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 10 | |||
| 11 | Always use set_buffer_if_live to restore original buffer at unwind. | ||
| 12 | * buffer.h (record_unwind_current_buffer): New function. | ||
| 13 | * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c: | ||
| 14 | * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c: | ||
| 15 | * undo.c, window.c: Adjust users. | ||
| 16 | * buffer.c (set_buffer_if_live): Fix comment. | ||
| 17 | |||
| 18 | 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 19 | |||
| 20 | Fix usage of set_buffer_internal. | ||
| 21 | * buffer.h (set_buffer_internal): Make it BUFFER_INLINE. | ||
| 22 | * buffer.c (set_buffer_if_live): Use set_buffer_internal. | ||
| 23 | * coding.c (decode_coding): Omit redundant test. | ||
| 24 | * fileio.c (decide_coding_unwind): Likewise. | ||
| 25 | * fns.c (secure_hash): Likewise. | ||
| 26 | * insdel.c (modify_region): Likewise. | ||
| 27 | * keyboard.c (command_loop_1): Likewise. | ||
| 28 | * print.c (PRINTFINISH): Likewise. | ||
| 29 | * xdisp.c (run_window_scroll_functions): Use set_buffer_internal. | ||
| 30 | |||
| 31 | 2012-08-27 Paul Eggert <eggert@cs.ucla.edu> | ||
| 32 | |||
| 33 | * dispnew.c: Use bool for boolean. | ||
| 34 | (frame_garbaged, display_completed, delayed_size_change) | ||
| 35 | (fonts_changed_p, add_window_display_history) | ||
| 36 | (add_frame_display_history, verify_row_hash) | ||
| 37 | (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p) | ||
| 38 | (row_equal_p, realloc_glyph_pool) | ||
| 39 | (allocate_matrices_for_frame_redisplay) | ||
| 40 | (showing_window_margins_p) | ||
| 41 | (adjust_frame_glyphs_for_frame_redisplay) | ||
| 42 | (build_frame_matrix_from_leaf_window, make_current) | ||
| 43 | (mirrored_line_dance, mirror_line_dance, update_frame) | ||
| 44 | (update_window_tree, update_single_window) | ||
| 45 | (check_current_matrix_flags, update_window, update_text_area) | ||
| 46 | (update_window_line, set_window_update_flags, scrolling_window) | ||
| 47 | (update_frame_1, scrolling, buffer_posn_from_coords) | ||
| 48 | (do_pending_window_change, change_frame_size) | ||
| 49 | (change_frame_size_1, sit_for): | ||
| 50 | Use bool for boolean. | ||
| 51 | (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows, | ||
| 52 | and remove last int (actually boolean) argument, which was always 0. | ||
| 53 | All callers changed. | ||
| 54 | * dispextern.h, frame.h, lisp.h: Reflect above API changes. | ||
| 55 | * dispextern.h (struct composition_it): Use bool for boolean. | ||
| 56 | (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'. | ||
| 57 | (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf. | ||
| 58 | * dired.c (file_name_completion): | ||
| 59 | Use bool for boolean. (This was missed in an earlier change.) | ||
| 60 | |||
| 61 | 2012-08-27 Martin Rudalics <rudalics@gmx.at> | ||
| 62 | |||
| 63 | * window.c (Fset_window_configuration): Revert first part of | ||
| 64 | last change. | ||
| 65 | |||
| 66 | 2012-08-27 Jan Djärv <jan.h.d@swipnet.se> | ||
| 67 | |||
| 68 | * nsterm.h (NSPanel): New class variable dialog_return. | ||
| 69 | |||
| 70 | * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize | ||
| 71 | dialog_return. | ||
| 72 | (windowShouldClose:): Use stop instead of stopModalWithCode. | ||
| 73 | (clicked:): Ditto, and also set dialog_return (Bug#12258). | ||
| 74 | (timeout_handler:): Use stop instead of abortModal. Send a dummy | ||
| 75 | event. | ||
| 76 | (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when | ||
| 77 | modal loop returns. | ||
| 78 | |||
| 79 | 2012-08-27 Paul Eggert <eggert@cs.ucla.edu> | ||
| 80 | |||
| 81 | * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans. | ||
| 82 | * composite.c (find_composition, composition_gstring_p) | ||
| 83 | (composition_reseat_it, find_automatic_composition): | ||
| 84 | * data.c (let_shadows_buffer_binding_p) | ||
| 85 | (let_shadows_global_binding_p, set_internal, make_blv) | ||
| 86 | (Fmake_variable_buffer_local, Fmake_local_variable) | ||
| 87 | (Fmake_variable_frame_local, arithcompare, cons_to_unsigned) | ||
| 88 | (cons_to_signed, arith_driver): | ||
| 89 | * dbusbind.c (xd_in_read_queued_messages): | ||
| 90 | * dired.c (directory_files_internal, file_name_completion): | ||
| 91 | Use bool for booleans. | ||
| 92 | * dired.c (file_name_completion): | ||
| 93 | * process.h (fd_callback): | ||
| 94 | Omit int (actually boolean) argument. It wasn't being used. | ||
| 95 | All uses changed. | ||
| 96 | * composite.h, lisp.h: Reflect above API changes. | ||
| 97 | |||
| 98 | * cmds.c, coding.c: Use bool for booleans. | ||
| 99 | * cmds.c (move_point, Fself_insert_command): | ||
| 100 | * coding.h (struct composition status, struct coding_system): | ||
| 101 | * coding.c (detect_coding_utf_8, encode_coding_utf_8) | ||
| 102 | (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule) | ||
| 103 | (emacs_mule_char, decode_coding_emacs_mule) | ||
| 104 | (encode_coding_emacs_mule, detect_coding_iso_2022) | ||
| 105 | (decode_coding_iso_2022, encode_invocation_designation) | ||
| 106 | (encode_designation_at_bol, encode_coding_iso_2022) | ||
| 107 | (detect_coding_sjis, detect_coding_big5, decode_coding_sjis) | ||
| 108 | (decode_coding_big5, encode_coding_sjis, encode_coding_big5) | ||
| 109 | (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text) | ||
| 110 | (encode_coding_raw_text, detect_coding_charset) | ||
| 111 | (decode_coding_charset, encode_coding_charset, detect_eol) | ||
| 112 | (detect_coding, get_translation_table, produce_chars) | ||
| 113 | (consume_chars, reused_workbuf_in_use) | ||
| 114 | (make_conversion_work_buffer, code_conversion_save) | ||
| 115 | (decode_coding_object, encode_coding_object) | ||
| 116 | (detect_coding_system, char_encodable_p) | ||
| 117 | (Funencodable_char_position, code_convert_region) | ||
| 118 | (code_convert_string, code_convert_string_norecord) | ||
| 119 | (Fset_coding_system_priority): | ||
| 120 | * fileio.c (Finsert_file_contents): | ||
| 121 | Use bool for booleans. | ||
| 122 | * coding.h, lisp.h: Reflect above API changes. | ||
| 123 | * coding.c: Remove unnecessary static function decls. | ||
| 124 | (detect_coding): Use unsigned, not signed, to copy an unsigned field. | ||
| 125 | (decode_coding, encode_coding, decode_coding_gap): Return 'void', | ||
| 126 | not a boolean 'int', since callers never look at the return value. | ||
| 127 | (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'. | ||
| 128 | * coding.h (decoding_buffer_size, encoding_buffer_size) | ||
| 129 | (emacs_mule_string_char): Remove unused extern decls. | ||
| 130 | (struct iso_2022_spec, struct coding_system): | ||
| 131 | Use 'unsigned int : 1' for boolean fields, since there's more than one. | ||
| 132 | (struct emacs_mule_spec): Remove unused field 'full_support'. | ||
| 133 | All initializations removed. | ||
| 134 | * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'. | ||
| 135 | |||
| 136 | 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 137 | |||
| 138 | Fix spare memory change (Bug#12286). | ||
| 139 | * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE. | ||
| 140 | (valid_lisp_object_p): Likewise. | ||
| 141 | |||
| 142 | 2012-08-27 Martin Rudalics <rudalics@gmx.at> | ||
| 143 | |||
| 144 | * window.c (Fset_window_configuration): Record any window's old | ||
| 145 | buffer if it's replaced (see Bug#8789). If the new current | ||
| 146 | buffer doesn't appear in the selected window, go to its old | ||
| 147 | point (Bug#12208). | ||
| 148 | |||
| 149 | 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 150 | |||
| 151 | Special MEM_TYPE_SPARE to denote reserved memory. | ||
| 152 | * alloc.c (enum mem_type): New memory type. | ||
| 153 | (refill_memory_reserve): Use new type for spare memory. | ||
| 154 | This prevents live_cons_p and live_string_p from incorrect | ||
| 155 | detection of uninitialized objects from spare memory as live. | ||
| 156 | |||
| 157 | 2012-08-26 Paul Eggert <eggert@cs.ucla.edu> | ||
| 158 | |||
| 159 | Spelling fixes. | ||
| 160 | * Makefile.in (.PHONY): versioclean -> versionclean. | ||
| 161 | |||
| 162 | Remove unused external symbols. | ||
| 163 | * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector): | ||
| 164 | * window.c (Qwindow_valid_p, decode_valid_window): | ||
| 165 | Now static, not extern. | ||
| 166 | * data.c (Qinterval): Remove; unused. | ||
| 167 | (syms_of_data): Do not define 'interval'. | ||
| 168 | * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons): | ||
| 169 | * window.h (decode_valid_window): | ||
| 170 | Remove decls. | ||
| 171 | |||
| 172 | * character.c, charset.c, chartab.c: Use bool for booleans. | ||
| 173 | * character.c (lisp_string_width, string_count_byte8) | ||
| 174 | (string_escape_byte8): | ||
| 175 | * charset.c (charset_map_loaded, load_charset_map, read_hex): | ||
| 176 | (load_charset_map_from_file, map_charset_chars) | ||
| 177 | (Fdefine_charset_internal, define_charset_internal) | ||
| 178 | (Fdeclare_equiv_charset, find_charsets_in_text) | ||
| 179 | (Ffind_charset_region, char_charset, Fiso_charset): | ||
| 180 | * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range) | ||
| 181 | (sub_char_table_set, sub_char_table_set_range) | ||
| 182 | (char_table_set_range, optimize_sub_char_table) | ||
| 183 | (map_sub_char_table): | ||
| 184 | Use bool for boolean. | ||
| 185 | * character.c (str_to_unibyte): Omit last boolean argument; it was | ||
| 186 | always 0. All callers changed. | ||
| 187 | * character.h, charset.h: Adjust to match previous changes. | ||
| 188 | * character.h (char_printable_p): Remove decl of nonexistent function. | ||
| 189 | * charset.h (struct charset): Members code_linear_p, iso_chars_96, | ||
| 190 | ascii_compatible_p, supplementary_p, compact_codes_p, unified_p | ||
| 191 | are all boolean, so make them single-bit bitfields. | ||
| 192 | |||
| 193 | * lisp.h (ASET): Remove attempt to detect side effects. | ||
| 194 | It was meant to be temporary and it often doesn't work, | ||
| 195 | because when IDX has side effects the behavior of IDX==IDX | ||
| 196 | is undefined. See Stefan Monnier in | ||
| 197 | <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>. | ||
| 198 | |||
| 199 | 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change) | ||
| 200 | |||
| 201 | * lisp.h (functionp): New function (extracted from Ffunctionp). | ||
| 202 | (FUNCTIONP): Use it. | ||
| 203 | * eval.c (Ffunctionp): Use it. | ||
| 204 | |||
| 205 | 2012-08-25 Paul Eggert <eggert@cs.ucla.edu> | ||
| 206 | |||
| 207 | * xgselect.c (xg_select): Use auto storage for the GPollFD buffer | ||
| 208 | as that's faster and simpler than static storage. Don't bother | ||
| 209 | with the g_main_context_query overhead if g_main_context_pending | ||
| 210 | says no events are pending. | ||
| 211 | (gfds, gfds_size): Remove these static vars. | ||
| 212 | (xgselect_initialize): Remove; no longer needed. | ||
| 213 | All uses and decls removed. | ||
| 214 | |||
| 215 | * emacs.c (fatal_error_signal_hook): Remove. | ||
| 216 | All uses removed. This leftover from old code was always 0. | ||
| 217 | |||
| 218 | * casefiddle.c, casetab.c, category.c: Use bool for boolean. | ||
| 219 | * casefiddle.c (casify_object, casify_region): | ||
| 220 | * casetab.c (set_case_table): | ||
| 221 | * category.c, category.h (word_boundary_p): | ||
| 222 | * category.h (CHAR_HAS_CATEGORY): | ||
| 223 | Use bool for booleans, instead of int. | ||
| 224 | |||
| 225 | 2012-08-25 Eli Zaretskii <eliz@gnu.org> | ||
| 226 | |||
| 227 | * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h. | ||
| 228 | |||
| 229 | 2012-08-25 Paul Eggert <eggert@cs.ucla.edu> | ||
| 230 | |||
| 231 | On assertion failure, print backtrace if available. | ||
| 232 | * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>. | ||
| 233 | (die) [ENABLE_CHECKING]: Print a backtrace if available. | ||
| 234 | * Makefile.in (LIB_EXECINFO): New macro. | ||
| 235 | (LIBES): Use it. | ||
| 236 | |||
| 237 | * bytecode.c, callint.c, callproc.c: Use bool for boolean. | ||
| 238 | * bytecode.c (exec_byte_code): | ||
| 239 | * callint.c (check_mark, Fcall_interactively): | ||
| 240 | * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1) | ||
| 241 | (getenv_internal, sync_process_alive, call_process_exited): | ||
| 242 | * lisp.h (USE_SAFE_ALLOCA): | ||
| 243 | Use bool for booleans, instead of int. | ||
| 244 | * lisp.h, process.h: Adjust prototypes to match above changes. | ||
| 245 | * callint.c (Fcall_interactively): Don't assume the mark's | ||
| 246 | offset fits in 'int'. | ||
| 247 | |||
| 248 | 2012-08-24 Paul Eggert <eggert@cs.ucla.edu> | ||
| 249 | |||
| 250 | * buffer.c, buffer.h: Use bool for boolean. | ||
| 251 | * buffer.c (reset_buffer_local_variables) | ||
| 252 | (buffer_lisp_local_variables, Fset_buffer_modified_p) | ||
| 253 | (Frestore_buffer_modified_p, Fset_buffer_multibyte): | ||
| 254 | (overlays_at, overlays_in, mouse_face_overlay_overlaps) | ||
| 255 | (overlay_touches_p, overlay_strings, Foverlay_put) | ||
| 256 | (report_overlay_modification, call_overlay_mod_hooks): | ||
| 257 | (mmap_enlarge, mmap_set_vars): | ||
| 258 | * buffer.h (buffer_has_overlays, uppercasep, lowercasep): | ||
| 259 | Use bool for booleans, instead of int. | ||
| 260 | * buffer.c (compact_buffer, mmap_free_1): Return void, not int, | ||
| 261 | since the 1-or-0 return value is always ignored anyway. | ||
| 262 | (mmap_initialized_p): | ||
| 263 | * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int. | ||
| 264 | * buffer.h, lisp.h: Adjust prototypes to match above changes. | ||
| 265 | |||
| 266 | 2012-08-23 Paul Eggert <eggert@cs.ucla.edu> | ||
| 267 | |||
| 268 | * bidi.c: Use bool for boolean. | ||
| 269 | This is a bit more readable, and makes the text segment of bidi.o | ||
| 270 | 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15). | ||
| 271 | Presumably it's faster too. | ||
| 272 | (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level): | ||
| 273 | Now bool. | ||
| 274 | (bidi_cache_find_level_change, bidi_cache_iterator_state) | ||
| 275 | (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes) | ||
| 276 | (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init) | ||
| 277 | (bidi_explicit_dir_char, bidi_level_of_next_char) | ||
| 278 | (bidi_find_other_level_edge, bidi_move_to_visually_next): | ||
| 279 | Use bool for booleans, instead of int. | ||
| 280 | * dispextern.h (bidi_init_it, bidi_paragraph_init) | ||
| 281 | (bidi_unshelve_cache): Adjust decls to match code. | ||
| 282 | |||
| 283 | 2012-08-23 Martin Rudalics <rudalics@gmx.at> | ||
| 284 | |||
| 285 | * keyboard.c (Fposn_at_x_y): Do not allow internal window as | ||
| 286 | argument. | ||
| 287 | |||
| 288 | 2012-08-23 Paul Eggert <eggert@cs.ucla.edu> | ||
| 289 | |||
| 290 | * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean. | ||
| 291 | * atimer.h: Include <stdbool.h>. | ||
| 292 | |||
| 293 | 2012-08-22 Dan Nicolaescu <dann@gnu.org> | ||
| 294 | |||
| 295 | * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to | ||
| 296 | compile time tests instead of run time tests on systems that do | ||
| 297 | not use them. | ||
| 298 | (FRAME_MAC_P): Remove leftover from deleted code. | ||
| 299 | * frame.c (syms_of_frame): Remove leftover from deleted code. | ||
| 300 | |||
| 301 | 2012-08-22 Jan Djärv <jan.h.d@swipnet.se> | ||
| 302 | |||
| 303 | * nsterm.m (insertText:): Don't clear modifiers if code is space. | ||
| 304 | |||
| 1 | 2012-08-22 Paul Eggert <eggert@cs.ucla.edu> | 305 | 2012-08-22 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 306 | ||
| 3 | * fontset.c (FONTSET_ADD): Return void, not Lisp_Object. | 307 | * fontset.c (FONTSET_ADD): Return void, not Lisp_Object. |
| @@ -60,8 +364,8 @@ | |||
| 60 | * w32uniscribe.c (uniscribe_shape): Fix producing gstring | 364 | * w32uniscribe.c (uniscribe_shape): Fix producing gstring |
| 61 | components for RTL text (Bug#11860). Adjust X-OFFSET of each | 365 | components for RTL text (Bug#11860). Adjust X-OFFSET of each |
| 62 | non-base glyph for the width of the base character, according to | 366 | non-base glyph for the width of the base character, according to |
| 63 | what x_draw_composite_glyph_string_foreground expects. Generate | 367 | what x_draw_composite_glyph_string_foreground expects. |
| 64 | WADJUST value according to composition_gstring_width's | 368 | Generate WADJUST value according to composition_gstring_width's |
| 65 | expectations, to produce correct width of the composed character. | 369 | expectations, to produce correct width of the composed character. |
| 66 | Reverse the sign of the DU offset produced by ScriptPlace. | 370 | Reverse the sign of the DU offset produced by ScriptPlace. |
| 67 | 371 | ||
diff --git a/src/Makefile.in b/src/Makefile.in index 1d89af31401..60df1f1c677 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -159,6 +159,8 @@ DBUS_LIBS = @DBUS_LIBS@ | |||
| 159 | ## dbusbind.o if HAVE_DBUS, else empty. | 159 | ## dbusbind.o if HAVE_DBUS, else empty. |
| 160 | DBUS_OBJ = @DBUS_OBJ@ | 160 | DBUS_OBJ = @DBUS_OBJ@ |
| 161 | 161 | ||
| 162 | LIB_EXECINFO=@LIB_EXECINFO@ | ||
| 163 | |||
| 162 | SETTINGS_CFLAGS = @SETTINGS_CFLAGS@ | 164 | SETTINGS_CFLAGS = @SETTINGS_CFLAGS@ |
| 163 | SETTINGS_LIBS = @SETTINGS_LIBS@ | 165 | SETTINGS_LIBS = @SETTINGS_LIBS@ |
| 164 | 166 | ||
| @@ -383,6 +385,7 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ | |||
| 383 | ## with GCC, we might need LIB_GCC again after them. | 385 | ## with GCC, we might need LIB_GCC again after them. |
| 384 | LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \ | 386 | LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \ |
| 385 | $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) \ | 387 | $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) \ |
| 388 | $(LIB_EXECINFO) \ | ||
| 386 | $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ | 389 | $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ |
| 387 | $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ | 390 | $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ |
| 388 | $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ | 391 | $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ |
| @@ -499,7 +502,7 @@ doc.o: buildobj.h | |||
| 499 | @ns_frag@ | 502 | @ns_frag@ |
| 500 | 503 | ||
| 501 | .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean | 504 | .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean |
| 502 | .PHONY: versioclean extraclean frc | 505 | .PHONY: versionclean extraclean frc |
| 503 | 506 | ||
| 504 | mostlyclean: | 507 | mostlyclean: |
| 505 | rm -f temacs$(EXEEXT) core *.core \#* *.o libXMenu11.a liblw.a | 508 | rm -f temacs$(EXEEXT) core *.core \#* *.o libXMenu11.a liblw.a |
diff --git a/src/alloc.c b/src/alloc.c index f0da9416ece..36ba22cc535 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -305,7 +305,9 @@ enum mem_type | |||
| 305 | and runtime slowdown. Minor but pointless. */ | 305 | and runtime slowdown. Minor but pointless. */ |
| 306 | MEM_TYPE_VECTORLIKE, | 306 | MEM_TYPE_VECTORLIKE, |
| 307 | /* Special type to denote vector blocks. */ | 307 | /* Special type to denote vector blocks. */ |
| 308 | MEM_TYPE_VECTOR_BLOCK | 308 | MEM_TYPE_VECTOR_BLOCK, |
| 309 | /* Special type to denote reserved memory. */ | ||
| 310 | MEM_TYPE_SPARE | ||
| 309 | }; | 311 | }; |
| 310 | 312 | ||
| 311 | static void *lisp_malloc (size_t, enum mem_type); | 313 | static void *lisp_malloc (size_t, enum mem_type); |
| @@ -3816,22 +3818,22 @@ refill_memory_reserve (void) | |||
| 3816 | spare_memory[0] = malloc (SPARE_MEMORY); | 3818 | spare_memory[0] = malloc (SPARE_MEMORY); |
| 3817 | if (spare_memory[1] == 0) | 3819 | if (spare_memory[1] == 0) |
| 3818 | spare_memory[1] = lisp_align_malloc (sizeof (struct cons_block), | 3820 | spare_memory[1] = lisp_align_malloc (sizeof (struct cons_block), |
| 3819 | MEM_TYPE_CONS); | 3821 | MEM_TYPE_SPARE); |
| 3820 | if (spare_memory[2] == 0) | 3822 | if (spare_memory[2] == 0) |
| 3821 | spare_memory[2] = lisp_align_malloc (sizeof (struct cons_block), | 3823 | spare_memory[2] = lisp_align_malloc (sizeof (struct cons_block), |
| 3822 | MEM_TYPE_CONS); | 3824 | MEM_TYPE_SPARE); |
| 3823 | if (spare_memory[3] == 0) | 3825 | if (spare_memory[3] == 0) |
| 3824 | spare_memory[3] = lisp_align_malloc (sizeof (struct cons_block), | 3826 | spare_memory[3] = lisp_align_malloc (sizeof (struct cons_block), |
| 3825 | MEM_TYPE_CONS); | 3827 | MEM_TYPE_SPARE); |
| 3826 | if (spare_memory[4] == 0) | 3828 | if (spare_memory[4] == 0) |
| 3827 | spare_memory[4] = lisp_align_malloc (sizeof (struct cons_block), | 3829 | spare_memory[4] = lisp_align_malloc (sizeof (struct cons_block), |
| 3828 | MEM_TYPE_CONS); | 3830 | MEM_TYPE_SPARE); |
| 3829 | if (spare_memory[5] == 0) | 3831 | if (spare_memory[5] == 0) |
| 3830 | spare_memory[5] = lisp_malloc (sizeof (struct string_block), | 3832 | spare_memory[5] = lisp_malloc (sizeof (struct string_block), |
| 3831 | MEM_TYPE_STRING); | 3833 | MEM_TYPE_SPARE); |
| 3832 | if (spare_memory[6] == 0) | 3834 | if (spare_memory[6] == 0) |
| 3833 | spare_memory[6] = lisp_malloc (sizeof (struct string_block), | 3835 | spare_memory[6] = lisp_malloc (sizeof (struct string_block), |
| 3834 | MEM_TYPE_STRING); | 3836 | MEM_TYPE_SPARE); |
| 3835 | if (spare_memory[0] && spare_memory[1] && spare_memory[5]) | 3837 | if (spare_memory[0] && spare_memory[1] && spare_memory[5]) |
| 3836 | Vmemory_full = Qnil; | 3838 | Vmemory_full = Qnil; |
| 3837 | #endif | 3839 | #endif |
| @@ -4561,6 +4563,7 @@ mark_maybe_pointer (void *p) | |||
| 4561 | switch (m->type) | 4563 | switch (m->type) |
| 4562 | { | 4564 | { |
| 4563 | case MEM_TYPE_NON_LISP: | 4565 | case MEM_TYPE_NON_LISP: |
| 4566 | case MEM_TYPE_SPARE: | ||
| 4564 | /* Nothing to do; not a pointer to Lisp memory. */ | 4567 | /* Nothing to do; not a pointer to Lisp memory. */ |
| 4565 | break; | 4568 | break; |
| 4566 | 4569 | ||
| @@ -5017,6 +5020,7 @@ valid_lisp_object_p (Lisp_Object obj) | |||
| 5017 | switch (m->type) | 5020 | switch (m->type) |
| 5018 | { | 5021 | { |
| 5019 | case MEM_TYPE_NON_LISP: | 5022 | case MEM_TYPE_NON_LISP: |
| 5023 | case MEM_TYPE_SPARE: | ||
| 5020 | return 0; | 5024 | return 0; |
| 5021 | 5025 | ||
| 5022 | case MEM_TYPE_BUFFER: | 5026 | case MEM_TYPE_BUFFER: |
| @@ -6681,13 +6685,21 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max) | |||
| 6681 | } | 6685 | } |
| 6682 | 6686 | ||
| 6683 | #ifdef ENABLE_CHECKING | 6687 | #ifdef ENABLE_CHECKING |
| 6688 | |||
| 6689 | # include <execinfo.h> | ||
| 6690 | |||
| 6684 | bool suppress_checking; | 6691 | bool suppress_checking; |
| 6685 | 6692 | ||
| 6686 | void | 6693 | void |
| 6687 | die (const char *msg, const char *file, int line) | 6694 | die (const char *msg, const char *file, int line) |
| 6688 | { | 6695 | { |
| 6696 | enum { NPOINTERS_MAX = 500 }; | ||
| 6697 | void *buffer[NPOINTERS_MAX]; | ||
| 6698 | int npointers; | ||
| 6689 | fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", | 6699 | fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", |
| 6690 | file, line, msg); | 6700 | file, line, msg); |
| 6701 | npointers = backtrace (buffer, NPOINTERS_MAX); | ||
| 6702 | backtrace_symbols_fd (buffer, npointers, STDERR_FILENO); | ||
| 6691 | abort (); | 6703 | abort (); |
| 6692 | } | 6704 | } |
| 6693 | #endif | 6705 | #endif |
diff --git a/src/atimer.c b/src/atimer.c index d67e1375f9a..eb3136ae55d 100644 --- a/src/atimer.c +++ b/src/atimer.c | |||
| @@ -408,7 +408,7 @@ do_pending_atimers (void) | |||
| 408 | some systems like HPUX (see process.c). */ | 408 | some systems like HPUX (see process.c). */ |
| 409 | 409 | ||
| 410 | void | 410 | void |
| 411 | turn_on_atimers (int on) | 411 | turn_on_atimers (bool on) |
| 412 | { | 412 | { |
| 413 | if (on) | 413 | if (on) |
| 414 | { | 414 | { |
diff --git a/src/atimer.h b/src/atimer.h index 4282bab49ba..6d441d71641 100644 --- a/src/atimer.h +++ b/src/atimer.h | |||
| @@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 20 | #define EMACS_ATIMER_H | 20 | #define EMACS_ATIMER_H |
| 21 | 21 | ||
| 22 | #include "systime.h" /* for EMACS_TIME */ | 22 | #include "systime.h" /* for EMACS_TIME */ |
| 23 | #include <stdbool.h> | ||
| 23 | 24 | ||
| 24 | /* Forward declaration. */ | 25 | /* Forward declaration. */ |
| 25 | 26 | ||
| @@ -74,7 +75,7 @@ struct atimer *start_atimer (enum atimer_type, EMACS_TIME, | |||
| 74 | void cancel_atimer (struct atimer *); | 75 | void cancel_atimer (struct atimer *); |
| 75 | void do_pending_atimers (void); | 76 | void do_pending_atimers (void); |
| 76 | void init_atimer (void); | 77 | void init_atimer (void); |
| 77 | void turn_on_atimers (int); | 78 | void turn_on_atimers (bool); |
| 78 | void stop_other_atimers (struct atimer *); | 79 | void stop_other_atimers (struct atimer *); |
| 79 | Lisp_Object unwind_stop_other_atimers (Lisp_Object); | 80 | Lisp_Object unwind_stop_other_atimers (Lisp_Object); |
| 80 | 81 | ||
diff --git a/src/bidi.c b/src/bidi.c index 4df585d4f48..6b3ac53d318 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -63,7 +63,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 63 | #include "buffer.h" | 63 | #include "buffer.h" |
| 64 | #include "dispextern.h" | 64 | #include "dispextern.h" |
| 65 | 65 | ||
| 66 | static int bidi_initialized = 0; | 66 | static bool bidi_initialized = 0; |
| 67 | 67 | ||
| 68 | static Lisp_Object bidi_type_table, bidi_mirror_table; | 68 | static Lisp_Object bidi_type_table, bidi_mirror_table; |
| 69 | 69 | ||
| @@ -82,10 +82,10 @@ typedef enum { | |||
| 82 | /* UAX#9 says to search only for L, AL, or R types of characters, and | 82 | /* UAX#9 says to search only for L, AL, or R types of characters, and |
| 83 | ignore RLE, RLO, LRE, and LRO, when determining the base paragraph | 83 | ignore RLE, RLO, LRE, and LRO, when determining the base paragraph |
| 84 | level. Yudit indeed ignores them. This variable is therefore set | 84 | level. Yudit indeed ignores them. This variable is therefore set |
| 85 | by default to ignore them, but setting it to zero will take them | 85 | by default to ignore them, but clearing it will take them into |
| 86 | into account. */ | 86 | account. */ |
| 87 | extern int bidi_ignore_explicit_marks_for_paragraph_level EXTERNALLY_VISIBLE; | 87 | extern bool bidi_ignore_explicit_marks_for_paragraph_level EXTERNALLY_VISIBLE; |
| 88 | int bidi_ignore_explicit_marks_for_paragraph_level = 1; | 88 | bool bidi_ignore_explicit_marks_for_paragraph_level = 1; |
| 89 | 89 | ||
| 90 | static Lisp_Object paragraph_start_re, paragraph_separate_re; | 90 | static Lisp_Object paragraph_start_re, paragraph_separate_re; |
| 91 | static Lisp_Object Qparagraph_start, Qparagraph_separate; | 91 | static Lisp_Object Qparagraph_start, Qparagraph_separate; |
| @@ -438,7 +438,7 @@ bidi_cache_search (ptrdiff_t charpos, int level, int dir) | |||
| 438 | that is lower than LEVEL, and return its cache slot index. DIR is | 438 | that is lower than LEVEL, and return its cache slot index. DIR is |
| 439 | the direction to search, starting with the last used cache slot. | 439 | the direction to search, starting with the last used cache slot. |
| 440 | If DIR is zero, we search backwards from the last occupied cache | 440 | If DIR is zero, we search backwards from the last occupied cache |
| 441 | slot. BEFORE, if non-zero, means return the index of the slot that | 441 | slot. BEFORE means return the index of the slot that |
| 442 | is ``before'' the level change in the search direction. That is, | 442 | is ``before'' the level change in the search direction. That is, |
| 443 | given the cached levels like this: | 443 | given the cached levels like this: |
| 444 | 444 | ||
| @@ -448,9 +448,9 @@ bidi_cache_search (ptrdiff_t charpos, int level, int dir) | |||
| 448 | and assuming we are at the position cached at the slot marked with | 448 | and assuming we are at the position cached at the slot marked with |
| 449 | C, searching backwards (DIR = -1) for LEVEL = 2 will return the | 449 | C, searching backwards (DIR = -1) for LEVEL = 2 will return the |
| 450 | index of slot B or A, depending whether BEFORE is, respectively, | 450 | index of slot B or A, depending whether BEFORE is, respectively, |
| 451 | non-zero or zero. */ | 451 | true or false. */ |
| 452 | static ptrdiff_t | 452 | static ptrdiff_t |
| 453 | bidi_cache_find_level_change (int level, int dir, int before) | 453 | bidi_cache_find_level_change (int level, int dir, bool before) |
| 454 | { | 454 | { |
| 455 | if (bidi_cache_idx) | 455 | if (bidi_cache_idx) |
| 456 | { | 456 | { |
| @@ -512,7 +512,7 @@ bidi_cache_ensure_space (ptrdiff_t idx) | |||
| 512 | } | 512 | } |
| 513 | 513 | ||
| 514 | static inline void | 514 | static inline void |
| 515 | bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) | 515 | bidi_cache_iterator_state (struct bidi_it *bidi_it, bool resolved) |
| 516 | { | 516 | { |
| 517 | ptrdiff_t idx; | 517 | ptrdiff_t idx; |
| 518 | 518 | ||
| @@ -690,11 +690,11 @@ bidi_shelve_cache (void) | |||
| 690 | 690 | ||
| 691 | /* Restore the cache state from a copy stashed away by | 691 | /* Restore the cache state from a copy stashed away by |
| 692 | bidi_shelve_cache, and free the buffer used to stash that copy. | 692 | bidi_shelve_cache, and free the buffer used to stash that copy. |
| 693 | JUST_FREE non-zero means free the buffer, but don't restore the | 693 | JUST_FREE means free the buffer, but don't restore the |
| 694 | cache; used when the corresponding iterator is discarded instead of | 694 | cache; used when the corresponding iterator is discarded instead of |
| 695 | being restored. */ | 695 | being restored. */ |
| 696 | void | 696 | void |
| 697 | bidi_unshelve_cache (void *databuf, int just_free) | 697 | bidi_unshelve_cache (void *databuf, bool just_free) |
| 698 | { | 698 | { |
| 699 | unsigned char *p = databuf; | 699 | unsigned char *p = databuf; |
| 700 | 700 | ||
| @@ -802,7 +802,7 @@ bidi_set_paragraph_end (struct bidi_it *bidi_it) | |||
| 802 | 802 | ||
| 803 | /* Initialize the bidi iterator from buffer/string position CHARPOS. */ | 803 | /* Initialize the bidi iterator from buffer/string position CHARPOS. */ |
| 804 | void | 804 | void |
| 805 | bidi_init_it (ptrdiff_t charpos, ptrdiff_t bytepos, int frame_window_p, | 805 | bidi_init_it (ptrdiff_t charpos, ptrdiff_t bytepos, bool frame_window_p, |
| 806 | struct bidi_it *bidi_it) | 806 | struct bidi_it *bidi_it) |
| 807 | { | 807 | { |
| 808 | if (! bidi_initialized) | 808 | if (! bidi_initialized) |
| @@ -872,11 +872,10 @@ bidi_line_init (struct bidi_it *bidi_it) | |||
| 872 | 872 | ||
| 873 | /* Count bytes in string S between BEG/BEGBYTE and END. BEG and END | 873 | /* Count bytes in string S between BEG/BEGBYTE and END. BEG and END |
| 874 | are zero-based character positions in S, BEGBYTE is byte position | 874 | are zero-based character positions in S, BEGBYTE is byte position |
| 875 | corresponding to BEG. UNIBYTE, if non-zero, means S is a unibyte | 875 | corresponding to BEG. UNIBYTE means S is a unibyte string. */ |
| 876 | string. */ | ||
| 877 | static inline ptrdiff_t | 876 | static inline ptrdiff_t |
| 878 | bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg, | 877 | bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg, |
| 879 | const ptrdiff_t begbyte, const ptrdiff_t end, int unibyte) | 878 | const ptrdiff_t begbyte, const ptrdiff_t end, bool unibyte) |
| 880 | { | 879 | { |
| 881 | ptrdiff_t pos = beg; | 880 | ptrdiff_t pos = beg; |
| 882 | const unsigned char *p = s + begbyte, *start = p; | 881 | const unsigned char *p = s + begbyte, *start = p; |
| @@ -900,10 +899,10 @@ bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg, | |||
| 900 | 899 | ||
| 901 | /* Fetch and returns the character at byte position BYTEPOS. If S is | 900 | /* Fetch and returns the character at byte position BYTEPOS. If S is |
| 902 | non-NULL, fetch the character from string S; otherwise fetch the | 901 | non-NULL, fetch the character from string S; otherwise fetch the |
| 903 | character from the current buffer. UNIBYTE non-zero means S is a | 902 | character from the current buffer. UNIBYTE means S is a |
| 904 | unibyte string. */ | 903 | unibyte string. */ |
| 905 | static inline int | 904 | static inline int |
| 906 | bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, int unibyte) | 905 | bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, bool unibyte) |
| 907 | { | 906 | { |
| 908 | if (s) | 907 | if (s) |
| 909 | { | 908 | { |
| @@ -923,9 +922,9 @@ bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, int unibyte) | |||
| 923 | specifies the character position of the next display string, or -1 | 922 | specifies the character position of the next display string, or -1 |
| 924 | if not yet computed. When the next character is at or beyond that | 923 | if not yet computed. When the next character is at or beyond that |
| 925 | position, the function updates DISP_POS with the position of the | 924 | position, the function updates DISP_POS with the position of the |
| 926 | next display string. DISP_PROP non-zero means that there's really | 925 | next display string. *DISP_PROP non-zero means that there's really |
| 927 | a display string at DISP_POS, as opposed to when we searched till | 926 | a display string at DISP_POS, as opposed to when we searched till |
| 928 | DISP_POS without finding one. If DISP_PROP is 2, it means the | 927 | DISP_POS without finding one. If *DISP_PROP is 2, it means the |
| 929 | display spec is of the form `(space ...)', which is replaced with | 928 | display spec is of the form `(space ...)', which is replaced with |
| 930 | u+2029 to handle it as a paragraph separator. STRING->s is the C | 929 | u+2029 to handle it as a paragraph separator. STRING->s is the C |
| 931 | string to iterate, or NULL if iterating over a buffer or a Lisp | 930 | string to iterate, or NULL if iterating over a buffer or a Lisp |
| @@ -933,7 +932,7 @@ bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, int unibyte) | |||
| 933 | static inline int | 932 | static inline int |
| 934 | bidi_fetch_char (ptrdiff_t bytepos, ptrdiff_t charpos, ptrdiff_t *disp_pos, | 933 | bidi_fetch_char (ptrdiff_t bytepos, ptrdiff_t charpos, ptrdiff_t *disp_pos, |
| 935 | int *disp_prop, struct bidi_string_data *string, | 934 | int *disp_prop, struct bidi_string_data *string, |
| 936 | int frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars) | 935 | bool frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars) |
| 937 | { | 936 | { |
| 938 | int ch; | 937 | int ch; |
| 939 | ptrdiff_t endpos | 938 | ptrdiff_t endpos |
| @@ -1134,7 +1133,7 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte) | |||
| 1134 | R2L, just use that. Otherwise, determine the paragraph direction | 1133 | R2L, just use that. Otherwise, determine the paragraph direction |
| 1135 | from the first strong directional character of the paragraph. | 1134 | from the first strong directional character of the paragraph. |
| 1136 | 1135 | ||
| 1137 | NO_DEFAULT_P non-zero means don't default to L2R if the paragraph | 1136 | NO_DEFAULT_P means don't default to L2R if the paragraph |
| 1138 | has no strong directional characters and both DIR and | 1137 | has no strong directional characters and both DIR and |
| 1139 | bidi_it->paragraph_dir are NEUTRAL_DIR. In that case, search back | 1138 | bidi_it->paragraph_dir are NEUTRAL_DIR. In that case, search back |
| 1140 | in the buffer until a paragraph is found with a strong character, | 1139 | in the buffer until a paragraph is found with a strong character, |
| @@ -1145,10 +1144,10 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte) | |||
| 1145 | direction as the preceding paragraph, even though Emacs generally | 1144 | direction as the preceding paragraph, even though Emacs generally |
| 1146 | views the separator as not belonging to any paragraph. */ | 1145 | views the separator as not belonging to any paragraph. */ |
| 1147 | void | 1146 | void |
| 1148 | bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p) | 1147 | bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, bool no_default_p) |
| 1149 | { | 1148 | { |
| 1150 | ptrdiff_t bytepos = bidi_it->bytepos; | 1149 | ptrdiff_t bytepos = bidi_it->bytepos; |
| 1151 | int string_p = bidi_it->string.s != NULL || STRINGP (bidi_it->string.lstring); | 1150 | bool string_p = bidi_it->string.s || STRINGP (bidi_it->string.lstring); |
| 1152 | ptrdiff_t pstartbyte; | 1151 | ptrdiff_t pstartbyte; |
| 1153 | /* Note that begbyte is a byte position, while end is a character | 1152 | /* Note that begbyte is a byte position, while end is a character |
| 1154 | position. Yes, this is ugly, but we are trying to avoid costly | 1153 | position. Yes, this is ugly, but we are trying to avoid costly |
| @@ -1221,8 +1220,8 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p) | |||
| 1221 | bidi_it->separator_limit = -1; | 1220 | bidi_it->separator_limit = -1; |
| 1222 | bidi_it->new_paragraph = 0; | 1221 | bidi_it->new_paragraph = 0; |
| 1223 | 1222 | ||
| 1224 | /* The following loop is run more than once only if NO_DEFAULT_P | 1223 | /* The following loop is run more than once only if NO_DEFAULT_P, |
| 1225 | is non-zero, and only if we are iterating on a buffer. */ | 1224 | and only if we are iterating on a buffer. */ |
| 1226 | do { | 1225 | do { |
| 1227 | ptrdiff_t pos1; | 1226 | ptrdiff_t pos1; |
| 1228 | 1227 | ||
| @@ -1320,7 +1319,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p) | |||
| 1320 | The rest of this file constitutes the core of the UBA implementation. | 1319 | The rest of this file constitutes the core of the UBA implementation. |
| 1321 | ***********************************************************************/ | 1320 | ***********************************************************************/ |
| 1322 | 1321 | ||
| 1323 | static inline int | 1322 | static inline bool |
| 1324 | bidi_explicit_dir_char (int ch) | 1323 | bidi_explicit_dir_char (int ch) |
| 1325 | { | 1324 | { |
| 1326 | bidi_type_t ch_type; | 1325 | bidi_type_t ch_type; |
| @@ -1345,7 +1344,7 @@ bidi_resolve_explicit_1 (struct bidi_it *bidi_it) | |||
| 1345 | int current_level; | 1344 | int current_level; |
| 1346 | int new_level; | 1345 | int new_level; |
| 1347 | bidi_dir_t override; | 1346 | bidi_dir_t override; |
| 1348 | int string_p = bidi_it->string.s != NULL || STRINGP (bidi_it->string.lstring); | 1347 | bool string_p = bidi_it->string.s || STRINGP (bidi_it->string.lstring); |
| 1349 | 1348 | ||
| 1350 | /* If reseat()'ed, don't advance, so as to start iteration from the | 1349 | /* If reseat()'ed, don't advance, so as to start iteration from the |
| 1351 | position where we were reseated. bidi_it->bytepos can be less | 1350 | position where we were reseated. bidi_it->bytepos can be less |
| @@ -2189,7 +2188,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) | |||
| 2189 | ptrdiff_t nc = bidi_it->nchars; | 2188 | ptrdiff_t nc = bidi_it->nchars; |
| 2190 | struct bidi_string_data bs = bidi_it->string; | 2189 | struct bidi_string_data bs = bidi_it->string; |
| 2191 | bidi_type_t chtype; | 2190 | bidi_type_t chtype; |
| 2192 | int fwp = bidi_it->frame_window_p; | 2191 | bool fwp = bidi_it->frame_window_p; |
| 2193 | int dpp = bidi_it->disp_prop; | 2192 | int dpp = bidi_it->disp_prop; |
| 2194 | 2193 | ||
| 2195 | if (bidi_it->nchars <= 0) | 2194 | if (bidi_it->nchars <= 0) |
| @@ -2268,8 +2267,8 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) | |||
| 2268 | return level; | 2267 | return level; |
| 2269 | } | 2268 | } |
| 2270 | 2269 | ||
| 2271 | /* Move to the other edge of a level given by LEVEL. If END_FLAG is | 2270 | /* Move to the other edge of a level given by LEVEL. If END_FLAG, |
| 2272 | non-zero, we are at the end of a level, and we need to prepare to | 2271 | we are at the end of a level, and we need to prepare to |
| 2273 | resume the scan of the lower level. | 2272 | resume the scan of the lower level. |
| 2274 | 2273 | ||
| 2275 | If this level's other edge is cached, we simply jump to it, filling | 2274 | If this level's other edge is cached, we simply jump to it, filling |
| @@ -2289,7 +2288,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) | |||
| 2289 | function moves to point C, whereas the UAX#9 ``level 2 run'' ends | 2288 | function moves to point C, whereas the UAX#9 ``level 2 run'' ends |
| 2290 | at point B. */ | 2289 | at point B. */ |
| 2291 | static void | 2290 | static void |
| 2292 | bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, int end_flag) | 2291 | bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, bool end_flag) |
| 2293 | { | 2292 | { |
| 2294 | int dir = end_flag ? -bidi_it->scan_dir : bidi_it->scan_dir; | 2293 | int dir = end_flag ? -bidi_it->scan_dir : bidi_it->scan_dir; |
| 2295 | ptrdiff_t idx; | 2294 | ptrdiff_t idx; |
| @@ -2363,7 +2362,7 @@ bidi_move_to_visually_next (struct bidi_it *bidi_it) | |||
| 2363 | scanning the text whenever we find a level change. */ | 2362 | scanning the text whenever we find a level change. */ |
| 2364 | if (new_level != old_level) | 2363 | if (new_level != old_level) |
| 2365 | { | 2364 | { |
| 2366 | int ascending = new_level > old_level; | 2365 | bool ascending = new_level > old_level; |
| 2367 | int level_to_search = ascending ? old_level + 1 : old_level; | 2366 | int level_to_search = ascending ? old_level + 1 : old_level; |
| 2368 | int incr = ascending ? 1 : -1; | 2367 | int incr = ascending ? 1 : -1; |
| 2369 | int expected_next_level = old_level + incr; | 2368 | int expected_next_level = old_level + incr; |
diff --git a/src/buffer.c b/src/buffer.c index c900ef8c5a8..0e2e50d9f51 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -110,10 +110,10 @@ static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS]; | |||
| 110 | int last_per_buffer_idx; | 110 | int last_per_buffer_idx; |
| 111 | 111 | ||
| 112 | static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, | 112 | static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, |
| 113 | int after, Lisp_Object arg1, | 113 | bool after, Lisp_Object arg1, |
| 114 | Lisp_Object arg2, Lisp_Object arg3); | 114 | Lisp_Object arg2, Lisp_Object arg3); |
| 115 | static void swap_out_buffer_local_variables (struct buffer *b); | 115 | static void swap_out_buffer_local_variables (struct buffer *b); |
| 116 | static void reset_buffer_local_variables (struct buffer *b, int permanent_too); | 116 | static void reset_buffer_local_variables (struct buffer *, bool); |
| 117 | 117 | ||
| 118 | /* Alist of all buffer names vs the buffers. */ | 118 | /* Alist of all buffer names vs the buffers. */ |
| 119 | /* This used to be a variable, but is no longer, | 119 | /* This used to be a variable, but is no longer, |
| @@ -155,7 +155,7 @@ static void alloc_buffer_text (struct buffer *, ptrdiff_t); | |||
| 155 | static void free_buffer_text (struct buffer *b); | 155 | static void free_buffer_text (struct buffer *b); |
| 156 | static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *); | 156 | static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *); |
| 157 | static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t); | 157 | static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t); |
| 158 | static Lisp_Object buffer_lisp_local_variables (struct buffer *, int); | 158 | static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool); |
| 159 | 159 | ||
| 160 | /* These setters are used only in this file, so they can be private. */ | 160 | /* These setters are used only in this file, so they can be private. */ |
| 161 | static inline void | 161 | static inline void |
| @@ -979,15 +979,13 @@ reset_buffer (register struct buffer *b) | |||
| 979 | it does not treat permanent locals consistently. | 979 | it does not treat permanent locals consistently. |
| 980 | Instead, use Fkill_all_local_variables. | 980 | Instead, use Fkill_all_local_variables. |
| 981 | 981 | ||
| 982 | If PERMANENT_TOO is 1, then we reset permanent | 982 | If PERMANENT_TOO, reset permanent buffer-local variables. |
| 983 | buffer-local variables. If PERMANENT_TOO is 0, | 983 | If not, preserve those. */ |
| 984 | we preserve those. */ | ||
| 985 | 984 | ||
| 986 | static void | 985 | static void |
| 987 | reset_buffer_local_variables (register struct buffer *b, int permanent_too) | 986 | reset_buffer_local_variables (struct buffer *b, bool permanent_too) |
| 988 | { | 987 | { |
| 989 | register int offset; | 988 | int offset, i; |
| 990 | int i; | ||
| 991 | 989 | ||
| 992 | /* Reset the major mode to Fundamental, together with all the | 990 | /* Reset the major mode to Fundamental, together with all the |
| 993 | things that depend on the major mode. | 991 | things that depend on the major mode. |
| @@ -1253,14 +1251,14 @@ buffer_local_value_1 (Lisp_Object variable, Lisp_Object buffer) | |||
| 1253 | /* Return an alist of the Lisp-level buffer-local bindings of | 1251 | /* Return an alist of the Lisp-level buffer-local bindings of |
| 1254 | buffer BUF. That is, don't include the variables maintained | 1252 | buffer BUF. That is, don't include the variables maintained |
| 1255 | in special slots in the buffer object. | 1253 | in special slots in the buffer object. |
| 1256 | If CLONE is zero elements of the form (VAR . unbound) are replaced | 1254 | If not CLONE, replace elements of the form (VAR . unbound) |
| 1257 | by VAR. */ | 1255 | by VAR. */ |
| 1258 | 1256 | ||
| 1259 | static Lisp_Object | 1257 | static Lisp_Object |
| 1260 | buffer_lisp_local_variables (struct buffer *buf, int clone) | 1258 | buffer_lisp_local_variables (struct buffer *buf, bool clone) |
| 1261 | { | 1259 | { |
| 1262 | Lisp_Object result = Qnil; | 1260 | Lisp_Object result = Qnil; |
| 1263 | register Lisp_Object tail; | 1261 | Lisp_Object tail; |
| 1264 | for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) | 1262 | for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) |
| 1265 | { | 1263 | { |
| 1266 | Lisp_Object val, elt; | 1264 | Lisp_Object val, elt; |
| @@ -1351,11 +1349,9 @@ DEFUN ("set-buffer-modified-p", Fset_buffer_modified_p, Sset_buffer_modified_p, | |||
| 1351 | 1, 1, 0, | 1349 | 1, 1, 0, |
| 1352 | doc: /* Mark current buffer as modified or unmodified according to FLAG. | 1350 | doc: /* Mark current buffer as modified or unmodified according to FLAG. |
| 1353 | A non-nil FLAG means mark the buffer modified. */) | 1351 | A non-nil FLAG means mark the buffer modified. */) |
| 1354 | (register Lisp_Object flag) | 1352 | (Lisp_Object flag) |
| 1355 | { | 1353 | { |
| 1356 | register int already; | 1354 | Lisp_Object fn, buffer, window; |
| 1357 | register Lisp_Object fn; | ||
| 1358 | Lisp_Object buffer, window; | ||
| 1359 | 1355 | ||
| 1360 | #ifdef CLASH_DETECTION | 1356 | #ifdef CLASH_DETECTION |
| 1361 | /* If buffer becoming modified, lock the file. | 1357 | /* If buffer becoming modified, lock the file. |
| @@ -1365,7 +1361,7 @@ A non-nil FLAG means mark the buffer modified. */) | |||
| 1365 | /* Test buffer-file-name so that binding it to nil is effective. */ | 1361 | /* Test buffer-file-name so that binding it to nil is effective. */ |
| 1366 | if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename))) | 1362 | if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename))) |
| 1367 | { | 1363 | { |
| 1368 | already = SAVE_MODIFF < MODIFF; | 1364 | bool already = SAVE_MODIFF < MODIFF; |
| 1369 | if (!already && !NILP (flag)) | 1365 | if (!already && !NILP (flag)) |
| 1370 | lock_file (fn); | 1366 | lock_file (fn); |
| 1371 | else if (already && NILP (flag)) | 1367 | else if (already && NILP (flag)) |
| @@ -1432,7 +1428,7 @@ state of the current buffer. Use with care. */) | |||
| 1432 | /* Test buffer-file-name so that binding it to nil is effective. */ | 1428 | /* Test buffer-file-name so that binding it to nil is effective. */ |
| 1433 | if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename))) | 1429 | if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename))) |
| 1434 | { | 1430 | { |
| 1435 | int already = SAVE_MODIFF < MODIFF; | 1431 | bool already = SAVE_MODIFF < MODIFF; |
| 1436 | if (!already && !NILP (flag)) | 1432 | if (!already && !NILP (flag)) |
| 1437 | lock_file (fn); | 1433 | lock_file (fn); |
| 1438 | else if (already && NILP (flag)) | 1434 | else if (already && NILP (flag)) |
| @@ -1557,7 +1553,6 @@ list first, followed by the list of all buffers. If no other buffer | |||
| 1557 | exists, return the buffer `*scratch*' (creating it if necessary). */) | 1553 | exists, return the buffer `*scratch*' (creating it if necessary). */) |
| 1558 | (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) | 1554 | (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) |
| 1559 | { | 1555 | { |
| 1560 | Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer); | ||
| 1561 | Lisp_Object tail, buf, pred; | 1556 | Lisp_Object tail, buf, pred; |
| 1562 | Lisp_Object notsogood = Qnil; | 1557 | Lisp_Object notsogood = Qnil; |
| 1563 | 1558 | ||
| @@ -1628,7 +1623,6 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) | |||
| 1628 | Lisp_Object | 1623 | Lisp_Object |
| 1629 | other_buffer_safely (Lisp_Object buffer) | 1624 | other_buffer_safely (Lisp_Object buffer) |
| 1630 | { | 1625 | { |
| 1631 | Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer); | ||
| 1632 | Lisp_Object tail, buf; | 1626 | Lisp_Object tail, buf; |
| 1633 | 1627 | ||
| 1634 | tail = Vbuffer_alist; | 1628 | tail = Vbuffer_alist; |
| @@ -1676,7 +1670,7 @@ No argument or nil as argument means do this for the current buffer. */) | |||
| 1676 | 1670 | ||
| 1677 | /* Truncate undo list and shrink the gap of BUFFER. */ | 1671 | /* Truncate undo list and shrink the gap of BUFFER. */ |
| 1678 | 1672 | ||
| 1679 | int | 1673 | void |
| 1680 | compact_buffer (struct buffer *buffer) | 1674 | compact_buffer (struct buffer *buffer) |
| 1681 | { | 1675 | { |
| 1682 | /* Verify indirection counters. */ | 1676 | /* Verify indirection counters. */ |
| @@ -1718,9 +1712,7 @@ compact_buffer (struct buffer *buffer) | |||
| 1718 | } | 1712 | } |
| 1719 | } | 1713 | } |
| 1720 | buffer->text->compact = buffer->text->modiff; | 1714 | buffer->text->compact = buffer->text->modiff; |
| 1721 | return 1; | ||
| 1722 | } | 1715 | } |
| 1723 | return 0; | ||
| 1724 | } | 1716 | } |
| 1725 | 1717 | ||
| 1726 | DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ", | 1718 | DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ", |
| @@ -2070,8 +2062,10 @@ the current buffer's major mode. */) | |||
| 2070 | 2062 | ||
| 2071 | CHECK_BUFFER (buffer); | 2063 | CHECK_BUFFER (buffer); |
| 2072 | 2064 | ||
| 2073 | if (STRINGP (BVAR (XBUFFER (buffer), name)) | 2065 | if (NILP (BVAR (XBUFFER (buffer), name))) |
| 2074 | && strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) | 2066 | error ("Attempt to set major mode for a dead buffer"); |
| 2067 | |||
| 2068 | if (strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) | ||
| 2075 | function = find_symbol_value (intern ("initial-major-mode")); | 2069 | function = find_symbol_value (intern ("initial-major-mode")); |
| 2076 | else | 2070 | else |
| 2077 | { | 2071 | { |
| @@ -2105,22 +2099,6 @@ DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0, | |||
| 2105 | XSETBUFFER (buf, current_buffer); | 2099 | XSETBUFFER (buf, current_buffer); |
| 2106 | return buf; | 2100 | return buf; |
| 2107 | } | 2101 | } |
| 2108 | |||
| 2109 | /* Set the current buffer to B. | ||
| 2110 | |||
| 2111 | We previously set windows_or_buffers_changed here to invalidate | ||
| 2112 | global unchanged information in beg_unchanged and end_unchanged. | ||
| 2113 | This is no longer necessary because we now compute unchanged | ||
| 2114 | information on a buffer-basis. Every action affecting other | ||
| 2115 | windows than the selected one requires a select_window at some | ||
| 2116 | time, and that increments windows_or_buffers_changed. */ | ||
| 2117 | |||
| 2118 | void | ||
| 2119 | set_buffer_internal (register struct buffer *b) | ||
| 2120 | { | ||
| 2121 | if (current_buffer != b) | ||
| 2122 | set_buffer_internal_1 (b); | ||
| 2123 | } | ||
| 2124 | 2102 | ||
| 2125 | /* Set the current buffer to B, and do not set windows_or_buffers_changed. | 2103 | /* Set the current buffer to B, and do not set windows_or_buffers_changed. |
| 2126 | This is used by redisplay. */ | 2104 | This is used by redisplay. */ |
| @@ -2226,13 +2204,13 @@ ends when the current command terminates. Use `switch-to-buffer' or | |||
| 2226 | return buffer; | 2204 | return buffer; |
| 2227 | } | 2205 | } |
| 2228 | 2206 | ||
| 2229 | /* Set the current buffer to BUFFER provided it is alive. */ | 2207 | /* Set the current buffer to BUFFER provided if it is alive. */ |
| 2230 | 2208 | ||
| 2231 | Lisp_Object | 2209 | Lisp_Object |
| 2232 | set_buffer_if_live (Lisp_Object buffer) | 2210 | set_buffer_if_live (Lisp_Object buffer) |
| 2233 | { | 2211 | { |
| 2234 | if (! NILP (BVAR (XBUFFER (buffer), name))) | 2212 | if (! NILP (BVAR (XBUFFER (buffer), name))) |
| 2235 | Fset_buffer (buffer); | 2213 | set_buffer_internal (XBUFFER (buffer)); |
| 2236 | return Qnil; | 2214 | return Qnil; |
| 2237 | } | 2215 | } |
| 2238 | 2216 | ||
| @@ -2471,8 +2449,8 @@ current buffer is cleared. */) | |||
| 2471 | struct Lisp_Marker *tail, *markers; | 2449 | struct Lisp_Marker *tail, *markers; |
| 2472 | struct buffer *other; | 2450 | struct buffer *other; |
| 2473 | ptrdiff_t begv, zv; | 2451 | ptrdiff_t begv, zv; |
| 2474 | int narrowed = (BEG != BEGV || Z != ZV); | 2452 | bool narrowed = (BEG != BEGV || Z != ZV); |
| 2475 | int modified_p = !NILP (Fbuffer_modified_p (Qnil)); | 2453 | bool modified_p = !NILP (Fbuffer_modified_p (Qnil)); |
| 2476 | Lisp_Object old_undo = BVAR (current_buffer, undo_list); | 2454 | Lisp_Object old_undo = BVAR (current_buffer, undo_list); |
| 2477 | struct gcpro gcpro1; | 2455 | struct gcpro gcpro1; |
| 2478 | 2456 | ||
| @@ -2821,19 +2799,19 @@ swap_out_buffer_local_variables (struct buffer *b) | |||
| 2821 | *VEC_PTR and *LEN_PTR should contain a valid vector and size | 2799 | *VEC_PTR and *LEN_PTR should contain a valid vector and size |
| 2822 | when this function is called. | 2800 | when this function is called. |
| 2823 | 2801 | ||
| 2824 | If EXTEND is non-zero, we make the vector bigger if necessary. | 2802 | If EXTEND, make the vector bigger if necessary. |
| 2825 | If EXTEND is zero, we never extend the vector, | 2803 | If not, never extend the vector, |
| 2826 | and we store only as many overlays as will fit. | 2804 | and store only as many overlays as will fit. |
| 2827 | But we still return the total number of overlays. | 2805 | But still return the total number of overlays. |
| 2828 | 2806 | ||
| 2829 | If CHANGE_REQ is true, then any position written into *PREV_PTR or | 2807 | If CHANGE_REQ, any position written into *PREV_PTR or |
| 2830 | *NEXT_PTR is guaranteed to be not equal to POS, unless it is the | 2808 | *NEXT_PTR is guaranteed to be not equal to POS, unless it is the |
| 2831 | default (BEGV or ZV). */ | 2809 | default (BEGV or ZV). */ |
| 2832 | 2810 | ||
| 2833 | ptrdiff_t | 2811 | ptrdiff_t |
| 2834 | overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, | 2812 | overlays_at (EMACS_INT pos, bool extend, Lisp_Object **vec_ptr, |
| 2835 | ptrdiff_t *len_ptr, | 2813 | ptrdiff_t *len_ptr, |
| 2836 | ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr, int change_req) | 2814 | ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr, bool change_req) |
| 2837 | { | 2815 | { |
| 2838 | Lisp_Object overlay, start, end; | 2816 | Lisp_Object overlay, start, end; |
| 2839 | struct Lisp_Overlay *tail; | 2817 | struct Lisp_Overlay *tail; |
| @@ -2842,7 +2820,7 @@ overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, | |||
| 2842 | Lisp_Object *vec = *vec_ptr; | 2820 | Lisp_Object *vec = *vec_ptr; |
| 2843 | ptrdiff_t next = ZV; | 2821 | ptrdiff_t next = ZV; |
| 2844 | ptrdiff_t prev = BEGV; | 2822 | ptrdiff_t prev = BEGV; |
| 2845 | int inhibit_storing = 0; | 2823 | bool inhibit_storing = 0; |
| 2846 | 2824 | ||
| 2847 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) | 2825 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) |
| 2848 | { | 2826 | { |
| @@ -2959,13 +2937,13 @@ overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, | |||
| 2959 | *VEC_PTR and *LEN_PTR should contain a valid vector and size | 2937 | *VEC_PTR and *LEN_PTR should contain a valid vector and size |
| 2960 | when this function is called. | 2938 | when this function is called. |
| 2961 | 2939 | ||
| 2962 | If EXTEND is non-zero, we make the vector bigger if necessary. | 2940 | If EXTEND, make the vector bigger if necessary. |
| 2963 | If EXTEND is zero, we never extend the vector, | 2941 | If not, never extend the vector, |
| 2964 | and we store only as many overlays as will fit. | 2942 | and store only as many overlays as will fit. |
| 2965 | But we still return the total number of overlays. */ | 2943 | But still return the total number of overlays. */ |
| 2966 | 2944 | ||
| 2967 | static ptrdiff_t | 2945 | static ptrdiff_t |
| 2968 | overlays_in (EMACS_INT beg, EMACS_INT end, int extend, | 2946 | overlays_in (EMACS_INT beg, EMACS_INT end, bool extend, |
| 2969 | Lisp_Object **vec_ptr, ptrdiff_t *len_ptr, | 2947 | Lisp_Object **vec_ptr, ptrdiff_t *len_ptr, |
| 2970 | ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr) | 2948 | ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr) |
| 2971 | { | 2949 | { |
| @@ -2976,8 +2954,8 @@ overlays_in (EMACS_INT beg, EMACS_INT end, int extend, | |||
| 2976 | Lisp_Object *vec = *vec_ptr; | 2954 | Lisp_Object *vec = *vec_ptr; |
| 2977 | ptrdiff_t next = ZV; | 2955 | ptrdiff_t next = ZV; |
| 2978 | ptrdiff_t prev = BEGV; | 2956 | ptrdiff_t prev = BEGV; |
| 2979 | int inhibit_storing = 0; | 2957 | bool inhibit_storing = 0; |
| 2980 | int end_is_Z = end == Z; | 2958 | bool end_is_Z = end == Z; |
| 2981 | 2959 | ||
| 2982 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) | 2960 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) |
| 2983 | { | 2961 | { |
| @@ -3078,10 +3056,10 @@ overlays_in (EMACS_INT beg, EMACS_INT end, int extend, | |||
| 3078 | } | 3056 | } |
| 3079 | 3057 | ||
| 3080 | 3058 | ||
| 3081 | /* Return non-zero if there exists an overlay with a non-nil | 3059 | /* Return true if there exists an overlay with a non-nil |
| 3082 | `mouse-face' property overlapping OVERLAY. */ | 3060 | `mouse-face' property overlapping OVERLAY. */ |
| 3083 | 3061 | ||
| 3084 | int | 3062 | bool |
| 3085 | mouse_face_overlay_overlaps (Lisp_Object overlay) | 3063 | mouse_face_overlay_overlaps (Lisp_Object overlay) |
| 3086 | { | 3064 | { |
| 3087 | ptrdiff_t start = OVERLAY_POSITION (OVERLAY_START (overlay)); | 3065 | ptrdiff_t start = OVERLAY_POSITION (OVERLAY_START (overlay)); |
| @@ -3110,7 +3088,7 @@ mouse_face_overlay_overlaps (Lisp_Object overlay) | |||
| 3110 | 3088 | ||
| 3111 | 3089 | ||
| 3112 | /* Fast function to just test if we're at an overlay boundary. */ | 3090 | /* Fast function to just test if we're at an overlay boundary. */ |
| 3113 | int | 3091 | bool |
| 3114 | overlay_touches_p (ptrdiff_t pos) | 3092 | overlay_touches_p (ptrdiff_t pos) |
| 3115 | { | 3093 | { |
| 3116 | Lisp_Object overlay; | 3094 | Lisp_Object overlay; |
| @@ -3327,7 +3305,7 @@ overlay_strings (ptrdiff_t pos, struct window *w, unsigned char **pstr) | |||
| 3327 | Lisp_Object overlay, window, str; | 3305 | Lisp_Object overlay, window, str; |
| 3328 | struct Lisp_Overlay *ov; | 3306 | struct Lisp_Overlay *ov; |
| 3329 | ptrdiff_t startpos, endpos; | 3307 | ptrdiff_t startpos, endpos; |
| 3330 | int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); | 3308 | bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 3331 | 3309 | ||
| 3332 | overlay_heads.used = overlay_heads.bytes = 0; | 3310 | overlay_heads.used = overlay_heads.bytes = 0; |
| 3333 | overlay_tails.used = overlay_tails.bytes = 0; | 3311 | overlay_tails.used = overlay_tails.bytes = 0; |
| @@ -4321,7 +4299,7 @@ VALUE will be returned.*/) | |||
| 4321 | (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) | 4299 | (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) |
| 4322 | { | 4300 | { |
| 4323 | Lisp_Object tail, buffer; | 4301 | Lisp_Object tail, buffer; |
| 4324 | int changed; | 4302 | bool changed; |
| 4325 | 4303 | ||
| 4326 | CHECK_OVERLAY (overlay); | 4304 | CHECK_OVERLAY (overlay); |
| 4327 | 4305 | ||
| @@ -4396,7 +4374,7 @@ add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay) | |||
| 4396 | and the insert-after-hooks of overlay ending at START. | 4374 | and the insert-after-hooks of overlay ending at START. |
| 4397 | 4375 | ||
| 4398 | This is called both before and after the modification. | 4376 | This is called both before and after the modification. |
| 4399 | AFTER is nonzero when we call after the modification. | 4377 | AFTER is true when we call after the modification. |
| 4400 | 4378 | ||
| 4401 | ARG1, ARG2, ARG3 are arguments to pass to the hook functions. | 4379 | ARG1, ARG2, ARG3 are arguments to pass to the hook functions. |
| 4402 | When AFTER is nonzero, they are the start position, | 4380 | When AFTER is nonzero, they are the start position, |
| @@ -4404,13 +4382,13 @@ add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay) | |||
| 4404 | and the length of deleted or replaced old text. */ | 4382 | and the length of deleted or replaced old text. */ |
| 4405 | 4383 | ||
| 4406 | void | 4384 | void |
| 4407 | report_overlay_modification (Lisp_Object start, Lisp_Object end, int after, | 4385 | report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, |
| 4408 | Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) | 4386 | Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) |
| 4409 | { | 4387 | { |
| 4410 | Lisp_Object prop, overlay; | 4388 | Lisp_Object prop, overlay; |
| 4411 | struct Lisp_Overlay *tail; | 4389 | struct Lisp_Overlay *tail; |
| 4412 | /* 1 if this change is an insertion. */ | 4390 | /* True if this change is an insertion. */ |
| 4413 | int insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); | 4391 | bool insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); |
| 4414 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 4392 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 4415 | 4393 | ||
| 4416 | overlay = Qnil; | 4394 | overlay = Qnil; |
| @@ -4530,7 +4508,7 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, int after, | |||
| 4530 | } | 4508 | } |
| 4531 | 4509 | ||
| 4532 | static void | 4510 | static void |
| 4533 | call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, int after, | 4511 | call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after, |
| 4534 | Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) | 4512 | Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) |
| 4535 | { | 4513 | { |
| 4536 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 4514 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| @@ -4689,7 +4667,7 @@ static int mmap_page_size; | |||
| 4689 | 4667 | ||
| 4690 | /* 1 means mmap has been initialized. */ | 4668 | /* 1 means mmap has been initialized. */ |
| 4691 | 4669 | ||
| 4692 | static int mmap_initialized_p; | 4670 | static bool mmap_initialized_p; |
| 4693 | 4671 | ||
| 4694 | /* Value is X rounded up to the next multiple of N. */ | 4672 | /* Value is X rounded up to the next multiple of N. */ |
| 4695 | 4673 | ||
| @@ -4785,9 +4763,9 @@ mmap_find (void *start, void *end) | |||
| 4785 | 4763 | ||
| 4786 | 4764 | ||
| 4787 | /* Unmap a region. P is a pointer to the start of the user-araa of | 4765 | /* Unmap a region. P is a pointer to the start of the user-araa of |
| 4788 | the region. Value is non-zero if successful. */ | 4766 | the region. */ |
| 4789 | 4767 | ||
| 4790 | static int | 4768 | static void |
| 4791 | mmap_free_1 (struct mmap_region *r) | 4769 | mmap_free_1 (struct mmap_region *r) |
| 4792 | { | 4770 | { |
| 4793 | if (r->next) | 4771 | if (r->next) |
| @@ -4798,24 +4776,19 @@ mmap_free_1 (struct mmap_region *r) | |||
| 4798 | mmap_regions = r->next; | 4776 | mmap_regions = r->next; |
| 4799 | 4777 | ||
| 4800 | if (munmap (r, r->nbytes_mapped) == -1) | 4778 | if (munmap (r, r->nbytes_mapped) == -1) |
| 4801 | { | 4779 | fprintf (stderr, "munmap: %s\n", emacs_strerror (errno)); |
| 4802 | fprintf (stderr, "munmap: %s\n", emacs_strerror (errno)); | ||
| 4803 | return 0; | ||
| 4804 | } | ||
| 4805 | |||
| 4806 | return 1; | ||
| 4807 | } | 4780 | } |
| 4808 | 4781 | ||
| 4809 | 4782 | ||
| 4810 | /* Enlarge region R by NPAGES pages. NPAGES < 0 means shrink R. | 4783 | /* Enlarge region R by NPAGES pages. NPAGES < 0 means shrink R. |
| 4811 | Value is non-zero if successful. */ | 4784 | Value is true if successful. */ |
| 4812 | 4785 | ||
| 4813 | static int | 4786 | static bool |
| 4814 | mmap_enlarge (struct mmap_region *r, int npages) | 4787 | mmap_enlarge (struct mmap_region *r, int npages) |
| 4815 | { | 4788 | { |
| 4816 | char *region_end = (char *) r + r->nbytes_mapped; | 4789 | char *region_end = (char *) r + r->nbytes_mapped; |
| 4817 | size_t nbytes; | 4790 | size_t nbytes; |
| 4818 | int success = 0; | 4791 | bool success = 0; |
| 4819 | 4792 | ||
| 4820 | if (npages < 0) | 4793 | if (npages < 0) |
| 4821 | { | 4794 | { |
| @@ -4865,17 +4838,16 @@ mmap_enlarge (struct mmap_region *r, int npages) | |||
| 4865 | } | 4838 | } |
| 4866 | 4839 | ||
| 4867 | 4840 | ||
| 4868 | /* Set or reset variables holding references to mapped regions. If | 4841 | /* Set or reset variables holding references to mapped regions. |
| 4869 | RESTORE_P is zero, set all variables to null. If RESTORE_P is | 4842 | If not RESTORE_P, set all variables to null. If RESTORE_P, set all |
| 4870 | non-zero, set all variables to the start of the user-areas | 4843 | variables to the start of the user-areas of mapped regions. |
| 4871 | of mapped regions. | ||
| 4872 | 4844 | ||
| 4873 | This function is called from Fdump_emacs to ensure that the dumped | 4845 | This function is called from Fdump_emacs to ensure that the dumped |
| 4874 | Emacs doesn't contain references to memory that won't be mapped | 4846 | Emacs doesn't contain references to memory that won't be mapped |
| 4875 | when Emacs starts. */ | 4847 | when Emacs starts. */ |
| 4876 | 4848 | ||
| 4877 | void | 4849 | void |
| 4878 | mmap_set_vars (int restore_p) | 4850 | mmap_set_vars (bool restore_p) |
| 4879 | { | 4851 | { |
| 4880 | struct mmap_region *r; | 4852 | struct mmap_region *r; |
| 4881 | 4853 | ||
diff --git a/src/buffer.h b/src/buffer.h index 6c63c52dc47..3acf1423816 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -471,7 +471,7 @@ struct buffer_text | |||
| 471 | /* Usually 0. Temporarily set to 1 in decode_coding_gap to | 471 | /* Usually 0. Temporarily set to 1 in decode_coding_gap to |
| 472 | prevent Fgarbage_collect from shrinking the gap and losing | 472 | prevent Fgarbage_collect from shrinking the gap and losing |
| 473 | not-yet-decoded bytes. */ | 473 | not-yet-decoded bytes. */ |
| 474 | int inhibit_shrinking; | 474 | bool inhibit_shrinking; |
| 475 | }; | 475 | }; |
| 476 | 476 | ||
| 477 | /* Most code should use this macro to access Lisp fields in struct buffer. */ | 477 | /* Most code should use this macro to access Lisp fields in struct buffer. */ |
| @@ -1006,23 +1006,46 @@ extern struct buffer buffer_local_symbols; | |||
| 1006 | 1006 | ||
| 1007 | extern void delete_all_overlays (struct buffer *); | 1007 | extern void delete_all_overlays (struct buffer *); |
| 1008 | extern void reset_buffer (struct buffer *); | 1008 | extern void reset_buffer (struct buffer *); |
| 1009 | extern int compact_buffer (struct buffer *); | 1009 | extern void compact_buffer (struct buffer *); |
| 1010 | extern void evaporate_overlays (ptrdiff_t); | 1010 | extern void evaporate_overlays (ptrdiff_t); |
| 1011 | extern ptrdiff_t overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, | 1011 | extern ptrdiff_t overlays_at (EMACS_INT, bool, Lisp_Object **, |
| 1012 | ptrdiff_t *len_ptr, ptrdiff_t *next_ptr, | 1012 | ptrdiff_t *, ptrdiff_t *, ptrdiff_t *, bool); |
| 1013 | ptrdiff_t *prev_ptr, int change_req); | ||
| 1014 | extern ptrdiff_t sort_overlays (Lisp_Object *, ptrdiff_t, struct window *); | 1013 | extern ptrdiff_t sort_overlays (Lisp_Object *, ptrdiff_t, struct window *); |
| 1015 | extern void recenter_overlay_lists (struct buffer *, ptrdiff_t); | 1014 | extern void recenter_overlay_lists (struct buffer *, ptrdiff_t); |
| 1016 | extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **); | 1015 | extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **); |
| 1017 | extern void validate_region (Lisp_Object *, Lisp_Object *); | 1016 | extern void validate_region (Lisp_Object *, Lisp_Object *); |
| 1018 | extern void set_buffer_internal (struct buffer *); | ||
| 1019 | extern void set_buffer_internal_1 (struct buffer *); | 1017 | extern void set_buffer_internal_1 (struct buffer *); |
| 1020 | extern void set_buffer_temp (struct buffer *); | 1018 | extern void set_buffer_temp (struct buffer *); |
| 1021 | extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object); | 1019 | extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object); |
| 1022 | extern void record_buffer (Lisp_Object); | 1020 | extern void record_buffer (Lisp_Object); |
| 1023 | extern _Noreturn void buffer_slot_type_mismatch (Lisp_Object, int); | 1021 | extern _Noreturn void buffer_slot_type_mismatch (Lisp_Object, int); |
| 1024 | extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); | 1022 | extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); |
| 1025 | extern void mmap_set_vars (int); | 1023 | extern void mmap_set_vars (bool); |
| 1024 | |||
| 1025 | /* Set the current buffer to B. | ||
| 1026 | |||
| 1027 | We previously set windows_or_buffers_changed here to invalidate | ||
| 1028 | global unchanged information in beg_unchanged and end_unchanged. | ||
| 1029 | This is no longer necessary because we now compute unchanged | ||
| 1030 | information on a buffer-basis. Every action affecting other | ||
| 1031 | windows than the selected one requires a select_window at some | ||
| 1032 | time, and that increments windows_or_buffers_changed. */ | ||
| 1033 | |||
| 1034 | BUFFER_INLINE void | ||
| 1035 | set_buffer_internal (struct buffer *b) | ||
| 1036 | { | ||
| 1037 | if (current_buffer != b) | ||
| 1038 | set_buffer_internal_1 (b); | ||
| 1039 | } | ||
| 1040 | |||
| 1041 | /* Arrange to go back to the original buffer after the next | ||
| 1042 | call to unbind_to if the original buffer is still alive. */ | ||
| 1043 | |||
| 1044 | BUFFER_INLINE void | ||
| 1045 | record_unwind_current_buffer (void) | ||
| 1046 | { | ||
| 1047 | record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); | ||
| 1048 | } | ||
| 1026 | 1049 | ||
| 1027 | /* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements. | 1050 | /* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements. |
| 1028 | If NEXTP is non-NULL, return next overlay there. | 1051 | If NEXTP is non-NULL, return next overlay there. |
| @@ -1067,7 +1090,7 @@ set_buffer_intervals (struct buffer *b, INTERVAL i) | |||
| 1067 | 1090 | ||
| 1068 | /* Non-zero if current buffer has overlays. */ | 1091 | /* Non-zero if current buffer has overlays. */ |
| 1069 | 1092 | ||
| 1070 | BUFFER_INLINE int | 1093 | BUFFER_INLINE bool |
| 1071 | buffer_has_overlays (void) | 1094 | buffer_has_overlays (void) |
| 1072 | { | 1095 | { |
| 1073 | return current_buffer->overlays_before || current_buffer->overlays_after; | 1096 | return current_buffer->overlays_before || current_buffer->overlays_after; |
| @@ -1243,7 +1266,7 @@ downcase (int c) | |||
| 1243 | } | 1266 | } |
| 1244 | 1267 | ||
| 1245 | /* 1 if C is upper case. */ | 1268 | /* 1 if C is upper case. */ |
| 1246 | BUFFER_INLINE int uppercasep (int c) { return downcase (c) != c; } | 1269 | BUFFER_INLINE bool uppercasep (int c) { return downcase (c) != c; } |
| 1247 | 1270 | ||
| 1248 | /* Upcase a character C known to be not upper case. */ | 1271 | /* Upcase a character C known to be not upper case. */ |
| 1249 | BUFFER_INLINE int | 1272 | BUFFER_INLINE int |
| @@ -1255,8 +1278,11 @@ upcase1 (int c) | |||
| 1255 | } | 1278 | } |
| 1256 | 1279 | ||
| 1257 | /* 1 if C is lower case. */ | 1280 | /* 1 if C is lower case. */ |
| 1258 | BUFFER_INLINE int lowercasep (int c) | 1281 | BUFFER_INLINE bool |
| 1259 | { return !uppercasep (c) && upcase1 (c) != c; } | 1282 | lowercasep (int c) |
| 1283 | { | ||
| 1284 | return !uppercasep (c) && upcase1 (c) != c; | ||
| 1285 | } | ||
| 1260 | 1286 | ||
| 1261 | /* Upcase a character C, or make no change if that cannot be done. */ | 1287 | /* Upcase a character C, or make no change if that cannot be done. */ |
| 1262 | BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } | 1288 | BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } |
diff --git a/src/bytecode.c b/src/bytecode.c index 5ac8b4fa2bd..40729cbd453 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -553,7 +553,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 553 | if (INTEGERP (args_template)) | 553 | if (INTEGERP (args_template)) |
| 554 | { | 554 | { |
| 555 | ptrdiff_t at = XINT (args_template); | 555 | ptrdiff_t at = XINT (args_template); |
| 556 | int rest = at & 128; | 556 | bool rest = (at & 128) != 0; |
| 557 | int mandatory = at & 127; | 557 | int mandatory = at & 127; |
| 558 | ptrdiff_t nonrest = at >> 8; | 558 | ptrdiff_t nonrest = at >> 8; |
| 559 | eassert (mandatory <= nonrest); | 559 | eassert (mandatory <= nonrest); |
| @@ -1051,7 +1051,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 1051 | 1051 | ||
| 1052 | CASE (Bsave_current_buffer): /* Obsolete since ??. */ | 1052 | CASE (Bsave_current_buffer): /* Obsolete since ??. */ |
| 1053 | CASE (Bsave_current_buffer_1): | 1053 | CASE (Bsave_current_buffer_1): |
| 1054 | record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); | 1054 | record_unwind_current_buffer (); |
| 1055 | NEXT; | 1055 | NEXT; |
| 1056 | 1056 | ||
| 1057 | CASE (Bsave_window_excursion): /* Obsolete since 24.1. */ | 1057 | CASE (Bsave_window_excursion): /* Obsolete since 24.1. */ |
diff --git a/src/callint.c b/src/callint.c index 36a59e812f2..b11545ddea2 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -150,7 +150,7 @@ static const char *callint_argfuns[] | |||
| 150 | = {"", "point", "mark", "region-beginning", "region-end"}; | 150 | = {"", "point", "mark", "region-beginning", "region-end"}; |
| 151 | 151 | ||
| 152 | static void | 152 | static void |
| 153 | check_mark (int for_region) | 153 | check_mark (bool for_region) |
| 154 | { | 154 | { |
| 155 | Lisp_Object tem; | 155 | Lisp_Object tem; |
| 156 | tem = Fmarker_buffer (BVAR (current_buffer, mark)); | 156 | tem = Fmarker_buffer (BVAR (current_buffer, mark)); |
| @@ -273,11 +273,11 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 273 | signed char *varies; | 273 | signed char *varies; |
| 274 | 274 | ||
| 275 | ptrdiff_t i, nargs; | 275 | ptrdiff_t i, nargs; |
| 276 | int foo; | 276 | ptrdiff_t mark; |
| 277 | int arg_from_tty = 0; | 277 | bool arg_from_tty = 0; |
| 278 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; | 278 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
| 279 | ptrdiff_t key_count; | 279 | ptrdiff_t key_count; |
| 280 | int record_then_fail = 0; | 280 | bool record_then_fail = 0; |
| 281 | 281 | ||
| 282 | Lisp_Object save_this_command, save_last_command; | 282 | Lisp_Object save_this_command, save_last_command; |
| 283 | Lisp_Object save_this_original_command, save_real_this_command; | 283 | Lisp_Object save_this_original_command, save_real_this_command; |
| @@ -685,7 +685,7 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 685 | goto have_prefix_arg; | 685 | goto have_prefix_arg; |
| 686 | case 'n': /* Read number from minibuffer. */ | 686 | case 'n': /* Read number from minibuffer. */ |
| 687 | { | 687 | { |
| 688 | int first = 1; | 688 | bool first = 1; |
| 689 | do | 689 | do |
| 690 | { | 690 | { |
| 691 | Lisp_Object str; | 691 | Lisp_Object str; |
| @@ -726,11 +726,11 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 726 | check_mark (1); | 726 | check_mark (1); |
| 727 | set_marker_both (point_marker, Qnil, PT, PT_BYTE); | 727 | set_marker_both (point_marker, Qnil, PT, PT_BYTE); |
| 728 | /* visargs[i+1] = Qnil; */ | 728 | /* visargs[i+1] = Qnil; */ |
| 729 | foo = marker_position (BVAR (current_buffer, mark)); | 729 | mark = marker_position (BVAR (current_buffer, mark)); |
| 730 | /* visargs[i] = Qnil; */ | 730 | /* visargs[i] = Qnil; */ |
| 731 | args[i] = PT < foo ? point_marker : BVAR (current_buffer, mark); | 731 | args[i] = PT < mark ? point_marker : BVAR (current_buffer, mark); |
| 732 | varies[i] = 3; | 732 | varies[i] = 3; |
| 733 | args[++i] = PT > foo ? point_marker : BVAR (current_buffer, mark); | 733 | args[++i] = PT > mark ? point_marker : BVAR (current_buffer, mark); |
| 734 | varies[i] = 4; | 734 | varies[i] = 4; |
| 735 | break; | 735 | break; |
| 736 | 736 | ||
diff --git a/src/callproc.c b/src/callproc.c index 4bf1da04e1a..2e9a8950700 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -77,7 +77,7 @@ static Lisp_Object Vtemp_file_name_pattern; | |||
| 77 | 77 | ||
| 78 | /* True if we are about to fork off a synchronous process or if we | 78 | /* True if we are about to fork off a synchronous process or if we |
| 79 | are waiting for it. */ | 79 | are waiting for it. */ |
| 80 | int synch_process_alive; | 80 | bool synch_process_alive; |
| 81 | 81 | ||
| 82 | /* Nonzero => this is a string explaining death of synchronous subprocess. */ | 82 | /* Nonzero => this is a string explaining death of synchronous subprocess. */ |
| 83 | const char *synch_process_death; | 83 | const char *synch_process_death; |
| @@ -94,8 +94,8 @@ int synch_process_retcode; | |||
| 94 | On MSDOS, delete the temporary file on any kind of termination. | 94 | On MSDOS, delete the temporary file on any kind of termination. |
| 95 | On Unix, kill the process and any children on termination by signal. */ | 95 | On Unix, kill the process and any children on termination by signal. */ |
| 96 | 96 | ||
| 97 | /* Nonzero if this is termination due to exit. */ | 97 | /* True if this is termination due to exit. */ |
| 98 | static int call_process_exited; | 98 | static bool call_process_exited; |
| 99 | 99 | ||
| 100 | static Lisp_Object | 100 | static Lisp_Object |
| 101 | call_process_kill (Lisp_Object fdpid) | 101 | call_process_kill (Lisp_Object fdpid) |
| @@ -190,7 +190,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 190 | (ptrdiff_t nargs, Lisp_Object *args) | 190 | (ptrdiff_t nargs, Lisp_Object *args) |
| 191 | { | 191 | { |
| 192 | Lisp_Object infile, buffer, current_dir, path, cleanup_info_tail; | 192 | Lisp_Object infile, buffer, current_dir, path, cleanup_info_tail; |
| 193 | int display_p; | 193 | bool display_p; |
| 194 | int fd[2]; | 194 | int fd[2]; |
| 195 | int filefd; | 195 | int filefd; |
| 196 | #define CALLPROC_BUFFER_SIZE_MIN (16 * 1024) | 196 | #define CALLPROC_BUFFER_SIZE_MIN (16 * 1024) |
| @@ -217,7 +217,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 217 | struct coding_system argument_coding; /* coding-system of arguments */ | 217 | struct coding_system argument_coding; /* coding-system of arguments */ |
| 218 | /* Set to the return value of Ffind_operation_coding_system. */ | 218 | /* Set to the return value of Ffind_operation_coding_system. */ |
| 219 | Lisp_Object coding_systems; | 219 | Lisp_Object coding_systems; |
| 220 | int output_to_buffer = 1; | 220 | bool output_to_buffer = 1; |
| 221 | 221 | ||
| 222 | /* Qt denotes that Ffind_operation_coding_system is not yet called. */ | 222 | /* Qt denotes that Ffind_operation_coding_system is not yet called. */ |
| 223 | coding_systems = Qt; | 223 | coding_systems = Qt; |
| @@ -241,7 +241,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 241 | /* If arguments are supplied, we may have to encode them. */ | 241 | /* If arguments are supplied, we may have to encode them. */ |
| 242 | if (nargs >= 5) | 242 | if (nargs >= 5) |
| 243 | { | 243 | { |
| 244 | int must_encode = 0; | 244 | bool must_encode = 0; |
| 245 | Lisp_Object coding_attrs; | 245 | Lisp_Object coding_attrs; |
| 246 | 246 | ||
| 247 | for (i = 4; i < nargs; i++) | 247 | for (i = 4; i < nargs; i++) |
| @@ -610,12 +610,12 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 610 | Lisp_Object volatile buffer_volatile = buffer; | 610 | Lisp_Object volatile buffer_volatile = buffer; |
| 611 | Lisp_Object volatile coding_systems_volatile = coding_systems; | 611 | Lisp_Object volatile coding_systems_volatile = coding_systems; |
| 612 | Lisp_Object volatile current_dir_volatile = current_dir; | 612 | Lisp_Object volatile current_dir_volatile = current_dir; |
| 613 | int volatile display_p_volatile = display_p; | 613 | bool volatile display_p_volatile = display_p; |
| 614 | bool volatile output_to_buffer_volatile = output_to_buffer; | ||
| 615 | bool volatile sa_must_free_volatile = sa_must_free; | ||
| 614 | int volatile fd1_volatile = fd1; | 616 | int volatile fd1_volatile = fd1; |
| 615 | int volatile fd_error_volatile = fd_error; | 617 | int volatile fd_error_volatile = fd_error; |
| 616 | int volatile fd_output_volatile = fd_output; | 618 | int volatile fd_output_volatile = fd_output; |
| 617 | int volatile output_to_buffer_volatile = output_to_buffer; | ||
| 618 | int volatile sa_must_free_volatile = sa_must_free; | ||
| 619 | ptrdiff_t volatile sa_count_volatile = sa_count; | 619 | ptrdiff_t volatile sa_count_volatile = sa_count; |
| 620 | unsigned char const **volatile new_argv_volatile = new_argv; | 620 | unsigned char const **volatile new_argv_volatile = new_argv; |
| 621 | 621 | ||
| @@ -766,11 +766,11 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 766 | 766 | ||
| 767 | if (output_to_buffer) | 767 | if (output_to_buffer) |
| 768 | { | 768 | { |
| 769 | register int nread; | 769 | int nread; |
| 770 | int first = 1; | 770 | bool first = 1; |
| 771 | EMACS_INT total_read = 0; | 771 | EMACS_INT total_read = 0; |
| 772 | int carryover = 0; | 772 | int carryover = 0; |
| 773 | int display_on_the_fly = display_p; | 773 | bool display_on_the_fly = display_p; |
| 774 | struct coding_system saved_coding; | 774 | struct coding_system saved_coding; |
| 775 | 775 | ||
| 776 | saved_coding = process_coding; | 776 | saved_coding = process_coding; |
| @@ -1086,7 +1086,7 @@ static char ** | |||
| 1086 | add_env (char **env, char **new_env, char *string) | 1086 | add_env (char **env, char **new_env, char *string) |
| 1087 | { | 1087 | { |
| 1088 | char **ep; | 1088 | char **ep; |
| 1089 | int ok = 1; | 1089 | bool ok = 1; |
| 1090 | if (string == NULL) | 1090 | if (string == NULL) |
| 1091 | return new_env; | 1091 | return new_env; |
| 1092 | 1092 | ||
| @@ -1126,8 +1126,7 @@ add_env (char **env, char **new_env, char *string) | |||
| 1126 | Therefore, the superior process must save and restore the value | 1126 | Therefore, the superior process must save and restore the value |
| 1127 | of environ around the vfork and the call to this function. | 1127 | of environ around the vfork and the call to this function. |
| 1128 | 1128 | ||
| 1129 | SET_PGRP is nonzero if we should put the subprocess into a separate | 1129 | If SET_PGRP, put the subprocess into a separate process group. |
| 1130 | process group. | ||
| 1131 | 1130 | ||
| 1132 | CURRENT_DIR is an elisp string giving the path of the current | 1131 | CURRENT_DIR is an elisp string giving the path of the current |
| 1133 | directory the subprocess should have. Since we can't really signal | 1132 | directory the subprocess should have. Since we can't really signal |
| @@ -1135,7 +1134,8 @@ add_env (char **env, char **new_env, char *string) | |||
| 1135 | executable directory by the parent. */ | 1134 | executable directory by the parent. */ |
| 1136 | 1135 | ||
| 1137 | int | 1136 | int |
| 1138 | child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, Lisp_Object current_dir) | 1137 | child_setup (int in, int out, int err, char **new_argv, bool set_pgrp, |
| 1138 | Lisp_Object current_dir) | ||
| 1139 | { | 1139 | { |
| 1140 | char **env; | 1140 | char **env; |
| 1141 | char *pwd_var; | 1141 | char *pwd_var; |
| @@ -1394,7 +1394,7 @@ relocate_fd (int fd, int minfd) | |||
| 1394 | } | 1394 | } |
| 1395 | #endif /* not WINDOWSNT */ | 1395 | #endif /* not WINDOWSNT */ |
| 1396 | 1396 | ||
| 1397 | static int | 1397 | static bool |
| 1398 | getenv_internal_1 (const char *var, ptrdiff_t varlen, char **value, | 1398 | getenv_internal_1 (const char *var, ptrdiff_t varlen, char **value, |
| 1399 | ptrdiff_t *valuelen, Lisp_Object env) | 1399 | ptrdiff_t *valuelen, Lisp_Object env) |
| 1400 | { | 1400 | { |
| @@ -1429,7 +1429,7 @@ getenv_internal_1 (const char *var, ptrdiff_t varlen, char **value, | |||
| 1429 | return 0; | 1429 | return 0; |
| 1430 | } | 1430 | } |
| 1431 | 1431 | ||
| 1432 | static int | 1432 | static bool |
| 1433 | getenv_internal (const char *var, ptrdiff_t varlen, char **value, | 1433 | getenv_internal (const char *var, ptrdiff_t varlen, char **value, |
| 1434 | ptrdiff_t *valuelen, Lisp_Object frame) | 1434 | ptrdiff_t *valuelen, Lisp_Object frame) |
| 1435 | { | 1435 | { |
diff --git a/src/casefiddle.c b/src/casefiddle.c index 81e84252b72..1102054b153 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c | |||
| @@ -35,8 +35,8 @@ Lisp_Object Qidentity; | |||
| 35 | static Lisp_Object | 35 | static Lisp_Object |
| 36 | casify_object (enum case_action flag, Lisp_Object obj) | 36 | casify_object (enum case_action flag, Lisp_Object obj) |
| 37 | { | 37 | { |
| 38 | register int c, c1; | 38 | int c, c1; |
| 39 | register int inword = flag == CASE_DOWN; | 39 | bool inword = flag == CASE_DOWN; |
| 40 | 40 | ||
| 41 | /* If the case table is flagged as modified, rescan it. */ | 41 | /* If the case table is flagged as modified, rescan it. */ |
| 42 | if (NILP (XCHAR_TABLE (BVAR (current_buffer, downcase_table))->extras[1])) | 42 | if (NILP (XCHAR_TABLE (BVAR (current_buffer, downcase_table))->extras[1])) |
| @@ -47,7 +47,8 @@ casify_object (enum case_action flag, Lisp_Object obj) | |||
| 47 | int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER | 47 | int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER |
| 48 | | CHAR_SHIFT | CHAR_CTL | CHAR_META); | 48 | | CHAR_SHIFT | CHAR_CTL | CHAR_META); |
| 49 | int flags = XINT (obj) & flagbits; | 49 | int flags = XINT (obj) & flagbits; |
| 50 | int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); | 50 | bool multibyte = ! NILP (BVAR (current_buffer, |
| 51 | enable_multibyte_characters)); | ||
| 51 | 52 | ||
| 52 | /* If the character has higher bits set | 53 | /* If the character has higher bits set |
| 53 | above the flags, return it unchanged. | 54 | above the flags, return it unchanged. |
| @@ -189,9 +190,9 @@ The argument object is not altered--the value is a copy. */) | |||
| 189 | static void | 190 | static void |
| 190 | casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e) | 191 | casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e) |
| 191 | { | 192 | { |
| 192 | register int c; | 193 | int c; |
| 193 | register int inword = flag == CASE_DOWN; | 194 | bool inword = flag == CASE_DOWN; |
| 194 | register int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); | 195 | bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 195 | ptrdiff_t start, end; | 196 | ptrdiff_t start, end; |
| 196 | ptrdiff_t start_byte; | 197 | ptrdiff_t start_byte; |
| 197 | 198 | ||
diff --git a/src/casetab.c b/src/casetab.c index a163d5204f8..3e22d0d0b77 100644 --- a/src/casetab.c +++ b/src/casetab.c | |||
| @@ -79,7 +79,7 @@ This is the one used for new buffers. */) | |||
| 79 | return Vascii_downcase_table; | 79 | return Vascii_downcase_table; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | static Lisp_Object set_case_table (Lisp_Object table, int standard); | 82 | static Lisp_Object set_case_table (Lisp_Object, bool); |
| 83 | 83 | ||
| 84 | DEFUN ("set-case-table", Fset_case_table, Sset_case_table, 1, 1, 0, | 84 | DEFUN ("set-case-table", Fset_case_table, Sset_case_table, 1, 1, 0, |
| 85 | doc: /* Select a new case table for the current buffer. | 85 | doc: /* Select a new case table for the current buffer. |
| @@ -113,7 +113,7 @@ See `set-case-table' for more info on case tables. */) | |||
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | static Lisp_Object | 115 | static Lisp_Object |
| 116 | set_case_table (Lisp_Object table, int standard) | 116 | set_case_table (Lisp_Object table, bool standard) |
| 117 | { | 117 | { |
| 118 | Lisp_Object up, canon, eqv; | 118 | Lisp_Object up, canon, eqv; |
| 119 | 119 | ||
diff --git a/src/category.c b/src/category.c index 1c9085fd558..80dc6938d8b 100644 --- a/src/category.c +++ b/src/category.c | |||
| @@ -406,17 +406,17 @@ then delete CATEGORY from the category set instead of adding it. */) | |||
| 406 | return Qnil; | 406 | return Qnil; |
| 407 | } | 407 | } |
| 408 | 408 | ||
| 409 | /* Return 1 if there is a word boundary between two word-constituent | 409 | /* Return true if there is a word boundary between two word-constituent |
| 410 | characters C1 and C2 if they appear in this order, else return 0. | 410 | characters C1 and C2 if they appear in this order. |
| 411 | Use the macro WORD_BOUNDARY_P instead of calling this function | 411 | Use the macro WORD_BOUNDARY_P instead of calling this function |
| 412 | directly. */ | 412 | directly. */ |
| 413 | 413 | ||
| 414 | int | 414 | bool |
| 415 | word_boundary_p (int c1, int c2) | 415 | word_boundary_p (int c1, int c2) |
| 416 | { | 416 | { |
| 417 | Lisp_Object category_set1, category_set2; | 417 | Lisp_Object category_set1, category_set2; |
| 418 | Lisp_Object tail; | 418 | Lisp_Object tail; |
| 419 | int default_result; | 419 | bool default_result; |
| 420 | 420 | ||
| 421 | if (EQ (CHAR_TABLE_REF (Vchar_script_table, c1), | 421 | if (EQ (CHAR_TABLE_REF (Vchar_script_table, c1), |
| 422 | CHAR_TABLE_REF (Vchar_script_table, c2))) | 422 | CHAR_TABLE_REF (Vchar_script_table, c2))) |
diff --git a/src/category.h b/src/category.h index 9fb981ed383..17cd203db45 100644 --- a/src/category.h +++ b/src/category.h | |||
| @@ -77,14 +77,14 @@ INLINE_HEADER_BEGIN | |||
| 77 | /* Return the category set of character C in the current category table. */ | 77 | /* Return the category set of character C in the current category table. */ |
| 78 | #define CATEGORY_SET(c) char_category_set (c) | 78 | #define CATEGORY_SET(c) char_category_set (c) |
| 79 | 79 | ||
| 80 | /* Return 1 if CATEGORY_SET contains CATEGORY, else return 0. | 80 | /* Return true if CATEGORY_SET contains CATEGORY. |
| 81 | The faster version of `!NILP (Faref (category_set, category))'. */ | 81 | The faster version of `!NILP (Faref (category_set, category))'. */ |
| 82 | #define CATEGORY_MEMBER(category, category_set) \ | 82 | #define CATEGORY_MEMBER(category, category_set) \ |
| 83 | ((XCATEGORY_SET (category_set)->data[(category) / 8] \ | 83 | ((XCATEGORY_SET (category_set)->data[(category) / 8] \ |
| 84 | >> ((category) % 8)) & 1) | 84 | >> ((category) % 8)) & 1) |
| 85 | 85 | ||
| 86 | /* Return 1 if category set of CH contains CATEGORY, else return 0. */ | 86 | /* Return true if category set of CH contains CATEGORY. */ |
| 87 | CATEGORY_INLINE int | 87 | CATEGORY_INLINE bool |
| 88 | CHAR_HAS_CATEGORY (int ch, int category) | 88 | CHAR_HAS_CATEGORY (int ch, int category) |
| 89 | { | 89 | { |
| 90 | Lisp_Object category_set = CATEGORY_SET (ch); | 90 | Lisp_Object category_set = CATEGORY_SET (ch); |
| @@ -108,14 +108,14 @@ CHAR_HAS_CATEGORY (int ch, int category) | |||
| 108 | #define CATEGORY_TABLE_VERSION (table) \ | 108 | #define CATEGORY_TABLE_VERSION (table) \ |
| 109 | Fchar_table_extra_slot (table, make_number (1)) | 109 | Fchar_table_extra_slot (table, make_number (1)) |
| 110 | 110 | ||
| 111 | /* Return 1 if there is a word boundary between two word-constituent | 111 | /* Return true if there is a word boundary between two |
| 112 | characters C1 and C2 if they appear in this order, else return 0. | 112 | word-constituent characters C1 and C2 if they appear in this order. |
| 113 | There is no word boundary between two word-constituent ASCII and | 113 | There is no word boundary between two word-constituent ASCII and |
| 114 | Latin-1 characters. */ | 114 | Latin-1 characters. */ |
| 115 | #define WORD_BOUNDARY_P(c1, c2) \ | 115 | #define WORD_BOUNDARY_P(c1, c2) \ |
| 116 | (!(SINGLE_BYTE_CHAR_P (c1) && SINGLE_BYTE_CHAR_P (c2)) \ | 116 | (!(SINGLE_BYTE_CHAR_P (c1) && SINGLE_BYTE_CHAR_P (c2)) \ |
| 117 | && word_boundary_p (c1, c2)) | 117 | && word_boundary_p (c1, c2)) |
| 118 | 118 | ||
| 119 | extern int word_boundary_p (int, int); | 119 | extern bool word_boundary_p (int, int); |
| 120 | 120 | ||
| 121 | INLINE_HEADER_END | 121 | INLINE_HEADER_END |
diff --git a/src/character.c b/src/character.c index b2acf36ec15..cfaaf8eeca9 100644 --- a/src/character.c +++ b/src/character.c | |||
| @@ -427,7 +427,7 @@ lisp_string_width (Lisp_Object string, ptrdiff_t precision, | |||
| 427 | /* This set multibyte to 0 even if STRING is multibyte when it | 427 | /* This set multibyte to 0 even if STRING is multibyte when it |
| 428 | contains only ascii and eight-bit-graphic, but that's | 428 | contains only ascii and eight-bit-graphic, but that's |
| 429 | intentional. */ | 429 | intentional. */ |
| 430 | int multibyte = len < SBYTES (string); | 430 | bool multibyte = len < SBYTES (string); |
| 431 | unsigned char *str = SDATA (string); | 431 | unsigned char *str = SDATA (string); |
| 432 | ptrdiff_t i = 0, i_byte = 0; | 432 | ptrdiff_t i = 0, i_byte = 0; |
| 433 | ptrdiff_t width = 0; | 433 | ptrdiff_t width = 0; |
| @@ -765,13 +765,10 @@ str_as_unibyte (unsigned char *str, ptrdiff_t bytes) | |||
| 765 | corresponding byte and store in DST. CHARS is the number of | 765 | corresponding byte and store in DST. CHARS is the number of |
| 766 | characters in SRC. The value is the number of bytes stored in DST. | 766 | characters in SRC. The value is the number of bytes stored in DST. |
| 767 | Usually, the value is the same as CHARS, but is less than it if SRC | 767 | Usually, the value is the same as CHARS, but is less than it if SRC |
| 768 | contains a non-ASCII, non-eight-bit character. If ACCEPT_LATIN_1 | 768 | contains a non-ASCII, non-eight-bit character. */ |
| 769 | is nonzero, a Latin-1 character is accepted and converted to a byte | ||
| 770 | of that character code. | ||
| 771 | Note: Currently the arg ACCEPT_LATIN_1 is not used. */ | ||
| 772 | 769 | ||
| 773 | ptrdiff_t | 770 | ptrdiff_t |
| 774 | str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, int accept_latin_1) | 771 | str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars) |
| 775 | { | 772 | { |
| 776 | ptrdiff_t i; | 773 | ptrdiff_t i; |
| 777 | 774 | ||
| @@ -781,8 +778,7 @@ str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, i | |||
| 781 | 778 | ||
| 782 | if (CHAR_BYTE8_P (c)) | 779 | if (CHAR_BYTE8_P (c)) |
| 783 | c = CHAR_TO_BYTE8 (c); | 780 | c = CHAR_TO_BYTE8 (c); |
| 784 | else if (! ASCII_CHAR_P (c) | 781 | else if (! ASCII_CHAR_P (c)) |
| 785 | && (! accept_latin_1 || c >= 0x100)) | ||
| 786 | return i; | 782 | return i; |
| 787 | *dst++ = c; | 783 | *dst++ = c; |
| 788 | } | 784 | } |
| @@ -793,7 +789,7 @@ str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, i | |||
| 793 | static ptrdiff_t | 789 | static ptrdiff_t |
| 794 | string_count_byte8 (Lisp_Object string) | 790 | string_count_byte8 (Lisp_Object string) |
| 795 | { | 791 | { |
| 796 | int multibyte = STRING_MULTIBYTE (string); | 792 | bool multibyte = STRING_MULTIBYTE (string); |
| 797 | ptrdiff_t nbytes = SBYTES (string); | 793 | ptrdiff_t nbytes = SBYTES (string); |
| 798 | unsigned char *p = SDATA (string); | 794 | unsigned char *p = SDATA (string); |
| 799 | unsigned char *pend = p + nbytes; | 795 | unsigned char *pend = p + nbytes; |
| @@ -825,7 +821,7 @@ string_escape_byte8 (Lisp_Object string) | |||
| 825 | { | 821 | { |
| 826 | ptrdiff_t nchars = SCHARS (string); | 822 | ptrdiff_t nchars = SCHARS (string); |
| 827 | ptrdiff_t nbytes = SBYTES (string); | 823 | ptrdiff_t nbytes = SBYTES (string); |
| 828 | int multibyte = STRING_MULTIBYTE (string); | 824 | bool multibyte = STRING_MULTIBYTE (string); |
| 829 | ptrdiff_t byte8_count; | 825 | ptrdiff_t byte8_count; |
| 830 | const unsigned char *src, *src_end; | 826 | const unsigned char *src, *src_end; |
| 831 | unsigned char *dst; | 827 | unsigned char *dst; |
diff --git a/src/character.h b/src/character.h index 332dfee373a..70d4e67a978 100644 --- a/src/character.h +++ b/src/character.h | |||
| @@ -676,7 +676,6 @@ extern int string_char (const unsigned char *, | |||
| 676 | const unsigned char **, int *); | 676 | const unsigned char **, int *); |
| 677 | 677 | ||
| 678 | extern int translate_char (Lisp_Object, int c); | 678 | extern int translate_char (Lisp_Object, int c); |
| 679 | extern int char_printable_p (int c); | ||
| 680 | extern void parse_str_as_multibyte (const unsigned char *, | 679 | extern void parse_str_as_multibyte (const unsigned char *, |
| 681 | ptrdiff_t, ptrdiff_t *, ptrdiff_t *); | 680 | ptrdiff_t, ptrdiff_t *, ptrdiff_t *); |
| 682 | extern ptrdiff_t count_size_as_multibyte (const unsigned char *, ptrdiff_t); | 681 | extern ptrdiff_t count_size_as_multibyte (const unsigned char *, ptrdiff_t); |
| @@ -685,7 +684,7 @@ extern ptrdiff_t str_as_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t, | |||
| 685 | extern ptrdiff_t str_to_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t); | 684 | extern ptrdiff_t str_to_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t); |
| 686 | extern ptrdiff_t str_as_unibyte (unsigned char *, ptrdiff_t); | 685 | extern ptrdiff_t str_as_unibyte (unsigned char *, ptrdiff_t); |
| 687 | extern ptrdiff_t str_to_unibyte (const unsigned char *, unsigned char *, | 686 | extern ptrdiff_t str_to_unibyte (const unsigned char *, unsigned char *, |
| 688 | ptrdiff_t, int); | 687 | ptrdiff_t); |
| 689 | extern ptrdiff_t strwidth (const char *, ptrdiff_t); | 688 | extern ptrdiff_t strwidth (const char *, ptrdiff_t); |
| 690 | extern ptrdiff_t c_string_width (const unsigned char *, ptrdiff_t, int, | 689 | extern ptrdiff_t c_string_width (const unsigned char *, ptrdiff_t, int, |
| 691 | ptrdiff_t *, ptrdiff_t *); | 690 | ptrdiff_t *, ptrdiff_t *); |
diff --git a/src/charset.c b/src/charset.c index 3e286fa947d..0673790e91c 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -215,7 +215,7 @@ static struct | |||
| 215 | 215 | ||
| 216 | /* Set to 1 to warn that a charset map is loaded and thus a buffer | 216 | /* Set to 1 to warn that a charset map is loaded and thus a buffer |
| 217 | text and a string data may be relocated. */ | 217 | text and a string data may be relocated. */ |
| 218 | int charset_map_loaded; | 218 | bool charset_map_loaded; |
| 219 | 219 | ||
| 220 | struct charset_map_entries | 220 | struct charset_map_entries |
| 221 | { | 221 | { |
| @@ -256,7 +256,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, | |||
| 256 | { | 256 | { |
| 257 | Lisp_Object vec IF_LINT (= Qnil), table IF_LINT (= Qnil); | 257 | Lisp_Object vec IF_LINT (= Qnil), table IF_LINT (= Qnil); |
| 258 | unsigned max_code = CHARSET_MAX_CODE (charset); | 258 | unsigned max_code = CHARSET_MAX_CODE (charset); |
| 259 | int ascii_compatible_p = charset->ascii_compatible_p; | 259 | bool ascii_compatible_p = charset->ascii_compatible_p; |
| 260 | int min_char, max_char, nonascii_min_char; | 260 | int min_char, max_char, nonascii_min_char; |
| 261 | int i; | 261 | int i; |
| 262 | unsigned char *fast_map = charset->fast_map; | 262 | unsigned char *fast_map = charset->fast_map; |
| @@ -423,7 +423,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, | |||
| 423 | paying attention to comment character '#'. */ | 423 | paying attention to comment character '#'. */ |
| 424 | 424 | ||
| 425 | static inline unsigned | 425 | static inline unsigned |
| 426 | read_hex (FILE *fp, int *eof, int *overflow) | 426 | read_hex (FILE *fp, bool *eof, bool *overflow) |
| 427 | { | 427 | { |
| 428 | int c; | 428 | int c; |
| 429 | unsigned n; | 429 | unsigned n; |
| @@ -512,7 +512,7 @@ load_charset_map_from_file (struct charset *charset, Lisp_Object mapfile, int co | |||
| 512 | { | 512 | { |
| 513 | unsigned from, to, c; | 513 | unsigned from, to, c; |
| 514 | int idx; | 514 | int idx; |
| 515 | int eof = 0, overflow = 0; | 515 | bool eof = 0, overflow = 0; |
| 516 | 516 | ||
| 517 | from = read_hex (fp, &eof, &overflow); | 517 | from = read_hex (fp, &eof, &overflow); |
| 518 | if (eof) | 518 | if (eof) |
| @@ -717,10 +717,8 @@ map_charset_chars (void (*c_function)(Lisp_Object, Lisp_Object), Lisp_Object fun | |||
| 717 | Lisp_Object arg, struct charset *charset, unsigned from, unsigned to) | 717 | Lisp_Object arg, struct charset *charset, unsigned from, unsigned to) |
| 718 | { | 718 | { |
| 719 | Lisp_Object range; | 719 | Lisp_Object range; |
| 720 | int partial; | 720 | bool partial = (from > CHARSET_MIN_CODE (charset) |
| 721 | 721 | || to < CHARSET_MAX_CODE (charset)); | |
| 722 | partial = (from > CHARSET_MIN_CODE (charset) | ||
| 723 | || to < CHARSET_MAX_CODE (charset)); | ||
| 724 | 722 | ||
| 725 | if (CHARSET_METHOD (charset) == CHARSET_METHOD_OFFSET) | 723 | if (CHARSET_METHOD (charset) == CHARSET_METHOD_OFFSET) |
| 726 | { | 724 | { |
| @@ -855,7 +853,7 @@ usage: (define-charset-internal ...) */) | |||
| 855 | struct charset charset; | 853 | struct charset charset; |
| 856 | int id; | 854 | int id; |
| 857 | int dimension; | 855 | int dimension; |
| 858 | int new_definition_p; | 856 | bool new_definition_p; |
| 859 | int nchars; | 857 | int nchars; |
| 860 | 858 | ||
| 861 | if (nargs != charset_arg_max) | 859 | if (nargs != charset_arg_max) |
| @@ -1250,7 +1248,7 @@ define_charset_internal (Lisp_Object name, | |||
| 1250 | const char *code_space_chars, | 1248 | const char *code_space_chars, |
| 1251 | unsigned min_code, unsigned max_code, | 1249 | unsigned min_code, unsigned max_code, |
| 1252 | int iso_final, int iso_revision, int emacs_mule_id, | 1250 | int iso_final, int iso_revision, int emacs_mule_id, |
| 1253 | int ascii_compatible, int supplementary, | 1251 | bool ascii_compatible, bool supplementary, |
| 1254 | int code_offset) | 1252 | int code_offset) |
| 1255 | { | 1253 | { |
| 1256 | const unsigned char *code_space = (const unsigned char *) code_space_chars; | 1254 | const unsigned char *code_space = (const unsigned char *) code_space_chars; |
| @@ -1448,7 +1446,7 @@ if CHARSET is designated instead. */) | |||
| 1448 | (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char, Lisp_Object charset) | 1446 | (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char, Lisp_Object charset) |
| 1449 | { | 1447 | { |
| 1450 | int id; | 1448 | int id; |
| 1451 | int chars_flag; | 1449 | bool chars_flag; |
| 1452 | 1450 | ||
| 1453 | CHECK_CHARSET_GET_ID (charset, id); | 1451 | CHECK_CHARSET_GET_ID (charset, id); |
| 1454 | check_iso_charset_parameter (dimension, chars, final_char); | 1452 | check_iso_charset_parameter (dimension, chars, final_char); |
| @@ -1499,7 +1497,9 @@ string_xstring_p (Lisp_Object string) | |||
| 1499 | It may lookup a translation table TABLE if supplied. */ | 1497 | It may lookup a translation table TABLE if supplied. */ |
| 1500 | 1498 | ||
| 1501 | static void | 1499 | static void |
| 1502 | find_charsets_in_text (const unsigned char *ptr, ptrdiff_t nchars, ptrdiff_t nbytes, Lisp_Object charsets, Lisp_Object table, int multibyte) | 1500 | find_charsets_in_text (const unsigned char *ptr, ptrdiff_t nchars, |
| 1501 | ptrdiff_t nbytes, Lisp_Object charsets, | ||
| 1502 | Lisp_Object table, bool multibyte) | ||
| 1503 | { | 1503 | { |
| 1504 | const unsigned char *pend = ptr + nbytes; | 1504 | const unsigned char *pend = ptr + nbytes; |
| 1505 | 1505 | ||
| @@ -1549,7 +1549,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */) | |||
| 1549 | ptrdiff_t from, from_byte, to, stop, stop_byte; | 1549 | ptrdiff_t from, from_byte, to, stop, stop_byte; |
| 1550 | int i; | 1550 | int i; |
| 1551 | Lisp_Object val; | 1551 | Lisp_Object val; |
| 1552 | int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); | 1552 | bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 1553 | 1553 | ||
| 1554 | validate_region (&beg, &end); | 1554 | validate_region (&beg, &end); |
| 1555 | from = XFASTINT (beg); | 1555 | from = XFASTINT (beg); |
| @@ -1735,7 +1735,7 @@ decode_char (struct charset *charset, unsigned int code) | |||
| 1735 | /* Variable used temporarily by the macro ENCODE_CHAR. */ | 1735 | /* Variable used temporarily by the macro ENCODE_CHAR. */ |
| 1736 | Lisp_Object charset_work; | 1736 | Lisp_Object charset_work; |
| 1737 | 1737 | ||
| 1738 | /* Return a code-point of CHAR in CHARSET. If CHAR doesn't belong to | 1738 | /* Return a code-point of C in CHARSET. If C doesn't belong to |
| 1739 | CHARSET, return CHARSET_INVALID_CODE (CHARSET). If STRICT is true, | 1739 | CHARSET, return CHARSET_INVALID_CODE (CHARSET). If STRICT is true, |
| 1740 | use CHARSET's strict_max_char instead of max_char. */ | 1740 | use CHARSET's strict_max_char instead of max_char. */ |
| 1741 | 1741 | ||
| @@ -1978,7 +1978,7 @@ is specified. */) | |||
| 1978 | struct charset * | 1978 | struct charset * |
| 1979 | char_charset (int c, Lisp_Object charset_list, unsigned int *code_return) | 1979 | char_charset (int c, Lisp_Object charset_list, unsigned int *code_return) |
| 1980 | { | 1980 | { |
| 1981 | int maybe_null = 0; | 1981 | bool maybe_null = 0; |
| 1982 | 1982 | ||
| 1983 | if (NILP (charset_list)) | 1983 | if (NILP (charset_list)) |
| 1984 | charset_list = Vcharset_ordered_list; | 1984 | charset_list = Vcharset_ordered_list; |
| @@ -2106,7 +2106,7 @@ DIMENSION, CHARS, and FINAL-CHAR. */) | |||
| 2106 | (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char) | 2106 | (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char) |
| 2107 | { | 2107 | { |
| 2108 | int id; | 2108 | int id; |
| 2109 | int chars_flag; | 2109 | bool chars_flag; |
| 2110 | 2110 | ||
| 2111 | check_iso_charset_parameter (dimension, chars, final_char); | 2111 | check_iso_charset_parameter (dimension, chars, final_char); |
| 2112 | chars_flag = XFASTINT (chars) == 96; | 2112 | chars_flag = XFASTINT (chars) == 96; |
diff --git a/src/charset.h b/src/charset.h index 4ef8ddc2c33..50d230489fe 100644 --- a/src/charset.h +++ b/src/charset.h | |||
| @@ -173,12 +173,24 @@ struct charset | |||
| 173 | check if a code-point is in a valid range. */ | 173 | check if a code-point is in a valid range. */ |
| 174 | unsigned char *code_space_mask; | 174 | unsigned char *code_space_mask; |
| 175 | 175 | ||
| 176 | /* 1 if there's no gap in code-points. */ | 176 | /* True if there's no gap in code-points. */ |
| 177 | int code_linear_p; | 177 | unsigned code_linear_p : 1; |
| 178 | 178 | ||
| 179 | /* If the charset is treated as 94-chars in ISO-2022, the value is 0. | 179 | /* True if the charset is treated as 96 chars in ISO-2022 |
| 180 | If the charset is treated as 96-chars in ISO-2022, the value is 1. */ | 180 | as opposed to 94 chars. */ |
| 181 | int iso_chars_96; | 181 | unsigned iso_chars_96 : 1; |
| 182 | |||
| 183 | /* True if the charset is compatible with ASCII. */ | ||
| 184 | unsigned ascii_compatible_p : 1; | ||
| 185 | |||
| 186 | /* True if the charset is supplementary. */ | ||
| 187 | unsigned supplementary_p : 1; | ||
| 188 | |||
| 189 | /* True if all the code points are representable by Lisp_Int. */ | ||
| 190 | unsigned compact_codes_p : 1; | ||
| 191 | |||
| 192 | /* True if the charset is unified with Unicode. */ | ||
| 193 | unsigned unified_p : 1; | ||
| 182 | 194 | ||
| 183 | /* ISO final byte of the charset: 48..127. It may be -1 if the | 195 | /* ISO final byte of the charset: 48..127. It may be -1 if the |
| 184 | charset doesn't conform to ISO-2022. */ | 196 | charset doesn't conform to ISO-2022. */ |
| @@ -192,15 +204,6 @@ struct charset | |||
| 192 | version. Otherwise, -1. */ | 204 | version. Otherwise, -1. */ |
| 193 | int emacs_mule_id; | 205 | int emacs_mule_id; |
| 194 | 206 | ||
| 195 | /* Nonzero if the charset is compatible with ASCII. */ | ||
| 196 | int ascii_compatible_p; | ||
| 197 | |||
| 198 | /* Nonzero if the charset is supplementary. */ | ||
| 199 | int supplementary_p; | ||
| 200 | |||
| 201 | /* Nonzero if all the code points are representable by Lisp_Int. */ | ||
| 202 | int compact_codes_p; | ||
| 203 | |||
| 204 | /* The method for encoding/decoding characters of the charset. */ | 207 | /* The method for encoding/decoding characters of the charset. */ |
| 205 | enum charset_method method; | 208 | enum charset_method method; |
| 206 | 209 | ||
| @@ -239,8 +242,6 @@ struct charset | |||
| 239 | /* Offset value to calculate a character code from code-point, and | 242 | /* Offset value to calculate a character code from code-point, and |
| 240 | visa versa. */ | 243 | visa versa. */ |
| 241 | int code_offset; | 244 | int code_offset; |
| 242 | |||
| 243 | int unified_p; | ||
| 244 | }; | 245 | }; |
| 245 | 246 | ||
| 246 | /* Hash table of charset symbols vs. the corresponding attribute | 247 | /* Hash table of charset symbols vs. the corresponding attribute |
| @@ -456,7 +457,7 @@ extern Lisp_Object charset_work; | |||
| 456 | 457 | ||
| 457 | /* Set to 1 when a charset map is loaded to warn that a buffer text | 458 | /* Set to 1 when a charset map is loaded to warn that a buffer text |
| 458 | and a string data may be relocated. */ | 459 | and a string data may be relocated. */ |
| 459 | extern int charset_map_loaded; | 460 | extern bool charset_map_loaded; |
| 460 | 461 | ||
| 461 | 462 | ||
| 462 | /* Set CHARSET to the charset highest priority of C, CODE to the | 463 | /* Set CHARSET to the charset highest priority of C, CODE to the |
| @@ -474,10 +475,10 @@ extern int charset_map_loaded; | |||
| 474 | macro ISO_CHARSET_TABLE (DIMENSION, CHARS, FINAL_CHAR). */ | 475 | macro ISO_CHARSET_TABLE (DIMENSION, CHARS, FINAL_CHAR). */ |
| 475 | extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; | 476 | extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; |
| 476 | 477 | ||
| 477 | /* A charset of type iso2022 who has DIMENSION, CHARS, and FINAL | 478 | /* A charset of type iso2022 who has DIMENSION, CHARS_96, and FINAL |
| 478 | (final character). */ | 479 | (final character). */ |
| 479 | #define ISO_CHARSET_TABLE(dimension, chars_96, final) \ | 480 | #define ISO_CHARSET_TABLE(dimension, chars_96, final) \ |
| 480 | iso_charset_table[(dimension) - 1][(chars_96)][(final)] | 481 | iso_charset_table[(dimension) - 1][chars_96][final] |
| 481 | 482 | ||
| 482 | /* Nonzero if the charset who has FAST_MAP may contain C. */ | 483 | /* Nonzero if the charset who has FAST_MAP may contain C. */ |
| 483 | #define CHARSET_FAST_MAP_REF(c, fast_map) \ | 484 | #define CHARSET_FAST_MAP_REF(c, fast_map) \ |
| @@ -495,7 +496,7 @@ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; | |||
| 495 | 496 | ||
| 496 | 497 | ||
| 497 | 498 | ||
| 498 | /* 1 if CHARSET may contain the character C. */ | 499 | /* True if CHARSET may contain the character C. */ |
| 499 | #define CHAR_CHARSET_P(c, charset) \ | 500 | #define CHAR_CHARSET_P(c, charset) \ |
| 500 | ((ASCII_CHAR_P (c) && (charset)->ascii_compatible_p) \ | 501 | ((ASCII_CHAR_P (c) && (charset)->ascii_compatible_p) \ |
| 501 | || ((CHARSET_UNIFIED_P (charset) \ | 502 | || ((CHARSET_UNIFIED_P (charset) \ |
diff --git a/src/chartab.c b/src/chartab.c index 711a49ed397..c14df0ebac6 100644 --- a/src/chartab.c +++ b/src/chartab.c | |||
| @@ -200,7 +200,7 @@ copy_char_table (Lisp_Object table) | |||
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | static Lisp_Object | 202 | static Lisp_Object |
| 203 | sub_char_table_ref (Lisp_Object table, int c, int is_uniprop) | 203 | sub_char_table_ref (Lisp_Object table, int c, bool is_uniprop) |
| 204 | { | 204 | { |
| 205 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 205 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 206 | int depth = XINT (tbl->depth); | 206 | int depth = XINT (tbl->depth); |
| @@ -245,7 +245,7 @@ char_table_ref (Lisp_Object table, int c) | |||
| 245 | 245 | ||
| 246 | static Lisp_Object | 246 | static Lisp_Object |
| 247 | sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, | 247 | sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, |
| 248 | Lisp_Object defalt, int is_uniprop) | 248 | Lisp_Object defalt, bool is_uniprop) |
| 249 | { | 249 | { |
| 250 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 250 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 251 | int depth = XINT (tbl->depth); | 251 | int depth = XINT (tbl->depth); |
| @@ -320,7 +320,7 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to) | |||
| 320 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); | 320 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); |
| 321 | int chartab_idx = CHARTAB_IDX (c, 0, 0), idx; | 321 | int chartab_idx = CHARTAB_IDX (c, 0, 0), idx; |
| 322 | Lisp_Object val; | 322 | Lisp_Object val; |
| 323 | int is_uniprop = UNIPROP_TABLE_P (table); | 323 | bool is_uniprop = UNIPROP_TABLE_P (table); |
| 324 | 324 | ||
| 325 | val = tbl->contents[chartab_idx]; | 325 | val = tbl->contents[chartab_idx]; |
| 326 | if (*from < 0) | 326 | if (*from < 0) |
| @@ -382,7 +382,7 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to) | |||
| 382 | 382 | ||
| 383 | 383 | ||
| 384 | static void | 384 | static void |
| 385 | sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, int is_uniprop) | 385 | sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, bool is_uniprop) |
| 386 | { | 386 | { |
| 387 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 387 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 388 | int depth = XINT ((tbl)->depth); | 388 | int depth = XINT ((tbl)->depth); |
| @@ -438,7 +438,7 @@ char_table_set (Lisp_Object table, int c, Lisp_Object val) | |||
| 438 | 438 | ||
| 439 | static void | 439 | static void |
| 440 | sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val, | 440 | sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val, |
| 441 | int is_uniprop) | 441 | bool is_uniprop) |
| 442 | { | 442 | { |
| 443 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 443 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 444 | int depth = XINT ((tbl)->depth); | 444 | int depth = XINT ((tbl)->depth); |
| @@ -484,7 +484,7 @@ char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val) | |||
| 484 | char_table_set (table, from, val); | 484 | char_table_set (table, from, val); |
| 485 | else | 485 | else |
| 486 | { | 486 | { |
| 487 | int is_uniprop = UNIPROP_TABLE_P (table); | 487 | bool is_uniprop = UNIPROP_TABLE_P (table); |
| 488 | int lim = CHARTAB_IDX (to, 0, 0); | 488 | int lim = CHARTAB_IDX (to, 0, 0); |
| 489 | int i, c; | 489 | int i, c; |
| 490 | 490 | ||
| @@ -683,7 +683,8 @@ optimize_sub_char_table (Lisp_Object table, Lisp_Object test) | |||
| 683 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 683 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 684 | int depth = XINT (tbl->depth); | 684 | int depth = XINT (tbl->depth); |
| 685 | Lisp_Object elt, this; | 685 | Lisp_Object elt, this; |
| 686 | int i, optimizable; | 686 | int i; |
| 687 | bool optimizable; | ||
| 687 | 688 | ||
| 688 | elt = XSUB_CHAR_TABLE (table)->contents[0]; | 689 | elt = XSUB_CHAR_TABLE (table)->contents[0]; |
| 689 | if (SUB_CHAR_TABLE_P (elt)) | 690 | if (SUB_CHAR_TABLE_P (elt)) |
| @@ -762,7 +763,7 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), | |||
| 762 | int chars_in_block; | 763 | int chars_in_block; |
| 763 | int from = XINT (XCAR (range)), to = XINT (XCDR (range)); | 764 | int from = XINT (XCAR (range)), to = XINT (XCDR (range)); |
| 764 | int i, c; | 765 | int i, c; |
| 765 | int is_uniprop = UNIPROP_TABLE_P (top); | 766 | bool is_uniprop = UNIPROP_TABLE_P (top); |
| 766 | uniprop_decoder_t decoder = UNIPROP_GET_DECODER (top); | 767 | uniprop_decoder_t decoder = UNIPROP_GET_DECODER (top); |
| 767 | 768 | ||
| 768 | if (SUB_CHAR_TABLE_P (table)) | 769 | if (SUB_CHAR_TABLE_P (table)) |
| @@ -811,7 +812,7 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), | |||
| 811 | this = XCHAR_TABLE (top)->defalt; | 812 | this = XCHAR_TABLE (top)->defalt; |
| 812 | if (!EQ (val, this)) | 813 | if (!EQ (val, this)) |
| 813 | { | 814 | { |
| 814 | int different_value = 1; | 815 | bool different_value = 1; |
| 815 | 816 | ||
| 816 | if (NILP (val)) | 817 | if (NILP (val)) |
| 817 | { | 818 | { |
diff --git a/src/cmds.c b/src/cmds.c index b416135ee9e..90d3cd6dced 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -47,10 +47,10 @@ DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, | |||
| 47 | return make_number (PT + XINT (n)); | 47 | return make_number (PT + XINT (n)); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | /* Add N to point; or subtract N if FORWARD is zero. N defaults to 1. | 50 | /* Add N to point; or subtract N if FORWARD is false. N defaults to 1. |
| 51 | Validate the new location. Return nil. */ | 51 | Validate the new location. Return nil. */ |
| 52 | static Lisp_Object | 52 | static Lisp_Object |
| 53 | move_point (Lisp_Object n, int forward) | 53 | move_point (Lisp_Object n, bool forward) |
| 54 | { | 54 | { |
| 55 | /* This used to just set point to point + XINT (n), and then check | 55 | /* This used to just set point to point + XINT (n), and then check |
| 56 | to see if it was within boundaries. But now that SET_PT can | 56 | to see if it was within boundaries. But now that SET_PT can |
| @@ -277,7 +277,7 @@ After insertion, the value of `auto-fill-function' is called if the | |||
| 277 | At the end, it runs `post-self-insert-hook'. */) | 277 | At the end, it runs `post-self-insert-hook'. */) |
| 278 | (Lisp_Object n) | 278 | (Lisp_Object n) |
| 279 | { | 279 | { |
| 280 | int remove_boundary = 1; | 280 | bool remove_boundary = 1; |
| 281 | CHECK_NATNUM (n); | 281 | CHECK_NATNUM (n); |
| 282 | 282 | ||
| 283 | if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command))) | 283 | if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command))) |
| @@ -438,7 +438,7 @@ internal_self_insert (int c, EMACS_INT n) | |||
| 438 | : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ()))) | 438 | : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ()))) |
| 439 | == Sword)) | 439 | == Sword)) |
| 440 | { | 440 | { |
| 441 | int modiff = MODIFF; | 441 | EMACS_INT modiff = MODIFF; |
| 442 | Lisp_Object sym; | 442 | Lisp_Object sym; |
| 443 | 443 | ||
| 444 | sym = call0 (Qexpand_abbrev); | 444 | sym = call0 (Qexpand_abbrev); |
diff --git a/src/coding.c b/src/coding.c index 971686dc180..02e7b34695e 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -147,18 +147,18 @@ STRUCT CODING_SYSTEM | |||
| 147 | CODING conforms to the format of XXX, and update the members of | 147 | CODING conforms to the format of XXX, and update the members of |
| 148 | DETECT_INFO. | 148 | DETECT_INFO. |
| 149 | 149 | ||
| 150 | Return 1 if the byte sequence conforms to XXX, otherwise return 0. | 150 | Return true if the byte sequence conforms to XXX. |
| 151 | 151 | ||
| 152 | Below is the template of these functions. */ | 152 | Below is the template of these functions. */ |
| 153 | 153 | ||
| 154 | #if 0 | 154 | #if 0 |
| 155 | static int | 155 | static bool |
| 156 | detect_coding_XXX (struct coding_system *coding, | 156 | detect_coding_XXX (struct coding_system *coding, |
| 157 | struct coding_detection_info *detect_info) | 157 | struct coding_detection_info *detect_info) |
| 158 | { | 158 | { |
| 159 | const unsigned char *src = coding->source; | 159 | const unsigned char *src = coding->source; |
| 160 | const unsigned char *src_end = coding->source + coding->src_bytes; | 160 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 161 | int multibytep = coding->src_multibyte; | 161 | bool multibytep = coding->src_multibyte; |
| 162 | ptrdiff_t consumed_chars = 0; | 162 | ptrdiff_t consumed_chars = 0; |
| 163 | int found = 0; | 163 | int found = 0; |
| 164 | ...; | 164 | ...; |
| @@ -212,7 +212,7 @@ decode_coding_XXXX (struct coding_system *coding) | |||
| 212 | /* A buffer to produce decoded characters. */ | 212 | /* A buffer to produce decoded characters. */ |
| 213 | int *charbuf = coding->charbuf + coding->charbuf_used; | 213 | int *charbuf = coding->charbuf + coding->charbuf_used; |
| 214 | int *charbuf_end = coding->charbuf + coding->charbuf_size; | 214 | int *charbuf_end = coding->charbuf + coding->charbuf_size; |
| 215 | int multibytep = coding->src_multibyte; | 215 | bool multibytep = coding->src_multibyte; |
| 216 | 216 | ||
| 217 | while (1) | 217 | while (1) |
| 218 | { | 218 | { |
| @@ -260,7 +260,7 @@ decode_coding_XXXX (struct coding_system *coding) | |||
| 260 | static void | 260 | static void |
| 261 | encode_coding_XXX (struct coding_system *coding) | 261 | encode_coding_XXX (struct coding_system *coding) |
| 262 | { | 262 | { |
| 263 | int multibytep = coding->dst_multibyte; | 263 | bool multibytep = coding->dst_multibyte; |
| 264 | int *charbuf = coding->charbuf; | 264 | int *charbuf = coding->charbuf; |
| 265 | int *charbuf_end = charbuf->charbuf + coding->charbuf_used; | 265 | int *charbuf_end = charbuf->charbuf + coding->charbuf_used; |
| 266 | unsigned char *dst = coding->destination + coding->produced; | 266 | unsigned char *dst = coding->destination + coding->produced; |
| @@ -651,8 +651,8 @@ static struct coding_system coding_categories[coding_category_max]; | |||
| 651 | 651 | ||
| 652 | /* Safely get one byte from the source text pointed by SRC which ends | 652 | /* Safely get one byte from the source text pointed by SRC which ends |
| 653 | at SRC_END, and set C to that byte. If there are not enough bytes | 653 | at SRC_END, and set C to that byte. If there are not enough bytes |
| 654 | in the source, it jumps to `no_more_source'. If multibytep is | 654 | in the source, it jumps to 'no_more_source'. If MULTIBYTEP, |
| 655 | nonzero, and a multibyte character is found at SRC, set C to the | 655 | and a multibyte character is found at SRC, set C to the |
| 656 | negative value of the character code. The caller should declare | 656 | negative value of the character code. The caller should declare |
| 657 | and set these variables appropriately in advance: | 657 | and set these variables appropriately in advance: |
| 658 | src, src_end, multibytep */ | 658 | src, src_end, multibytep */ |
| @@ -685,7 +685,7 @@ static struct coding_system coding_categories[coding_category_max]; | |||
| 685 | /* Safely get two bytes from the source text pointed by SRC which ends | 685 | /* Safely get two bytes from the source text pointed by SRC which ends |
| 686 | at SRC_END, and set C1 and C2 to those bytes while skipping the | 686 | at SRC_END, and set C1 and C2 to those bytes while skipping the |
| 687 | heading multibyte characters. If there are not enough bytes in the | 687 | heading multibyte characters. If there are not enough bytes in the |
| 688 | source, it jumps to `no_more_source'. If multibytep is nonzero and | 688 | source, it jumps to 'no_more_source'. If MULTIBYTEP and |
| 689 | a multibyte character is found for C2, set C2 to the negative value | 689 | a multibyte character is found for C2, set C2 to the negative value |
| 690 | of the character code. The caller should declare and set these | 690 | of the character code. The caller should declare and set these |
| 691 | variables appropriately in advance: | 691 | variables appropriately in advance: |
| @@ -746,8 +746,8 @@ static struct coding_system coding_categories[coding_category_max]; | |||
| 746 | 746 | ||
| 747 | 747 | ||
| 748 | /* Store a byte C in the place pointed by DST and increment DST to the | 748 | /* Store a byte C in the place pointed by DST and increment DST to the |
| 749 | next free point, and increment PRODUCED_CHARS. If MULTIBYTEP is | 749 | next free point, and increment PRODUCED_CHARS. If MULTIBYTEP, |
| 750 | nonzero, store in an appropriate multibyte from. The caller should | 750 | store in an appropriate multibyte form. The caller should |
| 751 | declare and set the variables `dst' and `multibytep' appropriately | 751 | declare and set the variables `dst' and `multibytep' appropriately |
| 752 | in advance. */ | 752 | in advance. */ |
| 753 | 753 | ||
| @@ -806,83 +806,6 @@ static struct coding_system coding_categories[coding_category_max]; | |||
| 806 | } while (0) | 806 | } while (0) |
| 807 | 807 | ||
| 808 | 808 | ||
| 809 | /* Prototypes for static functions. */ | ||
| 810 | static void record_conversion_result (struct coding_system *coding, | ||
| 811 | enum coding_result_code result); | ||
| 812 | static int detect_coding_utf_8 (struct coding_system *, | ||
| 813 | struct coding_detection_info *info); | ||
| 814 | static void decode_coding_utf_8 (struct coding_system *); | ||
| 815 | static int encode_coding_utf_8 (struct coding_system *); | ||
| 816 | |||
| 817 | static int detect_coding_utf_16 (struct coding_system *, | ||
| 818 | struct coding_detection_info *info); | ||
| 819 | static void decode_coding_utf_16 (struct coding_system *); | ||
| 820 | static int encode_coding_utf_16 (struct coding_system *); | ||
| 821 | |||
| 822 | static int detect_coding_iso_2022 (struct coding_system *, | ||
| 823 | struct coding_detection_info *info); | ||
| 824 | static void decode_coding_iso_2022 (struct coding_system *); | ||
| 825 | static int encode_coding_iso_2022 (struct coding_system *); | ||
| 826 | |||
| 827 | static int detect_coding_emacs_mule (struct coding_system *, | ||
| 828 | struct coding_detection_info *info); | ||
| 829 | static void decode_coding_emacs_mule (struct coding_system *); | ||
| 830 | static int encode_coding_emacs_mule (struct coding_system *); | ||
| 831 | |||
| 832 | static int detect_coding_sjis (struct coding_system *, | ||
| 833 | struct coding_detection_info *info); | ||
| 834 | static void decode_coding_sjis (struct coding_system *); | ||
| 835 | static int encode_coding_sjis (struct coding_system *); | ||
| 836 | |||
| 837 | static int detect_coding_big5 (struct coding_system *, | ||
| 838 | struct coding_detection_info *info); | ||
| 839 | static void decode_coding_big5 (struct coding_system *); | ||
| 840 | static int encode_coding_big5 (struct coding_system *); | ||
| 841 | |||
| 842 | static int detect_coding_ccl (struct coding_system *, | ||
| 843 | struct coding_detection_info *info); | ||
| 844 | static void decode_coding_ccl (struct coding_system *); | ||
| 845 | static int encode_coding_ccl (struct coding_system *); | ||
| 846 | |||
| 847 | static void decode_coding_raw_text (struct coding_system *); | ||
| 848 | static int encode_coding_raw_text (struct coding_system *); | ||
| 849 | |||
| 850 | static void coding_set_source (struct coding_system *); | ||
| 851 | static ptrdiff_t coding_change_source (struct coding_system *); | ||
| 852 | static void coding_set_destination (struct coding_system *); | ||
| 853 | static ptrdiff_t coding_change_destination (struct coding_system *); | ||
| 854 | static void coding_alloc_by_realloc (struct coding_system *, ptrdiff_t); | ||
| 855 | static void coding_alloc_by_making_gap (struct coding_system *, | ||
| 856 | ptrdiff_t, ptrdiff_t); | ||
| 857 | static unsigned char *alloc_destination (struct coding_system *, | ||
| 858 | ptrdiff_t, unsigned char *); | ||
| 859 | static void setup_iso_safe_charsets (Lisp_Object); | ||
| 860 | static ptrdiff_t encode_designation_at_bol (struct coding_system *, | ||
| 861 | int *, int *, unsigned char *); | ||
| 862 | static int detect_eol (const unsigned char *, | ||
| 863 | ptrdiff_t, enum coding_category); | ||
| 864 | static Lisp_Object adjust_coding_eol_type (struct coding_system *, int); | ||
| 865 | static void decode_eol (struct coding_system *); | ||
| 866 | static Lisp_Object get_translation_table (Lisp_Object, int, int *); | ||
| 867 | static Lisp_Object get_translation (Lisp_Object, int *, int *); | ||
| 868 | static int produce_chars (struct coding_system *, Lisp_Object, int); | ||
| 869 | static inline void produce_charset (struct coding_system *, int *, | ||
| 870 | ptrdiff_t); | ||
| 871 | static void produce_annotation (struct coding_system *, ptrdiff_t); | ||
| 872 | static int decode_coding (struct coding_system *); | ||
| 873 | static inline int *handle_composition_annotation (ptrdiff_t, ptrdiff_t, | ||
| 874 | struct coding_system *, | ||
| 875 | int *, ptrdiff_t *); | ||
| 876 | static inline int *handle_charset_annotation (ptrdiff_t, ptrdiff_t, | ||
| 877 | struct coding_system *, | ||
| 878 | int *, ptrdiff_t *); | ||
| 879 | static void consume_chars (struct coding_system *, Lisp_Object, int); | ||
| 880 | static int encode_coding (struct coding_system *); | ||
| 881 | static Lisp_Object make_conversion_work_buffer (int); | ||
| 882 | static Lisp_Object code_conversion_restore (Lisp_Object); | ||
| 883 | static inline int char_encodable_p (int, Lisp_Object); | ||
| 884 | static Lisp_Object make_subsidiaries (Lisp_Object); | ||
| 885 | |||
| 886 | static void | 809 | static void |
| 887 | record_conversion_result (struct coding_system *coding, | 810 | record_conversion_result (struct coding_system *coding, |
| 888 | enum coding_result_code result) | 811 | enum coding_result_code result) |
| @@ -1264,8 +1187,7 @@ alloc_destination (struct coding_system *coding, ptrdiff_t nbytes, | |||
| 1264 | /*** 3. UTF-8 ***/ | 1187 | /*** 3. UTF-8 ***/ |
| 1265 | 1188 | ||
| 1266 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 1189 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| 1267 | Check if a text is encoded in UTF-8. If it is, return 1, else | 1190 | Return true if a text is encoded in UTF-8. */ |
| 1268 | return 0. */ | ||
| 1269 | 1191 | ||
| 1270 | #define UTF_8_1_OCTET_P(c) ((c) < 0x80) | 1192 | #define UTF_8_1_OCTET_P(c) ((c) < 0x80) |
| 1271 | #define UTF_8_EXTRA_OCTET_P(c) (((c) & 0xC0) == 0x80) | 1193 | #define UTF_8_EXTRA_OCTET_P(c) (((c) & 0xC0) == 0x80) |
| @@ -1278,16 +1200,16 @@ alloc_destination (struct coding_system *coding, ptrdiff_t nbytes, | |||
| 1278 | #define UTF_8_BOM_2 0xBB | 1200 | #define UTF_8_BOM_2 0xBB |
| 1279 | #define UTF_8_BOM_3 0xBF | 1201 | #define UTF_8_BOM_3 0xBF |
| 1280 | 1202 | ||
| 1281 | static int | 1203 | static bool |
| 1282 | detect_coding_utf_8 (struct coding_system *coding, | 1204 | detect_coding_utf_8 (struct coding_system *coding, |
| 1283 | struct coding_detection_info *detect_info) | 1205 | struct coding_detection_info *detect_info) |
| 1284 | { | 1206 | { |
| 1285 | const unsigned char *src = coding->source, *src_base; | 1207 | const unsigned char *src = coding->source, *src_base; |
| 1286 | const unsigned char *src_end = coding->source + coding->src_bytes; | 1208 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 1287 | int multibytep = coding->src_multibyte; | 1209 | bool multibytep = coding->src_multibyte; |
| 1288 | ptrdiff_t consumed_chars = 0; | 1210 | ptrdiff_t consumed_chars = 0; |
| 1289 | int bom_found = 0; | 1211 | bool bom_found = 0; |
| 1290 | int found = 0; | 1212 | bool found = 0; |
| 1291 | 1213 | ||
| 1292 | detect_info->checked |= CATEGORY_MASK_UTF_8; | 1214 | detect_info->checked |= CATEGORY_MASK_UTF_8; |
| 1293 | /* A coding system of this category is always ASCII compatible. */ | 1215 | /* A coding system of this category is always ASCII compatible. */ |
| @@ -1371,10 +1293,10 @@ decode_coding_utf_8 (struct coding_system *coding) | |||
| 1371 | int *charbuf = coding->charbuf + coding->charbuf_used; | 1293 | int *charbuf = coding->charbuf + coding->charbuf_used; |
| 1372 | int *charbuf_end = coding->charbuf + coding->charbuf_size; | 1294 | int *charbuf_end = coding->charbuf + coding->charbuf_size; |
| 1373 | ptrdiff_t consumed_chars = 0, consumed_chars_base = 0; | 1295 | ptrdiff_t consumed_chars = 0, consumed_chars_base = 0; |
| 1374 | int multibytep = coding->src_multibyte; | 1296 | bool multibytep = coding->src_multibyte; |
| 1375 | enum utf_bom_type bom = CODING_UTF_8_BOM (coding); | 1297 | enum utf_bom_type bom = CODING_UTF_8_BOM (coding); |
| 1376 | int eol_dos = | 1298 | bool eol_dos |
| 1377 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 1299 | = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); |
| 1378 | int byte_after_cr = -1; | 1300 | int byte_after_cr = -1; |
| 1379 | 1301 | ||
| 1380 | if (bom != utf_without_bom) | 1302 | if (bom != utf_without_bom) |
| @@ -1513,10 +1435,10 @@ decode_coding_utf_8 (struct coding_system *coding) | |||
| 1513 | } | 1435 | } |
| 1514 | 1436 | ||
| 1515 | 1437 | ||
| 1516 | static int | 1438 | static bool |
| 1517 | encode_coding_utf_8 (struct coding_system *coding) | 1439 | encode_coding_utf_8 (struct coding_system *coding) |
| 1518 | { | 1440 | { |
| 1519 | int multibytep = coding->dst_multibyte; | 1441 | bool multibytep = coding->dst_multibyte; |
| 1520 | int *charbuf = coding->charbuf; | 1442 | int *charbuf = coding->charbuf; |
| 1521 | int *charbuf_end = charbuf + coding->charbuf_used; | 1443 | int *charbuf_end = charbuf + coding->charbuf_used; |
| 1522 | unsigned char *dst = coding->destination + coding->produced; | 1444 | unsigned char *dst = coding->destination + coding->produced; |
| @@ -1577,8 +1499,7 @@ encode_coding_utf_8 (struct coding_system *coding) | |||
| 1577 | 1499 | ||
| 1578 | 1500 | ||
| 1579 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 1501 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| 1580 | Check if a text is encoded in one of UTF-16 based coding systems. | 1502 | Return true if a text is encoded in one of UTF-16 based coding systems. */ |
| 1581 | If it is, return 1, else return 0. */ | ||
| 1582 | 1503 | ||
| 1583 | #define UTF_16_HIGH_SURROGATE_P(val) \ | 1504 | #define UTF_16_HIGH_SURROGATE_P(val) \ |
| 1584 | (((val) & 0xFC00) == 0xD800) | 1505 | (((val) & 0xFC00) == 0xD800) |
| @@ -1587,13 +1508,13 @@ encode_coding_utf_8 (struct coding_system *coding) | |||
| 1587 | (((val) & 0xFC00) == 0xDC00) | 1508 | (((val) & 0xFC00) == 0xDC00) |
| 1588 | 1509 | ||
| 1589 | 1510 | ||
| 1590 | static int | 1511 | static bool |
| 1591 | detect_coding_utf_16 (struct coding_system *coding, | 1512 | detect_coding_utf_16 (struct coding_system *coding, |
| 1592 | struct coding_detection_info *detect_info) | 1513 | struct coding_detection_info *detect_info) |
| 1593 | { | 1514 | { |
| 1594 | const unsigned char *src = coding->source; | 1515 | const unsigned char *src = coding->source; |
| 1595 | const unsigned char *src_end = coding->source + coding->src_bytes; | 1516 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 1596 | int multibytep = coding->src_multibyte; | 1517 | bool multibytep = coding->src_multibyte; |
| 1597 | int c1, c2; | 1518 | int c1, c2; |
| 1598 | 1519 | ||
| 1599 | detect_info->checked |= CATEGORY_MASK_UTF_16; | 1520 | detect_info->checked |= CATEGORY_MASK_UTF_16; |
| @@ -1680,12 +1601,12 @@ decode_coding_utf_16 (struct coding_system *coding) | |||
| 1680 | /* We may produces at most 3 chars in one loop. */ | 1601 | /* We may produces at most 3 chars in one loop. */ |
| 1681 | int *charbuf_end = coding->charbuf + coding->charbuf_size - 2; | 1602 | int *charbuf_end = coding->charbuf + coding->charbuf_size - 2; |
| 1682 | ptrdiff_t consumed_chars = 0, consumed_chars_base = 0; | 1603 | ptrdiff_t consumed_chars = 0, consumed_chars_base = 0; |
| 1683 | int multibytep = coding->src_multibyte; | 1604 | bool multibytep = coding->src_multibyte; |
| 1684 | enum utf_bom_type bom = CODING_UTF_16_BOM (coding); | 1605 | enum utf_bom_type bom = CODING_UTF_16_BOM (coding); |
| 1685 | enum utf_16_endian_type endian = CODING_UTF_16_ENDIAN (coding); | 1606 | enum utf_16_endian_type endian = CODING_UTF_16_ENDIAN (coding); |
| 1686 | int surrogate = CODING_UTF_16_SURROGATE (coding); | 1607 | int surrogate = CODING_UTF_16_SURROGATE (coding); |
| 1687 | int eol_dos = | 1608 | bool eol_dos |
| 1688 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 1609 | = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); |
| 1689 | int byte_after_cr1 = -1, byte_after_cr2 = -1; | 1610 | int byte_after_cr1 = -1, byte_after_cr2 = -1; |
| 1690 | 1611 | ||
| 1691 | if (bom == utf_with_bom) | 1612 | if (bom == utf_with_bom) |
| @@ -1795,17 +1716,17 @@ decode_coding_utf_16 (struct coding_system *coding) | |||
| 1795 | coding->charbuf_used = charbuf - coding->charbuf; | 1716 | coding->charbuf_used = charbuf - coding->charbuf; |
| 1796 | } | 1717 | } |
| 1797 | 1718 | ||
| 1798 | static int | 1719 | static bool |
| 1799 | encode_coding_utf_16 (struct coding_system *coding) | 1720 | encode_coding_utf_16 (struct coding_system *coding) |
| 1800 | { | 1721 | { |
| 1801 | int multibytep = coding->dst_multibyte; | 1722 | bool multibytep = coding->dst_multibyte; |
| 1802 | int *charbuf = coding->charbuf; | 1723 | int *charbuf = coding->charbuf; |
| 1803 | int *charbuf_end = charbuf + coding->charbuf_used; | 1724 | int *charbuf_end = charbuf + coding->charbuf_used; |
| 1804 | unsigned char *dst = coding->destination + coding->produced; | 1725 | unsigned char *dst = coding->destination + coding->produced; |
| 1805 | unsigned char *dst_end = coding->destination + coding->dst_bytes; | 1726 | unsigned char *dst_end = coding->destination + coding->dst_bytes; |
| 1806 | int safe_room = 8; | 1727 | int safe_room = 8; |
| 1807 | enum utf_bom_type bom = CODING_UTF_16_BOM (coding); | 1728 | enum utf_bom_type bom = CODING_UTF_16_BOM (coding); |
| 1808 | int big_endian = CODING_UTF_16_ENDIAN (coding) == utf_16_big_endian; | 1729 | bool big_endian = CODING_UTF_16_ENDIAN (coding) == utf_16_big_endian; |
| 1809 | ptrdiff_t produced_chars = 0; | 1730 | ptrdiff_t produced_chars = 0; |
| 1810 | int c; | 1731 | int c; |
| 1811 | 1732 | ||
| @@ -1930,16 +1851,15 @@ char emacs_mule_bytes[256]; | |||
| 1930 | 1851 | ||
| 1931 | 1852 | ||
| 1932 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 1853 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| 1933 | Check if a text is encoded in `emacs-mule'. If it is, return 1, | 1854 | Return true if a text is encoded in 'emacs-mule'. */ |
| 1934 | else return 0. */ | ||
| 1935 | 1855 | ||
| 1936 | static int | 1856 | static bool |
| 1937 | detect_coding_emacs_mule (struct coding_system *coding, | 1857 | detect_coding_emacs_mule (struct coding_system *coding, |
| 1938 | struct coding_detection_info *detect_info) | 1858 | struct coding_detection_info *detect_info) |
| 1939 | { | 1859 | { |
| 1940 | const unsigned char *src = coding->source, *src_base; | 1860 | const unsigned char *src = coding->source, *src_base; |
| 1941 | const unsigned char *src_end = coding->source + coding->src_bytes; | 1861 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 1942 | int multibytep = coding->src_multibyte; | 1862 | bool multibytep = coding->src_multibyte; |
| 1943 | ptrdiff_t consumed_chars = 0; | 1863 | ptrdiff_t consumed_chars = 0; |
| 1944 | int c; | 1864 | int c; |
| 1945 | int found = 0; | 1865 | int found = 0; |
| @@ -2029,12 +1949,12 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, | |||
| 2029 | { | 1949 | { |
| 2030 | const unsigned char *src_end = coding->source + coding->src_bytes; | 1950 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 2031 | const unsigned char *src_base = src; | 1951 | const unsigned char *src_base = src; |
| 2032 | int multibytep = coding->src_multibyte; | 1952 | bool multibytep = coding->src_multibyte; |
| 2033 | int charset_ID; | 1953 | int charset_ID; |
| 2034 | unsigned code; | 1954 | unsigned code; |
| 2035 | int c; | 1955 | int c; |
| 2036 | int consumed_chars = 0; | 1956 | int consumed_chars = 0; |
| 2037 | int mseq_found = 0; | 1957 | bool mseq_found = 0; |
| 2038 | 1958 | ||
| 2039 | ONE_MORE_BYTE (c); | 1959 | ONE_MORE_BYTE (c); |
| 2040 | if (c < 0) | 1960 | if (c < 0) |
| @@ -2411,12 +2331,12 @@ decode_coding_emacs_mule (struct coding_system *coding) | |||
| 2411 | /* We can produce up to 2 characters in a loop. */ | 2331 | /* We can produce up to 2 characters in a loop. */ |
| 2412 | - 1; | 2332 | - 1; |
| 2413 | ptrdiff_t consumed_chars = 0, consumed_chars_base; | 2333 | ptrdiff_t consumed_chars = 0, consumed_chars_base; |
| 2414 | int multibytep = coding->src_multibyte; | 2334 | bool multibytep = coding->src_multibyte; |
| 2415 | ptrdiff_t char_offset = coding->produced_char; | 2335 | ptrdiff_t char_offset = coding->produced_char; |
| 2416 | ptrdiff_t last_offset = char_offset; | 2336 | ptrdiff_t last_offset = char_offset; |
| 2417 | int last_id = charset_ascii; | 2337 | int last_id = charset_ascii; |
| 2418 | int eol_dos = | 2338 | bool eol_dos |
| 2419 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 2339 | = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); |
| 2420 | int byte_after_cr = -1; | 2340 | int byte_after_cr = -1; |
| 2421 | struct composition_status *cmp_status = &coding->spec.emacs_mule.cmp_status; | 2341 | struct composition_status *cmp_status = &coding->spec.emacs_mule.cmp_status; |
| 2422 | 2342 | ||
| @@ -2657,10 +2577,10 @@ decode_coding_emacs_mule (struct coding_system *coding) | |||
| 2657 | } while (0); | 2577 | } while (0); |
| 2658 | 2578 | ||
| 2659 | 2579 | ||
| 2660 | static int | 2580 | static bool |
| 2661 | encode_coding_emacs_mule (struct coding_system *coding) | 2581 | encode_coding_emacs_mule (struct coding_system *coding) |
| 2662 | { | 2582 | { |
| 2663 | int multibytep = coding->dst_multibyte; | 2583 | bool multibytep = coding->dst_multibyte; |
| 2664 | int *charbuf = coding->charbuf; | 2584 | int *charbuf = coding->charbuf; |
| 2665 | int *charbuf_end = charbuf + coding->charbuf_used; | 2585 | int *charbuf_end = charbuf + coding->charbuf_used; |
| 2666 | unsigned char *dst = coding->destination + coding->produced; | 2586 | unsigned char *dst = coding->destination + coding->produced; |
| @@ -2722,7 +2642,7 @@ encode_coding_emacs_mule (struct coding_system *coding) | |||
| 2722 | 2642 | ||
| 2723 | if (preferred_charset_id >= 0) | 2643 | if (preferred_charset_id >= 0) |
| 2724 | { | 2644 | { |
| 2725 | int result; | 2645 | bool result; |
| 2726 | 2646 | ||
| 2727 | charset = CHARSET_FROM_ID (preferred_charset_id); | 2647 | charset = CHARSET_FROM_ID (preferred_charset_id); |
| 2728 | CODING_CHAR_CHARSET_P (coding, dst, dst_end, c, charset, result); | 2648 | CODING_CHAR_CHARSET_P (coding, dst, dst_end, c, charset, result); |
| @@ -3017,17 +2937,17 @@ setup_iso_safe_charsets (Lisp_Object attrs) | |||
| 3017 | 2937 | ||
| 3018 | 2938 | ||
| 3019 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 2939 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| 3020 | Check if a text is encoded in one of ISO-2022 based coding systems. | 2940 | Return true if a text is encoded in one of ISO-2022 based coding |
| 3021 | If it is, return 1, else return 0. */ | 2941 | systems. */ |
| 3022 | 2942 | ||
| 3023 | static int | 2943 | static bool |
| 3024 | detect_coding_iso_2022 (struct coding_system *coding, | 2944 | detect_coding_iso_2022 (struct coding_system *coding, |
| 3025 | struct coding_detection_info *detect_info) | 2945 | struct coding_detection_info *detect_info) |
| 3026 | { | 2946 | { |
| 3027 | const unsigned char *src = coding->source, *src_base = src; | 2947 | const unsigned char *src = coding->source, *src_base = src; |
| 3028 | const unsigned char *src_end = coding->source + coding->src_bytes; | 2948 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 3029 | int multibytep = coding->src_multibyte; | 2949 | bool multibytep = coding->src_multibyte; |
| 3030 | int single_shifting = 0; | 2950 | bool single_shifting = 0; |
| 3031 | int id; | 2951 | int id; |
| 3032 | int c, c1; | 2952 | int c, c1; |
| 3033 | ptrdiff_t consumed_chars = 0; | 2953 | ptrdiff_t consumed_chars = 0; |
| @@ -3390,8 +3310,6 @@ detect_coding_iso_2022 (struct coding_system *coding, | |||
| 3390 | 3310 | ||
| 3391 | /* Finish the current composition as invalid. */ | 3311 | /* Finish the current composition as invalid. */ |
| 3392 | 3312 | ||
| 3393 | static int finish_composition (int *, struct composition_status *); | ||
| 3394 | |||
| 3395 | static int | 3313 | static int |
| 3396 | finish_composition (int *charbuf, struct composition_status *cmp_status) | 3314 | finish_composition (int *charbuf, struct composition_status *cmp_status) |
| 3397 | { | 3315 | { |
| @@ -3541,7 +3459,7 @@ decode_coding_iso_2022 (struct coding_system *coding) | |||
| 3541 | int *charbuf_end | 3459 | int *charbuf_end |
| 3542 | = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 3); | 3460 | = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 3); |
| 3543 | ptrdiff_t consumed_chars = 0, consumed_chars_base; | 3461 | ptrdiff_t consumed_chars = 0, consumed_chars_base; |
| 3544 | int multibytep = coding->src_multibyte; | 3462 | bool multibytep = coding->src_multibyte; |
| 3545 | /* Charsets invoked to graphic plane 0 and 1 respectively. */ | 3463 | /* Charsets invoked to graphic plane 0 and 1 respectively. */ |
| 3546 | int charset_id_0 = CODING_ISO_INVOKED_CHARSET (coding, 0); | 3464 | int charset_id_0 = CODING_ISO_INVOKED_CHARSET (coding, 0); |
| 3547 | int charset_id_1 = CODING_ISO_INVOKED_CHARSET (coding, 1); | 3465 | int charset_id_1 = CODING_ISO_INVOKED_CHARSET (coding, 1); |
| @@ -3553,8 +3471,8 @@ decode_coding_iso_2022 (struct coding_system *coding) | |||
| 3553 | ptrdiff_t char_offset = coding->produced_char; | 3471 | ptrdiff_t char_offset = coding->produced_char; |
| 3554 | ptrdiff_t last_offset = char_offset; | 3472 | ptrdiff_t last_offset = char_offset; |
| 3555 | int last_id = charset_ascii; | 3473 | int last_id = charset_ascii; |
| 3556 | int eol_dos = | 3474 | bool eol_dos |
| 3557 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 3475 | = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); |
| 3558 | int byte_after_cr = -1; | 3476 | int byte_after_cr = -1; |
| 3559 | int i; | 3477 | int i; |
| 3560 | 3478 | ||
| @@ -4282,7 +4200,7 @@ encode_invocation_designation (struct charset *charset, | |||
| 4282 | struct coding_system *coding, | 4200 | struct coding_system *coding, |
| 4283 | unsigned char *dst, ptrdiff_t *p_nchars) | 4201 | unsigned char *dst, ptrdiff_t *p_nchars) |
| 4284 | { | 4202 | { |
| 4285 | int multibytep = coding->dst_multibyte; | 4203 | bool multibytep = coding->dst_multibyte; |
| 4286 | ptrdiff_t produced_chars = *p_nchars; | 4204 | ptrdiff_t produced_chars = *p_nchars; |
| 4287 | int reg; /* graphic register number */ | 4205 | int reg; /* graphic register number */ |
| 4288 | int id = CHARSET_ID (charset); | 4206 | int id = CHARSET_ID (charset); |
| @@ -4380,7 +4298,7 @@ encode_designation_at_bol (struct coding_system *coding, | |||
| 4380 | int r[4]; | 4298 | int r[4]; |
| 4381 | int c, found = 0, reg; | 4299 | int c, found = 0, reg; |
| 4382 | ptrdiff_t produced_chars = 0; | 4300 | ptrdiff_t produced_chars = 0; |
| 4383 | int multibytep = coding->dst_multibyte; | 4301 | bool multibytep = coding->dst_multibyte; |
| 4384 | Lisp_Object attrs; | 4302 | Lisp_Object attrs; |
| 4385 | Lisp_Object charset_list; | 4303 | Lisp_Object charset_list; |
| 4386 | 4304 | ||
| @@ -4422,21 +4340,21 @@ encode_designation_at_bol (struct coding_system *coding, | |||
| 4422 | 4340 | ||
| 4423 | /* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions". */ | 4341 | /* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions". */ |
| 4424 | 4342 | ||
| 4425 | static int | 4343 | static bool |
| 4426 | encode_coding_iso_2022 (struct coding_system *coding) | 4344 | encode_coding_iso_2022 (struct coding_system *coding) |
| 4427 | { | 4345 | { |
| 4428 | int multibytep = coding->dst_multibyte; | 4346 | bool multibytep = coding->dst_multibyte; |
| 4429 | int *charbuf = coding->charbuf; | 4347 | int *charbuf = coding->charbuf; |
| 4430 | int *charbuf_end = charbuf + coding->charbuf_used; | 4348 | int *charbuf_end = charbuf + coding->charbuf_used; |
| 4431 | unsigned char *dst = coding->destination + coding->produced; | 4349 | unsigned char *dst = coding->destination + coding->produced; |
| 4432 | unsigned char *dst_end = coding->destination + coding->dst_bytes; | 4350 | unsigned char *dst_end = coding->destination + coding->dst_bytes; |
| 4433 | int safe_room = 16; | 4351 | int safe_room = 16; |
| 4434 | int bol_designation | 4352 | bool bol_designation |
| 4435 | = (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_DESIGNATE_AT_BOL | 4353 | = (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_DESIGNATE_AT_BOL |
| 4436 | && CODING_ISO_BOL (coding)); | 4354 | && CODING_ISO_BOL (coding)); |
| 4437 | ptrdiff_t produced_chars = 0; | 4355 | ptrdiff_t produced_chars = 0; |
| 4438 | Lisp_Object attrs, eol_type, charset_list; | 4356 | Lisp_Object attrs, eol_type, charset_list; |
| 4439 | int ascii_compatible; | 4357 | bool ascii_compatible; |
| 4440 | int c; | 4358 | int c; |
| 4441 | int preferred_charset_id = -1; | 4359 | int preferred_charset_id = -1; |
| 4442 | 4360 | ||
| @@ -4523,8 +4441,9 @@ encode_coding_iso_2022 (struct coding_system *coding) | |||
| 4523 | CODING_ISO_DESIGNATION (coding, i) | 4441 | CODING_ISO_DESIGNATION (coding, i) |
| 4524 | = CODING_ISO_INITIAL (coding, i); | 4442 | = CODING_ISO_INITIAL (coding, i); |
| 4525 | } | 4443 | } |
| 4526 | bol_designation | 4444 | bol_designation = ((CODING_ISO_FLAGS (coding) |
| 4527 | = CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_DESIGNATE_AT_BOL; | 4445 | & CODING_ISO_FLAG_DESIGNATE_AT_BOL) |
| 4446 | != 0); | ||
| 4528 | } | 4447 | } |
| 4529 | else if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_RESET_AT_CNTL) | 4448 | else if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_RESET_AT_CNTL) |
| 4530 | ENCODE_RESET_PLANE_AND_REGISTER (); | 4449 | ENCODE_RESET_PLANE_AND_REGISTER (); |
| @@ -4551,7 +4470,7 @@ encode_coding_iso_2022 (struct coding_system *coding) | |||
| 4551 | 4470 | ||
| 4552 | if (preferred_charset_id >= 0) | 4471 | if (preferred_charset_id >= 0) |
| 4553 | { | 4472 | { |
| 4554 | int result; | 4473 | bool result; |
| 4555 | 4474 | ||
| 4556 | charset = CHARSET_FROM_ID (preferred_charset_id); | 4475 | charset = CHARSET_FROM_ID (preferred_charset_id); |
| 4557 | CODING_CHAR_CHARSET_P (coding, dst, dst_end, c, charset, result); | 4476 | CODING_CHAR_CHARSET_P (coding, dst, dst_end, c, charset, result); |
| @@ -4631,16 +4550,15 @@ encode_coding_iso_2022 (struct coding_system *coding) | |||
| 4631 | */ | 4550 | */ |
| 4632 | 4551 | ||
| 4633 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 4552 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| 4634 | Check if a text is encoded in SJIS. If it is, return | 4553 | Return true if a text is encoded in SJIS. */ |
| 4635 | CATEGORY_MASK_SJIS, else return 0. */ | ||
| 4636 | 4554 | ||
| 4637 | static int | 4555 | static bool |
| 4638 | detect_coding_sjis (struct coding_system *coding, | 4556 | detect_coding_sjis (struct coding_system *coding, |
| 4639 | struct coding_detection_info *detect_info) | 4557 | struct coding_detection_info *detect_info) |
| 4640 | { | 4558 | { |
| 4641 | const unsigned char *src = coding->source, *src_base; | 4559 | const unsigned char *src = coding->source, *src_base; |
| 4642 | const unsigned char *src_end = coding->source + coding->src_bytes; | 4560 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 4643 | int multibytep = coding->src_multibyte; | 4561 | bool multibytep = coding->src_multibyte; |
| 4644 | ptrdiff_t consumed_chars = 0; | 4562 | ptrdiff_t consumed_chars = 0; |
| 4645 | int found = 0; | 4563 | int found = 0; |
| 4646 | int c; | 4564 | int c; |
| @@ -4688,16 +4606,15 @@ detect_coding_sjis (struct coding_system *coding, | |||
| 4688 | } | 4606 | } |
| 4689 | 4607 | ||
| 4690 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 4608 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| 4691 | Check if a text is encoded in BIG5. If it is, return | 4609 | Return true if a text is encoded in BIG5. */ |
| 4692 | CATEGORY_MASK_BIG5, else return 0. */ | ||
| 4693 | 4610 | ||
| 4694 | static int | 4611 | static bool |
| 4695 | detect_coding_big5 (struct coding_system *coding, | 4612 | detect_coding_big5 (struct coding_system *coding, |
| 4696 | struct coding_detection_info *detect_info) | 4613 | struct coding_detection_info *detect_info) |
| 4697 | { | 4614 | { |
| 4698 | const unsigned char *src = coding->source, *src_base; | 4615 | const unsigned char *src = coding->source, *src_base; |
| 4699 | const unsigned char *src_end = coding->source + coding->src_bytes; | 4616 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 4700 | int multibytep = coding->src_multibyte; | 4617 | bool multibytep = coding->src_multibyte; |
| 4701 | ptrdiff_t consumed_chars = 0; | 4618 | ptrdiff_t consumed_chars = 0; |
| 4702 | int found = 0; | 4619 | int found = 0; |
| 4703 | int c; | 4620 | int c; |
| @@ -4735,8 +4652,7 @@ detect_coding_big5 (struct coding_system *coding, | |||
| 4735 | return 1; | 4652 | return 1; |
| 4736 | } | 4653 | } |
| 4737 | 4654 | ||
| 4738 | /* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". | 4655 | /* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */ |
| 4739 | If SJIS_P is 1, decode SJIS text, else decode BIG5 test. */ | ||
| 4740 | 4656 | ||
| 4741 | static void | 4657 | static void |
| 4742 | decode_coding_sjis (struct coding_system *coding) | 4658 | decode_coding_sjis (struct coding_system *coding) |
| @@ -4750,15 +4666,15 @@ decode_coding_sjis (struct coding_system *coding) | |||
| 4750 | int *charbuf_end | 4666 | int *charbuf_end |
| 4751 | = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2); | 4667 | = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2); |
| 4752 | ptrdiff_t consumed_chars = 0, consumed_chars_base; | 4668 | ptrdiff_t consumed_chars = 0, consumed_chars_base; |
| 4753 | int multibytep = coding->src_multibyte; | 4669 | bool multibytep = coding->src_multibyte; |
| 4754 | struct charset *charset_roman, *charset_kanji, *charset_kana; | 4670 | struct charset *charset_roman, *charset_kanji, *charset_kana; |
| 4755 | struct charset *charset_kanji2; | 4671 | struct charset *charset_kanji2; |
| 4756 | Lisp_Object attrs, charset_list, val; | 4672 | Lisp_Object attrs, charset_list, val; |
| 4757 | ptrdiff_t char_offset = coding->produced_char; | 4673 | ptrdiff_t char_offset = coding->produced_char; |
| 4758 | ptrdiff_t last_offset = char_offset; | 4674 | ptrdiff_t last_offset = char_offset; |
| 4759 | int last_id = charset_ascii; | 4675 | int last_id = charset_ascii; |
| 4760 | int eol_dos = | 4676 | bool eol_dos |
| 4761 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 4677 | = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); |
| 4762 | int byte_after_cr = -1; | 4678 | int byte_after_cr = -1; |
| 4763 | 4679 | ||
| 4764 | CODING_GET_INFO (coding, attrs, charset_list); | 4680 | CODING_GET_INFO (coding, attrs, charset_list); |
| @@ -4868,14 +4784,14 @@ decode_coding_big5 (struct coding_system *coding) | |||
| 4868 | int *charbuf_end | 4784 | int *charbuf_end |
| 4869 | = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2); | 4785 | = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2); |
| 4870 | ptrdiff_t consumed_chars = 0, consumed_chars_base; | 4786 | ptrdiff_t consumed_chars = 0, consumed_chars_base; |
| 4871 | int multibytep = coding->src_multibyte; | 4787 | bool multibytep = coding->src_multibyte; |
| 4872 | struct charset *charset_roman, *charset_big5; | 4788 | struct charset *charset_roman, *charset_big5; |
| 4873 | Lisp_Object attrs, charset_list, val; | 4789 | Lisp_Object attrs, charset_list, val; |
| 4874 | ptrdiff_t char_offset = coding->produced_char; | 4790 | ptrdiff_t char_offset = coding->produced_char; |
| 4875 | ptrdiff_t last_offset = char_offset; | 4791 | ptrdiff_t last_offset = char_offset; |
| 4876 | int last_id = charset_ascii; | 4792 | int last_id = charset_ascii; |
| 4877 | int eol_dos = | 4793 | bool eol_dos |
| 4878 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 4794 | = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); |
| 4879 | int byte_after_cr = -1; | 4795 | int byte_after_cr = -1; |
| 4880 | 4796 | ||
| 4881 | CODING_GET_INFO (coding, attrs, charset_list); | 4797 | CODING_GET_INFO (coding, attrs, charset_list); |
| @@ -4957,13 +4873,12 @@ decode_coding_big5 (struct coding_system *coding) | |||
| 4957 | `japanese-jisx0208', `chinese-big5-1', and `chinese-big5-2'. We | 4873 | `japanese-jisx0208', `chinese-big5-1', and `chinese-big5-2'. We |
| 4958 | are sure that all these charsets are registered as official charset | 4874 | are sure that all these charsets are registered as official charset |
| 4959 | (i.e. do not have extended leading-codes). Characters of other | 4875 | (i.e. do not have extended leading-codes). Characters of other |
| 4960 | charsets are produced without any encoding. If SJIS_P is 1, encode | 4876 | charsets are produced without any encoding. */ |
| 4961 | SJIS text, else encode BIG5 text. */ | ||
| 4962 | 4877 | ||
| 4963 | static int | 4878 | static bool |
| 4964 | encode_coding_sjis (struct coding_system *coding) | 4879 | encode_coding_sjis (struct coding_system *coding) |
| 4965 | { | 4880 | { |
| 4966 | int multibytep = coding->dst_multibyte; | 4881 | bool multibytep = coding->dst_multibyte; |
| 4967 | int *charbuf = coding->charbuf; | 4882 | int *charbuf = coding->charbuf; |
| 4968 | int *charbuf_end = charbuf + coding->charbuf_used; | 4883 | int *charbuf_end = charbuf + coding->charbuf_used; |
| 4969 | unsigned char *dst = coding->destination + coding->produced; | 4884 | unsigned char *dst = coding->destination + coding->produced; |
| @@ -4971,7 +4886,7 @@ encode_coding_sjis (struct coding_system *coding) | |||
| 4971 | int safe_room = 4; | 4886 | int safe_room = 4; |
| 4972 | ptrdiff_t produced_chars = 0; | 4887 | ptrdiff_t produced_chars = 0; |
| 4973 | Lisp_Object attrs, charset_list, val; | 4888 | Lisp_Object attrs, charset_list, val; |
| 4974 | int ascii_compatible; | 4889 | bool ascii_compatible; |
| 4975 | struct charset *charset_kanji, *charset_kana; | 4890 | struct charset *charset_kanji, *charset_kana; |
| 4976 | struct charset *charset_kanji2; | 4891 | struct charset *charset_kanji2; |
| 4977 | int c; | 4892 | int c; |
| @@ -5054,10 +4969,10 @@ encode_coding_sjis (struct coding_system *coding) | |||
| 5054 | return 0; | 4969 | return 0; |
| 5055 | } | 4970 | } |
| 5056 | 4971 | ||
| 5057 | static int | 4972 | static bool |
| 5058 | encode_coding_big5 (struct coding_system *coding) | 4973 | encode_coding_big5 (struct coding_system *coding) |
| 5059 | { | 4974 | { |
| 5060 | int multibytep = coding->dst_multibyte; | 4975 | bool multibytep = coding->dst_multibyte; |
| 5061 | int *charbuf = coding->charbuf; | 4976 | int *charbuf = coding->charbuf; |
| 5062 | int *charbuf_end = charbuf + coding->charbuf_used; | 4977 | int *charbuf_end = charbuf + coding->charbuf_used; |
| 5063 | unsigned char *dst = coding->destination + coding->produced; | 4978 | unsigned char *dst = coding->destination + coding->produced; |
| @@ -5065,7 +4980,7 @@ encode_coding_big5 (struct coding_system *coding) | |||
| 5065 | int safe_room = 4; | 4980 | int safe_room = 4; |
| 5066 | ptrdiff_t produced_chars = 0; | 4981 | ptrdiff_t produced_chars = 0; |
| 5067 | Lisp_Object attrs, charset_list, val; | 4982 | Lisp_Object attrs, charset_list, val; |
| 5068 | int ascii_compatible; | 4983 | bool ascii_compatible; |
| 5069 | struct charset *charset_big5; | 4984 | struct charset *charset_big5; |
| 5070 | int c; | 4985 | int c; |
| 5071 | 4986 | ||
| @@ -5130,17 +5045,16 @@ encode_coding_big5 (struct coding_system *coding) | |||
| 5130 | /*** 10. CCL handlers ***/ | 5045 | /*** 10. CCL handlers ***/ |
| 5131 | 5046 | ||
| 5132 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 5047 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| 5133 | Check if a text is encoded in a coding system of which | 5048 | Return true if a text is encoded in a coding system of which |
| 5134 | encoder/decoder are written in CCL program. If it is, return | 5049 | encoder/decoder are written in CCL program. */ |
| 5135 | CATEGORY_MASK_CCL, else return 0. */ | ||
| 5136 | 5050 | ||
| 5137 | static int | 5051 | static bool |
| 5138 | detect_coding_ccl (struct coding_system *coding, | 5052 | detect_coding_ccl (struct coding_system *coding, |
| 5139 | struct coding_detection_info *detect_info) | 5053 | struct coding_detection_info *detect_info) |
| 5140 | { | 5054 | { |
| 5141 | const unsigned char *src = coding->source, *src_base; | 5055 | const unsigned char *src = coding->source, *src_base; |
| 5142 | const unsigned char *src_end = coding->source + coding->src_bytes; | 5056 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 5143 | int multibytep = coding->src_multibyte; | 5057 | bool multibytep = coding->src_multibyte; |
| 5144 | ptrdiff_t consumed_chars = 0; | 5058 | ptrdiff_t consumed_chars = 0; |
| 5145 | int found = 0; | 5059 | int found = 0; |
| 5146 | unsigned char *valids; | 5060 | unsigned char *valids; |
| @@ -5182,7 +5096,7 @@ decode_coding_ccl (struct coding_system *coding) | |||
| 5182 | int *charbuf = coding->charbuf + coding->charbuf_used; | 5096 | int *charbuf = coding->charbuf + coding->charbuf_used; |
| 5183 | int *charbuf_end = coding->charbuf + coding->charbuf_size; | 5097 | int *charbuf_end = coding->charbuf + coding->charbuf_size; |
| 5184 | ptrdiff_t consumed_chars = 0; | 5098 | ptrdiff_t consumed_chars = 0; |
| 5185 | int multibytep = coding->src_multibyte; | 5099 | bool multibytep = coding->src_multibyte; |
| 5186 | struct ccl_program *ccl = &coding->spec.ccl->ccl; | 5100 | struct ccl_program *ccl = &coding->spec.ccl->ccl; |
| 5187 | int source_charbuf[1024]; | 5101 | int source_charbuf[1024]; |
| 5188 | int source_byteidx[1025]; | 5102 | int source_byteidx[1025]; |
| @@ -5243,11 +5157,11 @@ decode_coding_ccl (struct coding_system *coding) | |||
| 5243 | coding->charbuf_used = charbuf - coding->charbuf; | 5157 | coding->charbuf_used = charbuf - coding->charbuf; |
| 5244 | } | 5158 | } |
| 5245 | 5159 | ||
| 5246 | static int | 5160 | static bool |
| 5247 | encode_coding_ccl (struct coding_system *coding) | 5161 | encode_coding_ccl (struct coding_system *coding) |
| 5248 | { | 5162 | { |
| 5249 | struct ccl_program *ccl = &coding->spec.ccl->ccl; | 5163 | struct ccl_program *ccl = &coding->spec.ccl->ccl; |
| 5250 | int multibytep = coding->dst_multibyte; | 5164 | bool multibytep = coding->dst_multibyte; |
| 5251 | int *charbuf = coding->charbuf; | 5165 | int *charbuf = coding->charbuf; |
| 5252 | int *charbuf_end = charbuf + coding->charbuf_used; | 5166 | int *charbuf_end = charbuf + coding->charbuf_used; |
| 5253 | unsigned char *dst = coding->destination + coding->produced; | 5167 | unsigned char *dst = coding->destination + coding->produced; |
| @@ -5308,7 +5222,6 @@ encode_coding_ccl (struct coding_system *coding) | |||
| 5308 | return 0; | 5222 | return 0; |
| 5309 | } | 5223 | } |
| 5310 | 5224 | ||
| 5311 | |||
| 5312 | 5225 | ||
| 5313 | /*** 10, 11. no-conversion handlers ***/ | 5226 | /*** 10, 11. no-conversion handlers ***/ |
| 5314 | 5227 | ||
| @@ -5317,8 +5230,8 @@ encode_coding_ccl (struct coding_system *coding) | |||
| 5317 | static void | 5230 | static void |
| 5318 | decode_coding_raw_text (struct coding_system *coding) | 5231 | decode_coding_raw_text (struct coding_system *coding) |
| 5319 | { | 5232 | { |
| 5320 | int eol_dos = | 5233 | bool eol_dos |
| 5321 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 5234 | = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); |
| 5322 | 5235 | ||
| 5323 | coding->chars_at_source = 1; | 5236 | coding->chars_at_source = 1; |
| 5324 | coding->consumed_char = coding->src_chars; | 5237 | coding->consumed_char = coding->src_chars; |
| @@ -5333,10 +5246,10 @@ decode_coding_raw_text (struct coding_system *coding) | |||
| 5333 | record_conversion_result (coding, CODING_RESULT_SUCCESS); | 5246 | record_conversion_result (coding, CODING_RESULT_SUCCESS); |
| 5334 | } | 5247 | } |
| 5335 | 5248 | ||
| 5336 | static int | 5249 | static bool |
| 5337 | encode_coding_raw_text (struct coding_system *coding) | 5250 | encode_coding_raw_text (struct coding_system *coding) |
| 5338 | { | 5251 | { |
| 5339 | int multibytep = coding->dst_multibyte; | 5252 | bool multibytep = coding->dst_multibyte; |
| 5340 | int *charbuf = coding->charbuf; | 5253 | int *charbuf = coding->charbuf; |
| 5341 | int *charbuf_end = coding->charbuf + coding->charbuf_used; | 5254 | int *charbuf_end = coding->charbuf + coding->charbuf_used; |
| 5342 | unsigned char *dst = coding->destination + coding->produced; | 5255 | unsigned char *dst = coding->destination + coding->produced; |
| @@ -5414,21 +5327,20 @@ encode_coding_raw_text (struct coding_system *coding) | |||
| 5414 | } | 5327 | } |
| 5415 | 5328 | ||
| 5416 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 5329 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| 5417 | Check if a text is encoded in a charset-based coding system. If it | 5330 | Return true if a text is encoded in a charset-based coding system. */ |
| 5418 | is, return 1, else return 0. */ | ||
| 5419 | 5331 | ||
| 5420 | static int | 5332 | static bool |
| 5421 | detect_coding_charset (struct coding_system *coding, | 5333 | detect_coding_charset (struct coding_system *coding, |
| 5422 | struct coding_detection_info *detect_info) | 5334 | struct coding_detection_info *detect_info) |
| 5423 | { | 5335 | { |
| 5424 | const unsigned char *src = coding->source, *src_base; | 5336 | const unsigned char *src = coding->source, *src_base; |
| 5425 | const unsigned char *src_end = coding->source + coding->src_bytes; | 5337 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 5426 | int multibytep = coding->src_multibyte; | 5338 | bool multibytep = coding->src_multibyte; |
| 5427 | ptrdiff_t consumed_chars = 0; | 5339 | ptrdiff_t consumed_chars = 0; |
| 5428 | Lisp_Object attrs, valids, name; | 5340 | Lisp_Object attrs, valids, name; |
| 5429 | int found = 0; | 5341 | int found = 0; |
| 5430 | ptrdiff_t head_ascii = coding->head_ascii; | 5342 | ptrdiff_t head_ascii = coding->head_ascii; |
| 5431 | int check_latin_extra = 0; | 5343 | bool check_latin_extra = 0; |
| 5432 | 5344 | ||
| 5433 | detect_info->checked |= CATEGORY_MASK_CHARSET; | 5345 | detect_info->checked |= CATEGORY_MASK_CHARSET; |
| 5434 | 5346 | ||
| @@ -5532,14 +5444,14 @@ decode_coding_charset (struct coding_system *coding) | |||
| 5532 | int *charbuf_end | 5444 | int *charbuf_end |
| 5533 | = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2); | 5445 | = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2); |
| 5534 | ptrdiff_t consumed_chars = 0, consumed_chars_base; | 5446 | ptrdiff_t consumed_chars = 0, consumed_chars_base; |
| 5535 | int multibytep = coding->src_multibyte; | 5447 | bool multibytep = coding->src_multibyte; |
| 5536 | Lisp_Object attrs = CODING_ID_ATTRS (coding->id); | 5448 | Lisp_Object attrs = CODING_ID_ATTRS (coding->id); |
| 5537 | Lisp_Object valids; | 5449 | Lisp_Object valids; |
| 5538 | ptrdiff_t char_offset = coding->produced_char; | 5450 | ptrdiff_t char_offset = coding->produced_char; |
| 5539 | ptrdiff_t last_offset = char_offset; | 5451 | ptrdiff_t last_offset = char_offset; |
| 5540 | int last_id = charset_ascii; | 5452 | int last_id = charset_ascii; |
| 5541 | int eol_dos = | 5453 | bool eol_dos |
| 5542 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 5454 | = !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); |
| 5543 | int byte_after_cr = -1; | 5455 | int byte_after_cr = -1; |
| 5544 | 5456 | ||
| 5545 | valids = AREF (attrs, coding_attr_charset_valids); | 5457 | valids = AREF (attrs, coding_attr_charset_valids); |
| @@ -5648,10 +5560,10 @@ decode_coding_charset (struct coding_system *coding) | |||
| 5648 | coding->charbuf_used = charbuf - coding->charbuf; | 5560 | coding->charbuf_used = charbuf - coding->charbuf; |
| 5649 | } | 5561 | } |
| 5650 | 5562 | ||
| 5651 | static int | 5563 | static bool |
| 5652 | encode_coding_charset (struct coding_system *coding) | 5564 | encode_coding_charset (struct coding_system *coding) |
| 5653 | { | 5565 | { |
| 5654 | int multibytep = coding->dst_multibyte; | 5566 | bool multibytep = coding->dst_multibyte; |
| 5655 | int *charbuf = coding->charbuf; | 5567 | int *charbuf = coding->charbuf; |
| 5656 | int *charbuf_end = charbuf + coding->charbuf_used; | 5568 | int *charbuf_end = charbuf + coding->charbuf_used; |
| 5657 | unsigned char *dst = coding->destination + coding->produced; | 5569 | unsigned char *dst = coding->destination + coding->produced; |
| @@ -5659,7 +5571,7 @@ encode_coding_charset (struct coding_system *coding) | |||
| 5659 | int safe_room = MAX_MULTIBYTE_LENGTH; | 5571 | int safe_room = MAX_MULTIBYTE_LENGTH; |
| 5660 | ptrdiff_t produced_chars = 0; | 5572 | ptrdiff_t produced_chars = 0; |
| 5661 | Lisp_Object attrs, charset_list; | 5573 | Lisp_Object attrs, charset_list; |
| 5662 | int ascii_compatible; | 5574 | bool ascii_compatible; |
| 5663 | int c; | 5575 | int c; |
| 5664 | 5576 | ||
| 5665 | CODING_GET_INFO (coding, attrs, charset_list); | 5577 | CODING_GET_INFO (coding, attrs, charset_list); |
| @@ -5865,7 +5777,6 @@ setup_coding_system (Lisp_Object coding_system, struct coding_system *coding) | |||
| 5865 | coding->encoder = encode_coding_emacs_mule; | 5777 | coding->encoder = encode_coding_emacs_mule; |
| 5866 | coding->common_flags | 5778 | coding->common_flags |
| 5867 | |= (CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK); | 5779 | |= (CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK); |
| 5868 | coding->spec.emacs_mule.full_support = 1; | ||
| 5869 | if (! NILP (AREF (attrs, coding_attr_emacs_mule_full)) | 5780 | if (! NILP (AREF (attrs, coding_attr_emacs_mule_full)) |
| 5870 | && ! EQ (CODING_ATTR_CHARSET_LIST (attrs), Vemacs_mule_charset_list)) | 5781 | && ! EQ (CODING_ATTR_CHARSET_LIST (attrs), Vemacs_mule_charset_list)) |
| 5871 | { | 5782 | { |
| @@ -5883,7 +5794,6 @@ setup_coding_system (Lisp_Object coding_system, struct coding_system *coding) | |||
| 5883 | SSET (safe_charsets, XFASTINT (XCAR (tail)), 0); | 5794 | SSET (safe_charsets, XFASTINT (XCAR (tail)), 0); |
| 5884 | coding->max_charset_id = max_charset_id; | 5795 | coding->max_charset_id = max_charset_id; |
| 5885 | coding->safe_charsets = SDATA (safe_charsets); | 5796 | coding->safe_charsets = SDATA (safe_charsets); |
| 5886 | coding->spec.emacs_mule.full_support = 1; | ||
| 5887 | } | 5797 | } |
| 5888 | coding->spec.emacs_mule.cmp_status.state = COMPOSING_NO; | 5798 | coding->spec.emacs_mule.cmp_status.state = COMPOSING_NO; |
| 5889 | coding->spec.emacs_mule.cmp_status.method = COMPOSITION_NO; | 5799 | coding->spec.emacs_mule.cmp_status.method = COMPOSITION_NO; |
| @@ -6216,11 +6126,9 @@ detect_eol (const unsigned char *source, ptrdiff_t src_bytes, | |||
| 6216 | 6126 | ||
| 6217 | if ((1 << category) & CATEGORY_MASK_UTF_16) | 6127 | if ((1 << category) & CATEGORY_MASK_UTF_16) |
| 6218 | { | 6128 | { |
| 6219 | int msb, lsb; | 6129 | bool msb = category == (coding_category_utf_16_le |
| 6220 | 6130 | | coding_category_utf_16_le_nosig); | |
| 6221 | msb = category == (coding_category_utf_16_le | 6131 | bool lsb = !msb; |
| 6222 | | coding_category_utf_16_le_nosig); | ||
| 6223 | lsb = 1 - msb; | ||
| 6224 | 6132 | ||
| 6225 | while (src + 1 < src_end) | 6133 | while (src + 1 < src_end) |
| 6226 | { | 6134 | { |
| @@ -6335,7 +6243,7 @@ static void | |||
| 6335 | detect_coding (struct coding_system *coding) | 6243 | detect_coding (struct coding_system *coding) |
| 6336 | { | 6244 | { |
| 6337 | const unsigned char *src, *src_end; | 6245 | const unsigned char *src, *src_end; |
| 6338 | int saved_mode = coding->mode; | 6246 | unsigned int saved_mode = coding->mode; |
| 6339 | 6247 | ||
| 6340 | coding->consumed = coding->consumed_char = 0; | 6248 | coding->consumed = coding->consumed_char = 0; |
| 6341 | coding->produced = coding->produced_char = 0; | 6249 | coding->produced = coding->produced_char = 0; |
| @@ -6350,7 +6258,7 @@ detect_coding (struct coding_system *coding) | |||
| 6350 | { | 6258 | { |
| 6351 | int c, i; | 6259 | int c, i; |
| 6352 | struct coding_detection_info detect_info; | 6260 | struct coding_detection_info detect_info; |
| 6353 | int null_byte_found = 0, eight_bit_found = 0; | 6261 | bool null_byte_found = 0, eight_bit_found = 0; |
| 6354 | 6262 | ||
| 6355 | detect_info.checked = detect_info.found = detect_info.rejected = 0; | 6263 | detect_info.checked = detect_info.found = detect_info.rejected = 0; |
| 6356 | for (src = coding->source; src < src_end; src++) | 6264 | for (src = coding->source; src < src_end; src++) |
| @@ -6609,11 +6517,11 @@ decode_eol (struct coding_system *coding) | |||
| 6609 | 6517 | ||
| 6610 | 6518 | ||
| 6611 | /* Return a translation table (or list of them) from coding system | 6519 | /* Return a translation table (or list of them) from coding system |
| 6612 | attribute vector ATTRS for encoding (ENCODEP is nonzero) or | 6520 | attribute vector ATTRS for encoding (if ENCODEP) or decoding (if |
| 6613 | decoding (ENCODEP is zero). */ | 6521 | not ENCODEP). */ |
| 6614 | 6522 | ||
| 6615 | static Lisp_Object | 6523 | static Lisp_Object |
| 6616 | get_translation_table (Lisp_Object attrs, int encodep, int *max_lookup) | 6524 | get_translation_table (Lisp_Object attrs, bool encodep, int *max_lookup) |
| 6617 | { | 6525 | { |
| 6618 | Lisp_Object standard, translation_table; | 6526 | Lisp_Object standard, translation_table; |
| 6619 | Lisp_Object val; | 6527 | Lisp_Object val; |
| @@ -6743,7 +6651,7 @@ get_translation (Lisp_Object trans, int *buf, int *buf_end) | |||
| 6743 | 6651 | ||
| 6744 | static int | 6652 | static int |
| 6745 | produce_chars (struct coding_system *coding, Lisp_Object translation_table, | 6653 | produce_chars (struct coding_system *coding, Lisp_Object translation_table, |
| 6746 | int last_block) | 6654 | bool last_block) |
| 6747 | { | 6655 | { |
| 6748 | unsigned char *dst = coding->destination + coding->produced; | 6656 | unsigned char *dst = coding->destination + coding->produced; |
| 6749 | unsigned char *dst_end = coding->destination + coding->dst_bytes; | 6657 | unsigned char *dst_end = coding->destination + coding->dst_bytes; |
| @@ -6846,7 +6754,7 @@ produce_chars (struct coding_system *coding, Lisp_Object translation_table, | |||
| 6846 | { | 6754 | { |
| 6847 | if (coding->src_multibyte) | 6755 | if (coding->src_multibyte) |
| 6848 | { | 6756 | { |
| 6849 | int multibytep = 1; | 6757 | bool multibytep = 1; |
| 6850 | ptrdiff_t consumed_chars = 0; | 6758 | ptrdiff_t consumed_chars = 0; |
| 6851 | 6759 | ||
| 6852 | while (1) | 6760 | while (1) |
| @@ -6882,7 +6790,7 @@ produce_chars (struct coding_system *coding, Lisp_Object translation_table, | |||
| 6882 | else | 6790 | else |
| 6883 | while (src < src_end) | 6791 | while (src < src_end) |
| 6884 | { | 6792 | { |
| 6885 | int multibytep = 1; | 6793 | bool multibytep = 1; |
| 6886 | int c = *src++; | 6794 | int c = *src++; |
| 6887 | 6795 | ||
| 6888 | if (dst >= dst_end - 1) | 6796 | if (dst >= dst_end - 1) |
| @@ -7018,7 +6926,7 @@ produce_charset (struct coding_system *coding, int *charbuf, ptrdiff_t pos) | |||
| 7018 | if (! coding->charbuf) \ | 6926 | if (! coding->charbuf) \ |
| 7019 | { \ | 6927 | { \ |
| 7020 | record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_MEM); \ | 6928 | record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_MEM); \ |
| 7021 | return coding->result; \ | 6929 | return; \ |
| 7022 | } \ | 6930 | } \ |
| 7023 | coding->charbuf_size = size; \ | 6931 | coding->charbuf_size = size; \ |
| 7024 | } while (0) | 6932 | } while (0) |
| @@ -7079,7 +6987,7 @@ produce_annotation (struct coding_system *coding, ptrdiff_t pos) | |||
| 7079 | CODING->dst_object. | 6987 | CODING->dst_object. |
| 7080 | */ | 6988 | */ |
| 7081 | 6989 | ||
| 7082 | static int | 6990 | static void |
| 7083 | decode_coding (struct coding_system *coding) | 6991 | decode_coding (struct coding_system *coding) |
| 7084 | { | 6992 | { |
| 7085 | Lisp_Object attrs; | 6993 | Lisp_Object attrs; |
| @@ -7098,8 +7006,7 @@ decode_coding (struct coding_system *coding) | |||
| 7098 | undo_list = Qt; | 7006 | undo_list = Qt; |
| 7099 | if (BUFFERP (coding->dst_object)) | 7007 | if (BUFFERP (coding->dst_object)) |
| 7100 | { | 7008 | { |
| 7101 | if (current_buffer != XBUFFER (coding->dst_object)) | 7009 | set_buffer_internal (XBUFFER (coding->dst_object)); |
| 7102 | set_buffer_internal (XBUFFER (coding->dst_object)); | ||
| 7103 | if (GPT != PT) | 7010 | if (GPT != PT) |
| 7104 | move_gap_both (PT, PT_BYTE); | 7011 | move_gap_both (PT, PT_BYTE); |
| 7105 | 7012 | ||
| @@ -7212,7 +7119,6 @@ decode_coding (struct coding_system *coding) | |||
| 7212 | bset_undo_list (current_buffer, undo_list); | 7119 | bset_undo_list (current_buffer, undo_list); |
| 7213 | record_insert (coding->dst_pos, coding->produced_char); | 7120 | record_insert (coding->dst_pos, coding->produced_char); |
| 7214 | } | 7121 | } |
| 7215 | return coding->result; | ||
| 7216 | } | 7122 | } |
| 7217 | 7123 | ||
| 7218 | 7124 | ||
| @@ -7341,7 +7247,7 @@ consume_chars (struct coding_system *coding, Lisp_Object translation_table, | |||
| 7341 | const unsigned char *src_end = coding->source + coding->src_bytes; | 7247 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 7342 | ptrdiff_t pos = coding->src_pos + coding->consumed_char; | 7248 | ptrdiff_t pos = coding->src_pos + coding->consumed_char; |
| 7343 | ptrdiff_t end_pos = coding->src_pos + coding->src_chars; | 7249 | ptrdiff_t end_pos = coding->src_pos + coding->src_chars; |
| 7344 | int multibytep = coding->src_multibyte; | 7250 | bool multibytep = coding->src_multibyte; |
| 7345 | Lisp_Object eol_type; | 7251 | Lisp_Object eol_type; |
| 7346 | int c; | 7252 | int c; |
| 7347 | ptrdiff_t stop, stop_composition, stop_charset; | 7253 | ptrdiff_t stop, stop_composition, stop_charset; |
| @@ -7488,7 +7394,7 @@ consume_chars (struct coding_system *coding, Lisp_Object translation_table, | |||
| 7488 | If CODING->dst_object is nil, the encoded data is placed at the | 7394 | If CODING->dst_object is nil, the encoded data is placed at the |
| 7489 | memory area specified by CODING->destination. */ | 7395 | memory area specified by CODING->destination. */ |
| 7490 | 7396 | ||
| 7491 | static int | 7397 | static void |
| 7492 | encode_coding (struct coding_system *coding) | 7398 | encode_coding (struct coding_system *coding) |
| 7493 | { | 7399 | { |
| 7494 | Lisp_Object attrs; | 7400 | Lisp_Object attrs; |
| @@ -7530,8 +7436,6 @@ encode_coding (struct coding_system *coding) | |||
| 7530 | 7436 | ||
| 7531 | if (BUFFERP (coding->dst_object) && coding->produced_char > 0) | 7437 | if (BUFFERP (coding->dst_object) && coding->produced_char > 0) |
| 7532 | insert_from_gap (coding->produced_char, coding->produced); | 7438 | insert_from_gap (coding->produced_char, coding->produced); |
| 7533 | |||
| 7534 | return (coding->result); | ||
| 7535 | } | 7439 | } |
| 7536 | 7440 | ||
| 7537 | 7441 | ||
| @@ -7545,26 +7449,27 @@ static Lisp_Object Vcode_conversion_workbuf_name; | |||
| 7545 | versions of Vcode_conversion_workbuf_name. */ | 7449 | versions of Vcode_conversion_workbuf_name. */ |
| 7546 | static Lisp_Object Vcode_conversion_reused_workbuf; | 7450 | static Lisp_Object Vcode_conversion_reused_workbuf; |
| 7547 | 7451 | ||
| 7548 | /* 1 iff Vcode_conversion_reused_workbuf is already in use. */ | 7452 | /* True iff Vcode_conversion_reused_workbuf is already in use. */ |
| 7549 | static int reused_workbuf_in_use; | 7453 | static bool reused_workbuf_in_use; |
| 7550 | 7454 | ||
| 7551 | 7455 | ||
| 7552 | /* Return a working buffer of code conversion. MULTIBYTE specifies the | 7456 | /* Return a working buffer of code conversion. MULTIBYTE specifies the |
| 7553 | multibyteness of returning buffer. */ | 7457 | multibyteness of returning buffer. */ |
| 7554 | 7458 | ||
| 7555 | static Lisp_Object | 7459 | static Lisp_Object |
| 7556 | make_conversion_work_buffer (int multibyte) | 7460 | make_conversion_work_buffer (bool multibyte) |
| 7557 | { | 7461 | { |
| 7558 | Lisp_Object name, workbuf; | 7462 | Lisp_Object name, workbuf; |
| 7559 | struct buffer *current; | 7463 | struct buffer *current; |
| 7560 | 7464 | ||
| 7561 | if (reused_workbuf_in_use++) | 7465 | if (reused_workbuf_in_use) |
| 7562 | { | 7466 | { |
| 7563 | name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil); | 7467 | name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil); |
| 7564 | workbuf = Fget_buffer_create (name); | 7468 | workbuf = Fget_buffer_create (name); |
| 7565 | } | 7469 | } |
| 7566 | else | 7470 | else |
| 7567 | { | 7471 | { |
| 7472 | reused_workbuf_in_use = 1; | ||
| 7568 | if (NILP (Fbuffer_live_p (Vcode_conversion_reused_workbuf))) | 7473 | if (NILP (Fbuffer_live_p (Vcode_conversion_reused_workbuf))) |
| 7569 | Vcode_conversion_reused_workbuf | 7474 | Vcode_conversion_reused_workbuf |
| 7570 | = Fget_buffer_create (Vcode_conversion_workbuf_name); | 7475 | = Fget_buffer_create (Vcode_conversion_workbuf_name); |
| @@ -7606,7 +7511,7 @@ code_conversion_restore (Lisp_Object arg) | |||
| 7606 | } | 7511 | } |
| 7607 | 7512 | ||
| 7608 | Lisp_Object | 7513 | Lisp_Object |
| 7609 | code_conversion_save (int with_work_buf, int multibyte) | 7514 | code_conversion_save (bool with_work_buf, bool multibyte) |
| 7610 | { | 7515 | { |
| 7611 | Lisp_Object workbuf = Qnil; | 7516 | Lisp_Object workbuf = Qnil; |
| 7612 | 7517 | ||
| @@ -7617,7 +7522,7 @@ code_conversion_save (int with_work_buf, int multibyte) | |||
| 7617 | return workbuf; | 7522 | return workbuf; |
| 7618 | } | 7523 | } |
| 7619 | 7524 | ||
| 7620 | int | 7525 | void |
| 7621 | decode_coding_gap (struct coding_system *coding, | 7526 | decode_coding_gap (struct coding_system *coding, |
| 7622 | ptrdiff_t chars, ptrdiff_t bytes) | 7527 | ptrdiff_t chars, ptrdiff_t bytes) |
| 7623 | { | 7528 | { |
| @@ -7660,7 +7565,6 @@ decode_coding_gap (struct coding_system *coding, | |||
| 7660 | } | 7565 | } |
| 7661 | 7566 | ||
| 7662 | unbind_to (count, Qnil); | 7567 | unbind_to (count, Qnil); |
| 7663 | return coding->result; | ||
| 7664 | } | 7568 | } |
| 7665 | 7569 | ||
| 7666 | 7570 | ||
| @@ -7706,8 +7610,8 @@ decode_coding_object (struct coding_system *coding, | |||
| 7706 | ptrdiff_t chars = to - from; | 7610 | ptrdiff_t chars = to - from; |
| 7707 | ptrdiff_t bytes = to_byte - from_byte; | 7611 | ptrdiff_t bytes = to_byte - from_byte; |
| 7708 | Lisp_Object attrs; | 7612 | Lisp_Object attrs; |
| 7709 | int saved_pt = -1, saved_pt_byte IF_LINT (= 0); | 7613 | ptrdiff_t saved_pt = -1, saved_pt_byte IF_LINT (= 0); |
| 7710 | int need_marker_adjustment = 0; | 7614 | bool need_marker_adjustment = 0; |
| 7711 | Lisp_Object old_deactivate_mark; | 7615 | Lisp_Object old_deactivate_mark; |
| 7712 | 7616 | ||
| 7713 | old_deactivate_mark = Vdeactivate_mark; | 7617 | old_deactivate_mark = Vdeactivate_mark; |
| @@ -7894,9 +7798,9 @@ encode_coding_object (struct coding_system *coding, | |||
| 7894 | ptrdiff_t chars = to - from; | 7798 | ptrdiff_t chars = to - from; |
| 7895 | ptrdiff_t bytes = to_byte - from_byte; | 7799 | ptrdiff_t bytes = to_byte - from_byte; |
| 7896 | Lisp_Object attrs; | 7800 | Lisp_Object attrs; |
| 7897 | int saved_pt = -1, saved_pt_byte IF_LINT (= 0); | 7801 | ptrdiff_t saved_pt = -1, saved_pt_byte IF_LINT (= 0); |
| 7898 | int need_marker_adjustment = 0; | 7802 | bool need_marker_adjustment = 0; |
| 7899 | int kill_src_buffer = 0; | 7803 | bool kill_src_buffer = 0; |
| 7900 | Lisp_Object old_deactivate_mark; | 7804 | Lisp_Object old_deactivate_mark; |
| 7901 | 7805 | ||
| 7902 | old_deactivate_mark = Vdeactivate_mark; | 7806 | old_deactivate_mark = Vdeactivate_mark; |
| @@ -8172,10 +8076,10 @@ function `define-coding-system'. */) | |||
| 8172 | 8076 | ||
| 8173 | 8077 | ||
| 8174 | /* Detect how the bytes at SRC of length SRC_BYTES are encoded. If | 8078 | /* Detect how the bytes at SRC of length SRC_BYTES are encoded. If |
| 8175 | HIGHEST is nonzero, return the coding system of the highest | 8079 | HIGHEST, return the coding system of the highest |
| 8176 | priority among the detected coding systems. Otherwise return a | 8080 | priority among the detected coding systems. Otherwise return a |
| 8177 | list of detected coding systems sorted by their priorities. If | 8081 | list of detected coding systems sorted by their priorities. If |
| 8178 | MULTIBYTEP is nonzero, it is assumed that the bytes are in correct | 8082 | MULTIBYTEP, it is assumed that the bytes are in correct |
| 8179 | multibyte form but contains only ASCII and eight-bit chars. | 8083 | multibyte form but contains only ASCII and eight-bit chars. |
| 8180 | Otherwise, the bytes are raw bytes. | 8084 | Otherwise, the bytes are raw bytes. |
| 8181 | 8085 | ||
| @@ -8190,7 +8094,7 @@ function `define-coding-system'. */) | |||
| 8190 | Lisp_Object | 8094 | Lisp_Object |
| 8191 | detect_coding_system (const unsigned char *src, | 8095 | detect_coding_system (const unsigned char *src, |
| 8192 | ptrdiff_t src_chars, ptrdiff_t src_bytes, | 8096 | ptrdiff_t src_chars, ptrdiff_t src_bytes, |
| 8193 | int highest, int multibytep, | 8097 | bool highest, bool multibytep, |
| 8194 | Lisp_Object coding_system) | 8098 | Lisp_Object coding_system) |
| 8195 | { | 8099 | { |
| 8196 | const unsigned char *src_end = src + src_bytes; | 8100 | const unsigned char *src_end = src + src_bytes; |
| @@ -8200,7 +8104,7 @@ detect_coding_system (const unsigned char *src, | |||
| 8200 | ptrdiff_t id; | 8104 | ptrdiff_t id; |
| 8201 | struct coding_detection_info detect_info; | 8105 | struct coding_detection_info detect_info; |
| 8202 | enum coding_category base_category; | 8106 | enum coding_category base_category; |
| 8203 | int null_byte_found = 0, eight_bit_found = 0; | 8107 | bool null_byte_found = 0, eight_bit_found = 0; |
| 8204 | 8108 | ||
| 8205 | if (NILP (coding_system)) | 8109 | if (NILP (coding_system)) |
| 8206 | coding_system = Qundecided; | 8110 | coding_system = Qundecided; |
| @@ -8556,7 +8460,7 @@ highest priority. */) | |||
| 8556 | } | 8460 | } |
| 8557 | 8461 | ||
| 8558 | 8462 | ||
| 8559 | static inline int | 8463 | static inline bool |
| 8560 | char_encodable_p (int c, Lisp_Object attrs) | 8464 | char_encodable_p (int c, Lisp_Object attrs) |
| 8561 | { | 8465 | { |
| 8562 | Lisp_Object tail; | 8466 | Lisp_Object tail; |
| @@ -8728,7 +8632,7 @@ to the string. */) | |||
| 8728 | Lisp_Object positions; | 8632 | Lisp_Object positions; |
| 8729 | ptrdiff_t from, to; | 8633 | ptrdiff_t from, to; |
| 8730 | const unsigned char *p, *stop, *pend; | 8634 | const unsigned char *p, *stop, *pend; |
| 8731 | int ascii_compatible; | 8635 | bool ascii_compatible; |
| 8732 | 8636 | ||
| 8733 | setup_coding_system (Fcheck_coding_system (coding_system), &coding); | 8637 | setup_coding_system (Fcheck_coding_system (coding_system), &coding); |
| 8734 | attrs = CODING_ID_ATTRS (coding.id); | 8638 | attrs = CODING_ID_ATTRS (coding.id); |
| @@ -8952,7 +8856,7 @@ is nil. */) | |||
| 8952 | static Lisp_Object | 8856 | static Lisp_Object |
| 8953 | code_convert_region (Lisp_Object start, Lisp_Object end, | 8857 | code_convert_region (Lisp_Object start, Lisp_Object end, |
| 8954 | Lisp_Object coding_system, Lisp_Object dst_object, | 8858 | Lisp_Object coding_system, Lisp_Object dst_object, |
| 8955 | int encodep, int norecord) | 8859 | bool encodep, bool norecord) |
| 8956 | { | 8860 | { |
| 8957 | struct coding_system coding; | 8861 | struct coding_system coding; |
| 8958 | ptrdiff_t from, from_byte, to, to_byte; | 8862 | ptrdiff_t from, from_byte, to, to_byte; |
| @@ -9040,7 +8944,8 @@ not fully specified.) */) | |||
| 9040 | 8944 | ||
| 9041 | Lisp_Object | 8945 | Lisp_Object |
| 9042 | code_convert_string (Lisp_Object string, Lisp_Object coding_system, | 8946 | code_convert_string (Lisp_Object string, Lisp_Object coding_system, |
| 9043 | Lisp_Object dst_object, int encodep, int nocopy, int norecord) | 8947 | Lisp_Object dst_object, bool encodep, bool nocopy, |
| 8948 | bool norecord) | ||
| 9044 | { | 8949 | { |
| 9045 | struct coding_system coding; | 8950 | struct coding_system coding; |
| 9046 | ptrdiff_t chars, bytes; | 8951 | ptrdiff_t chars, bytes; |
| @@ -9088,7 +8993,7 @@ code_convert_string (Lisp_Object string, Lisp_Object coding_system, | |||
| 9088 | 8993 | ||
| 9089 | Lisp_Object | 8994 | Lisp_Object |
| 9090 | code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system, | 8995 | code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system, |
| 9091 | int encodep) | 8996 | bool encodep) |
| 9092 | { | 8997 | { |
| 9093 | return code_convert_string (string, coding_system, Qt, encodep, 0, 1); | 8998 | return code_convert_string (string, coding_system, Qt, encodep, 0, 1); |
| 9094 | } | 8999 | } |
| @@ -9489,7 +9394,7 @@ usage: (set-coding-system-priority &rest coding-systems) */) | |||
| 9489 | (ptrdiff_t nargs, Lisp_Object *args) | 9394 | (ptrdiff_t nargs, Lisp_Object *args) |
| 9490 | { | 9395 | { |
| 9491 | ptrdiff_t i, j; | 9396 | ptrdiff_t i, j; |
| 9492 | int changed[coding_category_max]; | 9397 | bool changed[coding_category_max]; |
| 9493 | enum coding_category priorities[coding_category_max]; | 9398 | enum coding_category priorities[coding_category_max]; |
| 9494 | 9399 | ||
| 9495 | memset (changed, 0, sizeof changed); | 9400 | memset (changed, 0, sizeof changed); |
diff --git a/src/coding.h b/src/coding.h index 2987f19607b..c45d2ef86e2 100644 --- a/src/coding.h +++ b/src/coding.h | |||
| @@ -321,7 +321,7 @@ struct composition_status | |||
| 321 | { | 321 | { |
| 322 | enum composition_state state; | 322 | enum composition_state state; |
| 323 | enum composition_method method; | 323 | enum composition_method method; |
| 324 | int old_form; /* 0:pre-21 form, 1:post-21 form */ | 324 | bool old_form; /* true if pre-21 form */ |
| 325 | int length; /* number of elements produced in charbuf */ | 325 | int length; /* number of elements produced in charbuf */ |
| 326 | int nchars; /* number of characters composed */ | 326 | int nchars; /* number of characters composed */ |
| 327 | int ncomps; /* number of composition components */ | 327 | int ncomps; /* number of composition components */ |
| @@ -350,18 +350,18 @@ struct iso_2022_spec | |||
| 350 | there was an invalid designation previously. */ | 350 | there was an invalid designation previously. */ |
| 351 | int current_designation[4]; | 351 | int current_designation[4]; |
| 352 | 352 | ||
| 353 | /* Set to 1 temporarily only when graphic register 2 or 3 is invoked | ||
| 354 | by single-shift while encoding. */ | ||
| 355 | int single_shifting; | ||
| 356 | |||
| 357 | /* Set to 1 temporarily only when processing at beginning of line. */ | ||
| 358 | int bol; | ||
| 359 | |||
| 360 | /* If positive, we are now scanning CTEXT extended segment. */ | 353 | /* If positive, we are now scanning CTEXT extended segment. */ |
| 361 | int ctext_extended_segment_len; | 354 | int ctext_extended_segment_len; |
| 362 | 355 | ||
| 363 | /* If nonzero, we are now scanning embedded UTF-8 sequence. */ | 356 | /* True temporarily only when graphic register 2 or 3 is invoked by |
| 364 | int embedded_utf_8; | 357 | single-shift while encoding. */ |
| 358 | unsigned single_shifting : 1; | ||
| 359 | |||
| 360 | /* True temporarily only when processing at beginning of line. */ | ||
| 361 | unsigned bol : 1; | ||
| 362 | |||
| 363 | /* If true, we are now scanning embedded UTF-8 sequence. */ | ||
| 364 | unsigned embedded_utf_8 : 1; | ||
| 365 | 365 | ||
| 366 | /* The current composition. */ | 366 | /* The current composition. */ |
| 367 | struct composition_status cmp_status; | 367 | struct composition_status cmp_status; |
| @@ -369,7 +369,6 @@ struct iso_2022_spec | |||
| 369 | 369 | ||
| 370 | struct emacs_mule_spec | 370 | struct emacs_mule_spec |
| 371 | { | 371 | { |
| 372 | int full_support; | ||
| 373 | struct composition_status cmp_status; | 372 | struct composition_status cmp_status; |
| 374 | }; | 373 | }; |
| 375 | 374 | ||
| @@ -470,10 +469,6 @@ struct coding_system | |||
| 470 | Lisp_Object dst_object; | 469 | Lisp_Object dst_object; |
| 471 | unsigned char *destination; | 470 | unsigned char *destination; |
| 472 | 471 | ||
| 473 | /* Set to 1 if the source of conversion is not in the member | ||
| 474 | `charbuf', but at `src_object'. */ | ||
| 475 | int chars_at_source; | ||
| 476 | |||
| 477 | /* If an element is non-negative, it is a character code. | 472 | /* If an element is non-negative, it is a character code. |
| 478 | 473 | ||
| 479 | If it is in the range -128..-1, it is a 8-bit character code | 474 | If it is in the range -128..-1, it is a 8-bit character code |
| @@ -489,18 +484,21 @@ struct coding_system | |||
| 489 | int *charbuf; | 484 | int *charbuf; |
| 490 | int charbuf_size, charbuf_used; | 485 | int charbuf_size, charbuf_used; |
| 491 | 486 | ||
| 487 | /* True if the source of conversion is not in the member | ||
| 488 | `charbuf', but at `src_object'. */ | ||
| 489 | unsigned chars_at_source : 1; | ||
| 490 | |||
| 492 | /* Set to 1 if charbuf contains an annotation. */ | 491 | /* Set to 1 if charbuf contains an annotation. */ |
| 493 | int annotated; | 492 | unsigned annotated : 1; |
| 494 | 493 | ||
| 495 | unsigned char carryover[64]; | 494 | unsigned char carryover[64]; |
| 496 | int carryover_bytes; | 495 | int carryover_bytes; |
| 497 | 496 | ||
| 498 | int default_char; | 497 | int default_char; |
| 499 | 498 | ||
| 500 | int (*detector) (struct coding_system *, | 499 | bool (*detector) (struct coding_system *, struct coding_detection_info *); |
| 501 | struct coding_detection_info *); | ||
| 502 | void (*decoder) (struct coding_system *); | 500 | void (*decoder) (struct coding_system *); |
| 503 | int (*encoder) (struct coding_system *); | 501 | bool (*encoder) (struct coding_system *); |
| 504 | }; | 502 | }; |
| 505 | 503 | ||
| 506 | /* Meanings of bits in the member `common_flags' of the structure | 504 | /* Meanings of bits in the member `common_flags' of the structure |
| @@ -688,22 +686,20 @@ struct coding_system | |||
| 688 | #define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 1) | 686 | #define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 1) |
| 689 | 687 | ||
| 690 | /* Extern declarations. */ | 688 | /* Extern declarations. */ |
| 691 | extern Lisp_Object code_conversion_save (int, int); | 689 | extern Lisp_Object code_conversion_save (bool, bool); |
| 692 | extern int decoding_buffer_size (struct coding_system *, int); | ||
| 693 | extern int encoding_buffer_size (struct coding_system *, int); | ||
| 694 | extern void setup_coding_system (Lisp_Object, struct coding_system *); | 690 | extern void setup_coding_system (Lisp_Object, struct coding_system *); |
| 695 | extern Lisp_Object coding_charset_list (struct coding_system *); | 691 | extern Lisp_Object coding_charset_list (struct coding_system *); |
| 696 | extern Lisp_Object coding_system_charset_list (Lisp_Object); | 692 | extern Lisp_Object coding_system_charset_list (Lisp_Object); |
| 697 | extern Lisp_Object code_convert_string (Lisp_Object, Lisp_Object, | 693 | extern Lisp_Object code_convert_string (Lisp_Object, Lisp_Object, |
| 698 | Lisp_Object, int, int, int); | 694 | Lisp_Object, bool, bool, bool); |
| 699 | extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object, | 695 | extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object, |
| 700 | int); | 696 | bool); |
| 701 | extern Lisp_Object raw_text_coding_system (Lisp_Object); | 697 | extern Lisp_Object raw_text_coding_system (Lisp_Object); |
| 702 | extern Lisp_Object coding_inherit_eol_type (Lisp_Object, Lisp_Object); | 698 | extern Lisp_Object coding_inherit_eol_type (Lisp_Object, Lisp_Object); |
| 703 | extern Lisp_Object complement_process_encoding_system (Lisp_Object); | 699 | extern Lisp_Object complement_process_encoding_system (Lisp_Object); |
| 704 | 700 | ||
| 705 | extern int decode_coding_gap (struct coding_system *, | 701 | extern void decode_coding_gap (struct coding_system *, |
| 706 | ptrdiff_t, ptrdiff_t); | 702 | ptrdiff_t, ptrdiff_t); |
| 707 | extern void decode_coding_object (struct coding_system *, | 703 | extern void decode_coding_object (struct coding_system *, |
| 708 | Lisp_Object, ptrdiff_t, ptrdiff_t, | 704 | Lisp_Object, ptrdiff_t, ptrdiff_t, |
| 709 | ptrdiff_t, ptrdiff_t, Lisp_Object); | 705 | ptrdiff_t, ptrdiff_t, Lisp_Object); |
| @@ -778,6 +774,5 @@ extern struct coding_system safe_terminal_coding; | |||
| 778 | extern Lisp_Object Qcoding_system_error; | 774 | extern Lisp_Object Qcoding_system_error; |
| 779 | 775 | ||
| 780 | extern char emacs_mule_bytes[256]; | 776 | extern char emacs_mule_bytes[256]; |
| 781 | extern int emacs_mule_string_char (unsigned char *); | ||
| 782 | 777 | ||
| 783 | #endif /* EMACS_CODING_H */ | 778 | #endif /* EMACS_CODING_H */ |
diff --git a/src/composite.c b/src/composite.c index 4e90e9bb914..eddabb66d33 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -428,7 +428,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars, | |||
| 428 | 428 | ||
| 429 | This doesn't check the validity of composition. */ | 429 | This doesn't check the validity of composition. */ |
| 430 | 430 | ||
| 431 | int | 431 | bool |
| 432 | find_composition (ptrdiff_t pos, ptrdiff_t limit, | 432 | find_composition (ptrdiff_t pos, ptrdiff_t limit, |
| 433 | ptrdiff_t *start, ptrdiff_t *end, | 433 | ptrdiff_t *start, ptrdiff_t *end, |
| 434 | Lisp_Object *prop, Lisp_Object object) | 434 | Lisp_Object *prop, Lisp_Object object) |
| @@ -709,7 +709,7 @@ static Lisp_Object fill_gstring_header (Lisp_Object, Lisp_Object, | |||
| 709 | Lisp_Object, Lisp_Object, | 709 | Lisp_Object, Lisp_Object, |
| 710 | Lisp_Object); | 710 | Lisp_Object); |
| 711 | 711 | ||
| 712 | int | 712 | bool |
| 713 | composition_gstring_p (Lisp_Object gstring) | 713 | composition_gstring_p (Lisp_Object gstring) |
| 714 | { | 714 | { |
| 715 | Lisp_Object header; | 715 | Lisp_Object header; |
| @@ -1212,11 +1212,13 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos, | |||
| 1212 | string. In that case, FACE must not be NULL. | 1212 | string. In that case, FACE must not be NULL. |
| 1213 | 1213 | ||
| 1214 | If the character is composed, setup members of CMP_IT (id, nglyphs, | 1214 | If the character is composed, setup members of CMP_IT (id, nglyphs, |
| 1215 | from, to, reversed_p), and return 1. Otherwise, update | 1215 | from, to, reversed_p), and return true. Otherwise, update |
| 1216 | CMP_IT->stop_pos, and return 0. */ | 1216 | CMP_IT->stop_pos, and return false. */ |
| 1217 | 1217 | ||
| 1218 | int | 1218 | bool |
| 1219 | composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t endpos, struct window *w, struct face *face, Lisp_Object string) | 1219 | composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, |
| 1220 | ptrdiff_t bytepos, ptrdiff_t endpos, struct window *w, | ||
| 1221 | struct face *face, Lisp_Object string) | ||
| 1220 | { | 1222 | { |
| 1221 | if (endpos < 0) | 1223 | if (endpos < 0) |
| 1222 | endpos = NILP (string) ? BEGV : 0; | 1224 | endpos = NILP (string) ? BEGV : 0; |
| @@ -1482,10 +1484,10 @@ struct position_record | |||
| 1482 | /* This is like find_composition, but find an automatic composition | 1484 | /* This is like find_composition, but find an automatic composition |
| 1483 | instead. It is assured that POS is not within a static | 1485 | instead. It is assured that POS is not within a static |
| 1484 | composition. If found, set *GSTRING to the glyph-string | 1486 | composition. If found, set *GSTRING to the glyph-string |
| 1485 | representing the composition, and return 1. Otherwise, *GSTRING to | 1487 | representing the composition, and return true. Otherwise, *GSTRING to |
| 1486 | Qnil, and return 0. */ | 1488 | Qnil, and return false. */ |
| 1487 | 1489 | ||
| 1488 | static int | 1490 | static bool |
| 1489 | find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, | 1491 | find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, |
| 1490 | ptrdiff_t *start, ptrdiff_t *end, | 1492 | ptrdiff_t *start, ptrdiff_t *end, |
| 1491 | Lisp_Object *gstring, Lisp_Object string) | 1493 | Lisp_Object *gstring, Lisp_Object string) |
| @@ -1498,7 +1500,7 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, | |||
| 1498 | int c; | 1500 | int c; |
| 1499 | Lisp_Object window; | 1501 | Lisp_Object window; |
| 1500 | struct window *w; | 1502 | struct window *w; |
| 1501 | int need_adjustment = 0; | 1503 | bool need_adjustment = 0; |
| 1502 | 1504 | ||
| 1503 | window = Fget_buffer_window (Fcurrent_buffer (), Qnil); | 1505 | window = Fget_buffer_window (Fcurrent_buffer (), Qnil); |
| 1504 | if (NILP (window)) | 1506 | if (NILP (window)) |
diff --git a/src/composite.h b/src/composite.h index 6a7e0a5e2c7..68f5b27ee42 100644 --- a/src/composite.h +++ b/src/composite.h | |||
| @@ -223,8 +223,8 @@ extern Lisp_Object Qcomposition; | |||
| 223 | extern Lisp_Object composition_hash_table; | 223 | extern Lisp_Object composition_hash_table; |
| 224 | extern ptrdiff_t get_composition_id (ptrdiff_t, ptrdiff_t, ptrdiff_t, | 224 | extern ptrdiff_t get_composition_id (ptrdiff_t, ptrdiff_t, ptrdiff_t, |
| 225 | Lisp_Object, Lisp_Object); | 225 | Lisp_Object, Lisp_Object); |
| 226 | extern int find_composition (ptrdiff_t, ptrdiff_t, ptrdiff_t *, ptrdiff_t *, | 226 | extern bool find_composition (ptrdiff_t, ptrdiff_t, ptrdiff_t *, ptrdiff_t *, |
| 227 | Lisp_Object *, Lisp_Object); | 227 | Lisp_Object *, Lisp_Object); |
| 228 | extern void update_compositions (ptrdiff_t, ptrdiff_t, int); | 228 | extern void update_compositions (ptrdiff_t, ptrdiff_t, int); |
| 229 | extern void make_composition_value_copy (Lisp_Object); | 229 | extern void make_composition_value_copy (Lisp_Object); |
| 230 | extern void compose_region (int, int, Lisp_Object, Lisp_Object, | 230 | extern void compose_region (int, int, Lisp_Object, Lisp_Object, |
| @@ -310,17 +310,16 @@ struct font_metrics; | |||
| 310 | 310 | ||
| 311 | extern Lisp_Object composition_gstring_put_cache (Lisp_Object, ptrdiff_t); | 311 | extern Lisp_Object composition_gstring_put_cache (Lisp_Object, ptrdiff_t); |
| 312 | extern Lisp_Object composition_gstring_from_id (ptrdiff_t); | 312 | extern Lisp_Object composition_gstring_from_id (ptrdiff_t); |
| 313 | extern int composition_gstring_p (Lisp_Object); | 313 | extern bool composition_gstring_p (Lisp_Object); |
| 314 | extern int composition_gstring_width (Lisp_Object, ptrdiff_t, ptrdiff_t, | 314 | extern int composition_gstring_width (Lisp_Object, ptrdiff_t, ptrdiff_t, |
| 315 | struct font_metrics *); | 315 | struct font_metrics *); |
| 316 | 316 | ||
| 317 | extern void composition_compute_stop_pos (struct composition_it *, | 317 | extern void composition_compute_stop_pos (struct composition_it *, |
| 318 | ptrdiff_t, ptrdiff_t, ptrdiff_t, | 318 | ptrdiff_t, ptrdiff_t, ptrdiff_t, |
| 319 | Lisp_Object); | 319 | Lisp_Object); |
| 320 | extern int composition_reseat_it (struct composition_it *, | 320 | extern bool composition_reseat_it (struct composition_it *, ptrdiff_t, |
| 321 | ptrdiff_t, ptrdiff_t, ptrdiff_t, | 321 | ptrdiff_t, ptrdiff_t, struct window *, |
| 322 | struct window *, struct face *, | 322 | struct face *, Lisp_Object); |
| 323 | Lisp_Object); | ||
| 324 | extern int composition_update_it (struct composition_it *, | 323 | extern int composition_update_it (struct composition_it *, |
| 325 | ptrdiff_t, ptrdiff_t, Lisp_Object); | 324 | ptrdiff_t, ptrdiff_t, Lisp_Object); |
| 326 | 325 | ||
diff --git a/src/data.c b/src/data.c index f812c280b40..d8b7f42ea3f 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -83,8 +83,8 @@ Lisp_Object Qoverflow_error, Qunderflow_error; | |||
| 83 | Lisp_Object Qfloatp; | 83 | Lisp_Object Qfloatp; |
| 84 | Lisp_Object Qnumberp, Qnumber_or_marker_p; | 84 | Lisp_Object Qnumberp, Qnumber_or_marker_p; |
| 85 | 85 | ||
| 86 | Lisp_Object Qinteger, Qinterval, Qfloat, Qvector; | 86 | Lisp_Object Qinteger, Qsymbol; |
| 87 | Lisp_Object Qsymbol, Qstring, Qcons, Qmisc; | 87 | static Lisp_Object Qcons, Qfloat, Qmisc, Qstring, Qvector; |
| 88 | Lisp_Object Qwindow; | 88 | Lisp_Object Qwindow; |
| 89 | static Lisp_Object Qoverlay, Qwindow_configuration; | 89 | static Lisp_Object Qoverlay, Qwindow_configuration; |
| 90 | static Lisp_Object Qprocess, Qmarker; | 90 | static Lisp_Object Qprocess, Qmarker; |
| @@ -1080,10 +1080,10 @@ DEFUN ("set", Fset, Sset, 2, 2, 0, | |||
| 1080 | return newval; | 1080 | return newval; |
| 1081 | } | 1081 | } |
| 1082 | 1082 | ||
| 1083 | /* Return 1 if SYMBOL currently has a let-binding | 1083 | /* Return true if SYMBOL currently has a let-binding |
| 1084 | which was made in the buffer that is now current. */ | 1084 | which was made in the buffer that is now current. */ |
| 1085 | 1085 | ||
| 1086 | static int | 1086 | static bool |
| 1087 | let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol) | 1087 | let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol) |
| 1088 | { | 1088 | { |
| 1089 | struct specbinding *p; | 1089 | struct specbinding *p; |
| @@ -1102,7 +1102,7 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol) | |||
| 1102 | return 0; | 1102 | return 0; |
| 1103 | } | 1103 | } |
| 1104 | 1104 | ||
| 1105 | static int | 1105 | static bool |
| 1106 | let_shadows_global_binding_p (Lisp_Object symbol) | 1106 | let_shadows_global_binding_p (Lisp_Object symbol) |
| 1107 | { | 1107 | { |
| 1108 | struct specbinding *p; | 1108 | struct specbinding *p; |
| @@ -1118,14 +1118,15 @@ let_shadows_global_binding_p (Lisp_Object symbol) | |||
| 1118 | If buffer/frame-locality is an issue, WHERE specifies which context to use. | 1118 | If buffer/frame-locality is an issue, WHERE specifies which context to use. |
| 1119 | (nil stands for the current buffer/frame). | 1119 | (nil stands for the current buffer/frame). |
| 1120 | 1120 | ||
| 1121 | If BINDFLAG is zero, then if this symbol is supposed to become | 1121 | If BINDFLAG is false, then if this symbol is supposed to become |
| 1122 | local in every buffer where it is set, then we make it local. | 1122 | local in every buffer where it is set, then we make it local. |
| 1123 | If BINDFLAG is nonzero, we don't do that. */ | 1123 | If BINDFLAG is true, we don't do that. */ |
| 1124 | 1124 | ||
| 1125 | void | 1125 | void |
| 1126 | set_internal (register Lisp_Object symbol, register Lisp_Object newval, register Lisp_Object where, int bindflag) | 1126 | set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, |
| 1127 | bool bindflag) | ||
| 1127 | { | 1128 | { |
| 1128 | int voide = EQ (newval, Qunbound); | 1129 | bool voide = EQ (newval, Qunbound); |
| 1129 | struct Lisp_Symbol *sym; | 1130 | struct Lisp_Symbol *sym; |
| 1130 | Lisp_Object tem1; | 1131 | Lisp_Object tem1; |
| 1131 | 1132 | ||
| @@ -1464,7 +1465,8 @@ union Lisp_Val_Fwd | |||
| 1464 | }; | 1465 | }; |
| 1465 | 1466 | ||
| 1466 | static struct Lisp_Buffer_Local_Value * | 1467 | static struct Lisp_Buffer_Local_Value * |
| 1467 | make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents) | 1468 | make_blv (struct Lisp_Symbol *sym, bool forwarded, |
| 1469 | union Lisp_Val_Fwd valcontents) | ||
| 1468 | { | 1470 | { |
| 1469 | struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv); | 1471 | struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv); |
| 1470 | Lisp_Object symbol; | 1472 | Lisp_Object symbol; |
| @@ -1508,7 +1510,7 @@ The function `default-value' gets the default value and `set-default' sets it. | |||
| 1508 | struct Lisp_Symbol *sym; | 1510 | struct Lisp_Symbol *sym; |
| 1509 | struct Lisp_Buffer_Local_Value *blv = NULL; | 1511 | struct Lisp_Buffer_Local_Value *blv = NULL; |
| 1510 | union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO}); | 1512 | union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO}); |
| 1511 | int forwarded IF_LINT (= 0); | 1513 | bool forwarded IF_LINT (= 0); |
| 1512 | 1514 | ||
| 1513 | CHECK_SYMBOL (variable); | 1515 | CHECK_SYMBOL (variable); |
| 1514 | sym = XSYMBOL (variable); | 1516 | sym = XSYMBOL (variable); |
| @@ -1580,10 +1582,10 @@ See also `make-variable-buffer-local'. | |||
| 1580 | 1582 | ||
| 1581 | Do not use `make-local-variable' to make a hook variable buffer-local. | 1583 | Do not use `make-local-variable' to make a hook variable buffer-local. |
| 1582 | Instead, use `add-hook' and specify t for the LOCAL argument. */) | 1584 | Instead, use `add-hook' and specify t for the LOCAL argument. */) |
| 1583 | (register Lisp_Object variable) | 1585 | (Lisp_Object variable) |
| 1584 | { | 1586 | { |
| 1585 | register Lisp_Object tem; | 1587 | Lisp_Object tem; |
| 1586 | int forwarded IF_LINT (= 0); | 1588 | bool forwarded IF_LINT (= 0); |
| 1587 | union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO}); | 1589 | union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO}); |
| 1588 | struct Lisp_Symbol *sym; | 1590 | struct Lisp_Symbol *sym; |
| 1589 | struct Lisp_Buffer_Local_Value *blv = NULL; | 1591 | struct Lisp_Buffer_Local_Value *blv = NULL; |
| @@ -1767,9 +1769,9 @@ is to set the VARIABLE frame parameter of that frame. See | |||
| 1767 | Note that since Emacs 23.1, variables cannot be both buffer-local and | 1769 | Note that since Emacs 23.1, variables cannot be both buffer-local and |
| 1768 | frame-local any more (buffer-local bindings used to take precedence over | 1770 | frame-local any more (buffer-local bindings used to take precedence over |
| 1769 | frame-local bindings). */) | 1771 | frame-local bindings). */) |
| 1770 | (register Lisp_Object variable) | 1772 | (Lisp_Object variable) |
| 1771 | { | 1773 | { |
| 1772 | int forwarded; | 1774 | bool forwarded; |
| 1773 | union Lisp_Val_Fwd valcontents; | 1775 | union Lisp_Val_Fwd valcontents; |
| 1774 | struct Lisp_Symbol *sym; | 1776 | struct Lisp_Symbol *sym; |
| 1775 | struct Lisp_Buffer_Local_Value *blv = NULL; | 1777 | struct Lisp_Buffer_Local_Value *blv = NULL; |
| @@ -2225,7 +2227,7 @@ static Lisp_Object | |||
| 2225 | arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison) | 2227 | arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison) |
| 2226 | { | 2228 | { |
| 2227 | double f1 = 0, f2 = 0; | 2229 | double f1 = 0, f2 = 0; |
| 2228 | int floatp = 0; | 2230 | bool floatp = 0; |
| 2229 | 2231 | ||
| 2230 | CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num1); | 2232 | CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num1); |
| 2231 | CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num2); | 2233 | CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num2); |
| @@ -2342,7 +2344,7 @@ DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0, | |||
| 2342 | uintmax_t | 2344 | uintmax_t |
| 2343 | cons_to_unsigned (Lisp_Object c, uintmax_t max) | 2345 | cons_to_unsigned (Lisp_Object c, uintmax_t max) |
| 2344 | { | 2346 | { |
| 2345 | int valid = 0; | 2347 | bool valid = 0; |
| 2346 | uintmax_t val IF_LINT (= 0); | 2348 | uintmax_t val IF_LINT (= 0); |
| 2347 | if (INTEGERP (c)) | 2349 | if (INTEGERP (c)) |
| 2348 | { | 2350 | { |
| @@ -2395,7 +2397,7 @@ cons_to_unsigned (Lisp_Object c, uintmax_t max) | |||
| 2395 | intmax_t | 2397 | intmax_t |
| 2396 | cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max) | 2398 | cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max) |
| 2397 | { | 2399 | { |
| 2398 | int valid = 0; | 2400 | bool valid = 0; |
| 2399 | intmax_t val IF_LINT (= 0); | 2401 | intmax_t val IF_LINT (= 0); |
| 2400 | if (INTEGERP (c)) | 2402 | if (INTEGERP (c)) |
| 2401 | { | 2403 | { |
| @@ -2513,14 +2515,11 @@ static Lisp_Object float_arith_driver (double, ptrdiff_t, enum arithop, | |||
| 2513 | static Lisp_Object | 2515 | static Lisp_Object |
| 2514 | arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args) | 2516 | arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args) |
| 2515 | { | 2517 | { |
| 2516 | register Lisp_Object val; | 2518 | Lisp_Object val; |
| 2517 | ptrdiff_t argnum; | 2519 | ptrdiff_t argnum, ok_args; |
| 2518 | register EMACS_INT accum = 0; | 2520 | EMACS_INT accum = 0; |
| 2519 | register EMACS_INT next; | 2521 | EMACS_INT next, ok_accum; |
| 2520 | 2522 | bool overflow = 0; | |
| 2521 | int overflow = 0; | ||
| 2522 | ptrdiff_t ok_args; | ||
| 2523 | EMACS_INT ok_accum; | ||
| 2524 | 2523 | ||
| 2525 | switch (code) | 2524 | switch (code) |
| 2526 | { | 2525 | { |
| @@ -3090,8 +3089,6 @@ syms_of_data (void) | |||
| 3090 | DEFSYM (Qchar_table, "char-table"); | 3089 | DEFSYM (Qchar_table, "char-table"); |
| 3091 | DEFSYM (Qbool_vector, "bool-vector"); | 3090 | DEFSYM (Qbool_vector, "bool-vector"); |
| 3092 | DEFSYM (Qhash_table, "hash-table"); | 3091 | DEFSYM (Qhash_table, "hash-table"); |
| 3093 | /* Used by Fgarbage_collect. */ | ||
| 3094 | DEFSYM (Qinterval, "interval"); | ||
| 3095 | DEFSYM (Qmisc, "misc"); | 3092 | DEFSYM (Qmisc, "misc"); |
| 3096 | 3093 | ||
| 3097 | DEFSYM (Qdefun, "defun"); | 3094 | DEFSYM (Qdefun, "defun"); |
diff --git a/src/dbusbind.c b/src/dbusbind.c index f63f2948304..901820648cb 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c | |||
| @@ -70,7 +70,7 @@ static Lisp_Object QCdbus_registered_signal; | |||
| 70 | static Lisp_Object xd_registered_buses; | 70 | static Lisp_Object xd_registered_buses; |
| 71 | 71 | ||
| 72 | /* Whether we are reading a D-Bus event. */ | 72 | /* Whether we are reading a D-Bus event. */ |
| 73 | static int xd_in_read_queued_messages = 0; | 73 | static bool xd_in_read_queued_messages = 0; |
| 74 | 74 | ||
| 75 | 75 | ||
| 76 | /* We use "xd_" and "XD_" as prefix for all internal symbols, because | 76 | /* We use "xd_" and "XD_" as prefix for all internal symbols, because |
| @@ -997,8 +997,7 @@ xd_find_watch_fd (DBusWatch *watch) | |||
| 997 | } | 997 | } |
| 998 | 998 | ||
| 999 | /* Prototype. */ | 999 | /* Prototype. */ |
| 1000 | static void | 1000 | static void xd_read_queued_messages (int fd, void *data); |
| 1001 | xd_read_queued_messages (int fd, void *data, int for_read); | ||
| 1002 | 1001 | ||
| 1003 | /* Start monitoring WATCH for possible I/O. */ | 1002 | /* Start monitoring WATCH for possible I/O. */ |
| 1004 | static dbus_bool_t | 1003 | static dbus_bool_t |
| @@ -1686,7 +1685,7 @@ xd_read_message (Lisp_Object bus) | |||
| 1686 | 1685 | ||
| 1687 | /* Callback called when something is ready to read or write. */ | 1686 | /* Callback called when something is ready to read or write. */ |
| 1688 | static void | 1687 | static void |
| 1689 | xd_read_queued_messages (int fd, void *data, int for_read) | 1688 | xd_read_queued_messages (int fd, void *data) |
| 1690 | { | 1689 | { |
| 1691 | Lisp_Object busp = xd_registered_buses; | 1690 | Lisp_Object busp = xd_registered_buses; |
| 1692 | Lisp_Object bus = Qnil; | 1691 | Lisp_Object bus = Qnil; |
diff --git a/src/dired.c b/src/dired.c index 771230717e3..fa293258107 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -109,18 +109,20 @@ directory_files_internal_unwind (Lisp_Object dh) | |||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | /* Function shared by Fdirectory_files and Fdirectory_files_and_attributes. | 111 | /* Function shared by Fdirectory_files and Fdirectory_files_and_attributes. |
| 112 | When ATTRS is zero, return a list of directory filenames; when | 112 | If not ATTRS, return a list of directory filenames; |
| 113 | non-zero, return a list of directory filenames and their attributes. | 113 | if ATTRS, return a list of directory filenames and their attributes. |
| 114 | In the latter case, ID_FORMAT is passed to Ffile_attributes. */ | 114 | In the latter case, ID_FORMAT is passed to Ffile_attributes. */ |
| 115 | 115 | ||
| 116 | Lisp_Object | 116 | Lisp_Object |
| 117 | directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, int attrs, Lisp_Object id_format) | 117 | directory_files_internal (Lisp_Object directory, Lisp_Object full, |
| 118 | Lisp_Object match, Lisp_Object nosort, bool attrs, | ||
| 119 | Lisp_Object id_format) | ||
| 118 | { | 120 | { |
| 119 | DIR *d; | 121 | DIR *d; |
| 120 | ptrdiff_t directory_nbytes; | 122 | ptrdiff_t directory_nbytes; |
| 121 | Lisp_Object list, dirfilename, encoded_directory; | 123 | Lisp_Object list, dirfilename, encoded_directory; |
| 122 | struct re_pattern_buffer *bufp = NULL; | 124 | struct re_pattern_buffer *bufp = NULL; |
| 123 | int needsep = 0; | 125 | bool needsep = 0; |
| 124 | ptrdiff_t count = SPECPDL_INDEX (); | 126 | ptrdiff_t count = SPECPDL_INDEX (); |
| 125 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; | 127 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
| 126 | DIRENTRY *dp; | 128 | DIRENTRY *dp; |
| @@ -227,7 +229,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m | |||
| 227 | if (DIRENTRY_NONEMPTY (dp)) | 229 | if (DIRENTRY_NONEMPTY (dp)) |
| 228 | { | 230 | { |
| 229 | ptrdiff_t len; | 231 | ptrdiff_t len; |
| 230 | int wanted = 0; | 232 | bool wanted = 0; |
| 231 | Lisp_Object name, finalname; | 233 | Lisp_Object name, finalname; |
| 232 | struct gcpro gcpro1, gcpro2; | 234 | struct gcpro gcpro1, gcpro2; |
| 233 | 235 | ||
| @@ -381,9 +383,8 @@ which see. */) | |||
| 381 | } | 383 | } |
| 382 | 384 | ||
| 383 | 385 | ||
| 384 | static Lisp_Object file_name_completion | 386 | static Lisp_Object file_name_completion (Lisp_Object, Lisp_Object, bool, |
| 385 | (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, | 387 | Lisp_Object); |
| 386 | Lisp_Object predicate); | ||
| 387 | 388 | ||
| 388 | DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion, | 389 | DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion, |
| 389 | 2, 3, 0, | 390 | 2, 3, 0, |
| @@ -415,7 +416,7 @@ determined by the variable `completion-ignored-extensions', which see. */) | |||
| 415 | if (!NILP (handler)) | 416 | if (!NILP (handler)) |
| 416 | return call4 (handler, Qfile_name_completion, file, directory, predicate); | 417 | return call4 (handler, Qfile_name_completion, file, directory, predicate); |
| 417 | 418 | ||
| 418 | return file_name_completion (file, directory, 0, 0, predicate); | 419 | return file_name_completion (file, directory, 0, predicate); |
| 419 | } | 420 | } |
| 420 | 421 | ||
| 421 | DEFUN ("file-name-all-completions", Ffile_name_all_completions, | 422 | DEFUN ("file-name-all-completions", Ffile_name_all_completions, |
| @@ -439,14 +440,15 @@ These are all file names in directory DIRECTORY which begin with FILE. */) | |||
| 439 | if (!NILP (handler)) | 440 | if (!NILP (handler)) |
| 440 | return call3 (handler, Qfile_name_all_completions, file, directory); | 441 | return call3 (handler, Qfile_name_all_completions, file, directory); |
| 441 | 442 | ||
| 442 | return file_name_completion (file, directory, 1, 0, Qnil); | 443 | return file_name_completion (file, directory, 1, Qnil); |
| 443 | } | 444 | } |
| 444 | 445 | ||
| 445 | static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr); | 446 | static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr); |
| 446 | static Lisp_Object Qdefault_directory; | 447 | static Lisp_Object Qdefault_directory; |
| 447 | 448 | ||
| 448 | static Lisp_Object | 449 | static Lisp_Object |
| 449 | file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, Lisp_Object predicate) | 450 | file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, |
| 451 | Lisp_Object predicate) | ||
| 450 | { | 452 | { |
| 451 | DIR *d; | 453 | DIR *d; |
| 452 | ptrdiff_t bestmatchsize = 0; | 454 | ptrdiff_t bestmatchsize = 0; |
| @@ -458,11 +460,11 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 458 | Lisp_Object encoded_file; | 460 | Lisp_Object encoded_file; |
| 459 | Lisp_Object encoded_dir; | 461 | Lisp_Object encoded_dir; |
| 460 | struct stat st; | 462 | struct stat st; |
| 461 | int directoryp; | 463 | bool directoryp; |
| 462 | /* If includeall is zero, exclude files in completion-ignored-extensions as | 464 | /* If not INCLUDEALL, exclude files in completion-ignored-extensions as |
| 463 | well as "." and "..". Until shown otherwise, assume we can't exclude | 465 | well as "." and "..". Until shown otherwise, assume we can't exclude |
| 464 | anything. */ | 466 | anything. */ |
| 465 | int includeall = 1; | 467 | bool includeall = 1; |
| 466 | ptrdiff_t count = SPECPDL_INDEX (); | 468 | ptrdiff_t count = SPECPDL_INDEX (); |
| 467 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; | 469 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
| 468 | 470 | ||
| @@ -500,7 +502,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 500 | { | 502 | { |
| 501 | DIRENTRY *dp; | 503 | DIRENTRY *dp; |
| 502 | ptrdiff_t len; | 504 | ptrdiff_t len; |
| 503 | int canexclude = 0; | 505 | bool canexclude = 0; |
| 504 | 506 | ||
| 505 | errno = 0; | 507 | errno = 0; |
| 506 | dp = readdir (d); | 508 | dp = readdir (d); |
| @@ -528,7 +530,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 528 | if (file_name_completion_stat (encoded_dir, dp, &st) < 0) | 530 | if (file_name_completion_stat (encoded_dir, dp, &st) < 0) |
| 529 | continue; | 531 | continue; |
| 530 | 532 | ||
| 531 | directoryp = S_ISDIR (st.st_mode); | 533 | directoryp = S_ISDIR (st.st_mode) != 0; |
| 532 | tem = Qnil; | 534 | tem = Qnil; |
| 533 | /* If all_flag is set, always include all. | 535 | /* If all_flag is set, always include all. |
| 534 | It would not actually be helpful to the user to ignore any possible | 536 | It would not actually be helpful to the user to ignore any possible |
| @@ -716,7 +718,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 716 | /* This tests that the current file is an exact match | 718 | /* This tests that the current file is an exact match |
| 717 | but BESTMATCH is not (it is too long). */ | 719 | but BESTMATCH is not (it is too long). */ |
| 718 | if ((matchsize == SCHARS (name) | 720 | if ((matchsize == SCHARS (name) |
| 719 | && matchsize + !!directoryp < SCHARS (bestmatch)) | 721 | && matchsize + directoryp < SCHARS (bestmatch)) |
| 720 | || | 722 | || |
| 721 | /* If there is no exact match ignoring case, | 723 | /* If there is no exact match ignoring case, |
| 722 | prefer a match that does not change the case | 724 | prefer a match that does not change the case |
| @@ -728,7 +730,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 728 | either both or neither are exact. */ | 730 | either both or neither are exact. */ |
| 729 | (((matchsize == SCHARS (name)) | 731 | (((matchsize == SCHARS (name)) |
| 730 | == | 732 | == |
| 731 | (matchsize + !!directoryp == SCHARS (bestmatch))) | 733 | (matchsize + directoryp == SCHARS (bestmatch))) |
| 732 | && (cmp = Fcompare_strings (name, zero, | 734 | && (cmp = Fcompare_strings (name, zero, |
| 733 | make_number (SCHARS (file)), | 735 | make_number (SCHARS (file)), |
| 734 | file, zero, | 736 | file, zero, |
diff --git a/src/dispextern.h b/src/dispextern.h index a25aac96df9..1140d98f8a7 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -671,7 +671,7 @@ struct glyph_matrix | |||
| 671 | 671 | ||
| 672 | /* Values of BEGV and ZV as of last redisplay. Set in | 672 | /* Values of BEGV and ZV as of last redisplay. Set in |
| 673 | mark_window_display_accurate_1. */ | 673 | mark_window_display_accurate_1. */ |
| 674 | int begv, zv; | 674 | ptrdiff_t begv, zv; |
| 675 | }; | 675 | }; |
| 676 | 676 | ||
| 677 | 677 | ||
| @@ -1126,11 +1126,11 @@ struct glyph_row *matrix_row (struct glyph_matrix *, int); | |||
| 1126 | ((ROW)->phys_height - (ROW)->phys_ascent \ | 1126 | ((ROW)->phys_height - (ROW)->phys_ascent \ |
| 1127 | > (ROW)->height - (ROW)->ascent) | 1127 | > (ROW)->height - (ROW)->ascent) |
| 1128 | 1128 | ||
| 1129 | /* Non-zero means that fonts have been loaded since the last glyph | 1129 | /* True means that fonts have been loaded since the last glyph |
| 1130 | matrix adjustments. The function redisplay_internal adjusts glyph | 1130 | matrix adjustments. The function redisplay_internal adjusts glyph |
| 1131 | matrices when this flag is non-zero. */ | 1131 | matrices when this flag is true. */ |
| 1132 | 1132 | ||
| 1133 | extern int fonts_changed_p; | 1133 | extern bool fonts_changed_p; |
| 1134 | 1134 | ||
| 1135 | /* A glyph for a space. */ | 1135 | /* A glyph for a space. */ |
| 1136 | 1136 | ||
| @@ -1149,7 +1149,7 @@ extern int updated_area; | |||
| 1149 | /* Non-zero means last display completed. Zero means it was | 1149 | /* Non-zero means last display completed. Zero means it was |
| 1150 | preempted. */ | 1150 | preempted. */ |
| 1151 | 1151 | ||
| 1152 | extern int display_completed; | 1152 | extern bool display_completed; |
| 1153 | 1153 | ||
| 1154 | 1154 | ||
| 1155 | 1155 | ||
| @@ -1415,7 +1415,7 @@ struct glyph_string | |||
| 1415 | && !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)) \ | 1415 | && !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)) \ |
| 1416 | && WINDOW_TOTAL_LINES (W) > 1) | 1416 | && WINDOW_TOTAL_LINES (W) > 1) |
| 1417 | 1417 | ||
| 1418 | /* Value is non-zero if window W wants a header line. */ | 1418 | /* Value is true if window W wants a header line. */ |
| 1419 | 1419 | ||
| 1420 | #define WINDOW_WANTS_HEADER_LINE_P(W) \ | 1420 | #define WINDOW_WANTS_HEADER_LINE_P(W) \ |
| 1421 | (!MINI_WINDOW_P ((W)) \ | 1421 | (!MINI_WINDOW_P ((W)) \ |
| @@ -1856,7 +1856,6 @@ struct bidi_it { | |||
| 1856 | int resolved_level; /* final resolved level of this character */ | 1856 | int resolved_level; /* final resolved level of this character */ |
| 1857 | int invalid_levels; /* how many PDFs to ignore */ | 1857 | int invalid_levels; /* how many PDFs to ignore */ |
| 1858 | int invalid_rl_levels; /* how many PDFs from RLE/RLO to ignore */ | 1858 | int invalid_rl_levels; /* how many PDFs from RLE/RLO to ignore */ |
| 1859 | int prev_was_pdf; /* if non-zero, previous char was PDF */ | ||
| 1860 | struct bidi_saved_info prev; /* info about previous character */ | 1859 | struct bidi_saved_info prev; /* info about previous character */ |
| 1861 | struct bidi_saved_info last_strong; /* last-seen strong directional char */ | 1860 | struct bidi_saved_info last_strong; /* last-seen strong directional char */ |
| 1862 | struct bidi_saved_info next_for_neutral; /* surrounding characters for... */ | 1861 | struct bidi_saved_info next_for_neutral; /* surrounding characters for... */ |
| @@ -1879,6 +1878,7 @@ struct bidi_it { | |||
| 1879 | struct bidi_string_data string; /* string to reorder */ | 1878 | struct bidi_string_data string; /* string to reorder */ |
| 1880 | bidi_dir_t paragraph_dir; /* current paragraph direction */ | 1879 | bidi_dir_t paragraph_dir; /* current paragraph direction */ |
| 1881 | ptrdiff_t separator_limit; /* where paragraph separator should end */ | 1880 | ptrdiff_t separator_limit; /* where paragraph separator should end */ |
| 1881 | unsigned prev_was_pdf : 1; /* if non-zero, previous char was PDF */ | ||
| 1882 | unsigned first_elt : 1; /* if non-zero, examine current char first */ | 1882 | unsigned first_elt : 1; /* if non-zero, examine current char first */ |
| 1883 | unsigned new_paragraph : 1; /* if non-zero, we expect a new paragraph */ | 1883 | unsigned new_paragraph : 1; /* if non-zero, we expect a new paragraph */ |
| 1884 | unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */ | 1884 | unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */ |
| @@ -2085,10 +2085,10 @@ struct composition_it | |||
| 2085 | ptrdiff_t lookback; | 2085 | ptrdiff_t lookback; |
| 2086 | /* If non-negative, number of glyphs of the glyph-string. */ | 2086 | /* If non-negative, number of glyphs of the glyph-string. */ |
| 2087 | int nglyphs; | 2087 | int nglyphs; |
| 2088 | /* Nonzero iff the composition is created while buffer is scanned in | 2088 | /* True iff the composition is created while buffer is scanned in |
| 2089 | reverse order, and thus the grapheme clusters must be rendered | 2089 | reverse order, and thus the grapheme clusters must be rendered |
| 2090 | from the last to the first. */ | 2090 | from the last to the first. */ |
| 2091 | int reversed_p; | 2091 | bool reversed_p; |
| 2092 | 2092 | ||
| 2093 | /** The following members contain information about the current | 2093 | /** The following members contain information about the current |
| 2094 | grapheme cluster. */ | 2094 | grapheme cluster. */ |
| @@ -3002,14 +3002,14 @@ enum tool_bar_item_image | |||
| 3002 | 3002 | ||
| 3003 | /* Defined in bidi.c */ | 3003 | /* Defined in bidi.c */ |
| 3004 | 3004 | ||
| 3005 | extern void bidi_init_it (ptrdiff_t, ptrdiff_t, int, struct bidi_it *); | 3005 | extern void bidi_init_it (ptrdiff_t, ptrdiff_t, bool, struct bidi_it *); |
| 3006 | extern void bidi_move_to_visually_next (struct bidi_it *); | 3006 | extern void bidi_move_to_visually_next (struct bidi_it *); |
| 3007 | extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int); | 3007 | extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, bool); |
| 3008 | extern int bidi_mirror_char (int); | 3008 | extern int bidi_mirror_char (int); |
| 3009 | extern void bidi_push_it (struct bidi_it *); | 3009 | extern void bidi_push_it (struct bidi_it *); |
| 3010 | extern void bidi_pop_it (struct bidi_it *); | 3010 | extern void bidi_pop_it (struct bidi_it *); |
| 3011 | extern void *bidi_shelve_cache (void); | 3011 | extern void *bidi_shelve_cache (void); |
| 3012 | extern void bidi_unshelve_cache (void *, int); | 3012 | extern void bidi_unshelve_cache (void *, bool); |
| 3013 | 3013 | ||
| 3014 | /* Defined in xdisp.c */ | 3014 | /* Defined in xdisp.c */ |
| 3015 | 3015 | ||
| @@ -3304,7 +3304,7 @@ extern Lisp_Object marginal_area_string (struct window *, enum window_part, | |||
| 3304 | extern void redraw_frame (struct frame *); | 3304 | extern void redraw_frame (struct frame *); |
| 3305 | extern void cancel_line (int, struct frame *); | 3305 | extern void cancel_line (int, struct frame *); |
| 3306 | extern void init_desired_glyphs (struct frame *); | 3306 | extern void init_desired_glyphs (struct frame *); |
| 3307 | extern int update_frame (struct frame *, int, int); | 3307 | extern bool update_frame (struct frame *, bool, bool); |
| 3308 | extern void bitch_at_user (void); | 3308 | extern void bitch_at_user (void); |
| 3309 | void adjust_glyphs (struct frame *); | 3309 | void adjust_glyphs (struct frame *); |
| 3310 | void free_glyphs (struct frame *); | 3310 | void free_glyphs (struct frame *); |
| @@ -3320,13 +3320,13 @@ void rotate_matrix (struct glyph_matrix *, int, int, int); | |||
| 3320 | void increment_matrix_positions (struct glyph_matrix *, | 3320 | void increment_matrix_positions (struct glyph_matrix *, |
| 3321 | int, int, ptrdiff_t, ptrdiff_t); | 3321 | int, int, ptrdiff_t, ptrdiff_t); |
| 3322 | void blank_row (struct window *, struct glyph_row *, int); | 3322 | void blank_row (struct window *, struct glyph_row *, int); |
| 3323 | void enable_glyph_matrix_rows (struct glyph_matrix *, int, int, int); | 3323 | void clear_glyph_matrix_rows (struct glyph_matrix *, int, int); |
| 3324 | void clear_glyph_row (struct glyph_row *); | 3324 | void clear_glyph_row (struct glyph_row *); |
| 3325 | void prepare_desired_row (struct glyph_row *); | 3325 | void prepare_desired_row (struct glyph_row *); |
| 3326 | void set_window_update_flags (struct window *, int); | 3326 | void set_window_update_flags (struct window *, bool); |
| 3327 | void update_single_window (struct window *, int); | 3327 | void update_single_window (struct window *, bool); |
| 3328 | void do_pending_window_change (int); | 3328 | void do_pending_window_change (bool); |
| 3329 | void change_frame_size (struct frame *, int, int, int, int, int); | 3329 | void change_frame_size (struct frame *, int, int, bool, bool, bool); |
| 3330 | void init_display (void); | 3330 | void init_display (void); |
| 3331 | void syms_of_display (void); | 3331 | void syms_of_display (void); |
| 3332 | extern Lisp_Object Qredisplay_dont_pause; | 3332 | extern Lisp_Object Qredisplay_dont_pause; |
diff --git a/src/dispnew.c b/src/dispnew.c index ce7c4ebcb4c..4e307880111 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -88,7 +88,7 @@ static void update_frame_line (struct frame *, int); | |||
| 88 | static int required_matrix_height (struct window *); | 88 | static int required_matrix_height (struct window *); |
| 89 | static int required_matrix_width (struct window *); | 89 | static int required_matrix_width (struct window *); |
| 90 | static void adjust_frame_glyphs (struct frame *); | 90 | static void adjust_frame_glyphs (struct frame *); |
| 91 | static void change_frame_size_1 (struct frame *, int, int, int, int, int); | 91 | static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool); |
| 92 | static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t); | 92 | static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t); |
| 93 | static void fill_up_frame_row_with_spaces (struct glyph_row *, int); | 93 | static void fill_up_frame_row_with_spaces (struct glyph_row *, int); |
| 94 | static void build_frame_matrix_from_window_tree (struct glyph_matrix *, | 94 | static void build_frame_matrix_from_window_tree (struct glyph_matrix *, |
| @@ -98,20 +98,20 @@ static void build_frame_matrix_from_leaf_window (struct glyph_matrix *, | |||
| 98 | static void adjust_frame_message_buffer (struct frame *); | 98 | static void adjust_frame_message_buffer (struct frame *); |
| 99 | static void adjust_decode_mode_spec_buffer (struct frame *); | 99 | static void adjust_decode_mode_spec_buffer (struct frame *); |
| 100 | static void fill_up_glyph_row_with_spaces (struct glyph_row *); | 100 | static void fill_up_glyph_row_with_spaces (struct glyph_row *); |
| 101 | static void clear_window_matrices (struct window *, int); | 101 | static void clear_window_matrices (struct window *, bool); |
| 102 | static void fill_up_glyph_row_area_with_spaces (struct glyph_row *, int); | 102 | static void fill_up_glyph_row_area_with_spaces (struct glyph_row *, int); |
| 103 | static int scrolling_window (struct window *, int); | 103 | static int scrolling_window (struct window *, bool); |
| 104 | static int update_window_line (struct window *, int, int *); | 104 | static bool update_window_line (struct window *, int, bool *); |
| 105 | static void mirror_make_current (struct window *, int); | 105 | static void mirror_make_current (struct window *, int); |
| 106 | #ifdef GLYPH_DEBUG | 106 | #ifdef GLYPH_DEBUG |
| 107 | static void check_matrix_pointers (struct glyph_matrix *, | 107 | static void check_matrix_pointers (struct glyph_matrix *, |
| 108 | struct glyph_matrix *); | 108 | struct glyph_matrix *); |
| 109 | #endif | 109 | #endif |
| 110 | static void mirror_line_dance (struct window *, int, int, int *, char *); | 110 | static void mirror_line_dance (struct window *, int, int, int *, char *); |
| 111 | static int update_window_tree (struct window *, int); | 111 | static bool update_window_tree (struct window *, bool); |
| 112 | static int update_window (struct window *, int); | 112 | static bool update_window (struct window *, bool); |
| 113 | static int update_frame_1 (struct frame *, int, int); | 113 | static bool update_frame_1 (struct frame *, bool, bool); |
| 114 | static int scrolling (struct frame *); | 114 | static bool scrolling (struct frame *); |
| 115 | static void set_window_cursor_after_update (struct window *); | 115 | static void set_window_cursor_after_update (struct window *); |
| 116 | static void adjust_frame_glyphs_for_window_redisplay (struct frame *); | 116 | static void adjust_frame_glyphs_for_window_redisplay (struct frame *); |
| 117 | static void adjust_frame_glyphs_for_frame_redisplay (struct frame *); | 117 | static void adjust_frame_glyphs_for_frame_redisplay (struct frame *); |
| @@ -122,14 +122,14 @@ static void adjust_frame_glyphs_for_frame_redisplay (struct frame *); | |||
| 122 | static EMACS_TIME preemption_period; | 122 | static EMACS_TIME preemption_period; |
| 123 | static EMACS_TIME preemption_next_check; | 123 | static EMACS_TIME preemption_next_check; |
| 124 | 124 | ||
| 125 | /* Nonzero upon entry to redisplay means do not assume anything about | 125 | /* True upon entry to redisplay means do not assume anything about |
| 126 | current contents of actual terminal frame; clear and redraw it. */ | 126 | current contents of actual terminal frame; clear and redraw it. */ |
| 127 | 127 | ||
| 128 | int frame_garbaged; | 128 | bool frame_garbaged; |
| 129 | 129 | ||
| 130 | /* Nonzero means last display completed. Zero means it was preempted. */ | 130 | /* True means last display completed. False means it was preempted. */ |
| 131 | 131 | ||
| 132 | int display_completed; | 132 | bool display_completed; |
| 133 | 133 | ||
| 134 | Lisp_Object Qdisplay_table, Qredisplay_dont_pause; | 134 | Lisp_Object Qdisplay_table, Qredisplay_dont_pause; |
| 135 | 135 | ||
| @@ -146,13 +146,13 @@ Lisp_Object selected_frame; | |||
| 146 | 146 | ||
| 147 | struct frame *last_nonminibuf_frame; | 147 | struct frame *last_nonminibuf_frame; |
| 148 | 148 | ||
| 149 | /* 1 means SIGWINCH happened when not safe. */ | 149 | /* True means SIGWINCH happened when not safe. */ |
| 150 | 150 | ||
| 151 | static int delayed_size_change; | 151 | static bool delayed_size_change; |
| 152 | 152 | ||
| 153 | /* 1 means glyph initialization has been completed at startup. */ | 153 | /* 1 means glyph initialization has been completed at startup. */ |
| 154 | 154 | ||
| 155 | static int glyphs_initialized_initially_p; | 155 | static bool glyphs_initialized_initially_p; |
| 156 | 156 | ||
| 157 | /* Updated window if != 0. Set by update_window. */ | 157 | /* Updated window if != 0. Set by update_window. */ |
| 158 | 158 | ||
| @@ -178,15 +178,15 @@ static int glyph_pool_count; | |||
| 178 | 178 | ||
| 179 | static struct frame *frame_matrix_frame; | 179 | static struct frame *frame_matrix_frame; |
| 180 | 180 | ||
| 181 | /* Non-zero means that fonts have been loaded since the last glyph | 181 | /* True means that fonts have been loaded since the last glyph |
| 182 | matrix adjustments. Redisplay must stop, and glyph matrices must | 182 | matrix adjustments. Redisplay must stop, and glyph matrices must |
| 183 | be adjusted when this flag becomes non-zero during display. The | 183 | be adjusted when this flag becomes true during display. The |
| 184 | reason fonts can be loaded so late is that fonts of fontsets are | 184 | reason fonts can be loaded so late is that fonts of fontsets are |
| 185 | loaded on demand. Another reason is that a line contains many | 185 | loaded on demand. Another reason is that a line contains many |
| 186 | characters displayed by zero width or very narrow glyphs of | 186 | characters displayed by zero width or very narrow glyphs of |
| 187 | variable-width fonts. */ | 187 | variable-width fonts. */ |
| 188 | 188 | ||
| 189 | int fonts_changed_p; | 189 | bool fonts_changed_p; |
| 190 | 190 | ||
| 191 | /* Convert vpos and hpos from frame to window and vice versa. | 191 | /* Convert vpos and hpos from frame to window and vice versa. |
| 192 | This may only be used for terminal frames. */ | 192 | This may only be used for terminal frames. */ |
| @@ -222,16 +222,14 @@ static int history_idx; | |||
| 222 | history. */ | 222 | history. */ |
| 223 | 223 | ||
| 224 | static uprintmax_t history_tick; | 224 | static uprintmax_t history_tick; |
| 225 | |||
| 226 | static void add_frame_display_history (struct frame *, int); | ||
| 227 | 225 | ||
| 228 | /* Add to the redisplay history how window W has been displayed. | 226 | /* Add to the redisplay history how window W has been displayed. |
| 229 | MSG is a trace containing the information how W's glyph matrix | 227 | MSG is a trace containing the information how W's glyph matrix |
| 230 | has been constructed. PAUSED_P non-zero means that the update | 228 | has been constructed. PAUSED_P means that the update |
| 231 | has been interrupted for pending input. */ | 229 | has been interrupted for pending input. */ |
| 232 | 230 | ||
| 233 | static void | 231 | static void |
| 234 | add_window_display_history (struct window *w, const char *msg, int paused_p) | 232 | add_window_display_history (struct window *w, const char *msg, bool paused_p) |
| 235 | { | 233 | { |
| 236 | char *buf; | 234 | char *buf; |
| 237 | 235 | ||
| @@ -254,11 +252,11 @@ add_window_display_history (struct window *w, const char *msg, int paused_p) | |||
| 254 | 252 | ||
| 255 | 253 | ||
| 256 | /* Add to the redisplay history that frame F has been displayed. | 254 | /* Add to the redisplay history that frame F has been displayed. |
| 257 | PAUSED_P non-zero means that the update has been interrupted for | 255 | PAUSED_P means that the update has been interrupted for |
| 258 | pending input. */ | 256 | pending input. */ |
| 259 | 257 | ||
| 260 | static void | 258 | static void |
| 261 | add_frame_display_history (struct frame *f, int paused_p) | 259 | add_frame_display_history (struct frame *f, bool paused_p) |
| 262 | { | 260 | { |
| 263 | char *buf; | 261 | char *buf; |
| 264 | 262 | ||
| @@ -395,10 +393,10 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin | |||
| 395 | return n; | 393 | return n; |
| 396 | } | 394 | } |
| 397 | 395 | ||
| 398 | /* Return non-zero if ROW's hash value is correct, zero if not. | 396 | /* Return true if ROW's hash value is correct. |
| 399 | Optimized away if ENABLE_CHECKING is not defined. */ | 397 | Optimized away if ENABLE_CHECKING is not defined. */ |
| 400 | 398 | ||
| 401 | static int | 399 | static bool |
| 402 | verify_row_hash (struct glyph_row *row) | 400 | verify_row_hash (struct glyph_row *row) |
| 403 | { | 401 | { |
| 404 | return row->hash == row_hash (row); | 402 | return row->hash == row_hash (row); |
| @@ -431,9 +429,9 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y | |||
| 431 | { | 429 | { |
| 432 | int i; | 430 | int i; |
| 433 | int new_rows; | 431 | int new_rows; |
| 434 | int marginal_areas_changed_p = 0; | 432 | bool marginal_areas_changed_p = 0; |
| 435 | int header_line_changed_p = 0; | 433 | bool header_line_changed_p = 0; |
| 436 | int header_line_p = 0; | 434 | bool header_line_p = 0; |
| 437 | int left = -1, right = -1; | 435 | int left = -1, right = -1; |
| 438 | int window_width = -1, window_height = -1; | 436 | int window_width = -1, window_height = -1; |
| 439 | 437 | ||
| @@ -736,30 +734,28 @@ increment_matrix_positions (struct glyph_matrix *matrix, int start, int end, | |||
| 736 | } | 734 | } |
| 737 | 735 | ||
| 738 | 736 | ||
| 739 | /* Enable a range of rows in glyph matrix MATRIX. START and END are | 737 | /* Clear the enable_p flags in a range of rows in glyph matrix MATRIX. |
| 740 | the row indices of the first and last + 1 row to enable. If | 738 | START and END are the row indices of the first and last + 1 row to clear. */ |
| 741 | ENABLED_P is non-zero, enabled_p flags in rows will be set to 1. */ | ||
| 742 | 739 | ||
| 743 | void | 740 | void |
| 744 | enable_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end, int enabled_p) | 741 | clear_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end) |
| 745 | { | 742 | { |
| 746 | eassert (start <= end); | 743 | eassert (start <= end); |
| 747 | eassert (start >= 0 && start < matrix->nrows); | 744 | eassert (start >= 0 && start < matrix->nrows); |
| 748 | eassert (end >= 0 && end <= matrix->nrows); | 745 | eassert (end >= 0 && end <= matrix->nrows); |
| 749 | 746 | ||
| 750 | for (; start < end; ++start) | 747 | for (; start < end; ++start) |
| 751 | matrix->rows[start].enabled_p = enabled_p != 0; | 748 | matrix->rows[start].enabled_p = 0; |
| 752 | } | 749 | } |
| 753 | 750 | ||
| 754 | 751 | ||
| 755 | /* Clear MATRIX. | 752 | /* Clear MATRIX. |
| 756 | 753 | ||
| 757 | This empties all rows in MATRIX by setting the enabled_p flag for | 754 | Empty all rows in MATRIX by clearing their enabled_p flags. |
| 758 | all rows of the matrix to zero. The function prepare_desired_row | 755 | The function prepare_desired_row will eventually really clear a row |
| 759 | will eventually really clear a row when it sees one with a zero | 756 | when it sees one with a false enabled_p flag. |
| 760 | enabled_p flag. | ||
| 761 | 757 | ||
| 762 | Resets update hints to defaults value. The only update hint | 758 | Reset update hints to default values. The only update hint |
| 763 | currently present is the flag MATRIX->no_scrolling_p. */ | 759 | currently present is the flag MATRIX->no_scrolling_p. */ |
| 764 | 760 | ||
| 765 | void | 761 | void |
| @@ -767,7 +763,7 @@ clear_glyph_matrix (struct glyph_matrix *matrix) | |||
| 767 | { | 763 | { |
| 768 | if (matrix) | 764 | if (matrix) |
| 769 | { | 765 | { |
| 770 | enable_glyph_matrix_rows (matrix, 0, matrix->nrows, 0); | 766 | clear_glyph_matrix_rows (matrix, 0, matrix->nrows); |
| 771 | matrix->no_scrolling_p = 0; | 767 | matrix->no_scrolling_p = 0; |
| 772 | } | 768 | } |
| 773 | } | 769 | } |
| @@ -853,11 +849,11 @@ clear_desired_matrices (register struct frame *f) | |||
| 853 | } | 849 | } |
| 854 | 850 | ||
| 855 | 851 | ||
| 856 | /* Clear matrices in window tree rooted in W. If DESIRED_P is | 852 | /* Clear matrices in window tree rooted in W. If DESIRED_P, |
| 857 | non-zero clear desired matrices, otherwise clear current matrices. */ | 853 | clear desired matrices, otherwise clear current matrices. */ |
| 858 | 854 | ||
| 859 | static void | 855 | static void |
| 860 | clear_window_matrices (struct window *w, int desired_p) | 856 | clear_window_matrices (struct window *w, bool desired_p) |
| 861 | { | 857 | { |
| 862 | while (w) | 858 | while (w) |
| 863 | { | 859 | { |
| @@ -1109,12 +1105,12 @@ assign_row (struct glyph_row *to, struct glyph_row *from) | |||
| 1109 | /* Test whether the glyph memory of the glyph row WINDOW_ROW, which is | 1105 | /* Test whether the glyph memory of the glyph row WINDOW_ROW, which is |
| 1110 | a row in a window matrix, is a slice of the glyph memory of the | 1106 | a row in a window matrix, is a slice of the glyph memory of the |
| 1111 | glyph row FRAME_ROW which is a row in a frame glyph matrix. Value | 1107 | glyph row FRAME_ROW which is a row in a frame glyph matrix. Value |
| 1112 | is non-zero if the glyph memory of WINDOW_ROW is part of the glyph | 1108 | is true if the glyph memory of WINDOW_ROW is part of the glyph |
| 1113 | memory of FRAME_ROW. */ | 1109 | memory of FRAME_ROW. */ |
| 1114 | 1110 | ||
| 1115 | #ifdef GLYPH_DEBUG | 1111 | #ifdef GLYPH_DEBUG |
| 1116 | 1112 | ||
| 1117 | static int | 1113 | static bool |
| 1118 | glyph_row_slice_p (struct glyph_row *window_row, struct glyph_row *frame_row) | 1114 | glyph_row_slice_p (struct glyph_row *window_row, struct glyph_row *frame_row) |
| 1119 | { | 1115 | { |
| 1120 | struct glyph *window_glyph_start = window_row->glyphs[0]; | 1116 | struct glyph *window_glyph_start = window_row->glyphs[0]; |
| @@ -1161,7 +1157,7 @@ prepare_desired_row (struct glyph_row *row) | |||
| 1161 | { | 1157 | { |
| 1162 | if (!row->enabled_p) | 1158 | if (!row->enabled_p) |
| 1163 | { | 1159 | { |
| 1164 | int rp = row->reversed_p; | 1160 | bool rp = row->reversed_p; |
| 1165 | 1161 | ||
| 1166 | clear_glyph_row (row); | 1162 | clear_glyph_row (row); |
| 1167 | row->enabled_p = 1; | 1163 | row->enabled_p = 1; |
| @@ -1260,12 +1256,11 @@ line_draw_cost (struct glyph_matrix *matrix, int vpos) | |||
| 1260 | } | 1256 | } |
| 1261 | 1257 | ||
| 1262 | 1258 | ||
| 1263 | /* Test two glyph rows A and B for equality. Value is non-zero if A | 1259 | /* Return true if the glyph rows A and B have equal contents. |
| 1264 | and B have equal contents. MOUSE_FACE_P non-zero means compare the | 1260 | MOUSE_FACE_P means compare the mouse_face_p flags of A and B, too. */ |
| 1265 | mouse_face_p flags of A and B, too. */ | ||
| 1266 | 1261 | ||
| 1267 | static inline int | 1262 | static inline bool |
| 1268 | row_equal_p (struct glyph_row *a, struct glyph_row *b, int mouse_face_p) | 1263 | row_equal_p (struct glyph_row *a, struct glyph_row *b, bool mouse_face_p) |
| 1269 | { | 1264 | { |
| 1270 | eassert (verify_row_hash (a)); | 1265 | eassert (verify_row_hash (a)); |
| 1271 | eassert (verify_row_hash (b)); | 1266 | eassert (verify_row_hash (b)); |
| @@ -1380,14 +1375,14 @@ free_glyph_pool (struct glyph_pool *pool) | |||
| 1380 | is changed from a large value to a smaller one. But, if someone | 1375 | is changed from a large value to a smaller one. But, if someone |
| 1381 | does it once, we can expect that he will do it again. | 1376 | does it once, we can expect that he will do it again. |
| 1382 | 1377 | ||
| 1383 | Value is non-zero if the pool changed in a way which makes | 1378 | Return true if the pool changed in a way which makes |
| 1384 | re-adjusting window glyph matrices necessary. */ | 1379 | re-adjusting window glyph matrices necessary. */ |
| 1385 | 1380 | ||
| 1386 | static int | 1381 | static bool |
| 1387 | realloc_glyph_pool (struct glyph_pool *pool, struct dim matrix_dim) | 1382 | realloc_glyph_pool (struct glyph_pool *pool, struct dim matrix_dim) |
| 1388 | { | 1383 | { |
| 1389 | ptrdiff_t needed; | 1384 | ptrdiff_t needed; |
| 1390 | int changed_p; | 1385 | bool changed_p; |
| 1391 | 1386 | ||
| 1392 | changed_p = (pool->glyphs == 0 | 1387 | changed_p = (pool->glyphs == 0 |
| 1393 | || matrix_dim.height != pool->nrows | 1388 | || matrix_dim.height != pool->nrows |
| @@ -1561,7 +1556,7 @@ check_matrix_invariants (struct window *w) | |||
| 1561 | 1556 | ||
| 1562 | X and Y are column/row within the frame glyph matrix where | 1557 | X and Y are column/row within the frame glyph matrix where |
| 1563 | sub-matrices for the window tree rooted at WINDOW must be | 1558 | sub-matrices for the window tree rooted at WINDOW must be |
| 1564 | allocated. DIM_ONLY_P non-zero means that the caller of this | 1559 | allocated. DIM_ONLY_P means that the caller of this |
| 1565 | function is only interested in the result matrix dimension, and | 1560 | function is only interested in the result matrix dimension, and |
| 1566 | matrix adjustments should not be performed. | 1561 | matrix adjustments should not be performed. |
| 1567 | 1562 | ||
| @@ -1638,7 +1633,7 @@ check_matrix_invariants (struct window *w) | |||
| 1638 | 1633 | ||
| 1639 | static struct dim | 1634 | static struct dim |
| 1640 | allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y, | 1635 | allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y, |
| 1641 | int dim_only_p, int *window_change_flags) | 1636 | bool dim_only_p, int *window_change_flags) |
| 1642 | { | 1637 | { |
| 1643 | struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (window))); | 1638 | struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (window))); |
| 1644 | int x0 = x, y0 = y; | 1639 | int x0 = x, y0 = y; |
| @@ -1646,7 +1641,7 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y, | |||
| 1646 | struct dim total; | 1641 | struct dim total; |
| 1647 | struct dim dim; | 1642 | struct dim dim; |
| 1648 | struct window *w; | 1643 | struct window *w; |
| 1649 | int in_horz_combination_p; | 1644 | bool in_horz_combination_p; |
| 1650 | 1645 | ||
| 1651 | /* What combination is WINDOW part of? Compute this once since the | 1646 | /* What combination is WINDOW part of? Compute this once since the |
| 1652 | result is the same for all windows in the `next' chain. The | 1647 | result is the same for all windows in the `next' chain. The |
| @@ -1704,7 +1699,7 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y, | |||
| 1704 | /* Actually change matrices, if allowed. Do not consider | 1699 | /* Actually change matrices, if allowed. Do not consider |
| 1705 | CHANGED_LEAF_MATRIX computed above here because the pool | 1700 | CHANGED_LEAF_MATRIX computed above here because the pool |
| 1706 | may have been changed which we don't now here. We trust | 1701 | may have been changed which we don't now here. We trust |
| 1707 | that we only will be called with DIM_ONLY_P != 0 when | 1702 | that we only will be called with DIM_ONLY_P when |
| 1708 | necessary. */ | 1703 | necessary. */ |
| 1709 | if (!dim_only_p) | 1704 | if (!dim_only_p) |
| 1710 | { | 1705 | { |
| @@ -1919,9 +1914,9 @@ adjust_frame_glyphs (struct frame *f) | |||
| 1919 | f->glyphs_initialized_p = 1; | 1914 | f->glyphs_initialized_p = 1; |
| 1920 | } | 1915 | } |
| 1921 | 1916 | ||
| 1922 | /* Return 1 if any window in the tree has nonzero window margins. See | 1917 | /* Return true if any window in the tree has nonzero window margins. See |
| 1923 | the hack at the end of adjust_frame_glyphs_for_frame_redisplay. */ | 1918 | the hack at the end of adjust_frame_glyphs_for_frame_redisplay. */ |
| 1924 | static int | 1919 | static bool |
| 1925 | showing_window_margins_p (struct window *w) | 1920 | showing_window_margins_p (struct window *w) |
| 1926 | { | 1921 | { |
| 1927 | while (w) | 1922 | while (w) |
| @@ -2052,7 +2047,7 @@ static void | |||
| 2052 | adjust_frame_glyphs_for_frame_redisplay (struct frame *f) | 2047 | adjust_frame_glyphs_for_frame_redisplay (struct frame *f) |
| 2053 | { | 2048 | { |
| 2054 | struct dim matrix_dim; | 2049 | struct dim matrix_dim; |
| 2055 | int pool_changed_p; | 2050 | bool pool_changed_p; |
| 2056 | int window_change_flags; | 2051 | int window_change_flags; |
| 2057 | int top_window_y; | 2052 | int top_window_y; |
| 2058 | 2053 | ||
| @@ -2468,7 +2463,7 @@ build_frame_matrix_from_window_tree (struct glyph_matrix *matrix, struct window | |||
| 2468 | desired frame matrix built. W is a leaf window whose desired or | 2463 | desired frame matrix built. W is a leaf window whose desired or |
| 2469 | current matrix is to be added to FRAME_MATRIX. W's flag | 2464 | current matrix is to be added to FRAME_MATRIX. W's flag |
| 2470 | must_be_updated_p determines which matrix it contributes to | 2465 | must_be_updated_p determines which matrix it contributes to |
| 2471 | FRAME_MATRIX. If must_be_updated_p is non-zero, W's desired matrix | 2466 | FRAME_MATRIX. If W->must_be_updated_p, W's desired matrix |
| 2472 | is added to FRAME_MATRIX, otherwise W's current matrix is added. | 2467 | is added to FRAME_MATRIX, otherwise W's current matrix is added. |
| 2473 | Adding a desired matrix means setting up used counters and such in | 2468 | Adding a desired matrix means setting up used counters and such in |
| 2474 | frame rows, while adding a current window matrix to FRAME_MATRIX | 2469 | frame rows, while adding a current window matrix to FRAME_MATRIX |
| @@ -2519,7 +2514,7 @@ build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct w | |||
| 2519 | { | 2514 | { |
| 2520 | struct glyph_row *frame_row = frame_matrix->rows + frame_y; | 2515 | struct glyph_row *frame_row = frame_matrix->rows + frame_y; |
| 2521 | struct glyph_row *window_row = window_matrix->rows + window_y; | 2516 | struct glyph_row *window_row = window_matrix->rows + window_y; |
| 2522 | int current_row_p = window_matrix == w->current_matrix; | 2517 | bool current_row_p = window_matrix == w->current_matrix; |
| 2523 | 2518 | ||
| 2524 | /* Fill up the frame row with spaces up to the left margin of the | 2519 | /* Fill up the frame row with spaces up to the left margin of the |
| 2525 | window row. */ | 2520 | window row. */ |
| @@ -2692,7 +2687,7 @@ make_current (struct glyph_matrix *desired_matrix, struct glyph_matrix *current_ | |||
| 2692 | { | 2687 | { |
| 2693 | struct glyph_row *current_row = MATRIX_ROW (current_matrix, row); | 2688 | struct glyph_row *current_row = MATRIX_ROW (current_matrix, row); |
| 2694 | struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, row); | 2689 | struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, row); |
| 2695 | int mouse_face_p = current_row->mouse_face_p; | 2690 | bool mouse_face_p = current_row->mouse_face_p; |
| 2696 | 2691 | ||
| 2697 | /* Do current_row = desired_row. This exchanges glyph pointers | 2692 | /* Do current_row = desired_row. This exchanges glyph pointers |
| 2698 | between both rows, and does a structure assignment otherwise. */ | 2693 | between both rows, and does a structure assignment otherwise. */ |
| @@ -2789,7 +2784,7 @@ mirrored_line_dance (struct glyph_matrix *matrix, int unchanged_at_top, int nlin | |||
| 2789 | /* Assign new rows, maybe clear lines. */ | 2784 | /* Assign new rows, maybe clear lines. */ |
| 2790 | for (i = 0; i < nlines; ++i) | 2785 | for (i = 0; i < nlines; ++i) |
| 2791 | { | 2786 | { |
| 2792 | int enabled_before_p = new_rows[i].enabled_p; | 2787 | bool enabled_before_p = new_rows[i].enabled_p; |
| 2793 | 2788 | ||
| 2794 | eassert (i + unchanged_at_top < matrix->nrows); | 2789 | eassert (i + unchanged_at_top < matrix->nrows); |
| 2795 | eassert (unchanged_at_top + copy_from[i] < matrix->nrows); | 2790 | eassert (unchanged_at_top + copy_from[i] < matrix->nrows); |
| @@ -2897,7 +2892,8 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy | |||
| 2897 | /* W is a leaf window, and we are working on its current | 2892 | /* W is a leaf window, and we are working on its current |
| 2898 | matrix m. */ | 2893 | matrix m. */ |
| 2899 | struct glyph_matrix *m = w->current_matrix; | 2894 | struct glyph_matrix *m = w->current_matrix; |
| 2900 | int i, sync_p = 0; | 2895 | int i; |
| 2896 | bool sync_p = 0; | ||
| 2901 | struct glyph_row *old_rows; | 2897 | struct glyph_row *old_rows; |
| 2902 | 2898 | ||
| 2903 | /* Make a copy of the original rows of matrix m. */ | 2899 | /* Make a copy of the original rows of matrix m. */ |
| @@ -2919,22 +2915,19 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy | |||
| 2919 | int window_from = frame_from - m->matrix_y; | 2915 | int window_from = frame_from - m->matrix_y; |
| 2920 | 2916 | ||
| 2921 | /* Is assigned line inside window? */ | 2917 | /* Is assigned line inside window? */ |
| 2922 | int from_inside_window_p | 2918 | bool from_inside_window_p |
| 2923 | = window_from >= 0 && window_from < m->matrix_h; | 2919 | = window_from >= 0 && window_from < m->matrix_h; |
| 2924 | 2920 | ||
| 2925 | /* Is assigned to line inside window? */ | 2921 | /* Is assigned to line inside window? */ |
| 2926 | int to_inside_window_p | 2922 | bool to_inside_window_p |
| 2927 | = window_to >= 0 && window_to < m->matrix_h; | 2923 | = window_to >= 0 && window_to < m->matrix_h; |
| 2928 | 2924 | ||
| 2929 | if (from_inside_window_p && to_inside_window_p) | 2925 | if (from_inside_window_p && to_inside_window_p) |
| 2930 | { | 2926 | { |
| 2931 | /* Enabled setting before assignment. */ | ||
| 2932 | int enabled_before_p; | ||
| 2933 | |||
| 2934 | /* Do the assignment. The enabled_p flag is saved | 2927 | /* Do the assignment. The enabled_p flag is saved |
| 2935 | over the assignment because the old redisplay did | 2928 | over the assignment because the old redisplay did |
| 2936 | that. */ | 2929 | that. */ |
| 2937 | enabled_before_p = m->rows[window_to].enabled_p; | 2930 | bool enabled_before_p = m->rows[window_to].enabled_p; |
| 2938 | m->rows[window_to] = old_rows[window_from]; | 2931 | m->rows[window_to] = old_rows[window_from]; |
| 2939 | m->rows[window_to].enabled_p = enabled_before_p; | 2932 | m->rows[window_to].enabled_p = enabled_before_p; |
| 2940 | 2933 | ||
| @@ -3155,17 +3148,16 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", | |||
| 3155 | 3148 | ||
| 3156 | /* Update frame F based on the data in desired matrices. | 3149 | /* Update frame F based on the data in desired matrices. |
| 3157 | 3150 | ||
| 3158 | If FORCE_P is non-zero, don't let redisplay be stopped by detecting | 3151 | If FORCE_P, don't let redisplay be stopped by detecting pending input. |
| 3159 | pending input. If INHIBIT_HAIRY_ID_P is non-zero, don't try | 3152 | If INHIBIT_HAIRY_ID_P, don't try scrolling. |
| 3160 | scrolling. | ||
| 3161 | 3153 | ||
| 3162 | Value is non-zero if redisplay was stopped due to pending input. */ | 3154 | Value is true if redisplay was stopped due to pending input. */ |
| 3163 | 3155 | ||
| 3164 | int | 3156 | bool |
| 3165 | update_frame (struct frame *f, int force_p, int inhibit_hairy_id_p) | 3157 | update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p) |
| 3166 | { | 3158 | { |
| 3167 | /* 1 means display has been paused because of pending input. */ | 3159 | /* True means display has been paused because of pending input. */ |
| 3168 | int paused_p; | 3160 | bool paused_p; |
| 3169 | struct window *root_window = XWINDOW (f->root_window); | 3161 | struct window *root_window = XWINDOW (f->root_window); |
| 3170 | 3162 | ||
| 3171 | if (redisplay_dont_pause) | 3163 | if (redisplay_dont_pause) |
| @@ -3283,13 +3275,13 @@ update_frame (struct frame *f, int force_p, int inhibit_hairy_id_p) | |||
| 3283 | Window-based updates | 3275 | Window-based updates |
| 3284 | ************************************************************************/ | 3276 | ************************************************************************/ |
| 3285 | 3277 | ||
| 3286 | /* Perform updates in window tree rooted at W. FORCE_P non-zero means | 3278 | /* Perform updates in window tree rooted at W. |
| 3287 | don't stop updating when input is pending. */ | 3279 | If FORCE_P, don't stop updating if input is pending. */ |
| 3288 | 3280 | ||
| 3289 | static int | 3281 | static bool |
| 3290 | update_window_tree (struct window *w, int force_p) | 3282 | update_window_tree (struct window *w, bool force_p) |
| 3291 | { | 3283 | { |
| 3292 | int paused_p = 0; | 3284 | bool paused_p = 0; |
| 3293 | 3285 | ||
| 3294 | while (w && !paused_p) | 3286 | while (w && !paused_p) |
| 3295 | { | 3287 | { |
| @@ -3307,11 +3299,11 @@ update_window_tree (struct window *w, int force_p) | |||
| 3307 | } | 3299 | } |
| 3308 | 3300 | ||
| 3309 | 3301 | ||
| 3310 | /* Update window W if its flag must_be_updated_p is non-zero. If | 3302 | /* Update window W if its flag must_be_updated_p is set. |
| 3311 | FORCE_P is non-zero, don't stop updating if input is pending. */ | 3303 | If FORCE_P, don't stop updating if input is pending. */ |
| 3312 | 3304 | ||
| 3313 | void | 3305 | void |
| 3314 | update_single_window (struct window *w, int force_p) | 3306 | update_single_window (struct window *w, bool force_p) |
| 3315 | { | 3307 | { |
| 3316 | if (w->must_be_updated_p) | 3308 | if (w->must_be_updated_p) |
| 3317 | { | 3309 | { |
| @@ -3460,7 +3452,7 @@ redraw_overlapping_rows (struct window *w, int yb) | |||
| 3460 | static void | 3452 | static void |
| 3461 | check_current_matrix_flags (struct window *w) | 3453 | check_current_matrix_flags (struct window *w) |
| 3462 | { | 3454 | { |
| 3463 | int last_seen_p = 0; | 3455 | bool last_seen_p = 0; |
| 3464 | int i, yb = window_text_bottom_y (w); | 3456 | int i, yb = window_text_bottom_y (w); |
| 3465 | 3457 | ||
| 3466 | for (i = 0; i < w->current_matrix->nrows - 1; ++i) | 3458 | for (i = 0; i < w->current_matrix->nrows - 1; ++i) |
| @@ -3476,14 +3468,14 @@ check_current_matrix_flags (struct window *w) | |||
| 3476 | #endif /* GLYPH_DEBUG */ | 3468 | #endif /* GLYPH_DEBUG */ |
| 3477 | 3469 | ||
| 3478 | 3470 | ||
| 3479 | /* Update display of window W. FORCE_P non-zero means that we should | 3471 | /* Update display of window W. |
| 3480 | not stop when detecting pending input. */ | 3472 | If FORCE_P, don't stop updating when input is pending. */ |
| 3481 | 3473 | ||
| 3482 | static int | 3474 | static bool |
| 3483 | update_window (struct window *w, int force_p) | 3475 | update_window (struct window *w, bool force_p) |
| 3484 | { | 3476 | { |
| 3485 | struct glyph_matrix *desired_matrix = w->desired_matrix; | 3477 | struct glyph_matrix *desired_matrix = w->desired_matrix; |
| 3486 | int paused_p; | 3478 | bool paused_p; |
| 3487 | #if !PERIODIC_PREEMPTION_CHECKING | 3479 | #if !PERIODIC_PREEMPTION_CHECKING |
| 3488 | int preempt_count = baud_rate / 2400 + 1; | 3480 | int preempt_count = baud_rate / 2400 + 1; |
| 3489 | #endif | 3481 | #endif |
| @@ -3506,7 +3498,8 @@ update_window (struct window *w, int force_p) | |||
| 3506 | struct glyph_row *row, *end; | 3498 | struct glyph_row *row, *end; |
| 3507 | struct glyph_row *mode_line_row; | 3499 | struct glyph_row *mode_line_row; |
| 3508 | struct glyph_row *header_line_row; | 3500 | struct glyph_row *header_line_row; |
| 3509 | int yb, changed_p = 0, mouse_face_overwritten_p = 0; | 3501 | int yb; |
| 3502 | bool changed_p = 0, mouse_face_overwritten_p = 0; | ||
| 3510 | #if ! PERIODIC_PREEMPTION_CHECKING | 3503 | #if ! PERIODIC_PREEMPTION_CHECKING |
| 3511 | int n_updated = 0; | 3504 | int n_updated = 0; |
| 3512 | #endif | 3505 | #endif |
| @@ -3693,15 +3686,15 @@ update_marginal_area (struct window *w, int area, int vpos) | |||
| 3693 | 3686 | ||
| 3694 | 3687 | ||
| 3695 | /* Update the display of the text area of row VPOS in window W. | 3688 | /* Update the display of the text area of row VPOS in window W. |
| 3696 | Value is non-zero if display has changed. */ | 3689 | Value is true if display has changed. */ |
| 3697 | 3690 | ||
| 3698 | static int | 3691 | static bool |
| 3699 | update_text_area (struct window *w, int vpos) | 3692 | update_text_area (struct window *w, int vpos) |
| 3700 | { | 3693 | { |
| 3701 | struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); | 3694 | struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); |
| 3702 | struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); | 3695 | struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); |
| 3703 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); | 3696 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); |
| 3704 | int changed_p = 0; | 3697 | bool changed_p = 0; |
| 3705 | 3698 | ||
| 3706 | /* Let functions in xterm.c know what area subsequent X positions | 3699 | /* Let functions in xterm.c know what area subsequent X positions |
| 3707 | will be relative to. */ | 3700 | will be relative to. */ |
| @@ -3751,9 +3744,9 @@ update_text_area (struct window *w, int vpos) | |||
| 3751 | int stop, i, x; | 3744 | int stop, i, x; |
| 3752 | struct glyph *current_glyph = current_row->glyphs[TEXT_AREA]; | 3745 | struct glyph *current_glyph = current_row->glyphs[TEXT_AREA]; |
| 3753 | struct glyph *desired_glyph = desired_row->glyphs[TEXT_AREA]; | 3746 | struct glyph *desired_glyph = desired_row->glyphs[TEXT_AREA]; |
| 3754 | int overlapping_glyphs_p = current_row->contains_overlapping_glyphs_p; | 3747 | bool overlapping_glyphs_p = current_row->contains_overlapping_glyphs_p; |
| 3755 | int desired_stop_pos = desired_row->used[TEXT_AREA]; | 3748 | int desired_stop_pos = desired_row->used[TEXT_AREA]; |
| 3756 | int abort_skipping = 0; | 3749 | bool abort_skipping = 0; |
| 3757 | 3750 | ||
| 3758 | /* If the desired row extends its face to the text area end, and | 3751 | /* If the desired row extends its face to the text area end, and |
| 3759 | unless the current row also does so at the same position, | 3752 | unless the current row also does so at the same position, |
| @@ -3773,7 +3766,7 @@ update_text_area (struct window *w, int vpos) | |||
| 3773 | in common. */ | 3766 | in common. */ |
| 3774 | while (i < stop) | 3767 | while (i < stop) |
| 3775 | { | 3768 | { |
| 3776 | int can_skip_p = !abort_skipping; | 3769 | bool can_skip_p = !abort_skipping; |
| 3777 | 3770 | ||
| 3778 | /* Skip over glyphs that both rows have in common. These | 3771 | /* Skip over glyphs that both rows have in common. These |
| 3779 | don't have to be written. We can't skip if the last | 3772 | don't have to be written. We can't skip if the last |
| @@ -3847,7 +3840,7 @@ update_text_area (struct window *w, int vpos) | |||
| 3847 | int start_x = x, start_hpos = i; | 3840 | int start_x = x, start_hpos = i; |
| 3848 | struct glyph *start = desired_glyph; | 3841 | struct glyph *start = desired_glyph; |
| 3849 | int current_x = x; | 3842 | int current_x = x; |
| 3850 | int skip_first_p = !can_skip_p; | 3843 | bool skip_first_p = !can_skip_p; |
| 3851 | 3844 | ||
| 3852 | /* Find the next glyph that's equal again. */ | 3845 | /* Find the next glyph that's equal again. */ |
| 3853 | while (i < stop | 3846 | while (i < stop |
| @@ -3938,16 +3931,15 @@ update_text_area (struct window *w, int vpos) | |||
| 3938 | } | 3931 | } |
| 3939 | 3932 | ||
| 3940 | 3933 | ||
| 3941 | /* Update row VPOS in window W. Value is non-zero if display has been | 3934 | /* Update row VPOS in window W. Value is true if display has been changed. */ |
| 3942 | changed. */ | ||
| 3943 | 3935 | ||
| 3944 | static int | 3936 | static bool |
| 3945 | update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p) | 3937 | update_window_line (struct window *w, int vpos, bool *mouse_face_overwritten_p) |
| 3946 | { | 3938 | { |
| 3947 | struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); | 3939 | struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); |
| 3948 | struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); | 3940 | struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); |
| 3949 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); | 3941 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); |
| 3950 | int changed_p = 0; | 3942 | bool changed_p = 0; |
| 3951 | 3943 | ||
| 3952 | /* Set the row being updated. This is important to let xterm.c | 3944 | /* Set the row being updated. This is important to let xterm.c |
| 3953 | know what line height values are in effect. */ | 3945 | know what line height values are in effect. */ |
| @@ -4095,7 +4087,7 @@ set_window_cursor_after_update (struct window *w) | |||
| 4095 | tree rooted at W. */ | 4087 | tree rooted at W. */ |
| 4096 | 4088 | ||
| 4097 | void | 4089 | void |
| 4098 | set_window_update_flags (struct window *w, int on_p) | 4090 | set_window_update_flags (struct window *w, bool on_p) |
| 4099 | { | 4091 | { |
| 4100 | while (w) | 4092 | while (w) |
| 4101 | { | 4093 | { |
| @@ -4198,7 +4190,7 @@ add_row_entry (struct glyph_row *row) | |||
| 4198 | 4190 | ||
| 4199 | 4191 | ||
| 4200 | /* Try to reuse part of the current display of W by scrolling lines. | 4192 | /* Try to reuse part of the current display of W by scrolling lines. |
| 4201 | HEADER_LINE_P non-zero means W has a header line. | 4193 | HEADER_LINE_P means W has a header line. |
| 4202 | 4194 | ||
| 4203 | The algorithm is taken from Communications of the ACM, Apr78 "A | 4195 | The algorithm is taken from Communications of the ACM, Apr78 "A |
| 4204 | Technique for Isolating Differences Between Files." It should take | 4196 | Technique for Isolating Differences Between Files." It should take |
| @@ -4224,7 +4216,7 @@ add_row_entry (struct glyph_row *row) | |||
| 4224 | 1 if we did scroll. */ | 4216 | 1 if we did scroll. */ |
| 4225 | 4217 | ||
| 4226 | static int | 4218 | static int |
| 4227 | scrolling_window (struct window *w, int header_line_p) | 4219 | scrolling_window (struct window *w, bool header_line_p) |
| 4228 | { | 4220 | { |
| 4229 | struct glyph_matrix *desired_matrix = w->desired_matrix; | 4221 | struct glyph_matrix *desired_matrix = w->desired_matrix; |
| 4230 | struct glyph_matrix *current_matrix = w->current_matrix; | 4222 | struct glyph_matrix *current_matrix = w->current_matrix; |
| @@ -4237,7 +4229,7 @@ scrolling_window (struct window *w, int header_line_p) | |||
| 4237 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); | 4229 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); |
| 4238 | 4230 | ||
| 4239 | /* Skip over rows equal at the start. */ | 4231 | /* Skip over rows equal at the start. */ |
| 4240 | for (i = header_line_p ? 1 : 0; i < current_matrix->nrows - 1; ++i) | 4232 | for (i = header_line_p; i < current_matrix->nrows - 1; ++i) |
| 4241 | { | 4233 | { |
| 4242 | struct glyph_row *d = MATRIX_ROW (desired_matrix, i); | 4234 | struct glyph_row *d = MATRIX_ROW (desired_matrix, i); |
| 4243 | struct glyph_row *c = MATRIX_ROW (current_matrix, i); | 4235 | struct glyph_row *c = MATRIX_ROW (current_matrix, i); |
| @@ -4496,7 +4488,7 @@ scrolling_window (struct window *w, int header_line_p) | |||
| 4496 | for (j = nruns - 1; j > i; --j) | 4488 | for (j = nruns - 1; j > i; --j) |
| 4497 | { | 4489 | { |
| 4498 | struct run *p = runs[j]; | 4490 | struct run *p = runs[j]; |
| 4499 | int truncated_p = 0; | 4491 | bool truncated_p = 0; |
| 4500 | 4492 | ||
| 4501 | if (p->nrows > 0 | 4493 | if (p->nrows > 0 |
| 4502 | && p->desired_y < r->desired_y + r->height | 4494 | && p->desired_y < r->desired_y + r->height |
| @@ -4559,7 +4551,7 @@ scrolling_window (struct window *w, int header_line_p) | |||
| 4559 | for (j = 0; j < r->nrows; ++j) | 4551 | for (j = 0; j < r->nrows; ++j) |
| 4560 | { | 4552 | { |
| 4561 | struct glyph_row *from, *to; | 4553 | struct glyph_row *from, *to; |
| 4562 | int to_overlapped_p; | 4554 | bool to_overlapped_p; |
| 4563 | 4555 | ||
| 4564 | to = MATRIX_ROW (current_matrix, r->desired_vpos + j); | 4556 | to = MATRIX_ROW (current_matrix, r->desired_vpos + j); |
| 4565 | from = MATRIX_ROW (desired_matrix, r->desired_vpos + j); | 4557 | from = MATRIX_ROW (desired_matrix, r->desired_vpos + j); |
| @@ -4594,20 +4586,19 @@ scrolling_window (struct window *w, int header_line_p) | |||
| 4594 | 4586 | ||
| 4595 | /* Update the desired frame matrix of frame F. | 4587 | /* Update the desired frame matrix of frame F. |
| 4596 | 4588 | ||
| 4597 | FORCE_P non-zero means that the update should not be stopped by | 4589 | FORCE_P means that the update should not be stopped by pending input. |
| 4598 | pending input. INHIBIT_HAIRY_ID_P non-zero means that scrolling | 4590 | INHIBIT_HAIRY_ID_P means that scrolling should not be tried. |
| 4599 | should not be tried. | ||
| 4600 | 4591 | ||
| 4601 | Value is non-zero if update was stopped due to pending input. */ | 4592 | Value is true if update was stopped due to pending input. */ |
| 4602 | 4593 | ||
| 4603 | static int | 4594 | static bool |
| 4604 | update_frame_1 (struct frame *f, int force_p, int inhibit_id_p) | 4595 | update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p) |
| 4605 | { | 4596 | { |
| 4606 | /* Frame matrices to work on. */ | 4597 | /* Frame matrices to work on. */ |
| 4607 | struct glyph_matrix *current_matrix = f->current_matrix; | 4598 | struct glyph_matrix *current_matrix = f->current_matrix; |
| 4608 | struct glyph_matrix *desired_matrix = f->desired_matrix; | 4599 | struct glyph_matrix *desired_matrix = f->desired_matrix; |
| 4609 | int i; | 4600 | int i; |
| 4610 | int pause_p; | 4601 | bool pause_p; |
| 4611 | int preempt_count = baud_rate / 2400 + 1; | 4602 | int preempt_count = baud_rate / 2400 + 1; |
| 4612 | 4603 | ||
| 4613 | eassert (current_matrix && desired_matrix); | 4604 | eassert (current_matrix && desired_matrix); |
| @@ -4699,7 +4690,7 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p) | |||
| 4699 | } | 4690 | } |
| 4700 | } | 4691 | } |
| 4701 | 4692 | ||
| 4702 | pause_p = (i < FRAME_LINES (f) - 1) ? i : 0; | 4693 | pause_p = 0 < i && i < FRAME_LINES (f) - 1; |
| 4703 | 4694 | ||
| 4704 | /* Now just clean up termcap drivers and set cursor, etc. */ | 4695 | /* Now just clean up termcap drivers and set cursor, etc. */ |
| 4705 | if (!pause_p) | 4696 | if (!pause_p) |
| @@ -4809,7 +4800,7 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p) | |||
| 4809 | 4800 | ||
| 4810 | /* Do line insertions/deletions on frame F for frame-based redisplay. */ | 4801 | /* Do line insertions/deletions on frame F for frame-based redisplay. */ |
| 4811 | 4802 | ||
| 4812 | static int | 4803 | static bool |
| 4813 | scrolling (struct frame *frame) | 4804 | scrolling (struct frame *frame) |
| 4814 | { | 4805 | { |
| 4815 | int unchanged_at_top, unchanged_at_bottom; | 4806 | int unchanged_at_top, unchanged_at_bottom; |
| @@ -4952,10 +4943,10 @@ update_frame_line (struct frame *f, int vpos) | |||
| 4952 | struct glyph_matrix *desired_matrix = f->desired_matrix; | 4943 | struct glyph_matrix *desired_matrix = f->desired_matrix; |
| 4953 | struct glyph_row *current_row = MATRIX_ROW (current_matrix, vpos); | 4944 | struct glyph_row *current_row = MATRIX_ROW (current_matrix, vpos); |
| 4954 | struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, vpos); | 4945 | struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, vpos); |
| 4955 | int must_write_whole_line_p; | 4946 | bool must_write_whole_line_p; |
| 4956 | int write_spaces_p = FRAME_MUST_WRITE_SPACES (f); | 4947 | bool write_spaces_p = FRAME_MUST_WRITE_SPACES (f); |
| 4957 | int colored_spaces_p = (FACE_FROM_ID (f, DEFAULT_FACE_ID)->background | 4948 | bool colored_spaces_p = (FACE_FROM_ID (f, DEFAULT_FACE_ID)->background |
| 4958 | != FACE_TTY_DEFAULT_BG_COLOR); | 4949 | != FACE_TTY_DEFAULT_BG_COLOR); |
| 4959 | 4950 | ||
| 4960 | if (colored_spaces_p) | 4951 | if (colored_spaces_p) |
| 4961 | write_spaces_p = 1; | 4952 | write_spaces_p = 1; |
| @@ -5289,7 +5280,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p | |||
| 5289 | /* start_display takes into account the header-line row, but IT's | 5280 | /* start_display takes into account the header-line row, but IT's |
| 5290 | vpos still counts from the glyph row that includes the window's | 5281 | vpos still counts from the glyph row that includes the window's |
| 5291 | start position. Adjust for a possible header-line row. */ | 5282 | start position. Adjust for a possible header-line row. */ |
| 5292 | it.vpos += WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; | 5283 | it.vpos += WINDOW_WANTS_HEADER_LINE_P (w); |
| 5293 | 5284 | ||
| 5294 | x0 = *x; | 5285 | x0 = *x; |
| 5295 | 5286 | ||
| @@ -5613,12 +5604,12 @@ window_change_signal (int signalnum) /* If we don't have an argument, */ | |||
| 5613 | #endif /* SIGWINCH */ | 5604 | #endif /* SIGWINCH */ |
| 5614 | 5605 | ||
| 5615 | 5606 | ||
| 5616 | /* Do any change in frame size that was requested by a signal. SAFE | 5607 | /* Do any change in frame size that was requested by a signal. |
| 5617 | non-zero means this function is called from a place where it is | 5608 | SAFE means this function is called from a place where it is |
| 5618 | safe to change frame sizes while a redisplay is in progress. */ | 5609 | safe to change frame sizes while a redisplay is in progress. */ |
| 5619 | 5610 | ||
| 5620 | void | 5611 | void |
| 5621 | do_pending_window_change (int safe) | 5612 | do_pending_window_change (bool safe) |
| 5622 | { | 5613 | { |
| 5623 | /* If window_change_signal should have run before, run it now. */ | 5614 | /* If window_change_signal should have run before, run it now. */ |
| 5624 | if (redisplaying_p && !safe) | 5615 | if (redisplaying_p && !safe) |
| @@ -5645,16 +5636,17 @@ do_pending_window_change (int safe) | |||
| 5645 | /* Change the frame height and/or width. Values may be given as zero to | 5636 | /* Change the frame height and/or width. Values may be given as zero to |
| 5646 | indicate no change is to take place. | 5637 | indicate no change is to take place. |
| 5647 | 5638 | ||
| 5648 | If DELAY is non-zero, then assume we're being called from a signal | 5639 | If DELAY, assume we're being called from a signal handler, and |
| 5649 | handler, and queue the change for later - perhaps the next | 5640 | queue the change for later - perhaps the next redisplay. |
| 5650 | redisplay. Since this tries to resize windows, we can't call it | 5641 | Since this tries to resize windows, we can't call it |
| 5651 | from a signal handler. | 5642 | from a signal handler. |
| 5652 | 5643 | ||
| 5653 | SAFE non-zero means this function is called from a place where it's | 5644 | SAFE means this function is called from a place where it's |
| 5654 | safe to change frame sizes while a redisplay is in progress. */ | 5645 | safe to change frame sizes while a redisplay is in progress. */ |
| 5655 | 5646 | ||
| 5656 | void | 5647 | void |
| 5657 | change_frame_size (register struct frame *f, int newheight, int newwidth, int pretend, int delay, int safe) | 5648 | change_frame_size (struct frame *f, int newheight, int newwidth, |
| 5649 | bool pretend, bool delay, bool safe) | ||
| 5658 | { | 5650 | { |
| 5659 | Lisp_Object tail, frame; | 5651 | Lisp_Object tail, frame; |
| 5660 | 5652 | ||
| @@ -5673,7 +5665,8 @@ change_frame_size (register struct frame *f, int newheight, int newwidth, int pr | |||
| 5673 | } | 5665 | } |
| 5674 | 5666 | ||
| 5675 | static void | 5667 | static void |
| 5676 | change_frame_size_1 (register struct frame *f, int newheight, int newwidth, int pretend, int delay, int safe) | 5668 | change_frame_size_1 (struct frame *f, int newheight, int newwidth, |
| 5669 | bool pretend, bool delay, bool safe) | ||
| 5677 | { | 5670 | { |
| 5678 | int new_frame_total_cols; | 5671 | int new_frame_total_cols; |
| 5679 | ptrdiff_t count = SPECPDL_INDEX (); | 5672 | ptrdiff_t count = SPECPDL_INDEX (); |
| @@ -5769,7 +5762,7 @@ change_frame_size_1 (register struct frame *f, int newheight, int newwidth, int | |||
| 5769 | 5762 | ||
| 5770 | UNBLOCK_INPUT; | 5763 | UNBLOCK_INPUT; |
| 5771 | 5764 | ||
| 5772 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 5765 | record_unwind_current_buffer (); |
| 5773 | 5766 | ||
| 5774 | run_window_configuration_change_hook (f); | 5767 | run_window_configuration_change_hook (f); |
| 5775 | 5768 | ||
| @@ -5929,13 +5922,13 @@ additional wait period, in milliseconds; this is for backwards compatibility. | |||
| 5929 | 5922 | ||
| 5930 | TIMEOUT is number of seconds to wait (float or integer), | 5923 | TIMEOUT is number of seconds to wait (float or integer), |
| 5931 | or t to wait forever. | 5924 | or t to wait forever. |
| 5932 | READING is 1 if reading input. | 5925 | READING is true if reading input. |
| 5933 | If DO_DISPLAY is >0 display process output while waiting. | 5926 | If DO_DISPLAY is >0 display process output while waiting. |
| 5934 | If DO_DISPLAY is >1 perform an initial redisplay before waiting. | 5927 | If DO_DISPLAY is >1 perform an initial redisplay before waiting. |
| 5935 | */ | 5928 | */ |
| 5936 | 5929 | ||
| 5937 | Lisp_Object | 5930 | Lisp_Object |
| 5938 | sit_for (Lisp_Object timeout, int reading, int do_display) | 5931 | sit_for (Lisp_Object timeout, bool reading, int do_display) |
| 5939 | { | 5932 | { |
| 5940 | intmax_t sec; | 5933 | intmax_t sec; |
| 5941 | int nsec; | 5934 | int nsec; |
diff --git a/src/editfns.c b/src/editfns.c index 0bd632d14b7..7b451e4e443 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -946,13 +946,10 @@ BODY is executed just like `progn'. | |||
| 946 | usage: (save-current-buffer &rest BODY) */) | 946 | usage: (save-current-buffer &rest BODY) */) |
| 947 | (Lisp_Object args) | 947 | (Lisp_Object args) |
| 948 | { | 948 | { |
| 949 | Lisp_Object val; | ||
| 950 | ptrdiff_t count = SPECPDL_INDEX (); | 949 | ptrdiff_t count = SPECPDL_INDEX (); |
| 951 | 950 | ||
| 952 | record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); | 951 | record_unwind_current_buffer (); |
| 953 | 952 | return unbind_to (count, Fprogn (args)); | |
| 954 | val = Fprogn (args); | ||
| 955 | return unbind_to (count, val); | ||
| 956 | } | 953 | } |
| 957 | 954 | ||
| 958 | DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0, | 955 | DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0, |
diff --git a/src/emacs.c b/src/emacs.c index 9e7efcabbf7..7ff5c43dbea 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -279,11 +279,6 @@ static int fatal_error_code; | |||
| 279 | /* Nonzero if handling a fatal error already. */ | 279 | /* Nonzero if handling a fatal error already. */ |
| 280 | int fatal_error_in_progress; | 280 | int fatal_error_in_progress; |
| 281 | 281 | ||
| 282 | /* If non-null, call this function from fatal_error_signal before | ||
| 283 | committing suicide. */ | ||
| 284 | |||
| 285 | static void (*fatal_error_signal_hook) (void); | ||
| 286 | |||
| 287 | #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD | 282 | #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD |
| 288 | /* When compiled with GTK and running under Gnome, | 283 | /* When compiled with GTK and running under Gnome, |
| 289 | multiple threads may be created. Keep track of our main | 284 | multiple threads may be created. Keep track of our main |
| @@ -331,9 +326,6 @@ fatal_error_signal (int sig) | |||
| 331 | sigunblock (sigmask (fatal_error_code)); | 326 | sigunblock (sigmask (fatal_error_code)); |
| 332 | #endif | 327 | #endif |
| 333 | 328 | ||
| 334 | if (fatal_error_signal_hook) | ||
| 335 | fatal_error_signal_hook (); | ||
| 336 | |||
| 337 | kill (getpid (), fatal_error_code); | 329 | kill (getpid (), fatal_error_code); |
| 338 | } | 330 | } |
| 339 | 331 | ||
diff --git a/src/eval.c b/src/eval.c index c41e3f54d4d..df44c87dc25 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -2722,33 +2722,9 @@ DEFUN ("functionp", Ffunctionp, Sfunctionp, 1, 1, 0, | |||
| 2722 | doc: /* Non-nil if OBJECT is a function. */) | 2722 | doc: /* Non-nil if OBJECT is a function. */) |
| 2723 | (Lisp_Object object) | 2723 | (Lisp_Object object) |
| 2724 | { | 2724 | { |
| 2725 | if (SYMBOLP (object) && !NILP (Ffboundp (object))) | 2725 | if (FUNCTIONP (object)) |
| 2726 | { | ||
| 2727 | object = Findirect_function (object, Qt); | ||
| 2728 | |||
| 2729 | if (CONSP (object) && EQ (XCAR (object), Qautoload)) | ||
| 2730 | { | ||
| 2731 | /* Autoloaded symbols are functions, except if they load | ||
| 2732 | macros or keymaps. */ | ||
| 2733 | int i; | ||
| 2734 | for (i = 0; i < 4 && CONSP (object); i++) | ||
| 2735 | object = XCDR (object); | ||
| 2736 | |||
| 2737 | return (CONSP (object) && !NILP (XCAR (object))) ? Qnil : Qt; | ||
| 2738 | } | ||
| 2739 | } | ||
| 2740 | |||
| 2741 | if (SUBRP (object)) | ||
| 2742 | return (XSUBR (object)->max_args != UNEVALLED) ? Qt : Qnil; | ||
| 2743 | else if (COMPILEDP (object)) | ||
| 2744 | return Qt; | 2726 | return Qt; |
| 2745 | else if (CONSP (object)) | 2727 | return Qnil; |
| 2746 | { | ||
| 2747 | Lisp_Object car = XCAR (object); | ||
| 2748 | return (EQ (car, Qlambda) || EQ (car, Qclosure)) ? Qt : Qnil; | ||
| 2749 | } | ||
| 2750 | else | ||
| 2751 | return Qnil; | ||
| 2752 | } | 2728 | } |
| 2753 | 2729 | ||
| 2754 | DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0, | 2730 | DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0, |
diff --git a/src/fileio.c b/src/fileio.c index 6deca0bf1e1..7466914af1c 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3142,8 +3142,7 @@ decide_coding_unwind (Lisp_Object unwind_data) | |||
| 3142 | undo_list = XCAR (unwind_data); | 3142 | undo_list = XCAR (unwind_data); |
| 3143 | buffer = XCDR (unwind_data); | 3143 | buffer = XCDR (unwind_data); |
| 3144 | 3144 | ||
| 3145 | if (current_buffer != XBUFFER (buffer)) | 3145 | set_buffer_internal (XBUFFER (buffer)); |
| 3146 | set_buffer_internal (XBUFFER (buffer)); | ||
| 3147 | adjust_markers_for_delete (BEG, BEG_BYTE, Z, Z_BYTE); | 3146 | adjust_markers_for_delete (BEG, BEG_BYTE, Z, Z_BYTE); |
| 3148 | adjust_overlays_for_delete (BEG, Z - BEG); | 3147 | adjust_overlays_for_delete (BEG, Z - BEG); |
| 3149 | set_buffer_intervals (current_buffer, NULL); | 3148 | set_buffer_intervals (current_buffer, NULL); |
| @@ -3481,7 +3480,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3481 | Lisp_Object workbuf; | 3480 | Lisp_Object workbuf; |
| 3482 | struct buffer *buf; | 3481 | struct buffer *buf; |
| 3483 | 3482 | ||
| 3484 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 3483 | record_unwind_current_buffer (); |
| 3485 | 3484 | ||
| 3486 | workbuf = Fget_buffer_create (build_string (" *code-converting-work*")); | 3485 | workbuf = Fget_buffer_create (build_string (" *code-converting-work*")); |
| 3487 | buf = XBUFFER (workbuf); | 3486 | buf = XBUFFER (workbuf); |
| @@ -3760,7 +3759,8 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3760 | ptrdiff_t temp; | 3759 | ptrdiff_t temp; |
| 3761 | ptrdiff_t this = 0; | 3760 | ptrdiff_t this = 0; |
| 3762 | ptrdiff_t this_count = SPECPDL_INDEX (); | 3761 | ptrdiff_t this_count = SPECPDL_INDEX (); |
| 3763 | int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); | 3762 | bool multibyte |
| 3763 | = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); | ||
| 3764 | Lisp_Object conversion_buffer; | 3764 | Lisp_Object conversion_buffer; |
| 3765 | struct gcpro gcpro1; | 3765 | struct gcpro gcpro1; |
| 3766 | 3766 | ||
| @@ -1100,7 +1100,7 @@ an error is signaled. */) | |||
| 1100 | { | 1100 | { |
| 1101 | ptrdiff_t chars = SCHARS (string); | 1101 | ptrdiff_t chars = SCHARS (string); |
| 1102 | unsigned char *str = xmalloc (chars); | 1102 | unsigned char *str = xmalloc (chars); |
| 1103 | ptrdiff_t converted = str_to_unibyte (SDATA (string), str, chars, 0); | 1103 | ptrdiff_t converted = str_to_unibyte (SDATA (string), str, chars); |
| 1104 | 1104 | ||
| 1105 | if (converted < chars) | 1105 | if (converted < chars) |
| 1106 | error ("Can't convert the %"pD"dth character to unibyte", converted); | 1106 | error ("Can't convert the %"pD"dth character to unibyte", converted); |
| @@ -4656,13 +4656,12 @@ secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_ | |||
| 4656 | { | 4656 | { |
| 4657 | struct buffer *prev = current_buffer; | 4657 | struct buffer *prev = current_buffer; |
| 4658 | 4658 | ||
| 4659 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 4659 | record_unwind_current_buffer (); |
| 4660 | 4660 | ||
| 4661 | CHECK_BUFFER (object); | 4661 | CHECK_BUFFER (object); |
| 4662 | 4662 | ||
| 4663 | bp = XBUFFER (object); | 4663 | bp = XBUFFER (object); |
| 4664 | if (bp != current_buffer) | 4664 | set_buffer_internal (bp); |
| 4665 | set_buffer_internal (bp); | ||
| 4666 | 4665 | ||
| 4667 | if (NILP (start)) | 4666 | if (NILP (start)) |
| 4668 | b = BEGV; | 4667 | b = BEGV; |
| @@ -4749,8 +4748,7 @@ secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_ | |||
| 4749 | } | 4748 | } |
| 4750 | 4749 | ||
| 4751 | object = make_buffer_string (b, e, 0); | 4750 | object = make_buffer_string (b, e, 0); |
| 4752 | if (prev != current_buffer) | 4751 | set_buffer_internal (prev); |
| 4753 | set_buffer_internal (prev); | ||
| 4754 | /* Discard the unwind protect for recovering the current | 4752 | /* Discard the unwind protect for recovering the current |
| 4755 | buffer. */ | 4753 | buffer. */ |
| 4756 | specpdl_ptr--; | 4754 | specpdl_ptr--; |
diff --git a/src/frame.c b/src/frame.c index a00f44a1e5a..4785840a95f 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -4247,7 +4247,6 @@ syms_of_frame (void) | |||
| 4247 | DEFSYM (Qx, "x"); | 4247 | DEFSYM (Qx, "x"); |
| 4248 | DEFSYM (Qw32, "w32"); | 4248 | DEFSYM (Qw32, "w32"); |
| 4249 | DEFSYM (Qpc, "pc"); | 4249 | DEFSYM (Qpc, "pc"); |
| 4250 | DEFSYM (Qmac, "mac"); | ||
| 4251 | DEFSYM (Qns, "ns"); | 4250 | DEFSYM (Qns, "ns"); |
| 4252 | DEFSYM (Qvisible, "visible"); | 4251 | DEFSYM (Qvisible, "visible"); |
| 4253 | DEFSYM (Qbuffer_predicate, "buffer-predicate"); | 4252 | DEFSYM (Qbuffer_predicate, "buffer-predicate"); |
diff --git a/src/frame.h b/src/frame.h index 92fbda42c70..9421aa45414 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -34,7 +34,7 @@ INLINE_HEADER_BEGIN | |||
| 34 | /* Miscellanea. */ | 34 | /* Miscellanea. */ |
| 35 | 35 | ||
| 36 | /* Nonzero means there is at least one garbaged frame. */ | 36 | /* Nonzero means there is at least one garbaged frame. */ |
| 37 | extern int frame_garbaged; | 37 | extern bool frame_garbaged; |
| 38 | 38 | ||
| 39 | 39 | ||
| 40 | /* The structure representing a frame. */ | 40 | /* The structure representing a frame. */ |
| @@ -621,11 +621,21 @@ typedef struct frame *FRAME_PTR; | |||
| 621 | #define FRAME_INITIAL_P(f) ((f)->output_method == output_initial) | 621 | #define FRAME_INITIAL_P(f) ((f)->output_method == output_initial) |
| 622 | #define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap) | 622 | #define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap) |
| 623 | #define FRAME_X_P(f) ((f)->output_method == output_x_window) | 623 | #define FRAME_X_P(f) ((f)->output_method == output_x_window) |
| 624 | #ifndef WINDOWSNT | ||
| 625 | #define FRAME_W32_P(f) (0) | ||
| 626 | #else | ||
| 624 | #define FRAME_W32_P(f) ((f)->output_method == output_w32) | 627 | #define FRAME_W32_P(f) ((f)->output_method == output_w32) |
| 628 | #endif | ||
| 629 | #ifndef MSDOS | ||
| 630 | #define FRAME_MSDOS_P(f) (0) | ||
| 631 | #else | ||
| 625 | #define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw) | 632 | #define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw) |
| 626 | #define FRAME_MAC_P(f) ((f)->output_method == output_mac) | 633 | #endif |
| 634 | #ifndef HAVE_NS | ||
| 635 | #define FRAME_NS_P(f) (0) | ||
| 636 | #else | ||
| 627 | #define FRAME_NS_P(f) ((f)->output_method == output_ns) | 637 | #define FRAME_NS_P(f) ((f)->output_method == output_ns) |
| 628 | 638 | #endif | |
| 629 | /* FRAME_WINDOW_P tests whether the frame is a window, and is | 639 | /* FRAME_WINDOW_P tests whether the frame is a window, and is |
| 630 | defined to be the predicate for the window system being used. */ | 640 | defined to be the predicate for the window system being used. */ |
| 631 | 641 | ||
diff --git a/src/insdel.c b/src/insdel.c index 1dceb67bffa..8cb98566085 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -1779,8 +1779,7 @@ modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end, | |||
| 1779 | { | 1779 | { |
| 1780 | struct buffer *old_buffer = current_buffer; | 1780 | struct buffer *old_buffer = current_buffer; |
| 1781 | 1781 | ||
| 1782 | if (buffer != old_buffer) | 1782 | set_buffer_internal (buffer); |
| 1783 | set_buffer_internal (buffer); | ||
| 1784 | 1783 | ||
| 1785 | prepare_to_modify_buffer (start, end, NULL); | 1784 | prepare_to_modify_buffer (start, end, NULL); |
| 1786 | 1785 | ||
| @@ -1794,8 +1793,7 @@ modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end, | |||
| 1794 | 1793 | ||
| 1795 | bset_point_before_scroll (buffer, Qnil); | 1794 | bset_point_before_scroll (buffer, Qnil); |
| 1796 | 1795 | ||
| 1797 | if (buffer != old_buffer) | 1796 | set_buffer_internal (old_buffer); |
| 1798 | set_buffer_internal (old_buffer); | ||
| 1799 | } | 1797 | } |
| 1800 | 1798 | ||
| 1801 | /* Check that it is okay to modify the buffer between START and END, | 1799 | /* Check that it is okay to modify the buffer between START and END, |
| @@ -2119,7 +2117,7 @@ DEFUN ("combine-after-change-execute", Fcombine_after_change_execute, | |||
| 2119 | return Qnil; | 2117 | return Qnil; |
| 2120 | } | 2118 | } |
| 2121 | 2119 | ||
| 2122 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 2120 | record_unwind_current_buffer (); |
| 2123 | 2121 | ||
| 2124 | Fset_buffer (combine_after_change_buffer); | 2122 | Fset_buffer (combine_after_change_buffer); |
| 2125 | 2123 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index 3d4061accfc..d9b88a8a911 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1434,8 +1434,7 @@ command_loop_1 (void) | |||
| 1434 | Fkill_emacs (Qnil); | 1434 | Fkill_emacs (Qnil); |
| 1435 | 1435 | ||
| 1436 | /* Make sure the current window's buffer is selected. */ | 1436 | /* Make sure the current window's buffer is selected. */ |
| 1437 | if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) | 1437 | set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); |
| 1438 | set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); | ||
| 1439 | 1438 | ||
| 1440 | /* Display any malloc warning that just came out. Use while because | 1439 | /* Display any malloc warning that just came out. Use while because |
| 1441 | displaying one warning can cause another. */ | 1440 | displaying one warning can cause another. */ |
| @@ -1513,8 +1512,7 @@ command_loop_1 (void) | |||
| 1513 | /* A filter may have run while we were reading the input. */ | 1512 | /* A filter may have run while we were reading the input. */ |
| 1514 | if (! FRAME_LIVE_P (XFRAME (selected_frame))) | 1513 | if (! FRAME_LIVE_P (XFRAME (selected_frame))) |
| 1515 | Fkill_emacs (Qnil); | 1514 | Fkill_emacs (Qnil); |
| 1516 | if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) | 1515 | set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); |
| 1517 | set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); | ||
| 1518 | 1516 | ||
| 1519 | ++num_input_keys; | 1517 | ++num_input_keys; |
| 1520 | 1518 | ||
| @@ -9574,7 +9572,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9574 | because we may get input from a subprocess which | 9572 | because we may get input from a subprocess which |
| 9575 | wants to change the selected window and stuff (say, | 9573 | wants to change the selected window and stuff (say, |
| 9576 | emacsclient). */ | 9574 | emacsclient). */ |
| 9577 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 9575 | record_unwind_current_buffer (); |
| 9578 | 9576 | ||
| 9579 | if (! FRAME_LIVE_P (XFRAME (selected_frame))) | 9577 | if (! FRAME_LIVE_P (XFRAME (selected_frame))) |
| 9580 | Fkill_emacs (Qnil); | 9578 | Fkill_emacs (Qnil); |
| @@ -11251,7 +11249,7 @@ The `posn-' functions access elements of such lists. */) | |||
| 11251 | 11249 | ||
| 11252 | if (WINDOWP (frame_or_window)) | 11250 | if (WINDOWP (frame_or_window)) |
| 11253 | { | 11251 | { |
| 11254 | struct window *w = decode_valid_window (frame_or_window); | 11252 | struct window *w = decode_live_window (frame_or_window); |
| 11255 | 11253 | ||
| 11256 | XSETINT (x, (XINT (x) | 11254 | XSETINT (x, (XINT (x) |
| 11257 | + WINDOW_LEFT_EDGE_X (w) | 11255 | + WINDOW_LEFT_EDGE_X (w) |
diff --git a/src/keymap.c b/src/keymap.c index 21f7dcb5d37..4031091501c 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1570,9 +1570,7 @@ like in the respective argument of `key-binding'. */) | |||
| 1570 | would not be a problem here, but it is easier to keep | 1570 | would not be a problem here, but it is easier to keep |
| 1571 | things the same. | 1571 | things the same. |
| 1572 | */ | 1572 | */ |
| 1573 | 1573 | record_unwind_current_buffer (); | |
| 1574 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | ||
| 1575 | |||
| 1576 | set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); | 1574 | set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); |
| 1577 | } | 1575 | } |
| 1578 | } | 1576 | } |
diff --git a/src/lisp.h b/src/lisp.h index d9a7c9d0bdc..49a2832d686 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -606,10 +606,8 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper) | |||
| 606 | 606 | ||
| 607 | #define AREF(ARRAY, IDX) XVECTOR ((ARRAY))->contents[IDX] | 607 | #define AREF(ARRAY, IDX) XVECTOR ((ARRAY))->contents[IDX] |
| 608 | #define ASIZE(ARRAY) XVECTOR ((ARRAY))->header.size | 608 | #define ASIZE(ARRAY) XVECTOR ((ARRAY))->header.size |
| 609 | /* The IDX==IDX tries to detect when the macro argument is side-effecting. */ | ||
| 610 | #define ASET(ARRAY, IDX, VAL) \ | 609 | #define ASET(ARRAY, IDX, VAL) \ |
| 611 | (eassert ((IDX) == (IDX)), \ | 610 | (eassert (0 <= (IDX) && (IDX) < ASIZE (ARRAY)), \ |
| 612 | eassert ((IDX) >= 0 && (IDX) < ASIZE (ARRAY)), \ | ||
| 613 | XVECTOR (ARRAY)->contents[IDX] = (VAL)) | 611 | XVECTOR (ARRAY)->contents[IDX] = (VAL)) |
| 614 | 612 | ||
| 615 | /* Convenience macros for dealing with Lisp strings. */ | 613 | /* Convenience macros for dealing with Lisp strings. */ |
| @@ -1906,11 +1904,7 @@ typedef struct { | |||
| 1906 | Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object) | 1904 | Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object) |
| 1907 | 1905 | ||
| 1908 | /* Non-zero if OBJ is a Lisp function. */ | 1906 | /* Non-zero if OBJ is a Lisp function. */ |
| 1909 | #define FUNCTIONP(OBJ) \ | 1907 | #define FUNCTIONP(OBJ) functionp(OBJ) |
| 1910 | ((CONSP (OBJ) && EQ (XCAR (OBJ), Qlambda)) \ | ||
| 1911 | || (SYMBOLP (OBJ) && !NILP (Ffboundp (OBJ))) \ | ||
| 1912 | || COMPILEDP (OBJ) \ | ||
| 1913 | || SUBRP (OBJ)) | ||
| 1914 | 1908 | ||
| 1915 | /* defsubr (Sname); | 1909 | /* defsubr (Sname); |
| 1916 | is how we define the symbol for function `name' at start-up time. */ | 1910 | is how we define the symbol for function `name' at start-up time. */ |
| @@ -2579,8 +2573,7 @@ extern Lisp_Object Qoverflow_error, Qunderflow_error; | |||
| 2579 | extern Lisp_Object Qfloatp; | 2573 | extern Lisp_Object Qfloatp; |
| 2580 | extern Lisp_Object Qnumberp, Qnumber_or_marker_p; | 2574 | extern Lisp_Object Qnumberp, Qnumber_or_marker_p; |
| 2581 | 2575 | ||
| 2582 | extern Lisp_Object Qinteger, Qinterval, Qsymbol, Qstring; | 2576 | extern Lisp_Object Qbuffer, Qinteger, Qsymbol; |
| 2583 | extern Lisp_Object Qmisc, Qvector, Qfloat, Qcons, Qbuffer; | ||
| 2584 | 2577 | ||
| 2585 | extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; | 2578 | extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; |
| 2586 | 2579 | ||
| @@ -2627,7 +2620,7 @@ extern _Noreturn void args_out_of_range_3 (Lisp_Object, Lisp_Object, | |||
| 2627 | Lisp_Object); | 2620 | Lisp_Object); |
| 2628 | extern _Noreturn Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object); | 2621 | extern _Noreturn Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object); |
| 2629 | extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *); | 2622 | extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *); |
| 2630 | extern void set_internal (Lisp_Object, Lisp_Object, Lisp_Object, int); | 2623 | extern void set_internal (Lisp_Object, Lisp_Object, Lisp_Object, bool); |
| 2631 | extern void syms_of_data (void); | 2624 | extern void syms_of_data (void); |
| 2632 | extern void init_data (void); | 2625 | extern void init_data (void); |
| 2633 | extern void swap_in_global_binding (struct Lisp_Symbol *); | 2626 | extern void swap_in_global_binding (struct Lisp_Symbol *); |
| @@ -2639,7 +2632,7 @@ extern void keys_of_cmds (void); | |||
| 2639 | /* Defined in coding.c */ | 2632 | /* Defined in coding.c */ |
| 2640 | extern Lisp_Object Qcharset; | 2633 | extern Lisp_Object Qcharset; |
| 2641 | extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t, | 2634 | extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t, |
| 2642 | ptrdiff_t, int, int, Lisp_Object); | 2635 | ptrdiff_t, bool, bool, Lisp_Object); |
| 2643 | extern void init_coding (void); | 2636 | extern void init_coding (void); |
| 2644 | extern void init_coding_once (void); | 2637 | extern void init_coding_once (void); |
| 2645 | extern void syms_of_coding (void); | 2638 | extern void syms_of_coding (void); |
| @@ -2773,7 +2766,7 @@ _Noreturn void __executable_start (void); | |||
| 2773 | #endif | 2766 | #endif |
| 2774 | extern Lisp_Object selected_frame; | 2767 | extern Lisp_Object selected_frame; |
| 2775 | extern Lisp_Object Vwindow_system; | 2768 | extern Lisp_Object Vwindow_system; |
| 2776 | extern Lisp_Object sit_for (Lisp_Object, int, int); | 2769 | extern Lisp_Object sit_for (Lisp_Object, bool, int); |
| 2777 | extern void init_display (void); | 2770 | extern void init_display (void); |
| 2778 | extern void syms_of_display (void); | 2771 | extern void syms_of_display (void); |
| 2779 | 2772 | ||
| @@ -3110,14 +3103,14 @@ extern void syms_of_editfns (void); | |||
| 3110 | extern void set_time_zone_rule (const char *); | 3103 | extern void set_time_zone_rule (const char *); |
| 3111 | 3104 | ||
| 3112 | /* Defined in buffer.c. */ | 3105 | /* Defined in buffer.c. */ |
| 3113 | extern int mouse_face_overlay_overlaps (Lisp_Object); | 3106 | extern bool mouse_face_overlay_overlaps (Lisp_Object); |
| 3114 | extern _Noreturn void nsberror (Lisp_Object); | 3107 | extern _Noreturn void nsberror (Lisp_Object); |
| 3115 | extern void adjust_overlays_for_insert (ptrdiff_t, ptrdiff_t); | 3108 | extern void adjust_overlays_for_insert (ptrdiff_t, ptrdiff_t); |
| 3116 | extern void adjust_overlays_for_delete (ptrdiff_t, ptrdiff_t); | 3109 | extern void adjust_overlays_for_delete (ptrdiff_t, ptrdiff_t); |
| 3117 | extern void fix_start_end_in_overlays (ptrdiff_t, ptrdiff_t); | 3110 | extern void fix_start_end_in_overlays (ptrdiff_t, ptrdiff_t); |
| 3118 | extern void report_overlay_modification (Lisp_Object, Lisp_Object, int, | 3111 | extern void report_overlay_modification (Lisp_Object, Lisp_Object, bool, |
| 3119 | Lisp_Object, Lisp_Object, Lisp_Object); | 3112 | Lisp_Object, Lisp_Object, Lisp_Object); |
| 3120 | extern int overlay_touches_p (ptrdiff_t); | 3113 | extern bool overlay_touches_p (ptrdiff_t); |
| 3121 | extern Lisp_Object Vbuffer_alist; | 3114 | extern Lisp_Object Vbuffer_alist; |
| 3122 | extern Lisp_Object set_buffer_if_live (Lisp_Object); | 3115 | extern Lisp_Object set_buffer_if_live (Lisp_Object); |
| 3123 | extern Lisp_Object other_buffer_safely (Lisp_Object); | 3116 | extern Lisp_Object other_buffer_safely (Lisp_Object); |
| @@ -3330,7 +3323,7 @@ extern void setup_process_coding_systems (Lisp_Object); | |||
| 3330 | #ifndef DOS_NT | 3323 | #ifndef DOS_NT |
| 3331 | _Noreturn | 3324 | _Noreturn |
| 3332 | #endif | 3325 | #endif |
| 3333 | extern int child_setup (int, int, int, char **, int, Lisp_Object); | 3326 | extern int child_setup (int, int, int, char **, bool, Lisp_Object); |
| 3334 | extern void init_callproc_1 (void); | 3327 | extern void init_callproc_1 (void); |
| 3335 | extern void init_callproc (void); | 3328 | extern void init_callproc (void); |
| 3336 | extern void set_initial_environment (void); | 3329 | extern void set_initial_environment (void); |
| @@ -3441,7 +3434,7 @@ extern void syms_of_ccl (void); | |||
| 3441 | extern void syms_of_dired (void); | 3434 | extern void syms_of_dired (void); |
| 3442 | extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, | 3435 | extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, |
| 3443 | Lisp_Object, Lisp_Object, | 3436 | Lisp_Object, Lisp_Object, |
| 3444 | int, Lisp_Object); | 3437 | bool, Lisp_Object); |
| 3445 | 3438 | ||
| 3446 | /* Defined in term.c */ | 3439 | /* Defined in term.c */ |
| 3447 | extern int *char_ins_del_vector; | 3440 | extern int *char_ins_del_vector; |
| @@ -3586,7 +3579,7 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object); | |||
| 3586 | extern void *record_xmalloc (size_t); | 3579 | extern void *record_xmalloc (size_t); |
| 3587 | 3580 | ||
| 3588 | #define USE_SAFE_ALLOCA \ | 3581 | #define USE_SAFE_ALLOCA \ |
| 3589 | ptrdiff_t sa_count = SPECPDL_INDEX (); int sa_must_free = 0 | 3582 | ptrdiff_t sa_count = SPECPDL_INDEX (); bool sa_must_free = 0 |
| 3590 | 3583 | ||
| 3591 | /* SAFE_ALLOCA allocates a simple buffer. */ | 3584 | /* SAFE_ALLOCA allocates a simple buffer. */ |
| 3592 | 3585 | ||
| @@ -3656,6 +3649,38 @@ maybe_gc (void) | |||
| 3656 | Fgarbage_collect (); | 3649 | Fgarbage_collect (); |
| 3657 | } | 3650 | } |
| 3658 | 3651 | ||
| 3652 | LISP_INLINE int | ||
| 3653 | functionp (Lisp_Object object) | ||
| 3654 | { | ||
| 3655 | if (SYMBOLP (object) && !NILP (Ffboundp (object))) | ||
| 3656 | { | ||
| 3657 | object = Findirect_function (object, Qt); | ||
| 3658 | |||
| 3659 | if (CONSP (object) && EQ (XCAR (object), Qautoload)) | ||
| 3660 | { | ||
| 3661 | /* Autoloaded symbols are functions, except if they load | ||
| 3662 | macros or keymaps. */ | ||
| 3663 | int i; | ||
| 3664 | for (i = 0; i < 4 && CONSP (object); i++) | ||
| 3665 | object = XCDR (object); | ||
| 3666 | |||
| 3667 | return ! (CONSP (object) && !NILP (XCAR (object))); | ||
| 3668 | } | ||
| 3669 | } | ||
| 3670 | |||
| 3671 | if (SUBRP (object)) | ||
| 3672 | return XSUBR (object)->max_args != UNEVALLED; | ||
| 3673 | else if (COMPILEDP (object)) | ||
| 3674 | return 1; | ||
| 3675 | else if (CONSP (object)) | ||
| 3676 | { | ||
| 3677 | Lisp_Object car = XCAR (object); | ||
| 3678 | return EQ (car, Qlambda) || EQ (car, Qclosure); | ||
| 3679 | } | ||
| 3680 | else | ||
| 3681 | return 0; | ||
| 3682 | } | ||
| 3683 | |||
| 3659 | INLINE_HEADER_END | 3684 | INLINE_HEADER_END |
| 3660 | 3685 | ||
| 3661 | #endif /* EMACS_LISP_H */ | 3686 | #endif /* EMACS_LISP_H */ |
diff --git a/src/makefile.w32-in b/src/makefile.w32-in index bdb292099bc..e5959e0b1a5 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in | |||
| @@ -480,6 +480,7 @@ $(BLD)/alloc.$(O) : \ | |||
| 480 | $(SRC)/syssignal.h \ | 480 | $(SRC)/syssignal.h \ |
| 481 | $(SRC)/w32.h \ | 481 | $(SRC)/w32.h \ |
| 482 | $(NT_INC)/unistd.h \ | 482 | $(NT_INC)/unistd.h \ |
| 483 | $(GNU_LIB)/execinfo.h \ | ||
| 483 | $(GNU_LIB)/verify.h \ | 484 | $(GNU_LIB)/verify.h \ |
| 484 | $(BLOCKINPUT_H) \ | 485 | $(BLOCKINPUT_H) \ |
| 485 | $(BUFFER_H) \ | 486 | $(BUFFER_H) \ |
diff --git a/src/minibuf.c b/src/minibuf.c index 2154d1654df..41cc48017eb 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -817,7 +817,7 @@ get_minibuffer (EMACS_INT depth) | |||
| 817 | while the buffer doesn't know about them any more. */ | 817 | while the buffer doesn't know about them any more. */ |
| 818 | delete_all_overlays (XBUFFER (buf)); | 818 | delete_all_overlays (XBUFFER (buf)); |
| 819 | reset_buffer (XBUFFER (buf)); | 819 | reset_buffer (XBUFFER (buf)); |
| 820 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 820 | record_unwind_current_buffer (); |
| 821 | Fset_buffer (buf); | 821 | Fset_buffer (buf); |
| 822 | if (!NILP (Ffboundp (intern ("minibuffer-inactive-mode")))) | 822 | if (!NILP (Ffboundp (intern ("minibuffer-inactive-mode")))) |
| 823 | call0 (intern ("minibuffer-inactive-mode")); | 823 | call0 (intern ("minibuffer-inactive-mode")); |
diff --git a/src/nsmenu.m b/src/nsmenu.m index e8a0b43a01b..ab285f26df2 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -1497,6 +1497,7 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) | |||
| 1497 | FlippedView *contentView; | 1497 | FlippedView *contentView; |
| 1498 | NSImage *img; | 1498 | NSImage *img; |
| 1499 | 1499 | ||
| 1500 | dialog_return = Qundefined; | ||
| 1500 | area.origin.x = 3*SPACER; | 1501 | area.origin.x = 3*SPACER; |
| 1501 | area.origin.y = 2*SPACER; | 1502 | area.origin.y = 2*SPACER; |
| 1502 | area.size.width = ICONSIZE; | 1503 | area.size.width = ICONSIZE; |
| @@ -1584,7 +1585,7 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) | |||
| 1584 | 1585 | ||
| 1585 | - (BOOL)windowShouldClose: (id)sender | 1586 | - (BOOL)windowShouldClose: (id)sender |
| 1586 | { | 1587 | { |
| 1587 | [NSApp stopModalWithCode: XHASH (Qnil)]; // FIXME: BIG UGLY HACK!! | 1588 | [NSApp stop:self]; |
| 1588 | return NO; | 1589 | return NO; |
| 1589 | } | 1590 | } |
| 1590 | 1591 | ||
| @@ -1673,7 +1674,11 @@ void process_dialog (id window, Lisp_Object list) | |||
| 1673 | 1674 | ||
| 1674 | seltag = [[sellist objectAtIndex: 0] tag]; | 1675 | seltag = [[sellist objectAtIndex: 0] tag]; |
| 1675 | if (seltag != XHASH (Qundefined)) // FIXME: BIG UGLY HACK!! | 1676 | if (seltag != XHASH (Qundefined)) // FIXME: BIG UGLY HACK!! |
| 1676 | [NSApp stopModalWithCode: seltag]; | 1677 | { |
| 1678 | dialog_return = seltag; | ||
| 1679 | [NSApp stop:self]; | ||
| 1680 | } | ||
| 1681 | |||
| 1677 | return self; | 1682 | return self; |
| 1678 | } | 1683 | } |
| 1679 | 1684 | ||
| @@ -1756,13 +1761,27 @@ void process_dialog (id window, Lisp_Object list) | |||
| 1756 | 1761 | ||
| 1757 | - (void)timeout_handler: (NSTimer *)timedEntry | 1762 | - (void)timeout_handler: (NSTimer *)timedEntry |
| 1758 | { | 1763 | { |
| 1764 | NSEvent *nxev = [NSEvent otherEventWithType: NSApplicationDefined | ||
| 1765 | location: NSMakePoint (0, 0) | ||
| 1766 | modifierFlags: 0 | ||
| 1767 | timestamp: 0 | ||
| 1768 | windowNumber: [[NSApp mainWindow] windowNumber] | ||
| 1769 | context: [NSApp context] | ||
| 1770 | subtype: 0 | ||
| 1771 | data1: 0 | ||
| 1772 | data2: 0]; | ||
| 1773 | |||
| 1759 | timer_fired = 1; | 1774 | timer_fired = 1; |
| 1760 | [NSApp abortModal]; | 1775 | /* We use sto because stopModal/abortModal out of the main loop does not |
| 1776 | seem to work in 10.6. But as we use stop we must send a real event so | ||
| 1777 | the stop is seen and acted upon. */ | ||
| 1778 | [NSApp stop:self]; | ||
| 1779 | [NSApp postEvent: nxev atStart: NO]; | ||
| 1761 | } | 1780 | } |
| 1762 | 1781 | ||
| 1763 | - (Lisp_Object)runDialogAt: (NSPoint)p | 1782 | - (Lisp_Object)runDialogAt: (NSPoint)p |
| 1764 | { | 1783 | { |
| 1765 | NSInteger ret = 0; | 1784 | Lisp_Object ret = Qundefined; |
| 1766 | 1785 | ||
| 1767 | while (popup_activated_flag) | 1786 | while (popup_activated_flag) |
| 1768 | { | 1787 | { |
| @@ -1781,7 +1800,9 @@ void process_dialog (id window, Lisp_Object list) | |||
| 1781 | forMode: NSModalPanelRunLoopMode]; | 1800 | forMode: NSModalPanelRunLoopMode]; |
| 1782 | } | 1801 | } |
| 1783 | timer_fired = 0; | 1802 | timer_fired = 0; |
| 1803 | dialog_return = Qundefined; | ||
| 1784 | ret = [NSApp runModalForWindow: self]; | 1804 | ret = [NSApp runModalForWindow: self]; |
| 1805 | ret = dialog_return; | ||
| 1785 | if (! timer_fired) | 1806 | if (! timer_fired) |
| 1786 | { | 1807 | { |
| 1787 | if (tmo != nil) [tmo invalidate]; /* Cancels timer */ | 1808 | if (tmo != nil) [tmo invalidate]; /* Cancels timer */ |
diff --git a/src/nsterm.h b/src/nsterm.h index 54f4a4ec89e..72b8d13cc47 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -196,6 +196,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 196 | NSMatrix *matrix; | 196 | NSMatrix *matrix; |
| 197 | int rows, cols; | 197 | int rows, cols; |
| 198 | int timer_fired; | 198 | int timer_fired; |
| 199 | Lisp_Object dialog_return; | ||
| 199 | } | 200 | } |
| 200 | - initFromContents: (Lisp_Object)menu isQuestion: (BOOL)isQ; | 201 | - initFromContents: (Lisp_Object)menu isQuestion: (BOOL)isQ; |
| 201 | - addButton: (char *)str value: (Lisp_Object)val row: (int)row; | 202 | - addButton: (char *)str value: (Lisp_Object)val row: (int)row; |
diff --git a/src/nsterm.m b/src/nsterm.m index 12ca52684e6..c892a5486a7 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -5091,7 +5091,8 @@ not_in_argv (NSString *arg) | |||
| 5091 | /* TODO: still need this? */ | 5091 | /* TODO: still need this? */ |
| 5092 | if (code == 0x2DC) | 5092 | if (code == 0x2DC) |
| 5093 | code = '~'; /* 0x7E */ | 5093 | code = '~'; /* 0x7E */ |
| 5094 | emacs_event->modifiers = 0; | 5094 | if (code != 32) /* Space */ |
| 5095 | emacs_event->modifiers = 0; | ||
| 5095 | emacs_event->kind | 5096 | emacs_event->kind |
| 5096 | = code > 0xFF ? MULTIBYTE_CHAR_KEYSTROKE_EVENT : ASCII_KEYSTROKE_EVENT; | 5097 | = code > 0xFF ? MULTIBYTE_CHAR_KEYSTROKE_EVENT : ASCII_KEYSTROKE_EVENT; |
| 5097 | emacs_event->code = code; | 5098 | emacs_event->code = code; |
diff --git a/src/print.c b/src/print.c index 64449aeaf2a..52c07c79122 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -197,8 +197,7 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1; | |||
| 197 | ? PT - start_point : 0), \ | 197 | ? PT - start_point : 0), \ |
| 198 | old_point_byte + (old_point_byte >= start_point_byte \ | 198 | old_point_byte + (old_point_byte >= start_point_byte \ |
| 199 | ? PT_BYTE - start_point_byte : 0)); \ | 199 | ? PT_BYTE - start_point_byte : 0)); \ |
| 200 | if (old != current_buffer) \ | 200 | set_buffer_internal (old); |
| 201 | set_buffer_internal (old); | ||
| 202 | 201 | ||
| 203 | #define PRINTCHAR(ch) printchar (ch, printcharfun) | 202 | #define PRINTCHAR(ch) printchar (ch, printcharfun) |
| 204 | 203 | ||
| @@ -488,7 +487,7 @@ temp_output_buffer_setup (const char *bufname) | |||
| 488 | register struct buffer *old = current_buffer; | 487 | register struct buffer *old = current_buffer; |
| 489 | register Lisp_Object buf; | 488 | register Lisp_Object buf; |
| 490 | 489 | ||
| 491 | record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); | 490 | record_unwind_current_buffer (); |
| 492 | 491 | ||
| 493 | Fset_buffer (Fget_buffer_create (build_string (bufname))); | 492 | Fset_buffer (Fget_buffer_create (build_string (bufname))); |
| 494 | 493 | ||
diff --git a/src/process.c b/src/process.c index 7f6f6bafbea..fbe56ebcb54 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4870,15 +4870,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4870 | for (channel = 0; channel <= max_input_desc; ++channel) | 4870 | for (channel = 0; channel <= max_input_desc; ++channel) |
| 4871 | { | 4871 | { |
| 4872 | struct fd_callback_data *d = &fd_callback_info[channel]; | 4872 | struct fd_callback_data *d = &fd_callback_info[channel]; |
| 4873 | if (FD_ISSET (channel, &Available) | 4873 | if (d->func |
| 4874 | && d->func != 0 | 4874 | && ((d->condition & FOR_READ |
| 4875 | && (d->condition & FOR_READ) != 0) | 4875 | && FD_ISSET (channel, &Available)) |
| 4876 | d->func (channel, d->data, 1); | 4876 | || (d->condition & FOR_WRITE |
| 4877 | if (FD_ISSET (channel, &write_mask) | 4877 | && FD_ISSET (channel, &write_mask)))) |
| 4878 | && d->func != 0 | 4878 | d->func (channel, d->data); |
| 4879 | && (d->condition & FOR_WRITE) != 0) | 4879 | } |
| 4880 | d->func (channel, d->data, 0); | ||
| 4881 | } | ||
| 4882 | 4880 | ||
| 4883 | for (channel = 0; channel <= max_process_desc; channel++) | 4881 | for (channel = 0; channel <= max_process_desc; channel++) |
| 4884 | { | 4882 | { |
| @@ -5198,7 +5196,7 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 5198 | /* There's no good reason to let process filters change the current | 5196 | /* There's no good reason to let process filters change the current |
| 5199 | buffer, and many callers of accept-process-output, sit-for, and | 5197 | buffer, and many callers of accept-process-output, sit-for, and |
| 5200 | friends don't expect current-buffer to be changed from under them. */ | 5198 | friends don't expect current-buffer to be changed from under them. */ |
| 5201 | record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); | 5199 | record_unwind_current_buffer (); |
| 5202 | 5200 | ||
| 5203 | /* Read and dispose of the process output. */ | 5201 | /* Read and dispose of the process output. */ |
| 5204 | outstream = p->filter; | 5202 | outstream = p->filter; |
| @@ -6589,7 +6587,7 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason) | |||
| 6589 | /* There's no good reason to let sentinels change the current | 6587 | /* There's no good reason to let sentinels change the current |
| 6590 | buffer, and many callers of accept-process-output, sit-for, and | 6588 | buffer, and many callers of accept-process-output, sit-for, and |
| 6591 | friends don't expect current-buffer to be changed from under them. */ | 6589 | friends don't expect current-buffer to be changed from under them. */ |
| 6592 | record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); | 6590 | record_unwind_current_buffer (); |
| 6593 | 6591 | ||
| 6594 | sentinel = p->sentinel; | 6592 | sentinel = p->sentinel; |
| 6595 | if (NILP (sentinel)) | 6593 | if (NILP (sentinel)) |
diff --git a/src/process.h b/src/process.h index 55a572117c6..ce3d2e702cc 100644 --- a/src/process.h +++ b/src/process.h | |||
| @@ -184,7 +184,7 @@ pset_gnutls_cred_type (struct Lisp_Process *p, Lisp_Object val) | |||
| 184 | 184 | ||
| 185 | /* True if we are about to fork off a synchronous process or if we | 185 | /* True if we are about to fork off a synchronous process or if we |
| 186 | are waiting for it. */ | 186 | are waiting for it. */ |
| 187 | extern int synch_process_alive; | 187 | extern bool synch_process_alive; |
| 188 | 188 | ||
| 189 | /* Communicate exit status of sync process to from sigchld_handler | 189 | /* Communicate exit status of sync process to from sigchld_handler |
| 190 | to Fcall_process. */ | 190 | to Fcall_process. */ |
| @@ -219,7 +219,7 @@ extern void hold_keyboard_input (void); | |||
| 219 | extern void unhold_keyboard_input (void); | 219 | extern void unhold_keyboard_input (void); |
| 220 | extern int kbd_on_hold_p (void); | 220 | extern int kbd_on_hold_p (void); |
| 221 | 221 | ||
| 222 | typedef void (*fd_callback)(int fd, void *data, int for_read); | 222 | typedef void (*fd_callback) (int fd, void *data); |
| 223 | 223 | ||
| 224 | extern void add_read_fd (int fd, fd_callback func, void *data); | 224 | extern void add_read_fd (int fd, fd_callback func, void *data); |
| 225 | extern void delete_read_fd (int fd); | 225 | extern void delete_read_fd (int fd); |
diff --git a/src/textprop.c b/src/textprop.c index 20d98b0e6f3..b6895fc426a 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -760,7 +760,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 760 | 760 | ||
| 761 | if (BUFFERP (object) && current_buffer != XBUFFER (object)) | 761 | if (BUFFERP (object) && current_buffer != XBUFFER (object)) |
| 762 | { | 762 | { |
| 763 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 763 | record_unwind_current_buffer (); |
| 764 | Fset_buffer (object); | 764 | Fset_buffer (object); |
| 765 | } | 765 | } |
| 766 | 766 | ||
| @@ -843,7 +843,7 @@ position LIMIT; return LIMIT if nothing is found before reaching LIMIT. */) | |||
| 843 | 843 | ||
| 844 | if (BUFFERP (object) && current_buffer != XBUFFER (object)) | 844 | if (BUFFERP (object) && current_buffer != XBUFFER (object)) |
| 845 | { | 845 | { |
| 846 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 846 | record_unwind_current_buffer (); |
| 847 | Fset_buffer (object); | 847 | Fset_buffer (object); |
| 848 | } | 848 | } |
| 849 | 849 | ||
diff --git a/src/undo.c b/src/undo.c index 777e3291806..9cd1d5f9f67 100644 --- a/src/undo.c +++ b/src/undo.c | |||
| @@ -324,7 +324,7 @@ truncate_undo_list (struct buffer *b) | |||
| 324 | /* Make the buffer current to get its local values of variables such | 324 | /* Make the buffer current to get its local values of variables such |
| 325 | as undo_limit. Also so that Vundo_outer_limit_function can | 325 | as undo_limit. Also so that Vundo_outer_limit_function can |
| 326 | tell which buffer to operate on. */ | 326 | tell which buffer to operate on. */ |
| 327 | record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); | 327 | record_unwind_current_buffer (); |
| 328 | set_buffer_internal (b); | 328 | set_buffer_internal (b); |
| 329 | 329 | ||
| 330 | list = BVAR (b, undo_list); | 330 | list = BVAR (b, undo_list); |
| @@ -4098,7 +4098,7 @@ symlink (char const *filename, char const *linkname) | |||
| 4098 | dir_access = sys_access (filename, D_OK); | 4098 | dir_access = sys_access (filename, D_OK); |
| 4099 | 4099 | ||
| 4100 | /* Since Windows distinguishes between symlinks to directories and | 4100 | /* Since Windows distinguishes between symlinks to directories and |
| 4101 | to files, we provide a kludgey feature: if FILENAME doesn't | 4101 | to files, we provide a kludgy feature: if FILENAME doesn't |
| 4102 | exist, but ends in a slash, we create a symlink to directory. If | 4102 | exist, but ends in a slash, we create a symlink to directory. If |
| 4103 | FILENAME exists and is a directory, we always create a symlink to | 4103 | FILENAME exists and is a directory, we always create a symlink to |
| 4104 | directory. */ | 4104 | directory. */ |
| @@ -4165,7 +4165,7 @@ symlink (char const *filename, char const *linkname) | |||
| 4165 | whether the underlying volume actually supports symlinks, by | 4165 | whether the underlying volume actually supports symlinks, by |
| 4166 | testing the FILE_SUPPORTS_REPARSE_POINTS bit in volume's flags, and | 4166 | testing the FILE_SUPPORTS_REPARSE_POINTS bit in volume's flags, and |
| 4167 | avoid the call to this function if it doesn't. That's because the | 4167 | avoid the call to this function if it doesn't. That's because the |
| 4168 | call to GetFileAttributes takes a non-negligible time, expecially | 4168 | call to GetFileAttributes takes a non-negligible time, especially |
| 4169 | on non-local or removable filesystems. See stat_worker for an | 4169 | on non-local or removable filesystems. See stat_worker for an |
| 4170 | example of how to do that. */ | 4170 | example of how to do that. */ |
| 4171 | static int | 4171 | static int |
diff --git a/src/window.c b/src/window.c index 4d92566b243..ba1ec2544f8 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -54,7 +54,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 54 | #include "nsterm.h" | 54 | #include "nsterm.h" |
| 55 | #endif | 55 | #endif |
| 56 | 56 | ||
| 57 | Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_valid_p; | 57 | Lisp_Object Qwindowp, Qwindow_live_p; |
| 58 | static Lisp_Object Qwindow_valid_p; | ||
| 58 | static Lisp_Object Qwindow_configuration_p, Qrecord_window_buffer; | 59 | static Lisp_Object Qwindow_configuration_p, Qrecord_window_buffer; |
| 59 | static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer; | 60 | static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer; |
| 60 | static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; | 61 | static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; |
| @@ -268,7 +269,7 @@ decode_any_window (register Lisp_Object window) | |||
| 268 | return w; | 269 | return w; |
| 269 | } | 270 | } |
| 270 | 271 | ||
| 271 | struct window * | 272 | static struct window * |
| 272 | decode_valid_window (register Lisp_Object window) | 273 | decode_valid_window (register Lisp_Object window) |
| 273 | { | 274 | { |
| 274 | struct window *w; | 275 | struct window *w; |
| @@ -1968,6 +1969,9 @@ unshow_buffer (register struct window *w) | |||
| 1968 | is actually stored in that buffer, and the window's pointm isn't used. | 1969 | is actually stored in that buffer, and the window's pointm isn't used. |
| 1969 | So don't clobber point in that buffer. */ | 1970 | So don't clobber point in that buffer. */ |
| 1970 | if (! EQ (buf, XWINDOW (selected_window)->buffer) | 1971 | if (! EQ (buf, XWINDOW (selected_window)->buffer) |
| 1972 | /* Don't clobber point in current buffer either (this could be | ||
| 1973 | useful in connection with bug#12208). | ||
| 1974 | && XBUFFER (buf) != current_buffer */ | ||
| 1971 | /* This line helps to fix Horsley's testbug.el bug. */ | 1975 | /* This line helps to fix Horsley's testbug.el bug. */ |
| 1972 | && !(WINDOWP (BVAR (b, last_selected_window)) | 1976 | && !(WINDOWP (BVAR (b, last_selected_window)) |
| 1973 | && w != XWINDOW (BVAR (b, last_selected_window)) | 1977 | && w != XWINDOW (BVAR (b, last_selected_window)) |
| @@ -3097,7 +3101,7 @@ run_window_configuration_change_hook (struct frame *f) | |||
| 3097 | /* Use the right buffer. Matters when running the local hooks. */ | 3101 | /* Use the right buffer. Matters when running the local hooks. */ |
| 3098 | if (current_buffer != XBUFFER (Fwindow_buffer (Qnil))) | 3102 | if (current_buffer != XBUFFER (Fwindow_buffer (Qnil))) |
| 3099 | { | 3103 | { |
| 3100 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 3104 | record_unwind_current_buffer (); |
| 3101 | Fset_buffer (Fwindow_buffer (Qnil)); | 3105 | Fset_buffer (Fwindow_buffer (Qnil)); |
| 3102 | } | 3106 | } |
| 3103 | 3107 | ||
| @@ -3134,7 +3138,7 @@ run_window_configuration_change_hook (struct frame *f) | |||
| 3134 | DEFUN ("run-window-configuration-change-hook", Frun_window_configuration_change_hook, | 3138 | DEFUN ("run-window-configuration-change-hook", Frun_window_configuration_change_hook, |
| 3135 | Srun_window_configuration_change_hook, 1, 1, 0, | 3139 | Srun_window_configuration_change_hook, 1, 1, 0, |
| 3136 | doc: /* Run `window-configuration-change-hook' for FRAME. */) | 3140 | doc: /* Run `window-configuration-change-hook' for FRAME. */) |
| 3137 | (Lisp_Object frame) | 3141 | (Lisp_Object frame) |
| 3138 | { | 3142 | { |
| 3139 | CHECK_LIVE_FRAME (frame); | 3143 | CHECK_LIVE_FRAME (frame); |
| 3140 | run_window_configuration_change_hook (XFRAME (frame)); | 3144 | run_window_configuration_change_hook (XFRAME (frame)); |
| @@ -3201,7 +3205,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int | |||
| 3201 | because that might itself be a local variable. */ | 3205 | because that might itself be a local variable. */ |
| 3202 | if (window_initialized) | 3206 | if (window_initialized) |
| 3203 | { | 3207 | { |
| 3204 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 3208 | record_unwind_current_buffer (); |
| 3205 | Fset_buffer (buffer); | 3209 | Fset_buffer (buffer); |
| 3206 | } | 3210 | } |
| 3207 | 3211 | ||
| @@ -5899,7 +5903,13 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5899 | } | 5903 | } |
| 5900 | 5904 | ||
| 5901 | if (!NILP (new_current_buffer)) | 5905 | if (!NILP (new_current_buffer)) |
| 5902 | Fset_buffer (new_current_buffer); | 5906 | { |
| 5907 | Fset_buffer (new_current_buffer); | ||
| 5908 | /* If the new current buffer doesn't appear in the selected | ||
| 5909 | window, go to its old point (see bug#12208). */ | ||
| 5910 | if (!EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)) | ||
| 5911 | Fgoto_char (make_number (old_point)); | ||
| 5912 | } | ||
| 5903 | 5913 | ||
| 5904 | Vminibuf_scroll_window = data->minibuf_scroll_window; | 5914 | Vminibuf_scroll_window = data->minibuf_scroll_window; |
| 5905 | minibuf_selected_window = data->minibuf_selected_window; | 5915 | minibuf_selected_window = data->minibuf_selected_window; |
diff --git a/src/window.h b/src/window.h index 28b9678b667..dfb88b2cf3c 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -972,7 +972,6 @@ struct glyph *get_phys_cursor_glyph (struct window *w); | |||
| 972 | extern Lisp_Object Qwindowp, Qwindow_live_p; | 972 | extern Lisp_Object Qwindowp, Qwindow_live_p; |
| 973 | extern Lisp_Object Vwindow_list; | 973 | extern Lisp_Object Vwindow_list; |
| 974 | 974 | ||
| 975 | extern struct window *decode_valid_window (Lisp_Object); | ||
| 976 | extern struct window *decode_live_window (Lisp_Object); | 975 | extern struct window *decode_live_window (Lisp_Object); |
| 977 | extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); | 976 | extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); |
| 978 | extern void mark_window_cursors_off (struct window *); | 977 | extern void mark_window_cursors_off (struct window *); |
diff --git a/src/xdisp.c b/src/xdisp.c index f5edb4b16f8..13b03736bde 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -2420,7 +2420,7 @@ remember_mouse_glyph (struct frame *f, int gx, int gy, NativeRectangle *rect) | |||
| 2420 | static Lisp_Object | 2420 | static Lisp_Object |
| 2421 | safe_eval_handler (Lisp_Object arg, ptrdiff_t nargs, Lisp_Object *args) | 2421 | safe_eval_handler (Lisp_Object arg, ptrdiff_t nargs, Lisp_Object *args) |
| 2422 | { | 2422 | { |
| 2423 | add_to_log ("Error during redisplay: %S signalled %S", | 2423 | add_to_log ("Error during redisplay: %S signaled %S", |
| 2424 | Flist (nargs, args), arg); | 2424 | Flist (nargs, args), arg); |
| 2425 | return Qnil; | 2425 | return Qnil; |
| 2426 | } | 2426 | } |
| @@ -14551,8 +14551,7 @@ run_window_scroll_functions (Lisp_Object window, struct text_pos startp) | |||
| 14551 | make_number (CHARPOS (startp))); | 14551 | make_number (CHARPOS (startp))); |
| 14552 | SET_TEXT_POS_FROM_MARKER (startp, w->start); | 14552 | SET_TEXT_POS_FROM_MARKER (startp, w->start); |
| 14553 | /* In case the hook functions switch buffers. */ | 14553 | /* In case the hook functions switch buffers. */ |
| 14554 | if (current_buffer != XBUFFER (w->buffer)) | 14554 | set_buffer_internal (XBUFFER (w->buffer)); |
| 14555 | set_buffer_internal_1 (XBUFFER (w->buffer)); | ||
| 14556 | } | 14555 | } |
| 14557 | 14556 | ||
| 14558 | return startp; | 14557 | return startp; |
| @@ -15380,7 +15379,7 @@ set_vertical_scroll_bar (struct window *w) | |||
| 15380 | selected_window is redisplayed. | 15379 | selected_window is redisplayed. |
| 15381 | 15380 | ||
| 15382 | We can return without actually redisplaying the window if | 15381 | We can return without actually redisplaying the window if |
| 15383 | fonts_changed_p is nonzero. In that case, redisplay_internal will | 15382 | fonts_changed_p. In that case, redisplay_internal will |
| 15384 | retry. */ | 15383 | retry. */ |
| 15385 | 15384 | ||
| 15386 | static void | 15385 | static void |
| @@ -16224,7 +16223,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 16224 | } | 16223 | } |
| 16225 | #endif /* HAVE_WINDOW_SYSTEM */ | 16224 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 16226 | 16225 | ||
| 16227 | /* We go to this label, with fonts_changed_p nonzero, | 16226 | /* We go to this label, with fonts_changed_p set, |
| 16228 | if it is necessary to try again using larger glyph matrices. | 16227 | if it is necessary to try again using larger glyph matrices. |
| 16229 | We have to redeem the scroll bar even in this case, | 16228 | We have to redeem the scroll bar even in this case, |
| 16230 | because the loop in redisplay_internal expects that. */ | 16229 | because the loop in redisplay_internal expects that. */ |
| @@ -17705,15 +17704,15 @@ try_window_id (struct window *w) | |||
| 17705 | { | 17704 | { |
| 17706 | rotate_matrix (current_matrix, first_unchanged_at_end_vpos + dvpos, | 17705 | rotate_matrix (current_matrix, first_unchanged_at_end_vpos + dvpos, |
| 17707 | bottom_vpos, dvpos); | 17706 | bottom_vpos, dvpos); |
| 17708 | enable_glyph_matrix_rows (current_matrix, bottom_vpos + dvpos, | 17707 | clear_glyph_matrix_rows (current_matrix, bottom_vpos + dvpos, |
| 17709 | bottom_vpos, 0); | 17708 | bottom_vpos); |
| 17710 | } | 17709 | } |
| 17711 | else if (dvpos > 0) | 17710 | else if (dvpos > 0) |
| 17712 | { | 17711 | { |
| 17713 | rotate_matrix (current_matrix, first_unchanged_at_end_vpos, | 17712 | rotate_matrix (current_matrix, first_unchanged_at_end_vpos, |
| 17714 | bottom_vpos, dvpos); | 17713 | bottom_vpos, dvpos); |
| 17715 | enable_glyph_matrix_rows (current_matrix, first_unchanged_at_end_vpos, | 17714 | clear_glyph_matrix_rows (current_matrix, first_unchanged_at_end_vpos, |
| 17716 | first_unchanged_at_end_vpos + dvpos, 0); | 17715 | first_unchanged_at_end_vpos + dvpos); |
| 17717 | } | 17716 | } |
| 17718 | 17717 | ||
| 17719 | /* For frame-based redisplay, make sure that current frame and window | 17718 | /* For frame-based redisplay, make sure that current frame and window |
diff --git a/src/xgselect.c b/src/xgselect.c index 04ca00274e8..0c00d815820 100644 --- a/src/xgselect.c +++ b/src/xgselect.c | |||
| @@ -29,9 +29,6 @@ along with GNU Emacs. If not, see <http§://www.gnu.org/licenses/>. */ | |||
| 29 | #include <setjmp.h> | 29 | #include <setjmp.h> |
| 30 | #include "xterm.h" | 30 | #include "xterm.h" |
| 31 | 31 | ||
| 32 | static GPollFD *gfds; | ||
| 33 | static ptrdiff_t gfds_size; | ||
| 34 | |||
| 35 | int | 32 | int |
| 36 | xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, | 33 | xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, |
| 37 | EMACS_TIME *timeout, sigset_t *sigmask) | 34 | EMACS_TIME *timeout, sigset_t *sigmask) |
| @@ -41,35 +38,31 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, | |||
| 41 | 38 | ||
| 42 | GMainContext *context; | 39 | GMainContext *context; |
| 43 | int have_wfds = wfds != NULL; | 40 | int have_wfds = wfds != NULL; |
| 44 | int n_gfds = 0, retval = 0, our_fds = 0, max_fds = fds_lim - 1; | 41 | GPollFD gfds_buf[128]; |
| 42 | GPollFD *gfds = gfds_buf; | ||
| 43 | int gfds_size = sizeof gfds_buf / sizeof *gfds_buf; | ||
| 44 | int n_gfds, retval = 0, our_fds = 0, max_fds = fds_lim - 1; | ||
| 45 | int i, nfds, tmo_in_millisec; | 45 | int i, nfds, tmo_in_millisec; |
| 46 | USE_SAFE_ALLOCA; | ||
| 46 | 47 | ||
| 47 | if (!x_in_use) | 48 | if (! (x_in_use |
| 48 | return pselect (fds_lim, rfds, wfds, efds, tmop, sigmask); | 49 | && g_main_context_pending (context = g_main_context_default ()))) |
| 50 | return pselect (fds_lim, rfds, wfds, efds, timeout, sigmask); | ||
| 49 | 51 | ||
| 50 | if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); | 52 | if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); |
| 51 | else FD_ZERO (&all_rfds); | 53 | else FD_ZERO (&all_rfds); |
| 52 | if (wfds) memcpy (&all_wfds, wfds, sizeof (all_rfds)); | 54 | if (wfds) memcpy (&all_wfds, wfds, sizeof (all_rfds)); |
| 53 | else FD_ZERO (&all_wfds); | 55 | else FD_ZERO (&all_wfds); |
| 54 | 56 | ||
| 55 | /* Update event sources in GLib. */ | 57 | n_gfds = g_main_context_query (context, G_PRIORITY_LOW, &tmo_in_millisec, |
| 56 | context = g_main_context_default (); | 58 | gfds, gfds_size); |
| 57 | g_main_context_pending (context); | 59 | if (gfds_size < n_gfds) |
| 58 | 60 | { | |
| 59 | do { | 61 | SAFE_NALLOCA (gfds, sizeof *gfds, n_gfds); |
| 60 | if (n_gfds > gfds_size) | 62 | gfds_size = n_gfds; |
| 61 | { | 63 | n_gfds = g_main_context_query (context, G_PRIORITY_LOW, &tmo_in_millisec, |
| 62 | xfree (gfds); | 64 | gfds, gfds_size); |
| 63 | gfds = xpalloc (0, &gfds_size, n_gfds - gfds_size, INT_MAX, | 65 | } |
| 64 | sizeof *gfds); | ||
| 65 | } | ||
| 66 | |||
| 67 | n_gfds = g_main_context_query (context, | ||
| 68 | G_PRIORITY_LOW, | ||
| 69 | &tmo_in_millisec, | ||
| 70 | gfds, | ||
| 71 | gfds_size); | ||
| 72 | } while (n_gfds > gfds_size); | ||
| 73 | 66 | ||
| 74 | for (i = 0; i < n_gfds; ++i) | 67 | for (i = 0; i < n_gfds; ++i) |
| 75 | { | 68 | { |
| @@ -86,6 +79,8 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, | |||
| 86 | } | 79 | } |
| 87 | } | 80 | } |
| 88 | 81 | ||
| 82 | SAFE_FREE (); | ||
| 83 | |||
| 89 | if (tmo_in_millisec >= 0) | 84 | if (tmo_in_millisec >= 0) |
| 90 | { | 85 | { |
| 91 | tmo = make_emacs_time (tmo_in_millisec / 1000, | 86 | tmo = make_emacs_time (tmo_in_millisec / 1000, |
| @@ -147,12 +142,3 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, | |||
| 147 | return retval; | 142 | return retval; |
| 148 | } | 143 | } |
| 149 | #endif /* USE_GTK || HAVE_GCONF || HAVE_GSETTINGS */ | 144 | #endif /* USE_GTK || HAVE_GCONF || HAVE_GSETTINGS */ |
| 150 | |||
| 151 | void | ||
| 152 | xgselect_initialize (void) | ||
| 153 | { | ||
| 154 | #if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) | ||
| 155 | gfds_size = 128; | ||
| 156 | gfds = xmalloc (gfds_size * sizeof *gfds); | ||
| 157 | #endif | ||
| 158 | } | ||
diff --git a/src/xgselect.h b/src/xgselect.h index 8e5614ea972..5509e23c5c0 100644 --- a/src/xgselect.h +++ b/src/xgselect.h | |||
| @@ -31,6 +31,4 @@ extern int xg_select (int max_fds, | |||
| 31 | EMACS_TIME *timeout, | 31 | EMACS_TIME *timeout, |
| 32 | sigset_t *sigmask); | 32 | sigset_t *sigmask); |
| 33 | 33 | ||
| 34 | extern void xgselect_initialize (void); | ||
| 35 | |||
| 36 | #endif /* XGSELECT_H */ | 34 | #endif /* XGSELECT_H */ |
diff --git a/src/xsmfns.c b/src/xsmfns.c index 1f6eb84260e..cddbb2aae86 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c | |||
| @@ -97,7 +97,7 @@ ice_connection_closed (void) | |||
| 97 | open to a session manager, just return. */ | 97 | open to a session manager, just return. */ |
| 98 | 98 | ||
| 99 | static void | 99 | static void |
| 100 | x_session_check_input (int fd, void *data, int for_read) | 100 | x_session_check_input (int fd, void *data) |
| 101 | { | 101 | { |
| 102 | int ret; | 102 | int ret; |
| 103 | 103 | ||
diff --git a/src/xterm.c b/src/xterm.c index 118c8767c23..7e61cc4d8ea 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -10815,8 +10815,6 @@ x_initialize (void) | |||
| 10815 | XSetIOErrorHandler (x_io_error_quitter); | 10815 | XSetIOErrorHandler (x_io_error_quitter); |
| 10816 | 10816 | ||
| 10817 | signal (SIGPIPE, x_connection_signal); | 10817 | signal (SIGPIPE, x_connection_signal); |
| 10818 | |||
| 10819 | xgselect_initialize (); | ||
| 10820 | } | 10818 | } |
| 10821 | 10819 | ||
| 10822 | 10820 | ||