Merge from trunk

This commit is contained in:
Tom Tromey 2012-08-20 07:34:41 -06:00
commit 49bc1a9dfc
125 changed files with 4595 additions and 2706 deletions

View file

@ -1,3 +1,21 @@
2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
Merge from gnulib, incorporating:
2012-08-19 ignore-value, stat-time, timespec: omit AC_C_INLINE
2012-08-19 mktime, sys_select: avoid 'static inline'
2012-08-19 gnulib-tool: Fix indentation.
2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
* lib/sigprocmask.c, m4/signalblocking.m4: Remove.
These files have been unused since the 2012-06-22 patch that
introduced high-resolution time stamps.
2012-08-17 Jan Beich <jbeich@tormail.org> (tiny change)
* configure.ac (PTY_OPEN): Try posix_openpt on gnu-linux,
gnu-kfreebsd, freebsd, and netbsd. (Bug#12040)
2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
Merge from gnulib, incorporating:

View file

@ -508,9 +508,6 @@ dup2
lib/signal.h:
signal
lib/sigprocmask.c:
signal
lib/stdio.h:
fdopen
fopen

View file

@ -1,3 +1,10 @@
2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
Use ASCII tests for character types.
* merge-gnulib (GNULIB_MODULES): Add c-ctype. This documents a
new direct dependency; c-ctype was already being used indirectly
via other gnulib modules.
2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
Use bool for Emacs Lisp booleans.

View file

@ -26,7 +26,7 @@
GNULIB_URL=git://git.savannah.gnu.org/gnulib.git
GNULIB_MODULES='
alloca-opt c-strcase
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

View file

@ -36,7 +36,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# 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-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 stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings
# 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
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@

View file

@ -731,6 +731,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `posix_memalign' function. */
#undef HAVE_POSIX_MEMALIGN
/* Define to 1 if you have the `posix_openpt' function. */
#undef HAVE_POSIX_OPENPT
/* Define if you have the /proc filesystem. */
#undef HAVE_PROCFS

132
autogen/configure vendored
View file

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.65 for emacs 24.1.50.
# Generated by GNU Autoconf 2.65 for emacs 24.2.50.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -549,8 +549,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='emacs'
PACKAGE_TARNAME='emacs'
PACKAGE_VERSION='24.1.50'
PACKAGE_STRING='emacs 24.1.50'
PACKAGE_VERSION='24.2.50'
PACKAGE_STRING='emacs 24.2.50'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@ -1928,7 +1928,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures emacs 24.1.50 to adapt to many kinds of systems.
\`configure' configures emacs 24.2.50 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -2002,7 +2002,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of emacs 24.1.50:";;
short | recursive ) echo "Configuration of emacs 24.2.50:";;
esac
cat <<\_ACEOF
@ -2169,7 +2169,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
emacs configure 24.1.50
emacs configure 24.2.50
generated by GNU Autoconf 2.65
Copyright (C) 2009 Free Software Foundation, Inc.
@ -2891,7 +2891,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by emacs $as_me 24.1.50, which was
It was created by emacs $as_me 24.2.50, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@
@ -3751,7 +3751,7 @@ fi
# Define the identity of the package.
PACKAGE='emacs'
VERSION='24.1.50'
VERSION='24.2.50'
cat >>confdefs.h <<_ACEOF
@ -13258,12 +13258,14 @@ done
# PTY-related GNU extensions.
for ac_func in getpt
for ac_func in getpt posix_openpt
do :
ac_fn_c_check_func "$LINENO" "getpt" "ac_cv_func_getpt"
if test "x$ac_cv_func_getpt" = x""yes; then :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
eval as_val=\$$as_ac_var
if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GETPT 1
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@ -14883,7 +14885,7 @@ case $opsys in
;;
darwin )
darwin )
$as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++)" >>confdefs.h
$as_echo "#define FIRST_PTY_LETTER 'p'" >>confdefs.h
@ -14896,12 +14898,12 @@ case $opsys in
;;
gnu | freebsd | netbsd | openbsd )
gnu | openbsd )
$as_echo "#define FIRST_PTY_LETTER 'p'" >>confdefs.h
;;
gnu-linux | gnu-kfreebsd )
gnu-linux | gnu-kfreebsd | freebsd | netbsd )
if test "x$ac_cv_func_grantpt" = xyes; then
$as_echo "#define UNIX98_PTYS 1" >>confdefs.h
@ -14910,7 +14912,12 @@ $as_echo "#define UNIX98_PTYS 1" >>confdefs.h
$as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptyname; sigblock (sigmask (SIGCHLD)); if (grantpt (fd) == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname(fd))) { sigunblock (sigmask (SIGCHLD)); close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); sigunblock (sigmask (SIGCHLD)); }" >>confdefs.h
if test "x$ac_cv_func_getpt" = xyes; then
if test "x$ac_cv_func_posix_openpt" = xyes; then
$as_echo "#define PTY_OPEN fd = posix_openpt (O_RDWR | O_NOCTTY)" >>confdefs.h
$as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h
elif test "x$ac_cv_func_getpt" = xyes; then
$as_echo "#define PTY_OPEN fd = getpt ()" >>confdefs.h
$as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h
@ -17310,9 +17317,7 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_GETENV $ac_have_decl
_ACEOF
:
@ -20044,7 +20049,7 @@ $as_echo "$gl_cv_func_dup2_works" >&6; }
fi
if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
@ -20056,7 +20061,7 @@ if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
fi
fi
@ -20480,7 +20485,7 @@ else
fi
if test $HAVE_GETLOADAVG = 0; then
if test $HAVE_GETLOADAVG = 0; then
@ -20608,7 +20613,7 @@ fi
done
fi
fi
@ -20625,7 +20630,7 @@ fi
if test $REPLACE_GETOPT = 1; then
if test $REPLACE_GETOPT = 1; then
@ -20649,8 +20654,8 @@ if test $REPLACE_GETOPT = 1; then
GNULIB_GL_UNISTD_H_GETOPT=1
fi
GNULIB_GL_UNISTD_H_GETOPT=1
fi
@ -20673,7 +20678,7 @@ $as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
fi
if test $REPLACE_GETOPT = 1; then
if test $REPLACE_GETOPT = 1; then
@ -20697,8 +20702,8 @@ if test $REPLACE_GETOPT = 1; then
GNULIB_GL_UNISTD_H_GETOPT=1
fi
GNULIB_GL_UNISTD_H_GETOPT=1
fi
@ -20858,7 +20863,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
@ -20894,7 +20899,7 @@ fi
done
fi
fi
@ -20911,7 +20916,6 @@ fi
if test $ac_cv_func_lstat = yes; then
case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
@ -20923,7 +20927,7 @@ fi
HAVE_LSTAT=0
fi
if test $REPLACE_LSTAT = 1; then
if test $REPLACE_LSTAT = 1; then
@ -20938,7 +20942,7 @@ if test $REPLACE_LSTAT = 1; then
:
fi
fi
@ -21187,7 +21191,7 @@ $as_echo "$gl_cv_func_working_mktime" >&6; }
REPLACE_MKTIME=0
fi
if test $REPLACE_MKTIME = 1; then
if test $REPLACE_MKTIME = 1; then
@ -21198,10 +21202,8 @@ if test $REPLACE_MKTIME = 1; then
gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext"
fi
:
fi
@ -21256,7 +21258,7 @@ $as_echo "$gl_cv_sig_pselect" >&6; }
REPLACE_PSELECT=1
fi
if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then
if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then
@ -21267,7 +21269,7 @@ if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then
gl_LIBOBJS="$gl_LIBOBJS pselect.$ac_objext"
fi
fi
@ -21485,7 +21487,7 @@ $as_echo "#define PTHREAD_SIGMASK_UNBLOCK_BUG 1" >>confdefs.h
esac
fi
if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
@ -21503,7 +21505,7 @@ $as_echo "#define HAVE_PTHREAD_SIGMASK 1" >>confdefs.h
fi
fi
fi
@ -21606,7 +21608,7 @@ $as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
esac
fi
if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
@ -21620,7 +21622,7 @@ if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
:
fi
fi
@ -21734,7 +21736,7 @@ fi
ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
/* <sys/types.h> is not needed according to POSIX, but the
<sys/socket.h> in i386-unknown-freebsd4.10 and
powerpc-apple-darwin5.5 required it. */
@ -21834,7 +21836,6 @@ $as_echo "#define ssize_t int" >>confdefs.h
ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h>
#include <sys/stat.h>
"
@ -21930,7 +21931,6 @@ fi
ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h>
#include <sys/stat.h>
"
@ -22641,7 +22641,7 @@ $as_echo "$gl_cv_func_strtoimax" >&6; }
HAVE_STRTOIMAX=0
fi
if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
@ -22666,7 +22666,7 @@ _ACEOF
fi
fi
@ -22686,7 +22686,7 @@ fi
HAVE_DECL_STRTOUMAX=0
fi
if test $ac_cv_func_strtoumax = no; then
if test $ac_cv_func_strtoumax = no; then
@ -22711,7 +22711,7 @@ _ACEOF
fi
fi
@ -22783,7 +22783,7 @@ $as_echo "$gl_cv_func_symlink_works" >&6; }
esac
fi
if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
@ -22794,7 +22794,7 @@ if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
gl_LIBOBJS="$gl_LIBOBJS symlink.$ac_objext"
fi
fi
@ -23185,7 +23185,7 @@ $as_echo "$gl_cv_time_r_posix" >&6; }
HAVE_LOCALTIME_R=0
fi
if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
@ -23199,7 +23199,7 @@ if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
:
fi
fi
@ -23211,9 +23211,7 @@ fi
:
@ -23505,7 +23503,7 @@ $as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
;;
esac
if test $REPLACE_STAT = 1; then
if test $REPLACE_STAT = 1; then
@ -23520,7 +23518,7 @@ if test $REPLACE_STAT = 1; then
:
fi
fi
@ -23567,7 +23565,7 @@ done
fi
fi
if test $HAVE_STRTOLL = 0; then
if test $HAVE_STRTOLL = 0; then
@ -23581,7 +23579,7 @@ if test $HAVE_STRTOLL = 0; then
:
fi
fi
@ -23619,7 +23617,7 @@ done
fi
fi
if test $HAVE_STRTOULL = 0; then
if test $HAVE_STRTOULL = 0; then
@ -23633,7 +23631,7 @@ if test $HAVE_STRTOULL = 0; then
:
fi
fi
@ -24668,7 +24666,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by emacs $as_me 24.1.50, which was
This file was extended by emacs $as_me 24.2.50, which was
generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -24734,7 +24732,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
emacs config.status 24.1.50
emacs config.status 24.2.50
configured by $0, generated by GNU Autoconf 2.65,
with options \\"\$ac_cs_config\\"

View file

@ -2773,7 +2773,7 @@ AC_FUNC_GETPGRP
AC_CHECK_FUNCS(grantpt)
# PTY-related GNU extensions.
AC_CHECK_FUNCS(getpt)
AC_CHECK_FUNCS(getpt posix_openpt)
# Check this now, so that we will NOT find the above functions in ncurses.
# That is because we have not set up to link ncurses in lib-src.
@ -3397,6 +3397,7 @@ case $opsys in
AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
;;
dnl FIXME? Maybe use same as freebsd - see bug#12040.
darwin )
AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)])
dnl Not used, because PTY_ITERATION is defined.
@ -3409,11 +3410,11 @@ case $opsys in
AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
;;
gnu | freebsd | netbsd | openbsd )
gnu | openbsd )
AC_DEFINE(FIRST_PTY_LETTER, ['p'])
;;
gnu-linux | gnu-kfreebsd )
gnu-linux | gnu-kfreebsd | freebsd | netbsd )
dnl if HAVE_GRANTPT
if test "x$ac_cv_func_grantpt" = xyes; then
AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.])
@ -3421,8 +3422,12 @@ case $opsys in
dnl Note that grantpt and unlockpt may fork. We must block SIGCHLD
dnl to prevent sigchld_handler from intercepting the child's death.
AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname; sigblock (sigmask (SIGCHLD)); if (grantpt (fd) == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname(fd))) { sigunblock (sigmask (SIGCHLD)); close (fd); return -1; } snprintf (pty_name, sizeof pty_name, "%s", ptyname); sigunblock (sigmask (SIGCHLD)); }])
dnl if HAVE_POSIX_OPENPT
if test "x$ac_cv_func_posix_openpt" = xyes; then
AC_DEFINE(PTY_OPEN, [fd = posix_openpt (O_RDWR | O_NOCTTY)])
AC_DEFINE(PTY_NAME_SPRINTF, [])
dnl if HAVE_GETPT
if test "x$ac_cv_func_getpt" = xyes; then
elif test "x$ac_cv_func_getpt" = xyes; then
AC_DEFINE(PTY_OPEN, [fd = getpt ()])
AC_DEFINE(PTY_NAME_SPRINTF, [])
else

View file

@ -160,6 +160,10 @@ The PCL-CVS commands are still available via the keyboard.
* Editing Changes in Emacs 24.3
** New option `yank-handled-properties' allows processing of text
properties on yanked text, in more ways that are more general than
just removing them, as done by `yank-excluded-properties'.
** New option `delete-trailing-lines' specifies whether the M-x
delete-trailing-whitespace command should delete trailing lines at the
end of the buffer. It defaults to t.

View file

@ -1,3 +1,10 @@
2012-08-17 Daniel Bergey <bergey@alum.mit.edu> (tiny change)
* quail/indian.el (quail-define-inscript-package):
Set kbd-translate for all Inscript layouts. It's a positional
layout: vowels should be on the left hand regardless of the
underlying characters produced by those keys. (Bug#12072)
2012-08-06 Mohsen BANAN <libre@mohsen.1.banan.byname.net>
* quail/persian.el: Add some mappings. (Bug#11812)

View file

@ -309,7 +309,7 @@ Full key sequences are listed below:")
(defun quail-define-inscript-package (char-tables key-tables pkgname lang
title docstring)
(funcall 'quail-define-package pkgname lang title nil docstring
nil nil nil nil nil nil nil nil)
nil nil nil t nil nil nil nil)
(let (char-table key-table char key)
(while (and char-tables key-tables)
(setq char-table (car char-tables)

View file

@ -1,3 +1,12 @@
2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
Rely on <config.h> + <unistd.h> to declare 'environ'.
* emacsclient.c (environ): Remove decl.
2012-08-17 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
2012-08-15 Paul Eggert <eggert@cs.ucla.edu>
* etags.c (Pascal_functions): Fix parenthesization typo.

View file

@ -1584,11 +1584,6 @@ main (int argc, char **argv)
/* Send over our environment and current directory. */
if (!current_frame)
{
#ifndef WINDOWSNT
/* This is defined in stdlib.h on MS-Windows. It's defined in
unistd.h on some POSIX hosts, but not all (Bug#10155). */
extern char **environ;
#endif
int i;
for (i = 0; environ[i]; i++)
{

View file

@ -451,6 +451,7 @@ $(BLD)/profile.$(O) : \
$(BLD)/regex.$(O) : \
$(SRC)/regex.c \
$(SRC)/regex.h \
$(NT_INC)/stdbool.h \
$(NT_INC)/unistd.h \
$(CONFIG_H)

View file

@ -21,7 +21,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# 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-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 stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings
# 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
MOSTLYCLEANFILES += core *.stackdump

View file

@ -142,7 +142,7 @@ verify (twos_complement_arithmetic,
verify (base_year_is_a_multiple_of_100, TM_YEAR_BASE % 100 == 0);
/* Return 1 if YEAR + TM_YEAR_BASE is a leap year. */
static inline int
static int
leapyear (long_int year)
{
/* Don't add YEAR to TM_YEAR_BASE, as that might overflow.
@ -196,7 +196,7 @@ isdst_differ (int a, int b)
The result may overflow. It is the caller's responsibility to
detect overflow. */
static inline time_t
static time_t
ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1,
int year0, int yday0, int hour0, int min0, int sec0)
{

View file

@ -1,349 +0,0 @@
/* POSIX compatible signal blocking.
Copyright (C) 2006-2012 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
/* Specification. */
#include <signal.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
# include "msvc-inval.h"
#endif
/* We assume that a platform without POSIX signal blocking functions
also does not have the POSIX sigaction() function, only the
signal() function. We also assume signal() has SysV semantics,
where any handler is uninstalled prior to being invoked. This is
true for native Windows platforms. */
/* We use raw signal(), but also provide a wrapper rpl_signal() so
that applications can query or change a blocked signal. */
#undef signal
/* Provide invalid signal numbers as fallbacks if the uncatchable
signals are not defined. */
#ifndef SIGKILL
# define SIGKILL (-1)
#endif
#ifndef SIGSTOP
# define SIGSTOP (-1)
#endif
/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias
for the signal SIGABRT. Only one signal handler is stored for both
SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
# undef SIGABRT_COMPAT
# define SIGABRT_COMPAT 6
#endif
#ifdef SIGABRT_COMPAT
# define SIGABRT_COMPAT_MASK (1U << SIGABRT_COMPAT)
#else
# define SIGABRT_COMPAT_MASK 0
#endif
typedef void (*handler_t) (int);
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
static inline handler_t
signal_nothrow (int sig, handler_t handler)
{
handler_t result;
TRY_MSVC_INVAL
{
result = signal (sig, handler);
}
CATCH_MSVC_INVAL
{
result = SIG_ERR;
errno = EINVAL;
}
DONE_MSVC_INVAL;
return result;
}
# define signal signal_nothrow
#endif
/* Handling of gnulib defined signals. */
#if GNULIB_defined_SIGPIPE
static handler_t SIGPIPE_handler = SIG_DFL;
#endif
#if GNULIB_defined_SIGPIPE
static handler_t
ext_signal (int sig, handler_t handler)
{
switch (sig)
{
case SIGPIPE:
{
handler_t old_handler = SIGPIPE_handler;
SIGPIPE_handler = handler;
return old_handler;
}
default: /* System defined signal */
return signal (sig, handler);
}
}
# undef signal
# define signal ext_signal
#endif
int
sigismember (const sigset_t *set, int sig)
{
if (sig >= 0 && sig < NSIG)
{
#ifdef SIGABRT_COMPAT
if (sig == SIGABRT_COMPAT)
sig = SIGABRT;
#endif
return (*set >> sig) & 1;
}
else
return 0;
}
int
sigemptyset (sigset_t *set)
{
*set = 0;
return 0;
}
int
sigaddset (sigset_t *set, int sig)
{
if (sig >= 0 && sig < NSIG)
{
#ifdef SIGABRT_COMPAT
if (sig == SIGABRT_COMPAT)
sig = SIGABRT;
#endif
*set |= 1U << sig;
return 0;
}
else
{
errno = EINVAL;
return -1;
}
}
int
sigdelset (sigset_t *set, int sig)
{
if (sig >= 0 && sig < NSIG)
{
#ifdef SIGABRT_COMPAT
if (sig == SIGABRT_COMPAT)
sig = SIGABRT;
#endif
*set &= ~(1U << sig);
return 0;
}
else
{
errno = EINVAL;
return -1;
}
}
int
sigfillset (sigset_t *set)
{
*set = ((2U << (NSIG - 1)) - 1) & ~ SIGABRT_COMPAT_MASK;
return 0;
}
/* Set of currently blocked signals. */
static volatile sigset_t blocked_set /* = 0 */;
/* Set of currently blocked and pending signals. */
static volatile sig_atomic_t pending_array[NSIG] /* = { 0 } */;
/* Signal handler that is installed for blocked signals. */
static void
blocked_handler (int sig)
{
/* Reinstall the handler, in case the signal occurs multiple times
while blocked. There is an inherent race where an asynchronous
signal in between when the kernel uninstalled the handler and
when we reinstall it will trigger the default handler; oh
well. */
signal (sig, blocked_handler);
if (sig >= 0 && sig < NSIG)
pending_array[sig] = 1;
}
int
sigpending (sigset_t *set)
{
sigset_t pending = 0;
int sig;
for (sig = 0; sig < NSIG; sig++)
if (pending_array[sig])
pending |= 1U << sig;
*set = pending;
return 0;
}
/* The previous signal handlers.
Only the array elements corresponding to blocked signals are relevant. */
static volatile handler_t old_handlers[NSIG];
int
sigprocmask (int operation, const sigset_t *set, sigset_t *old_set)
{
if (old_set != NULL)
*old_set = blocked_set;
if (set != NULL)
{
sigset_t new_blocked_set;
sigset_t to_unblock;
sigset_t to_block;
switch (operation)
{
case SIG_BLOCK:
new_blocked_set = blocked_set | *set;
break;
case SIG_SETMASK:
new_blocked_set = *set;
break;
case SIG_UNBLOCK:
new_blocked_set = blocked_set & ~*set;
break;
default:
errno = EINVAL;
return -1;
}
to_unblock = blocked_set & ~new_blocked_set;
to_block = new_blocked_set & ~blocked_set;
if (to_block != 0)
{
int sig;
for (sig = 0; sig < NSIG; sig++)
if ((to_block >> sig) & 1)
{
pending_array[sig] = 0;
if ((old_handlers[sig] = signal (sig, blocked_handler)) != SIG_ERR)
blocked_set |= 1U << sig;
}
}
if (to_unblock != 0)
{
sig_atomic_t received[NSIG];
int sig;
for (sig = 0; sig < NSIG; sig++)
if ((to_unblock >> sig) & 1)
{
if (signal (sig, old_handlers[sig]) != blocked_handler)
/* The application changed a signal handler while the signal
was blocked, bypassing our rpl_signal replacement.
We don't support this. */
abort ();
received[sig] = pending_array[sig];
blocked_set &= ~(1U << sig);
pending_array[sig] = 0;
}
else
received[sig] = 0;
for (sig = 0; sig < NSIG; sig++)
if (received[sig])
raise (sig);
}
}
return 0;
}
/* Install the handler FUNC for signal SIG, and return the previous
handler. */
handler_t
rpl_signal (int sig, handler_t handler)
{
/* We must provide a wrapper, so that a user can query what handler
they installed even if that signal is currently blocked. */
if (sig >= 0 && sig < NSIG && sig != SIGKILL && sig != SIGSTOP
&& handler != SIG_ERR)
{
#ifdef SIGABRT_COMPAT
if (sig == SIGABRT_COMPAT)
sig = SIGABRT;
#endif
if (blocked_set & (1U << sig))
{
/* POSIX states that sigprocmask and signal are both
async-signal-safe. This is not true of our
implementation - there is a slight data race where an
asynchronous interrupt on signal A can occur after we
install blocked_handler but before we have updated
old_handlers for signal B, such that handler A can see
stale information if it calls signal(B). Oh well -
signal handlers really shouldn't try to manipulate the
installed handlers of unrelated signals. */
handler_t result = old_handlers[sig];
old_handlers[sig] = handler;
return result;
}
else
return signal (sig, handler);
}
else
{
errno = EINVAL;
return SIG_ERR;
}
}
#if GNULIB_defined_SIGPIPE
/* Raise the signal SIGPIPE. */
int
_gl_raise_SIGPIPE (void)
{
if (blocked_set & (1U << SIGPIPE))
pending_array[SIGPIPE] = 1;
else
{
handler_t handler = SIGPIPE_handler;
if (handler == SIG_DFL)
exit (128 + SIGPIPE);
else if (handler != SIG_IGN)
(*handler) (SIGPIPE);
}
return 0;
}
#endif

View file

@ -130,7 +130,7 @@
/* Re-define FD_ISSET to avoid a WSA call while we are not using
network sockets. */
static inline int
static int
rpl_fd_isset (SOCKET fd, fd_set * set)
{
u_int i;

View file

@ -1,3 +1,100 @@
2012-08-20 Chong Yidong <cyd@gnu.org>
* descr-text.el (describe-text-properties-1): Use overlays-in to
report on empty overlays (Bug#3322).
2012-08-20 Glenn Morris <rgm@gnu.org>
* mail/rmailout.el (rmail-output-read-file-name):
Trap and report errors in rmail-output-file-alist elements.
* font-lock.el (font-lock-add-keywords): Doc fix (quote face names
since most non-font-lock faces are not also variables).
2012-08-20 Edward Reingold <reingold@iit.edu>
* calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance):
New function. (Bug12160)
2012-08-19 Glenn Morris <rgm@gnu.org>
* mail/rmailout.el (rmail-output-read-file-name):
Fix previous change (when the alist is nil or does not match).
2012-08-19 Chong Yidong <cyd@gnu.org>
* xml.el (xml-escape-string): Don't refer to xml-entity-alist
(Bug#12228).
2012-08-18 Chong Yidong <cyd@gnu.org>
* simple.el (yank-handled-properties): New defcustom.
(yank-excluded-properties): Add font-lock-face and category.
(yank): Doc fix.
* subr.el (remove-yank-excluded-properties): Obey
yank-handled-properties. The special handling of font-lock-face
and category is now done this way, instead of being hard-coded.
(insert-for-yank-1): Remove font-lock-face handling.
(yank-handle-font-lock-face-property)
(yank-handle-category-property): New function.
2012-08-17 Glenn Morris <rgm@gnu.org>
* mail/rmailout.el (rmail-output-read-file-name):
Check rmail-output-file-alist against the full message body
in the correct rmail buffer. (Bug#12214)
2012-08-17 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-sh-handle-start-file-process): Eliminate
superfluous prompt. (Bug#12203)
2012-08-17 Chong Yidong <cyd@gnu.org>
* mouse.el (mouse-appearance-menu): If x-select-font returns a
font spec, set the font directly (Bug#3228).
2012-08-17 Martin Rudalics <rudalics@gmx.at>
* window.el (delete-window): Fix last fix.
2012-08-16 Martin Rudalics <rudalics@gmx.at>
* window.el (window-valid-p): Move to window.c.
(window-child, window-child-count, window-last-child)
(window-normalize-window, window-combined-p)
(window-combinations, window-atom-root, window-min-size)
(window-sizable, window-sizable-p, window-size-fixed-p)
(window-min-delta, window-max-delta, window--resizable)
(window--resizable-p, window-resizable, window-total-size)
(window-full-height-p, window-full-width-p, window-body-size)
(window-at-side-p, adjust-window-trailing-edge, maximize-window)
(minimize-window, window-deletable-p, delete-window)
(delete-other-windows, set-window-buffer-start-and-point)
(next-buffer, previous-buffer, split-window, balance-windows-2)
(set-window-text-height, window-buffer-height)
(fit-window-to-buffer, shrink-window-if-larger-than-buffer)
(truncated-partial-width-window-p): Minor code adjustments. In
doc-strings state whether the argument window has to denote a
live, valid or any window.
2012-08-16 Phil Sainty <psainty@orcon.net.nz> (tiny change)
* progmodes/subword.el (subword-forward-function)
(subword-backward-function, subword-forward-regexp)
(subword-backward-regexp): New variables.
(subword-forward, subword-forward-internal, subword-backward-internal):
Use new variables, eg so that different "word" definitions
can be easily used. (Bug#11411)
2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
* vc/vc-mtn.el (vc-mtn-revision-completion-table): Handle completion
for composite selectors.
* vc/vc.el (vc-diff-build-argument-list-internal): Don't prevent
operation just because we can't find a previous revision.
2012-08-15 Chong Yidong <cyd@gnu.org>
* frame.el (set-frame-font): Accept font objects.

View file

@ -1009,6 +1009,168 @@ shown are hard-coded to 8-12, 13-17."
(cal-tex-e-framebox)
(cal-tex-hspace "1cm")))
(defun cal-tex-cursor-week-at-a-glance (&optional n event)
"One-week-at-a-glance full page calendar for week indicated by cursor.
Optional prefix argument N specifies number of weeks (default 1),
starting on Mondays. The calendar shows holiday and diary entries
if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
It does not show hours of the day. Optional EVENT indicates a buffer
position to use instead of point."
(interactive (list (prefix-numeric-value current-prefix-arg)
last-nonmenu-event))
(or n (setq n 1))
(let* ((date (calendar-gregorian-from-absolute
(calendar-dayname-on-or-before
1
(calendar-absolute-from-gregorian
(calendar-cursor-to-date t event)))))
(month (calendar-extract-month date))
(year (calendar-extract-year date))
(day (calendar-extract-day date))
(d1 (calendar-absolute-from-gregorian date))
(d2 (+ (* 7 n) d1))
(holidays (if cal-tex-holidays
(holiday-in-range d1 d2)))
(diary-list (if cal-tex-diary
(cal-tex-list-diary-entries d1 d2))))
(cal-tex-preamble "twoside,12pt")
(cal-tex-cmd "\\usepackage{color}")
(cal-tex-cmd "\\textwidth 7in")
(cal-tex-cmd "\\textheight 10.5in")
(cal-tex-cmd "\\oddsidemargin 0in")
(cal-tex-cmd "\\evensidemargin 0in")
(cal-tex-cmd "\\topmargin 0pt")
(cal-tex-cmd "\\headheight -0.875in")
(cal-tex-cmd "\\headsep 0.125in")
(cal-tex-cmd "\\footskip .125in")
(insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}
\\long\\def\\rightday#1#2#3#4#5{%
\\rule{\\textwidth}{0.3pt}\\\\%
\\hbox to \\textwidth{%
\\vbox to 2.75in{%
\\vspace*{2pt}%
\\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%
\\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em \\textcolor{red}{#4}}}%
\\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\}
\\long\\def\\weekend#1#2#3#4#5{%
\\rule{\\textwidth}{0.3pt}\\\\%
\\hbox to \\textwidth{%
\\vbox to 1.8in{%
\\vspace*{2pt}%
\\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%
\\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em \\textcolor{red}{#4}}}%
\\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\}
\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]}
\\long\\def\\leftday#1#2#3#4#5{%
\\rule{\\textwidth}{0.3pt}\\\\%
\\hbox to \\textwidth{%
\\vbox to 2.75in{%
\\vspace*{2pt}%
\\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}%
\\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em \\textcolor{red}{#4}}}%
\\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\}
")
(cal-tex-b-document)
(cal-tex-cmd "\\pagestyle{empty}\\ ")
(cal-tex-newpage)
(dotimes (i n)
(insert "\\lefthead")
(cal-tex-arg
(let ((d (cal-tex-incr-date date 2)))
(if (= (calendar-extract-month date)
(calendar-extract-month d))
(format "%s %s"
(cal-tex-month-name (calendar-extract-month date))
(calendar-extract-year date))
(if (= (calendar-extract-year date)
(calendar-extract-year d))
(format "%s---%s %s"
(cal-tex-month-name (calendar-extract-month date))
(cal-tex-month-name (calendar-extract-month d))
(calendar-extract-year date))
(format "%s %s---%s %s"
(cal-tex-month-name (calendar-extract-month date))
(calendar-extract-year date)
(cal-tex-month-name (calendar-extract-month d))
(calendar-extract-year d))))))
(insert "%\n")
(dotimes (_jdummy 3)
(insert "\\leftday")
(cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
(cal-tex-arg (number-to-string (calendar-extract-day date)))
(cal-tex-arg (cal-tex-latexify-list diary-list date))
(cal-tex-arg (cal-tex-latexify-list holidays date))
(cal-tex-arg (eval cal-tex-daily-string))
(insert "%\n")
(setq date (cal-tex-incr-date date)))
(insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")
(cal-tex-nl)
(insert (cal-tex-mini-calendar
(calendar-extract-month (cal-tex-previous-month date))
(calendar-extract-year (cal-tex-previous-month date))
"lastmonth" "1.1in" "1in"))
(insert (cal-tex-mini-calendar
(calendar-extract-month date)
(calendar-extract-year date)
"thismonth" "1.1in" "1in"))
(insert (cal-tex-mini-calendar
(calendar-extract-month (cal-tex-next-month date))
(calendar-extract-year (cal-tex-next-month date))
"nextmonth" "1.1in" "1in"))
(insert "\\hbox to \\textwidth{")
(cal-tex-hfill)
(insert "\\lastmonth")
(cal-tex-hfill)
(insert "\\thismonth")
(cal-tex-hfill)
(insert "\\nextmonth")
(cal-tex-hfill)
(insert "}")
(cal-tex-newpage)
(insert "\\righthead")
(cal-tex-arg
(let ((d (cal-tex-incr-date date 3)))
(if (= (calendar-extract-month date)
(calendar-extract-month d))
(format "%s %s"
(cal-tex-month-name (calendar-extract-month date))
(calendar-extract-year date))
(if (= (calendar-extract-year date)
(calendar-extract-year d))
(format "%s---%s %s"
(cal-tex-month-name (calendar-extract-month date))
(cal-tex-month-name (calendar-extract-month d))
(calendar-extract-year date))
(format "%s %s---%s %s"
(cal-tex-month-name (calendar-extract-month date))
(calendar-extract-year date)
(cal-tex-month-name (calendar-extract-month d))
(calendar-extract-year d))))))
(insert "%\n")
(dotimes (_jdummy 2)
(insert "\\rightday")
(cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
(cal-tex-arg (number-to-string (calendar-extract-day date)))
(cal-tex-arg (cal-tex-latexify-list diary-list date))
(cal-tex-arg (cal-tex-latexify-list holidays date))
(cal-tex-arg (eval cal-tex-daily-string))
(insert "%\n")
(setq date (cal-tex-incr-date date)))
(dotimes (_jdummy 2)
(insert "\\weekend")
(cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
(cal-tex-arg (number-to-string (calendar-extract-day date)))
(cal-tex-arg (cal-tex-latexify-list diary-list date))
(cal-tex-arg (cal-tex-latexify-list holidays date))
(cal-tex-arg (eval cal-tex-daily-string))
(insert "%\n")
(setq date (cal-tex-incr-date date)))
(unless (= i (1- n))
(run-hooks 'cal-tex-week-hook)
(cal-tex-newpage)))
(cal-tex-end-document)
(run-hooks 'cal-tex-hook)))
;;;###cal-autoload
(defun cal-tex-cursor-filofax-2week (&optional n event)
"Two-weeks-at-a-glance Filofax style calendar for week cursor is in.

View file

@ -140,7 +140,7 @@ otherwise."
(defun describe-text-properties-1 (pos output-buffer)
(let* ((properties (text-properties-at pos))
(overlays (overlays-at pos))
(overlays (overlays-in pos (1+ pos)))
(wid-field (get-char-property pos 'field))
(wid-button (get-char-property pos 'button))
(wid-doc (get-char-property pos 'widget-doc))

View file

@ -146,8 +146,8 @@
;; fontified automagically. In your ~/.emacs there could be:
;;
;; (defvar foo-font-lock-keywords
;; '(("\\<\\(one\\|two\\|three\\)\\>" . font-lock-keyword-face)
;; ("\\<\\(four\\|five\\|six\\)\\>" . font-lock-type-face))
;; '(("\\<\\(one\\|two\\|three\\)\\>" . 'font-lock-keyword-face)
;; ("\\<\\(four\\|five\\|six\\)\\>" . 'font-lock-type-face))
;; "Default expressions to highlight in Foo mode.")
;;
;; (add-hook 'foo-mode-hook
@ -167,8 +167,8 @@
;; could be:
;;
;; (defvar bar-font-lock-keywords
;; '(("\\<\\(uno\\|due\\|tre\\)\\>" . font-lock-keyword-face)
;; ("\\<\\(quattro\\|cinque\\|sei\\)\\>" . font-lock-type-face))
;; '(("\\<\\(uno\\|due\\|tre\\)\\>" . 'font-lock-keyword-face)
;; ("\\<\\(quattro\\|cinque\\|sei\\)\\>" . 'font-lock-type-face))
;; "Default expressions to highlight in Bar mode.")
;;
;; and within `bar-mode' there could be:
@ -679,8 +679,8 @@ end of the current highlighting list.
For example:
(font-lock-add-keywords 'c-mode
'((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 font-lock-warning-face prepend)
(\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . font-lock-keyword-face)))
'((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 'font-lock-warning-face prepend)
(\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . 'font-lock-keyword-face)))
adds two fontification patterns for C mode, to fontify `FIXME:' words, even in
comments, and to fontify `and', `or' and `not' words as keywords.
@ -694,9 +694,9 @@ For example:
(add-hook 'c-mode-hook
(lambda ()
(font-lock-add-keywords nil
'((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 font-lock-warning-face prepend)
'((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 'font-lock-warning-face prepend)
(\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" .
font-lock-keyword-face)))))
'font-lock-keyword-face)))))
The above procedure may fail to add keywords to derived modes if
some involved major mode does not follow the standard conventions.

View file

@ -663,6 +663,7 @@ Element N specifies the summary line for message N+1.")
(defvar rmail-last-regexp nil)
(put 'rmail-last-regexp 'permanent-local t)
;; Note that rmail-output-read-file-name modifies this.
(defcustom rmail-default-file "~/xmail"
"Default file name for \\[rmail-output]."
:type 'file

View file

@ -34,7 +34,6 @@
:type 'boolean
:group 'rmail-output)
;; FIXME risky?
(defcustom rmail-output-file-alist nil
"Alist matching regexps to suggested output Rmail files.
This is a list of elements of the form (REGEXP . NAME-EXP).
@ -47,6 +46,7 @@ a file name as a string."
(string :tag "File Name")
sexp)))
:group 'rmail-output)
;; This is risky because NAME-EXP gets evalled.
;;;###autoload(put 'rmail-output-file-alist 'risky-local-variable t)
(defcustom rmail-fields-not-to-output nil
@ -58,35 +58,57 @@ The function `rmail-delete-unwanted-fields' uses this, ignoring case."
(defun rmail-output-read-file-name ()
"Read the file name to use for `rmail-output'.
Set `rmail-default-file' to this name as well as returning it."
(let ((default-file
(let (answer tail)
(setq tail rmail-output-file-alist)
;; Suggest a file based on a pattern match.
(while (and tail (not answer))
(save-excursion
(goto-char (point-min))
(if (re-search-forward (car (car tail)) nil t)
(setq answer (eval (cdr (car tail)))))
(setq tail (cdr tail))))
Set `rmail-default-file' to this name as well as returning it.
This uses `rmail-output-file-alist'."
(let* ((default-file
(or
(when rmail-output-file-alist
(or rmail-buffer (error "There is no Rmail buffer"))
(save-current-buffer
(set-buffer rmail-buffer)
(let ((beg (rmail-msgbeg rmail-current-message))
(end (rmail-msgend rmail-current-message)))
(if (rmail-buffers-swapped-p) (set-buffer rmail-view-buffer))
(save-excursion
(save-restriction
(widen)
(narrow-to-region beg end)
(let ((tail rmail-output-file-alist)
answer err)
;; Suggest a file based on a pattern match.
(while (and tail (not answer))
(goto-char (point-min))
(if (re-search-forward (caar tail) nil t)
(setq answer
(condition-case err
(eval (cdar tail))
(error
(display-warning
:error
(format "Error evaluating \
`rmail-output-file-alist' element:\nregexp: %s\naction: %s\nerror: %S\n"
(caar tail) (cdar tail) err))
nil))))
(setq tail (cdr tail)))
answer))))))
;; If no suggestion, use same file as last time.
(or answer rmail-default-file))))
(let ((read-file
(expand-file-name
(read-file-name
(concat "Output message to mail file (default "
(file-name-nondirectory default-file)
"): ")
(file-name-directory default-file)
(abbreviate-file-name default-file))
(file-name-directory default-file))))
(setq rmail-default-file
(if (file-directory-p read-file)
(expand-file-name (file-name-nondirectory default-file)
read-file)
(expand-file-name
(or read-file (file-name-nondirectory default-file))
(file-name-directory default-file)))))))
rmail-default-file))
(read-file
(expand-file-name
(read-file-name
(concat "Output message to mail file (default "
(file-name-nondirectory default-file)
"): ")
(file-name-directory default-file)
(abbreviate-file-name default-file))
(file-name-directory default-file))))
(setq rmail-default-file
(if (file-directory-p read-file)
(expand-file-name (file-name-nondirectory default-file)
read-file)
(expand-file-name
(or read-file (file-name-nondirectory default-file))
(file-name-directory default-file))))))
(defun rmail-delete-unwanted-fields (preserve)
"Delete all headers matching `rmail-fields-not-to-output'.

View file

@ -1951,12 +1951,14 @@ choose a font."
(choice
;; Either choice == 'x-select-font, or choice is a
;; symbol whose name is a font.
(buffer-face-mode-invoke (font-face-attributes
(if (eq choice 'x-select-font)
(x-select-font)
(symbol-name choice)))
t
(called-interactively-p 'interactive))))))))
(let ((font (if (eq choice 'x-select-font)
(x-select-font)
(symbol-name choice))))
(buffer-face-mode-invoke
(if (fontp font 'font-spec)
(list :font font)
(font-face-attributes font))
t (called-interactively-p 'interactive)))))))))
;;; Bindings for mouse commands.

View file

@ -2738,51 +2738,64 @@ the result will be a local, non-Tramp, filename."
(bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
(name1 name)
(i 0))
(unwind-protect
(save-excursion
(save-restriction
(unless buffer
;; BUFFER can be nil. We use a temporary buffer.
(setq buffer (generate-new-buffer tramp-temp-buffer-name)))
(while (get-process name1)
;; NAME must be unique as process name.
(setq i (1+ i)
name1 (format "%s<%d>" name i)))
(setq name name1)
;; Set the new process properties.
(tramp-set-connection-property v "process-name" name)
(tramp-set-connection-property v "process-buffer" buffer)
;; Activate narrowing in order to save BUFFER contents.
;; Clear also the modification time; otherwise we might
;; be interrupted by `verify-visited-file-modtime'.
(with-current-buffer (tramp-get-connection-buffer v)
(let ((buffer-undo-list t))
(unless buffer
;; BUFFER can be nil. We use a temporary buffer.
(setq buffer (generate-new-buffer tramp-temp-buffer-name)))
(while (get-process name1)
;; NAME must be unique as process name.
(setq i (1+ i)
name1 (format "%s<%d>" name i)))
(setq name name1)
;; Set the new process properties.
(tramp-set-connection-property v "process-name" name)
(tramp-set-connection-property v "process-buffer" buffer)
(with-current-buffer (tramp-get-connection-buffer v)
(unwind-protect
(save-excursion
(save-restriction
;; Activate narrowing in order to save BUFFER
;; contents. Clear also the modification time;
;; otherwise we might be interrupted by
;; `verify-visited-file-modtime'.
(let ((buffer-undo-list t)
(buffer-read-only nil)
(mark (point)))
(clear-visited-file-modtime)
(narrow-to-region (point-max) (point-max))
;; We call `tramp-maybe-open-connection', in order
;; to cleanup the prompt afterwards.
(tramp-maybe-open-connection v)
(widen)
(delete-region mark (point))
(narrow-to-region (point-max) (point-max))
;; Now do it.
(if command
;; Send the command.
(tramp-send-command v command nil t) ; nooutput
;; Check, whether a pty is associated.
(tramp-maybe-open-connection v)
(unless (tramp-compat-process-get
(tramp-get-connection-process v) 'remote-tty)
(tramp-error
v 'file-error
"pty association is not supported for `%s'" name)))))
(let ((p (tramp-get-connection-process v)))
;; Set query flag for this process.
(tramp-compat-set-process-query-on-exit-flag p t)
;; Return process.
p)))
;; Save exit.
(with-current-buffer (tramp-get-connection-buffer v)
"pty association is not supported for `%s'" name))))
(let ((p (tramp-get-connection-process v)))
;; Set query flag for this process. We ignore errors,
;; because the process could have finished already.
(ignore-errors
(tramp-compat-set-process-query-on-exit-flag p t))
;; Return process.
p)))
;; Save exit.
(if (string-match tramp-temp-buffer-name (buffer-name))
(progn
(set-process-buffer (tramp-get-connection-process v) nil)
(kill-buffer (current-buffer)))
(set-buffer-modified-p bmp)))
(tramp-set-connection-property v "process-name" nil)
(tramp-set-connection-property v "process-buffer" nil)))))
(set-buffer-modified-p bmp))
(tramp-set-connection-property v "process-name" nil)
(tramp-set-connection-property v "process-buffer" nil))))))
(defun tramp-sh-handle-process-file
(program &optional infile destination display &rest args)

View file

@ -80,6 +80,20 @@
;;; Code:
(defvar subword-forward-function 'subword-forward-internal
"Function to call for forward subword movement.")
(defvar subword-backward-function 'subword-backward-internal
"Function to call for backward subword movement.")
(defvar subword-forward-regexp
"\\W*\\(\\([[:upper:]]*\\W?\\)[[:lower:][:digit:]]*\\)"
"Regexp used by `subword-forward-internal'.")
(defvar subword-backward-regexp
"\\(\\(\\W\\|[[:lower:][:digit:]]\\)\\([[:upper:]]+\\W*\\)\\|\\W\\w+\\)"
"Regexp used by `subword-backward-internal'.")
(defvar subword-mode-map
(let ((map (make-sparse-keymap)))
(dolist (cmd '(forward-word backward-word mark-word kill-word
@ -138,10 +152,10 @@ Optional argument ARG is the same as for `forward-word'."
(cond
((< 0 arg)
(dotimes (i arg (point))
(subword-forward-internal)))
(funcall subword-forward-function)))
((> 0 arg)
(dotimes (i (- arg) (point))
(subword-backward-internal)))
(funcall subword-backward-function)))
(t
(point))))
@ -249,9 +263,7 @@ Optional argument ARG is the same as for `capitalize-word'."
(if (and
(save-excursion
(let ((case-fold-search nil))
(re-search-forward
(concat "\\W*\\(\\([[:upper:]]*\\W?\\)[[:lower:][:digit:]]*\\)")
nil t)))
(re-search-forward subword-forward-regexp nil t)))
(> (match-end 0) (point)))
(goto-char
(cond
@ -265,11 +277,7 @@ Optional argument ARG is the same as for `capitalize-word'."
(defun subword-backward-internal ()
(if (save-excursion
(let ((case-fold-search nil))
(re-search-backward
(concat
"\\(\\(\\W\\|[[:lower:][:digit:]]\\)\\([[:upper:]]+\\W*\\)"
"\\|\\W\\w+\\)")
nil t)))
(re-search-backward subword-backward-regexp nil t)))
(goto-char
(cond
((and (match-end 3)

View file

@ -3474,16 +3474,36 @@ The argument is used for internal purposes; do not supply one."
;; Yanking.
(defcustom yank-handled-properties
'((font-lock-face . yank-handle-font-lock-face-property)
(category . yank-handle-category-property))
"List of special text property handling conditions for yanking.
Each element should have the form (PROP . FUN), where PROP is a
property symbol and FUN is a function. When the `yank' command
inserts text into the buffer, it scans the inserted text for
stretches of text that have `eq' values of the text property
PROP; for each such stretch of text, FUN is called with three
arguments: the property's value in that text, and the start and
end positions of the text.
This is done prior to removing the properties specified by
`yank-excluded-properties'."
:group 'killing
:version "24.3")
;; This is actually used in subr.el but defcustom does not work there.
(defcustom yank-excluded-properties
'(read-only invisible intangible field mouse-face help-echo local-map keymap
yank-handler follow-link fontified)
'(category field follow-link fontified font-lock-face help-echo
intangible invisible keymap local-map mouse-face read-only
yank-handler)
"Text properties to discard when yanking.
The value should be a list of text properties to discard or t,
which means to discard all text properties."
which means to discard all text properties.
See also `yank-handled-properties'."
:type '(choice (const :tag "All" t) (repeat symbol))
:group 'killing
:version "22.1")
:version "24.3")
(defvar yank-window-start nil)
(defvar yank-undo-function nil
@ -3535,15 +3555,16 @@ doc string for `insert-for-yank-1', which see."
(defun yank (&optional arg)
"Reinsert (\"paste\") the last stretch of killed text.
More precisely, reinsert the stretch of killed text most recently
killed OR yanked. Put point at end, and set mark at beginning.
With just \\[universal-argument] as argument, same but put point at beginning (and mark at end).
With argument N, reinsert the Nth most recently killed stretch of killed
text.
More precisely, reinsert the most recent kill, which is the
stretch of killed text most recently killed OR yanked. Put point
at the end, and set mark at the beginning without activating it.
With just \\[universal-argument] as argument, put point at beginning, and mark at end.
With argument N, reinsert the Nth most recent kill.
When this command inserts killed text into the buffer, it honors
`yank-excluded-properties' and `yank-handler' as described in the
doc string for `insert-for-yank-1', which see.
When this command inserts text into the buffer, it honors the
`yank-handled-properties' and `yank-excluded-properties'
variables, and the `yank-handler' text property. See
`insert-for-yank-1' for details.
See also the command `yank-pop' (\\[yank-pop])."
(interactive "*P")

View file

@ -2805,35 +2805,24 @@ if it's an autoloaded macro."
;;;; Support for yanking and text properties.
(defvar yank-handled-properties)
(defvar yank-excluded-properties)
(defun remove-yank-excluded-properties (start end)
"Remove `yank-excluded-properties' between START and END positions.
Replaces `category' properties with their defined properties."
"Process text properties between START and END, inserted for a `yank'.
Perform the handling specified by `yank-handled-properties', then
remove properties specified by `yank-excluded-properties'."
(let ((inhibit-read-only t))
;; Replace any `category' property with the properties it stands
;; for. This is to remove `mouse-face' properties that are placed
;; on categories in *Help* buffers' buttons. See
;; http://lists.gnu.org/archive/html/emacs-devel/2002-04/msg00648.html
;; for the details.
(unless (memq yank-excluded-properties '(t nil))
(save-excursion
(goto-char start)
(while (< (point) end)
(let ((cat (get-text-property (point) 'category))
run-end)
(setq run-end
(next-single-property-change (point) 'category nil end))
(when cat
(let (run-end2 original)
(remove-list-of-text-properties (point) run-end '(category))
(while (< (point) run-end)
(setq run-end2 (next-property-change (point) nil run-end))
(setq original (text-properties-at (point)))
(set-text-properties (point) run-end2 (symbol-plist cat))
(add-text-properties (point) run-end2 original)
(goto-char run-end2))))
(goto-char run-end)))))
(dolist (handler yank-handled-properties)
(let ((prop (car handler))
(fun (cdr handler))
(run-start start))
(while (< run-start end)
(let ((value (get-text-property run-start prop))
(run-end (next-single-property-change
run-start prop nil end)))
(funcall fun value run-start run-end)
(setq run-start run-end)))))
(if (eq yank-excluded-properties t)
(set-text-properties start end nil)
(remove-list-of-text-properties start end yank-excluded-properties))))
@ -2851,29 +2840,31 @@ See `insert-for-yank-1' for more details."
(insert-for-yank-1 string))
(defun insert-for-yank-1 (string)
"Insert STRING at point, stripping some text properties.
"Insert STRING at point for the `yank' command.
This function is like `insert', except it honors the variables
`yank-handled-properties' and `yank-excluded-properties', and the
`yank-handler' text property.
Strip text properties from the inserted text according to
`yank-excluded-properties'. Otherwise just like (insert STRING).
Properties listed in `yank-handled-properties' are processed,
then those listed in `yank-excluded-properties' are discarded.
If STRING has a non-nil `yank-handler' property on the first character,
the normal insert behavior is modified in various ways. The value of
the yank-handler property must be a list with one to four elements
with the following format: (FUNCTION PARAM NOEXCLUDE UNDO).
When FUNCTION is present and non-nil, it is called instead of `insert'
to insert the string. FUNCTION takes one argument--the object to insert.
If PARAM is present and non-nil, it replaces STRING as the object
passed to FUNCTION (or `insert'); for example, if FUNCTION is
`yank-rectangle', PARAM may be a list of strings to insert as a
rectangle.
If NOEXCLUDE is present and non-nil, the normal removal of the
If STRING has a non-nil `yank-handler' property on its first
character, the normal insert behavior is altered. The value of
the `yank-handler' property must be a list of one to four
elements, of the form (FUNCTION PARAM NOEXCLUDE UNDO).
FUNCTION, if non-nil, should be a function of one argument, an
object to insert; it is called instead of `insert'.
PARAM, if present and non-nil, replaces STRING as the argument to
FUNCTION or `insert'; e.g. if FUNCTION is `yank-rectangle', PARAM
may be a list of strings to insert as a rectangle.
If NOEXCLUDE is present and non-nil, the normal removal of
`yank-excluded-properties' is not performed; instead FUNCTION is
responsible for removing those properties. This may be necessary
if FUNCTION adjusts point before or after inserting the object.
If UNDO is present and non-nil, it is a function that will be called
responsible for the removal. This may be necessary if FUNCTION
adjusts point before or after inserting the object.
UNDO, if present and non-nil, should be a function to be called
by `yank-pop' to undo the insertion of the current object. It is
called with two arguments, the start and end of the current region.
FUNCTION may set `yank-undo-function' to override the UNDO value."
given two arguments, the start and end of the region. FUNCTION
may set `yank-undo-function' to override UNDO."
(let* ((handler (and (stringp string)
(get-text-property 0 'yank-handler string)))
(param (or (nth 1 handler) string))
@ -2882,7 +2873,7 @@ If UNDO is present and non-nil, it is a function that will be called
end)
(setq yank-undo-function t)
(if (nth 0 handler) ;; FUNCTION
(if (nth 0 handler) ; FUNCTION
(funcall (car handler) param)
(insert param))
(setq end (point))
@ -2891,34 +2882,17 @@ If UNDO is present and non-nil, it is a function that will be called
;; following text property changes.
(setq inhibit-read-only t)
;; What should we do with `font-lock-face' properties?
(if font-lock-defaults
;; No, just wipe them.
(remove-list-of-text-properties opoint end '(font-lock-face))
;; Convert them to `face'.
(save-excursion
(goto-char opoint)
(while (< (point) end)
(let ((face (get-text-property (point) 'font-lock-face))
run-end)
(setq run-end
(next-single-property-change (point) 'font-lock-face nil end))
(when face
(remove-text-properties (point) run-end '(font-lock-face nil))
(put-text-property (point) run-end 'face face))
(goto-char run-end)))))
(unless (nth 2 handler) ;; NOEXCLUDE
(remove-yank-excluded-properties opoint (point)))
(unless (nth 2 handler) ; NOEXCLUDE
(remove-yank-excluded-properties opoint end))
;; If last inserted char has properties, mark them as rear-nonsticky.
(if (and (> end opoint)
(text-properties-at (1- end)))
(put-text-property (1- end) end 'rear-nonsticky t))
(if (eq yank-undo-function t) ;; not set by FUNCTION
(setq yank-undo-function (nth 3 handler))) ;; UNDO
(if (nth 4 handler) ;; COMMAND
(if (eq yank-undo-function t) ; not set by FUNCTION
(setq yank-undo-function (nth 3 handler))) ; UNDO
(if (nth 4 handler) ; COMMAND
(setq this-command (nth 4 handler)))))
(defun insert-buffer-substring-no-properties (buffer &optional start end)
@ -2944,6 +2918,27 @@ Strip text properties from the inserted text according to
(insert-buffer-substring buffer start end)
(remove-yank-excluded-properties opoint (point))))
(defun yank-handle-font-lock-face-property (face start end)
"If `font-lock-defaults' is nil, apply FACE as a `face' property.
START and END denote the start and end of the text to act on.
Do nothing if FACE is nil."
(and face
(null font-lock-defaults)
(put-text-property start end 'face face)))
;; This removes `mouse-face' properties in *Help* buffer buttons:
;; http://lists.gnu.org/archive/html/emacs-devel/2002-04/msg00648.html
(defun yank-handle-category-property (category start end)
"Apply property category CATEGORY's properties between START and END."
(when category
(let ((start2 start))
(while (< start2 end)
(let ((end2 (next-property-change start2 nil end))
(original (text-properties-at start2)))
(set-text-properties start2 end2 (symbol-plist category))
(add-text-properties start2 end2 original)
(setq start2 end2))))))
;;;; Synchronous shell commands.

View file

@ -305,29 +305,28 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
ids)))
(defun vc-mtn-revision-completion-table (_files)
;; TODO: Implement completion for selectors
;; TODO: Implement completion for composite selectors.
;; What about using `files'?!? --Stef
(lambda (string pred action)
(cond
;; Special chars for composite selectors.
((string-match ".*[^\\]\\(\\\\\\\\\\)*[/|;(]" string)
(completion-table-with-context (substring string 0 (match-end 0))
(vc-mtn-revision-completion-table nil)
(substring string (match-end 0))
pred action))
;; "Tag" selectors.
((string-match "\\`t:" string)
(complete-with-action action
(mapcar (lambda (tag) (concat "t:" tag))
(vc-mtn-list-tags))
string pred))
;; "Branch" selectors.
((string-match "\\`b:" string)
(complete-with-action action
(mapcar (lambda (tag) (concat "b:" tag))
(vc-mtn-list-branches))
string pred))
;; "Head" selectors. Not sure how they differ from "branch" selectors.
((string-match "\\`h:" string)
(complete-with-action action
(mapcar (lambda (tag) (concat "h:" tag))
(vc-mtn-list-branches))
string pred))
;; "Branch" or "Head" selectors.
((string-match "\\`[hb]:" string)
(let ((prefix (match-string 0 string)))
(complete-with-action action
(mapcar (lambda (tag) (concat prefix tag))
(vc-mtn-list-branches))
string pred)))
;; "ID" selectors.
((string-match "\\`i:" string)
(complete-with-action action
@ -339,7 +338,13 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(complete-with-action action
'("t:" "b:" "h:" "i:"
;; Completion not implemented for these.
"a:" "c:" "d:" "e:" "l:")
"c:" "a:" "k:" "d:" "m:" "e:" "l:" "i:" "p:"
;; These have no arg to complete.
"u:" "w:"
;; Selector functions.
"difference(" "lca(" "max(" "ancestors("
"descendants(" "parents(" "children("
"pick(")
string pred)))))

View file

@ -1652,8 +1652,9 @@ Return t if the buffer had changes, nil otherwise."
(setq rev1-default (vc-working-revision first)))
;; if the file is not locked, use last and previous revisions as defaults
(t
(setq rev1-default (vc-call-backend backend 'previous-revision first
(vc-working-revision first)))
(setq rev1-default (ignore-errors ;If `previous-revision' doesn't work.
(vc-call-backend backend 'previous-revision first
(vc-working-revision first))))
(when (string= rev1-default "") (setq rev1-default nil))
(setq rev2-default (vc-working-revision first))))
;; construct argument list

View file

@ -91,11 +91,13 @@ be any window."
(and window (window-parent window) (window-prev-sibling window)))
(defun window-child (window)
"Return WINDOW's first child window."
"Return WINDOW's first child window.
WINDOW can be any window."
(or (window-top-child window) (window-left-child window)))
(defun window-child-count (window)
"Return number of WINDOW's child windows."
"Return number of WINDOW's child windows.
WINDOW can be any window."
(let ((count 0))
(when (and (windowp window) (setq window (window-child window)))
(while window
@ -104,20 +106,13 @@ be any window."
count))
(defun window-last-child (window)
"Return last child window of WINDOW."
"Return last child window of WINDOW.
WINDOW can be any window."
(when (and (windowp window) (setq window (window-child window)))
(while (window-next-sibling window)
(setq window (window-next-sibling window))))
window)
(defun window-valid-p (object)
"Return t if OBJECT denotes a live window or internal window.
Otherwise, return nil; this includes the case where OBJECT is a
deleted window."
(and (windowp object)
(or (window-buffer object) (window-child object))
t))
(defun window-normalize-buffer (buffer-or-name)
"Return buffer specified by BUFFER-OR-NAME.
BUFFER-OR-NAME must be either a buffer or a string naming a live
@ -143,20 +138,22 @@ FRAME must be a live frame and defaults to the selected frame."
(selected-frame)))
(defun window-normalize-window (window &optional live-only)
"Return window specified by WINDOW.
If WINDOW is nil, return `selected-window'.
If WINDOW is a live window or internal window, return WINDOW;
if LIVE-ONLY is non-nil, return WINDOW for a live window only.
"Return the window specified by WINDOW.
If WINDOW is nil, return the selected window. Otherwise, if
WINDOW is a live or an internal window, return WINDOW; if
LIVE-ONLY is non-nil, return WINDOW for a live window only.
Otherwise, signal an error."
(cond ((null window)
(selected-window))
(live-only
(if (window-live-p window)
window
(error "%s is not a live window" window)))
((if (window-valid-p window)
window
(error "%s is not a window" window)))))
(cond
((null window)
(selected-window))
(live-only
(if (window-live-p window)
window
(error "%s is not a live window" window)))
((window-valid-p window)
window)
(t
(error "%s is not a valid window" window))))
(defvar ignore-window-parameters nil
"If non-nil, standard functions ignore window parameters.
@ -207,7 +204,7 @@ narrower, explicitly specify the SIZE argument of that function."
(defun window-combined-p (&optional window horizontal)
"Return non-nil if WINDOW has siblings in a given direction.
If WINDOW is omitted or nil, it defaults to the selected window.
WINDOW must be a valid window and defaults to the selected one.
HORIZONTAL determines a direction for the window combination.
If HORIZONTAL is omitted or nil, return non-nil if WINDOW is part
@ -223,7 +220,7 @@ horizontal window combination."
(defun window-combinations (window &optional horizontal)
"Return largest number of windows vertically arranged within WINDOW.
If WINDOW is omitted or nil, it defaults to the selected window.
WINDOW must be a valid window and defaults to the selected one.
If HORIZONTAL is non-nil, return the largest number of
windows horizontally arranged within WINDOW."
(setq window (window-normalize-window window))
@ -321,7 +318,7 @@ too."
;;; Atomic windows.
(defun window-atom-root (&optional window)
"Return root of atomic window WINDOW is a part of.
WINDOW can be any window and defaults to the selected one.
WINDOW must be a valid window and defaults to the selected one.
Return nil if WINDOW is not part of an atomic window."
(setq window (window-normalize-window window))
(let (root)
@ -525,10 +522,10 @@ window).")
(defun window-min-size (&optional window horizontal ignore)
"Return the minimum size of WINDOW.
WINDOW can be an arbitrary window and defaults to the selected
one. Optional argument HORIZONTAL non-nil means return the
minimum number of columns of WINDOW; otherwise return the minimum
number of WINDOW's lines.
WINDOW must be a valid window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return the minimum
number of columns of WINDOW; otherwise return the minimum number
of WINDOW's lines.
Optional argument IGNORE, if non-nil, means ignore restrictions
imposed by fixed size windows, `window-min-height' or
@ -608,6 +605,7 @@ means ignore all of the above restrictions for all windows."
(defun window-sizable (window delta &optional horizontal ignore)
"Return DELTA if DELTA lines can be added to WINDOW.
WINDOW must be a valid window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return DELTA if DELTA
columns can be added to WINDOW. A return value of zero means
that no lines (or columns) can be added to WINDOW.
@ -649,6 +647,7 @@ ignore all of the above restrictions for all windows."
(defun window-sizable-p (window delta &optional horizontal ignore)
"Return t if WINDOW can be resized by DELTA lines.
WINDOW must be a valid window and defaults to the selected one.
For the meaning of the arguments of this function see the
doc-string of `window-sizable'."
(setq window (window-normalize-window window))
@ -691,9 +690,9 @@ doc-string of `window-sizable'."
(defun window-size-fixed-p (&optional window horizontal)
"Return non-nil if WINDOW's height is fixed.
WINDOW can be an arbitrary window and defaults to the selected
window. Optional argument HORIZONTAL non-nil means return
non-nil if WINDOW's width is fixed.
WINDOW must be a valid window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return non-nil if
WINDOW's width is fixed.
If this function returns nil, this does not necessarily mean that
WINDOW can be resized in the desired direction. The function
@ -741,8 +740,8 @@ WINDOW can be resized in the desired direction. The function
(defun window-min-delta (&optional window horizontal ignore trail noup nodown)
"Return number of lines by which WINDOW can be shrunk.
WINDOW can be an arbitrary window and defaults to the selected
window. Return zero if WINDOW cannot be shrunk.
WINDOW must be a valid window and defaults to the selected one.
Return zero if WINDOW cannot be shrunk.
Optional argument HORIZONTAL non-nil means return number of
columns by which WINDOW can be shrunk.
@ -823,8 +822,8 @@ at least one other window can be enlarged appropriately."
(defun window-max-delta (&optional window horizontal ignore trail noup nodown)
"Return maximum number of lines by which WINDOW can be enlarged.
WINDOW can be an arbitrary window and defaults to the selected
window. The return value is zero if WINDOW cannot be enlarged.
WINDOW must be a valid window and defaults to the selected one.
The return value is zero if WINDOW cannot be enlarged.
Optional argument HORIZONTAL non-nil means return maximum number
of columns by which WINDOW can be enlarged.
@ -861,6 +860,7 @@ only whether other windows can be shrunk appropriately."
;; Make NOUP also inhibit the min-size check.
(defun window--resizable (window delta &optional horizontal ignore trail noup nodown)
"Return DELTA if WINDOW can be resized vertically by DELTA lines.
WINDOW must be a valid window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return DELTA if WINDOW
can be resized horizontally by DELTA columns. A return value of
zero means that WINDOW is not resizable.
@ -907,6 +907,7 @@ violate size restrictions of WINDOW or its child windows."
(defun window--resizable-p (window delta &optional horizontal ignore trail noup nodown)
"Return t if WINDOW can be resized vertically by DELTA lines.
WINDOW must be a valid window and defaults to the selected one.
For the meaning of the arguments of this function see the
doc-string of `window--resizable'."
(setq window (window-normalize-window window))
@ -918,6 +919,7 @@ doc-string of `window--resizable'."
(defun window-resizable (window delta &optional horizontal ignore)
"Return DELTA if WINDOW can be resized vertically by DELTA lines.
WINDOW must be a valid window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return DELTA if WINDOW
can be resized horizontally by DELTA columns. A return value of
zero means that WINDOW is not resizable.
@ -944,7 +946,7 @@ means ignore all of the above restrictions for all windows."
(defun window-total-size (&optional window horizontal)
"Return the total height or width of WINDOW.
If WINDOW is omitted or nil, it defaults to the selected window.
WINDOW must be a valid window and defaults to the selected one.
If HORIZONTAL is omitted or nil, return the total height of
WINDOW, in lines, like `window-total-height'. Otherwise return
@ -961,8 +963,8 @@ the total width, in columns, like `window-total-width'."
"Return t if WINDOW is as high as its containing frame.
More precisely, return t if and only if the total height of
WINDOW equals the total height of the root window of WINDOW's
frame. WINDOW can be any window and defaults to the selected
one."
frame. WINDOW must be a valid window and defaults to the
selected one."
(setq window (window-normalize-window window))
(= (window-total-size window)
(window-total-size (frame-root-window window))))
@ -971,15 +973,14 @@ one."
"Return t if WINDOW is as wide as its containing frame.
More precisely, return t if and only if the total width of WINDOW
equals the total width of the root window of WINDOW's frame.
WINDOW can be any window and defaults to the selected one."
WINDOW must be a valid window and defaults to the selected one."
(setq window (window-normalize-window window))
(= (window-total-size window t)
(window-total-size (frame-root-window window) t)))
(defun window-body-size (&optional window horizontal)
"Return the height or width of WINDOW's text area.
If WINDOW is omitted or nil, it defaults to the selected window.
Signal an error if the window is not live.
WINDOW must be a live window and defaults to the selected one.
If HORIZONTAL is omitted or nil, return the height of the text
area, like `window-body-height'. Otherwise, return the width of
@ -1089,9 +1090,9 @@ regardless of whether that buffer is current or not."
(defun window-at-side-p (&optional window side)
"Return t if WINDOW is at SIDE of its containing frame.
WINDOW can be any window and defaults to the selected one. SIDE
can be any of the symbols `left', `top', `right' or `bottom'.
The default value nil is handled like `bottom'."
WINDOW must be a valid window and defaults to the selected one.
SIDE can be any of the symbols `left', `top', `right' or
`bottom'. The default value nil is handled like `bottom'."
(setq window (window-normalize-window window))
(let ((edge
(cond
@ -2027,7 +2028,8 @@ any windows."
(defun adjust-window-trailing-edge (window delta &optional horizontal)
"Move WINDOW's bottom edge by DELTA lines.
Optional argument HORIZONTAL non-nil means move WINDOW's right
edge by DELTA columns. WINDOW defaults to the selected window.
edge by DELTA columns. WINDOW must be a valid window and
defaults to the selected one.
If DELTA is greater than zero, move the edge downwards or to the
right. If DELTA is less than zero, move the edge upwards or to
@ -2211,7 +2213,7 @@ Return nil."
(defun maximize-window (&optional window)
"Maximize WINDOW.
Make WINDOW as large as possible without deleting any windows.
WINDOW can be any window and defaults to the selected window."
WINDOW must be a valid window and defaults to the selected one."
(interactive)
(setq window (window-normalize-window window))
(window-resize window (window-max-delta window))
@ -2220,7 +2222,7 @@ WINDOW can be any window and defaults to the selected window."
(defun minimize-window (&optional window)
"Minimize WINDOW.
Make WINDOW as small as possible without deleting any windows.
WINDOW can be any window and defaults to the selected window."
WINDOW must be a valid window and defaults to the selected one."
(interactive)
(setq window (window-normalize-window window))
(window-resize window (- (window-min-delta window)))
@ -2376,8 +2378,8 @@ and no others."
;;; Deleting windows.
(defun window-deletable-p (&optional window)
"Return t if WINDOW can be safely deleted from its frame.
Return `frame' if deleting WINDOW should also delete its
frame."
WINDOW must be a valid window and defaults to the selected one.
Return `frame' if deleting WINDOW should also delete its frame."
(setq window (window-normalize-window window))
(unless ignore-window-parameters
@ -2415,8 +2417,8 @@ frame."
(defun delete-window (&optional window)
"Delete WINDOW.
WINDOW can be an arbitrary window and defaults to the selected
one. Return nil.
WINDOW must be a valid window and defaults to the selected one.
Return nil.
If the variable `ignore-window-parameters' is non-nil or the
`delete-window' parameter of WINDOW equals t, do not process any
@ -2427,8 +2429,9 @@ function.
Otherwise, if WINDOW is part of an atomic window, call
`delete-window' with the root of the atomic window as its
argument. If WINDOW is the only window on its frame or the last
non-side window, signal an error."
argument. Signal an error if WINDOW is either the only window on
its frame, the last non-side window, or part of an atomic window
that is its frame's root window."
(interactive)
(setq window (window-normalize-window window))
(let* ((frame (window-frame window))
@ -2495,7 +2498,7 @@ non-side window, signal an error."
(defun delete-other-windows (&optional window)
"Make WINDOW fill its frame.
WINDOW may be any window and defaults to the selected one.
WINDOW must be a valid window and defaults to the selected one.
Return nil.
If the variable `ignore-window-parameters' is non-nil or the
@ -2638,11 +2641,13 @@ WINDOW."
(defun set-window-buffer-start-and-point (window buffer &optional start point)
"Set WINDOW's buffer to BUFFER.
WINDOW must be a live window and defaults to the selected one.
Optional argument START non-nil means set WINDOW's start position
to START. Optional argument POINT non-nil means set WINDOW's
point to POINT. If WINDOW is selected this also sets BUFFER's
`point' to POINT. If WINDOW is selected and the buffer it showed
before was current this also makes BUFFER the current buffer."
(setq window (window-normalize-window window t))
(let ((selected (eq window (selected-window)))
(current (eq (window-buffer window) (current-buffer))))
(set-window-buffer window buffer)
@ -2956,16 +2961,24 @@ displayed there."
(defun next-buffer ()
"In selected window switch to next buffer."
(interactive)
(if (window-minibuffer-p)
(error "Cannot switch buffers in minibuffer window"))
(switch-to-next-buffer))
(cond
((window-minibuffer-p)
(error "Cannot switch buffers in minibuffer window"))
((eq (window-dedicated-p) t)
(error "Window is strongly dedicated to its buffer"))
(t
(switch-to-next-buffer))))
(defun previous-buffer ()
"In selected window switch to previous buffer."
(interactive)
(if (window-minibuffer-p)
(error "Cannot switch buffers in minibuffer window"))
(switch-to-prev-buffer))
(cond
((window-minibuffer-p)
(error "Cannot switch buffers in minibuffer window"))
((eq (window-dedicated-p) t)
(error "Window is strongly dedicated to its buffer"))
(t
(switch-to-prev-buffer))))
(defun delete-windows-on (&optional buffer-or-name frame)
"Delete all windows showing BUFFER-OR-NAME.
@ -3138,7 +3151,7 @@ Optional argument HORIZONTAL non-nil means return minimum width."
(defun split-window (&optional window size side)
"Make a new window adjacent to WINDOW.
WINDOW can be any window and defaults to the selected one.
WINDOW must be a valid window and defaults to the selected one.
Return the new window which is always a live window.
Optional argument SIZE a positive number means make WINDOW SIZE
@ -3459,7 +3472,7 @@ right, if any."
(defun balance-windows-2 (window horizontal)
"Subroutine of `balance-windows-1'.
WINDOW must be a vertical combination (horizontal if HORIZONTAL
is non-nil."
is non-nil)."
(let* ((first (window-child window))
(sub first)
(number-of-children 0)
@ -5187,9 +5200,9 @@ documentation for additional customization information."
(defun set-window-text-height (window height)
"Set the height in lines of the text display area of WINDOW to HEIGHT.
WINDOW must be a live window. HEIGHT doesn't include the mode
line or header line, if any, or any partial-height lines in the
text display area.
WINDOW must be a live window and defaults to the selected one.
HEIGHT doesn't include the mode line or header line, if any, or
any partial-height lines in the text display area.
Note that the current implementation of this function cannot
always set the height exactly, but attempts to be conservative,
@ -5256,7 +5269,9 @@ in some window."
(1+ (vertical-motion (buffer-size) window))))))
(defun window-buffer-height (window)
"Return the height (in screen lines) of the buffer that WINDOW is displaying."
"Return the height (in screen lines) of the buffer that WINDOW is displaying.
WINDOW must be a live window and defaults to the selected one."
(setq window (window-normalize-window window t))
(with-current-buffer (window-buffer window)
(max 1
(count-screen-lines (point-min) (point-max)
@ -5268,7 +5283,7 @@ in some window."
;;; Resizing buffers to fit their contents exactly.
(defun fit-window-to-buffer (&optional window max-height min-height override)
"Adjust height of WINDOW to display its buffer's contents exactly.
WINDOW can be any live window and defaults to the selected one.
WINDOW must be a live window and defaults to the selected one.
Optional argument MAX-HEIGHT specifies the maximum height of
WINDOW and defaults to the height of WINDOW's frame. Optional
@ -5387,7 +5402,7 @@ WINDOW defaults to the selected window."
"Shrink height of WINDOW if its buffer doesn't need so many lines.
More precisely, shrink WINDOW vertically to be as small as
possible, while still showing the full contents of its buffer.
WINDOW defaults to the selected window.
WINDOW must be a live window and defaults to the selected one.
Do not shrink WINDOW to less than `window-min-height' lines. Do
nothing if the buffer contains more lines than the present window
@ -5809,13 +5824,12 @@ is active. This function is run by `mouse-autoselect-window-timer'."
(defun truncated-partial-width-window-p (&optional window)
"Return non-nil if lines in WINDOW are specifically truncated due to its width.
WINDOW defaults to the selected window.
WINDOW must be a live window and defaults to the selected one.
Return nil if WINDOW is not a partial-width window
(regardless of the value of `truncate-lines').
Otherwise, consult the value of `truncate-partial-width-windows'
for the buffer shown in WINDOW."
(unless window
(setq window (selected-window)))
(setq window (window-normalize-window window t))
(unless (window-full-width-p window)
(let ((t-p-w-w (buffer-local-value 'truncate-partial-width-windows
(window-buffer window))))

View file

@ -1011,13 +1011,25 @@ The first line is indented with the optional INDENT-STRING."
(defalias 'xml-print 'xml-debug-print)
(defun xml-escape-string (string)
"Return STRING with entity substitutions made from `xml-entity-alist'."
(mapconcat (lambda (byte)
(let ((char (char-to-string byte)))
(if (rassoc char xml-entity-alist)
(concat "&" (car (rassoc char xml-entity-alist)) ";")
char)))
string ""))
"Convert STRING into a string containing valid XML character data.
Replace occurrences of &<>'\" in STRING with their default XML
entity references (e.g. replace each & with &amp;).
XML character data must not contain & or < characters, nor the >
character under some circumstances. The XML spec does not impose
restriction on \" or ', but we just substitute for these too
\(as is permitted by the spec)."
(with-temp-buffer
(insert string)
(dolist (substitution '(("&" . "&amp;")
("<" . "&lt;")
(">" . "&gt;")
("'" . "&apos;")
("\"" . "&quot;")))
(goto-char (point-min))
(while (search-forward (car substitution) nil t)
(replace-match (cdr substitution) t t nil)))
(buffer-string)))
(defun xml-debug-print-internal (xml indent-string)
"Outputs the XML tree in the current buffer.

View file

@ -1,3 +1,11 @@
2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
Use ASCII tests for character types.
* lwlib-Xaw.c, lwlib.c, xlwmenu.c:
Don't include <ctype.h>; no longer needed.
* lwlib-Xaw.c (openFont):
* xlwmenu.c (openXftFont): Test just for ASCII digits.
2012-08-01 Glenn Morris <rgm@gnu.org>
* Makefile.in (config_h): Add conf_post.h.

View file

@ -24,7 +24,6 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <setjmp.h>
#include <ctype.h>
#include <lisp.h>
@ -125,7 +124,7 @@ openFont (Widget widget, char *name)
XftFont *fn;
/* Try to convert Gtk-syntax (Sans 9) to Xft syntax Sans-9. */
while (i > 0 && isdigit (fname[i]))
while (i > 0 && '0' <= fname[i] && fname[i] <= '9')
--i;
if (fname[i] == ' ')
{

View file

@ -28,7 +28,6 @@ Boston, MA 02110-1301, USA. */
#include <sys/types.h>
#include <stdio.h>
#include <ctype.h>
#include "lwlib-int.h"
#include "lwlib-utils.h"
#include <X11/StringDefs.h>

View file

@ -28,7 +28,6 @@ Boston, MA 02110-1301, USA. */
#include <lisp.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
#if (defined __sun) && !(defined SUNOS41)
@ -1858,7 +1857,7 @@ openXftFont (XlwMenuWidget mw)
int screen = XScreenNumberOfScreen (mw->core.screen);
int len = strlen (fname), i = len-1;
/* Try to convert Gtk-syntax (Sans 9) to Xft syntax Sans-9. */
while (i > 0 && isdigit (fname[i]))
while (i > 0 && '0' <= fname[i] && fname[i] <= '9')
--i;
if (fname[i] == ' ')
{

View file

@ -136,135 +136,134 @@ AC_DEFUN([gl_INIT],
m4_pushdef([gl_LIBSOURCES_DIR], [])
gl_COMMON
gl_source_base='lib'
gl_FUNC_ALLOCA
AC_CHECK_FUNCS_ONCE([readlinkat])
gl_CLOCK_TIME
gl_MD5
gl_SHA1
gl_SHA256
gl_SHA512
AC_REQUIRE([gl_C99_STRTOLD])
gl_FUNC_DUP2
if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
AC_LIBOBJ([dup2])
gl_PREREQ_DUP2
fi
gl_UNISTD_MODULE_INDICATOR([dup2])
gl_ENVIRON
gl_UNISTD_MODULE_INDICATOR([environ])
AC_REQUIRE([gl_EXTERN_INLINE])
gl_FILEMODE
gl_GETLOADAVG
if test $HAVE_GETLOADAVG = 0; then
AC_LIBOBJ([getloadavg])
gl_PREREQ_GETLOADAVG
fi
gl_STDLIB_MODULE_INDICATOR([getloadavg])
gl_FUNC_GETOPT_GNU
if test $REPLACE_GETOPT = 1; then
AC_LIBOBJ([getopt])
AC_LIBOBJ([getopt1])
gl_PREREQ_GETOPT
dnl Arrange for unistd.h to include getopt.h.
GNULIB_GL_UNISTD_H_GETOPT=1
fi
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
gl_FUNC_GETOPT_POSIX
if test $REPLACE_GETOPT = 1; then
AC_LIBOBJ([getopt])
AC_LIBOBJ([getopt1])
gl_PREREQ_GETOPT
dnl Arrange for unistd.h to include getopt.h.
GNULIB_GL_UNISTD_H_GETOPT=1
fi
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
gl_GETTIME
gl_FUNC_GETTIMEOFDAY
if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
AC_LIBOBJ([gettimeofday])
gl_PREREQ_GETTIMEOFDAY
fi
gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
AC_REQUIRE([AC_C_INLINE])
gl_INTTYPES_INCOMPLETE
AC_REQUIRE([gl_LARGEFILE])
gl_FUNC_LSTAT
if test $REPLACE_LSTAT = 1; then
AC_LIBOBJ([lstat])
gl_PREREQ_LSTAT
fi
gl_SYS_STAT_MODULE_INDICATOR([lstat])
gl_FUNC_MKTIME
if test $REPLACE_MKTIME = 1; then
AC_LIBOBJ([mktime])
gl_PREREQ_MKTIME
fi
gl_TIME_MODULE_INDICATOR([mktime])
gl_MULTIARCH
gl_FUNC_PSELECT
if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then
AC_LIBOBJ([pselect])
fi
gl_SYS_SELECT_MODULE_INDICATOR([pselect])
gl_FUNC_PTHREAD_SIGMASK
if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
AC_LIBOBJ([pthread_sigmask])
gl_PREREQ_PTHREAD_SIGMASK
fi
gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
gl_FUNC_READLINK
if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
AC_LIBOBJ([readlink])
gl_PREREQ_READLINK
fi
gl_UNISTD_MODULE_INDICATOR([readlink])
gl_SIGNAL_H
gl_TYPE_SOCKLEN_T
gt_TYPE_SSIZE_T
gl_STAT_TIME
gl_STAT_BIRTHTIME
gl_STDALIGN_H
gl_STDARG_H
AM_STDBOOL_H
gl_STDDEF_H
gl_STDINT_H
gl_STDIO_H
gl_STDLIB_H
gl_FUNC_GNU_STRFTIME
gl_FUNC_STRTOIMAX
if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
AC_LIBOBJ([strtoimax])
gl_PREREQ_STRTOIMAX
fi
gl_INTTYPES_MODULE_INDICATOR([strtoimax])
gl_FUNC_STRTOUMAX
if test $ac_cv_func_strtoumax = no; then
AC_LIBOBJ([strtoumax])
gl_PREREQ_STRTOUMAX
fi
gl_INTTYPES_MODULE_INDICATOR([strtoumax])
gl_FUNC_SYMLINK
if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
AC_LIBOBJ([symlink])
fi
gl_UNISTD_MODULE_INDICATOR([symlink])
gl_HEADER_SYS_SELECT
AC_PROG_MKDIR_P
gl_HEADER_SYS_STAT_H
AC_PROG_MKDIR_P
gl_HEADER_SYS_TIME_H
AC_PROG_MKDIR_P
gl_HEADER_TIME_H
gl_TIME_R
if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
AC_LIBOBJ([time_r])
gl_PREREQ_TIME_R
fi
gl_TIME_MODULE_INDICATOR([time_r])
gl_TIMESPEC
gl_UNISTD_H
gl_UTIMENS
gl_FUNC_ALLOCA
AC_CHECK_FUNCS_ONCE([readlinkat])
gl_CLOCK_TIME
gl_MD5
gl_SHA1
gl_SHA256
gl_SHA512
AC_REQUIRE([gl_C99_STRTOLD])
gl_FUNC_DUP2
if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
AC_LIBOBJ([dup2])
gl_PREREQ_DUP2
fi
gl_UNISTD_MODULE_INDICATOR([dup2])
gl_ENVIRON
gl_UNISTD_MODULE_INDICATOR([environ])
AC_REQUIRE([gl_EXTERN_INLINE])
gl_FILEMODE
gl_GETLOADAVG
if test $HAVE_GETLOADAVG = 0; then
AC_LIBOBJ([getloadavg])
gl_PREREQ_GETLOADAVG
fi
gl_STDLIB_MODULE_INDICATOR([getloadavg])
gl_FUNC_GETOPT_GNU
if test $REPLACE_GETOPT = 1; then
AC_LIBOBJ([getopt])
AC_LIBOBJ([getopt1])
gl_PREREQ_GETOPT
dnl Arrange for unistd.h to include getopt.h.
GNULIB_GL_UNISTD_H_GETOPT=1
fi
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
gl_FUNC_GETOPT_POSIX
if test $REPLACE_GETOPT = 1; then
AC_LIBOBJ([getopt])
AC_LIBOBJ([getopt1])
gl_PREREQ_GETOPT
dnl Arrange for unistd.h to include getopt.h.
GNULIB_GL_UNISTD_H_GETOPT=1
fi
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
gl_GETTIME
gl_FUNC_GETTIMEOFDAY
if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
AC_LIBOBJ([gettimeofday])
gl_PREREQ_GETTIMEOFDAY
fi
gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
gl_INTTYPES_INCOMPLETE
AC_REQUIRE([gl_LARGEFILE])
gl_FUNC_LSTAT
if test $REPLACE_LSTAT = 1; then
AC_LIBOBJ([lstat])
gl_PREREQ_LSTAT
fi
gl_SYS_STAT_MODULE_INDICATOR([lstat])
gl_FUNC_MKTIME
if test $REPLACE_MKTIME = 1; then
AC_LIBOBJ([mktime])
gl_PREREQ_MKTIME
fi
gl_TIME_MODULE_INDICATOR([mktime])
gl_MULTIARCH
gl_FUNC_PSELECT
if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then
AC_LIBOBJ([pselect])
fi
gl_SYS_SELECT_MODULE_INDICATOR([pselect])
gl_FUNC_PTHREAD_SIGMASK
if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
AC_LIBOBJ([pthread_sigmask])
gl_PREREQ_PTHREAD_SIGMASK
fi
gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
gl_FUNC_READLINK
if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
AC_LIBOBJ([readlink])
gl_PREREQ_READLINK
fi
gl_UNISTD_MODULE_INDICATOR([readlink])
gl_SIGNAL_H
gl_TYPE_SOCKLEN_T
gt_TYPE_SSIZE_T
gl_STAT_TIME
gl_STAT_BIRTHTIME
gl_STDALIGN_H
gl_STDARG_H
AM_STDBOOL_H
gl_STDDEF_H
gl_STDINT_H
gl_STDIO_H
gl_STDLIB_H
gl_FUNC_GNU_STRFTIME
gl_FUNC_STRTOIMAX
if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
AC_LIBOBJ([strtoimax])
gl_PREREQ_STRTOIMAX
fi
gl_INTTYPES_MODULE_INDICATOR([strtoimax])
gl_FUNC_STRTOUMAX
if test $ac_cv_func_strtoumax = no; then
AC_LIBOBJ([strtoumax])
gl_PREREQ_STRTOUMAX
fi
gl_INTTYPES_MODULE_INDICATOR([strtoumax])
gl_FUNC_SYMLINK
if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
AC_LIBOBJ([symlink])
fi
gl_UNISTD_MODULE_INDICATOR([symlink])
gl_HEADER_SYS_SELECT
AC_PROG_MKDIR_P
gl_HEADER_SYS_STAT_H
AC_PROG_MKDIR_P
gl_HEADER_SYS_TIME_H
AC_PROG_MKDIR_P
gl_HEADER_TIME_H
gl_TIME_R
if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
AC_LIBOBJ([time_r])
gl_PREREQ_TIME_R
fi
gl_TIME_MODULE_INDICATOR([time_r])
gl_TIMESPEC
gl_UNISTD_H
gl_UTIMENS
gl_gnulib_enabled_dosname=false
gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
gl_gnulib_enabled_pathmax=false
@ -281,27 +280,27 @@ gl_UTIMENS
func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 ()
{
if ! $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then
AC_SUBST([LIBINTL])
AC_SUBST([LTLIBINTL])
AC_SUBST([LIBINTL])
AC_SUBST([LTLIBINTL])
gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true
fi
}
func_gl_gnulib_m4code_pathmax ()
{
if ! $gl_gnulib_enabled_pathmax; then
gl_PATHMAX
gl_PATHMAX
gl_gnulib_enabled_pathmax=true
fi
}
func_gl_gnulib_m4code_stat ()
{
if ! $gl_gnulib_enabled_stat; then
gl_FUNC_STAT
if test $REPLACE_STAT = 1; then
AC_LIBOBJ([stat])
gl_PREREQ_STAT
fi
gl_SYS_STAT_MODULE_INDICATOR([stat])
gl_FUNC_STAT
if test $REPLACE_STAT = 1; then
AC_LIBOBJ([stat])
gl_PREREQ_STAT
fi
gl_SYS_STAT_MODULE_INDICATOR([stat])
gl_gnulib_enabled_stat=true
if test $REPLACE_STAT = 1; then
func_gl_gnulib_m4code_dosname
@ -317,24 +316,24 @@ gl_SYS_STAT_MODULE_INDICATOR([stat])
func_gl_gnulib_m4code_strtoll ()
{
if ! $gl_gnulib_enabled_strtoll; then
gl_FUNC_STRTOLL
if test $HAVE_STRTOLL = 0; then
AC_LIBOBJ([strtoll])
gl_PREREQ_STRTOLL
fi
gl_STDLIB_MODULE_INDICATOR([strtoll])
gl_FUNC_STRTOLL
if test $HAVE_STRTOLL = 0; then
AC_LIBOBJ([strtoll])
gl_PREREQ_STRTOLL
fi
gl_STDLIB_MODULE_INDICATOR([strtoll])
gl_gnulib_enabled_strtoll=true
fi
}
func_gl_gnulib_m4code_strtoull ()
{
if ! $gl_gnulib_enabled_strtoull; then
gl_FUNC_STRTOULL
if test $HAVE_STRTOULL = 0; then
AC_LIBOBJ([strtoull])
gl_PREREQ_STRTOULL
fi
gl_STDLIB_MODULE_INDICATOR([strtoull])
gl_FUNC_STRTOULL
if test $HAVE_STRTOULL = 0; then
AC_LIBOBJ([strtoull])
gl_PREREQ_STRTOULL
fi
gl_STDLIB_MODULE_INDICATOR([strtoull])
gl_gnulib_enabled_strtoull=true
fi
}

View file

@ -1,4 +1,4 @@
# serial 23
# serial 24
dnl Copyright (C) 2002-2003, 2005-2007, 2009-2012 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@ -247,7 +247,4 @@ AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [
])
# Prerequisites of lib/mktime.c.
AC_DEFUN([gl_PREREQ_MKTIME],
[
AC_REQUIRE([AC_C_INLINE])
])
AC_DEFUN([gl_PREREQ_MKTIME], [:])

View file

@ -1,27 +0,0 @@
# signalblocking.m4 serial 13
dnl Copyright (C) 2001-2002, 2006-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Determine available signal blocking primitives. Three different APIs exist:
# 1) POSIX: sigemptyset, sigaddset, sigprocmask
# 2) SYSV: sighold, sigrelse
# 3) BSD: sigblock, sigsetmask
# For simplicity, here we check only for the POSIX signal blocking.
AC_DEFUN([gl_SIGNALBLOCKING],
[
AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
if test $gl_cv_type_sigset_t = yes; then
AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1])
fi
if test -z "$gl_cv_func_sigprocmask"; then
HAVE_POSIX_SIGNALBLOCKING=0
fi
])
# Prerequisites of lib/sigprocmask.c.
AC_DEFUN([gl_PREREQ_SIGPROCMASK], [
AC_REQUIRE([AC_C_INLINE])
])

View file

@ -19,7 +19,6 @@ dnl From Paul Eggert.
AC_DEFUN([gl_STAT_TIME],
[
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_HEADERS_ONCE([sys/time.h])
@ -70,7 +69,6 @@ AC_DEFUN([gl_STAT_TIME],
#
AC_DEFUN([gl_STAT_BIRTHTIME],
[
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_HEADERS_ONCE([sys/time.h])
AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [],

View file

@ -1,4 +1,4 @@
#serial 14
#serial 15
# Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
@ -8,8 +8,4 @@
dnl From Jim Meyering
AC_DEFUN([gl_TIMESPEC],
[
dnl Prerequisites of lib/timespec.h.
AC_REQUIRE([AC_C_INLINE])
])
AC_DEFUN([gl_TIMESPEC], [:])

View file

@ -1,3 +1,8 @@
2012-08-17 Juanma Barranquero <lekktu@gmail.com>
* config.nt: Sync with autogen/config.in.
(HAVE_POSIX_OPENPT): New macro.
2012-08-14 Juanma Barranquero <lekktu@gmail.com>
* config.nt: Sync with autogen/config.in.

View file

@ -740,6 +740,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `posix_memalign' function. */
#undef HAVE_POSIX_MEMALIGN
/* Define to 1 if you have the `posix_openpt' function. */
#undef HAVE_POSIX_OPENPT
/* Define if you have the /proc filesystem. */
#undef HAVE_PROCFS

View file

@ -89,7 +89,7 @@ define pp
set $tmp = $arg0
set $output_debug = print_output_debug_flag
set print_output_debug_flag = 0
set safe_debug_print ($tmp)
call safe_debug_print ($tmp)
set print_output_debug_flag = $output_debug
end
document pp
@ -102,7 +102,7 @@ define pv
set $tmp = "$arg0"
set $output_debug = print_output_debug_flag
set print_output_debug_flag = 0
set safe_debug_print (find_symbol_value (intern ($tmp)))
call safe_debug_print (find_symbol_value (intern ($tmp)))
set print_output_debug_flag = $output_debug
end
document pv
@ -1162,7 +1162,7 @@ end
define xwhichsymbols
set $output_debug = print_output_debug_flag
set print_output_debug_flag = 0
set safe_debug_print (which_symbols ($arg0, $arg1))
call safe_debug_print (which_symbols ($arg0, $arg1))
set print_output_debug_flag = $output_debug
end
document xwhichsymbols

View file

@ -1,3 +1,421 @@
2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
Inline setter functions for Lisp_Objects slots of struct specbinding.
* eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
Adjust users.
2012-08-20 Martin Rudalics <rudalics@gmx.at>
* window.c (select_window): Always make selected window's buffer
current.
2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
Use AREF and ASET for docstrings of category tables.
* category.h (CATEGORY_DOCSTRING): Use AREF.
(SET_CATEGORY_DOCSTRING): Use ASET.
* category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
Inline setter functions for hash table members.
* lisp.h (set_hash_key, set_hash_value, set_hash_next)
(set_hash_hash, set_hash_index): Rename with _slot suffix.
(set_hash_key_and_value, set_hash_index, set_hash_next)
(set_hash_hash): New functions.
* charset.c, fns.c: Adjust users.
2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
Inline getter and setter functions for per-buffer values.
* buffer.h (per_buffer_default, set_per_buffer_default)
(per_buffer_value, set_per_buffer_value): New functions.
(PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
* buffer.c, data.c: Adjust users.
2012-08-20 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
Rely on <config.h> + <unistd.h> to declare 'environ',
as gnulib does this if the system doesn't.
* callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
* emacs.c (environ) [DOUG_LEA_MALLOC]:
* vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
* vm-limit.c: Include <unistd.h>, for 'environ'.
* unexaix.c, unexcoff.c: Include "mem-limits.h".
(start_of_data): Remove decl; mem-limits.h provides it.
* xdisp.c (handle_invisible_prop): Make it a bit faster
and avoid a gcc -Wmaybe-uninitialized diagnostic.
2012-08-19 Chong Yidong <cyd@gnu.org>
* xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
ends (Bug#3874).
2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
* .gdbinit: Use call instead of set when calling a function in the
inferior.
* data.c (set_internal): Don't use set_blv_found.
(Fkill_local_variable): Likewise.
2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
* nsfont.m (ns_ascii_average_width): Ensure the string
ascii_printable is initialized with a null-terminated character
array. Otherwise, it can contain undesired extra characters.
2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
port new setting code to Sun C 5.8 2005/10/13
* chartab.c, lisp.h (char_table_set, char_table_set_range):
Return void, not Lisp_Object. Otherwise, the compiler
complains about (A?B:C) where B is void and C is Lisp_Object
when compiling CHAR_TABLE_SET, due to the recent change to
the API of sub_char_table_set_contents.
2012-08-18 Chong Yidong <cyd@gnu.org>
* xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
for the string case (Bug#3874).
2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
* buffer.h (BSET): Remove (Bug#12215).
Replace all uses with calls to new setter functions.
(bset_bidi_paragraph_direction, bset_case_canon_table)
(bset_case_eqv_table, bset_directory, bset_display_count)
(bset_display_time, bset_downcase_table)
(bset_enable_multibyte_characters, bset_filename, bset_keymap)
(bset_last_selected_window, bset_local_var_alist)
(bset_mark_active, bset_point_before_scroll, bset_read_only)
(bset_truncate_lines, bset_undo_list, bset_upcase_table)
(bset_width_table):
* buffer.c (bset_abbrev_mode, bset_abbrev_table)
(bset_auto_fill_function, bset_auto_save_file_format)
(bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
(bset_bidi_display_reordering, bset_buffer_file_coding_system)
(bset_cache_long_line_scans, bset_case_fold_search)
(bset_ctl_arrow, bset_cursor_in_non_selected_windows)
(bset_cursor_type, bset_display_table, bset_extra_line_spacing)
(bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
(bset_fringe_indicator_alist, bset_fringes_outside_margins)
(bset_header_line_format, bset_indicate_buffer_boundaries)
(bset_indicate_empty_lines, bset_invisibility_spec)
(bset_left_fringe_width, bset_major_mode, bset_mark)
(bset_minor_modes, bset_mode_line_format, bset_mode_name)
(bset_name, bset_overwrite_mode, bset_pt_marker)
(bset_right_fringe_width, bset_save_length)
(bset_scroll_bar_width, bset_scroll_down_aggressively)
(bset_scroll_up_aggressively, bset_selective_display)
(bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
(bset_word_wrap, bset_zv_marker):
* category.c (bset_category_table):
* syntax.c (bset_syntax_table):
New setter functions.
* process.h (PSET): Remove (Bug#12215).
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(PROCESS_INLINE): New macro.
(pset_childp): New setter function.
(pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
* process.c (PROCESS_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(pset_buffer, pset_command, pset_decode_coding_system)
(pset_decoding_buf, pset_encode_coding_system)
(pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
(pset_plist, pset_sentinel, pset_status, pset_tty_name)
(pset_type, pset_write_queue): New setter functions.
* window.h (WSET): Remove (Bug#12215).
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(WINDOW_INLINE): New macro.
(wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
(wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
(wset_total_lines, wset_vertical_scroll_bar)
(wset_window_end_pos, wset_window_end_valid)
(wset_window_end_vpos): New setter functions.
* window.c (WINDOW_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(wset_combination_limit, wset_dedicated, wset_display_table)
(wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
(wset_new_normal, wset_new_total, wset_next_buffers)
(wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
(wset_prev_buffers, wset_right_fringe_width)
(wset_right_margin_cols, wset_scroll_bar_width, wset_start)
(wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
(wset_window_parameters):
* xdisp.c (wset_base_line_number, wset_base_line_pos)
(wset_column_number_displayed, wset_region_showing):
New setter functions.
* termhooks.h (TSET): Remove (Bug#12215).
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(TERMHOOKS_INLINE): New macro.
(tset_charset_list, tset_selection_alist): New setter functions.
* terminal.c (TERMHOOKS_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(tset_param_alist): New setter function.
2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
* keyboard.h (KSET): Remove (Bug#12215).
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(KEYBOARD_INLINE): New macro.
(kset_default_minibuffer_frame, kset_defining_kbd_macro)
(kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
(kset_prefix_arg, kset_system_key_alist, kset_window_system):
New setter functions.
* keyboard.c (KEYBOARD_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(kset_echo_string, kset_kbd_queue)
(kset_keyboard_translate_table, kset_last_prefix_arg)
(kset_last_repeatable_command, kset_local_function_key_map)
(kset_overriding_terminal_local_map, kset_real_last_command)
(kset_system_key_syms): New setter functions.
* frame.h (FSET): Remove (Bug#12215).
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(FRAME_INLINE): New macro.
(fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
(fset_current_tool_bar_string, fset_desired_tool_bar_string)
(fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
(fset_menu_bar_vector, fset_menu_bar_window, fset_name)
(fset_param_alist, fset_root_window, fset_scroll_bars)
(fset_selected_window, fset_title, fset_tool_bar_items)
(fset_tool_bar_position, fset_tool_bar_window): New functions.
* frame.c (FRAME_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(fset_buffer_predicate, fset_minibuffer_window): New setter functions.
A few more naming-convention fixes for getters and setters.
* buffer.c (set_buffer_overlays_before): Move here from buffer.h,
and rename from buffer_overlays_set_before.
(set_buffer_overlays_after): Move here from buffer.h, and rename
from buffer_overlays_set_after.
* buffer.h (buffer_intervals): Rename from buffer_get_intervals.
All uses changed.
(set_buffer_intervals): Rename from buffer_set_intervals.
* intervals.c (set_interval_object): Move here from intervals.h,
and rename from interval_set_object.
(set_interval_left): Move here from intervals.h, and rename from
interval_set_left.
(set_interval_right): Move here from intervals.h, and rename from
interval_set_right.
(copy_interval_parent): Move here from intervals.h, and rename from
interval_copy_parent.
* intervals.h (set_interval_parent): Rename from interval_set_parent.
(set_interval_plist): Rename from interval_set_plist.
Return void, not Lisp_Object, since no caller uses the result.
* lisp.h (string_intervals): Rename from string_get_intervals.
(set_string_intervals): Rename from string_set_intervals.
* lisp.h (set_char_table_extras): Rename from char_table_set_extras.
(set_char_table_contents): Rename from char_table_set_contents.
(set_sub_char_table_contents): Rename from sub_char_table_set_contents.
All uses changed. See the end of
<http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
* lisp.h (CSET): Remove (Bug#12215).
(set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
(set_char_table_purpose): New functions,
replacing CSET. All uses changed. For example, replace
"CSET (XCHAR_TABLE (char_table), parent, parent);" with
"set_char_table_parent (char_table, parent);".
The old version was confusing because it used the same name
'parent' for two different things.
2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
Functions to get and set Lisp_Object fields of buffer-local variables.
* lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
(set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
(BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
* data.c, eval.c, frame.c: Adjust users.
2012-08-17 Chong Yidong <cyd@gnu.org>
* xfaces.c (merge_face_vectors): If the target font specfies a
font spec, make the font's attributes take precedence over
directly-specified attributes.
(merge_face_ref): Recognize :font.
2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
Do not use memcpy for copying intervals.
* intervals.c (reproduce_interval): New function.
(reproduce_tree, reproduce_tree_obj): Use it.
(reproduce_tree_obj): Remove prototype.
2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
* lisp.h (duration_to_sec_usec): Remove unused decl.
2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
* nsfont.m (ns_ascii_average_width): Send initWithFormat selector
to an allocated instance of NSString, not to the class itself.
2012-08-17 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in (C_CTYPE_H): New macro.
(LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
Use ASCII tests for character types.
* category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
* xfns.c, xterm.c:
Don't include <ctype.h>; was not needed.
* charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
* sysdep.c, xfaces.c:
Include <c-ctype.h> instead of <ctype.h>.
* nsterm.m: Include <c-ctype.h>.
* charset.c (read_hex):
* doc.c (Fsnarf_documentation):
* fileio.c (IS_DRIVE) [WINDOWSNT]:
(DRIVE_LETTER) [DOS_NT]:
(Ffile_name_directory, Fexpand_file_name)
(Fsubstitute_in_file_name):
* font.c (font_parse_xlfd, font_parse_fcname):
* frame.c (x_set_font_backend):
* gtkutil.c (xg_get_font):
* image.c (xbm_scan, xpm_scan, pbm_scan_number):
* nsimage.m (hexchar):
* nsterm.m (ns_xlfd_to_fontname):
* sysdep.c (system_process_attributes):
* xfaces.c (hash_string_case_insensitive):
Use C-locale tests instead of locale-specific tests for character
types, since we want the ASCII interpretation here, not the
interpretation suitable for whatever happens to be the current locale.
2012-08-16 Martin Rudalics <rudalics@gmx.at>
Consistently check windows for validity/liveness
(Bug#11984, Bug#12025, Bug#12026).
* lisp.h (CHECK_VALID_WINDOW): New macro.
* window.c (decode_window): Rename to decode_live_window.
(decode_valid_window, Fwindow_valid_p): New functions.
(Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
(Fframe_first_window, Fframe_selected_window, Fwindow_parent)
(Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
(Fwindow_prev_sibling, Fwindow_combination_limit)
(Fset_window_combination_limit, Fwindow_use_time)
(Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
(Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
(Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
(Fwindow_hscroll, Fset_window_hscroll)
(Fwindow_redisplay_end_trigger)
(Fset_window_redisplay_end_trigger, Fwindow_edges)
(Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
(Fwindow_inside_edges, Fwindow_inside_pixel_edges)
(Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
(Fwindow_end, Fset_window_point, Fset_window_start)
(Fpos_visible_in_window_p, Fwindow_line_height)
(Fwindow_dedicated_p, Fset_window_dedicated_p)
(Fwindow_prev_buffers, Fset_window_prev_buffers)
(Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
(Fset_window_parameter, Fwindow_display_table)
(Fset_window_display_table, Fdelete_other_windows_internal)
(Fset_window_buffer, Fset_window_new_total)
(Fset_window_new_normal, Fdelete_window_internal)
(Fwindow_text_height, Fset_window_margins, Fwindow_margins)
(Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
(Fwindow_scroll_bars): Check whether argument window is a valid or
live window. Update doc-strings.
(syms_of_window): New symbol Qwindow_valid_p.
* keyboard.c (Fposn_at_x_y): Check whether argument
frame_or_window denotes a valid window.
2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
Fix previous char table change.
* lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
* chartab.c (optimize_sub_char_table): Likewise.
2012-08-16 Chong Yidong <cyd@gnu.org>
* gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
* xfont.c (xfont_open):
* xftfont.c (xftfont_open): Set the font's max_width field.
* nsfont.m (nsfont_open): Similar to the Xft backend, set
min_width to space_width and average_width to the average over
printable ASCII characters.
(ns_char_width): Code cleanup.
(ns_ascii_average_width): New utility function.
* font.h (struct font): Update comments.
2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
Simple interface to set Lisp_Object fields of character tables.
* lisp.h (CSET): New macro.
(char_table_set_extras, char_table_set_contents)
(sub_char_table_set_contents): New function.
* casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
* syntax.c: Adjust users.
2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
* eval.c (eval_sub): Bind lexical-binding.
* lread.c (Qlexical_binding): Make non-static.
2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
* nsmenu.m (popupSession): Remove.
(pop_down_menu): Remove endModalSession.
(timeout_handler:): New method.
(runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
Call runModalForWindow. Check timer_fired when it returns.
If not set, cancel timer and break out of loop.
Otherwise loop again, with a new timeout.
* nsterm.m: Include fcntl.h if present.
(fd_entry, t_readfds, inNsSelect): Remove.
(select_writefds, select_valid, select_timeout, selfds)
(select_mutex, apploopnr): Add.
(EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
Otherwise call kbd_buffer_store_event.
(ns_send_appdefined): Remove release of fd_entry.
(ns_read_socket): Always send appdefined. Remove inNsSelect check.
Increment and decrement apploopnr.
(ns_select): If no file descriptors, just do a NSTimer.
Otherwise copy read/write masks and start select thread (fd_handler).
Start main loop and wait for application defined event.
Inform select thread to stop selecting after main loop is exited.
(ns_term_init): Create selfds pipe and set non-blocking.
Initialize select_mutex. Start the select thread (fd_handler).
(fd_handler:): Loop forever, wait for info from the main thread
to either start or stop selecting. When select returns, send
and appdefined event.
(sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
If not call kbd_buffer_store_event.
* nsterm.h (EmacsApp): fd_handler takes id argument.
(EmacsDialogPanel): Add timer_fired and timeout_handler.
* gtkutil.c (xg_mark_data): Use FRAME_X_P.
2012-08-15 Eli Zaretskii <eliz@gnu.org>
* region-cache.c (move_cache_gap): Update gap_len using the actual
@ -8,8 +426,8 @@
Generalize and cleanup font subsystem checks.
* font.h (FONT_DEBUG, font_assert): Remove.
* font.c, fontset.c, w32font.c, xfont.c, xftfont.c: Change
font_assert to eassert. Use eassert where appropriate.
* font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
Change font_assert to eassert. Use eassert where appropriate.
2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
@ -17,10 +435,10 @@
2012-08-15 Chong Yidong <cyd@gnu.org>
* gtkutil.c (xg_get_font): Rename from xg_get_font_name. When
using the new font chooser, use gtk_font_chooser_get_font_desc to
extract the font descriptor instead of just the font name. In
that case, return a font spec instead of a string.
* gtkutil.c (xg_get_font): Rename from xg_get_font_name.
When using the new font chooser, use gtk_font_chooser_get_font_desc to
extract the font descriptor instead of just the font name.
In that case, return a font spec instead of a string.
(x_last_font_name): Move to this file from xfns.c.
* xfns.c (Fx_select_font): The return value can also be a font
@ -3302,6 +3720,7 @@
has at least microseconds now. All uses removed.
(update_frame, update_single_window, update_window, update_frame_1)
(Fsleep_for, sit_for): Port to higher-resolution time stamps.
(duration_to_sec_usec): Remove; no longer needed.
* editfns.c (time_overflow): Now extern.
(Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)

View file

@ -5809,7 +5809,7 @@ mark_buffer (struct buffer *buffer)
/* ...but there are some buffer-specific things. */
MARK_INTERVAL_TREE (buffer_get_intervals (buffer));
MARK_INTERVAL_TREE (buffer_intervals (buffer));
/* For now, we just don't mark the undo_list. It's done later in
a special way just before the sweep phase, and after stripping
@ -6063,7 +6063,7 @@ mark_object (Lisp_Object arg)
}
if (!PURE_POINTER_P (XSTRING (ptr->name)))
MARK_STRING (XSTRING (ptr->name));
MARK_INTERVAL_TREE (string_get_intervals (ptr->name));
MARK_INTERVAL_TREE (string_intervals (ptr->name));
ptr = ptr->next;
if (ptr)
@ -6378,7 +6378,7 @@ gc_sweep (void)
{
if (!iblk->intervals[i].gcmarkbit)
{
interval_set_parent (&iblk->intervals[i], interval_free_list);
set_interval_parent (&iblk->intervals[i], interval_free_list);
interval_free_list = &iblk->intervals[i];
this_free++;
}

View file

@ -155,6 +155,228 @@ static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay
static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t);
static Lisp_Object buffer_lisp_local_variables (struct buffer *, int);
/* These setters are used only in this file, so they can be private. */
static inline void
bset_abbrev_mode (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (abbrev_mode) = val;
}
static inline void
bset_abbrev_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (abbrev_table) = val;
}
static inline void
bset_auto_fill_function (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (auto_fill_function) = val;
}
static inline void
bset_auto_save_file_format (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (auto_save_file_format) = val;
}
static inline void
bset_auto_save_file_name (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (auto_save_file_name) = val;
}
static inline void
bset_backed_up (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (backed_up) = val;
}
static inline void
bset_begv_marker (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (begv_marker) = val;
}
static inline void
bset_bidi_display_reordering (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (bidi_display_reordering) = val;
}
static inline void
bset_buffer_file_coding_system (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (buffer_file_coding_system) = val;
}
static inline void
bset_cache_long_line_scans (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (cache_long_line_scans) = val;
}
static inline void
bset_case_fold_search (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (case_fold_search) = val;
}
static inline void
bset_ctl_arrow (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (ctl_arrow) = val;
}
static inline void
bset_cursor_in_non_selected_windows (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (cursor_in_non_selected_windows) = val;
}
static inline void
bset_cursor_type (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (cursor_type) = val;
}
static inline void
bset_display_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (display_table) = val;
}
static inline void
bset_extra_line_spacing (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (extra_line_spacing) = val;
}
static inline void
bset_file_format (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (file_format) = val;
}
static inline void
bset_file_truename (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (file_truename) = val;
}
static inline void
bset_fringe_cursor_alist (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (fringe_cursor_alist) = val;
}
static inline void
bset_fringe_indicator_alist (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (fringe_indicator_alist) = val;
}
static inline void
bset_fringes_outside_margins (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (fringes_outside_margins) = val;
}
static inline void
bset_header_line_format (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (header_line_format) = val;
}
static inline void
bset_indicate_buffer_boundaries (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (indicate_buffer_boundaries) = val;
}
static inline void
bset_indicate_empty_lines (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (indicate_empty_lines) = val;
}
static inline void
bset_invisibility_spec (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (invisibility_spec) = val;
}
static inline void
bset_left_fringe_width (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (left_fringe_width) = val;
}
static inline void
bset_major_mode (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (major_mode) = val;
}
static inline void
bset_mark (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (mark) = val;
}
static inline void
bset_minor_modes (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (minor_modes) = val;
}
static inline void
bset_mode_line_format (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (mode_line_format) = val;
}
static inline void
bset_mode_name (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (mode_name) = val;
}
static inline void
bset_name (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (name) = val;
}
static inline void
bset_overwrite_mode (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (overwrite_mode) = val;
}
static inline void
bset_pt_marker (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (pt_marker) = val;
}
static inline void
bset_right_fringe_width (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (right_fringe_width) = val;
}
static inline void
bset_save_length (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (save_length) = val;
}
static inline void
bset_scroll_bar_width (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (scroll_bar_width) = val;
}
static inline void
bset_scroll_down_aggressively (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (scroll_down_aggressively) = val;
}
static inline void
bset_scroll_up_aggressively (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (scroll_up_aggressively) = val;
}
static inline void
bset_selective_display (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (selective_display) = val;
}
static inline void
bset_selective_display_ellipses (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (selective_display_ellipses) = val;
}
static inline void
bset_vertical_scroll_bar_type (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (vertical_scroll_bar_type) = val;
}
static inline void
bset_word_wrap (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (word_wrap) = val;
}
static inline void
bset_zv_marker (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (zv_marker) = val;
}
/* For debugging; temporary. See set_buffer_internal. */
/* Lisp_Object Qlisp_mode, Vcheck_symbol; */
@ -358,7 +580,7 @@ even if it is dead. The return value is never nil. */)
BUF_CHARS_MODIFF (b) = 1;
BUF_OVERLAY_MODIFF (b) = 1;
BUF_SAVE_MODIFF (b) = 1;
buffer_set_intervals (b, NULL);
set_buffer_intervals (b, NULL);
BUF_UNCHANGED_MODIFIED (b) = 1;
BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1;
BUF_END_UNCHANGED (b) = 0;
@ -368,7 +590,7 @@ even if it is dead. The return value is never nil. */)
b->newline_cache = 0;
b->width_run_cache = 0;
BSET (b, width_table, Qnil);
bset_width_table (b, Qnil);
b->prevent_redisplay_optimizations_p = 1;
/* Put this on the chain of all buffers including killed ones. */
@ -377,20 +599,20 @@ even if it is dead. The return value is never nil. */)
/* An ordinary buffer normally doesn't need markers
to handle BEGV and ZV. */
BSET (b, pt_marker, Qnil);
BSET (b, begv_marker, Qnil);
BSET (b, zv_marker, Qnil);
bset_pt_marker (b, Qnil);
bset_begv_marker (b, Qnil);
bset_zv_marker (b, Qnil);
name = Fcopy_sequence (buffer_or_name);
string_set_intervals (name, NULL);
BSET (b, name, name);
set_string_intervals (name, NULL);
bset_name (b, name);
BSET (b, undo_list, (SREF (name, 0) != ' ') ? Qnil : Qt);
bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt);
reset_buffer (b);
reset_buffer_local_variables (b, 1);
BSET (b, mark, Fmake_marker ());
bset_mark (b, Fmake_marker ());
BUF_MARKERS (b) = NULL;
/* Put this in the alist of all live buffers. */
@ -437,6 +659,19 @@ copy_overlays (struct buffer *b, struct Lisp_Overlay *list)
return result;
}
/* Set an appropriate overlay of B. */
static inline void
set_buffer_overlays_before (struct buffer *b, struct Lisp_Overlay *o)
{
b->overlays_before = o;
}
static inline void
set_buffer_overlays_after (struct buffer *b, struct Lisp_Overlay *o)
{
b->overlays_after = o;
}
/* Clone per-buffer values of buffer FROM.
@ -458,7 +693,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
if (offset == PER_BUFFER_VAR_OFFSET (name))
continue;
obj = PER_BUFFER_VALUE (from, offset);
obj = per_buffer_value (from, offset);
if (MARKERP (obj) && XMARKER (obj)->buffer == from)
{
struct Lisp_Marker *m = XMARKER (obj);
@ -467,17 +702,17 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
XMARKER (obj)->insertion_type = m->insertion_type;
}
PER_BUFFER_VALUE (to, offset) = obj;
set_per_buffer_value (to, offset, obj);
}
memcpy (to->local_flags, from->local_flags, sizeof to->local_flags);
buffer_set_overlays_before (to, copy_overlays (to, from->overlays_before));
buffer_set_overlays_after (to, copy_overlays (to, from->overlays_after));
set_buffer_overlays_before (to, copy_overlays (to, from->overlays_before));
set_buffer_overlays_after (to, copy_overlays (to, from->overlays_after));
/* Get (a copy of) the alist of Lisp-level local variables of FROM
and install that in TO. */
BSET (to, local_var_alist, buffer_lisp_local_variables (from, 1));
bset_local_var_alist (to, buffer_lisp_local_variables (from, 1));
}
@ -580,15 +815,15 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
b->newline_cache = 0;
b->width_run_cache = 0;
BSET (b, width_table, Qnil);
bset_width_table (b, Qnil);
/* Put this on the chain of all buffers including killed ones. */
b->header.next.buffer = all_buffers;
all_buffers = b;
name = Fcopy_sequence (name);
string_set_intervals (name, NULL);
BSET (b, name, name);
set_string_intervals (name, NULL);
bset_name (b, name);
reset_buffer (b);
reset_buffer_local_variables (b, 1);
@ -597,10 +832,11 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
XSETBUFFER (buf, b);
Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
BSET (b, mark, Fmake_marker ());
bset_mark (b, Fmake_marker ());
/* The multibyte status belongs to the base buffer. */
BSET (b, enable_multibyte_characters, BVAR (b->base_buffer, enable_multibyte_characters));
bset_enable_multibyte_characters
(b, BVAR (b->base_buffer, enable_multibyte_characters));
/* Make sure the base buffer has markers for its narrowing. */
if (NILP (BVAR (b->base_buffer, pt_marker)))
@ -608,14 +844,17 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
eassert (NILP (BVAR (b->base_buffer, begv_marker)));
eassert (NILP (BVAR (b->base_buffer, zv_marker)));
BSET (b->base_buffer, pt_marker,
build_marker (b->base_buffer, b->base_buffer->pt, b->base_buffer->pt_byte));
bset_pt_marker (b->base_buffer,
build_marker (b->base_buffer, b->base_buffer->pt,
b->base_buffer->pt_byte));
BSET (b->base_buffer, begv_marker,
build_marker (b->base_buffer, b->base_buffer->begv, b->base_buffer->begv_byte));
bset_begv_marker (b->base_buffer,
build_marker (b->base_buffer, b->base_buffer->begv,
b->base_buffer->begv_byte));
BSET (b->base_buffer, zv_marker,
build_marker (b->base_buffer, b->base_buffer->zv, b->base_buffer->zv_byte));
bset_zv_marker (b->base_buffer,
build_marker (b->base_buffer, b->base_buffer->zv,
b->base_buffer->zv_byte));
XMARKER (BVAR (b->base_buffer, zv_marker))->insertion_type = 1;
}
@ -623,9 +862,9 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
if (NILP (clone))
{
/* Give the indirect buffer markers for its narrowing. */
BSET (b, pt_marker, build_marker (b, b->pt, b->pt_byte));
BSET (b, begv_marker, build_marker (b, b->begv, b->begv_byte));
BSET (b, zv_marker, build_marker (b, b->zv, b->zv_byte));
bset_pt_marker (b, build_marker (b, b->pt, b->pt_byte));
bset_begv_marker (b, build_marker (b, b->begv, b->begv_byte));
bset_zv_marker (b, build_marker (b, b->zv, b->zv_byte));
XMARKER (BVAR (b, zv_marker))->insertion_type = 1;
}
else
@ -633,11 +872,11 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
struct buffer *old_b = current_buffer;
clone_per_buffer_values (b->base_buffer, b);
BSET (b, filename, Qnil);
BSET (b, file_truename, Qnil);
BSET (b, display_count, make_number (0));
BSET (b, backed_up, Qnil);
BSET (b, auto_save_file_name, Qnil);
bset_filename (b, Qnil);
bset_file_truename (b, Qnil);
bset_display_count (b, make_number (0));
bset_backed_up (b, Qnil);
bset_auto_save_file_name (b, Qnil);
set_buffer_internal_1 (b);
Fset (intern ("buffer-save-without-query"), Qnil);
Fset (intern ("buffer-file-number"), Qnil);
@ -686,8 +925,8 @@ delete_all_overlays (struct buffer *b)
ov->next = NULL;
}
buffer_set_overlays_before (b, NULL);
buffer_set_overlays_after (b, NULL);
set_buffer_overlays_before (b, NULL);
set_buffer_overlays_after (b, NULL);
}
/* Reinitialize everything about a buffer except its name and contents
@ -700,10 +939,9 @@ delete_all_overlays (struct buffer *b)
void
reset_buffer (register struct buffer *b)
{
BSET (b, filename, Qnil);
BSET (b, file_truename, Qnil);
BSET (b, directory,
(current_buffer) ? BVAR (current_buffer, directory) : Qnil);
bset_filename (b, Qnil);
bset_file_truename (b, Qnil);
bset_directory (b, current_buffer ? BVAR (current_buffer, directory) : Qnil);
b->modtime = make_emacs_time (0, UNKNOWN_MODTIME_NSECS);
b->modtime_size = -1;
XSETFASTINT (BVAR (b, save_length), 0);
@ -711,25 +949,25 @@ reset_buffer (register struct buffer *b)
/* It is more conservative to start out "changed" than "unchanged". */
b->clip_changed = 0;
b->prevent_redisplay_optimizations_p = 1;
BSET (b, backed_up, Qnil);
bset_backed_up (b, Qnil);
BUF_AUTOSAVE_MODIFF (b) = 0;
b->auto_save_failure_time = 0;
BSET (b, auto_save_file_name, Qnil);
BSET (b, read_only, Qnil);
buffer_set_overlays_before (b, NULL);
buffer_set_overlays_after (b, NULL);
bset_auto_save_file_name (b, Qnil);
bset_read_only (b, Qnil);
set_buffer_overlays_before (b, NULL);
set_buffer_overlays_after (b, NULL);
b->overlay_center = BEG;
BSET (b, mark_active, Qnil);
BSET (b, point_before_scroll, Qnil);
BSET (b, file_format, Qnil);
BSET (b, auto_save_file_format, Qt);
BSET (b, last_selected_window, Qnil);
BSET (b, display_count, make_number (0));
BSET (b, display_time, Qnil);
BSET (b, enable_multibyte_characters,
BVAR (&buffer_defaults, enable_multibyte_characters));
BSET (b, cursor_type, BVAR (&buffer_defaults, cursor_type));
BSET (b, extra_line_spacing, BVAR (&buffer_defaults, extra_line_spacing));
bset_mark_active (b, Qnil);
bset_point_before_scroll (b, Qnil);
bset_file_format (b, Qnil);
bset_auto_save_file_format (b, Qt);
bset_last_selected_window (b, Qnil);
bset_display_count (b, make_number (0));
bset_display_time (b, Qnil);
bset_enable_multibyte_characters
(b, BVAR (&buffer_defaults, enable_multibyte_characters));
bset_cursor_type (b, BVAR (&buffer_defaults, cursor_type));
bset_extra_line_spacing (b, BVAR (&buffer_defaults, extra_line_spacing));
b->display_error_modiff = 0;
}
@ -753,10 +991,10 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
things that depend on the major mode.
default-major-mode is handled at a higher level.
We ignore it here. */
BSET (b, major_mode, Qfundamental_mode);
BSET (b, keymap, Qnil);
BSET (b, mode_name, QSFundamental);
BSET (b, minor_modes, Qnil);
bset_major_mode (b, Qfundamental_mode);
bset_keymap (b, Qnil);
bset_mode_name (b, QSFundamental);
bset_minor_modes (b, Qnil);
/* If the standard case table has been altered and invalidated,
fix up its insides first. */
@ -765,15 +1003,15 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
&& CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2])))
Fset_standard_case_table (Vascii_downcase_table);
BSET (b, downcase_table, Vascii_downcase_table);
BSET (b, upcase_table, XCHAR_TABLE (Vascii_downcase_table)->extras[0]);
BSET (b, case_canon_table, XCHAR_TABLE (Vascii_downcase_table)->extras[1]);
BSET (b, case_eqv_table, XCHAR_TABLE (Vascii_downcase_table)->extras[2]);
BSET (b, invisibility_spec, Qt);
bset_downcase_table (b, Vascii_downcase_table);
bset_upcase_table (b, XCHAR_TABLE (Vascii_downcase_table)->extras[0]);
bset_case_canon_table (b, XCHAR_TABLE (Vascii_downcase_table)->extras[1]);
bset_case_eqv_table (b, XCHAR_TABLE (Vascii_downcase_table)->extras[2]);
bset_invisibility_spec (b, Qt);
/* Reset all (or most) per-buffer variables to their defaults. */
if (permanent_too)
BSET (b, local_var_alist, Qnil);
bset_local_var_alist (b, Qnil);
else
{
Lisp_Object tmp, prop, last = Qnil;
@ -807,7 +1045,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
}
/* Delete this local variable. */
else if (NILP (last))
BSET (b, local_var_alist, XCDR (tmp));
bset_local_var_alist (b, XCDR (tmp));
else
XSETCDR (last, XCDR (tmp));
}
@ -823,7 +1061,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
if ((idx > 0
&& (permanent_too
|| buffer_permanent_local_flags[idx] == 0)))
PER_BUFFER_VALUE (b, offset) = PER_BUFFER_DEFAULT (offset);
set_per_buffer_value (b, offset, per_buffer_default (offset));
}
}
@ -999,7 +1237,7 @@ buffer_local_value_1 (Lisp_Object variable, Lisp_Object buffer)
{
union Lisp_Fwd *fwd = SYMBOL_FWD (sym);
if (BUFFER_OBJFWDP (fwd))
result = PER_BUFFER_VALUE (buf, XBUFFER_OBJFWD (fwd)->offset);
result = per_buffer_value (buf, XBUFFER_OBJFWD (fwd)->offset);
else
result = Fdefault_value (variable);
break;
@ -1079,7 +1317,7 @@ No argument or nil as argument means use current buffer as BUFFER. */)
&& SYMBOLP (PER_BUFFER_SYMBOL (offset)))
{
Lisp_Object sym = PER_BUFFER_SYMBOL (offset);
Lisp_Object val = PER_BUFFER_VALUE (buf, offset);
Lisp_Object val = per_buffer_value (buf, offset);
result = Fcons (EQ (val, Qunbound) ? sym : Fcons (sym, val),
result);
}
@ -1284,7 +1522,7 @@ This does not change the name of the visited file (if any). */)
error ("Buffer name `%s' is in use", SDATA (newname));
}
BSET (current_buffer, name, newname);
bset_name (current_buffer, newname);
/* Catch redisplay's attention. Unless we do this, the mode lines for
any windows displaying current_buffer will stay unchanged. */
@ -1429,7 +1667,7 @@ No argument or nil as argument means do this for the current buffer. */)
}
if (EQ (BVAR (XBUFFER (real_buffer), undo_list), Qt))
BSET (XBUFFER (real_buffer), undo_list, Qnil);
bset_undo_list (XBUFFER (real_buffer), Qnil);
return Qnil;
}
@ -1689,7 +1927,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
m = next;
}
BUF_MARKERS (b) = NULL;
buffer_set_intervals (b, NULL);
set_buffer_intervals (b, NULL);
/* Perhaps we should explicitly free the interval tree here... */
}
@ -1701,7 +1939,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
swap_out_buffer_local_variables (b);
reset_buffer_local_variables (b, 1);
BSET (b, name, Qnil);
bset_name (b, Qnil);
BLOCK_INPUT;
if (b->base_buffer)
@ -1725,9 +1963,9 @@ cleaning up all windows currently displaying the buffer to be killed. */)
free_region_cache (b->width_run_cache);
b->width_run_cache = 0;
}
BSET (b, width_table, Qnil);
bset_width_table (b, Qnil);
UNBLOCK_INPUT;
BSET (b, undo_list, Qnil);
bset_undo_list (b, Qnil);
/* Run buffer-list-update-hook. */
if (!NILP (Vrun_hooks))
@ -1768,8 +2006,8 @@ record_buffer (Lisp_Object buffer)
Vinhibit_quit = tem;
/* Update buffer list of selected frame. */
FSET (f, buffer_list, Fcons (buffer, Fdelq (buffer, f->buffer_list)));
FSET (f, buried_buffer_list, Fdelq (buffer, f->buried_buffer_list));
fset_buffer_list (f, Fcons (buffer, Fdelq (buffer, f->buffer_list)));
fset_buried_buffer_list (f, Fdelq (buffer, f->buried_buffer_list));
/* Run buffer-list-update-hook. */
if (!NILP (Vrun_hooks))
@ -1806,9 +2044,9 @@ DEFUN ("bury-buffer-internal", Fbury_buffer_internal, Sbury_buffer_internal,
Vinhibit_quit = tem;
/* Update buffer lists of selected frame. */
FSET (f, buffer_list, Fdelq (buffer, f->buffer_list));
FSET (f, buried_buffer_list,
Fcons (buffer, Fdelq (buffer, f->buried_buffer_list)));
fset_buffer_list (f, Fdelq (buffer, f->buffer_list));
fset_buried_buffer_list
(f, Fcons (buffer, Fdelq (buffer, f->buried_buffer_list)));
/* Run buffer-list-update-hook. */
if (!NILP (Vrun_hooks))
@ -1908,7 +2146,7 @@ set_buffer_internal_1 (register struct buffer *b)
/* Put the undo list back in the base buffer, so that it appears
that an indirect buffer shares the undo list of its base. */
if (old_buf->base_buffer)
BSET (old_buf->base_buffer, undo_list, BVAR (old_buf, undo_list));
bset_undo_list (old_buf->base_buffer, BVAR (old_buf, undo_list));
/* If the old current buffer has markers to record PT, BEGV and ZV
when it is not current, update them now. */
@ -1918,7 +2156,7 @@ set_buffer_internal_1 (register struct buffer *b)
/* Get the undo list from the base buffer, so that it appears
that an indirect buffer shares the undo list of its base. */
if (b->base_buffer)
BSET (b, undo_list, BVAR (b->base_buffer, undo_list));
bset_undo_list (b, BVAR (b->base_buffer, undo_list));
/* If the new current buffer has markers to record PT, BEGV and ZV
when it is not current, fetch them now. */
@ -2116,8 +2354,8 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
#define swapfield_(field, type) \
do { \
type tmp##field = BVAR (other_buffer, field); \
BSET (other_buffer, field, BVAR (current_buffer, field)); \
BSET (current_buffer, field, tmp##field); \
bset_##field (other_buffer, BVAR (current_buffer, field)); \
bset_##field (current_buffer, tmp##field); \
} while (0)
swapfield (own_text, struct buffer_text);
@ -2157,8 +2395,8 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
swapfield_ (pt_marker, Lisp_Object);
swapfield_ (begv_marker, Lisp_Object);
swapfield_ (zv_marker, Lisp_Object);
BSET (current_buffer, point_before_scroll, Qnil);
BSET (other_buffer, point_before_scroll, Qnil);
bset_point_before_scroll (current_buffer, Qnil);
bset_point_before_scroll (other_buffer, Qnil);
current_buffer->text->modiff++; other_buffer->text->modiff++;
current_buffer->text->chars_modiff++; other_buffer->text->chars_modiff++;
@ -2247,7 +2485,7 @@ current buffer is cleared. */)
/* Don't record these buffer changes. We will put a special undo entry
instead. */
BSET (current_buffer, undo_list, Qt);
bset_undo_list (current_buffer, Qt);
/* If the cached position is for this buffer, clear it out. */
clear_charpos_cache (current_buffer);
@ -2269,7 +2507,7 @@ current buffer is cleared. */)
to calculate the old correspondences. */
set_intervals_multibyte (0);
BSET (current_buffer, enable_multibyte_characters, Qnil);
bset_enable_multibyte_characters (current_buffer, Qnil);
Z = Z_BYTE;
BEGV = BEGV_BYTE;
@ -2407,7 +2645,7 @@ current buffer is cleared. */)
/* Do this first, so that chars_in_text asks the right question.
set_intervals_multibyte needs it too. */
BSET (current_buffer, enable_multibyte_characters, Qt);
bset_enable_multibyte_characters (current_buffer, Qt);
GPT_BYTE = advance_to_char_boundary (GPT_BYTE);
GPT = chars_in_text (BEG_ADDR, GPT_BYTE - BEG_BYTE) + BEG;
@ -2465,11 +2703,11 @@ current buffer is cleared. */)
if (!EQ (old_undo, Qt))
{
/* Represent all the above changes by a special undo entry. */
BSET (current_buffer, undo_list,
Fcons (list3 (Qapply,
intern ("set-buffer-multibyte"),
NILP (flag) ? Qt : Qnil),
old_undo));
bset_undo_list (current_buffer,
Fcons (list3 (Qapply,
intern ("set-buffer-multibyte"),
NILP (flag) ? Qt : Qnil),
old_undo));
}
UNGCPRO;
@ -3236,7 +3474,7 @@ recenter_overlay_lists (struct buffer *buf, ptrdiff_t pos)
if (prev)
prev->next = next;
else
buffer_set_overlays_before (buf, next);
set_buffer_overlays_before (buf, next);
/* Search thru overlays_after for where to put it. */
other_prev = NULL;
@ -3258,7 +3496,7 @@ recenter_overlay_lists (struct buffer *buf, ptrdiff_t pos)
if (other_prev)
other_prev->next = tail;
else
buffer_set_overlays_after (buf, tail);
set_buffer_overlays_after (buf, tail);
tail = prev;
}
else
@ -3294,7 +3532,7 @@ recenter_overlay_lists (struct buffer *buf, ptrdiff_t pos)
if (prev)
prev->next = next;
else
buffer_set_overlays_after (buf, next);
set_buffer_overlays_after (buf, next);
/* Search thru overlays_before for where to put it. */
other_prev = NULL;
@ -3316,7 +3554,7 @@ recenter_overlay_lists (struct buffer *buf, ptrdiff_t pos)
if (other_prev)
other_prev->next = tail;
else
buffer_set_overlays_before (buf, tail);
set_buffer_overlays_before (buf, tail);
tail = prev;
}
}
@ -3421,7 +3659,7 @@ fix_start_end_in_overlays (register ptrdiff_t start, register ptrdiff_t end)
beforep = tail;
}
if (!parent)
buffer_set_overlays_before (current_buffer, tail->next);
set_buffer_overlays_before (current_buffer, tail->next);
else
parent->next = tail->next;
tail = tail->next;
@ -3467,7 +3705,7 @@ fix_start_end_in_overlays (register ptrdiff_t start, register ptrdiff_t end)
beforep = tail;
}
if (!parent)
buffer_set_overlays_after (current_buffer, tail->next);
set_buffer_overlays_after (current_buffer, tail->next);
else
parent->next = tail->next;
tail = tail->next;
@ -3481,14 +3719,14 @@ fix_start_end_in_overlays (register ptrdiff_t start, register ptrdiff_t end)
if (beforep)
{
beforep->next = current_buffer->overlays_before;
buffer_set_overlays_before (current_buffer, before_list);
set_buffer_overlays_before (current_buffer, before_list);
}
recenter_overlay_lists (current_buffer, current_buffer->overlay_center);
if (afterp)
{
afterp->next = current_buffer->overlays_after;
buffer_set_overlays_after (current_buffer, after_list);
set_buffer_overlays_after (current_buffer, after_list);
}
recenter_overlay_lists (current_buffer, current_buffer->overlay_center);
}
@ -3565,7 +3803,7 @@ fix_overlays_before (struct buffer *bp, ptrdiff_t prev, ptrdiff_t pos)
if (!right_pair)
{
found->next = bp->overlays_before;
buffer_set_overlays_before (bp, found);
set_buffer_overlays_before (bp, found);
}
else
{
@ -3643,13 +3881,13 @@ for the rear of the overlay advance when text is inserted there
{
if (b->overlays_after)
XOVERLAY (overlay)->next = b->overlays_after;
buffer_set_overlays_after (b, XOVERLAY (overlay));
set_buffer_overlays_after (b, XOVERLAY (overlay));
}
else
{
if (b->overlays_before)
XOVERLAY (overlay)->next = b->overlays_before;
buffer_set_overlays_before (b, XOVERLAY (overlay));
set_buffer_overlays_before (b, XOVERLAY (overlay));
}
/* This puts it in the right list, and in the right order. */
@ -3714,8 +3952,8 @@ unchain_both (struct buffer *b, Lisp_Object overlay)
{
struct Lisp_Overlay *ov = XOVERLAY (overlay);
buffer_set_overlays_before (b, unchain_overlay (b->overlays_before, ov));
buffer_set_overlays_after (b, unchain_overlay (b->overlays_after, ov));
set_buffer_overlays_before (b, unchain_overlay (b->overlays_before, ov));
set_buffer_overlays_after (b, unchain_overlay (b->overlays_after, ov));
eassert (XOVERLAY (overlay)->next == NULL);
}
@ -3810,12 +4048,12 @@ buffer. */)
if (n_end < b->overlay_center)
{
XOVERLAY (overlay)->next = b->overlays_after;
buffer_set_overlays_after (b, XOVERLAY (overlay));
set_buffer_overlays_after (b, XOVERLAY (overlay));
}
else
{
XOVERLAY (overlay)->next = b->overlays_before;
buffer_set_overlays_before (b, XOVERLAY (overlay));
set_buffer_overlays_before (b, XOVERLAY (overlay));
}
/* This puts it in the right list, and in the right order. */
@ -4911,8 +5149,8 @@ init_buffer_once (void)
/* No one will share the text with these buffers, but let's play it safe. */
buffer_defaults.indirections = 0;
buffer_local_symbols.indirections = 0;
buffer_set_intervals (&buffer_defaults, NULL);
buffer_set_intervals (&buffer_local_symbols, NULL);
set_buffer_intervals (&buffer_defaults, NULL);
set_buffer_intervals (&buffer_local_symbols, NULL);
XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize);
XSETBUFFER (Vbuffer_defaults, &buffer_defaults);
XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize);
@ -4922,55 +5160,55 @@ init_buffer_once (void)
/* Must do these before making the first buffer! */
/* real setup is done in bindings.el */
BSET (&buffer_defaults, mode_line_format, build_pure_c_string ("%-"));
BSET (&buffer_defaults, header_line_format, Qnil);
BSET (&buffer_defaults, abbrev_mode, Qnil);
BSET (&buffer_defaults, overwrite_mode, Qnil);
BSET (&buffer_defaults, case_fold_search, Qt);
BSET (&buffer_defaults, auto_fill_function, Qnil);
BSET (&buffer_defaults, selective_display, Qnil);
BSET (&buffer_defaults, selective_display_ellipses, Qt);
BSET (&buffer_defaults, abbrev_table, Qnil);
BSET (&buffer_defaults, display_table, Qnil);
BSET (&buffer_defaults, undo_list, Qnil);
BSET (&buffer_defaults, mark_active, Qnil);
BSET (&buffer_defaults, file_format, Qnil);
BSET (&buffer_defaults, auto_save_file_format, Qt);
buffer_set_overlays_before (&buffer_defaults, NULL);
buffer_set_overlays_after (&buffer_defaults, NULL);
bset_mode_line_format (&buffer_defaults, build_pure_c_string ("%-"));
bset_header_line_format (&buffer_defaults, Qnil);
bset_abbrev_mode (&buffer_defaults, Qnil);
bset_overwrite_mode (&buffer_defaults, Qnil);
bset_case_fold_search (&buffer_defaults, Qt);
bset_auto_fill_function (&buffer_defaults, Qnil);
bset_selective_display (&buffer_defaults, Qnil);
bset_selective_display_ellipses (&buffer_defaults, Qt);
bset_abbrev_table (&buffer_defaults, Qnil);
bset_display_table (&buffer_defaults, Qnil);
bset_undo_list (&buffer_defaults, Qnil);
bset_mark_active (&buffer_defaults, Qnil);
bset_file_format (&buffer_defaults, Qnil);
bset_auto_save_file_format (&buffer_defaults, Qt);
set_buffer_overlays_before (&buffer_defaults, NULL);
set_buffer_overlays_after (&buffer_defaults, NULL);
buffer_defaults.overlay_center = BEG;
XSETFASTINT (BVAR (&buffer_defaults, tab_width), 8);
BSET (&buffer_defaults, truncate_lines, Qnil);
BSET (&buffer_defaults, word_wrap, Qnil);
BSET (&buffer_defaults, ctl_arrow, Qt);
BSET (&buffer_defaults, bidi_display_reordering, Qt);
BSET (&buffer_defaults, bidi_paragraph_direction, Qnil);
BSET (&buffer_defaults, cursor_type, Qt);
BSET (&buffer_defaults, extra_line_spacing, Qnil);
BSET (&buffer_defaults, cursor_in_non_selected_windows, Qt);
bset_truncate_lines (&buffer_defaults, Qnil);
bset_word_wrap (&buffer_defaults, Qnil);
bset_ctl_arrow (&buffer_defaults, Qt);
bset_bidi_display_reordering (&buffer_defaults, Qt);
bset_bidi_paragraph_direction (&buffer_defaults, Qnil);
bset_cursor_type (&buffer_defaults, Qt);
bset_extra_line_spacing (&buffer_defaults, Qnil);
bset_cursor_in_non_selected_windows (&buffer_defaults, Qt);
BSET (&buffer_defaults, enable_multibyte_characters, Qt);
BSET (&buffer_defaults, buffer_file_coding_system, Qnil);
bset_enable_multibyte_characters (&buffer_defaults, Qt);
bset_buffer_file_coding_system (&buffer_defaults, Qnil);
XSETFASTINT (BVAR (&buffer_defaults, fill_column), 70);
XSETFASTINT (BVAR (&buffer_defaults, left_margin), 0);
BSET (&buffer_defaults, cache_long_line_scans, Qnil);
BSET (&buffer_defaults, file_truename, Qnil);
bset_cache_long_line_scans (&buffer_defaults, Qnil);
bset_file_truename (&buffer_defaults, Qnil);
XSETFASTINT (BVAR (&buffer_defaults, display_count), 0);
XSETFASTINT (BVAR (&buffer_defaults, left_margin_cols), 0);
XSETFASTINT (BVAR (&buffer_defaults, right_margin_cols), 0);
BSET (&buffer_defaults, left_fringe_width, Qnil);
BSET (&buffer_defaults, right_fringe_width, Qnil);
BSET (&buffer_defaults, fringes_outside_margins, Qnil);
BSET (&buffer_defaults, scroll_bar_width, Qnil);
BSET (&buffer_defaults, vertical_scroll_bar_type, Qt);
BSET (&buffer_defaults, indicate_empty_lines, Qnil);
BSET (&buffer_defaults, indicate_buffer_boundaries, Qnil);
BSET (&buffer_defaults, fringe_indicator_alist, Qnil);
BSET (&buffer_defaults, fringe_cursor_alist, Qnil);
BSET (&buffer_defaults, scroll_up_aggressively, Qnil);
BSET (&buffer_defaults, scroll_down_aggressively, Qnil);
BSET (&buffer_defaults, display_time, Qnil);
bset_left_fringe_width (&buffer_defaults, Qnil);
bset_right_fringe_width (&buffer_defaults, Qnil);
bset_fringes_outside_margins (&buffer_defaults, Qnil);
bset_scroll_bar_width (&buffer_defaults, Qnil);
bset_vertical_scroll_bar_type (&buffer_defaults, Qt);
bset_indicate_empty_lines (&buffer_defaults, Qnil);
bset_indicate_buffer_boundaries (&buffer_defaults, Qnil);
bset_fringe_indicator_alist (&buffer_defaults, Qnil);
bset_fringe_cursor_alist (&buffer_defaults, Qnil);
bset_scroll_up_aggressively (&buffer_defaults, Qnil);
bset_scroll_down_aggressively (&buffer_defaults, Qnil);
bset_display_time (&buffer_defaults, Qnil);
/* Assign the local-flags to the slots that have default values.
The local flag is a bit that is used in the buffer
@ -4982,24 +5220,24 @@ init_buffer_once (void)
/* 0 means not a lisp var, -1 means always local, else mask */
memset (&buffer_local_flags, 0, sizeof buffer_local_flags);
BSET (&buffer_local_flags, filename, make_number (-1));
BSET (&buffer_local_flags, directory, make_number (-1));
BSET (&buffer_local_flags, backed_up, make_number (-1));
BSET (&buffer_local_flags, save_length, make_number (-1));
BSET (&buffer_local_flags, auto_save_file_name, make_number (-1));
BSET (&buffer_local_flags, read_only, make_number (-1));
BSET (&buffer_local_flags, major_mode, make_number (-1));
BSET (&buffer_local_flags, mode_name, make_number (-1));
BSET (&buffer_local_flags, undo_list, make_number (-1));
BSET (&buffer_local_flags, mark_active, make_number (-1));
BSET (&buffer_local_flags, point_before_scroll, make_number (-1));
BSET (&buffer_local_flags, file_truename, make_number (-1));
BSET (&buffer_local_flags, invisibility_spec, make_number (-1));
BSET (&buffer_local_flags, file_format, make_number (-1));
BSET (&buffer_local_flags, auto_save_file_format, make_number (-1));
BSET (&buffer_local_flags, display_count, make_number (-1));
BSET (&buffer_local_flags, display_time, make_number (-1));
BSET (&buffer_local_flags, enable_multibyte_characters, make_number (-1));
bset_filename (&buffer_local_flags, make_number (-1));
bset_directory (&buffer_local_flags, make_number (-1));
bset_backed_up (&buffer_local_flags, make_number (-1));
bset_save_length (&buffer_local_flags, make_number (-1));
bset_auto_save_file_name (&buffer_local_flags, make_number (-1));
bset_read_only (&buffer_local_flags, make_number (-1));
bset_major_mode (&buffer_local_flags, make_number (-1));
bset_mode_name (&buffer_local_flags, make_number (-1));
bset_undo_list (&buffer_local_flags, make_number (-1));
bset_mark_active (&buffer_local_flags, make_number (-1));
bset_point_before_scroll (&buffer_local_flags, make_number (-1));
bset_file_truename (&buffer_local_flags, make_number (-1));
bset_invisibility_spec (&buffer_local_flags, make_number (-1));
bset_file_format (&buffer_local_flags, make_number (-1));
bset_auto_save_file_format (&buffer_local_flags, make_number (-1));
bset_display_count (&buffer_local_flags, make_number (-1));
bset_display_time (&buffer_local_flags, make_number (-1));
bset_enable_multibyte_characters (&buffer_local_flags, make_number (-1));
idx = 1;
XSETFASTINT (BVAR (&buffer_local_flags, mode_line_format), idx); ++idx;
@ -5055,7 +5293,7 @@ init_buffer_once (void)
QSFundamental = build_pure_c_string ("Fundamental");
Qfundamental_mode = intern_c_string ("fundamental-mode");
BSET (&buffer_defaults, major_mode, Qfundamental_mode);
bset_major_mode (&buffer_defaults, Qfundamental_mode);
Qmode_class = intern_c_string ("mode-class");
@ -5118,13 +5356,13 @@ init_buffer (void)
len++;
}
BSET (current_buffer, directory, make_unibyte_string (pwd, len));
bset_directory (current_buffer, make_unibyte_string (pwd, len));
if (! NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
/* At this moment, we still don't know how to decode the
directory name. So, we keep the bytes in multibyte form so
that ENCODE_FILE correctly gets the original bytes. */
BSET (current_buffer, directory,
string_to_multibyte (BVAR (current_buffer, directory)));
bset_directory
(current_buffer, string_to_multibyte (BVAR (current_buffer, directory)));
/* Add /: to the front of the name
if it would otherwise be treated as magic. */
@ -5135,11 +5373,12 @@ init_buffer (void)
However, it is not necessary to turn / into /:/.
So avoid doing that. */
&& strcmp ("/", SSDATA (BVAR (current_buffer, directory))))
BSET (current_buffer, directory,
concat2 (build_string ("/:"), BVAR (current_buffer, directory)));
bset_directory
(current_buffer,
concat2 (build_string ("/:"), BVAR (current_buffer, directory)));
temp = get_minibuffer (0);
BSET (XBUFFER (temp), directory, BVAR (current_buffer, directory));
bset_directory (XBUFFER (temp), BVAR (current_buffer, directory));
free (pwd);
}

View file

@ -477,7 +477,6 @@ struct buffer_text
/* Most code should use this macro to access Lisp fields in struct buffer. */
#define BVAR(buf, field) ((buf)->INTERNAL_FIELD (field))
#define BSET(buf, field, value) ((buf)->INTERNAL_FIELD (field) = (value))
/* This is the structure that the buffer Lisp object points to. */
@ -862,6 +861,104 @@ struct buffer
Lisp_Object INTERNAL_FIELD (undo_list);
};
/* Most code should use these functions to set Lisp fields in struct
buffer. */
BUFFER_INLINE void
bset_bidi_paragraph_direction (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (bidi_paragraph_direction) = val;
}
BUFFER_INLINE void
bset_case_canon_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (case_canon_table) = val;
}
BUFFER_INLINE void
bset_case_eqv_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (case_eqv_table) = val;
}
BUFFER_INLINE void
bset_directory (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (directory) = val;
}
BUFFER_INLINE void
bset_display_count (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (display_count) = val;
}
BUFFER_INLINE void
bset_display_time (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (display_time) = val;
}
BUFFER_INLINE void
bset_downcase_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (downcase_table) = val;
}
BUFFER_INLINE void
bset_enable_multibyte_characters (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (enable_multibyte_characters) = val;
}
BUFFER_INLINE void
bset_filename (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (filename) = val;
}
BUFFER_INLINE void
bset_keymap (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (keymap) = val;
}
BUFFER_INLINE void
bset_last_selected_window (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (last_selected_window) = val;
}
BUFFER_INLINE void
bset_local_var_alist (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (local_var_alist) = val;
}
BUFFER_INLINE void
bset_mark_active (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (mark_active) = val;
}
BUFFER_INLINE void
bset_point_before_scroll (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (point_before_scroll) = val;
}
BUFFER_INLINE void
bset_read_only (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (read_only) = val;
}
BUFFER_INLINE void
bset_truncate_lines (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (truncate_lines) = val;
}
BUFFER_INLINE void
bset_undo_list (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (undo_list) = val;
}
BUFFER_INLINE void
bset_upcase_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (upcase_table) = val;
}
BUFFER_INLINE void
bset_width_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (width_table) = val;
}
/* Chain of all buffers, including killed ones. */
@ -949,7 +1046,7 @@ extern Lisp_Object Qfirst_change_hook;
/* Get text properties of B. */
BUFFER_INLINE INTERVAL
buffer_get_intervals (struct buffer *b)
buffer_intervals (struct buffer *b)
{
eassert (b->text != NULL);
return b->text->intervals;
@ -958,26 +1055,12 @@ buffer_get_intervals (struct buffer *b)
/* Set text properties of B to I. */
BUFFER_INLINE void
buffer_set_intervals (struct buffer *b, INTERVAL i)
set_buffer_intervals (struct buffer *b, INTERVAL i)
{
eassert (b->text != NULL);
b->text->intervals = i;
}
/* Set an appropriate overlay of B. */
BUFFER_INLINE void
buffer_set_overlays_before (struct buffer *b, struct Lisp_Overlay *o)
{
b->overlays_before = o;
}
BUFFER_INLINE void
buffer_set_overlays_after (struct buffer *b, struct Lisp_Overlay *o)
{
b->overlays_after = o;
}
/* Non-zero if current buffer has overlays. */
BUFFER_INLINE int
@ -1116,18 +1199,36 @@ extern int last_per_buffer_idx;
#define PER_BUFFER_IDX(OFFSET) \
XINT (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_flags))
/* Return the default value of the per-buffer variable at offset
OFFSET in the buffer structure. */
/* Functions to get and set default value of the per-buffer
variable at offset OFFSET in the buffer structure. */
#define PER_BUFFER_DEFAULT(OFFSET) \
(*(Lisp_Object *)((OFFSET) + (char *) &buffer_defaults))
BUFFER_INLINE Lisp_Object
per_buffer_default (int offset)
{
return *(Lisp_Object *)(offset + (char *) &buffer_defaults);
}
/* Return the buffer-local value of the per-buffer variable at offset
OFFSET in the buffer structure. */
BUFFER_INLINE void
set_per_buffer_default (int offset, Lisp_Object value)
{
*(Lisp_Object *)(offset + (char *) &buffer_defaults) = value;
}
/* Functions to get and set buffer-local value of the per-buffer
variable at offset OFFSET in the buffer structure. */
BUFFER_INLINE Lisp_Object
per_buffer_value (struct buffer *b, int offset)
{
return *(Lisp_Object *)(offset + (char *) b);
}
BUFFER_INLINE void
set_per_buffer_value (struct buffer *b, int offset, Lisp_Object value)
{
*(Lisp_Object *)(offset + (char *) b) = value;
}
#define PER_BUFFER_VALUE(BUFFER, OFFSET) \
(*(Lisp_Object *)((OFFSET) + (char *) (BUFFER)))
/* Downcase a character C, or make no change if that cannot be done. */
BUFFER_INLINE int
downcase (int c)

View file

@ -372,7 +372,7 @@ invoke it. If KEYS is omitted or nil, the return value of
Vthis_command = save_this_command;
Vthis_original_command = save_this_original_command;
Vreal_this_command = save_real_this_command;
KSET (current_kboard, Vlast_command, save_last_command);
kset_last_command (current_kboard, save_last_command);
temporarily_switch_to_single_kboard (NULL);
return unbind_to (speccount, apply1 (function, specs));
@ -843,7 +843,7 @@ invoke it. If KEYS is omitted or nil, the return value of
Vthis_command = save_this_command;
Vthis_original_command = save_this_original_command;
Vreal_this_command = save_real_this_command;
KSET (current_kboard, Vlast_command, save_last_command);
kset_last_command (current_kboard, save_last_command);
{
Lisp_Object val;

View file

@ -65,10 +65,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "nsterm.h"
#endif
#ifndef USE_CRT_DLL
extern char **environ;
#endif
#ifdef HAVE_SETPGID
#if !defined (USG)
#undef setpgrp

View file

@ -128,13 +128,13 @@ set_case_table (Lisp_Object table, int standard)
up = Fmake_char_table (Qcase_table, Qnil);
map_char_table (set_identity, Qnil, table, up);
map_char_table (shuffle, Qnil, table, up);
XCHAR_TABLE (table)->extras[0] = up;
set_char_table_extras (table, 0, up);
}
if (NILP (canon))
{
canon = Fmake_char_table (Qcase_table, Qnil);
XCHAR_TABLE (table)->extras[1] = canon;
set_char_table_extras (table, 1, canon);
map_char_table (set_canon, Qnil, table, table);
}
@ -143,11 +143,11 @@ set_case_table (Lisp_Object table, int standard)
eqv = Fmake_char_table (Qcase_table, Qnil);
map_char_table (set_identity, Qnil, canon, eqv);
map_char_table (shuffle, Qnil, canon, eqv);
XCHAR_TABLE (table)->extras[2] = eqv;
set_char_table_extras (table, 2, eqv);
}
/* This is so set_image_of_range_1 in regex.c can find the EQV table. */
XCHAR_TABLE (canon)->extras[2] = eqv;
set_char_table_extras (canon, 2, eqv);
if (standard)
{
@ -158,10 +158,10 @@ set_case_table (Lisp_Object table, int standard)
}
else
{
BSET (current_buffer, downcase_table, table);
BSET (current_buffer, upcase_table, up);
BSET (current_buffer, case_canon_table, canon);
BSET (current_buffer, case_eqv_table, eqv);
bset_downcase_table (current_buffer, table);
bset_upcase_table (current_buffer, up);
bset_case_canon_table (current_buffer, canon);
bset_case_eqv_table (current_buffer, eqv);
}
return table;
@ -260,7 +260,7 @@ init_casetab_once (void)
down = Fmake_char_table (Qcase_table, Qnil);
Vascii_downcase_table = down;
XCHAR_TABLE (down)->purpose = Qcase_table;
set_char_table_purpose (down, Qcase_table);
for (i = 0; i < 128; i++)
{
@ -268,10 +268,10 @@ init_casetab_once (void)
CHAR_TABLE_SET (down, i, make_number (c));
}
XCHAR_TABLE (down)->extras[1] = Fcopy_sequence (down);
set_char_table_extras (down, 1, Fcopy_sequence (down));
up = Fmake_char_table (Qcase_table, Qnil);
XCHAR_TABLE (down)->extras[0] = up;
set_char_table_extras (down, 0, up);
for (i = 0; i < 128; i++)
{
@ -281,7 +281,7 @@ init_casetab_once (void)
CHAR_TABLE_SET (up, i, make_number (c));
}
XCHAR_TABLE (down)->extras[2] = Fcopy_sequence (up);
set_char_table_extras (down, 2, Fcopy_sequence (up));
/* Fill in what isn't filled in. */
set_case_table (down, 1);

View file

@ -32,7 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define CATEGORY_INLINE EXTERN_INLINE
#include <ctype.h>
#include <setjmp.h>
#include "lisp.h"
#include "character.h"
@ -41,6 +40,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "category.h"
#include "keymap.h"
/* This setter is used only in this file, so it can be private. */
static inline void
bset_category_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (category_table) = val;
}
/* The version number of the latest category table. Each category
table has a unique version number. It is assigned a new number
also when it is modified. When a regular expression is compiled
@ -71,11 +77,12 @@ hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
EMACS_UINT hash;
if (NILP (XCHAR_TABLE (table)->extras[1]))
XCHAR_TABLE (table)->extras[1]
= make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
make_float (DEFAULT_REHASH_SIZE),
make_float (DEFAULT_REHASH_THRESHOLD),
Qnil, Qnil, Qnil);
set_char_table_extras
(table, 1,
make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
make_float (DEFAULT_REHASH_SIZE),
make_float (DEFAULT_REHASH_THRESHOLD),
Qnil, Qnil, Qnil));
h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]);
i = hash_lookup (h, category_set, &hash);
if (i >= 0)
@ -136,7 +143,7 @@ the current buffer's category table. */)
error ("Category `%c' is already defined", (int) XFASTINT (category));
if (!NILP (Vpurify_flag))
docstring = Fpurecopy (docstring);
CATEGORY_DOCSTRING (table, XFASTINT (category)) = docstring;
SET_CATEGORY_DOCSTRING (table, XFASTINT (category), docstring);
return Qnil;
}
@ -238,10 +245,10 @@ copy_category_table (Lisp_Object table)
table = copy_char_table (table);
if (! NILP (XCHAR_TABLE (table)->defalt))
XCHAR_TABLE (table)->defalt
= Fcopy_sequence (XCHAR_TABLE (table)->defalt);
XCHAR_TABLE (table)->extras[0]
= Fcopy_sequence (XCHAR_TABLE (table)->extras[0]);
set_char_table_defalt (table,
Fcopy_sequence (XCHAR_TABLE (table)->defalt));
set_char_table_extras
(table, 0, Fcopy_sequence (XCHAR_TABLE (table)->extras[0]));
map_char_table (copy_category_entry, Qnil, table, table);
return table;
@ -270,9 +277,9 @@ DEFUN ("make-category-table", Fmake_category_table, Smake_category_table,
int i;
val = Fmake_char_table (Qcategory_table, Qnil);
XCHAR_TABLE (val)->defalt = MAKE_CATEGORY_SET;
set_char_table_defalt (val, MAKE_CATEGORY_SET);
for (i = 0; i < (1 << CHARTAB_SIZE_BITS_0); i++)
XCHAR_TABLE (val)->contents[i] = MAKE_CATEGORY_SET;
set_char_table_contents (val, i, MAKE_CATEGORY_SET);
Fset_char_table_extra_slot (val, make_number (0),
Fmake_vector (make_number (95), Qnil));
return val;
@ -285,7 +292,7 @@ Return TABLE. */)
{
int idx;
table = check_category_table (table);
BSET (current_buffer, category_table, table);
bset_category_table (current_buffer, table);
/* Indicate that this buffer now has a specified category table. */
idx = PER_BUFFER_VAR_IDX (category_table);
SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
@ -466,7 +473,7 @@ init_category_once (void)
Vstandard_category_table = Fmake_char_table (Qcategory_table, Qnil);
/* Set a category set which contains nothing to the default. */
XCHAR_TABLE (Vstandard_category_table)->defalt = MAKE_CATEGORY_SET;
set_char_table_defalt (Vstandard_category_table, MAKE_CATEGORY_SET);
Fset_char_table_extra_slot (Vstandard_category_table, make_number (0),
Fmake_vector (make_number (95), Qnil));
}

View file

@ -96,8 +96,12 @@ CHAR_HAS_CATEGORY (int ch, int category)
#define Vstandard_category_table BVAR (&buffer_defaults, category_table)
/* Return the doc string of CATEGORY in category table TABLE. */
#define CATEGORY_DOCSTRING(table, category) \
XVECTOR (Fchar_table_extra_slot (table, make_number (0)))->contents[(category) - ' ']
#define CATEGORY_DOCSTRING(table, category) \
AREF (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' '))
/* Set the doc string of CATEGORY to VALUE in category table TABLE. */
#define SET_CATEGORY_DOCSTRING(table, category, value) \
ASET (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' '), value)
/* Return the version number of category table TABLE. Not used for
the moment. */

View file

@ -30,10 +30,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <unistd.h>
#include <ctype.h>
#include <limits.h>
#include <sys/types.h>
#include <setjmp.h>
#include <c-ctype.h>
#include "lisp.h"
#include "character.h"
#include "charset.h"
@ -446,7 +446,7 @@ read_hex (FILE *fp, int *eof, int *overflow)
return 0;
}
n = 0;
while (isxdigit (c = getc (fp)))
while (c_isxdigit (c = getc (fp)))
{
if (UINT_MAX >> 4 < n)
*overflow = 1;
@ -1131,7 +1131,7 @@ usage: (define-charset-internal ...) */)
{
new_definition_p = 0;
id = XFASTINT (CHARSET_SYMBOL_ID (args[charset_arg_name]));
set_hash_value (hash_table, charset.hash_index, attrs);
set_hash_value_slot (hash_table, charset.hash_index, attrs);
}
else
{

View file

@ -115,8 +115,8 @@ the char-table has no extra slot. */)
size = VECSIZE (struct Lisp_Char_Table) - 1 + n_extras;
vector = Fmake_vector (make_number (size), init);
XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE);
XCHAR_TABLE (vector)->parent = Qnil;
XCHAR_TABLE (vector)->purpose = purpose;
set_char_table_parent (vector, Qnil);
set_char_table_purpose (vector, purpose);
XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
return vector;
}
@ -155,21 +155,17 @@ char_table_ascii (Lisp_Object table)
static Lisp_Object
copy_sub_char_table (Lisp_Object table)
{
Lisp_Object copy;
int depth = XINT (XSUB_CHAR_TABLE (table)->depth);
int min_char = XINT (XSUB_CHAR_TABLE (table)->min_char);
Lisp_Object val;
Lisp_Object copy = make_sub_char_table (depth, min_char, Qnil);
int i;
copy = make_sub_char_table (depth, min_char, Qnil);
/* Recursively copy any sub char-tables. */
for (i = 0; i < chartab_size[depth]; i++)
{
val = XSUB_CHAR_TABLE (table)->contents[i];
if (SUB_CHAR_TABLE_P (val))
XSUB_CHAR_TABLE (copy)->contents[i] = copy_sub_char_table (val);
else
XSUB_CHAR_TABLE (copy)->contents[i] = val;
Lisp_Object val = XSUB_CHAR_TABLE (table)->contents[i];
set_sub_char_table_contents
(copy, i, SUB_CHAR_TABLE_P (val) ? copy_sub_char_table (val) : val);
}
return copy;
@ -185,18 +181,19 @@ copy_char_table (Lisp_Object table)
copy = Fmake_vector (make_number (size), Qnil);
XSETPVECTYPE (XVECTOR (copy), PVEC_CHAR_TABLE);
XCHAR_TABLE (copy)->defalt = XCHAR_TABLE (table)->defalt;
XCHAR_TABLE (copy)->parent = XCHAR_TABLE (table)->parent;
XCHAR_TABLE (copy)->purpose = XCHAR_TABLE (table)->purpose;
set_char_table_defalt (copy, XCHAR_TABLE (table)->defalt);
set_char_table_parent (copy, XCHAR_TABLE (table)->parent);
set_char_table_purpose (copy, XCHAR_TABLE (table)->purpose);
for (i = 0; i < chartab_size[0]; i++)
XCHAR_TABLE (copy)->contents[i]
= (SUB_CHAR_TABLE_P (XCHAR_TABLE (table)->contents[i])
? copy_sub_char_table (XCHAR_TABLE (table)->contents[i])
: XCHAR_TABLE (table)->contents[i]);
XCHAR_TABLE (copy)->ascii = char_table_ascii (copy);
set_char_table_contents
(copy, i,
(SUB_CHAR_TABLE_P (XCHAR_TABLE (table)->contents[i])
? copy_sub_char_table (XCHAR_TABLE (table)->contents[i])
: XCHAR_TABLE (table)->contents[i]));
set_char_table_ascii (copy, char_table_ascii (copy));
size -= VECSIZE (struct Lisp_Char_Table) - 1;
for (i = 0; i < size; i++)
XCHAR_TABLE (copy)->extras[i] = XCHAR_TABLE (table)->extras[i];
set_char_table_extras (copy, i, XCHAR_TABLE (table)->extras[i]);
XSETCHAR_TABLE (copy, XCHAR_TABLE (copy));
return copy;
@ -394,7 +391,7 @@ sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, int is_uniprop)
Lisp_Object sub;
if (depth == 3)
tbl->contents[i] = val;
set_sub_char_table_contents (table, i, val);
else
{
sub = tbl->contents[i];
@ -407,23 +404,21 @@ sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, int is_uniprop)
sub = make_sub_char_table (depth + 1,
min_char + i * chartab_chars[depth],
sub);
tbl->contents[i] = sub;
set_sub_char_table_contents (table, i, sub);
}
}
sub_char_table_set (sub, c, val, is_uniprop);
}
}
Lisp_Object
void
char_table_set (Lisp_Object table, int c, Lisp_Object val)
{
struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
if (ASCII_CHAR_P (c)
&& SUB_CHAR_TABLE_P (tbl->ascii))
{
XSUB_CHAR_TABLE (tbl->ascii)->contents[c] = val;
}
set_sub_char_table_contents (tbl->ascii, c, val);
else
{
int i = CHARTAB_IDX (c, 0, 0);
@ -433,13 +428,12 @@ char_table_set (Lisp_Object table, int c, Lisp_Object val)
if (! SUB_CHAR_TABLE_P (sub))
{
sub = make_sub_char_table (1, i * chartab_chars[0], sub);
tbl->contents[i] = sub;
set_char_table_contents (table, i, sub);
}
sub_char_table_set (sub, c, val, UNIPROP_TABLE_P (table));
if (ASCII_CHAR_P (c))
tbl->ascii = char_table_ascii (table);
set_char_table_ascii (table, char_table_ascii (table));
}
return val;
}
static void
@ -461,7 +455,7 @@ sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val,
if (c > to)
break;
if (from <= c && c + chars_in_block - 1 <= to)
tbl->contents[i] = val;
set_sub_char_table_contents (table, i, val);
else
{
Lisp_Object sub = tbl->contents[i];
@ -472,7 +466,7 @@ sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val,
else
{
sub = make_sub_char_table (depth + 1, c, sub);
tbl->contents[i] = sub;
set_sub_char_table_contents (table, i, sub);
}
}
sub_char_table_set_range (sub, from, to, val, is_uniprop);
@ -481,7 +475,7 @@ sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val,
}
Lisp_Object
void
char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val)
{
struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
@ -500,22 +494,21 @@ char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val)
if (c > to)
break;
if (from <= c && c + chartab_chars[0] - 1 <= to)
tbl->contents[i] = val;
set_char_table_contents (table, i, val);
else
{
Lisp_Object sub = tbl->contents[i];
if (! SUB_CHAR_TABLE_P (sub))
{
sub = make_sub_char_table (1, i * chartab_chars[0], sub);
tbl->contents[i] = sub;
set_char_table_contents (table, i, sub);
}
sub_char_table_set_range (sub, from, to, val, is_uniprop);
}
}
if (ASCII_CHAR_P (from))
tbl->ascii = char_table_ascii (table);
set_char_table_ascii (table, char_table_ascii (table));
}
return val;
}
@ -563,7 +556,7 @@ Return PARENT. PARENT must be either nil or another char-table. */)
error ("Attempt to make a chartable be its own parent");
}
XCHAR_TABLE (char_table)->parent = parent;
set_char_table_parent (char_table, parent);
return parent;
}
@ -594,7 +587,8 @@ DEFUN ("set-char-table-extra-slot", Fset_char_table_extra_slot,
|| XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table)))
args_out_of_range (char_table, n);
return XCHAR_TABLE (char_table)->extras[XINT (n)] = value;
set_char_table_extras (char_table, XINT (n), value);
return value;
}
DEFUN ("char-table-range", Fchar_table_range, Schar_table_range,
@ -640,12 +634,12 @@ or a character code. Return VALUE. */)
{
int i;
XCHAR_TABLE (char_table)->ascii = value;
set_char_table_ascii (char_table, value);
for (i = 0; i < chartab_size[0]; i++)
XCHAR_TABLE (char_table)->contents[i] = value;
set_char_table_contents (char_table, i, value);
}
else if (EQ (range, Qnil))
XCHAR_TABLE (char_table)->defalt = value;
set_char_table_defalt (char_table, value);
else if (CHARACTERP (range))
char_table_set (char_table, XINT (range), value);
else if (CONSP (range))
@ -693,15 +687,19 @@ optimize_sub_char_table (Lisp_Object table, Lisp_Object test)
elt = XSUB_CHAR_TABLE (table)->contents[0];
if (SUB_CHAR_TABLE_P (elt))
elt = XSUB_CHAR_TABLE (table)->contents[0]
= optimize_sub_char_table (elt, test);
{
elt = optimize_sub_char_table (elt, test);
set_sub_char_table_contents (table, 0, elt);
}
optimizable = SUB_CHAR_TABLE_P (elt) ? 0 : 1;
for (i = 1; i < chartab_size[depth]; i++)
{
this = XSUB_CHAR_TABLE (table)->contents[i];
if (SUB_CHAR_TABLE_P (this))
this = XSUB_CHAR_TABLE (table)->contents[i]
= optimize_sub_char_table (this, test);
{
this = optimize_sub_char_table (this, test);
set_sub_char_table_contents (table, i, this);
}
if (optimizable
&& (NILP (test) ? NILP (Fequal (this, elt)) /* defaults to `equal'. */
: EQ (test, Qeq) ? !EQ (this, elt) /* Optimize `eq' case. */
@ -728,11 +726,11 @@ equivalent and can be merged. It defaults to `equal'. */)
{
elt = XCHAR_TABLE (char_table)->contents[i];
if (SUB_CHAR_TABLE_P (elt))
XCHAR_TABLE (char_table)->contents[i]
= optimize_sub_char_table (elt, test);
set_char_table_contents
(char_table, i, optimize_sub_char_table (elt, test));
}
/* Reset the `ascii' cache, in case it got optimized away. */
XCHAR_TABLE (char_table)->ascii = char_table_ascii (char_table);
set_char_table_ascii (char_table, char_table_ascii (char_table));
return Qnil;
}
@ -824,9 +822,9 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object),
/* This is to get a value of FROM in PARENT
without checking the parent of PARENT. */
XCHAR_TABLE (parent)->parent = Qnil;
set_char_table_parent (parent, Qnil);
val = CHAR_TABLE_REF (parent, from);
XCHAR_TABLE (parent)->parent = temp;
set_char_table_parent (parent, temp);
XSETCDR (range, make_number (c - 1));
val = map_sub_char_table (c_function, function,
parent, arg, val, range,
@ -906,9 +904,9 @@ map_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object),
temp = XCHAR_TABLE (parent)->parent;
/* This is to get a value of FROM in PARENT without checking the
parent of PARENT. */
XCHAR_TABLE (parent)->parent = Qnil;
set_char_table_parent (parent, Qnil);
val = CHAR_TABLE_REF (parent, from);
XCHAR_TABLE (parent)->parent = temp;
set_char_table_parent (parent, temp);
val = map_sub_char_table (c_function, function, parent, arg, val, range,
parent);
table = parent;
@ -1143,10 +1141,9 @@ uniprop_table_uncompress (Lisp_Object table, int idx)
int min_char = (XINT (XSUB_CHAR_TABLE (table)->min_char)
+ chartab_chars[2] * idx);
Lisp_Object sub = make_sub_char_table (3, min_char, Qnil);
struct Lisp_Sub_Char_Table *subtbl = XSUB_CHAR_TABLE (sub);
const unsigned char *p, *pend;
XSUB_CHAR_TABLE (table)->contents[idx] = sub;
set_sub_char_table_contents (table, idx, sub);
p = SDATA (val), pend = p + SBYTES (val);
if (*p == 1)
{
@ -1156,7 +1153,8 @@ uniprop_table_uncompress (Lisp_Object table, int idx)
while (p < pend && idx < chartab_chars[2])
{
int v = STRING_CHAR_ADVANCE (p);
subtbl->contents[idx++] = v > 0 ? make_number (v) : Qnil;
set_sub_char_table_contents
(sub, idx++, v > 0 ? make_number (v) : Qnil);
}
}
else if (*p == 2)
@ -1181,7 +1179,7 @@ uniprop_table_uncompress (Lisp_Object table, int idx)
}
}
while (count-- > 0)
subtbl->contents[idx++] = make_number (v);
set_sub_char_table_contents (sub, idx++, make_number (v));
}
}
/* It seems that we don't need this function because C code won't need
@ -1284,7 +1282,7 @@ uniprop_encode_value_numeric (Lisp_Object table, Lisp_Object value)
args[0] = XCHAR_TABLE (table)->extras[4];
args[1] = Fmake_vector (make_number (1), value);
XCHAR_TABLE (table)->extras[4] = Fvconcat (2, args);
set_char_table_extras (table, 4, Fvconcat (2, args));
}
return make_number (i);
}
@ -1346,7 +1344,7 @@ uniprop_table (Lisp_Object prop)
: ! NILP (val))
return Qnil;
/* Prepare ASCII values in advance for CHAR_TABLE_REF. */
XCHAR_TABLE (table)->ascii = char_table_ascii (table);
set_char_table_ascii (table, char_table_ascii (table));
return table;
}

View file

@ -301,7 +301,7 @@ At the end, it runs `post-self-insert-hook'. */)
added be explicit calls to undo-boundary. */
&& EQ (BVAR (current_buffer, undo_list), last_undo_boundary))
/* Remove the undo_boundary that was just pushed. */
BSET (current_buffer, undo_list, XCDR (BVAR (current_buffer, undo_list)));
bset_undo_list (current_buffer, XCDR (BVAR (current_buffer, undo_list)));
/* Barf if the key that invoked this was not a character. */
if (!CHARACTERP (last_command_event))

View file

@ -7112,7 +7112,7 @@ decode_coding (struct coding_system *coding)
record_first_change ();
undo_list = BVAR (current_buffer, undo_list);
BSET (current_buffer, undo_list, Qt);
bset_undo_list (current_buffer, Qt);
}
coding->consumed = coding->consumed_char = 0;
@ -7209,7 +7209,7 @@ decode_coding (struct coding_system *coding)
decode_eol (coding);
if (BUFFERP (coding->dst_object))
{
BSET (current_buffer, undo_list, undo_list);
bset_undo_list (current_buffer, undo_list);
record_insert (coding->dst_pos, coding->produced_char);
}
return coding->result;
@ -7577,8 +7577,8 @@ make_conversion_work_buffer (int multibyte)
doesn't compile new regexps. */
Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt);
Ferase_buffer ();
BSET (current_buffer, undo_list, Qt);
BSET (current_buffer, enable_multibyte_characters, multibyte ? Qt : Qnil);
bset_undo_list (current_buffer, Qt);
bset_enable_multibyte_characters (current_buffer, multibyte ? Qt : Qnil);
set_buffer_internal (current);
return workbuf;
}
@ -9302,10 +9302,10 @@ DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_intern
terminal_coding->common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK;
terminal_coding->src_multibyte = 1;
terminal_coding->dst_multibyte = 0;
if (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK)
TSET (term, charset_list, coding_charset_list (terminal_coding));
else
TSET (term, charset_list, Fcons (make_number (charset_ascii), Qnil));
tset_charset_list
(term, (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK
? coding_charset_list (terminal_coding)
: Fcons (make_number (charset_ascii), Qnil)));
return Qnil;
}

View file

@ -580,7 +580,7 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
else
{
swap_in_symval_forwarding (sym, blv);
valcontents = BLV_VALUE (blv);
valcontents = blv_value (blv);
}
break;
}
@ -884,7 +884,7 @@ do_symval_forwarding (register union Lisp_Fwd *valcontents)
return *XOBJFWD (valcontents)->objvar;
case Lisp_Fwd_Buffer_Obj:
return PER_BUFFER_VALUE (current_buffer,
return per_buffer_value (current_buffer,
XBUFFER_OBJFWD (valcontents)->offset);
case Lisp_Fwd_Kboard_Obj:
@ -956,7 +956,7 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva
b = XBUFFER (lbuf);
if (! PER_BUFFER_VALUE_P (b, idx))
PER_BUFFER_VALUE (b, offset) = newval;
set_per_buffer_value (b, offset, newval);
}
}
break;
@ -974,7 +974,7 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva
if (buf == NULL)
buf = current_buffer;
PER_BUFFER_VALUE (buf, offset) = newval;
set_per_buffer_value (buf, offset, newval);
}
break;
@ -1001,16 +1001,16 @@ swap_in_global_binding (struct Lisp_Symbol *symbol)
/* Unload the previously loaded binding. */
if (blv->fwd)
SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd));
set_blv_value (blv, do_symval_forwarding (blv->fwd));
/* Select the global binding in the symbol. */
blv->valcell = blv->defcell;
set_blv_valcell (blv, blv->defcell);
if (blv->fwd)
store_symval_forwarding (blv->fwd, XCDR (blv->defcell), NULL);
/* Indicate that the global binding is set up now. */
blv->where = Qnil;
SET_BLV_FOUND (blv, 0);
set_blv_where (blv, Qnil);
set_blv_found (blv, 0);
}
/* Set up the buffer-local symbol SYMBOL for validity in the current buffer.
@ -1038,7 +1038,7 @@ swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_
/* Unload the previously loaded binding. */
tem1 = blv->valcell;
if (blv->fwd)
SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd));
set_blv_value (blv, do_symval_forwarding (blv->fwd));
/* Choose the new binding. */
{
Lisp_Object var;
@ -1046,7 +1046,7 @@ swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_
if (blv->frame_local)
{
tem1 = assq_no_quit (var, XFRAME (selected_frame)->param_alist);
blv->where = selected_frame;
set_blv_where (blv, selected_frame);
}
else
{
@ -1058,9 +1058,9 @@ swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_
tem1 = blv->defcell;
/* Load the new binding. */
blv->valcell = tem1;
set_blv_valcell (blv, tem1);
if (blv->fwd)
store_symval_forwarding (blv->fwd, BLV_VALUE (blv), NULL);
store_symval_forwarding (blv->fwd, blv_value (blv), NULL);
}
}
@ -1087,7 +1087,7 @@ find_symbol_value (Lisp_Object symbol)
{
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
swap_in_symval_forwarding (sym, blv);
return blv->fwd ? do_symval_forwarding (blv->fwd) : BLV_VALUE (blv);
return blv->fwd ? do_symval_forwarding (blv->fwd) : blv_value (blv);
}
/* FALLTHROUGH */
case SYMBOL_FORWARDED:
@ -1212,7 +1212,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
/* Write out `realvalue' to the old loaded binding. */
if (blv->fwd)
SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd));
set_blv_value (blv, do_symval_forwarding (blv->fwd));
/* Find the new binding. */
XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */
@ -1220,7 +1220,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
(blv->frame_local
? XFRAME (where)->param_alist
: BVAR (XBUFFER (where), local_var_alist)));
blv->where = where;
set_blv_where (blv, where);
blv->found = 1;
if (NILP (tem1))
@ -1250,17 +1250,18 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
bindings, not for frame-local bindings. */
eassert (!blv->frame_local);
tem1 = Fcons (symbol, XCDR (blv->defcell));
BSET (XBUFFER (where), local_var_alist,
Fcons (tem1, BVAR (XBUFFER (where), local_var_alist)));
bset_local_var_alist
(XBUFFER (where),
Fcons (tem1, BVAR (XBUFFER (where), local_var_alist)));
}
}
/* Record which binding is now loaded. */
blv->valcell = tem1;
set_blv_valcell (blv, tem1);
}
/* Store the new value in the cons cell. */
SET_BLV_VALUE (blv, newval);
set_blv_value (blv, newval);
if (blv->fwd)
{
@ -1345,7 +1346,7 @@ default_value (Lisp_Object symbol)
{
int offset = XBUFFER_OBJFWD (valcontents)->offset;
if (PER_BUFFER_IDX (offset) != 0)
return PER_BUFFER_DEFAULT (offset);
return per_buffer_default (offset);
}
/* For other variables, get the current value. */
@ -1432,7 +1433,7 @@ for this variable. */)
int offset = XBUFFER_OBJFWD (valcontents)->offset;
int idx = PER_BUFFER_IDX (offset);
PER_BUFFER_DEFAULT (offset) = value;
set_per_buffer_default (offset, value);
/* If this variable is not always local in all buffers,
set it in the buffers that don't nominally have a local value. */
@ -1442,7 +1443,7 @@ for this variable. */)
FOR_EACH_BUFFER (b)
if (!PER_BUFFER_VALUE_P (b, idx))
PER_BUFFER_VALUE (b, offset) = value;
set_per_buffer_value (b, offset, value);
}
return value;
}
@ -1516,12 +1517,12 @@ make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents
eassert (!(forwarded && BUFFER_OBJFWDP (valcontents.fwd)));
eassert (!(forwarded && KBOARD_OBJFWDP (valcontents.fwd)));
blv->fwd = forwarded ? valcontents.fwd : NULL;
blv->where = Qnil;
set_blv_where (blv, Qnil);
blv->frame_local = 0;
blv->local_if_set = 0;
blv->defcell = tem;
blv->valcell = tem;
SET_BLV_FOUND (blv, 0);
set_blv_defcell (blv, tem);
set_blv_valcell (blv, tem);
set_blv_found (blv, 0);
return blv;
}
@ -1690,17 +1691,16 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
default value. */
find_symbol_value (variable);
BSET (current_buffer, local_var_alist,
Fcons (Fcons (variable, XCDR (blv->defcell)),
BVAR (current_buffer, local_var_alist)));
bset_local_var_alist
(current_buffer,
Fcons (Fcons (variable, XCDR (blv->defcell)),
BVAR (current_buffer, local_var_alist)));
/* Make sure symbol does not think it is set up for this buffer;
force it to look once again for this buffer's value. */
if (current_buffer == XBUFFER (blv->where))
blv->where = Qnil;
/* blv->valcell = blv->defcell;
* SET_BLV_FOUND (blv, 0); */
blv->found = 0;
set_blv_where (blv, Qnil);
set_blv_found (blv, 0);
}
/* If the symbol forwards into a C variable, then load the binding
@ -1742,8 +1742,8 @@ From now on the default value will apply in this buffer. Return VARIABLE. */)
if (idx > 0)
{
SET_PER_BUFFER_VALUE_P (current_buffer, idx, 0);
PER_BUFFER_VALUE (current_buffer, offset)
= PER_BUFFER_DEFAULT (offset);
set_per_buffer_value (current_buffer, offset,
per_buffer_default (offset));
}
}
return variable;
@ -1760,8 +1760,9 @@ From now on the default value will apply in this buffer. Return VARIABLE. */)
XSETSYMBOL (variable, sym); /* Propagate variable indirection. */
tem = Fassq (variable, BVAR (current_buffer, local_var_alist));
if (!NILP (tem))
BSET (current_buffer, local_var_alist,
Fdelq (tem, BVAR (current_buffer, local_var_alist)));
bset_local_var_alist
(current_buffer,
Fdelq (tem, BVAR (current_buffer, local_var_alist)));
/* If the symbol is set up with the current buffer's binding
loaded, recompute its value. We have to do it now, or else
@ -1770,9 +1771,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */)
Lisp_Object buf; XSETBUFFER (buf, current_buffer);
if (EQ (buf, blv->where))
{
blv->where = Qnil;
/* blv->valcell = blv->defcell;
* SET_BLV_FOUND (blv, 0); */
set_blv_where (blv, Qnil);
blv->found = 0;
find_symbol_value (variable);
}
@ -1894,11 +1893,11 @@ BUFFER defaults to the current buffer. */)
if (EQ (variable, XCAR (elt)))
{
eassert (!blv->frame_local);
eassert (BLV_FOUND (blv) || !EQ (blv->where, tmp));
eassert (blv_found (blv) || !EQ (blv->where, tmp));
return Qt;
}
}
eassert (!BLV_FOUND (blv) || !EQ (blv->where, tmp));
eassert (!blv_found (blv) || !EQ (blv->where, tmp));
return Qnil;
}
case SYMBOL_FORWARDED:
@ -1988,7 +1987,7 @@ If the current binding is global (the default), the value is nil. */)
if (!NILP (Flocal_variable_p (variable, Qnil)))
return Fcurrent_buffer ();
else if (sym->redirect == SYMBOL_LOCALIZED
&& BLV_FOUND (SYMBOL_BLV (sym)))
&& blv_found (SYMBOL_BLV (sym)))
return SYMBOL_BLV (sym)->where;
else
return Qnil;

View file

@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <signal.h>
#include <stdio.h>
#include <ctype.h>
#include <setjmp.h>
#include <unistd.h>
@ -622,7 +621,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
are invalidated below. */
if (INTEGERP (w->window_end_vpos)
&& XFASTINT (w->window_end_vpos) >= i)
WSET (w, window_end_valid, Qnil);
wset_window_end_valid (w, Qnil);
while (i < matrix->nrows)
matrix->rows[i++].enabled_p = 0;
@ -879,7 +878,7 @@ clear_window_matrices (struct window *w, int desired_p)
else
{
clear_glyph_matrix (w->current_matrix);
WSET (w, window_end_valid, Qnil);
wset_window_end_valid (w, Qnil);
}
}
@ -1888,14 +1887,14 @@ adjust_frame_glyphs_initially (void)
int top_margin = FRAME_TOP_MARGIN (sf);
/* Do it for the root window. */
WSET (root, top_line, make_number (top_margin));
WSET (root, total_lines, make_number (frame_lines - 1 - top_margin));
WSET (root, total_cols, make_number (frame_cols));
wset_top_line (root, make_number (top_margin));
wset_total_lines (root, make_number (frame_lines - 1 - top_margin));
wset_total_cols (root, make_number (frame_cols));
/* Do it for the mini-buffer window. */
WSET (mini, top_line, make_number (frame_lines - 1));
WSET (mini, total_lines, make_number (1));
WSET (mini, total_cols, make_number (frame_cols));
wset_top_line (mini, make_number (frame_lines - 1));
wset_total_lines (mini, make_number (1));
wset_total_cols (mini, make_number (frame_cols));
adjust_frame_glyphs (sf);
glyphs_initialized_initially_p = 1;
@ -2167,10 +2166,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
if (NILP (f->menu_bar_window))
{
Lisp_Object frame;
FSET (f, menu_bar_window, make_window ());
fset_menu_bar_window (f, make_window ());
w = XWINDOW (f->menu_bar_window);
XSETFRAME (frame, f);
WSET (w, frame, frame);
wset_frame (w, frame);
w->pseudo_window_p = 1;
}
else
@ -2178,10 +2177,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
/* Set window dimensions to frame dimensions and allocate or
adjust glyph matrices of W. */
WSET (w, top_line, make_number (0));
WSET (w, left_col, make_number (0));
WSET (w, total_lines, make_number (FRAME_MENU_BAR_LINES (f)));
WSET (w, total_cols, make_number (FRAME_TOTAL_COLS (f)));
wset_top_line (w, make_number (0));
wset_left_col (w, make_number (0));
wset_total_lines (w, make_number (FRAME_MENU_BAR_LINES (f)));
wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f)));
allocate_matrices_for_window_redisplay (w);
}
#endif /* not USE_X_TOOLKIT && not USE_GTK */
@ -2195,19 +2194,19 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
if (NILP (f->tool_bar_window))
{
Lisp_Object frame;
FSET (f, tool_bar_window, make_window ());
fset_tool_bar_window (f, make_window ());
w = XWINDOW (f->tool_bar_window);
XSETFRAME (frame, f);
WSET (w, frame, frame);
wset_frame (w, frame);
w->pseudo_window_p = 1;
}
else
w = XWINDOW (f->tool_bar_window);
WSET (w, top_line, make_number (FRAME_MENU_BAR_LINES (f)));
WSET (w, left_col, make_number (0));
WSET (w, total_lines, make_number (FRAME_TOOL_BAR_LINES (f)));
WSET (w, total_cols, make_number (FRAME_TOTAL_COLS (f)));
wset_top_line (w, make_number (FRAME_MENU_BAR_LINES (f)));
wset_left_col (w, make_number (0));
wset_total_lines (w, make_number (FRAME_TOOL_BAR_LINES (f)));
wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f)));
allocate_matrices_for_window_redisplay (w);
}
#endif
@ -2273,7 +2272,7 @@ free_glyphs (struct frame *f)
free_glyph_matrix (w->desired_matrix);
free_glyph_matrix (w->current_matrix);
w->desired_matrix = w->current_matrix = NULL;
FSET (f, menu_bar_window, Qnil);
fset_menu_bar_window (f, Qnil);
}
/* Free the tool bar window and its glyph matrices. */
@ -2283,7 +2282,7 @@ free_glyphs (struct frame *f)
free_glyph_matrix (w->desired_matrix);
free_glyph_matrix (w->current_matrix);
w->desired_matrix = w->current_matrix = NULL;
FSET (f, tool_bar_window, Qnil);
fset_tool_bar_window (f, Qnil);
}
/* Release frame glyph matrices. Reset fields to zero in
@ -3221,8 +3220,8 @@ update_frame (struct frame *f, int force_p, int inhibit_hairy_id_p)
/* Swap tool-bar strings. We swap because we want to
reuse strings. */
tem = f->current_tool_bar_string;
FSET (f, current_tool_bar_string, f->desired_tool_bar_string);
FSET (f, desired_tool_bar_string, tem);
fset_current_tool_bar_string (f, f->desired_tool_bar_string);
fset_desired_tool_bar_string (f, tem);
}
}
@ -5745,7 +5744,7 @@ change_frame_size_1 (register struct frame *f, int newheight, int newwidth, int
FrameCols (FRAME_TTY (f)) = newwidth;
if (WINDOWP (f->tool_bar_window))
WSET (XWINDOW (f->tool_bar_window), total_cols, make_number (newwidth));
wset_total_cols (XWINDOW (f->tool_bar_window), make_number (newwidth));
}
FRAME_LINES (f) = newheight;

View file

@ -22,11 +22,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/file.h> /* Must be after sys/types.h for USG*/
#include <ctype.h>
#include <setjmp.h>
#include <fcntl.h>
#include <unistd.h>
#include <c-ctype.h>
#include "lisp.h"
#include "character.h"
#include "buffer.h"
@ -597,9 +598,9 @@ the same file name is found in the `doc-directory'. */)
{
ptrdiff_t len;
while (*beg && isspace (*beg)) ++beg;
while (*beg && c_isspace (*beg)) ++beg;
for (end = beg; *end && ! isspace (*end); ++end)
for (end = beg; *end && ! c_isspace (*end); ++end)
if (*end == '/') beg = end+1; /* skip directory part */
len = end - beg;

View file

@ -102,7 +102,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <ctype.h>
#include <setjmp.h>
#include <float.h>
#include <unistd.h>

View file

@ -473,7 +473,7 @@ x_set_title (struct frame *f, Lisp_Object name)
update_mode_lines = 1;
FSET (f, title, name);
fset_title (f, name);
if (NILP (name))
name = f->name;

View file

@ -44,7 +44,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/resource.h>
#endif
#include <ctype.h>
#include <float.h>
#include <limits.h>
#include <intprops.h>
@ -59,10 +58,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "window.h"
#include "blockinput.h"
#ifndef USE_CRT_DLL
extern char **environ;
#endif
#define TM_YEAR_BASE 1900
#ifdef WINDOWSNT
@ -882,7 +877,7 @@ save_excursion_restore (Lisp_Object info)
info = XCDR (info);
tem = XCAR (info);
tem1 = BVAR (current_buffer, mark_active);
BSET (current_buffer, mark_active, tem);
bset_mark_active (current_buffer, tem);
/* If mark is active now, and either was not active
or was at a different place, run the activate hook. */
@ -2816,13 +2811,15 @@ determines whether case is significant or ignored. */)
static Lisp_Object
subst_char_in_region_unwind (Lisp_Object arg)
{
return BSET (current_buffer, undo_list, arg);
bset_undo_list (current_buffer, arg);
return arg;
}
static Lisp_Object
subst_char_in_region_unwind_1 (Lisp_Object arg)
{
return BSET (current_buffer, filename, arg);
bset_filename (current_buffer, arg);
return arg;
}
DEFUN ("subst-char-in-region", Fsubst_char_in_region,
@ -2896,11 +2893,11 @@ Both characters must have the same length of multi-byte form. */)
{
record_unwind_protect (subst_char_in_region_unwind,
BVAR (current_buffer, undo_list));
BSET (current_buffer, undo_list, Qt);
bset_undo_list (current_buffer, Qt);
/* Don't do file-locking. */
record_unwind_protect (subst_char_in_region_unwind_1,
BVAR (current_buffer, filename));
BSET (current_buffer, filename, Qnil);
bset_filename (current_buffer, Qnil);
}
if (pos_byte < GPT_BYTE)
@ -2982,7 +2979,7 @@ Both characters must have the same length of multi-byte form. */)
INC_POS (pos_byte_next);
if (! NILP (noundo))
BSET (current_buffer, undo_list, tem);
bset_undo_list (current_buffer, tem);
UNGCPRO;
}
@ -3937,7 +3934,7 @@ usage: (format STRING &rest OBJECTS) */)
/* If this argument has text properties, record where
in the result string it appears. */
if (string_get_intervals (args[n]))
if (string_intervals (args[n]))
info[n].intervals = arg_intervals = 1;
continue;
@ -4281,7 +4278,7 @@ usage: (format STRING &rest OBJECTS) */)
arguments has text properties, set up text properties of the
result string. */
if (string_get_intervals (args[0]) || arg_intervals)
if (string_intervals (args[0]) || arg_intervals)
{
Lisp_Object len, new_len, props;
struct gcpro gcpro1;
@ -4531,7 +4528,7 @@ Transposing beyond buffer boundaries is an error. */)
Lisp_Object buf;
XSETBUFFER (buf, current_buffer);
cur_intv = buffer_get_intervals (current_buffer);
cur_intv = buffer_intervals (current_buffer);
validate_region (&startr1, &endr1);
validate_region (&startr2, &endr2);

View file

@ -638,10 +638,6 @@ argmatch (char **argv, int argc, const char *sstr, const char *lstr,
static void
malloc_initialize_hook (void)
{
#ifndef USE_CRT_DLL
extern char **environ;
#endif
if (initialized)
{
if (!malloc_using_checking)

View file

@ -133,7 +133,27 @@ Lisp_Object inhibit_lisp_code;
static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *);
static int interactive_p (int);
static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args);
/* Functions to set Lisp_Object slots of struct specbinding. */
static inline void
set_specpdl_symbol (Lisp_Object symbol)
{
specpdl_ptr->symbol = symbol;
}
static inline void
set_specpdl_old_value (Lisp_Object oldval)
{
specpdl_ptr->old_value = oldval;
}
static inline void
set_specpdl_saved_value (Lisp_Object savedval)
{
specpdl_ptr->saved_value = savedval;
}
void
init_eval_once (void)
{
@ -2230,7 +2250,19 @@ eval_sub (Lisp_Object form)
goto retry;
}
if (EQ (funcar, Qmacro))
val = eval_sub (apply1 (Fcdr (fun), original_args));
{
ptrdiff_t count = SPECPDL_INDEX ();
extern Lisp_Object Qlexical_binding;
Lisp_Object exp;
/* Bind lexical-binding during expansion of the macro, so the
macro can know reliably if the code it outputs will be
interpreted using lexical-binding or not. */
specbind (Qlexical_binding,
NILP (Vinternal_interpreter_environment) ? Qnil : Qt);
exp = apply1 (Fcdr (fun), original_args);
unbind_to (count, Qnil);
val = eval_sub (exp);
}
else if (EQ (funcar, Qlambda)
|| EQ (funcar, Qclosure))
val = apply_lambda (fun, original_args);
@ -3183,8 +3215,8 @@ specbind (Lisp_Object symbol, Lisp_Object value)
case SYMBOL_PLAINVAL:
/* The most common case is that of a non-constant symbol with a
trivial value. Make that as fast as we can. */
specpdl_ptr->symbol = symbol;
specpdl_ptr->old_value = SYMBOL_VAL (sym);
set_specpdl_symbol (symbol);
set_specpdl_old_value (SYMBOL_VAL (sym));
specpdl_ptr->func = NULL;
specpdl_ptr->saved_value = Qnil;
++specpdl_ptr;
@ -3197,7 +3229,7 @@ specbind (Lisp_Object symbol, Lisp_Object value)
{
Lisp_Object ovalue = find_symbol_value (symbol);
specpdl_ptr->func = 0;
specpdl_ptr->old_value = ovalue;
set_specpdl_old_value (ovalue);
eassert (sym->redirect != SYMBOL_LOCALIZED
|| (EQ (SYMBOL_BLV (sym)->where,
@ -3214,12 +3246,12 @@ specbind (Lisp_Object symbol, Lisp_Object value)
if (!NILP (Flocal_variable_p (symbol, Qnil)))
{
eassert (sym->redirect != SYMBOL_LOCALIZED
|| (BLV_FOUND (SYMBOL_BLV (sym))
|| (blv_found (SYMBOL_BLV (sym))
&& EQ (cur_buf, SYMBOL_BLV (sym)->where)));
where = cur_buf;
}
else if (sym->redirect == SYMBOL_LOCALIZED
&& BLV_FOUND (SYMBOL_BLV (sym)))
&& blv_found (SYMBOL_BLV (sym)))
where = SYMBOL_BLV (sym)->where;
else
where = Qnil;
@ -3231,7 +3263,7 @@ specbind (Lisp_Object symbol, Lisp_Object value)
let_shadows_buffer_binding_p which is itself only used
in set_internal for local_if_set. */
eassert (NILP (where) || EQ (where, cur_buf));
specpdl_ptr->symbol = Fcons (symbol, Fcons (where, cur_buf));
set_specpdl_symbol (Fcons (symbol, Fcons (where, cur_buf)));
/* If SYMBOL is a per-buffer variable which doesn't have a
buffer-local value here, make the `let' change the global
@ -3248,7 +3280,7 @@ specbind (Lisp_Object symbol, Lisp_Object value)
}
}
else
specpdl_ptr->symbol = symbol;
set_specpdl_symbol (symbol);
specpdl_ptr++;
do_specbind (sym, specpdl_ptr - 1, value);
@ -3266,9 +3298,9 @@ record_unwind_protect (Lisp_Object (*function) (Lisp_Object), Lisp_Object arg)
if (specpdl_ptr == specpdl + specpdl_size)
grow_specpdl ();
specpdl_ptr->func = function;
specpdl_ptr->symbol = Qnil;
specpdl_ptr->old_value = arg;
specpdl_ptr->saved_value = Qnil;
set_specpdl_symbol (Qnil);
set_specpdl_old_value (arg);
set_specpdl_saved_value (Qnil);
specpdl_ptr++;
}

View file

@ -30,7 +30,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <pwd.h>
#endif
#include <ctype.h>
#include <errno.h>
#ifdef HAVE_LIBSELINUX
@ -38,6 +37,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <selinux/context.h>
#endif
#include <c-ctype.h>
#include "lisp.h"
#include "intervals.h"
#include "character.h"
@ -67,12 +68,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define IS_DRIVE(x) ((x) >= 'A' && (x) <= 'z')
#endif
#ifdef WINDOWSNT
#define IS_DRIVE(x) isalpha ((unsigned char) (x))
#define IS_DRIVE(x) c_isalpha (x)
#endif
/* Need to lower-case the drive letter, or else expanded
filenames will sometimes compare unequal, because
`expand-file-name' doesn't always down-case the drive letter. */
#define DRIVE_LETTER(x) (tolower ((unsigned char) (x)))
#define DRIVE_LETTER(x) c_tolower (x)
#endif
#include "systime.h"
@ -364,7 +365,7 @@ Given a Unix syntax file name, returns a string ending in slash. */)
r += 2;
}
if (getdefdir (toupper ((unsigned char) *beg) - 'A' + 1, r))
if (getdefdir (c_toupper (*beg) - 'A' + 1, r))
{
if (!IS_DIRECTORY_SEP (res[strlen (res) - 1]))
strcat (res, "/");
@ -1053,7 +1054,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
if (!IS_DIRECTORY_SEP (nm[0]))
{
adir = alloca (MAXPATHLEN + 1);
if (!getdefdir (toupper (drive) - 'A' + 1, adir))
if (!getdefdir (c_toupper (drive) - 'A' + 1, adir))
adir = NULL;
}
if (!adir)
@ -1129,7 +1130,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
adir = alloca (MAXPATHLEN + 1);
if (drive)
{
if (!getdefdir (toupper (drive) - 'A' + 1, adir))
if (!getdefdir (c_toupper (drive) - 'A' + 1, adir))
newdir = "/";
}
else
@ -1635,7 +1636,7 @@ those `/' is discarded. */)
else
{
o = p;
while (p != endp && (isalnum (*p) || *p == '_')) p++;
while (p != endp && (c_isalnum (*p) || *p == '_')) p++;
s = p;
}
@ -1698,7 +1699,7 @@ those `/' is discarded. */)
else
{
o = p;
while (p != endp && (isalnum (*p) || *p == '_')) p++;
while (p != endp && (c_isalnum (*p) || *p == '_')) p++;
s = p;
}
@ -3145,12 +3146,12 @@ decide_coding_unwind (Lisp_Object unwind_data)
set_buffer_internal (XBUFFER (buffer));
adjust_markers_for_delete (BEG, BEG_BYTE, Z, Z_BYTE);
adjust_overlays_for_delete (BEG, Z - BEG);
buffer_set_intervals (current_buffer, NULL);
set_buffer_intervals (current_buffer, NULL);
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
/* Now we are safe to change the buffer's multibyteness directly. */
BSET (current_buffer, enable_multibyte_characters, multibyte);
BSET (current_buffer, undo_list, undo_list);
bset_enable_multibyte_characters (current_buffer, multibyte);
bset_undo_list (current_buffer, undo_list);
return Qnil;
}
@ -3486,16 +3487,16 @@ variable `last-coding-system-used' to the coding system actually used. */)
buf = XBUFFER (workbuf);
delete_all_overlays (buf);
BSET (buf, directory, BVAR (current_buffer, directory));
BSET (buf, read_only, Qnil);
BSET (buf, filename, Qnil);
BSET (buf, undo_list, Qt);
bset_directory (buf, BVAR (current_buffer, directory));
bset_read_only (buf, Qnil);
bset_filename (buf, Qnil);
bset_undo_list (buf, Qt);
eassert (buf->overlays_before == NULL);
eassert (buf->overlays_after == NULL);
set_buffer_internal (buf);
Ferase_buffer ();
BSET (buf, enable_multibyte_characters, Qnil);
bset_enable_multibyte_characters (buf, Qnil);
insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0);
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
@ -4104,8 +4105,8 @@ variable `last-coding-system-used' to the coding system actually used. */)
unwind_data = Fcons (BVAR (current_buffer, enable_multibyte_characters),
Fcons (BVAR (current_buffer, undo_list),
Fcurrent_buffer ()));
BSET (current_buffer, enable_multibyte_characters, Qnil);
BSET (current_buffer, undo_list, Qt);
bset_enable_multibyte_characters (current_buffer, Qnil);
bset_undo_list (current_buffer, Qt);
record_unwind_protect (decide_coding_unwind, unwind_data);
if (inserted > 0 && ! NILP (Vset_auto_coding_function))
@ -4153,7 +4154,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
&& NILP (replace))
/* Visiting a file with these coding system makes the buffer
unibyte. */
BSET (current_buffer, enable_multibyte_characters, Qnil);
bset_enable_multibyte_characters (current_buffer, Qnil);
}
coding.dst_multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
@ -4196,13 +4197,13 @@ variable `last-coding-system-used' to the coding system actually used. */)
if (!NILP (visit))
{
if (!EQ (BVAR (current_buffer, undo_list), Qt) && !nochange)
BSET (current_buffer, undo_list, Qnil);
bset_undo_list (current_buffer, Qnil);
if (NILP (handler))
{
current_buffer->modtime = mtime;
current_buffer->modtime_size = st.st_size;
BSET (current_buffer, filename, orig_filename);
bset_filename (current_buffer, orig_filename);
}
SAVE_MODIFF = MODIFF;
@ -4247,7 +4248,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
/* Save old undo list and don't record undo for decoding. */
old_undo = BVAR (current_buffer, undo_list);
BSET (current_buffer, undo_list, Qt);
bset_undo_list (current_buffer, Qt);
if (NILP (replace))
{
@ -4339,7 +4340,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
if (NILP (visit))
{
BSET (current_buffer, undo_list, old_undo);
bset_undo_list (current_buffer, old_undo);
if (CONSP (old_undo) && inserted != old_inserted)
{
/* Adjust the last undo record for the size change during
@ -4354,7 +4355,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
else
/* If undo_list was Qt before, keep it that way.
Otherwise start with an empty undo_list. */
BSET (current_buffer, undo_list, EQ (old_undo, Qt) ? Qt : Qnil);
bset_undo_list (current_buffer, EQ (old_undo, Qt) ? Qt : Qnil);
unbind_to (count1, Qnil);
}
@ -4594,7 +4595,7 @@ This calls `write-region-annotate-functions' at the start, and
{
SAVE_MODIFF = MODIFF;
XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
BSET (current_buffer, filename, visit_file);
bset_filename (current_buffer, visit_file);
}
UNGCPRO;
return val;
@ -4810,7 +4811,7 @@ This calls `write-region-annotate-functions' at the start, and
{
SAVE_MODIFF = MODIFF;
XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
BSET (current_buffer, filename, visit_file);
bset_filename (current_buffer, visit_file);
update_mode_lines++;
}
else if (quietly)

View file

@ -628,7 +628,7 @@ concat (ptrdiff_t nargs, Lisp_Object *args,
ptrdiff_t thislen_byte = SBYTES (this);
memcpy (SDATA (val) + toindex_byte, SDATA (this), SBYTES (this));
if (string_get_intervals (this))
if (string_intervals (this))
{
textprops[num_textprops].argnum = argnum;
textprops[num_textprops].from = 0;
@ -640,7 +640,7 @@ concat (ptrdiff_t nargs, Lisp_Object *args,
/* Copy a single-byte string to a multibyte string. */
else if (STRINGP (this) && STRINGP (val))
{
if (string_get_intervals (this))
if (string_intervals (this))
{
textprops[num_textprops].argnum = argnum;
textprops[num_textprops].from = 0;
@ -1060,7 +1060,7 @@ If you're not sure, whether to use `string-as-multibyte' or
str_as_multibyte (SDATA (new_string), nbytes,
SBYTES (string), NULL);
string = new_string;
string_set_intervals (string, NULL);
set_string_intervals (string, NULL);
}
return string;
}
@ -2150,8 +2150,8 @@ ARRAY is a vector, string, char-table, or bool-vector. */)
int i;
for (i = 0; i < (1 << CHARTAB_SIZE_BITS_0); i++)
XCHAR_TABLE (array)->contents[i] = item;
XCHAR_TABLE (array)->defalt = item;
set_char_table_contents (array, i, item);
set_char_table_defalt (array, item);
}
else if (STRINGP (array))
{
@ -3663,7 +3663,7 @@ make_hash_table (Lisp_Object test, Lisp_Object size, Lisp_Object rehash_size,
/* Set up the free list. */
for (i = 0; i < sz - 1; ++i)
set_hash_next (h, i, make_number (i + 1));
set_hash_next_slot (h, i, make_number (i + 1));
h->next_free = make_number (0);
XSET_HASH_TABLE (table, h);
@ -3760,17 +3760,17 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
}
#endif
h->key_and_value = larger_vector (h->key_and_value,
2 * (new_size - old_size), -1);
h->next = larger_vector (h->next, new_size - old_size, -1);
h->hash = larger_vector (h->hash, new_size - old_size, -1);
h->index = Fmake_vector (make_number (index_size), Qnil);
set_hash_key_and_value (h, larger_vector (h->key_and_value,
2 * (new_size - old_size), -1));
set_hash_next (h, larger_vector (h->next, new_size - old_size, -1));
set_hash_hash (h, larger_vector (h->hash, new_size - old_size, -1));
set_hash_index (h, Fmake_vector (make_number (index_size), Qnil));
/* Update the free list. Do it so that new entries are added at
the end of the free list. This makes some operations like
maphash faster. */
for (i = old_size; i < new_size - 1; ++i)
set_hash_next (h, i, make_number (i + 1));
set_hash_next_slot (h, i, make_number (i + 1));
if (!NILP (h->next_free))
{
@ -3781,7 +3781,7 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
!NILP (next))
last = next;
set_hash_next (h, XFASTINT (last), make_number (old_size));
set_hash_next_slot (h, XFASTINT (last), make_number (old_size));
}
else
XSETFASTINT (h->next_free, old_size);
@ -3792,8 +3792,8 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
{
EMACS_UINT hash_code = XUINT (HASH_HASH (h, i));
ptrdiff_t start_of_bucket = hash_code % ASIZE (h->index);
set_hash_next (h, i, HASH_INDEX (h, start_of_bucket));
set_hash_index (h, start_of_bucket, make_number (i));
set_hash_next_slot (h, i, HASH_INDEX (h, start_of_bucket));
set_hash_index_slot (h, start_of_bucket, make_number (i));
}
}
}
@ -3852,16 +3852,16 @@ hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value,
/* Store key/value in the key_and_value vector. */
i = XFASTINT (h->next_free);
h->next_free = HASH_NEXT (h, i);
set_hash_key (h, i, key);
set_hash_value (h, i, value);
set_hash_key_slot (h, i, key);
set_hash_value_slot (h, i, value);
/* Remember its hash code. */
set_hash_hash (h, i, make_number (hash));
set_hash_hash_slot (h, i, make_number (hash));
/* Add new entry to its collision chain. */
start_of_bucket = hash % ASIZE (h->index);
set_hash_next (h, i, HASH_INDEX (h, start_of_bucket));
set_hash_index (h, start_of_bucket, make_number (i));
set_hash_next_slot (h, i, HASH_INDEX (h, start_of_bucket));
set_hash_index_slot (h, start_of_bucket, make_number (i));
return i;
}
@ -3892,16 +3892,16 @@ hash_remove_from_table (struct Lisp_Hash_Table *h, Lisp_Object key)
{
/* Take entry out of collision chain. */
if (NILP (prev))
set_hash_index (h, start_of_bucket, HASH_NEXT (h, i));
set_hash_index_slot (h, start_of_bucket, HASH_NEXT (h, i));
else
set_hash_next (h, XFASTINT (prev), HASH_NEXT (h, i));
set_hash_next_slot (h, XFASTINT (prev), HASH_NEXT (h, i));
/* Clear slots in key_and_value and add the slots to
the free list. */
set_hash_key (h, i, Qnil);
set_hash_value (h, i, Qnil);
set_hash_hash (h, i, Qnil);
set_hash_next (h, i, h->next_free);
set_hash_key_slot (h, i, Qnil);
set_hash_value_slot (h, i, Qnil);
set_hash_hash_slot (h, i, Qnil);
set_hash_next_slot (h, i, h->next_free);
h->next_free = make_number (i);
h->count--;
eassert (h->count >= 0);
@ -3927,10 +3927,10 @@ hash_clear (struct Lisp_Hash_Table *h)
for (i = 0; i < size; ++i)
{
set_hash_next (h, i, i < size - 1 ? make_number (i + 1) : Qnil);
set_hash_key (h, i, Qnil);
set_hash_value (h, i, Qnil);
set_hash_hash (h, i, Qnil);
set_hash_next_slot (h, i, i < size - 1 ? make_number (i + 1) : Qnil);
set_hash_key_slot (h, i, Qnil);
set_hash_value_slot (h, i, Qnil);
set_hash_hash_slot (h, i, Qnil);
}
for (i = 0; i < ASIZE (h->index); ++i)
@ -3994,18 +3994,18 @@ sweep_weak_table (struct Lisp_Hash_Table *h, int remove_entries_p)
{
/* Take out of collision chain. */
if (NILP (prev))
set_hash_index (h, bucket, next);
set_hash_index_slot (h, bucket, next);
else
set_hash_next (h, XFASTINT (prev), next);
set_hash_next_slot (h, XFASTINT (prev), next);
/* Add to free list. */
set_hash_next (h, i, h->next_free);
set_hash_next_slot (h, i, h->next_free);
h->next_free = idx;
/* Clear key, value, and hash. */
set_hash_key (h, i, Qnil);
set_hash_value (h, i, Qnil);
set_hash_hash (h, i, Qnil);
set_hash_key_slot (h, i, Qnil);
set_hash_value_slot (h, i, Qnil);
set_hash_hash_slot (h, i, Qnil);
h->count--;
}
@ -4512,7 +4512,7 @@ VALUE. In any case, return VALUE. */)
i = hash_lookup (h, key, &hash);
if (i >= 0)
set_hash_value (h, i, value);
set_hash_value_slot (h, i, value);
else
hash_put (h, key, value, hash);

View file

@ -23,9 +23,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <float.h>
#include <stdio.h>
#include <ctype.h>
#include <setjmp.h>
#include <c-ctype.h>
#include "lisp.h"
#include "character.h"
#include "buffer.h"
@ -1079,7 +1080,7 @@ font_parse_xlfd (char *name, ptrdiff_t len, Lisp_Object font)
p = f[XLFD_POINT_INDEX];
if (*p == '[')
point_size = parse_matrix (p);
else if (isdigit (*p))
else if (c_isdigit (*p))
point_size = atoi (p), point_size /= 10;
if (point_size >= 0)
ASET (font, FONT_SIZE_INDEX, make_float (point_size));
@ -1346,7 +1347,7 @@ font_parse_fcname (char *name, ptrdiff_t len, Lisp_Object font)
{
int decimal = 0, size_found = 1;
for (q = p + 1; *q && *q != ':'; q++)
if (! isdigit (*q))
if (! c_isdigit (*q))
{
if (*q != '.' || decimal)
{
@ -1474,7 +1475,7 @@ font_parse_fcname (char *name, ptrdiff_t len, Lisp_Object font)
/* Scan backwards from the end, looking for a size. */
for (p = name + len - 1; p >= name; p--)
if (!isdigit (*p))
if (!c_isdigit (*p))
break;
if ((p < name + len - 1) && ((p + 1 == name) || *p == ' '))

View file

@ -284,8 +284,11 @@ struct font
/* Beyond here, there should be no more Lisp_Object components. */
/* Maximum bound width over all existing characters of the font. On
X window, this is same as (font->max_bounds.width). */
/* Minimum and maximum glyph widths, in pixels. Some font backends,
such as xft, lack the information to easily compute minimum and
maximum widths over all characters; in that case, these values
are approximate. */
int min_width;
int max_width;
/* By which pixel size the font is opened. */
@ -301,13 +304,10 @@ struct font
/* Average width of glyphs in the font. If the font itself doesn't
have that information but has glyphs of ASCII characters, the
value is the average with of those glyphs. Otherwise, the value
value is the average width of those glyphs. Otherwise, the value
is 0. */
int average_width;
/* Minimum glyph width (in pixels). */
int min_width;
/* Ascent and descent of the font (in pixels). */
int ascent, descent;

View file

@ -1916,7 +1916,7 @@ format is the same as above. */)
if (!EQ (fontset, Vdefault_fontset))
{
tables[1] = Fmake_char_table (Qnil, Qnil);
XCHAR_TABLE (tables[0])->extras[0] = tables[1];
set_char_table_extras (tables[0], 0, tables[1]);
fontsets[1] = Vdefault_fontset;
}
@ -1979,7 +1979,7 @@ format is the same as above. */)
if (c <= MAX_5_BYTE_CHAR)
char_table_set_range (tables[k], c, to, alist);
else
XCHAR_TABLE (tables[k])->defalt = alist;
set_char_table_defalt (tables[k], alist);
/* At last, change each elements to font names. */
for (; CONSP (alist); alist = XCDR (alist))

View file

@ -19,11 +19,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#define FRAME_INLINE EXTERN_INLINE
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <setjmp.h>
#include <c-ctype.h>
#include "lisp.h"
#include "character.h"
#ifdef HAVE_X_WINDOWS
@ -125,6 +129,18 @@ static Lisp_Object Qdelete_frame_functions;
static void x_report_frame_params (struct frame *, Lisp_Object *);
#endif
/* These setters are used only in this file, so they can be private. */
static inline void
fset_buffer_predicate (struct frame *f, Lisp_Object val)
{
f->buffer_predicate = val;
}
static inline void
fset_minibuffer_window (struct frame *f, Lisp_Object val)
{
f->minibuffer_window = val;
}
static void
set_menu_bar_lines_1 (Lisp_Object window, int n)
@ -132,8 +148,8 @@ set_menu_bar_lines_1 (Lisp_Object window, int n)
struct window *w = XWINDOW (window);
w->last_modified = 0;
WSET (w, top_line, make_number (XFASTINT (w->top_line) + n));
WSET (w, total_lines, make_number (XFASTINT (w->total_lines) - n));
wset_top_line (w, make_number (XFASTINT (w->top_line) + n));
wset_total_lines (w, make_number (XFASTINT (w->total_lines) - n));
/* Handle just the top child in a vertical split. */
if (!NILP (w->vchild))
@ -269,7 +285,7 @@ make_frame (int mini_p)
/* Initialize Lisp data. Note that allocate_frame initializes all
Lisp data to nil, so do it only for slots which should not be nil. */
FSET (f, tool_bar_position, Qtop);
fset_tool_bar_position (f, Qtop);
/* Initialize non-Lisp data. Note that allocate_frame zeroes out all
non-Lisp data, so do it only for slots which should not be zero.
@ -289,20 +305,20 @@ make_frame (int mini_p)
if (mini_p)
{
mini_window = make_window ();
WSET (XWINDOW (root_window), next, mini_window);
WSET (XWINDOW (mini_window), prev, root_window);
wset_next (XWINDOW (root_window), mini_window);
wset_prev (XWINDOW (mini_window), root_window);
XWINDOW (mini_window)->mini = 1;
WSET (XWINDOW (mini_window), frame, frame);
FSET (f, minibuffer_window, mini_window);
wset_frame (XWINDOW (mini_window), frame);
fset_minibuffer_window (f, mini_window);
}
else
{
mini_window = Qnil;
WSET (XWINDOW (root_window), next, Qnil);
FSET (f, minibuffer_window, Qnil);
wset_next (XWINDOW (root_window), Qnil);
fset_minibuffer_window (f, Qnil);
}
WSET (XWINDOW (root_window), frame, frame);
wset_frame (XWINDOW (root_window), frame);
/* 10 is arbitrary,
just so that there is "something there."
@ -311,21 +327,21 @@ make_frame (int mini_p)
SET_FRAME_COLS (f, 10);
FRAME_LINES (f) = 10;
WSET (XWINDOW (root_window), total_cols, make_number (10));
WSET (XWINDOW (root_window), total_lines, make_number (mini_p ? 9 : 10));
wset_total_cols (XWINDOW (root_window), make_number (10));
wset_total_lines (XWINDOW (root_window), make_number (mini_p ? 9 : 10));
if (mini_p)
{
WSET (XWINDOW (mini_window), total_cols, make_number (10));
WSET (XWINDOW (mini_window), top_line, make_number (9));
WSET (XWINDOW (mini_window), total_lines, make_number (1));
wset_total_cols (XWINDOW (mini_window), make_number (10));
wset_top_line (XWINDOW (mini_window), make_number (9));
wset_total_lines (XWINDOW (mini_window), make_number (1));
}
/* Choose a buffer for the frame's root window. */
{
Lisp_Object buf;
WSET (XWINDOW (root_window), buffer, Qt);
wset_buffer (XWINDOW (root_window), Qt);
buf = Fcurrent_buffer ();
/* If buf is a 'hidden' buffer (i.e. one whose name starts with
a space), try to find another one. */
@ -339,12 +355,12 @@ make_frame (int mini_p)
etc. Running Lisp functions at this point surely ends in a
SEGV. */
set_window_buffer (root_window, buf, 0, 0);
FSET (f, buffer_list, Fcons (buf, Qnil));
fset_buffer_list (f, Fcons (buf, Qnil));
}
if (mini_p)
{
WSET (XWINDOW (mini_window), buffer, Qt);
wset_buffer (XWINDOW (mini_window), Qt);
set_window_buffer (mini_window,
(NILP (Vminibuffer_list)
? get_minibuffer (0)
@ -352,8 +368,8 @@ make_frame (int mini_p)
0, 0);
}
FSET (f, root_window, root_window);
FSET (f, selected_window, root_window);
fset_root_window (f, root_window);
fset_selected_window (f, root_window);
/* Make sure this window seems more recently used than
a newly-created, never-selected window. */
XWINDOW (f->selected_window)->use_time = ++window_select_count;
@ -393,8 +409,8 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
XSETFRAME (frame_dummy, f);
GCPRO1 (frame_dummy);
/* If there's no minibuffer frame to use, create one. */
KSET (kb, Vdefault_minibuffer_frame,
call1 (intern ("make-initial-minibuffer-frame"), display));
kset_default_minibuffer_frame
(kb, call1 (intern ("make-initial-minibuffer-frame"), display));
UNGCPRO;
}
@ -402,7 +418,7 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
= XFRAME (KVAR (kb, Vdefault_minibuffer_frame))->minibuffer_window;
}
FSET (f, minibuffer_window, mini_window);
fset_minibuffer_window (f, mini_window);
/* Make the chosen minibuffer window display the proper minibuffer,
unless it is already showing a minibuffer. */
@ -439,11 +455,12 @@ make_minibuffer_frame (void)
Avoid infinite looping on the window chain by marking next pointer
as nil. */
mini_window = FSET (f, minibuffer_window, f->root_window);
mini_window = f->root_window;
fset_minibuffer_window (f, mini_window);
XWINDOW (mini_window)->mini = 1;
WSET (XWINDOW (mini_window), next, Qnil);
WSET (XWINDOW (mini_window), prev, Qnil);
WSET (XWINDOW (mini_window), frame, frame);
wset_next (XWINDOW (mini_window), Qnil);
wset_prev (XWINDOW (mini_window), Qnil);
wset_frame (XWINDOW (mini_window), frame);
/* Put the proper buffer in that window. */
@ -482,7 +499,7 @@ make_initial_frame (void)
Vframe_list = Fcons (frame, Vframe_list);
tty_frame_count = 1;
FSET (f, name, build_pure_c_string ("F1"));
fset_name (f, build_pure_c_string ("F1"));
f->visible = 1;
f->async_visible = 1;
@ -523,7 +540,7 @@ make_terminal_frame (struct terminal *terminal)
XSETFRAME (frame, f);
Vframe_list = Fcons (frame, Vframe_list);
FSET (f, name, make_formatted_string (name, "F%"pMd, ++tty_frame_count));
fset_name (f, make_formatted_string (name, "F%"pMd, ++tty_frame_count));
f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */
f->async_visible = 1; /* Don't let visible be cleared later. */
@ -693,7 +710,7 @@ affects all frames on the same terminal device. */)
/* Make the frame face alist be frame-specific, so that each
frame could change its face definitions independently. */
FSET (f, face_alist, Fcopy_alist (sf->face_alist));
fset_face_alist (f, Fcopy_alist (sf->face_alist));
/* Simple Fcopy_alist isn't enough, because we need the contents of
the vectors which are the CDRs of associations in face_alist to
be copied as well. */
@ -847,7 +864,7 @@ to that frame. */)
(Lisp_Object event)
{
/* Preserve prefix arg that the command loop just cleared. */
KSET (current_kboard, Vprefix_arg, Vcurrent_prefix_arg);
kset_prefix_arg (current_kboard, Vcurrent_prefix_arg);
Frun_hooks (1, &Qmouse_leave_buffer_hook);
return do_switch_frame (event, 0, 0, Qnil);
}
@ -1280,7 +1297,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
/* Mark all the windows that used to be on FRAME as deleted, and then
remove the reference to them. */
delete_all_child_windows (f->root_window);
FSET (f, root_window, Qnil);
fset_root_window (f, Qnil);
Vframe_list = Fdelq (frame, Vframe_list);
FRAME_SET_VISIBLE (f, 0);
@ -1289,7 +1306,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
garbage collection. The frame object itself may not be garbage
collected until much later, because recent_keys and other data
structures can still refer to it. */
FSET (f, menu_bar_vector, Qnil);
fset_menu_bar_vector (f, Qnil);
free_font_driver_list (f);
xfree (f->namebuf);
@ -1441,11 +1458,11 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
if (NILP (frame_with_minibuf))
abort ();
KSET (kb, Vdefault_minibuffer_frame, frame_with_minibuf);
kset_default_minibuffer_frame (kb, frame_with_minibuf);
}
else
/* No frames left on this kboard--say no minibuffer either. */
KSET (kb, Vdefault_minibuffer_frame, Qnil);
kset_default_minibuffer_frame (kb, Qnil);
}
/* Cause frame titles to update--necessary if we now have just one frame. */
@ -1683,7 +1700,7 @@ make_frame_visible_1 (Lisp_Object window)
w = XWINDOW (window);
if (!NILP (w->buffer))
BSET (XBUFFER (w->buffer), display_time, Fcurrent_time ());
bset_display_time (XBUFFER (w->buffer), Fcurrent_time ());
if (!NILP (w->vchild))
make_frame_visible_1 (w->vchild);
@ -1917,7 +1934,7 @@ The redirection lasts until `redirect-frame-focus' is called to change it. */)
f = XFRAME (frame);
FSET (f, focus_frame, focus_frame);
fset_focus_frame (f, focus_frame);
if (FRAME_TERMINAL (f)->frame_rehighlight_hook)
(*FRAME_TERMINAL (f)->frame_rehighlight_hook) (f);
@ -1982,10 +1999,10 @@ frames_discard_buffer (Lisp_Object buffer)
FOR_EACH_FRAME (tail, frame)
{
FSET (XFRAME (frame), buffer_list,
Fdelq (buffer, XFRAME (frame)->buffer_list));
FSET (XFRAME (frame), buried_buffer_list,
Fdelq (buffer, XFRAME (frame)->buried_buffer_list));
fset_buffer_list
(XFRAME (frame), Fdelq (buffer, XFRAME (frame)->buffer_list));
fset_buried_buffer_list
(XFRAME (frame), Fdelq (buffer, XFRAME (frame)->buried_buffer_list));
}
}
@ -2052,7 +2069,7 @@ set_term_frame_name (struct frame *f, Lisp_Object name)
error ("Frame names of the form F<num> are usurped by Emacs");
}
FSET (f, name, name);
fset_name (f, name);
update_mode_lines = 1;
}
@ -2069,7 +2086,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
for (; CONSP (val); val = XCDR (val))
if (!NILP (Fbuffer_live_p (XCAR (val))))
list = Fcons (XCAR (val), list);
FSET (f, buffer_list, Fnreverse (list));
fset_buffer_list (f, Fnreverse (list));
return;
}
if (EQ (prop, Qburied_buffer_list))
@ -2078,7 +2095,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
for (; CONSP (val); val = XCDR (val))
if (!NILP (Fbuffer_live_p (XCAR (val))))
list = Fcons (XCAR (val), list);
FSET (f, buried_buffer_list, Fnreverse (list));
fset_buried_buffer_list (f, Fnreverse (list));
return;
}
@ -2096,7 +2113,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
case SYMBOL_PLAINVAL: case SYMBOL_FORWARDED: break;
case SYMBOL_LOCALIZED:
{ struct Lisp_Buffer_Local_Value *blv = sym->val.blv;
if (blv->frame_local && BLV_FOUND (blv) && XFRAME (blv->where) == f)
if (blv->frame_local && blv_found (blv) && XFRAME (blv->where) == f)
swap_in_global_binding (sym);
break;
}
@ -2115,7 +2132,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
/* Update the frame parameter alist. */
old_alist_elt = Fassq (prop, f->param_alist);
if (EQ (old_alist_elt, Qnil))
FSET (f, param_alist, Fcons (Fcons (prop, val), f->param_alist));
fset_param_alist (f, Fcons (Fcons (prop, val), f->param_alist));
else
Fsetcdr (old_alist_elt, val);
@ -2123,7 +2140,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
in addition to the alist. */
if (EQ (prop, Qbuffer_predicate))
FSET (f, buffer_predicate, val);
fset_buffer_predicate (f, val);
if (! FRAME_WINDOW_P (f))
{
@ -2143,7 +2160,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
error ("Can't change the surrogate minibuffer of a frame with its own minibuffer");
/* Install the chosen minibuffer window, with proper buffer. */
FSET (f, minibuffer_window, val);
fset_minibuffer_window (f, val);
}
}
@ -3271,7 +3288,7 @@ x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
new_value = Qnil;
while (*p0)
{
while (*p1 && ! isspace (*p1) && *p1 != ',') p1++;
while (*p1 && ! c_isspace (*p1) && *p1 != ',') p1++;
if (p0 < p1)
new_value = Fcons (Fintern (make_string (p0, p1 - p0), Qnil),
new_value);
@ -3279,7 +3296,7 @@ x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
{
int c;
while ((c = *++p1) && isspace (c));
while ((c = *++p1) && c_isspace (c));
}
p0 = p1;
}

View file

@ -25,6 +25,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "dispextern.h"
INLINE_HEADER_BEGIN
#ifndef FRAME_INLINE
# define FRAME_INLINE INLINE
#endif
/* Miscellanea. */
@ -80,10 +85,6 @@ struct terminal;
struct font_driver_list;
/* Most code should use this macro to set Lisp field in struct frame. */
#define FSET(f, field, value) ((f)->field = (value))
struct frame
{
struct vectorlike_header header;
@ -499,6 +500,109 @@ struct frame
unsigned long foreground_pixel;
};
/* Most code should use these functions to set Lisp fields in struct frame. */
FRAME_INLINE void
fset_buffer_list (struct frame *f, Lisp_Object val)
{
f->buffer_list = val;
}
FRAME_INLINE void
fset_buried_buffer_list (struct frame *f, Lisp_Object val)
{
f->buried_buffer_list = val;
}
FRAME_INLINE void
fset_condemned_scroll_bars (struct frame *f, Lisp_Object val)
{
f->condemned_scroll_bars = val;
}
FRAME_INLINE void
fset_current_tool_bar_string (struct frame *f, Lisp_Object val)
{
f->current_tool_bar_string = val;
}
FRAME_INLINE void
fset_desired_tool_bar_string (struct frame *f, Lisp_Object val)
{
f->desired_tool_bar_string = val;
}
FRAME_INLINE void
fset_face_alist (struct frame *f, Lisp_Object val)
{
f->face_alist = val;
}
FRAME_INLINE void
fset_focus_frame (struct frame *f, Lisp_Object val)
{
f->focus_frame = val;
}
FRAME_INLINE void
fset_icon_name (struct frame *f, Lisp_Object val)
{
f->icon_name = val;
}
FRAME_INLINE void
fset_menu_bar_items (struct frame *f, Lisp_Object val)
{
f->menu_bar_items = val;
}
FRAME_INLINE void
fset_menu_bar_vector (struct frame *f, Lisp_Object val)
{
f->menu_bar_vector = val;
}
FRAME_INLINE void
fset_menu_bar_window (struct frame *f, Lisp_Object val)
{
f->menu_bar_window = val;
}
FRAME_INLINE void
fset_name (struct frame *f, Lisp_Object val)
{
f->name = val;
}
FRAME_INLINE void
fset_param_alist (struct frame *f, Lisp_Object val)
{
f->param_alist = val;
}
FRAME_INLINE void
fset_root_window (struct frame *f, Lisp_Object val)
{
f->root_window = val;
}
FRAME_INLINE void
fset_scroll_bars (struct frame *f, Lisp_Object val)
{
f->scroll_bars = val;
}
FRAME_INLINE void
fset_selected_window (struct frame *f, Lisp_Object val)
{
f->selected_window = val;
}
FRAME_INLINE void
fset_title (struct frame *f, Lisp_Object val)
{
f->title = val;
}
FRAME_INLINE void
fset_tool_bar_items (struct frame *f, Lisp_Object val)
{
f->tool_bar_items = val;
}
FRAME_INLINE void
fset_tool_bar_position (struct frame *f, Lisp_Object val)
{
f->tool_bar_position = val;
}
FRAME_INLINE void
fset_tool_bar_window (struct frame *f, Lisp_Object val)
{
f->tool_bar_window = val;
}
#define FRAME_KBOARD(f) ((f)->terminal->kboard)
/* Return a pointer to the image cache of frame F. */
@ -1146,4 +1250,6 @@ extern void set_frame_menubar (FRAME_PTR, int, int);
#endif /* HAVE_WINDOW_SYSTEM */
INLINE_HEADER_END
#endif /* not EMACS_FRAME_H */

View file

@ -830,7 +830,7 @@ one trustfile (usually a CA bundle). */)
XPROCESS (proc)->gnutls_state = NULL;
XPROCESS (proc)->gnutls_x509_cred = NULL;
XPROCESS (proc)->gnutls_anon_cred = NULL;
PSET (XPROCESS (proc), gnutls_cred_type, type);
pset_gnutls_cred_type (XPROCESS (proc), type);
GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_EMPTY;
GNUTLS_LOG (1, max_log_level, "allocating credentials");

View file

@ -24,7 +24,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <signal.h>
#include <stdio.h>
#include <setjmp.h>
#include <ctype.h>
#include <c-ctype.h>
#include "lisp.h"
#include "xterm.h"
#include "blockinput.h"
@ -2016,7 +2018,7 @@ xg_get_file_name (FRAME_PTR f,
#if USE_NEW_GTK_FONT_CHOOSER
extern Lisp_Object Qnormal;
extern Lisp_Object Qxft, Qnormal;
extern Lisp_Object Qextra_light, Qlight, Qsemi_light, Qsemi_bold;
extern Lisp_Object Qbold, Qextra_bold, Qultra_bold;
extern Lisp_Object Qoblique, Qitalic;
@ -2072,7 +2074,7 @@ xg_get_font (FRAME_PTR f, const char *default_name)
if (p)
{
char *ep = p+1;
while (isdigit (*ep))
while (c_isdigit (*ep))
++ep;
if (*ep == '\0') *p = ' ';
}
@ -2099,7 +2101,7 @@ xg_get_font (FRAME_PTR f, const char *default_name)
if (desc)
{
Lisp_Object args[8];
Lisp_Object args[10];
const char *name = pango_font_description_get_family (desc);
gint size = pango_font_description_get_size (desc);
PangoWeight weight = pango_font_description_get_weight (desc);
@ -2117,6 +2119,9 @@ xg_get_font (FRAME_PTR f, const char *default_name)
args[6] = QCslant;
args[7] = XG_STYLE_TO_SYMBOL (style);
args[8] = QCtype;
args[9] = Qxft;
font = Ffont_spec (8, args);
pango_font_description_free (desc);
@ -2259,7 +2264,7 @@ xg_mark_data (void)
{
FRAME_PTR f = XFRAME (frame);
if (FRAME_X_OUTPUT (f) && FRAME_GTK_OUTER_WIDGET (f))
if (FRAME_X_P (f) && FRAME_GTK_OUTER_WIDGET (f))
{
struct xg_frame_tb_info *tbinfo
= g_object_get_data (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)),

View file

@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <math.h>
#include <ctype.h>
#include <unistd.h>
#ifdef HAVE_PNG
@ -33,6 +32,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <setjmp.h>
#include <c-ctype.h>
/* This makes the fields of a Display accessible, in Xlib header files. */
#define XLIB_ILLEGAL_ACCESS
@ -2405,12 +2406,12 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
loop:
/* Skip white space. */
while (*s < end && (c = *(*s)++, isspace (c)))
while (*s < end && (c = *(*s)++, c_isspace (c)))
;
if (*s >= end)
c = 0;
else if (isdigit (c))
else if (c_isdigit (c))
{
int value = 0, digit;
@ -2422,7 +2423,7 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
while (*s < end)
{
c = *(*s)++;
if (isdigit (c))
if (c_isdigit (c))
digit = c - '0';
else if (c >= 'a' && c <= 'f')
digit = c - 'a' + 10;
@ -2433,11 +2434,11 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
value = 16 * value + digit;
}
}
else if (isdigit (c))
else if (c_isdigit (c))
{
value = c - '0';
while (*s < end
&& (c = *(*s)++, isdigit (c)))
&& (c = *(*s)++, c_isdigit (c)))
value = 8 * value + c - '0';
}
}
@ -2445,7 +2446,7 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
{
value = c - '0';
while (*s < end
&& (c = *(*s)++, isdigit (c)))
&& (c = *(*s)++, c_isdigit (c)))
value = 10 * value + c - '0';
}
@ -2454,11 +2455,11 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
*ival = value;
c = XBM_TK_NUMBER;
}
else if (isalpha (c) || c == '_')
else if (c_isalpha (c) || c == '_')
{
*sval++ = c;
while (*s < end
&& (c = *(*s)++, (isalnum (c) || c == '_')))
&& (c = *(*s)++, (c_isalnum (c) || c == '_')))
*sval++ = c;
*sval = 0;
if (*s < end)
@ -3661,16 +3662,17 @@ xpm_scan (const unsigned char **s,
while (*s < end)
{
/* Skip white-space. */
while (*s < end && (c = *(*s)++, isspace (c)))
while (*s < end && (c = *(*s)++, c_isspace (c)))
;
/* gnus-pointer.xpm uses '-' in its identifier.
sb-dir-plus.xpm uses '+' in its identifier. */
if (isalpha (c) || c == '_' || c == '-' || c == '+')
if (c_isalpha (c) || c == '_' || c == '-' || c == '+')
{
*beg = *s - 1;
while (*s < end
&& (c = **s, isalnum (c) || c == '_' || c == '-' || c == '+'))
&& (c = **s, c_isalnum (c)
|| c == '_' || c == '-' || c == '+'))
++*s;
*len = *s - *beg;
return XPM_TK_IDENT;
@ -5014,7 +5016,7 @@ pbm_scan_number (unsigned char **s, unsigned char *end)
while (*s < end)
{
/* Skip white-space. */
while (*s < end && (c = *(*s)++, isspace (c)))
while (*s < end && (c = *(*s)++, c_isspace (c)))
;
if (c == '#')
@ -5023,11 +5025,11 @@ pbm_scan_number (unsigned char **s, unsigned char *end)
while (*s < end && (c = *(*s)++, c != '\n'))
;
}
else if (isdigit (c))
else if (c_isdigit (c))
{
/* Read decimal number. */
val = c - '0';
while (*s < end && (c = *(*s)++, isdigit (c)))
while (*s < end && (c = *(*s)++, c_isdigit (c)))
val = 10 * val + c - '0';
break;
}
@ -8554,7 +8556,7 @@ gs_load (struct frame *f, struct image *img)
don't either. Let the Lisp loader use `unwind-protect' instead. */
printnum1 = FRAME_X_WINDOW (f);
printnum2 = img->pixmap;
window_and_pixmap_id
window_and_pixmap_id
= make_formatted_string (buffer, "%"pMu" %"pMu, printnum1, printnum2);
printnum1 = FRAME_FOREGROUND_PIXEL (f);

View file

@ -141,7 +141,7 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
struct Lisp_Vector *widthtab;
if (!VECTORP (BVAR (buf, width_table)))
BSET (buf, width_table, Fmake_vector (make_number (256), make_number (0)));
bset_width_table (buf, Fmake_vector (make_number (256), make_number (0)));
widthtab = XVECTOR (BVAR (buf, width_table));
if (widthtab->header.size != 256)
abort ();
@ -166,7 +166,7 @@ width_run_cache_on_off (void)
{
free_region_cache (current_buffer->width_run_cache);
current_buffer->width_run_cache = 0;
BSET (current_buffer, width_table, Qnil);
bset_width_table (current_buffer, Qnil);
}
}
else
@ -336,7 +336,7 @@ current_column (void)
/* If the buffer has overlays, text properties,
or multibyte characters, use a more general algorithm. */
if (buffer_get_intervals (current_buffer)
if (buffer_intervals (current_buffer)
|| buffer_has_overlays ()
|| Z != Z_BYTE)
return current_column_1 ();
@ -2003,7 +2003,7 @@ whether or not it is currently displayed in some window. */)
old_buffer = w->buffer;
old_charpos = XMARKER (w->pointm)->charpos;
old_bytepos = XMARKER (w->pointm)->bytepos;
WSET (w, buffer, Fcurrent_buffer ());
wset_buffer (w, Fcurrent_buffer ());
set_marker_both (w->pointm, w->buffer,
BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer));
}
@ -2146,7 +2146,7 @@ whether or not it is currently displayed in some window. */)
if (BUFFERP (old_buffer))
{
WSET (w, buffer, old_buffer);
wset_buffer (w, old_buffer);
set_marker_both (w->pointm, w->buffer,
old_charpos, old_bytepos);
}

View file

@ -844,10 +844,10 @@ insert_1_both (const char *string,
PT + nchars, PT_BYTE + nbytes,
before_markers);
if (buffer_get_intervals (current_buffer))
if (buffer_intervals (current_buffer))
offset_intervals (current_buffer, PT, nchars);
if (!inherit && buffer_get_intervals (current_buffer))
if (!inherit && buffer_intervals (current_buffer))
set_text_properties (make_number (PT), make_number (PT + nchars),
Qnil, Qnil, Qnil);
@ -976,7 +976,7 @@ insert_from_string_1 (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
offset_intervals (current_buffer, PT, nchars);
intervals = string_get_intervals (string);
intervals = string_intervals (string);
/* Get the intervals for the part of the string we are inserting. */
if (nbytes < SBYTES (string))
intervals = copy_intervals (intervals, pos, nchars);
@ -1017,7 +1017,7 @@ insert_from_gap (ptrdiff_t nchars, ptrdiff_t nbytes)
adjust_markers_for_insert (GPT - nchars, GPT_BYTE - nbytes,
GPT, GPT_BYTE, 0);
if (buffer_get_intervals (current_buffer))
if (buffer_intervals (current_buffer))
{
offset_intervals (current_buffer, GPT - nchars, nchars);
graft_intervals_into_buffer (NULL, GPT - nchars, nchars,
@ -1157,11 +1157,11 @@ insert_from_buffer_1 (struct buffer *buf,
PT_BYTE + outgoing_nbytes,
0);
if (buffer_get_intervals (current_buffer))
if (buffer_intervals (current_buffer))
offset_intervals (current_buffer, PT, nchars);
/* Get the intervals for the part of the string we are inserting. */
intervals = buffer_get_intervals (buf);
intervals = buffer_intervals (buf);
if (nchars < BUF_Z (buf) - BUF_BEG (buf))
{
if (buf == current_buffer && PT <= from)
@ -1226,7 +1226,7 @@ adjust_after_replace (ptrdiff_t from, ptrdiff_t from_byte,
else if (len < nchars_del)
adjust_overlays_for_delete (from, nchars_del - len);
if (buffer_get_intervals (current_buffer))
if (buffer_intervals (current_buffer))
offset_intervals (current_buffer, from, len - nchars_del);
if (from < PT)
@ -1412,7 +1412,7 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new,
/* Get the intervals for the part of the string we are inserting--
not including the combined-before bytes. */
intervals = string_get_intervals (new);
intervals = string_intervals (new);
/* Insert those intervals. */
graft_intervals_into_buffer (intervals, from, inschars,
current_buffer, inherit);
@ -1792,7 +1792,7 @@ modify_region (struct buffer *buffer, ptrdiff_t start, ptrdiff_t end,
if (! preserve_chars_modiff)
CHARS_MODIFF = MODIFF;
BSET (buffer, point_before_scroll, Qnil);
bset_point_before_scroll (buffer, Qnil);
if (buffer != old_buffer)
set_buffer_internal (old_buffer);
@ -1822,7 +1822,7 @@ prepare_to_modify_buffer (ptrdiff_t start, ptrdiff_t end,
if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
++windows_or_buffers_changed;
if (buffer_get_intervals (current_buffer))
if (buffer_intervals (current_buffer))
{
if (preserve_ptr)
{

View file

@ -59,10 +59,41 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object);
static INTERVAL merge_interval_right (INTERVAL);
static INTERVAL reproduce_tree (INTERVAL, INTERVAL);
static INTERVAL reproduce_tree_obj (INTERVAL, Lisp_Object);
/* Utility functions for intervals. */
/* Use these functions to set Lisp_Object
or pointer slots of struct interval. */
static inline void
set_interval_object (INTERVAL i, Lisp_Object obj)
{
eassert (BUFFERP (obj) || STRINGP (obj));
i->up_obj = 1;
i->up.obj = obj;
}
static inline void
set_interval_left (INTERVAL i, INTERVAL left)
{
i->left = left;
}
static inline void
set_interval_right (INTERVAL i, INTERVAL right)
{
i->right = right;
}
/* Make the parent of D be whatever the parent of S is, regardless
of the type. This is used when balancing an interval tree. */
static inline void
copy_interval_parent (INTERVAL d, INTERVAL s)
{
d->up = s->up;
d->up_obj = s->up_obj;
}
/* Create the root interval of some object, a buffer or string. */
@ -80,18 +111,18 @@ create_root_interval (Lisp_Object parent)
new->total_length = (BUF_Z (XBUFFER (parent))
- BUF_BEG (XBUFFER (parent)));
eassert (0 <= TOTAL_LENGTH (new));
buffer_set_intervals (XBUFFER (parent), new);
set_buffer_intervals (XBUFFER (parent), new);
new->position = BEG;
}
else if (STRINGP (parent))
{
new->total_length = SCHARS (parent);
eassert (0 <= TOTAL_LENGTH (new));
string_set_intervals (parent, new);
set_string_intervals (parent, new);
new->position = 0;
}
interval_set_object (new, parent);
set_interval_object (new, parent);
return new;
}
@ -105,7 +136,7 @@ copy_properties (register INTERVAL source, register INTERVAL target)
return;
COPY_INTERVAL_CACHE (source, target);
interval_set_plist (target, Fcopy_sequence (source->plist));
set_interval_plist (target, Fcopy_sequence (source->plist));
}
/* Merge the properties of interval SOURCE into the properties
@ -141,7 +172,7 @@ merge_properties (register INTERVAL source, register INTERVAL target)
if (NILP (val))
{
val = XCAR (o);
interval_set_plist (target, Fcons (sym, Fcons (val, target->plist)));
set_interval_plist (target, Fcons (sym, Fcons (val, target->plist)));
}
o = XCDR (o);
}
@ -323,21 +354,21 @@ rotate_right (INTERVAL interval)
if (! ROOT_INTERVAL_P (interval))
{
if (AM_LEFT_CHILD (interval))
interval_set_left (INTERVAL_PARENT (interval), B);
set_interval_left (INTERVAL_PARENT (interval), B);
else
interval_set_right (INTERVAL_PARENT (interval), B);
set_interval_right (INTERVAL_PARENT (interval), B);
}
interval_copy_parent (B, interval);
copy_interval_parent (B, interval);
/* Make B the parent of A */
i = B->right;
interval_set_right (B, interval);
interval_set_parent (interval, B);
set_interval_right (B, interval);
set_interval_parent (interval, B);
/* Make A point to c */
interval_set_left (interval, i);
set_interval_left (interval, i);
if (i)
interval_set_parent (i, interval);
set_interval_parent (i, interval);
/* A's total length is decreased by the length of B and its left child. */
interval->total_length -= B->total_length - LEFT_TOTAL_LENGTH (interval);
@ -370,21 +401,21 @@ rotate_left (INTERVAL interval)
if (! ROOT_INTERVAL_P (interval))
{
if (AM_LEFT_CHILD (interval))
interval_set_left (INTERVAL_PARENT (interval), B);
set_interval_left (INTERVAL_PARENT (interval), B);
else
interval_set_right (INTERVAL_PARENT (interval), B);
set_interval_right (INTERVAL_PARENT (interval), B);
}
interval_copy_parent (B, interval);
copy_interval_parent (B, interval);
/* Make B the parent of A */
i = B->left;
interval_set_left (B, interval);
interval_set_parent (interval, B);
set_interval_left (B, interval);
set_interval_parent (interval, B);
/* Make A point to c */
interval_set_right (interval, i);
set_interval_right (interval, i);
if (i)
interval_set_parent (i, interval);
set_interval_parent (i, interval);
/* A's total length is decreased by the length of B and its right child. */
interval->total_length -= B->total_length - RIGHT_TOTAL_LENGTH (interval);
@ -456,9 +487,9 @@ balance_possible_root_interval (register INTERVAL interval)
if (have_parent)
{
if (BUFFERP (parent))
buffer_set_intervals (XBUFFER (parent), interval);
set_buffer_intervals (XBUFFER (parent), interval);
else if (STRINGP (parent))
string_set_intervals (parent, interval);
set_string_intervals (parent, interval);
}
return interval;
@ -494,9 +525,9 @@ buffer_balance_intervals (struct buffer *b)
INTERVAL i;
eassert (b != NULL);
i = buffer_get_intervals (b);
i = buffer_intervals (b);
if (i)
buffer_set_intervals (b, balance_an_interval (i));
set_buffer_intervals (b, balance_an_interval (i));
}
/* Split INTERVAL into two pieces, starting the second piece at
@ -520,20 +551,20 @@ split_interval_right (INTERVAL interval, ptrdiff_t offset)
ptrdiff_t new_length = LENGTH (interval) - offset;
new->position = position + offset;
interval_set_parent (new, interval);
set_interval_parent (new, interval);
if (NULL_RIGHT_CHILD (interval))
{
interval_set_right (interval, new);
set_interval_right (interval, new);
new->total_length = new_length;
eassert (0 <= TOTAL_LENGTH (new));
}
else
{
/* Insert the new node between INTERVAL and its right child. */
interval_set_right (new, interval->right);
interval_set_parent (interval->right, new);
interval_set_right (interval, new);
set_interval_right (new, interval->right);
set_interval_parent (interval->right, new);
set_interval_right (interval, new);
new->total_length = new_length + new->right->total_length;
eassert (0 <= TOTAL_LENGTH (new));
balance_an_interval (new);
@ -565,20 +596,20 @@ split_interval_left (INTERVAL interval, ptrdiff_t offset)
new->position = interval->position;
interval->position = interval->position + offset;
interval_set_parent (new, interval);
set_interval_parent (new, interval);
if (NULL_LEFT_CHILD (interval))
{
interval_set_left (interval, new);
set_interval_left (interval, new);
new->total_length = new_length;
eassert (0 <= TOTAL_LENGTH (new));
}
else
{
/* Insert the new node between INTERVAL and its left child. */
interval_set_left (new, interval->left);
interval_set_parent (new->left, new);
interval_set_left (interval, new);
set_interval_left (new, interval->left);
set_interval_parent (new->left, new);
set_interval_left (interval, new);
new->total_length = new_length + new->left->total_length;
eassert (0 <= TOTAL_LENGTH (new));
balance_an_interval (new);
@ -953,20 +984,20 @@ adjust_intervals_for_insertion (INTERVAL tree,
RESET_INTERVAL (&newi);
pleft = prev ? prev->plist : Qnil;
pright = i ? i->plist : Qnil;
interval_set_plist (&newi, merge_properties_sticky (pleft, pright));
set_interval_plist (&newi, merge_properties_sticky (pleft, pright));
if (! prev) /* i.e. position == BEG */
{
if (! intervals_equal (i, &newi))
{
i = split_interval_left (i, length);
interval_set_plist (i, newi.plist);
set_interval_plist (i, newi.plist);
}
}
else if (! intervals_equal (prev, &newi))
{
prev = split_interval_right (prev, position - prev->position);
interval_set_plist (prev, newi.plist);
set_interval_plist (prev, newi.plist);
if (i && intervals_equal (prev, i))
merge_interval_right (prev);
}
@ -1191,8 +1222,8 @@ delete_node (register INTERVAL i)
this->total_length += migrate_amt;
}
eassert (0 <= TOTAL_LENGTH (this));
interval_set_left (this, migrate);
interval_set_parent (migrate, this);
set_interval_left (this, migrate);
set_interval_parent (migrate, this);
return i->right;
}
@ -1217,12 +1248,12 @@ delete_interval (register INTERVAL i)
GET_INTERVAL_OBJECT (owner, i);
parent = delete_node (i);
if (parent)
interval_set_object (parent, owner);
set_interval_object (parent, owner);
if (BUFFERP (owner))
buffer_set_intervals (XBUFFER (owner), parent);
set_buffer_intervals (XBUFFER (owner), parent);
else if (STRINGP (owner))
string_set_intervals (owner, parent);
set_string_intervals (owner, parent);
else
abort ();
@ -1232,15 +1263,15 @@ delete_interval (register INTERVAL i)
parent = INTERVAL_PARENT (i);
if (AM_LEFT_CHILD (i))
{
interval_set_left (parent, delete_node (i));
set_interval_left (parent, delete_node (i));
if (parent->left)
interval_set_parent (parent->left, parent);
set_interval_parent (parent->left, parent);
}
else
{
interval_set_right (parent, delete_node (i));
set_interval_right (parent, delete_node (i));
if (parent->right)
interval_set_parent (parent->right, parent);
set_interval_parent (parent->right, parent);
}
}
@ -1321,8 +1352,8 @@ static void
adjust_intervals_for_deletion (struct buffer *buffer,
ptrdiff_t start, ptrdiff_t length)
{
register ptrdiff_t left_to_delete = length;
register INTERVAL tree = buffer_get_intervals (buffer);
ptrdiff_t left_to_delete = length;
INTERVAL tree = buffer_intervals (buffer);
Lisp_Object parent;
ptrdiff_t offset;
@ -1337,7 +1368,7 @@ adjust_intervals_for_deletion (struct buffer *buffer,
if (length == TOTAL_LENGTH (tree))
{
buffer_set_intervals (buffer, NULL);
set_buffer_intervals (buffer, NULL);
return;
}
@ -1354,10 +1385,10 @@ adjust_intervals_for_deletion (struct buffer *buffer,
{
left_to_delete -= interval_deletion_adjustment (tree, start - offset,
left_to_delete);
tree = buffer_get_intervals (buffer);
tree = buffer_intervals (buffer);
if (left_to_delete == tree->total_length)
{
buffer_set_intervals (buffer, NULL);
set_buffer_intervals (buffer, NULL);
return;
}
}
@ -1371,11 +1402,11 @@ adjust_intervals_for_deletion (struct buffer *buffer,
void
offset_intervals (struct buffer *buffer, ptrdiff_t start, ptrdiff_t length)
{
if (!buffer_get_intervals (buffer) || length == 0)
if (!buffer_intervals (buffer) || length == 0)
return;
if (length > 0)
adjust_intervals_for_insertion (buffer_get_intervals (buffer),
adjust_intervals_for_insertion (buffer_intervals (buffer),
start, length);
else
{
@ -1498,6 +1529,26 @@ merge_interval_left (register INTERVAL i)
abort ();
}
/* Create a copy of SOURCE but with the default value of UP. */
static INTERVAL
reproduce_interval (INTERVAL source)
{
register INTERVAL target = make_interval ();
target->total_length = source->total_length;
target->position = source->position;
copy_properties (source, target);
if (! NULL_LEFT_CHILD (source))
set_interval_left (target, reproduce_tree (source->left, target));
if (! NULL_RIGHT_CHILD (source))
set_interval_right (target, reproduce_tree (source->right, target));
return target;
}
/* Make an exact copy of interval tree SOURCE which descends from
PARENT. This is done by recursing through SOURCE, copying
the current interval and its properties, and then adjusting
@ -1506,33 +1557,17 @@ merge_interval_left (register INTERVAL i)
static INTERVAL
reproduce_tree (INTERVAL source, INTERVAL parent)
{
register INTERVAL t = make_interval ();
memcpy (t, source, sizeof *t);
copy_properties (source, t);
interval_set_parent (t, parent);
if (! NULL_LEFT_CHILD (source))
interval_set_left (t, reproduce_tree (source->left, t));
if (! NULL_RIGHT_CHILD (source))
interval_set_right (t, reproduce_tree (source->right, t));
return t;
INTERVAL target = reproduce_interval (source);
set_interval_parent (target, parent);
return target;
}
static INTERVAL
reproduce_tree_obj (INTERVAL source, Lisp_Object parent)
{
register INTERVAL t = make_interval ();
memcpy (t, source, sizeof *t);
copy_properties (source, t);
interval_set_object (t, parent);
if (! NULL_LEFT_CHILD (source))
interval_set_left (t, reproduce_tree (source->left, t));
if (! NULL_RIGHT_CHILD (source))
interval_set_right (t, reproduce_tree (source->right, t));
return t;
INTERVAL target = reproduce_interval (source);
set_interval_object (target, parent);
return target;
}
/* Insert the intervals of SOURCE into BUFFER at POSITION.
@ -1577,12 +1612,10 @@ graft_intervals_into_buffer (INTERVAL source, ptrdiff_t position,
ptrdiff_t length, struct buffer *buffer,
int inherit)
{
register INTERVAL under, over, this;
register INTERVAL tree;
INTERVAL tree = buffer_intervals (buffer);
INTERVAL under, over, this;
ptrdiff_t over_used;
tree = buffer_get_intervals (buffer);
/* If the new text has no properties, then with inheritance it
becomes part of whatever interval it was inserted into.
To prevent inheritance, we must clear out the properties
@ -1611,9 +1644,9 @@ graft_intervals_into_buffer (INTERVAL source, ptrdiff_t position,
Lisp_Object buf;
XSETBUFFER (buf, buffer);
buffer_set_intervals (buffer, reproduce_tree_obj (source, buf));
buffer_get_intervals (buffer)->position = BUF_BEG (buffer);
eassert (buffer_get_intervals (buffer)->up_obj == 1);
set_buffer_intervals (buffer, reproduce_tree_obj (source, buf));
buffer_intervals (buffer)->position = BUF_BEG (buffer);
eassert (buffer_intervals (buffer)->up_obj == 1);
return;
}
else if (!tree)
@ -1854,7 +1887,7 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos)
int have_overlays;
ptrdiff_t original_position;
BSET (current_buffer, point_before_scroll, Qnil);
bset_point_before_scroll (current_buffer, Qnil);
if (charpos == PT)
return;
@ -1871,7 +1904,7 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos)
/* If we have no text properties and overlays,
then we can do it quickly. */
if (!buffer_get_intervals (current_buffer) && ! have_overlays)
if (!buffer_intervals (current_buffer) && ! have_overlays)
{
temp_set_point_both (current_buffer, charpos, bytepos);
return;
@ -1880,7 +1913,7 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos)
/* Set TO to the interval containing the char after CHARPOS,
and TOPREV to the interval containing the char before CHARPOS.
Either one may be null. They may be equal. */
to = find_interval (buffer_get_intervals (current_buffer), charpos);
to = find_interval (buffer_intervals (current_buffer), charpos);
if (charpos == BEGV)
toprev = 0;
else if (to && to->position == charpos)
@ -1894,7 +1927,7 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos)
and FROMPREV to the interval containing the char before PT.
Either one may be null. They may be equal. */
/* We could cache this and save time. */
from = find_interval (buffer_get_intervals (current_buffer), buffer_point);
from = find_interval (buffer_intervals (current_buffer), buffer_point);
if (buffer_point == BEGV)
fromprev = 0;
else if (from && from->position == PT)
@ -2000,7 +2033,7 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos)
/* Set TO to the interval containing the char after CHARPOS,
and TOPREV to the interval containing the char before CHARPOS.
Either one may be null. They may be equal. */
to = find_interval (buffer_get_intervals (current_buffer), charpos);
to = find_interval (buffer_intervals (current_buffer), charpos);
if (charpos == BEGV)
toprev = 0;
else if (to && to->position == charpos)
@ -2133,11 +2166,11 @@ get_property_and_range (ptrdiff_t pos, Lisp_Object prop, Lisp_Object *val,
INTERVAL i, prev, next;
if (NILP (object))
i = find_interval (buffer_get_intervals (current_buffer), pos);
i = find_interval (buffer_intervals (current_buffer), pos);
else if (BUFFERP (object))
i = find_interval (buffer_get_intervals (XBUFFER (object)), pos);
i = find_interval (buffer_intervals (XBUFFER (object)), pos);
else if (STRINGP (object))
i = find_interval (string_get_intervals (object), pos);
i = find_interval (string_intervals (object), pos);
else
abort ();
@ -2264,13 +2297,13 @@ void
copy_intervals_to_string (Lisp_Object string, struct buffer *buffer,
ptrdiff_t position, ptrdiff_t length)
{
INTERVAL interval_copy = copy_intervals (buffer_get_intervals (buffer),
INTERVAL interval_copy = copy_intervals (buffer_intervals (buffer),
position, length);
if (!interval_copy)
return;
interval_set_object (interval_copy, string);
string_set_intervals (string, interval_copy);
set_interval_object (interval_copy, string);
set_string_intervals (string, interval_copy);
}
/* Return 1 if strings S1 and S2 have identical properties; 0 otherwise.
@ -2283,8 +2316,8 @@ compare_string_intervals (Lisp_Object s1, Lisp_Object s2)
ptrdiff_t pos = 0;
ptrdiff_t end = SCHARS (s1);
i1 = find_interval (string_get_intervals (s1), 0);
i2 = find_interval (string_get_intervals (s2), 0);
i1 = find_interval (string_intervals (s1), 0);
i2 = find_interval (string_intervals (s2), 0);
while (pos < end)
{
@ -2409,13 +2442,13 @@ set_intervals_multibyte_1 (INTERVAL i, int multi_flag,
{
if ((i)->left)
{
interval_set_plist (i, i->left->plist);
set_interval_plist (i, i->left->plist);
(i)->left->total_length = 0;
delete_interval ((i)->left);
}
else
{
interval_set_plist (i, i->right->plist);
set_interval_plist (i, i->right->plist);
(i)->right->total_length = 0;
delete_interval ((i)->right);
}
@ -2429,7 +2462,7 @@ set_intervals_multibyte_1 (INTERVAL i, int multi_flag,
void
set_intervals_multibyte (int multi_flag)
{
INTERVAL i = buffer_get_intervals (current_buffer);
INTERVAL i = buffer_intervals (current_buffer);
if (i)
set_intervals_multibyte_1 (i, multi_flag, BEG, BEG_BYTE, Z, Z_BYTE);

View file

@ -137,47 +137,16 @@ struct interval
or pointer slots of struct interval. */
INTERVALS_INLINE void
interval_set_parent (INTERVAL i, INTERVAL parent)
set_interval_parent (INTERVAL i, INTERVAL parent)
{
i->up_obj = 0;
i->up.interval = parent;
}
INTERVALS_INLINE void
interval_set_object (INTERVAL i, Lisp_Object obj)
{
eassert (BUFFERP (obj) || STRINGP (obj));
i->up_obj = 1;
i->up.obj = obj;
}
INTERVALS_INLINE void
interval_set_left (INTERVAL i, INTERVAL left)
{
i->left = left;
}
INTERVALS_INLINE void
interval_set_right (INTERVAL i, INTERVAL right)
{
i->right = right;
}
INTERVALS_INLINE Lisp_Object
interval_set_plist (INTERVAL i, Lisp_Object plist)
set_interval_plist (INTERVAL i, Lisp_Object plist)
{
i->plist = plist;
return plist;
}
/* Make the parent of D be whatever the parent of S is, regardless
of the type. This is used when balancing an interval tree. */
INTERVALS_INLINE void
interval_copy_parent (INTERVAL d, INTERVAL s)
{
d->up = s->up;
d->up_obj = s->up_obj;
}
/* Get the parent interval, if any, otherwise a null pointer. Useful
@ -191,11 +160,11 @@ interval_copy_parent (INTERVAL d, INTERVAL s)
{ \
(i)->total_length = (i)->position = 0; \
(i)->left = (i)->right = NULL; \
interval_set_parent (i, NULL); \
set_interval_parent (i, NULL); \
(i)->write_protect = 0; \
(i)->visible = 0; \
(i)->front_sticky = (i)->rear_sticky = 0; \
interval_set_plist (i, Qnil); \
set_interval_plist (i, Qnil); \
}
/* Copy the cached property values of interval FROM to interval TO. */

View file

@ -18,6 +18,9 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#define KEYBOARD_INLINE EXTERN_INLINE
#include <signal.h>
#include <stdio.h>
#include <setjmp.h>
@ -469,6 +472,53 @@ static void handle_user_signal (int);
static char *find_user_signal_name (int);
static int store_user_signal_events (void);
/* These setters are used only in this file, so they can be private. */
static inline void
kset_echo_string (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (echo_string) = val;
}
static inline void
kset_kbd_queue (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (kbd_queue) = val;
}
static inline void
kset_keyboard_translate_table (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vkeyboard_translate_table) = val;
}
static inline void
kset_last_prefix_arg (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vlast_prefix_arg) = val;
}
static inline void
kset_last_repeatable_command (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vlast_repeatable_command) = val;
}
static inline void
kset_local_function_key_map (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vlocal_function_key_map) = val;
}
static inline void
kset_overriding_terminal_local_map (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Voverriding_terminal_local_map) = val;
}
static inline void
kset_real_last_command (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vreal_last_command) = val;
}
static inline void
kset_system_key_syms (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (system_key_syms) = val;
}
/* Add C to the echo string, if echoing is going on.
C can be a character, which is printed prettily ("M-C-x" and all that
@ -551,8 +601,9 @@ echo_char (Lisp_Object c)
else if (STRINGP (echo_string))
echo_string = concat2 (echo_string, build_string (" "));
KSET (current_kboard, echo_string,
concat2 (echo_string, make_string (buffer, ptr - buffer)));
kset_echo_string
(current_kboard,
concat2 (echo_string, make_string (buffer, ptr - buffer)));
echo_now ();
}
@ -597,8 +648,9 @@ echo_dash (void)
/* Put a dash at the end of the buffer temporarily,
but make it go away when the next character is added. */
KSET (current_kboard, echo_string,
concat2 (KVAR (current_kboard, echo_string), build_string ("-")));
kset_echo_string
(current_kboard,
concat2 (KVAR (current_kboard, echo_string), build_string ("-")));
echo_now ();
}
@ -660,7 +712,7 @@ cancel_echoing (void)
{
current_kboard->immediate_echo = 0;
current_kboard->echo_after_prompt = -1;
KSET (current_kboard, echo_string, Qnil);
kset_echo_string (current_kboard, Qnil);
ok_to_echo_at_next_pause = NULL;
echo_kboard = NULL;
echo_message_buffer = Qnil;
@ -684,9 +736,9 @@ static void
echo_truncate (ptrdiff_t nchars)
{
if (STRINGP (KVAR (current_kboard, echo_string)))
KSET (current_kboard, echo_string,
Fsubstring (KVAR (current_kboard, echo_string),
make_number (0), make_number (nchars)));
kset_echo_string (current_kboard,
Fsubstring (KVAR (current_kboard, echo_string),
make_number (0), make_number (nchars)));
truncate_echo_area (nchars);
}
@ -1016,8 +1068,8 @@ cmd_error (Lisp_Object data)
Vstandard_input = Qt;
Vexecuting_kbd_macro = Qnil;
executing_kbd_macro = Qnil;
KSET (current_kboard, Vprefix_arg, Qnil);
KSET (current_kboard, Vlast_prefix_arg, Qnil);
kset_prefix_arg (current_kboard, Qnil);
kset_last_prefix_arg (current_kboard, Qnil);
cancel_echoing ();
/* Avoid unquittable loop if data contains a circular list. */
@ -1338,8 +1390,8 @@ command_loop_1 (void)
#endif
int already_adjusted = 0;
KSET (current_kboard, Vprefix_arg, Qnil);
KSET (current_kboard, Vlast_prefix_arg, Qnil);
kset_prefix_arg (current_kboard, Qnil);
kset_last_prefix_arg (current_kboard, Qnil);
Vdeactivate_mark = Qnil;
waiting_for_input = 0;
cancel_echoing ();
@ -1371,10 +1423,10 @@ command_loop_1 (void)
}
/* Do this after running Vpost_command_hook, for consistency. */
KSET (current_kboard, Vlast_command, Vthis_command);
KSET (current_kboard, Vreal_last_command, Vreal_this_command);
kset_last_command (current_kboard, Vthis_command);
kset_real_last_command (current_kboard, Vreal_this_command);
if (!CONSP (last_command_event))
KSET (current_kboard, Vlast_repeatable_command, Vreal_this_command);
kset_last_repeatable_command (current_kboard, Vreal_this_command);
while (1)
{
@ -1546,7 +1598,7 @@ command_loop_1 (void)
keys = Fkey_description (keys, Qnil);
bitch_at_user ();
message_with_string ("%s is undefined", keys, 0);
KSET (current_kboard, defining_kbd_macro, Qnil);
kset_defining_kbd_macro (current_kboard, Qnil);
update_mode_lines = 1;
/* If this is a down-mouse event, don't reset prefix-arg;
pass it to the command run by the up event. */
@ -1556,10 +1608,10 @@ command_loop_1 (void)
= parse_modifiers (EVENT_HEAD (last_command_event));
int modifiers = XINT (XCAR (XCDR (breakdown)));
if (!(modifiers & down_modifier))
KSET (current_kboard, Vprefix_arg, Qnil);
kset_prefix_arg (current_kboard, Qnil);
}
else
KSET (current_kboard, Vprefix_arg, Qnil);
kset_prefix_arg (current_kboard, Qnil);
}
else
{
@ -1596,7 +1648,7 @@ command_loop_1 (void)
unbind_to (scount, Qnil);
#endif
}
KSET (current_kboard, Vlast_prefix_arg, Vcurrent_prefix_arg);
kset_last_prefix_arg (current_kboard, Vcurrent_prefix_arg);
safe_run_hooks (Qpost_command_hook);
@ -1627,10 +1679,10 @@ command_loop_1 (void)
if (NILP (KVAR (current_kboard, Vprefix_arg))
|| CONSP (last_command_event))
{
KSET (current_kboard, Vlast_command, Vthis_command);
KSET (current_kboard, Vreal_last_command, Vreal_this_command);
kset_last_command (current_kboard, Vthis_command);
kset_real_last_command (current_kboard, Vreal_this_command);
if (!CONSP (last_command_event))
KSET (current_kboard, Vlast_repeatable_command, Vreal_this_command);
kset_last_repeatable_command (current_kboard, Vreal_this_command);
cancel_echoing ();
this_command_key_count = 0;
this_command_key_count_reset = 0;
@ -2573,7 +2625,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
abort ();
}
if (!CONSP (last))
KSET (kb, kbd_queue, Fcons (c, Qnil));
kset_kbd_queue (kb, Fcons (c, Qnil));
else
XSETCDR (last, Fcons (c, Qnil));
kb->kbd_queue_has_data = 1;
@ -2745,8 +2797,8 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
if (!CONSP (KVAR (current_kboard, kbd_queue)))
abort ();
c = XCAR (KVAR (current_kboard, kbd_queue));
KSET (current_kboard, kbd_queue,
XCDR (KVAR (current_kboard, kbd_queue)));
kset_kbd_queue (current_kboard,
XCDR (KVAR (current_kboard, kbd_queue)));
if (NILP (KVAR (current_kboard, kbd_queue)))
current_kboard->kbd_queue_has_data = 0;
input_pending = readable_events (0);
@ -2813,7 +2865,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
abort ();
}
if (!CONSP (last))
KSET (kb, kbd_queue, Fcons (c, Qnil));
kset_kbd_queue (kb, Fcons (c, Qnil));
else
XSETCDR (last, Fcons (c, Qnil));
kb->kbd_queue_has_data = 1;
@ -3071,7 +3123,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
cancel_echoing ();
ok_to_echo_at_next_pause = saved_ok_to_echo;
KSET (current_kboard, echo_string, saved_echo_string);
kset_echo_string (current_kboard, saved_echo_string);
current_kboard->echo_after_prompt = saved_echo_after_prompt;
if (saved_immediate_echo)
echo_now ();
@ -3542,9 +3594,9 @@ kbd_buffer_store_event_hold (register struct input_event *event,
if (single_kboard && kb != current_kboard)
{
KSET (kb, kbd_queue,
Fcons (make_lispy_switch_frame (event->frame_or_window),
Fcons (make_number (c), Qnil)));
kset_kbd_queue
(kb, Fcons (make_lispy_switch_frame (event->frame_or_window),
Fcons (make_number (c), Qnil)));
kb->kbd_queue_has_data = 1;
for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++)
{
@ -5416,7 +5468,7 @@ make_lispy_event (struct input_event *event)
/* We need to use an alist rather than a vector as the cache
since we can't make a vector long enough. */
if (NILP (KVAR (current_kboard, system_key_syms)))
KSET (current_kboard, system_key_syms, Fcons (Qnil, Qnil));
kset_system_key_syms (current_kboard, Fcons (Qnil, Qnil));
return modify_event_symbol (event->code,
event->modifiers,
Qfunction_key,
@ -8739,11 +8791,11 @@ read_char_minibuf_menu_prompt (int commandflag,
is not used on replay.
*/
orig_defn_macro = KVAR (current_kboard, defining_kbd_macro);
KSET (current_kboard, defining_kbd_macro, Qnil);
kset_defining_kbd_macro (current_kboard, Qnil);
do
obj = read_char (commandflag, 0, 0, Qt, 0, NULL);
while (BUFFERP (obj));
KSET (current_kboard, defining_kbd_macro, orig_defn_macro);
kset_defining_kbd_macro (current_kboard, orig_defn_macro);
if (!INTEGERP (obj))
return obj;
@ -9099,7 +9151,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
/* Install the string STR as the beginning of the string of
echoing, so that it serves as a prompt for the next
character. */
KSET (current_kboard, echo_string, prompt);
kset_echo_string (current_kboard, prompt);
current_kboard->echo_after_prompt = SCHARS (prompt);
echo_now ();
}
@ -9345,15 +9397,17 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
if (!NILP (delayed_switch_frame))
{
KSET (interrupted_kboard, kbd_queue,
Fcons (delayed_switch_frame,
KVAR (interrupted_kboard, kbd_queue)));
kset_kbd_queue
(interrupted_kboard,
Fcons (delayed_switch_frame,
KVAR (interrupted_kboard, kbd_queue)));
delayed_switch_frame = Qnil;
}
while (t > 0)
KSET (interrupted_kboard, kbd_queue,
Fcons (keybuf[--t], KVAR (interrupted_kboard, kbd_queue)));
kset_kbd_queue
(interrupted_kboard,
Fcons (keybuf[--t], KVAR (interrupted_kboard, kbd_queue)));
/* If the side queue is non-empty, ensure it begins with a
switch-frame, so we'll replay it in the right context. */
@ -9365,9 +9419,10 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
{
Lisp_Object frame;
XSETFRAME (frame, interrupted_frame);
KSET (interrupted_kboard, kbd_queue,
Fcons (make_lispy_switch_frame (frame),
KVAR (interrupted_kboard, kbd_queue)));
kset_kbd_queue
(interrupted_kboard,
Fcons (make_lispy_switch_frame (frame),
KVAR (interrupted_kboard, kbd_queue)));
}
mock_input = 0;
orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
@ -10261,7 +10316,7 @@ a special event, so ignore the prefix argument and don't clear it. */)
{
prefixarg = KVAR (current_kboard, Vprefix_arg);
Vcurrent_prefix_arg = prefixarg;
KSET (current_kboard, Vprefix_arg, Qnil);
kset_prefix_arg (current_kboard, Qnil);
}
else
prefixarg = Qnil;
@ -11200,11 +11255,8 @@ The `posn-' functions access elements of such lists. */)
if (WINDOWP (frame_or_window))
{
struct window *w;
struct window *w = decode_valid_window (frame_or_window);
CHECK_LIVE_WINDOW (frame_or_window);
w = XWINDOW (frame_or_window);
XSETINT (x, (XINT (x)
+ WINDOW_LEFT_EDGE_X (w)
+ (NILP (whole)
@ -11259,30 +11311,30 @@ The `posn-' functions access elements of such lists. */)
void
init_kboard (KBOARD *kb)
{
KSET (kb, Voverriding_terminal_local_map, Qnil);
KSET (kb, Vlast_command, Qnil);
KSET (kb, Vreal_last_command, Qnil);
KSET (kb, Vkeyboard_translate_table, Qnil);
KSET (kb, Vlast_repeatable_command, Qnil);
KSET (kb, Vprefix_arg, Qnil);
KSET (kb, Vlast_prefix_arg, Qnil);
KSET (kb, kbd_queue, Qnil);
kset_overriding_terminal_local_map (kb, Qnil);
kset_last_command (kb, Qnil);
kset_real_last_command (kb, Qnil);
kset_keyboard_translate_table (kb, Qnil);
kset_last_repeatable_command (kb, Qnil);
kset_prefix_arg (kb, Qnil);
kset_last_prefix_arg (kb, Qnil);
kset_kbd_queue (kb, Qnil);
kb->kbd_queue_has_data = 0;
kb->immediate_echo = 0;
KSET (kb, echo_string, Qnil);
kset_echo_string (kb, Qnil);
kb->echo_after_prompt = -1;
kb->kbd_macro_buffer = 0;
kb->kbd_macro_bufsize = 0;
KSET (kb, defining_kbd_macro, Qnil);
KSET (kb, Vlast_kbd_macro, Qnil);
kset_defining_kbd_macro (kb, Qnil);
kset_last_kbd_macro (kb, Qnil);
kb->reference_count = 0;
KSET (kb, Vsystem_key_alist, Qnil);
KSET (kb, system_key_syms, Qnil);
KSET (kb, Vwindow_system, Qt); /* Unset. */
KSET (kb, Vinput_decode_map, Fmake_sparse_keymap (Qnil));
KSET (kb, Vlocal_function_key_map, Fmake_sparse_keymap (Qnil));
kset_system_key_alist (kb, Qnil);
kset_system_key_syms (kb, Qnil);
kset_window_system (kb, Qt); /* Unset. */
kset_input_decode_map (kb, Fmake_sparse_keymap (Qnil));
kset_local_function_key_map (kb, Fmake_sparse_keymap (Qnil));
Fset_keymap_parent (KVAR (kb, Vlocal_function_key_map), Vfunction_key_map);
KSET (kb, Vdefault_minibuffer_frame, Qnil);
kset_default_minibuffer_frame (kb, Qnil);
}
/*
@ -11358,7 +11410,7 @@ init_keyboard (void)
init_kboard (current_kboard);
/* A value of nil for Vwindow_system normally means a tty, but we also use
it for the initial terminal since there is no window system there. */
KSET (current_kboard, Vwindow_system, Qnil);
kset_window_system (current_kboard, Qnil);
if (!noninteractive)
{

View file

@ -19,10 +19,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "systime.h" /* for EMACS_TIME, Time */
#include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */
INLINE_HEADER_BEGIN
#ifndef KEYBOARD_INLINE
# define KEYBOARD_INLINE INLINE
#endif
/* Most code should use this macro to access Lisp fields in struct kboard. */
#define KVAR(kboard, field) ((kboard)->INTERNAL_FIELD (field))
#define KSET(kboard, field, value) ((kboard)->INTERNAL_FIELD (field) = (value))
/* Each KBOARD represents one logical input stream from which Emacs
gets input. If we are using ordinary terminals, it has one KBOARD
@ -173,6 +177,47 @@ struct kboard
char echo_after_prompt;
};
KEYBOARD_INLINE void
kset_default_minibuffer_frame (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vdefault_minibuffer_frame) = val;
}
KEYBOARD_INLINE void
kset_defining_kbd_macro (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (defining_kbd_macro) = val;
}
KEYBOARD_INLINE void
kset_input_decode_map (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vinput_decode_map) = val;
}
KEYBOARD_INLINE void
kset_last_command (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vlast_command) = val;
}
KEYBOARD_INLINE void
kset_last_kbd_macro (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vlast_kbd_macro) = val;
}
KEYBOARD_INLINE void
kset_prefix_arg (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vprefix_arg) = val;
}
KEYBOARD_INLINE void
kset_system_key_alist (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vsystem_key_alist) = val;
}
KEYBOARD_INLINE void
kset_window_system (struct kboard *kb, Lisp_Object val)
{
kb->INTERNAL_FIELD (Vwindow_system) = val;
}
/* Temporarily used before a frame has been opened. */
extern KBOARD *initial_kboard;
@ -510,3 +555,5 @@ extern void mark_kboards (void);
#ifdef WINDOWSNT
extern const char *const lispy_function_keys[];
#endif
INLINE_HEADER_END

View file

@ -1854,7 +1854,7 @@ If KEYMAP is nil, that means no local keymap. */)
if (!NILP (keymap))
keymap = get_keymap (keymap, 1, 1);
BSET (current_buffer, keymap, keymap);
bset_keymap (current_buffer, keymap);
return Qnil;
}

View file

@ -934,7 +934,7 @@ enum
8-bit European characters. Do not check validity of CT. */
#define CHAR_TABLE_SET(CT, IDX, VAL) \
(ASCII_CHAR_P (IDX) && SUB_CHAR_TABLE_P (XCHAR_TABLE (CT)->ascii) \
? XSUB_CHAR_TABLE (XCHAR_TABLE (CT)->ascii)->contents[IDX] = VAL \
? set_sub_char_table_contents (XCHAR_TABLE (CT)->ascii, IDX, VAL) \
: char_table_set (CT, IDX, VAL))
enum CHARTAB_SIZE_BITS
@ -947,8 +947,6 @@ enum CHARTAB_SIZE_BITS
extern const int chartab_size[4];
struct Lisp_Sub_Char_Table;
struct Lisp_Char_Table
{
/* HEADER.SIZE is the vector's size field, which also holds the
@ -997,6 +995,7 @@ struct Lisp_Sub_Char_Table
/* Minimum character covered by the sub char-table. */
Lisp_Object min_char;
/* Use set_sub_char_table_contents to set this. */
Lisp_Object contents[1];
};
@ -1478,14 +1477,6 @@ struct Lisp_Buffer_Local_Value
Lisp_Object valcell;
};
#define BLV_FOUND(blv) \
(eassert ((blv)->found == !EQ ((blv)->defcell, (blv)->valcell)), (blv)->found)
#define SET_BLV_FOUND(blv, v) \
(eassert ((v) == !EQ ((blv)->defcell, (blv)->valcell)), (blv)->found = (v))
#define BLV_VALUE(blv) (XCDR ((blv)->valcell))
#define SET_BLV_VALUE(blv, v) (XSETCDR ((blv)->valcell, v))
/* Like Lisp_Objfwd except that value lives in a slot in the
current kboard. */
struct Lisp_Kboard_Objfwd
@ -1767,15 +1758,18 @@ typedef struct {
#define CHECK_WINDOW_CONFIGURATION(x) \
CHECK_TYPE (WINDOW_CONFIGURATIONP (x), Qwindow_configuration_p, x)
/* This macro rejects windows on the interior of the window tree as
"dead", which is what we want; this is an argument-checking macro, and
the user should never get access to interior windows.
/* A window of any sort, leaf or interior, is "valid" if one of its
buffer, vchild, or hchild members is non-nil. */
#define CHECK_VALID_WINDOW(x) \
CHECK_TYPE (WINDOWP (x) \
&& (!NILP (XWINDOW (x)->buffer) \
|| !NILP (XWINDOW (x)->vchild) \
|| !NILP (XWINDOW (x)->hchild)), \
Qwindow_valid_p, x)
A window of any sort, leaf or interior, is dead if the buffer,
vchild, and hchild members are all nil. */
#define CHECK_LIVE_WINDOW(x) \
CHECK_TYPE (WINDOWP (x) && !NILP (XWINDOW (x)->buffer), \
/* A window is "live" if and only if it shows a buffer. */
#define CHECK_LIVE_WINDOW(x) \
CHECK_TYPE (WINDOWP (x) && !NILP (XWINDOW (x)->buffer), \
Qwindow_live_p, x)
#define CHECK_PROCESS(x) \
@ -2364,31 +2358,55 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
}
LISP_INLINE void
set_hash_key (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
set_hash_key_and_value (struct Lisp_Hash_Table *h, Lisp_Object key_and_value)
{
h->key_and_value = key_and_value;
}
LISP_INLINE void
set_hash_key_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
{
gc_aset (h->key_and_value, 2 * idx, val);
}
LISP_INLINE void
set_hash_value (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
set_hash_value_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
{
gc_aset (h->key_and_value, 2 * idx + 1, val);
}
LISP_INLINE void
set_hash_next (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
set_hash_next (struct Lisp_Hash_Table *h, Lisp_Object next)
{
h->next = next;
}
LISP_INLINE void
set_hash_next_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
{
gc_aset (h->next, idx, val);
}
LISP_INLINE void
set_hash_hash (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
set_hash_hash (struct Lisp_Hash_Table *h, Lisp_Object hash)
{
h->hash = hash;
}
LISP_INLINE void
set_hash_hash_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
{
gc_aset (h->hash, idx, val);
}
LISP_INLINE void
set_hash_index (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
set_hash_index (struct Lisp_Hash_Table *h, Lisp_Object index)
{
h->index = index;
}
LISP_INLINE void
set_hash_index_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
{
gc_aset (h->index, idx, val);
}
@ -2420,6 +2438,52 @@ set_symbol_next (Lisp_Object sym, struct Lisp_Symbol *next)
XSYMBOL (sym)->next = next;
}
/* Buffer-local (also frame-local) variable access functions. */
LISP_INLINE int
blv_found (struct Lisp_Buffer_Local_Value *blv)
{
eassert (blv->found == !EQ (blv->defcell, blv->valcell));
return blv->found;
}
LISP_INLINE void
set_blv_found (struct Lisp_Buffer_Local_Value *blv, int found)
{
eassert (found == !EQ (blv->defcell, blv->valcell));
blv->found = found;
}
LISP_INLINE Lisp_Object
blv_value (struct Lisp_Buffer_Local_Value *blv)
{
return XCDR (blv->valcell);
}
LISP_INLINE void
set_blv_value (struct Lisp_Buffer_Local_Value *blv, Lisp_Object val)
{
XSETCDR (blv->valcell, val);
}
LISP_INLINE void
set_blv_where (struct Lisp_Buffer_Local_Value *blv, Lisp_Object val)
{
blv->where = val;
}
LISP_INLINE void
set_blv_defcell (struct Lisp_Buffer_Local_Value *blv, Lisp_Object val)
{
blv->defcell = val;
}
LISP_INLINE void
set_blv_valcell (struct Lisp_Buffer_Local_Value *blv, Lisp_Object val)
{
blv->valcell = val;
}
/* Set overlay's property list. */
LISP_INLINE void
@ -2431,7 +2495,7 @@ set_overlay_plist (Lisp_Object overlay, Lisp_Object plist)
/* Get text properties of S. */
LISP_INLINE INTERVAL
string_get_intervals (Lisp_Object s)
string_intervals (Lisp_Object s)
{
return XSTRING (s)->intervals;
}
@ -2439,11 +2503,57 @@ string_get_intervals (Lisp_Object s)
/* Set text properties of S to I. */
LISP_INLINE void
string_set_intervals (Lisp_Object s, INTERVAL i)
set_string_intervals (Lisp_Object s, INTERVAL i)
{
XSTRING (s)->intervals = i;
}
/* Set a Lisp slot in TABLE to VAL. Most code should use this instead
of setting slots directly. */
LISP_INLINE void
set_char_table_ascii (Lisp_Object table, Lisp_Object val)
{
XCHAR_TABLE (table)->ascii = val;
}
LISP_INLINE void
set_char_table_defalt (Lisp_Object table, Lisp_Object val)
{
XCHAR_TABLE (table)->defalt = val;
}
LISP_INLINE void
set_char_table_parent (Lisp_Object table, Lisp_Object val)
{
XCHAR_TABLE (table)->parent = val;
}
LISP_INLINE void
set_char_table_purpose (Lisp_Object table, Lisp_Object val)
{
XCHAR_TABLE (table)->purpose = val;
}
/* Set different slots in (sub)character tables. */
LISP_INLINE void
set_char_table_extras (Lisp_Object table, ptrdiff_t idx, Lisp_Object val)
{
eassert (0 <= idx && idx < CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (table)));
XCHAR_TABLE (table)->extras[idx] = val;
}
LISP_INLINE void
set_char_table_contents (Lisp_Object table, ptrdiff_t idx, Lisp_Object val)
{
eassert (0 <= idx && idx < (1 << CHARTAB_SIZE_BITS_0));
XCHAR_TABLE (table)->contents[idx] = val;
}
LISP_INLINE void
set_sub_char_table_contents (Lisp_Object table, ptrdiff_t idx, Lisp_Object val)
{
XSUB_CHAR_TABLE (table)->contents[idx] = val;
}
/* Defined in data.c. */
extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
extern Lisp_Object Qerror_conditions, Qerror_message, Qtop_level;
@ -2666,7 +2776,6 @@ _Noreturn void __executable_start (void);
#endif
extern Lisp_Object selected_frame;
extern Lisp_Object Vwindow_system;
void duration_to_sec_usec (double, int *, int *);
extern Lisp_Object sit_for (Lisp_Object, int, int);
extern void init_display (void);
extern void syms_of_display (void);
@ -2847,9 +2956,8 @@ extern Lisp_Object copy_char_table (Lisp_Object);
extern Lisp_Object char_table_ref (Lisp_Object, int);
extern Lisp_Object char_table_ref_and_range (Lisp_Object, int,
int *, int *);
extern Lisp_Object char_table_set (Lisp_Object, int, Lisp_Object);
extern Lisp_Object char_table_set_range (Lisp_Object, int, int,
Lisp_Object);
extern void char_table_set (Lisp_Object, int, Lisp_Object);
extern void char_table_set_range (Lisp_Object, int, int, Lisp_Object);
extern int char_table_translate (Lisp_Object, int);
extern void map_char_table (void (*) (Lisp_Object, Lisp_Object,
Lisp_Object),

View file

@ -80,7 +80,7 @@ static Lisp_Object Qascii_character, Qload, Qload_file_name;
Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
static Lisp_Object Qinhibit_file_name_operation;
static Lisp_Object Qeval_buffer_list;
static Lisp_Object Qlexical_binding;
Lisp_Object Qlexical_binding;
static Lisp_Object Qfile_truename, Qdo_after_load_evaluation; /* ACM 2006/5/16 */
/* Used instead of Qget_file_char while loading *.elc files compiled
@ -3189,8 +3189,8 @@ substitute_object_recurse (Lisp_Object object, Lisp_Object placeholder, Lisp_Obj
/* Check for text properties in each interval.
substitute_in_interval contains part of the logic. */
INTERVAL root_interval = string_get_intervals (subtree);
Lisp_Object arg = Fcons (object, placeholder);
INTERVAL root_interval = string_intervals (subtree);
Lisp_Object arg = Fcons (object, placeholder);
traverse_intervals_noorder (root_interval,
&substitute_in_interval, arg);
@ -3211,7 +3211,7 @@ substitute_in_interval (INTERVAL interval, Lisp_Object arg)
Lisp_Object object = Fcar (arg);
Lisp_Object placeholder = Fcdr (arg);
SUBSTITUTE (interval->plist, interval_set_plist (interval, true_value));
SUBSTITUTE (interval->plist, set_interval_plist (interval, true_value));
}

View file

@ -127,7 +127,7 @@ macro before appending to it. */)
message ("Appending to kbd macro...");
}
KSET (current_kboard, defining_kbd_macro, Qt);
kset_defining_kbd_macro (current_kboard, Qt);
return Qnil;
}
@ -137,12 +137,13 @@ macro before appending to it. */)
void
end_kbd_macro (void)
{
KSET (current_kboard, defining_kbd_macro, Qnil);
kset_defining_kbd_macro (current_kboard, Qnil);
update_mode_lines++;
KSET (current_kboard, Vlast_kbd_macro,
make_event_array ((current_kboard->kbd_macro_end
- current_kboard->kbd_macro_buffer),
current_kboard->kbd_macro_buffer));
kset_last_kbd_macro
(current_kboard,
make_event_array ((current_kboard->kbd_macro_end
- current_kboard->kbd_macro_buffer),
current_kboard->kbd_macro_buffer));
}
DEFUN ("end-kbd-macro", Fend_kbd_macro, Send_kbd_macro, 0, 2, "p",
@ -330,7 +331,7 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
executing_kbd_macro = final;
executing_kbd_macro_index = 0;
KSET (current_kboard, Vprefix_arg, Qnil);
kset_prefix_arg (current_kboard, Qnil);
if (!NILP (loopfunc))
{

View file

@ -395,6 +395,8 @@ BLOCKINPUT_H = $(SRC)/blockinput.h \
$(ATIMER_H)
BUFFER_H = $(SRC)/buffer.h \
$(SYSTIME_H)
C_CTYPE_H = $(GNU_LIB)/c-ctype.h \
$(NT_INC)/stdbool.h
CAREADLINKAT_H = $(GNU_LIB)/careadlinkat.h \
$(NT_INC)/unistd.h
CHARACTER_H = $(SRC)/character.h \
@ -441,7 +443,8 @@ LISP_H = $(SRC)/lisp.h \
$(SRC)/globals.h \
$(GNU_LIB)/intprops.h \
$(INTTYPES_H) \
$(NT_INC)/stdalign.h
$(NT_INC)/stdalign.h \
$(NT_INC)/stdbool.h
MD5_H = $(GNU_LIB)/md5.h \
$(NT_INC)/stdint.h
MENU_H = $(SRC)/menu.h \
@ -626,6 +629,7 @@ $(BLD)/charset.$(O) : \
$(CHARSET_H) \
$(CODING_H) \
$(CONFIG_H) \
$(C_CTYPE_H) \
$(LISP_H)
$(BLD)/chartab.$(O) : \
@ -747,6 +751,7 @@ $(BLD)/doc.$(O) : \
$(BUFFER_H) \
$(CHARACTER_H) \
$(CONFIG_H) \
$(C_CTYPE_H) \
$(KEYBOARD_H) \
$(LISP_H)
@ -820,6 +825,7 @@ $(BLD)/fileio.$(O) : \
$(CHARACTER_H) \
$(CODING_H) \
$(CONFIG_H) \
$(C_CTYPE_H) \
$(DISPEXTERN_H) \
$(FRAME_H) \
$(INTERVALS_H) \
@ -881,6 +887,7 @@ $(BLD)/font.$(O) : \
$(CHARACTER_H) \
$(CHARSET_H) \
$(CONFIG_H) \
$(C_CTYPE_H) \
$(DISPEXTERN_H) \
$(FONT_H) \
$(FRAME_H) \
@ -916,6 +923,7 @@ $(BLD)/frame.$(O) : \
$(BUFFER_H) \
$(CHARACTER_H) \
$(CONFIG_H) \
$(C_CTYPE_H) \
$(DISPEXTERN_H) \
$(FONT_H) \
$(FRAME_H) \
@ -967,6 +975,7 @@ $(BLD)/image.$(O) : \
$(CHARACTER_H) \
$(CODING_H) \
$(CONFIG_H) \
$(C_CTYPE_H) \
$(DISPEXTERN_H) \
$(FONT_H) \
$(FRAME_H) \
@ -1354,6 +1363,7 @@ $(BLD)/sysdep.$(O) : \
$(BLOCKINPUT_H) \
$(CAREADLINKAT_H) \
$(CONFIG_H) \
$(C_CTYPE_H) \
$(DISPEXTERN_H) \
$(FRAME_H) \
$(GRP_H) \
@ -1438,6 +1448,7 @@ $(BLD)/unexw32.$(O) : \
$(BLD)/vm-limit.$(O) : \
$(SRC)/vm-limit.c \
$(SRC)/mem-limits.h \
$(NT_INC)/unistd.h \
$(CONFIG_H) \
$(LISP_H)
@ -1499,6 +1510,7 @@ $(BLD)/xfaces.$(O) : \
$(CHARACTER_H) \
$(CHARSET_H) \
$(CONFIG_H) \
$(C_CTYPE_H) \
$(DISPEXTERN_H) \
$(FONT_H) \
$(FRAME_H) \

View file

@ -565,11 +565,11 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
/* Defeat (setq-default truncate-lines t), since truncated lines do
not work correctly in minibuffers. (Bug#5715, etc) */
BSET (current_buffer, truncate_lines, Qnil);
bset_truncate_lines (current_buffer, Qnil);
/* If appropriate, copy enable-multibyte-characters into the minibuffer. */
if (inherit_input_method)
BSET (current_buffer, enable_multibyte_characters, enable_multibyte);
bset_enable_multibyte_characters (current_buffer, enable_multibyte);
/* The current buffer's default directory is usually the right thing
for our minibuffer here. However, if you're typing a command at
@ -580,7 +580,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
you think of something better to do? Find another buffer with a
better directory, and use that one instead. */
if (STRINGP (ambient_dir))
BSET (current_buffer, directory, ambient_dir);
bset_directory (current_buffer, ambient_dir);
else
{
Lisp_Object buf_list;
@ -594,8 +594,8 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
other_buf = XCDR (XCAR (buf_list));
if (STRINGP (BVAR (XBUFFER (other_buf), directory)))
{
BSET (current_buffer, directory,
BVAR (XBUFFER (other_buf), directory));
bset_directory (current_buffer,
BVAR (XBUFFER (other_buf), directory));
break;
}
}
@ -672,7 +672,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
}
clear_message (1, 1);
BSET (current_buffer, keymap, map);
bset_keymap (current_buffer, map);
/* Turn on an input method stored in INPUT_METHOD if any. */
if (STRINGP (input_method) && !NILP (Ffboundp (Qactivate_input_method)))
@ -681,7 +681,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
Frun_hooks (1, &Qminibuffer_setup_hook);
/* Don't allow the user to undo past this point. */
BSET (current_buffer, undo_list, Qnil);
bset_undo_list (current_buffer, Qnil);
recursive_edit_1 ();

View file

@ -520,8 +520,8 @@ dos_set_window_size (int *rows, int *cols)
/* If the user specified a special video mode for these dimensions,
use that mode. */
video_mode
= Fsymbol_value (Fintern_soft (make_formatted_string
video_mode
= Fsymbol_value (Fintern_soft (make_formatted_string
(video_name, "screen-dimensions-%dx%d",
*rows, *cols), Qnil));
@ -1801,7 +1801,7 @@ internal_terminal_init (void)
}
tty = FRAME_TTY (sf);
KSET (current_kboard, Vwindow_system, Qpc);
kset_window_system (current_kboard, Qpc);
sf->output_method = output_msdos_raw;
if (init_needed)
{

View file

@ -447,7 +447,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil))
return;
FSET (f, icon_name, arg);
fset_icon_name (f, arg);
if (NILP (arg))
{
@ -539,7 +539,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
if (! NILP (Fstring_equal (name, f->name)))
return;
FSET (f, name, name);
fset_name (f, name);
/* title overrides explicit name */
if (! NILP (f->title))
@ -590,7 +590,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
update_mode_lines = 1;
FSET (f, title, name);
fset_title (f, name);
if (NILP (name))
name = f->name;
@ -676,7 +676,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
[[view window] setRepresentedFilename: fstr];
[[view window] setTitle: str];
FSET (f, name, name);
fset_name (f, name);
}
[pool release];
@ -1204,11 +1204,11 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
FRAME_FONTSET (f) = -1;
FSET (f, icon_name, x_get_arg (dpyinfo, parms, Qicon_name,
"iconName", "Title",
RES_TYPE_STRING));
fset_icon_name (f, x_get_arg (dpyinfo, parms, Qicon_name,
"iconName", "Title",
RES_TYPE_STRING));
if (! STRINGP (f->icon_name))
FSET (f, icon_name, Qnil);
fset_icon_name (f, Qnil);
FRAME_NS_DISPLAY_INFO (f) = dpyinfo;
@ -1231,12 +1231,12 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
be set. */
if (EQ (name, Qunbound) || NILP (name) || ! STRINGP (name))
{
FSET (f, name, build_string ([ns_app_name UTF8String]));
fset_name (f, build_string ([ns_app_name UTF8String]));
f->explicit_name = 0;
}
else
{
FSET (f, name, name);
fset_name (f, name);
f->explicit_name = 1;
specbind (Qx_resource_name, name);
}
@ -1391,13 +1391,13 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
if (FRAME_HAS_MINIBUF_P (f)
&& (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
|| !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
KSET (kb, Vdefault_minibuffer_frame, frame);
kset_default_minibuffer_frame (kb, frame);
/* All remaining specified parameters, which have not been "used"
by x_get_arg and friends, now go in the misc. alist of the frame. */
for (tem = parms; CONSP (tem); tem = XCDR (tem))
if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
FSET (f, param_alist, Fcons (XCAR (tem), f->param_alist));
fset_param_alist (f, Fcons (XCAR (tem), f->param_alist));
UNGCPRO;

View file

@ -236,27 +236,63 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
}
/* Utility: get width of a char c in screen font sfont */
/* Utility: get width of a char c in screen font SFONT */
static float
ns_char_width (NSFont *sfont, int c)
{
float w;
NSString *cstr = [NSString stringWithFormat: @"%c", c];
float w = -1.0;
NSString *cstr = [NSString stringWithFormat: @"%c", c];
#ifdef NS_IMPL_COCOA
NSGlyph glyph = [sfont glyphWithName: cstr];
if (glyph)
{
float w = [sfont advancementForGlyph: glyph].width;
if (w >= 1.5)
return w;
}
NSGlyph glyph = [sfont glyphWithName: cstr];
if (glyph)
w = [sfont advancementForGlyph: glyph].width;
#endif
if (w < 0.0)
{
NSDictionary *attrsDictionary =
[NSDictionary dictionaryWithObject: sfont forKey: NSFontAttributeName];
w = [cstr sizeWithAttributes: attrsDictionary].width;
}
return max (w, 2.0);
return max (w, 1.0);
}
/* Return average width over ASCII printable characters for SFONT. */
static NSString *ascii_printable;
static int
ns_ascii_average_width (NSFont *sfont)
{
float w = -1.0;
if (!ascii_printable)
{
char chars[96];
int ch;
for (ch = 0; ch < 95; ch++)
chars[ch] = ' ' + ch;
chars[95] = '\0';
ascii_printable = [[NSString alloc] initWithFormat: @"%s", chars];
}
#ifdef NS_IMPL_COCOA
NSGlyph glyph = [sfont glyphWithName: ascii_printable];
if (glyph)
w = [sfont advancementForGlyph: glyph].width;
#endif
if (w < 0.0)
{
NSDictionary *attrsDictionary =
[NSDictionary dictionaryWithObject: sfont forKey: NSFontAttributeName];
w = [ascii_printable sizeWithAttributes: attrsDictionary].width;
}
return lrint (w / 95.0);
}
@ -885,10 +921,11 @@ when setting family in ns_spec_to_descriptor(). */
/* set up metrics portion of font struct */
font->ascent = lrint([sfont ascender]);
font->descent = -lrint(floor(adjusted_descender));
font->min_width = ns_char_width(sfont, '|');
font->space_width = lrint (ns_char_width (sfont, ' '));
font->average_width = lrint (font_info->width);
font->max_width = lrint (font_info->max_bounds.width);
font->min_width = font->space_width; /* Approximate. */
font->average_width = ns_ascii_average_width (sfont);
font->height = lrint (font_info->height);
font->underline_position = lrint (font_info->underpos);
font->underline_thickness = lrint (font_info->underwidth);
@ -1492,4 +1529,6 @@ - (void)setIntAttribute: (NSInteger)attributeTag value: (NSInteger)val
DEFSYM (Qmedium, "medium");
DEFVAR_LISP ("ns-reg-to-script", Vns_reg_to_script,
doc: /* Internal use: maps font registry to Unicode script. */);
ascii_printable = NULL;
}

View file

@ -302,7 +302,7 @@ - (void)dealloc
[bmRep release];
return nil;
}
#define hexchar(x) (isdigit (x) ? x - '0' : x - 'a' + 10)
#define hexchar(x) ('0' <= (x) && (x) <= '9' ? (x) - '0' : (x) - 'a' + 10)
s1 = *s++;
s2 = *s++;
c = hexchar (s1) * 0x10 + hexchar (s2);
@ -501,4 +501,3 @@ - (NSColor *)stippleMask
}
@end

View file

@ -73,7 +73,6 @@
/* Nonzero means a menu is currently active. */
static int popup_activated_flag;
static NSModalSession popupSession;
/* Nonzero means we are tracking and updating menus. */
static int trackingMenu;
@ -215,7 +214,7 @@
if (! NILP (Vlucid_menu_bar_dirty_flag))
call0 (Qrecompute_lucid_menubar);
safe_run_hooks (Qmenu_bar_update_hook);
FSET (f, menu_bar_items, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
/* Now ready to go */
items = FRAME_MENU_BAR_ITEMS (f);
@ -341,7 +340,7 @@
}
/* The menu items are different, so store them in the frame */
/* FIXME: this is not correct for single-submenu case */
FSET (f, menu_bar_vector, menu_items);
fset_menu_bar_vector (f, menu_items);
f->menu_bar_items_used = menu_items_used;
/* Calls restore_menu_items, etc., as they were outside */
@ -1365,8 +1364,6 @@ - (NSRect) frame
{
EmacsDialogPanel *panel = unwind_data->dialog;
popup_activated_flag = 0;
[NSApp endModalSession: popupSession];
[panel close];
[unwind_data->pool release];
[[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow];
@ -1756,20 +1753,40 @@ void process_dialog (id window, Lisp_Object list)
}
- (void)timeout_handler: (NSTimer *)timedEntry
{
timer_fired = 1;
[NSApp abortModal];
}
- (Lisp_Object)runDialogAt: (NSPoint)p
{
NSInteger ret;
NSInteger ret = 0;
/* initiate a session that will be ended by pop_down_menu */
popupSession = [NSApp beginModalSessionForWindow: self];
while (popup_activated_flag
&& (ret = [NSApp runModalSession: popupSession])
== NSRunContinuesResponse)
while (popup_activated_flag)
{
/* Run this for timers.el, indep of atimers; might not return.
TODO: use return value to avoid calling every iteration. */
timer_check ();
[NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]];
NSTimer *tmo = nil;
EMACS_TIME next_time = timer_check ();
if (EMACS_TIME_VALID_P (next_time))
{
double time = EMACS_TIME_TO_DOUBLE (next_time);
tmo = [NSTimer timerWithTimeInterval: time
target: self
selector: @selector (timeout_handler:)
userInfo: 0
repeats: NO];
[[NSRunLoop currentRunLoop] addTimer: tmo
forMode: NSModalPanelRunLoopMode];
}
timer_fired = 0;
ret = [NSApp runModalForWindow: self];
if (! timer_fired)
{
if (tmo != nil) [tmo invalidate]; /* Cancels timer */
break;
}
}
{ /* FIXME: BIG UGLY HACK!!! */

View file

@ -56,7 +56,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
- (void)sendEvent: (NSEvent *)theEvent;
- (void)showPreferencesWindow: (id)sender;
- (BOOL) openFile: (NSString *)fileName;
- (void)fd_handler: (NSTimer *) fdEntry;
- (void)fd_handler: (id)unused;
- (void)timeout_handler: (NSTimer *)timedEntry;
- (BOOL)fulfillService: (NSString *)name withArg: (NSString *)arg;
@end
@ -195,12 +195,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
NSTextField *title;
NSMatrix *matrix;
int rows, cols;
int timer_fired;
}
- initFromContents: (Lisp_Object)menu isQuestion: (BOOL)isQ;
- addButton: (char *)str value: (Lisp_Object)val row: (int)row;
- addString: (char *)str row: (int)row;
- addSplit;
- (Lisp_Object)runDialogAt: (NSPoint)p;
- (void)timeout_handler: (NSTimer *)timedEntry;
@end
#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
@ -448,7 +450,10 @@ struct nsfont_info
struct font font;
char *name; /* PostScript name, uniquely identifies on NS systems */
float width; /* this and following metrics stored as float rather than int */
/* The following metrics are stored as float rather than int. */
float width; /* Maximum advance for the font. */
float height;
float underpos;
float underwidth;

View file

@ -36,9 +36,15 @@ Updated by Christian Limpach (chris@nice.ch)
#include <signal.h>
#include <unistd.h>
#include <setjmp.h>
#include <c-ctype.h>
#include <c-strcase.h>
#include <ftoastr.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include "lisp.h"
#include "blockinput.h"
#include "sysselect.h"
@ -184,17 +190,20 @@ Updated by Christian Limpach (chris@nice.ch)
static BOOL send_appdefined = YES;
static NSEvent *last_appdefined_event = 0;
static NSTimer *timed_entry = 0;
static NSTimer *fd_entry = nil;
static NSTimer *scroll_repeat_entry = nil;
static fd_set select_readfds, t_readfds;
static int select_nfds;
static fd_set select_readfds, select_writefds;
enum { SELECT_HAVE_READ = 1, SELECT_HAVE_WRITE = 2, SELECT_HAVE_TMO = 4 };
static int select_nfds = 0, select_valid = 0;
static EMACS_TIME select_timeout = { 0, 0 };
static int selfds[2] = { -1, -1 };
static pthread_mutex_t select_mutex;
static int apploopnr = 0;
static NSAutoreleasePool *outerpool;
static struct input_event *emacs_event = NULL;
static struct input_event *q_event_ptr = NULL;
static int n_emacs_events_pending = 0;
static NSMutableArray *ns_pending_files, *ns_pending_service_names,
*ns_pending_service_args;
static BOOL inNsSelect = 0;
static BOOL ns_do_open_file = NO;
/* Convert modifiers in a NeXTstep event to emacs style modifiers. */
@ -252,15 +261,20 @@ Updated by Christian Limpach (chris@nice.ch)
/* This is a piece of code which is common to all the event handling
methods. Maybe it should even be a function. */
#define EV_TRAILER(e) \
{ \
XSETFRAME (emacs_event->frame_or_window, emacsframe); \
if (e) emacs_event->timestamp = EV_TIMESTAMP (e); \
n_emacs_events_pending++; \
kbd_buffer_store_event_hold (emacs_event, q_event_ptr); \
EVENT_INIT (*emacs_event); \
ns_send_appdefined (-1); \
}
#define EV_TRAILER(e) \
{ \
XSETFRAME (emacs_event->frame_or_window, emacsframe); \
if (e) emacs_event->timestamp = EV_TIMESTAMP (e); \
if (q_event_ptr) \
{ \
n_emacs_events_pending++; \
kbd_buffer_store_event_hold (emacs_event, q_event_ptr); \
} \
else \
kbd_buffer_store_event (emacs_event); \
EVENT_INIT (*emacs_event); \
ns_send_appdefined (-1); \
}
void x_set_cursor_type (struct frame *, Lisp_Object, Lisp_Object);
@ -1018,7 +1032,7 @@ Free a pool and temporary objects it refers to (callable from C)
: dpyinfo->x_focus_frame);
if (!FRAME_LIVE_P (dpyinfo->x_highlight_frame))
{
FSET (dpyinfo->x_focus_frame, focus_frame, Qnil);
fset_focus_frame (dpyinfo->x_focus_frame, Qnil);
dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame;
}
}
@ -3377,14 +3391,6 @@ overwriting cursor (usually when cursor on a tab) */
timed_entry = nil;
}
/* Ditto for file descriptor poller */
if (fd_entry)
{
[fd_entry invalidate];
[fd_entry release];
fd_entry = nil;
}
nxev = [NSEvent otherEventWithType: NSApplicationDefined
location: NSMakePoint (0, 0)
modifierFlags: 0
@ -3402,7 +3408,6 @@ overwriting cursor (usually when cursor on a tab) */
}
}
static int
ns_read_socket (struct terminal *terminal, int expected,
struct input_event *hold_quit)
@ -3466,24 +3471,14 @@ overwriting cursor (usually when cursor on a tab) */
/* Run and wait for events. We must always send one NX_APPDEFINED event
to ourself, otherwise [NXApp run] will never exit. */
send_appdefined = YES;
ns_send_appdefined (-1);
/* If called via ns_select, this is called once with expected=1,
because we expect either the timeout or file descriptor activity.
In this case the first event through will either be real input or
one of these. read_avail_input() then calls once more with expected=0
and in that case we need to return quickly if there is nothing.
If we're being called outside of that, it's also OK to return quickly
after one iteration through the event loop, since other terms do
this and emacs expects it. */
if (!(inNsSelect && expected))
if (++apploopnr != 1)
{
/* Post an application defined event on the event queue. When this is
received the [NXApp run] will return, thus having processed all
events which are currently queued, if any. */
ns_send_appdefined (-1);
abort ();
}
[NSApp run];
--apploopnr;
}
nevents = n_emacs_events_pending;
@ -3503,65 +3498,89 @@ overwriting cursor (usually when cursor on a tab) */
-------------------------------------------------------------------------- */
{
int result;
double time;
NSEvent *ev;
struct timespec select_timeout;
int k, nr = 0;
struct input_event event;
char c;
/* NSTRACE (ns_select); */
if (NSApp == nil || inNsSelect == 1 /* || ([NSApp isActive] == NO &&
[NSApp nextEventMatchingMask:NSAnyEventMask untilDate:nil
inMode:NSDefaultRunLoopMode dequeue:NO] == nil) */)
for (k = 0; readfds && k < nfds+1; k++)
if (FD_ISSET(k, readfds)) ++nr;
if (NSApp == nil
|| (timeout && timeout->tv_sec == 0 && timeout->tv_nsec == 0))
return pselect (nfds, readfds, writefds, exceptfds, timeout, sigmask);
/* Save file descriptor set, which gets overwritten in calls to select ()
Note, this is called from process.c, and only readfds is ever set */
if (readfds)
[outerpool release];
outerpool = [[NSAutoreleasePool alloc] init];
send_appdefined = YES;
if (nr > 0)
{
memcpy (&select_readfds, readfds, sizeof (fd_set));
pthread_mutex_lock (&select_mutex);
select_nfds = nfds;
select_valid = 0;
if (readfds)
{
select_readfds = *readfds;
select_valid += SELECT_HAVE_READ;
}
if (writefds)
{
select_writefds = *writefds;
select_valid += SELECT_HAVE_WRITE;
}
if (timeout)
{
select_timeout = *timeout;
select_valid += SELECT_HAVE_TMO;
}
pthread_mutex_unlock (&select_mutex);
/* Inform fd_handler that select should be called */
c = 'g';
write (selfds[1], &c, 1);
}
else if (nr == 0 && timeout)
{
/* No file descriptor, just a timeout, no need to wake fd_handler */
double time = EMACS_TIME_TO_DOUBLE (*timeout);
timed_entry = [[NSTimer scheduledTimerWithTimeInterval: time
target: NSApp
selector:
@selector (timeout_handler:)
userInfo: 0
repeats: NO]
retain];
}
else /* No timeout and no file descriptors, can this happen? */
{
/* Send appdefined so we exit from the loop */
ns_send_appdefined (-1);
}
else
select_nfds = 0;
/* Try an initial select for pending data on input files */
select_timeout.tv_sec = select_timeout.tv_nsec = 0;
result = pselect (nfds, readfds, writefds, exceptfds,
&select_timeout, sigmask);
if (result)
return result;
EVENT_INIT (event);
BLOCK_INPUT;
emacs_event = &event;
if (++apploopnr != 1)
{
abort();
}
[NSApp run];
--apploopnr;
emacs_event = NULL;
if (nr > 0 && readfds)
{
c = 's';
write (selfds[1], &c, 1);
}
UNBLOCK_INPUT;
/* if (!timeout || timed_entry || fd_entry)
fprintf (stderr, "assertion failed: timeout null or timed_entry/fd_entry non-null in ns_select\n"); */
/* set a timeout and run the main AppKit event loop while continuing
to monitor the files */
time = EMACS_TIME_TO_DOUBLE (*timeout);
timed_entry = [[NSTimer scheduledTimerWithTimeInterval: time
target: NSApp
selector: @selector (timeout_handler:)
userInfo: 0
repeats: YES] /* for safe removal */
retain];
/* set a periodic task to try the pselect () again */
fd_entry = [[NSTimer scheduledTimerWithTimeInterval: 0.1
target: NSApp
selector: @selector (fd_handler:)
userInfo: 0
repeats: YES]
retain];
/* Let Application dispatch events until it receives an event of the type
NX_APPDEFINED, which should only be sent by timeout_handler.
We tell read_avail_input() that input is "expected" because we do expect
either the timeout or fd handler to fire, and if they don't, the original
call from process.c that got us here expects us to wait until some input
comes. */
inNsSelect = 1;
gobble_input (1);
ev = last_appdefined_event;
inNsSelect = 0;
if (ev)
{
@ -3575,25 +3594,28 @@ We tell read_avail_input() that input is "expected" because we do expect
if (t == -2)
{
/* The NX_APPDEFINED event we received was a timeout. */
return 0;
result = 0;
}
else if (t == -1)
{
/* The NX_APPDEFINED event we received was the result of
at least one real input event arriving. */
errno = EINTR;
return -1;
result = -1;
}
else
{
/* Received back from pselect () in fd_handler; copy the results */
if (readfds)
memcpy (readfds, &select_readfds, sizeof (fd_set));
return t;
/* Received back from select () in fd_handler; copy the results */
pthread_mutex_lock (&select_mutex);
if (readfds) *readfds = select_readfds;
if (writefds) *writefds = select_writefds;
if (timeout) *timeout = select_timeout;
pthread_mutex_unlock (&select_mutex);
result = t;
}
}
/* never reached, shut compiler up */
return 0;
return result;
}
@ -3676,7 +3698,7 @@ We tell read_avail_input() that input is "expected" because we do expect
{
bar = XNS_SCROLL_BAR (window->vertical_scroll_bar);
[bar removeFromSuperview];
WSET (window, vertical_scroll_bar, Qnil);
wset_vertical_scroll_bar (window, Qnil);
}
ns_clear_frame_area (f, sb_left, top, width, height);
UNBLOCK_INPUT;
@ -3687,7 +3709,7 @@ We tell read_avail_input() that input is "expected" because we do expect
{
ns_clear_frame_area (f, sb_left, top, width, height);
bar = [[EmacsScroller alloc] initFrame: r window: win];
WSET (window, vertical_scroll_bar, make_save_value (bar, 0));
wset_vertical_scroll_bar (window, make_save_value (bar, 0));
}
else
{
@ -4024,6 +4046,21 @@ static Lisp_Object ns_string_to_lispmod (const char *s)
{
baud_rate = 38400;
Fset_input_interrupt_mode (Qnil);
if (selfds[0] == -1)
{
if (pipe (selfds) == -1)
{
fprintf (stderr, "Failed to create pipe: %s\n",
emacs_strerror (errno));
abort ();
}
fcntl (selfds[0], F_SETFL, O_NONBLOCK|fcntl (selfds[0], F_GETFL));
FD_ZERO (&select_readfds);
FD_ZERO (&select_writefds);
pthread_mutex_init (&select_mutex, NULL);
}
ns_initialized = 1;
}
@ -4039,6 +4076,11 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
return NULL;
[NSApp setDelegate: NSApp];
/* Start the select thread. */
[NSThread detachNewThreadSelector:@selector (fd_handler:)
toTarget:NSApp
withObject:nil];
/* debugging: log all notifications */
/* [[NSNotificationCenter defaultCenter] addObserver: NSApp
selector: @selector (logNotification:)
@ -4051,7 +4093,7 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
terminal->kboard = xmalloc (sizeof *terminal->kboard);
init_kboard (terminal->kboard);
KSET (terminal->kboard, Vwindow_system, Qns);
kset_window_system (terminal->kboard, Qns);
terminal->kboard->next_kboard = all_kboards;
all_kboards = terminal->kboard;
/* Don't let the initial kboard remain current longer than necessary.
@ -4547,26 +4589,91 @@ - (void)timeout_handler: (NSTimer *)timedEntry
ns_send_appdefined (-2);
}
- (void)fd_handler: (NSTimer *) fdEntry
- (void)fd_handler:(id)unused
/* --------------------------------------------------------------------------
Check data waiting on file descriptors and terminate if so
-------------------------------------------------------------------------- */
{
int result;
struct timespec select_timeout;
int waiting = 1, nfds;
char c;
SELECT_TYPE readfds, writefds, *wfds;
EMACS_TIME timeout, *tmo;
/* NSTRACE (fd_handler); */
if (select_nfds == 0)
return;
memcpy (&t_readfds, &select_readfds, sizeof (fd_set));
select_timeout.tv_sec = select_timeout.tv_nsec = 0;
result = pselect (select_nfds, &t_readfds, NULL, NULL, &select_timeout, NULL);
if (result)
for (;;)
{
memcpy (&select_readfds, &t_readfds, sizeof (fd_set));
ns_send_appdefined (result);
if (waiting)
{
SELECT_TYPE fds;
FD_SET (selfds[0], &fds);
result = select (selfds[0]+1, &fds, NULL, NULL, NULL);
if (result > 0)
{
read (selfds[0], &c, 1);
if (c == 'g') waiting = 0;
}
}
else
{
pthread_mutex_lock (&select_mutex);
nfds = select_nfds;
if (select_valid & SELECT_HAVE_READ)
readfds = select_readfds;
else
FD_ZERO (&readfds);
if (select_valid & SELECT_HAVE_WRITE)
{
writefds = select_writefds;
wfds = &writefds;
}
else
wfds = NULL;
if (select_valid & SELECT_HAVE_TMO)
{
timeout = select_timeout;
tmo = &timeout;
}
else
tmo = NULL;
pthread_mutex_unlock (&select_mutex);
FD_SET (selfds[0], &readfds);
if (selfds[0] >= nfds) nfds = selfds[0]+1;
result = pselect (nfds, &readfds, wfds, NULL, tmo, NULL);
if (result == 0)
ns_send_appdefined (-2);
else if (result > 0)
{
if (FD_ISSET (selfds[0], &readfds))
{
read (selfds[0], &c, 1);
if (c == 's') waiting = 1;
}
else
{
pthread_mutex_lock (&select_mutex);
if (select_valid & SELECT_HAVE_READ)
select_readfds = readfds;
if (select_valid & SELECT_HAVE_WRITE)
select_writefds = writefds;
if (select_valid & SELECT_HAVE_TMO)
select_timeout = timeout;
pthread_mutex_unlock (&select_mutex);
ns_send_appdefined (result);
}
}
waiting = 1;
}
}
}
@ -6281,7 +6388,7 @@ - (void)dealloc
{
NSTRACE (EmacsScroller_dealloc);
if (!NILP (win))
WSET (XWINDOW (win), vertical_scroll_bar, Qnil);
wset_vertical_scroll_bar (XWINDOW (win), Qnil);
[super dealloc];
}
@ -6404,8 +6511,13 @@ - (void) sendScrollEventAtLoc: (float)loc fromEvent: (NSEvent *)e
XSETINT (emacs_event->x, loc * pixel_height);
XSETINT (emacs_event->y, pixel_height-20);
n_emacs_events_pending++;
kbd_buffer_store_event_hold (emacs_event, q_event_ptr);
if (q_event_ptr)
{
n_emacs_events_pending++;
kbd_buffer_store_event_hold (emacs_event, q_event_ptr);
}
else
kbd_buffer_store_event (emacs_event);
EVENT_INIT (*emacs_event);
ns_send_appdefined (-1);
}
@ -6675,20 +6787,20 @@ Convert an X font name (XLFD) to an NS font name.
/* undo hack in ns_fontname_to_xlfd, converting '$' to '-', '_' to ' '
also uppercase after '-' or ' ' */
name[0] = toupper (name[0]);
name[0] = c_toupper (name[0]);
for (len =strlen (name), i =0; i<len; i++)
{
if (name[i] == '$')
{
name[i] = '-';
if (i+1<len)
name[i+1] = toupper (name[i+1]);
name[i+1] = c_toupper (name[i+1]);
}
else if (name[i] == '_')
{
name[i] = ' ';
if (i+1<len)
name[i+1] = toupper (name[i+1]);
name[i+1] = c_toupper (name[i+1]);
}
}
/*fprintf (stderr, "converted '%s' to '%s'\n",xlfd,name); */

View file

@ -494,14 +494,14 @@ temp_output_buffer_setup (const char *bufname)
Fkill_all_local_variables ();
delete_all_overlays (current_buffer);
BSET (current_buffer, directory, BVAR (old, directory));
BSET (current_buffer, read_only, Qnil);
BSET (current_buffer, filename, Qnil);
BSET (current_buffer, undo_list, Qt);
bset_directory (current_buffer, BVAR (old, directory));
bset_read_only (current_buffer, Qnil);
bset_filename (current_buffer, Qnil);
bset_undo_list (current_buffer, Qt);
eassert (current_buffer->overlays_before == NULL);
eassert (current_buffer->overlays_after == NULL);
BSET (current_buffer, enable_multibyte_characters,
BVAR (&buffer_defaults, enable_multibyte_characters));
bset_enable_multibyte_characters
(current_buffer, BVAR (&buffer_defaults, enable_multibyte_characters));
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
@ -1194,7 +1194,7 @@ print_preprocess (Lisp_Object obj)
{
case Lisp_String:
/* A string may have text properties, which can be circular. */
traverse_intervals_noorder (string_get_intervals (obj),
traverse_intervals_noorder (string_intervals (obj),
print_preprocess_string, Qnil);
break;
@ -1297,7 +1297,7 @@ static Lisp_Object
print_prune_string_charset (Lisp_Object string)
{
print_check_string_result = 0;
traverse_intervals (string_get_intervals (string), 0,
traverse_intervals (string_intervals (string), 0,
print_check_string_charset_prop, string);
if (! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND))
{
@ -1408,7 +1408,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
if (! EQ (Vprint_charset_text_property, Qt))
obj = print_prune_string_charset (obj);
if (string_get_intervals (obj))
if (string_intervals (obj))
{
PRINTCHAR ('#');
PRINTCHAR ('(');
@ -1499,9 +1499,9 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
}
PRINTCHAR ('\"');
if (string_get_intervals (obj))
if (string_intervals (obj))
{
traverse_intervals (string_get_intervals (obj),
traverse_intervals (string_intervals (obj),
0, print_interval, printcharfun);
PRINTCHAR (')');
}

View file

@ -20,6 +20,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#define PROCESS_INLINE EXTERN_INLINE
#include <signal.h>
#include <stdio.h>
#include <errno.h>
@ -312,6 +315,93 @@ static struct sockaddr_and_len {
/* Maximum number of bytes to send to a pty without an eof. */
static int pty_max_bytes;
/* These setters are used only in this file, so they can be private. */
static inline void
pset_buffer (struct Lisp_Process *p, Lisp_Object val)
{
p->buffer = val;
}
static inline void
pset_command (struct Lisp_Process *p, Lisp_Object val)
{
p->command = val;
}
static inline void
pset_decode_coding_system (struct Lisp_Process *p, Lisp_Object val)
{
p->decode_coding_system = val;
}
static inline void
pset_decoding_buf (struct Lisp_Process *p, Lisp_Object val)
{
p->decoding_buf = val;
}
static inline void
pset_encode_coding_system (struct Lisp_Process *p, Lisp_Object val)
{
p->encode_coding_system = val;
}
static inline void
pset_encoding_buf (struct Lisp_Process *p, Lisp_Object val)
{
p->encoding_buf = val;
}
static inline void
pset_filter (struct Lisp_Process *p, Lisp_Object val)
{
p->filter = val;
}
static inline void
pset_log (struct Lisp_Process *p, Lisp_Object val)
{
p->log = val;
}
static inline void
pset_mark (struct Lisp_Process *p, Lisp_Object val)
{
p->mark = val;
}
static inline void
pset_thread (struct Lisp_Process *p, Lisp_Object val)
{
p->thread = val;
}
static inline void
pset_name (struct Lisp_Process *p, Lisp_Object val)
{
p->name = val;
}
static inline void
pset_plist (struct Lisp_Process *p, Lisp_Object val)
{
p->plist = val;
}
static inline void
pset_sentinel (struct Lisp_Process *p, Lisp_Object val)
{
p->sentinel = val;
}
static inline void
pset_status (struct Lisp_Process *p, Lisp_Object val)
{
p->status = val;
}
static inline void
pset_tty_name (struct Lisp_Process *p, Lisp_Object val)
{
p->tty_name = val;
}
static inline void
pset_type (struct Lisp_Process *p, Lisp_Object val)
{
p->type = val;
}
static inline void
pset_write_queue (struct Lisp_Process *p, Lisp_Object val)
{
p->write_queue = val;
}
enum fd_bits
@ -562,7 +652,7 @@ static void
update_status (struct Lisp_Process *p)
{
eassert (p->raw_status_new);
PSET (p, status, status_convert (p->raw_status));
pset_status (p, status_convert (p->raw_status));
p->raw_status_new = 0;
}
@ -760,9 +850,9 @@ make_process (Lisp_Object name)
p = allocate_process ();
/* Initialize Lisp data. Note that allocate_process initializes all
Lisp data to nil, so do it only for slots which should not be nil. */
PSET (p, status, Qrun);
PSET (p, mark, Fmake_marker ());
PSET (p, thread, Fcurrent_thread ());
pset_status (p, Qrun);
pset_mark (p, Fmake_marker ());
pset_thread (p, Fcurrent_thread ());
/* Initialize non-Lisp data. Note that allocate_process zeroes out all
non-Lisp data, so do it only for slots which should not be zero. */
@ -783,7 +873,7 @@ make_process (Lisp_Object name)
name1 = concat2 (name, make_formatted_string (suffix, "<%"pMd">", i));
}
name = name1;
PSET (p, name, name);
pset_name (p, name);
XSETPROCESS (val, p);
Vprocess_alist = Fcons (Fcons (name, val), Vprocess_alist);
return val;
@ -901,7 +991,7 @@ nil, indicating the current buffer's process. */)
p->raw_status_new = 0;
if (NETCONN1_P (p) || SERIALCONN1_P (p))
{
PSET (p, status, Fcons (Qexit, Fcons (make_number (0), Qnil)));
pset_status (p, Fcons (Qexit, Fcons (make_number (0), Qnil)));
p->tick = ++process_tick;
status_notify (p);
redisplay_preserve_echo_area (13);
@ -930,7 +1020,7 @@ nil, indicating the current buffer's process. */)
{
Fkill_process (process, Qnil);
/* Do this now, since remove_process will make sigchld_handler do nothing. */
PSET (p, status, Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil)));
pset_status (p, Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil)));
p->tick = ++process_tick;
status_notify (p);
redisplay_preserve_echo_area (13);
@ -1057,9 +1147,9 @@ Return BUFFER. */)
if (!NILP (buffer))
CHECK_BUFFER (buffer);
p = XPROCESS (process);
PSET (p, buffer, buffer);
pset_buffer (p, buffer);
if (NETCONN1_P (p) || SERIALCONN1_P (p))
PSET (p, childp, Fplist_put (p->childp, QCbuffer, buffer));
pset_childp (p, Fplist_put (p->childp, QCbuffer, buffer));
setup_process_coding_systems (process);
return buffer;
}
@ -1124,9 +1214,9 @@ The string argument is normally a multibyte string, except:
delete_read_fd (p->infd);
}
PSET (p, filter, filter);
pset_filter (p, filter);
if (NETCONN1_P (p) || SERIALCONN1_P (p))
PSET (p, childp, Fplist_put (p->childp, QCfilter, filter));
pset_childp (p, Fplist_put (p->childp, QCfilter, filter));
setup_process_coding_systems (process);
return filter;
}
@ -1153,9 +1243,9 @@ It gets two arguments: the process, and a string describing the change. */)
CHECK_PROCESS (process);
p = XPROCESS (process);
PSET (p, sentinel, sentinel);
pset_sentinel (p, sentinel);
if (NETCONN1_P (p) || SERIALCONN1_P (p))
PSET (p, childp, Fplist_put (p->childp, QCsentinel, sentinel));
pset_childp (p, Fplist_put (p->childp, QCsentinel, sentinel));
return sentinel;
}
@ -1324,7 +1414,7 @@ DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist,
CHECK_PROCESS (process);
CHECK_LIST (plist);
PSET (XPROCESS (process), plist, plist);
pset_plist (XPROCESS (process), plist);
return plist;
}
@ -1510,18 +1600,18 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
itself; it's all taken care of here. */
record_unwind_protect (start_process_unwind, proc);
PSET (XPROCESS (proc), childp, Qt);
PSET (XPROCESS (proc), plist, Qnil);
PSET (XPROCESS (proc), type, Qreal);
PSET (XPROCESS (proc), buffer, buffer);
PSET (XPROCESS (proc), sentinel, Qnil);
PSET (XPROCESS (proc), filter, Qnil);
PSET (XPROCESS (proc), command, Flist (nargs - 2, args + 2));
pset_childp (XPROCESS (proc), Qt);
pset_plist (XPROCESS (proc), Qnil);
pset_type (XPROCESS (proc), Qreal);
pset_buffer (XPROCESS (proc), buffer);
pset_sentinel (XPROCESS (proc), Qnil);
pset_filter (XPROCESS (proc), Qnil);
pset_command (XPROCESS (proc), Flist (nargs - 2, args + 2));
#ifdef HAVE_GNUTLS
/* AKA GNUTLS_INITSTAGE(proc). */
XPROCESS (proc)->gnutls_initstage = GNUTLS_STAGE_EMPTY;
PSET (XPROCESS (proc), gnutls_cred_type, Qnil);
pset_gnutls_cred_type (XPROCESS (proc), Qnil);
#endif
#ifdef ADAPTIVE_READ_BUFFERING
@ -1561,7 +1651,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
else if (CONSP (Vdefault_process_coding_system))
val = XCAR (Vdefault_process_coding_system);
}
PSET (XPROCESS (proc), decode_coding_system, val);
pset_decode_coding_system (XPROCESS (proc), val);
val = Vcoding_system_for_write;
if (NILP (val))
@ -1581,7 +1671,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
else if (CONSP (Vdefault_process_coding_system))
val = XCDR (Vdefault_process_coding_system);
}
PSET (XPROCESS (proc), encode_coding_system, val);
pset_encode_coding_system (XPROCESS (proc), val);
/* Note: At this moment, the above coding system may leave
text-conversion or eol-conversion unspecified. They will be
decided after we read output from the process and decode it by
@ -1590,9 +1680,9 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
}
PSET (XPROCESS (proc), decoding_buf, empty_unibyte_string);
pset_decoding_buf (XPROCESS (proc), empty_unibyte_string);
XPROCESS (proc)->decoding_carryover = 0;
PSET (XPROCESS (proc), encoding_buf, empty_unibyte_string);
pset_encoding_buf (XPROCESS (proc), empty_unibyte_string);
XPROCESS (proc)->inherit_coding_system_flag
= !(NILP (buffer) || !inherit_process_coding_system);
@ -1724,9 +1814,6 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
/* Use volatile to protect variables from being clobbered by longjmp. */
volatile int forkin, forkout;
volatile int pty_flag = 0;
#ifndef USE_CRT_DLL
extern char **environ;
#endif
inchannel = outchannel = -1;
@ -1814,7 +1901,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
more portable (see USG_SUBTTY_WORKS above). */
XPROCESS (process)->pty_flag = pty_flag;
PSET (XPROCESS (process), status, Qrun);
pset_status (XPROCESS (process), Qrun);
/* Delay interrupts until we have a chance to store
the new fork's pid in its process structure */
@ -2050,10 +2137,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
#ifdef HAVE_PTYS
if (pty_flag)
PSET (XPROCESS (process), tty_name, build_string (pty_name));
pset_tty_name (XPROCESS (process), build_string (pty_name));
else
#endif
PSET (XPROCESS (process), tty_name, Qnil);
pset_tty_name (XPROCESS (process), Qnil);
#if !defined (WINDOWSNT) && defined (FD_CLOEXEC)
/* Wait for child_setup to complete in case that vfork is
@ -2148,7 +2235,7 @@ create_pty (Lisp_Object process)
more portable (see USG_SUBTTY_WORKS above). */
XPROCESS (process)->pty_flag = pty_flag;
PSET (XPROCESS (process), status, Qrun);
pset_status (XPROCESS (process), Qrun);
setup_process_coding_systems (process);
add_non_keyboard_read_fd (inchannel);
@ -2156,10 +2243,10 @@ create_pty (Lisp_Object process)
XPROCESS (process)->pid = -2;
#ifdef HAVE_PTYS
if (pty_flag)
PSET (XPROCESS (process), tty_name, build_string (pty_name));
pset_tty_name (XPROCESS (process), build_string (pty_name));
else
#endif
PSET (XPROCESS (process), tty_name, Qnil);
pset_tty_name (XPROCESS (process), Qnil);
}
@ -2548,7 +2635,7 @@ OPTION is not a supported option, return nil instead; otherwise return t. */)
if (set_socket_option (s, option, value))
{
PSET (p, childp, Fplist_put (p->childp, option, value));
pset_childp (p, Fplist_put (p->childp, option, value));
return Qt;
}
@ -2781,18 +2868,18 @@ usage: (make-serial-process &rest ARGS) */)
if (NILP (buffer))
buffer = name;
buffer = Fget_buffer_create (buffer);
PSET (p, buffer, buffer);
pset_buffer (p, buffer);
PSET (p, childp, contact);
PSET (p, plist, Fcopy_sequence (Fplist_get (contact, QCplist)));
PSET (p, type, Qserial);
PSET (p, sentinel, Fplist_get (contact, QCsentinel));
PSET (p, filter, Fplist_get (contact, QCfilter));
PSET (p, log, Qnil);
pset_childp (p, contact);
pset_plist (p, Fcopy_sequence (Fplist_get (contact, QCplist)));
pset_type (p, Qserial);
pset_sentinel (p, Fplist_get (contact, QCsentinel));
pset_filter (p, Fplist_get (contact, QCfilter));
pset_log (p, Qnil);
if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
p->kill_without_query = 1;
if (tem = Fplist_get (contact, QCstop), !NILP (tem))
PSET (p, command, Qt);
pset_command (p, Qt);
p->pty_flag = 0;
if (!EQ (p->command, Qt))
@ -2821,7 +2908,7 @@ usage: (make-serial-process &rest ARGS) */)
else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters)))
|| (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters))))
val = Qnil;
PSET (p, decode_coding_system, val);
pset_decode_coding_system (p, val);
val = Qnil;
if (!NILP (tem))
@ -2835,12 +2922,12 @@ usage: (make-serial-process &rest ARGS) */)
else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters)))
|| (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters))))
val = Qnil;
PSET (p, encode_coding_system, val);
pset_encode_coding_system (p, val);
setup_process_coding_systems (proc);
PSET (p, decoding_buf, empty_unibyte_string);
pset_decoding_buf (p, empty_unibyte_string);
p->decoding_carryover = 0;
PSET (p, encoding_buf, empty_unibyte_string);
pset_encoding_buf (p, empty_unibyte_string);
p->inherit_coding_system_flag
= !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
@ -3577,23 +3664,23 @@ usage: (make-network-process &rest ARGS) */)
p = XPROCESS (proc);
PSET (p, childp, contact);
PSET (p, plist, Fcopy_sequence (Fplist_get (contact, QCplist)));
PSET (p, type, Qnetwork);
pset_childp (p, contact);
pset_plist (p, Fcopy_sequence (Fplist_get (contact, QCplist)));
pset_type (p, Qnetwork);
PSET (p, buffer, buffer);
PSET (p, sentinel, sentinel);
PSET (p, filter, filter);
PSET (p, log, Fplist_get (contact, QClog));
pset_buffer (p, buffer);
pset_sentinel (p, sentinel);
pset_filter (p, filter);
pset_log (p, Fplist_get (contact, QClog));
if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
p->kill_without_query = 1;
if ((tem = Fplist_get (contact, QCstop), !NILP (tem)))
PSET (p, command, Qt);
pset_command (p, Qt);
p->pid = 0;
p->infd = inch;
p->outfd = outch;
if (is_server && socktype != SOCK_DGRAM)
PSET (p, status, Qlisten);
pset_status (p, Qlisten);
/* Make the process marker point into the process buffer (if any). */
if (BUFFERP (buffer))
@ -3607,7 +3694,7 @@ usage: (make-network-process &rest ARGS) */)
/* We may get here if connect did succeed immediately. However,
in that case, we still need to signal this like a non-blocking
connection. */
PSET (p, status, Qconnect);
pset_status (p, Qconnect);
if ((fd_callback_info[inch].flags & NON_BLOCKING_CONNECT_FD) == 0)
add_non_blocking_write_fd (inch);
}
@ -3667,7 +3754,7 @@ usage: (make-network-process &rest ARGS) */)
else
val = Qnil;
}
PSET (p, decode_coding_system, val);
pset_decode_coding_system (p, val);
if (!NILP (tem))
{
@ -3701,13 +3788,13 @@ usage: (make-network-process &rest ARGS) */)
else
val = Qnil;
}
PSET (p, encode_coding_system, val);
pset_encode_coding_system (p, val);
}
setup_process_coding_systems (proc);
PSET (p, decoding_buf, empty_unibyte_string);
pset_decoding_buf (p, empty_unibyte_string);
p->decoding_carryover = 0;
PSET (p, encoding_buf, empty_unibyte_string);
pset_encoding_buf (p, empty_unibyte_string);
p->inherit_coding_system_flag
= !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
@ -4324,18 +4411,18 @@ server_accept_connection (Lisp_Object server, int channel)
conv_sockaddr_to_lisp (&saddr.sa, len));
#endif
PSET (p, childp, contact);
PSET (p, plist, Fcopy_sequence (ps->plist));
PSET (p, type, Qnetwork);
pset_childp (p, contact);
pset_plist (p, Fcopy_sequence (ps->plist));
pset_type (p, Qnetwork);
PSET (p, buffer, buffer);
PSET (p, sentinel, ps->sentinel);
PSET (p, filter, ps->filter);
PSET (p, command, Qnil);
pset_buffer (p, buffer);
pset_sentinel (p, ps->sentinel);
pset_filter (p, ps->filter);
pset_command (p, Qnil);
p->pid = 0;
p->infd = s;
p->outfd = s;
PSET (p, status, Qrun);
pset_status (p, Qrun);
/* Client processes for accepted connections are not stopped initially. */
if (!EQ (p->filter, Qt))
@ -4346,13 +4433,13 @@ server_accept_connection (Lisp_Object server, int channel)
of the new process should reflect the settings at the time the
server socket was opened; not the current settings. */
PSET (p, decode_coding_system, ps->decode_coding_system);
PSET (p, encode_coding_system, ps->encode_coding_system);
pset_decode_coding_system (p, ps->decode_coding_system);
pset_encode_coding_system (p, ps->encode_coding_system);
setup_process_coding_systems (proc);
PSET (p, decoding_buf, empty_unibyte_string);
pset_decoding_buf (p, empty_unibyte_string);
p->decoding_carryover = 0;
PSET (p, encoding_buf, empty_unibyte_string);
pset_encoding_buf (p, empty_unibyte_string);
p->inherit_coding_system_flag
= (NILP (buffer) ? 0 : ps->inherit_coding_system_flag);
@ -5052,7 +5139,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
waitpid() will not find the process object to
delete. Do it here. */
p->tick = ++process_tick;
PSET (p, status, Qfailed);
pset_status (p, Qfailed);
}
else
kill (getpid (), SIGCHLD);
@ -5072,8 +5159,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
if (XPROCESS (proc)->raw_status_new)
update_status (XPROCESS (proc));
if (EQ (XPROCESS (proc)->status, Qrun))
PSET (XPROCESS (proc), status,
Fcons (Qexit, Fcons (make_number (256), Qnil)));
pset_status (XPROCESS (proc),
list2 (Qexit, make_number (256)));
}
}
#ifdef NON_BLOCKING_CONNECT
@ -5119,13 +5206,12 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
if (xerrno)
{
p->tick = ++process_tick;
PSET (p, status,
Fcons (Qfailed, Fcons (make_number (xerrno), Qnil)));
pset_status (p, list2 (Qfailed, make_number (xerrno)));
deactivate_process (proc);
}
else
{
PSET (p, status, Qrun);
pset_status (p, Qrun);
/* Execute the sentinel here. If we had relied on
status_notify to do it later, it will read input
from the process before calling the sentinel. */
@ -5322,7 +5408,7 @@ read_process_output (Lisp_Object proc, register int channel)
/* A new coding system might be found. */
if (!EQ (p->decode_coding_system, Vlast_coding_system_used))
{
PSET (p, decode_coding_system, Vlast_coding_system_used);
pset_decode_coding_system (p, Vlast_coding_system_used);
/* Don't call setup_coding_system for
proc_decode_coding_system[channel] here. It is done in
@ -5338,8 +5424,8 @@ read_process_output (Lisp_Object proc, register int channel)
if (NILP (p->encode_coding_system)
&& proc_encode_coding_system[p->outfd])
{
PSET (p, encode_coding_system,
coding_inherit_eol_type (Vlast_coding_system_used, Qnil));
pset_encode_coding_system
(p, coding_inherit_eol_type (Vlast_coding_system_used, Qnil));
setup_coding_system (p->encode_coding_system,
proc_encode_coding_system[p->outfd]);
}
@ -5348,7 +5434,7 @@ read_process_output (Lisp_Object proc, register int channel)
if (coding->carryover_bytes > 0)
{
if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
PSET (p, decoding_buf, make_uninit_string (coding->carryover_bytes));
pset_decoding_buf (p, make_uninit_string (coding->carryover_bytes));
memcpy (SDATA (p->decoding_buf), coding->carryover,
coding->carryover_bytes);
p->decoding_carryover = coding->carryover_bytes;
@ -5404,7 +5490,7 @@ read_process_output (Lisp_Object proc, register int channel)
old_begv_byte = BEGV_BYTE;
old_zv_byte = ZV_BYTE;
BSET (current_buffer, read_only, Qnil);
bset_read_only (current_buffer, Qnil);
/* Insert new output into buffer
at the current end-of-output marker,
@ -5432,12 +5518,12 @@ read_process_output (Lisp_Object proc, register int channel)
similar code in the previous `if' block. */
if (!EQ (p->decode_coding_system, Vlast_coding_system_used))
{
PSET (p, decode_coding_system, Vlast_coding_system_used);
pset_decode_coding_system (p, Vlast_coding_system_used);
if (NILP (p->encode_coding_system)
&& proc_encode_coding_system[p->outfd])
{
PSET (p, encode_coding_system,
coding_inherit_eol_type (Vlast_coding_system_used, Qnil));
pset_encode_coding_system
(p, coding_inherit_eol_type (Vlast_coding_system_used, Qnil));
setup_coding_system (p->encode_coding_system,
proc_encode_coding_system[p->outfd]);
}
@ -5445,7 +5531,7 @@ read_process_output (Lisp_Object proc, register int channel)
if (coding->carryover_bytes > 0)
{
if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
PSET (p, decoding_buf, make_uninit_string (coding->carryover_bytes));
pset_decoding_buf (p, make_uninit_string (coding->carryover_bytes));
memcpy (SDATA (p->decoding_buf), coding->carryover,
coding->carryover_bytes);
p->decoding_carryover = coding->carryover_bytes;
@ -5495,7 +5581,7 @@ read_process_output (Lisp_Object proc, register int channel)
Fnarrow_to_region (make_number (old_begv), make_number (old_zv));
BSET (current_buffer, read_only, old_read_only);
bset_read_only (current_buffer, old_read_only);
SET_PT_BOTH (opoint, opoint_byte);
}
/* Handling the process output should not deactivate the mark. */
@ -5562,9 +5648,9 @@ write_queue_push (struct Lisp_Process *p, Lisp_Object input_obj,
entry = Fcons (obj, Fcons (make_number (offset), make_number (len)));
if (front)
PSET (p, write_queue, Fcons (entry, p->write_queue));
pset_write_queue (p, Fcons (entry, p->write_queue));
else
PSET (p, write_queue, nconc2 (p->write_queue, Fcons (entry, Qnil)));
pset_write_queue (p, nconc2 (p->write_queue, Fcons (entry, Qnil)));
}
/* Remove the first element in the write_queue of process P, put its
@ -5582,7 +5668,7 @@ write_queue_pop (struct Lisp_Process *p, Lisp_Object *obj,
return 0;
entry = XCAR (p->write_queue);
PSET (p, write_queue, XCDR (p->write_queue));
pset_write_queue (p, XCDR (p->write_queue));
*obj = XCAR (entry);
offset_length = XCDR (entry);
@ -5629,8 +5715,8 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
&& !NILP (BVAR (XBUFFER (object), enable_multibyte_characters)))
|| EQ (object, Qt))
{
PSET (p, encode_coding_system,
complement_process_encoding_system (p->encode_coding_system));
pset_encode_coding_system
(p, complement_process_encoding_system (p->encode_coding_system));
if (!EQ (Vlast_coding_system_used, p->encode_coding_system))
{
/* The coding system for encoding was changed to raw-text
@ -5851,7 +5937,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
proc = process_sent_to;
p = XPROCESS (proc);
p->raw_status_new = 0;
PSET (p, status, Fcons (Qexit, Fcons (make_number (256), Qnil)));
pset_status (p, Fcons (Qexit, Fcons (make_number (256), Qnil)));
p->tick = ++process_tick;
deactivate_process (proc);
error ("SIGPIPE raised on process %s; closed it", SDATA (p->name));
@ -6080,7 +6166,7 @@ process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
#ifdef SIGCONT
case SIGCONT:
p->raw_status_new = 0;
PSET (p, status, Qrun);
pset_status (p, Qrun);
p->tick = ++process_tick;
if (!nomsg)
{
@ -6173,7 +6259,7 @@ traffic. */)
if (NILP (p->command)
&& p->infd >= 0)
delete_read_fd (p->infd);
PSET (p, command, Qt);
pset_command (p, Qt);
return process;
}
#ifndef SIGTSTP
@ -6208,7 +6294,7 @@ traffic. */)
tcflush (p->infd, TCIFLUSH);
#endif /* not WINDOWSNT */
}
PSET (p, command, Qnil);
pset_command (p, Qnil);
return process;
}
#ifdef SIGCONT
@ -6621,7 +6707,7 @@ sigchld_handler (int signo)
static Lisp_Object
exec_sentinel_unwind (Lisp_Object data)
{
PSET (XPROCESS (XCAR (data)), sentinel, XCDR (data));
pset_sentinel (XPROCESS (XCAR (data)), XCDR (data));
return Qnil;
}
@ -6667,7 +6753,7 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
/* Zilch the sentinel while it's running, to avoid recursive invocations;
assure that it gets restored no matter how the sentinel exits. */
PSET (p, sentinel, Qnil);
pset_sentinel (p, Qnil);
record_unwind_protect (exec_sentinel_unwind, Fcons (proc, sentinel));
/* Inhibit quit so that random quits don't screw up a running filter. */
specbind (Qinhibit_quit, Qt);
@ -6822,13 +6908,13 @@ status_notify (struct Lisp_Process *deleting_process)
before_byte = PT_BYTE;
tem = BVAR (current_buffer, read_only);
BSET (current_buffer, read_only, Qnil);
bset_read_only (current_buffer, Qnil);
insert_string ("\nProcess ");
{ /* FIXME: temporary kludge */
Lisp_Object tem2 = p->name; Finsert (1, &tem2); }
insert_string (" ");
Finsert (1, &msg);
BSET (current_buffer, read_only, tem);
bset_read_only (current_buffer, tem);
set_marker_both (p->mark, p->buffer, PT, PT_BYTE);
if (opoint >= before)
@ -6865,8 +6951,8 @@ encode subprocess input. */)
Fcheck_coding_system (decoding);
Fcheck_coding_system (encoding);
encoding = coding_inherit_eol_type (encoding, Qnil);
PSET (p, decode_coding_system, decoding);
PSET (p, encode_coding_system, encoding);
pset_decode_coding_system (p, decoding);
pset_encode_coding_system (p, encoding);
setup_process_coding_systems (process);
return Qnil;
@ -6896,8 +6982,8 @@ suppressed. */)
CHECK_PROCESS (process);
p = XPROCESS (process);
if (NILP (flag))
PSET (p, decode_coding_system,
raw_text_coding_system (p->decode_coding_system));
pset_decode_coding_system
(p, raw_text_coding_system (p->decode_coding_system));
setup_process_coding_systems (process);
return Qnil;

View file

@ -26,10 +26,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "gnutls.h"
#endif
/* Most code should use these macros to set
Lisp fields in struct Lisp_Process. */
#define PSET(p, field, value) ((p)->field = (value))
INLINE_HEADER_BEGIN
#ifndef PROCESS_INLINE
# define PROCESS_INLINE INLINE
#endif
/* This structure records information about a subprocess
or network connection. */
@ -168,6 +168,23 @@ struct Lisp_Process
#define ChannelMask(n) (1 << (n))
/* Most code should use these functions to set Lisp fields in struct
process. */
PROCESS_INLINE void
pset_childp (struct Lisp_Process *p, Lisp_Object val)
{
p->childp = val;
}
#ifdef HAVE_GNUTLS
PROCESS_INLINE void
pset_gnutls_cred_type (struct Lisp_Process *p, Lisp_Object val)
{
p->gnutls_cred_type = val;
}
#endif
/* True if we are about to fork off a synchronous process or if we
are waiting for it. */
extern int synch_process_alive;
@ -213,3 +230,5 @@ extern void add_write_fd (int fd, fd_callback func, void *data);
extern void delete_write_fd (int fd);
extern void update_processes_for_thread_death (Lisp_Object);
INLINE_HEADER_END

View file

@ -278,8 +278,8 @@ looking_at_1 (Lisp_Object string, int posix)
save_search_regs ();
/* This is so set_image_of_range_1 in regex.c can find the EQV table. */
XCHAR_TABLE (BVAR (current_buffer, case_canon_table))->extras[2]
= BVAR (current_buffer, case_eqv_table);
set_char_table_extras (BVAR (current_buffer, case_canon_table), 2,
BVAR (current_buffer, case_eqv_table));
CHECK_STRING (string);
bufp = compile_pattern (string,
@ -393,8 +393,8 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, int p
}
/* This is so set_image_of_range_1 in regex.c can find the EQV table. */
XCHAR_TABLE (BVAR (current_buffer, case_canon_table))->extras[2]
= BVAR (current_buffer, case_eqv_table);
set_char_table_extras (BVAR (current_buffer, case_canon_table), 2,
BVAR (current_buffer, case_eqv_table));
bufp = compile_pattern (regexp,
(NILP (Vinhibit_changing_match_data)
@ -990,8 +990,8 @@ search_command (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror,
}
/* This is so set_image_of_range_1 in regex.c can find the EQV table. */
XCHAR_TABLE (BVAR (current_buffer, case_canon_table))->extras[2]
= BVAR (current_buffer, case_eqv_table);
set_char_table_extras (BVAR (current_buffer, case_canon_table), 2,
BVAR (current_buffer, case_eqv_table));
np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE,
(!NILP (BVAR (current_buffer, case_fold_search))

View file

@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <ctype.h>
#include <sys/types.h>
#include <setjmp.h>
#include "lisp.h"
@ -150,6 +149,13 @@ static void scan_sexps_forward (struct lisp_parse_state *,
ptrdiff_t, ptrdiff_t, ptrdiff_t, EMACS_INT,
int, Lisp_Object, int);
static int in_classes (int, Lisp_Object);
/* This setter is used only in this file, so it can be private. */
static inline void
bset_syntax_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (syntax_table) = val;
}
/* Whether the syntax of the character C has the prefix flag set. */
int syntax_prefix_flag_p (int c)
@ -819,7 +825,7 @@ It is a copy of the TABLE, which defaults to the standard syntax table. */)
/* Only the standard syntax table should have a default element.
Other syntax tables should inherit from parents instead. */
XCHAR_TABLE (copy)->defalt = Qnil;
set_char_table_defalt (copy, Qnil);
/* Copied syntax tables should all have parents.
If we copied one with no parent, such as the standard syntax table,
@ -836,7 +842,7 @@ One argument, a syntax table. */)
{
int idx;
check_syntax_table (table);
BSET (current_buffer, syntax_table, table);
bset_syntax_table (current_buffer, table);
/* Indicate that this buffer now has a specified syntax table. */
idx = PER_BUFFER_VAR_IDX (syntax_table);
SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);

Some files were not shown because too many files have changed in this diff Show more