aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1992-04-24 08:11:54 +0000
committerJim Blandy1992-04-24 08:11:54 +0000
commit4746118aca2d5cbdd054b4af4814d56550dfbc79 (patch)
tree370e07c6950794f936bc8d434cb0560d883e4a0b
parentd4327fecc103493bc8275c3580b05c06c9fcc019 (diff)
downloademacs-4746118aca2d5cbdd054b4af4814d56550dfbc79.tar.gz
emacs-4746118aca2d5cbdd054b4af4814d56550dfbc79.zip
*** empty log message ***
-rw-r--r--Makefile.in52
-rwxr-xr-xbuild-ins.in85
-rwxr-xr-xconfigure1.in204
-rw-r--r--etc/MACHINES12
-rw-r--r--lib-src/etags.c380
-rw-r--r--lib-src/timer.c4
-rw-r--r--lisp/mail/rmail.el8
-rw-r--r--lisp/play/doctor.el2
-rw-r--r--lisp/progmodes/compile.el26
-rw-r--r--lisp/startup.el8
-rwxr-xr-xmake-dist24
-rw-r--r--src/bytecode.c7
-rw-r--r--src/callint.c7
-rw-r--r--src/callproc.c3
-rw-r--r--src/editfns.c6
-rw-r--r--src/fileio.c8
-rw-r--r--src/floatfns.c12
-rw-r--r--src/lisp.h14
-rw-r--r--src/lread.c20
-rw-r--r--src/print.c12
-rw-r--r--src/process.c10
-rw-r--r--src/ralloc.c1
-rw-r--r--src/s/hpux.h5
-rw-r--r--src/search.c65
-rw-r--r--src/sysdep.c44
-rw-r--r--src/systty.h46
-rw-r--r--src/term.c7
-rw-r--r--src/xfns.c7
-rw-r--r--src/xterm.c34
29 files changed, 708 insertions, 405 deletions
diff --git a/Makefile.in b/Makefile.in
index 1c7d6dfad9e..ceb8f0e8297 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -14,6 +14,9 @@
14# This is a very dangerous thing to do! 14# This is a very dangerous thing to do!
15# make clean 15# make clean
16# This is a little less dangerous. 16# This is a little less dangerous.
17# make dist
18# This produces a tar file from the current source tree suitable
19# for redistribution.
17 20
18SHELL = /bin/sh 21SHELL = /bin/sh
19 22
@@ -28,65 +31,65 @@ prefix=/usr/local
28 31
29# Where to install Emacs and other binaries that people will want to 32# Where to install Emacs and other binaries that people will want to
30# run directly (like etags). 33# run directly (like etags).
31bindir=$(prefix)/bin 34bindir=${prefix}/bin
32 35
33# A directory under which we will install many of Emacs's files. The 36# A directory under which we will install many of Emacs's files. The
34# default values for many of the variables below are expressed in 37# default values for many of the variables below are expressed in
35# terms of this one, so you may not need to change them. 38# terms of this one, so you may not need to change them.
36emacsdir=$(prefix)/emacs-19.0 39emacsdir=${prefix}/emacs-19.0
37 40
38# Where to install and expect the architecture-independent data files 41# Where to install and expect the architecture-independent data files
39# (like the tutorial and the Zippy database). 42# (like the tutorial and the Zippy database).
40datadir=$(emacsdir)/etc 43datadir=${emacsdir}/etc
41 44
42# Where to install the elisp files distributed with Emacs. Strictly 45# Where to install the elisp files distributed with Emacs. Strictly
43# speaking, all the elisp files should go under datadir (above), since 46# speaking, all the elisp files should go under datadir (above), since
44# both elisp source and compiled elisp are completely portable, but 47# both elisp source and compiled elisp are completely portable, but
45# it's traditional to give the lisp files their own subdirectory. 48# it's traditional to give the lisp files their own subdirectory.
46lispdir=$(emacsdir)/lisp 49lispdir=${emacsdir}/lisp
47 50
48# Directories Emacs should search for elisp files specific to this 51# Directories Emacs should search for elisp files specific to this
49# site (i.e. customizations), before consulting $(lispdir). This 52# site (i.e. customizations), before consulting ${lispdir}. This
50# should be a colon-separated list of directories. 53# should be a colon-separated list of directories.
51locallisppath=$(emacsdir)/local-lisp 54locallisppath=${emacsdir}/local-lisp
52 55
53# Where Emacs will search to find its elisp files. Before changing 56# Where Emacs will search to find its elisp files. Before changing
54# this, check to see if your purpose wouldn't better be served by 57# this, check to see if your purpose wouldn't better be served by
55# changing locallisppath. This should be a colon-separated list of 58# changing locallisppath. This should be a colon-separated list of
56# directories. 59# directories.
57lisppath=$(locallisppath):$(lispdir) 60lisppath=${locallisppath}:${lispdir}
58 61
59# Where Emacs will search for its elisp files before dumping. This is 62# Where Emacs will search for its elisp files while building. This is
60# only used during the process of compiling Emacs, to help Emacs find 63# only used during the process of compiling Emacs, to help Emacs find
61# its lisp files before they've been installed in their final 64# its lisp files before they've been installed in their final
62# location. It's usually identical to lisppath, except that the entry 65# location. It's usually identical to lisppath, except that the entry
63# for the directory containing the installed lisp files has been 66# for the directory containing the installed lisp files has been
64# replaced with ../lisp. This should be a colon-separated list of 67# replaced with ../lisp. This should be a colon-separated list of
65# directories. 68# directories.
66dumplisppath=$(locallisppath):../lisp 69buildlisppath=../lisp
67 70
68# Where to install and expect the files that Emacs modifies as it 71# Where to install and expect the files that Emacs modifies as it
69# runs. These files are all architecture-independent. Right now, 72# runs. These files are all architecture-independent. Right now,
70# the only such data is the locking directory. 73# the only such data is the locking directory.
71statedir=$(emacsdir) 74statedir=${emacsdir}
72 75
73# Where to create and expect the locking directory, where the Emacs 76# Where to create and expect the locking directory, where the Emacs
74# locking code keeps track of which files are currently being edited. 77# locking code keeps track of which files are currently being edited.
75lockdir=$(statedir)/lock 78lockdir=${statedir}/lock
76 79
77# Where to install and expect executable files to be run by Emacs 80# Where to install and expect executable files to be run by Emacs
78# rather than directly by users, and other architecture-dependent 81# rather than directly by users, and other architecture-dependent
79# data. 82# data.
80libdir=$(emacsdir)/arch-lib 83libdir=${emacsdir}/arch-lib
81 84
82# Where to install Emacs's man pages. 85# Where to install Emacs's man pages.
83mandir=/usr/man/man1 86mandir=/usr/man/man1
84 87
85# Where to install and expect the info files describing Emacs. In the 88# Where to install and expect the info files describing Emacs. In the
86# past, this defaulted to a subdirectory of $(prefix)/lib/emacs, but 89# past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
87# since there are now many packages documented with the texinfo 90# since there are now many packages documented with the texinfo
88# system, it is inappropriate to imply that it is part of Emacs. 91# system, it is inappropriate to imply that it is part of Emacs.
89infodir=$(prefix)/info 92infodir=${prefix}/info
90 93
91 94
92# ==================== Utility Programs for the Build ==================== 95# ==================== Utility Programs for the Build ====================
@@ -110,22 +113,22 @@ SUBDIR = lib-src src
110 113
111# Subdirectories to install, and where they'll go. 114# Subdirectories to install, and where they'll go.
112COPYDIR = arch-lib etc info lisp 115COPYDIR = arch-lib etc info lisp
113COPYDESTS = $(libdir) $(datadir) $(infodir) $(lispdir) 116COPYDESTS = ${libdir} ${datadir} ${infodir} ${lispdir}
114 117
115all: src/paths.h ${SUBDIR} 118all: src/paths.h ${SUBDIR}
116 119
117removenullpaths=sed -e 's/^://' -e 's/:$$//' -e 's/::/:/' 120removenullpaths=sed -e 's/^://' -e 's/:$$//' -e 's/::/:/'
118 121
119src/paths.h: Makefile src/paths.h.in 122src/paths.h: Makefile src/paths.h.in
120 lisppath=`echo $(lisppath) | $(removenullpaths)` ; \ 123 lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
121 dumplisppath=`echo $(dumplisppath) | $(removenullpaths)` ; \ 124 buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
122 /bin/sed < src/paths.h.in > src/paths.h \ 125 /bin/sed < src/paths.h.in > src/paths.h \
123 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \ 126 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
124 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${dumplisppath}'";' \ 127 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
125 -e 's;\(#.*PATH_EXEC\).*$$;\1 "$(libdir)";' \ 128 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${libdir}";' \
126 -e 's;\(#.*PATH_DATA\).*$$;\1 "$(datadir)";' \ 129 -e 's;\(#.*PATH_DATA\).*$$;\1 "${datadir}";' \
127 -e 's;\(#.*PATH_LOCK\).*$$;\1 "$(lockdir)/";' \ 130 -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";' \
128 -e 's;\(#.*PATH_SUPERLOCK\).*$$;\1 "$(lockdir)/!!!SuperLock!!!";' 131 -e 's;\(#.*PATH_SUPERLOCK\).*$$;\1 "${lockdir}/!!!SuperLock!!!";'
129 132
130src: lib-src 133src: lib-src
131 134
@@ -274,3 +277,6 @@ TAGS tags: lib-src
274 277
275check: 278check:
276 @echo "We don't have any tests for GNU Emacs yet." 279 @echo "We don't have any tests for GNU Emacs yet."
280
281dist:
282 make-dist
diff --git a/build-ins.in b/build-ins.in
index d23a1b28e80..0769f528ef0 100755
--- a/build-ins.in
+++ b/build-ins.in
@@ -18,21 +18,37 @@ bindir=${prefix}/bin
18# A directory under which we will install many of Emacs's files. The 18# A directory under which we will install many of Emacs's files. The
19# default values for many of the variables below are expressed in 19# default values for many of the variables below are expressed in
20# terms of this one, so you may not need to change them. 20# terms of this one, so you may not need to change them.
21emacsdir=${prefix}/lib/emacs-19.0 21emacsdir=${prefix}/emacs-19.0
22 22
23# Where to install and expect the architecture-independent data files 23# Where to install and expect the architecture-independent data files
24# (like the tutorial and the zippy database). 24# (like the tutorial and the Zippy database).
25datadir=${emacsdir}/etc 25datadir=${emacsdir}/etc
26 26
27# Where to install the elisp files distributed with Emacs. 27# Where to install the elisp files distributed with Emacs. Strictly
28# speaking, all the elisp files should go under datadir (above), since
29# both elisp source and compiled elisp are completely portable, but
30# it's traditional to give the lisp files their own subdirectory.
28lispdir=${emacsdir}/lisp 31lispdir=${emacsdir}/lisp
29 32
30# Where Emacs will search to find its elisp files. This should be a 33# Directories Emacs should search for elisp files specific to this
31# colon-separated list of directories. Strictly speaking, all the 34# site (i.e. customizations), before consulting ${lispdir}. This
32# elisp files should go under datadir (above), since both elisp source 35# should be a colon-separated list of directories.
33# and compiled elisp are completely portable, but it's traditional to 36locallisppath=${emacsdir}/local-lisp
34# give the lisp files their own subdirectory. 37
35lisppath=${emacsdir}/local-lisp:${lispdir} 38# Where Emacs will search to find its elisp files. Before changing
39# this, check to see if your purpose wouldn't better be served by
40# changing locallisppath. This should be a colon-separated list of
41# directories.
42lisppath=${locallisppath}:${lispdir}
43
44# Where Emacs will search for its elisp files before dumping. This is
45# only used during the process of compiling Emacs, to help Emacs find
46# its lisp files before they've been installed in their final
47# location. It's usually identical to lisppath, except that the entry
48# for the directory containing the installed lisp files has been
49# replaced with ../lisp. This should be a colon-separated list of
50# directories.
51dumplisppath=../lisp
36 52
37# Where to install and expect the files that Emacs modifies as it 53# Where to install and expect the files that Emacs modifies as it
38# runs. These files are all architecture-independent. Right now, 54# runs. These files are all architecture-independent. Right now,
@@ -57,46 +73,17 @@ mandir=/usr/man/man1
57# system, it is inappropriate to imply that it is part of Emacs. 73# system, it is inappropriate to imply that it is part of Emacs.
58infodir=${prefix}/info 74infodir=${prefix}/info
59 75
60scum 76removenullpaths="sed -e 's/^://' -e 's/:"'$'"//' -e 's/::/:/'"
61 77
62 78lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
63# Where to install all of Emacs's data files - the lisp code, 79dumplisppath=`echo ${dumplisppath} | ${removenullpaths}` ; \
64# documentation tree, and the architecture-dependent and -independent 80/bin/sed < src/paths.h.in > src/paths.h \
65# libaries. The default definitions for the variables below are 81-e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
66# expressed in terms of this one, so you may not need to change them. 82-e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${dumplisppath}'";' \
67# set LIBROOT=/usr/local/lib/emacs-19.0 83-e 's;\(#.*PATH_EXEC\).*$$;\1 "${libdir}";' \
68emacsdir=/u/src/emacs/19.0 84-e 's;\(#.*PATH_DATA\).*$$;\1 "${datadir}";' \
69 85-e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";' \
70# Emacs will search this path to find its elisp files. This should be 86-e 's;\(#.*PATH_SUPERLOCK\).*$$;\1 "${lockdir}/!!!SuperLock!!!";'
71# a colon-separated list of directories. Strictly speaking, all the
72# elisp files should go under DATADIR (below), since both elisp source
73# and compiled elisp are completely portable, but it's traditional to
74# give the lisp files their own subdirectory.
75LISPPATH=/u/src/emacs/19.0/local-lisp:/u/src/emacs/19.0/lisp
76
77# Emacs will look here for its architecture-independent files (like
78# the tutorial and the zippy database).
79DATADIR=/u/src/emacs/19.0/etc
80
81# Emacs will look here for its architecture-dependent files, like
82# executables for its utilities.
83LIBDIR=/u/src/emacs/19.0/arch-lib
84
85# The locking directory, where the Emacs locking code keeps track of
86# which files are currently being edited.
87# set LOCKDIR=${LIBROOT}/lock
88LOCKDIR=/u/src/emacs/19.0/lock
89
90# This is where build-install should place the binaries people will
91# want to run directly (like etags and Emacs itself).
92BINDIR=/usr/local/bin
93
94/bin/sed < src/paths.h.in > src/paths.h \
95-e 's;\(#.*PATH_LOADSEARCH\).*$;\1 "${lisppath}";' \
96-e 's;\(#.*PATH_EXEC\).*$;\1 "${libdir}";' \
97-e 's;\(#.*PATH_DATA\).*$;\1 "${datadir}";' \
98-e 's;\(#.*PATH_LOCK\).*$;\1 "${lockdir}/";' \
99-e 's;\(#.*PATH_SUPERLOCK\).*$;\1 "${lockdir}/!!!SuperLock!!!";'
100 87
101(cd lib-src; make) || exit 1 88(cd lib-src; make) || exit 1
102(cd src; make) || exit 1 89(cd src; make) || exit 1
diff --git a/configure1.in b/configure1.in
index cc02b2e9b00..e75009351f1 100755
--- a/configure1.in
+++ b/configure1.in
@@ -33,11 +33,14 @@ progname=$0
33short_usage="Type \`${progname} -usage' for more information about options." 33short_usage="Type \`${progname} -usage' for more information about options."
34 34
35usage_message="Usage: ${progname} MACHINENAME [-OPTION[=VALUE] ...] 35usage_message="Usage: ${progname} MACHINENAME [-OPTION[=VALUE] ...]
36
37This message needs to be updated.
38
36Set compilation and installation parameters for GNU Emacs, and report. 39Set compilation and installation parameters for GNU Emacs, and report.
37MACHINENAME is the machine to build for. See \`etc/MACHINES'. 40MACHINENAME is the machine to build for. See \`etc/MACHINES'.
38Options are: 41Options are:
39 -opsystem=SYSTEM - operating system to build for; see \`etc/MACHINES'. 42 -opsystem=SYSTEM - operating system to build for; see \`etc/MACHINES'.
40 -libroot=DIR - where to install Emacs's library files 43 -prefix=DIR - where to install Emacs's library files
41These options have reasonable defaults (in []s), and may not be needed: 44These options have reasonable defaults (in []s), and may not be needed:
42 -g, -O - Passed to the compiler. If omitted, use -O only. 45 -g, -O - Passed to the compiler. If omitted, use -O only.
43 -cc=COMPILER - Which compiler to use. Defaults to gcc if available. 46 -cc=COMPILER - Which compiler to use. Defaults to gcc if available.
@@ -65,7 +68,8 @@ options=":\
65usage:help:\ 68usage:help:\
66machine:opsystem:\ 69machine:opsystem:\
67g:O:cc:\ 70g:O:cc:\
68libroot:datadir:libdir:bindir:lisppath:lockdir:\ 71prefix:bindir:emacsdir:datadir:lispdir:locallisppath:\
72lisppath:buildlisppath:statedir:lockdir:libdir:mandir:infodir:\
69gnu_malloc:rel_alloc:highpri:lisp_float_type:\ 73gnu_malloc:rel_alloc:highpri:lisp_float_type:\
70window_system:have_x_menu:\ 74window_system:have_x_menu:\
71" 75"
@@ -81,7 +85,7 @@ have_x_windows:have_x11:have_x_menu:\
81c_switch_site:sigtype:\ 85c_switch_site:sigtype:\
82" 86"
83 87
84libroot= 88prefix=
85bindir=/usr/local/bin 89bindir=/usr/local/bin
86gnu_malloc=yes 90gnu_malloc=yes
87lisp_float_type=yes 91lisp_float_type=yes
@@ -96,7 +100,8 @@ window_system=""
96have_x_menu="" 100have_x_menu=""
97 101
98echo "Examining options." 102echo "Examining options."
99for arg in $*; do 103while [ $# != 0 ]; do
104 arg="$1"
100 case "${arg}" in 105 case "${arg}" in
101 -*) 106 -*)
102 # Separate the switch name from the value it's being given. 107 # Separate the switch name from the value it's being given.
@@ -107,7 +112,9 @@ for arg in $*; do
107 valomitted=no 112 valomitted=no
108 ;; 113 ;;
109 -* ) 114 -* )
110 # If FOO is a boolean argument, -FOO is equivalent to -FOO=yes. 115 # If FOO is a boolean argument, -FOO is equivalent to
116 # -FOO=yes. Otherwise, the value comes from the next
117 # argument - see below.
111 opt=`echo ${arg} | sed 's:^-\(.*\)$:\1:'` 118 opt=`echo ${arg} | sed 's:^-\(.*\)$:\1:'`
112 val="yes" 119 val="yes"
113 valomitted=yes 120 valomitted=yes
@@ -159,10 +166,13 @@ for arg in $*; do
159 ;; 166 ;;
160 *) 167 *)
161 if [ "${valomitted}" = "yes" ]; then 168 if [ "${valomitted}" = "yes" ]; then
162 (echo "${progname}: You must give a value for the \`-${opt}' option, as in 169 if [ $# = 1 ]; then
163 \`-${opt}=FOO'." 170 (echo "${progname}: You must give a value for the \`-${opt}' option, as in
164 echo "${short_usage}") | more 171 \`-${opt}=FOO'."
165 exit 1 172 echo "${short_usage}") | more
173 exit 1
174 fi
175 shift; val="$1"
166 fi 176 fi
167 ;; 177 ;;
168 esac 178 esac
@@ -173,6 +183,7 @@ for arg in $*; do
173 machine=${arg} 183 machine=${arg}
174 ;; 184 ;;
175 esac 185 esac
186 shift
176done 187done
177 188
178if [ "${machine}" = "" ]; then 189if [ "${machine}" = "" ]; then
@@ -241,9 +252,52 @@ systems that Emacs has been ported to." 1>&2
241 fi 252 fi
242fi 253fi
243 254
244if [ "${libroot}" = "" ]; then 255if [ ! "${prefix}" ]; then
245 echo "Guessing library directory." 256 prefix="/usr/local"
246 libroot=`/bin/pwd` 257fi
258
259if [ ! "${emacsdir}" ]; then
260 emacsdir="${prefix}/emacs-19.0"
261fi
262
263if [ ! "${datadir}" ]; then
264 datadir="${emacsdir}/etc"
265fi
266
267if [ ! "${lispdir}" ]; then
268 lispdir="${emacsdir}/lisp"
269fi
270
271if [ ! "${locallisppath}" ]; then
272 locallisppath="${emacsdir}/local-lisp"
273fi
274
275if [ ! "${lisppath}" ]; then
276 lisppath="${locallisppath}:${lispdir}"
277fi
278
279if [ ! "${buildlisppath}" ]; then
280 buildlisppath=../lisp
281fi
282
283if [ ! "${statedir}" ]; then
284 statedir="${emacsdir}"
285fi
286
287if [ ! "${lockdir}" ]; then
288 lockdir="${statedir}/lock"
289fi
290
291if [ "${libdir}" = "" ]; then
292 libdir="${emacsdir}/arch-lib"
293fi
294
295if [ ! "${mandir}" ]; then
296 mandir="/usr/man/man1"
297fi
298
299if [ ! "${infodir}" ]; then
300 infodir="${prefix}/info"
247fi 301fi
248 302
249echo "Checking window system." 303echo "Checking window system."
@@ -279,39 +333,10 @@ case "${window_system}" in
279 ;; 333 ;;
280esac 334esac
281 335
282# What is the return type of a signal handler? We grep
283# /usr/include/signal.h for the declaration of the signal function.
284# Yuck.
285echo "Looking for return type of signal handler functions."
286if [ -r /usr/include/signal.h ]; then
287 sigpattern='[ ]*([ ]*\*[ ]*signal[ ]*('
288 sigtype=void
289 if grep -s "int${sigpattern}" /usr/include/signal.h; then
290 sigtype=int
291 fi
292fi
293
294
295if [ "${have_x_menu}" = "" ]; then 336if [ "${have_x_menu}" = "" ]; then
296 have_x_menu=no 337 have_x_menu=no
297fi 338fi
298 339
299if [ "${lisppath}" = "" ]; then
300 lisppath='$(locallisppath):$(lispdir)'
301fi
302
303if [ "${datadir}" = "" ]; then
304 datadir='$(emacsdir)/etc'
305fi
306
307if [ "${libdir}" = "" ]; then
308 libdir='$(emacsdir)/arch-lib'
309fi
310
311if [ "${lockdir}" = "" ]; then
312 lockdir='$(statedir)/lock'
313fi
314
315echo "Checking for GCC." 340echo "Checking for GCC."
316case "${cc}" in 341case "${cc}" in
317 "" ) 342 "" )
@@ -328,11 +353,53 @@ case "${cc}" in
328 ;; 353 ;;
329esac 354esac
330 355
331case "${O},${g},${cc}" in 356case "${cc}" in
332 ,,gcc ) O=yes; g=yes ;; 357 "gcc" )
333 ,,* ) O=yes; g=no ;; 358 # With GCC, both O and g should default to yes, no matter what
359 # the other is.
360 case "${O},${g}" in
361 , ) O=yes; g=yes ;;
362 ,* ) O=yes; ;;
363 *, ) g=yes ;;
364 esac
365 ;;
366 "*" )
367 # With other compilers, treat them as mutually exclusive,
368 # defaulting to debug.
369 case "${O},${g}" in
370 , ) O=no ; g=yes ;;
371 ,no ) O=yes; ;;
372 ,yes ) O=no ; ;;
373 no, ) g=yes ;;
374 yes, ) g=no ;;
375 esac
376 ;;
334esac 377esac
335 378
379# What is the return type of a signal handler? We run
380# /usr/include/signal.h through cpp and grep for the declaration of
381# the signal function. Yuck.
382echo "Looking for return type of signal handler functions."
383signal_h_file=''
384if [ -r /usr/include/signal.h ]; then
385 signal_h_file=/usr/include/signal.h
386elif [ -r /usr/include/sys/signal.h ]; then
387 signal_h_file=/usr/include/sys/signal.h
388fi
389sigtype=void
390if [ "${signal_h_file}" ]; then
391 sigpattern='[ ]*([ ]*\*[ ]*signal[ ]*('
392
393 # We make a symbolic link whose name ends in .c, so the compiler
394 # won't complain about having only been given a .h file.
395 tempcname="configure.tmp.$$.c"
396 ln -s ${signal_h_file} ${tempcname}
397 if ${cc} -E ${tempcname} | grep "int${sigpattern}" > /dev/null; then
398 sigtype=int
399 fi
400 rm ${tempcname}
401fi
402
336echo "Examining the machine- and system-dependent files to find out" 403echo "Examining the machine- and system-dependent files to find out"
337echo " - which libraries the lib-src programs will want, and" 404echo " - which libraries the lib-src programs will want, and"
338echo " - whether the GNU malloc routines are usable." 405echo " - whether the GNU malloc routines are usable."
@@ -345,14 +412,16 @@ echo '#include "src/'${machfile}'"
345#ifndef LIBS_SYSTEM 412#ifndef LIBS_SYSTEM
346#define LIBS_SYSTEM 413#define LIBS_SYSTEM
347#endif 414#endif
348libsrc_libs=LIBS_MACHINE LIBS_SYSTEM 415@configure@ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
349#ifdef SYSTEM_MALLOC 416#ifdef SYSTEM_MALLOC
350system_malloc=yes 417@configure@ system_malloc=yes
351#else 418#else
352system_malloc=no 419@configure@ system_malloc=no
353#endif 420#endif
354' > ${tempcname} 421' > ${tempcname}
355eval `${cc} -E ${tempcname} | grep -v '^#' | grep -v '^[ ]*$'` 422eval `${cc} -E ${tempcname} \
423 | grep '@configure@' \
424 | sed -e 's/^@configure@//'`
356rm ${tempcname} 425rm ${tempcname}
357 426
358# Do the opsystem or machine files prohibit the use of the GNU malloc? 427# Do the opsystem or machine files prohibit the use of the GNU malloc?
@@ -383,7 +452,8 @@ esac
383sed_flags="-e 's:@machine@:${machfile}:'" 452sed_flags="-e 's:@machine@:${machfile}:'"
384sed_flags="${sed_flags} -e 's:@opsystem@:${opsysfile}:'" 453sed_flags="${sed_flags} -e 's:@opsystem@:${opsysfile}:'"
385for flag in `echo ${config_h_opts} | tr ':' ' '`; do 454for flag in `echo ${config_h_opts} | tr ':' ' '`; do
386 cflagname=`echo ${flag} | tr a-z A-Z` 455 cflagname=`echo ${flag} \
456 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
387 val=`eval echo '$'${flag}` 457 val=`eval echo '$'${flag}`
388 case ${val} in 458 case ${val} in
389 no | "") 459 no | "")
@@ -411,12 +481,20 @@ rm -f ./Makefile
411# editing \`./Makefile.in' itself, or running \`${progname}' instead." 481# editing \`./Makefile.in' itself, or running \`${progname}' instead."
412 /bin/sed < Makefile.in \ 482 /bin/sed < Makefile.in \
413 -e '/^# DIST: /d' \ 483 -e '/^# DIST: /d' \
414 -e 's;^\(emacsdir=\).*$;\1'"${libroot};" \ 484 -e 's;^\(prefix=\).*$;\1'"${prefix};" \
415 -e 's;^\(bindir=\).*$;\1'"${bindir};" \ 485 -e 's;^\(bindir=\).*$;\1'"${bindir};" \
416 -e 's;^\(lisppath=\).*$;\1'"${lisppath};" \ 486 -e 's;^\(emacsdir=\).*$;\1'"${emacsdir};" \
417 -e 's;^\(datadir=\).*$;\1'"${datadir};" \ 487 -e 's;^\(datadir=\).*$;\1'"${datadir};" \
488 -e 's;^\(lispdir=\).*$;\1'"${lispdir};" \
489 -e 's;^\(locallisppath=\).*$;\1'"${locallisppath};" \
490 -e 's;^\(lisppath=\).*$;\1'"${lisppath};" \
491 -e 's;^\(buildlisppath=\).*$;\1'"${buildlisppath};" \
492 -e 's;^\(statedir=\).*$;\1'"${statedir};" \
418 -e 's;^\(lockdir=\).*$;\1'"${lockdir};" \ 493 -e 's;^\(lockdir=\).*$;\1'"${lockdir};" \
419 -e 's;^\(libdir=\).*$;\1'"${libdir};") > ./Makefile 494 -e 's;^\(libdir=\).*$;\1'"${libdir};" \
495 -e 's;^\(mandir=\).*$;\1'"${mandir};" \
496 -e 's;^\(infodir=\).*$;\1'"${infodir};" \
497) > ./Makefile
420# Remind people not to edit this. 498# Remind people not to edit this.
421chmod -w ./Makefile 499chmod -w ./Makefile
422 500
@@ -427,12 +505,12 @@ rm -f ./build-install
427# If you are thinking about editing it, you should seriously consider 505# If you are thinking about editing it, you should seriously consider
428# editing \`./build-install.in' itself, or running \`${progname}' instead." 506# editing \`./build-install.in' itself, or running \`${progname}' instead."
429 /bin/sed < build-install.in \ 507 /bin/sed < build-install.in \
430 -e 's;^\(LIBROOT=\).*$;\1'"${libroot};" \ 508 -e 's;^\(prefix=\).*$;\1'"${prefix};" \
431 -e 's;^\(BINDIR=\).*$;\1'"${bindir};" \ 509 -e 's;^\(bindir=\).*$;\1'"${bindir};" \
432 -e 's;^\(LISPPATH=\).*$;\1'"${lisppath};" \ 510 -e 's;^\(lisppath=\).*$;\1'"${lisppath};" \
433 -e 's;^\(DATADIR=\).*$;\1'"${datadir};" \ 511 -e 's;^\(datadir=\).*$;\1'"${datadir};" \
434 -e 's;^\(LOCKDIR=\).*$;\1'"${lockdir};" \ 512 -e 's;^\(lockdir=\).*$;\1'"${lockdir};" \
435 -e 's;^\(LIBDIR=\).*$;\1'"${libdir};") > ./build-install 513 -e 's;^\(libdir=\).*$;\1'"${libdir};") > ./build-install
436# Remind people not to edit this. 514# Remind people not to edit this.
437chmod -w build-install 515chmod -w build-install
438chmod +x build-install 516chmod +x build-install
@@ -463,6 +541,11 @@ chmod -w lib-src/Makefile
463 541
464 542
465# Create a verbal description of what we have done. 543# Create a verbal description of what we have done.
544if [ "${highpri}" ]; then
545 desc_highpri="${highpri}"
546else
547 desc_highpri="none"
548fi
466message="# Configured for machine \`${machine}' running \`${opsystem}'. 549message="# Configured for machine \`${machine}' running \`${opsystem}'.
467# The following values have been set in ./Makefile and ./build-install: 550# The following values have been set in ./Makefile and ./build-install:
468# Executables will be placed in 551# Executables will be placed in
@@ -477,7 +560,7 @@ message="# Configured for machine \`${machine}' running \`${opsystem}'.
477# Emacs will keep track of file-locking in 560# Emacs will keep track of file-locking in
478# ${lockdir}. 561# ${lockdir}.
479# The following values have been set in src/config.h: 562# The following values have been set in src/config.h:
480# At how much higher than normal priority should Emacs run? ${highpri-none} 563# At how much higher than normal priority should Emacs run? ${desc_highpri}
481# Should Emacs use the GNU version of malloc? ${gnu_malloc}${gnu_malloc_reason} 564# Should Emacs use the GNU version of malloc? ${gnu_malloc}${gnu_malloc_reason}
482# Should Emacs use the relocating allocator for buffers? ${rel_alloc} 565# Should Emacs use the relocating allocator for buffers? ${rel_alloc}
483# Should Emacs support a floating point Elisp type? ${lisp_float_type} 566# Should Emacs support a floating point Elisp type? ${lisp_float_type}
@@ -511,7 +594,8 @@ echo "'${progname}' \\
511 -gnu_malloc='${gnu_malloc}' \\ 594 -gnu_malloc='${gnu_malloc}' \\
512 -rel_alloc='${rel_alloc}' \\ 595 -rel_alloc='${rel_alloc}' \\
513 -highpri='${highpri}' \\ 596 -highpri='${highpri}' \\
514 -lisp_float_type='${lisp_float_type}'" >> config.status 597 -lisp_float_type='${lisp_float_type}' \\
598 $@" >> config.status
515# Remind people not to edit this. 599# Remind people not to edit this.
516chmod -w config.status 600chmod -w config.status
517chmod +x config.status 601chmod +x config.status
diff --git a/etc/MACHINES b/etc/MACHINES
index 3e7796021fe..724c95f0797 100644
--- a/etc/MACHINES
+++ b/etc/MACHINES
@@ -82,12 +82,12 @@ System V rel 4 (-opsystem=usg5-4)
82 The standard C preprocessor generate xmakefile incorrectly. However, 82 The standard C preprocessor generate xmakefile incorrectly. However,
83 /lib/cpp will work, so use `make CPP=/lib/cpp'. 83 /lib/cpp will work, so use `make CPP=/lib/cpp'.
84 84
85 Versions 3 and earlier of V.4, on the Intel 386 and 860, had problems 85 Versions 3 and earlier of V.4, on the Intel 386 and 860, had
86 in the X11 libraries. These prevent Emacs from working with X. 86 problems in the X11 libraries. These prevent Emacs from working
87 You can use Emacs with X provided your copy of X is based on X11 87 with X. You can use Emacs with X provided your copy of X is based
88 release 4 or newer. Unfortunately, the only way you can tell whether 88 on X11 release 4 or newer. Unfortunately, the only way you can tell
89 your X11 library is new enough is to try compiling Emacs to use X. 89 whether your X11 library is new enough is to try compiling Emacs to
90 If xemacs runs, your X11 library is new enough. 90 use X. If xemacs runs, your X11 library is new enough.
91 91
92 In this context, GSV4 and GSV4i are alternate names for X11R4. 92 In this context, GSV4 and GSV4i are alternate names for X11R4.
93 OL2.* is X11R3 based. OL3 is in between X11R3 and X11R4, and may or 93 OL2.* is X11R3 based. OL3 is in between X11R3 and X11R4, and may or
diff --git a/lib-src/etags.c b/lib-src/etags.c
index fed3f584eff..69d29109b69 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -1,5 +1,5 @@
1/* Tags file maker to go with GNU Emacs 1/* Tags file maker to go with GNU Emacs
2 Copyright (C) 1984, 1987, 1988, 1989 Free Software Foundation, Inc. and Ken Arnold 2 Copyright (C) 1984, 1987, 1988, 1989, 1992 Free Software Foundation, Inc. and Ken Arnold
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -31,6 +31,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
31#include <sys/types.h> 31#include <sys/types.h>
32#include <sys/stat.h> 32#include <sys/stat.h>
33 33
34#include "getopt.h"
35
34#ifdef __GNUC__ 36#ifdef __GNUC__
35#define alloca __builtin_alloca 37#define alloca __builtin_alloca
36#else 38#else
@@ -410,6 +412,12 @@ DEFINEST definedef;
410#define LEVEL_OK_FOR_FUNCDEF() \ 412#define LEVEL_OK_FOR_FUNCDEF() \
411 (level==0 || c_ext && level==1 && structdef==sinbody) 413 (level==0 || c_ext && level==1 && structdef==sinbody)
412 414
415/*
416 * next_token_is_func
417 * set this to TRUE, and the next token considered is called a function.
418 */
419logical next_token_is_func;
420
413/* C extensions. Currently all listed extensions are C++ dialects, so 421/* C extensions. Currently all listed extensions are C++ dialects, so
414 * `c_ext' is used as an abbreviation for `c_ext&C_PLPL'. If a non-C++ 422 * `c_ext' is used as an abbreviation for `c_ext&C_PLPL'. If a non-C++
415 * dialect is added, this must change. 423 * dialect is added, this must change.
@@ -436,7 +444,6 @@ char *curfile, /* current input file name */
436 *intk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789", /* valid in-token chars */ 444 *intk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789", /* valid in-token chars */
437 *notgd = ",;"; /* non-valid after-function chars */ 445 *notgd = ",;"; /* non-valid after-function chars */
438 446
439int file_num; /* current file number */
440int append_to_tagfile; /* -a: append to tags */ 447int append_to_tagfile; /* -a: append to tags */
441int emacs_tags_format; /* emacs style output (no -e option any more) */ 448int emacs_tags_format; /* emacs style output (no -e option any more) */
442/* The following three default to 1 for etags, but to 0 for ctags. */ 449/* The following three default to 1 for etags, but to 0 for ctags. */
@@ -458,6 +465,27 @@ int noindentypedefs; /* -S: ignore indentation in C */
458/* Name this program was invoked with. */ 465/* Name this program was invoked with. */
459char *progname; 466char *progname;
460 467
468struct option longopts[] = {
469 { "append", no_argument, NULL, 'a' },
470 { "backward-search", no_argument, NULL, 'B' },
471 { "c++", no_argument, NULL, 'C' },
472 { "cxref", no_argument, NULL, 'x' },
473 { "defines", no_argument, NULL, 'd' },
474 { "forward-search", no_argument, NULL, 'F' },
475 { "help", no_argument, NULL, 'H' },
476 { "ignore-indentation", no_argument, NULL, 'S' },
477 { "include", required_argument, NULL, 'i' },
478 { "no-defines", no_argument, NULL, 'D' },
479 { "no-warn", no_argument, NULL, 'w' },
480 { "output", required_argument, NULL, 'o' },
481 { "typedefs", no_argument, NULL, 't' },
482 { "typedefs-and-c++", no_argument, NULL, 'T' },
483 { "update", no_argument, NULL, 'u' },
484 { "version", no_argument, NULL, 'V' },
485 { "vgrind", no_argument, NULL, 'v' },
486 { 0 }
487};
488
461FILE *inf, /* ioptr for current input file */ 489FILE *inf, /* ioptr for current input file */
462 *outf; /* ioptr for tags file */ 490 *outf; /* ioptr for tags file */
463 491
@@ -481,13 +509,118 @@ struct linebuffer filename_lb; /* used to read in filenames */
481 509
482 510
483void 511void
512print_version ()
513{
514#ifdef CTAGS
515 printf ("CTAGS ");
516#ifdef ETAGS
517 printf ("and ");
518#endif
519#endif
520#ifdef ETAGS
521 printf ("ETAGS ");
522#endif
523 printf ("for Emacs version 19.0.\n");
524
525 exit (0);
526}
527
528void
529print_help ()
530{
531 printf ("These are the options accepted by %s. You may use unambiguous\n\
532abbreviations for the long option names.\n\n", progname);
533
534 fputs ("\
535-a, --append\n\
536 Append tag entries to existing tags file.\n\
537-C, --c++\n\
538 Treat files with `.c' and `.h' extensions as C++ code, not C\n\
539 code. Files with `.C', `.H', `.cxx', `.hxx', or `.cc'\n\
540 extensions are always assumed to be C++ code.\n\
541-d, --defines\n\
542 Create tag entries for #defines, too.", stdout);
543
544#ifdef ETAGS
545 fputs (" This is the default\n\
546 behavior.", stdout);
547#endif
548
549 fputs ("\n\
550-D, --no-defines\n\
551 Don't create tag entries for #defines.", stdout);
552
553#ifdef CTAGS
554 fputs (" This is the default\n\
555 behavior.", stdout);
556#endif
557
558 puts ("\n\
559-o FILE, --output=FILE\n\
560 Write the tags to FILE.\n\
561-S, --ignore-indentation\n\
562 Don't rely on indentation quite as much as normal. Currently,\n\
563 this means not to assume that a closing brace in the first\n\
564 column is the final brace of a function or structure\n\
565 definition.\n\
566-t, --typedefs\n\
567 Generate tag entries for typedefs. This is the default\n\
568 behavior.\n\
569-T, --typedefs-and-c++\n\
570 Generate tag entries for typedefs, struct/enum/union tags, and\n\
571 C++ member functions.");
572
573#ifdef ETAGS
574 puts ("-i FILE, --include=FILE\n\
575 Include a note in tag file indicating that, when searching for\n\
576 a tag, one should also consult the tags file FILE after\n\
577 checking the current file.");
578#endif
579
580#ifdef CTAGS
581 puts ("-B, --backward-search\n\
582 Write the search commands for the tag entries using '?', the\n\
583 backward-search command.\n\
584-F, --forward-search\n\
585 Write the search commands for the tag entries using '/', the\n\
586 forward-search command.\n\
587-u, --update\n\
588 Update the tag entries for the given files, leaving tag\n\
589 entries for other files in place. Currently, this is\n\
590 implemented by deleting the existing entries for the given\n\
591 files and then rewriting the new entries at the end of the\n\
592 tags file. It is often faster to simply rebuild the entire\n\
593 tag file than to use this.\n\
594-v, --vgrind\n\
595 Generates an index of items intended for human consumption,\n\
596 similar to the output of vgrind. The index is sorted, and\n\
597 gives the page number of each item.\n\
598-x, --cxref\n\
599 Like --vgrind, but in the style of cxref, rather than vgrind.\n\
600 The output uses line numbers instead of page numbers, but\n\
601 beyond that the differences are cosmetic; try both to see\n\
602 which you like.\n\
603-w, --no-warn\n\
604 Suppress warning messages about entries defined in multiple\n\
605 files.");
606#endif
607
608 puts ("-V, --version\n\
609 Print the version of the program.\n\
610-H, --help\n\
611 Print this help message.");
612
613 exit (0);
614}
615
616
617void
484main (argc, argv) 618main (argc, argv)
485 int argc; 619 int argc;
486 char *argv[]; 620 char *argv[];
487{ 621{
488 char cmd[100]; 622 char cmd[100];
489 int i; 623 int i;
490 int outfflag = 0;
491 unsigned int nincluded_files = 0; 624 unsigned int nincluded_files = 0;
492 char **included_files = (char **) alloca (argc * sizeof (char *)); 625 char **included_files = (char **) alloca (argc * sizeof (char *));
493 char *this_file; 626 char *this_file;
@@ -513,116 +646,109 @@ main (argc, argv)
513 if (emacs_tags_format) 646 if (emacs_tags_format)
514 typedefs = typedefs_and_cplusplus = constantypedefs = 1; 647 typedefs = typedefs_and_cplusplus = constantypedefs = 1;
515 648
516 for (; argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0'; argc--, argv++) 649 for (;;)
517 { 650 {
518 for (i = 1; argv[1][i]; i++) 651 int opt;
652 opt = getopt_long (argc, argv, "aCdDo:StTi:BFuvxwVH", longopts, 0);
653
654 if (opt == EOF)
655 break;
656
657 switch (opt)
519 { 658 {
520 switch (argv[1][i]) 659 case '\0':
660 /* If getopt returns '\0', then it has already processed a
661 long-named option. We should do nothing. */
662 break;
663
664 /* Common options. */
665 case 'a':
666 append_to_tagfile++;
667 break;
668 case 'C':
669 cplusplus = 1;
670 break;
671 case 'd':
672 constantypedefs = 1;
673 break;
674 case 'D':
675 constantypedefs = 0;
676 break;
677 case 'o':
678 if (outfile)
521 { 679 {
522 /* Common options. */ 680 fprintf (stderr,
523 case 'a': 681 "%s: -o flag may only be given once\n", progname);
524 append_to_tagfile++;
525 break;
526 case 'C':
527 cplusplus = 1;
528 break;
529 case 'd':
530 constantypedefs = 1;
531 break;
532 case 'D':
533 constantypedefs = 0;
534 break;
535 case 'o':
536 if (outfflag)
537 {
538 fprintf (stderr,
539 "%s: -o flag may only be given once\n", progname);
540 goto usage;
541 }
542 outfflag++, argc--;
543 argv++;
544 if (argc <= 1 || argv[1][0] == '\0')
545 {
546 fprintf (stderr,
547 "%s: -o flag must be followed by a filename\n",
548 progname);
549 goto usage;
550 }
551 outfile = argv[1];
552 goto next_arg;
553 case 'S':
554 noindentypedefs++;
555 break;
556 case 't':
557 typedefs++;
558 break;
559 case 'T':
560 typedefs++;
561 typedefs_and_cplusplus++;
562 break;
563
564 /* Etags options */
565 case 'i':
566 if (!emacs_tags_format)
567 goto usage;
568 --argc;
569 ++argv;
570 if (argc <= 1 || argv[1][0] == '\0')
571 {
572 fprintf (stderr,
573 "%s: -i flag must be followed by a filename\n",
574 progname);
575 goto usage;
576 }
577 included_files[nincluded_files++] = argv[1];
578 goto next_arg;
579
580 /* Ctags options. */
581 case 'B':
582 searchar = '?';
583 if (emacs_tags_format)
584 goto usage;
585 break;
586 case 'F':
587 searchar = '/';
588 if (emacs_tags_format)
589 goto usage;
590 break;
591 case 'u':
592 update++;
593 if (emacs_tags_format)
594 goto usage;
595 break;
596 case 'v':
597 vgrind_style++;
598 /*FALLTHRU*/
599 case 'x':
600 cxref_style++;
601 if (emacs_tags_format)
602 goto usage;
603 break;
604 case 'w':
605 no_warnings++;
606 if (emacs_tags_format)
607 goto usage;
608 break;
609
610 default:
611 goto usage; 682 goto usage;
612 } 683 }
684 outfile = optarg;
685 break;
686 case 'S':
687 noindentypedefs++;
688 break;
689 case 't':
690 typedefs++;
691 break;
692 case 'T':
693 typedefs++;
694 typedefs_and_cplusplus++;
695 break;
696 case 'V':
697 print_version ();
698 break;
699 case 'H':
700 print_help ();
701 break;
702
703 /* Etags options */
704 case 'i':
705 if (!emacs_tags_format)
706 goto usage;
707 included_files[nincluded_files++] = optarg;
708 break;
709
710 /* Ctags options. */
711 case 'B':
712 searchar = '?';
713 if (emacs_tags_format)
714 goto usage;
715 break;
716 case 'F':
717 searchar = '/';
718 if (emacs_tags_format)
719 goto usage;
720 break;
721 case 'u':
722 update++;
723 if (emacs_tags_format)
724 goto usage;
725 break;
726 case 'v':
727 vgrind_style++;
728 /*FALLTHRU*/
729 case 'x':
730 cxref_style++;
731 if (emacs_tags_format)
732 goto usage;
733 break;
734 case 'w':
735 no_warnings++;
736 if (emacs_tags_format)
737 goto usage;
738 break;
739
740 default:
741 goto usage;
613 } 742 }
614 next_arg:;
615 } 743 }
616 744
617 if (argc <= 1) 745 if (optind == argc)
618 { 746 {
747 fprintf (stderr, "%s: No input files specified.\n", progname);
748
619 usage: 749 usage:
620 fprintf (stderr, "Usage:\n"); 750 fprintf (stderr, "%s: Try '%s --help' for a complete list of options.\n",
621#ifndef CTAGS 751 progname, progname);
622 fprintf (stderr, "\tetags [-aDiS] [-o tagsfile] file ...\n");
623#else
624 fprintf (stderr, "\tctags [-aBdeFTStuwvx] [-o tagsfile] file ...\n");
625#endif
626 exit (BAD); 752 exit (BAD);
627 } 753 }
628 754
@@ -652,10 +778,10 @@ main (argc, argv)
652 } 778 }
653 } 779 }
654 780
655 file_num = 1;
656#ifdef VMS 781#ifdef VMS
657 for (argc--, argv++; 782 argc -= optind;
658 (this_file = gfnames (&argc, &argv, &got_err)) != NULL; file_num++) 783 argv += optind;
784 while (gfnames (&argc, &argv, &got_err) != NULL)
659 { 785 {
660 if (got_err) 786 if (got_err)
661 { 787 {
@@ -670,9 +796,9 @@ main (argc, argv)
670 } /* solely to balance out the ifdef'd parens above */ 796 } /* solely to balance out the ifdef'd parens above */
671#endif 797#endif
672#else 798#else
673 for (; file_num < argc; file_num++) 799 for (; optind < argc; optind++)
674 { 800 {
675 this_file = argv[file_num]; 801 this_file = argv[optind];
676 if (1) 802 if (1)
677 { 803 {
678#endif 804#endif
@@ -706,9 +832,11 @@ main (argc, argv)
706 put_entries (head); 832 put_entries (head);
707 exit (GOOD); 833 exit (GOOD);
708 } 834 }
709 if (update) /* update cannot be set under VMS */ 835 if (update)
710 { 836 {
711 for (i = 1; i < argc; i++) 837 /* update cannot be set under VMS, so we may assume that argc
838 and argv have not been munged. */
839 for (i = optind; i < argc; i++)
712 { 840 {
713 sprintf (cmd, 841 sprintf (cmd,
714 "mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS", 842 "mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS",
@@ -905,7 +1033,9 @@ find_entries (file)
905 goto close_and_return; 1033 goto close_and_return;
906 } 1034 }
907 /* if not a .c or .h or .y file, try fortran */ 1035 /* if not a .c or .h or .y file, try fortran */
908 else if (cp && ((cp[1] != 'c' && cp[1] != 'h' && cp[1] != 'y') 1036 else if (cp && ((cp[1] != 'c'
1037 && cp[1] != 'h'
1038 && cp[1] != 'y')
909 || (cp[1] != 0 && cp[2] != 0))) 1039 || (cp[1] != 0 && cp[2] != 0)))
910 { 1040 {
911 if (PF_funcs (inf) != 0) 1041 if (PF_funcs (inf) != 0)
@@ -1308,6 +1438,8 @@ C_entries (c_ext)
1308 definedef = dnone; 1438 definedef = dnone;
1309 gotone = midtoken = inquote = inchar = incomm = FALSE; 1439 gotone = midtoken = inquote = inchar = incomm = FALSE;
1310 level = 0; 1440 level = 0;
1441 tydef = none;
1442 next_token_is_func = 0;
1311 1443
1312 C_create_stabs (); 1444 C_create_stabs ();
1313 1445
@@ -1316,6 +1448,9 @@ C_entries (c_ext)
1316 c = *lp++; 1448 c = *lp++;
1317 if (c == '\\') 1449 if (c == '\\')
1318 { 1450 {
1451 /* If we're at the end of the line, the next character is a
1452 '\0'; don't skip it, because it's the thing that tells us
1453 to read the next line. */
1319 if (*lp == 0) 1454 if (*lp == 0)
1320 continue; 1455 continue;
1321 lp++; 1456 lp++;
@@ -1331,10 +1466,6 @@ C_entries (c_ext)
1331 } 1466 }
1332 else if (inquote) 1467 else if (inquote)
1333 { 1468 {
1334 /*
1335 * Too dumb to know about \" not being magic, but
1336 * they usually occur in pairs anyway.
1337 */
1338 if (c == '"') 1469 if (c == '"')
1339 inquote = FALSE; 1470 inquote = FALSE;
1340 continue; 1471 continue;
@@ -1569,11 +1700,6 @@ consider_token (c, lpp, tokp, is_func, c_ext, level)
1569 int level; /* IN */ 1700 int level; /* IN */
1570{ 1701{
1571 reg char *lp = *lpp; 1702 reg char *lp = *lpp;
1572 /*
1573 * next_token_is_func
1574 * set this to TRUE, and the next token considered is called a function.
1575 */
1576 static logical next_token_is_func;
1577 logical firsttok; /* TRUE if have seen first token in ()'s */ 1703 logical firsttok; /* TRUE if have seen first token in ()'s */
1578 Stab_entry *tokse = stab_find (get_C_stab (c_ext), tokp->p, tokp->len); 1704 Stab_entry *tokse = stab_find (get_C_stab (c_ext), tokp->p, tokp->len);
1579 enum sym_type toktype = stab_type (tokse); 1705 enum sym_type toktype = stab_type (tokse);
@@ -1758,10 +1884,18 @@ consider_token (c, lpp, tokp, is_func, c_ext, level)
1758 goto goodone; 1884 goto goodone;
1759 } 1885 }
1760 /* Detect GNUmacs's function-defining macros. */ 1886 /* Detect GNUmacs's function-defining macros. */
1761 if (definedef == dnone && strneq (tokp->p, "DEF", 3)) 1887 if (definedef == dnone)
1762 { 1888 {
1763 next_token_is_func = TRUE; 1889 if (strneq (tokp->p, "DEF", 3))
1764 goto badone; 1890 {
1891 next_token_is_func = TRUE;
1892 goto badone;
1893 }
1894 else if (strneq (tokp->p, "EXFUN", 5))
1895 {
1896 next_token_is_func = FALSE;
1897 goto badone;
1898 }
1765 } 1899 }
1766 if (next_token_is_func) 1900 if (next_token_is_func)
1767 { 1901 {
diff --git a/lib-src/timer.c b/lib-src/timer.c
index 149625f2995..d7084bfcdc4 100644
--- a/lib-src/timer.c
+++ b/lib-src/timer.c
@@ -105,7 +105,7 @@ void
105getevent() 105getevent()
106 106
107{ 107{
108 extern char *memcpy(), *fgets(); 108 extern char *fgets();
109 struct event *ep; 109 struct event *ep;
110 char buf[256]; 110 char buf[256];
111 111
@@ -127,7 +127,7 @@ getevent()
127 free((char *)events[slot]), events[slot] = 0; 127 free((char *)events[slot]), events[slot] = 0;
128 128
129 else { 129 else {
130 (void)memcpy((char *)events[slot],(char *)ep,sizeof(struct event)); 130 memcpy((char *)events[slot],(char *)ep,sizeof(struct event));
131 if (slot == mevent) mevent++; 131 if (slot == mevent) mevent++;
132 } /* schedule */ 132 } /* schedule */
133 } /* malloc */ 133 } /* malloc */
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 347fce775f1..c45f7552aae 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -99,10 +99,12 @@ Called with region narrowed to unformatted header.")
99(defvar rmail-last-file nil) 99(defvar rmail-last-file nil)
100(defvar rmail-last-rmail-file nil) 100(defvar rmail-last-rmail-file nil)
101 101
102;;; Regexp matching the delimiter of messages in UNIX mail format
103;;; (UNIX From lines), minus the initial ^. Note that if you change
104;;; this expression, you must change the code in rmail-nuke-pinhead-header
105;;; that knows the exact ordering of the \\( \\) subexpressions.
102(defvar rmail-unix-mail-delimiter 106(defvar rmail-unix-mail-delimiter
103 "From \\([^ \n]*\\(\\|\".*\"[^ \n]*\\)\\) ?\\([^ \n]*\\) \\([^ ]*\\) *\\([0-9]*\\) \\([0-9:]*\\)\\( ?[A-Z]?[A-Z][A-Z]T\\( DST\\)?\\| ?[-+]?[0-9][0-9][0-9][0-9]\\|\\) [0-9][0-9]\\([0-9]*\\) *\\(remote from [^\n]*\\)?\n" 107 "From \\([^ \n]*\\(\\|\".*\"[^ \n]*\\)\\) ?\\([^ \n]*\\) \\([^ ]*\\) *\\([0-9]*\\) \\([0-9:]*\\)\\( ?[A-Z]?[A-Z][A-Z]T\\( DST\\)?\\| ?[-+]?[0-9][0-9][0-9][0-9]\\|\\) [0-9][0-9]\\([0-9]*\\) *\\(remote from [^\n]*\\)?\n" nil)
104 "Regexp matching the delimiter of messages in UNIX mail format (UNIX From lines), minus the
105initial ^. ")
106 108
107;;;; *** Rmail Mode *** 109;;;; *** Rmail Mode ***
108 110
diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el
index 873fc5f5c50..74d6efc4c2d 100644
--- a/lisp/play/doctor.el
+++ b/lisp/play/doctor.el
@@ -1319,7 +1319,7 @@ element pair in RLIST."
1319TYPE is number of words preceding KEY to start looking for subject. 1319TYPE is number of words preceding KEY to start looking for subject.
1320MEM is t if results are to be put on Doctor's memory stack. 1320MEM is t if results are to be put on Doctor's memory stack.
1321Return in the global variables SUBJ, VERB and OBJECT." 1321Return in the global variables SUBJ, VERB and OBJECT."
1322 (let ((foo (doctor-subjsearch sent key type) sent)) 1322 (let ((foo (doctor-subjsearch sent key type)))
1323 (or foo 1323 (or foo
1324 (setq foo sent 1324 (setq foo sent
1325 mem nil)) 1325 mem nil))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index d8e8f6e3bd5..48e061c3481 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -19,8 +19,6 @@
19;; file named COPYING. Among other things, the copyright notice 19;; file named COPYING. Among other things, the copyright notice
20;; and this notice must be preserved on all copies. 20;; and this notice must be preserved on all copies.
21 21
22(provide 'compile)
23
24;;;###autoload 22;;;###autoload
25(defvar compilation-mode-hook nil 23(defvar compilation-mode-hook nil
26 "*List of hook functions run by compilation-mode (see `run-hooks').") 24 "*List of hook functions run by compilation-mode (see `run-hooks').")
@@ -437,18 +435,30 @@ other kinds of prefix arguments are ignored."
437;; If compilation-last-buffer is set to a live buffer, use that. 435;; If compilation-last-buffer is set to a live buffer, use that.
438;; Otherwise, look for a compilation buffer and signal an error 436;; Otherwise, look for a compilation buffer and signal an error
439;; if there are none. 437;; if there are none.
440(defun compilation-find-buffer () 438(defun compilation-find-buffer (&optional other-buffer)
441 (if (compilation-buffer-p (current-buffer)) 439 (if (and (not other-buffer)
440 (compilation-buffer-p (current-buffer)))
442 ;; The current buffer is a compilation buffer. 441 ;; The current buffer is a compilation buffer.
443 (current-buffer) 442 (current-buffer)
444 (if (and compilation-last-buffer (buffer-name compilation-last-buffer)) 443 (if (and compilation-last-buffer (buffer-name compilation-last-buffer)
444 (or (not other-buffer) (not (eq compilation-last-buffer
445 (current-buffer)))))
445 compilation-last-buffer 446 compilation-last-buffer
446 (let ((buffers (buffer-list))) 447 (let ((buffers (buffer-list)))
447 (while (and buffers (not (compilation-buffer-p (car buffers)))) 448 (while (and buffers (or (not (compilation-buffer-p (car buffers)))
449 (and other-buffer
450 (eq (car buffers) (current-buffer)))))
448 (setq buffers (cdr buffers))) 451 (setq buffers (cdr buffers)))
449 (if buffers 452 (if buffers
450 (car buffers) 453 (car buffers)
451 (error "No compilation started!")))))) 454 (or (and other-buffer
455 (compilation-buffer-p (current-buffer))
456 ;; The current buffer is a compilation buffer.
457 (progn
458 (if other-buffer
459 (message "This is the only compilation buffer."))
460 (current-buffer)))
461 (error "No compilation started!")))))))
452 462
453;;;###autoload 463;;;###autoload
454(defun next-error (&optional argp) 464(defun next-error (&optional argp)
@@ -792,3 +802,5 @@ See variable `compilation-parse-errors-function' for the interface it uses."
792 (setq compilation-error-list (nreverse compilation-error-list))) 802 (setq compilation-error-list (nreverse compilation-error-list)))
793 803
794(define-key ctl-x-map "`" 'next-error) 804(define-key ctl-x-map "`" 'next-error)
805
806(provide 'compile)
diff --git a/lisp/startup.el b/lisp/startup.el
index fa81e24b775..3bd20aa9de5 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1,11 +1,11 @@
1;; Process Emacs shell arguments 1;; Process Emacs shell arguments
2;; Copyright (C) 1985, 1986 Free Software Foundation, Inc. 2;; Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc.
3 3
4;; This file is part of GNU Emacs. 4;; This file is part of GNU Emacs.
5 5
6;; GNU Emacs is free software; you can redistribute it and/or modify 6;; GNU Emacs is free software; you can redistribute it and/or modify
7;; it under the terms of the GNU General Public License as published by 7;; it under the terms of the GNU General Public License as published by
8;; the Free Software Foundation; either version 1, or (at your option) 8;; the Free Software Foundation; either version 2, or (at your option)
9;; any later version. 9;; any later version.
10 10
11;; GNU Emacs is distributed in the hope that it will be useful, 11;; GNU Emacs is distributed in the hope that it will be useful,
@@ -116,7 +116,9 @@ directory name of the directory where the `.emacs' file was looked for.")
116 (setq command-line-processed t) 116 (setq command-line-processed t)
117 ;; In presence of symlinks, switch to cleaner form of default directory. 117 ;; In presence of symlinks, switch to cleaner form of default directory.
118 (if (and (not (eq system-type 'vax-vms)) 118 (if (and (not (eq system-type 'vax-vms))
119 (getenv "PWD")) 119 (getenv "PWD")
120 (equal (nthcdr 10 (file-attributes default-directory))
121 (nthcdr 10 (file-attributes (getenv "PWD")))))
120 (setq default-directory (file-name-as-directory (getenv "PWD")))) 122 (setq default-directory (file-name-as-directory (getenv "PWD"))))
121 (let ((tail directory-abbrev-alist)) 123 (let ((tail directory-abbrev-alist))
122 (while tail 124 (while tail
diff --git a/make-dist b/make-dist
index db0a5cb62c4..cd2773bd5c7 100755
--- a/make-dist
+++ b/make-dist
@@ -14,12 +14,17 @@ set -e
14# Print out each line we read, for debugging's sake. 14# Print out each line we read, for debugging's sake.
15# set -v 15# set -v
16 16
17cleanup=yes 17clean_up=yes
18make_tar=yes
18 19
19while [ $# -gt 0 ]; do 20while [ $# -gt 0 ]; do
20 case "$1" in 21 case "$1" in
21 "--no-cleanup" ) 22 "--no-clean_up" )
22 cleanup=no 23 clean_up=no
24 ;;
25 "--no-tar" )
26 make_tar=no
27 clean_up=no
23 ;; 28 ;;
24 * ) 29 * )
25 echo "${progname}: Unrecognized argument: $1" >&2 30 echo "${progname}: Unrecognized argument: $1" >&2
@@ -65,9 +70,10 @@ mkdir ${tempdir}
65 70
66# We copy in the top-level files before creating the subdirectories in 71# We copy in the top-level files before creating the subdirectories in
67# hopes that this will make the top-level files appear first in the 72# hopes that this will make the top-level files appear first in the
68# tar file. 73# tar file; this means that people can start reading the INSTALL and
74# README while the rest of the tar file is still unpacking. Whoopee.
69echo "Copying top-level files." 75echo "Copying top-level files."
70ln INSTALL PROBLEMS README ${tempdir} 76ln GETTING.GNU.SOFTWARE INSTALL PROBLEMS README ${tempdir}
71ln ChangeLog Makefile.in build-install.in configure make-dist ${tempdir} 77ln ChangeLog Makefile.in build-install.in configure make-dist ${tempdir}
72 78
73echo "Creating subdirectories." 79echo "Creating subdirectories."
@@ -174,10 +180,12 @@ for subdir in lisp src lib-src info shortnames; do
174 ln -s ../etc/COPYING ${tempdir}/${subdir} 180 ln -s ../etc/COPYING ${tempdir}/${subdir}
175done 181done
176 182
177echo "Creating tar file." 183if [ "${make_tar}" = yes ]; then
178(cd ${tempparent}; tar cvf - ${emacsname}) | compress > ${emacsname}.tar.Z 184 echo "Creating tar file."
185 (cd ${tempparent}; tar cvf - ${emacsname}) | compress > ${emacsname}.tar.Z
186fi
179 187
180if [ "${cleanup}" = yes ]; then 188if [ "${clean_up}" = yes ]; then
181 echo "Cleaning up the staging directory." 189 echo "Cleaning up the staging directory."
182 rm -rf ${tempparent} 190 rm -rf ${tempparent}
183fi 191fi
diff --git a/src/bytecode.c b/src/bytecode.c
index acde450299c..5ab689f1925 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1,11 +1,11 @@
1/* Execution of byte code produced by bytecomp.el. 1/* Execution of byte code produced by bytecomp.el.
2 Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1988, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -1077,8 +1077,7 @@ If the third argument is incorrect, Emacs may crash.")
1077 break; 1077 break;
1078 1078
1079 case Bnumberp: 1079 case Bnumberp:
1080 TOP = (XTYPE (TOP) == Lisp_Int || XTYPE (TOP) == Lisp_Float 1080 TOP = (NUMBERP (TOP) ? Qt : Qnil);
1081 ? Qt : Qnil);
1082 break; 1081 break;
1083 1082
1084 case Bintegerp: 1083 case Bintegerp:
diff --git a/src/callint.c b/src/callint.c
index ffee0785095..0075ef721dc 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -408,12 +408,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
408 case 'n': /* Read number from minibuffer. */ 408 case 'n': /* Read number from minibuffer. */
409 do 409 do
410 args[i] = Fread_minibuffer (build_string (prompt), Qnil); 410 args[i] = Fread_minibuffer (build_string (prompt), Qnil);
411#ifdef LISP_FLOAT_TYPE 411 while (! NUMBERP (args[i]));
412 while (XTYPE (args[i]) != Lisp_Int
413 && XTYPE (args[i]) != Lisp_Float);
414#else
415 while (XTYPE (args[i]) != Lisp_Int);
416#endif
417 visargs[i] = last_minibuf_string; 412 visargs[i] = last_minibuf_string;
418 break; 413 break;
419 414
diff --git a/src/callproc.c b/src/callproc.c
index d22393a2635..68b447d401d 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -200,7 +200,7 @@ If you quit, the process is killed with SIGKILL.")
200 env = environ; 200 env = environ;
201 201
202#if 0 /* Some systems don't have sigblock. */ 202#if 0 /* Some systems don't have sigblock. */
203 mask = sigblock (sigmask (SIGCHLD)); 203 EMACS_SIGBLOCK (sigmask (SIGCHLD), mask);
204#endif 204#endif
205 205
206 /* Record that we're about to create a synchronous process. */ 206 /* Record that we're about to create a synchronous process. */
@@ -511,6 +511,7 @@ This function consults the variable ``process-environment'' for its value.")
511 callable from C. */ 511 callable from C. */
512char * 512char *
513egetenv (var) 513egetenv (var)
514 char *var;
514{ 515{
515 char *value; 516 char *value;
516 int valuelen; 517 int valuelen;
diff --git a/src/editfns.c b/src/editfns.c
index d0db0837591..0ef059aa055 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1094,20 +1094,24 @@ Use %% to put a single % into the output.")
1094 /* Would get MPV otherwise, since Lisp_Int's `point' to low memory. */ 1094 /* Would get MPV otherwise, since Lisp_Int's `point' to low memory. */
1095 else if (XTYPE (args[n]) == Lisp_Int && *format != 's') 1095 else if (XTYPE (args[n]) == Lisp_Int && *format != 's')
1096 { 1096 {
1097#ifdef LISP_FLOAT_TYPE
1097 /* The following loop issumes the Lisp type indicates 1098 /* The following loop issumes the Lisp type indicates
1098 the proper way to pass the argument. 1099 the proper way to pass the argument.
1099 So make sure we have a flonum if the argument should 1100 So make sure we have a flonum if the argument should
1100 be a double. */ 1101 be a double. */
1101 if (*format == 'e' || *format == 'f' || *format == 'g') 1102 if (*format == 'e' || *format == 'f' || *format == 'g')
1102 args[n] = Ffloat (args[n]); 1103 args[n] = Ffloat (args[n]);
1104#endif
1103 total += 10; 1105 total += 10;
1104 } 1106 }
1107#ifdef LISP_FLOAT_TYPE
1105 else if (XTYPE (args[n]) == Lisp_Float && *format != 's') 1108 else if (XTYPE (args[n]) == Lisp_Float && *format != 's')
1106 { 1109 {
1107 if (! (*format == 'e' || *format == 'f' || *format == 'g')) 1110 if (! (*format == 'e' || *format == 'f' || *format == 'g'))
1108 args[n] = Ftruncate (args[n]); 1111 args[n] = Ftruncate (args[n]);
1109 total += 20; 1112 total += 20;
1110 } 1113 }
1114#endif
1111 else 1115 else
1112 { 1116 {
1113 /* Anything but a string, convert to a string using princ. */ 1117 /* Anything but a string, convert to a string using princ. */
@@ -1131,6 +1135,7 @@ Use %% to put a single % into the output.")
1131 /* We checked above that the corresponding format effector 1135 /* We checked above that the corresponding format effector
1132 isn't %s, which would cause MPV. */ 1136 isn't %s, which would cause MPV. */
1133 strings[n] = (unsigned char *) XINT (args[n]); 1137 strings[n] = (unsigned char *) XINT (args[n]);
1138#ifdef LISP_FLOAT_TYPE
1134 else if (XTYPE (args[n]) == Lisp_Float) 1139 else if (XTYPE (args[n]) == Lisp_Float)
1135 { 1140 {
1136 union { double d; int half[2]; } u; 1141 union { double d; int half[2]; } u;
@@ -1139,6 +1144,7 @@ Use %% to put a single % into the output.")
1139 strings[n++] = (unsigned char *) u.half[0]; 1144 strings[n++] = (unsigned char *) u.half[0];
1140 strings[n] = (unsigned char *) u.half[1]; 1145 strings[n] = (unsigned char *) u.half[1];
1141 } 1146 }
1147#endif
1142 else 1148 else
1143 strings[n] = XSTRING (args[n])->data; 1149 strings[n] = XSTRING (args[n])->data;
1144 } 1150 }
diff --git a/src/fileio.c b/src/fileio.c
index ea7f8c6250f..f977ee0c623 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1,11 +1,11 @@
1/* File IO for GNU Emacs. 1/* File IO for GNU Emacs.
2 Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1988, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -411,7 +411,7 @@ directory_file_name (src, dst)
411 /* Process as Unix format: just remove any final slash. 411 /* Process as Unix format: just remove any final slash.
412 But leave "/" unchanged; do not change it to "". */ 412 But leave "/" unchanged; do not change it to "". */
413 strcpy (dst, src); 413 strcpy (dst, src);
414 if (dst[slen - 1] == '/' && slen > 1) 414 if (slen > 1 && dst[slen - 1] == '/')
415 dst[slen - 1] = 0; 415 dst[slen - 1] = 0;
416 return 1; 416 return 1;
417} 417}
@@ -2478,7 +2478,7 @@ Auto-saving writes the buffer into a file\n\
2478so that your editing is not lost if the system crashes.\n\ 2478so that your editing is not lost if the system crashes.\n\
2479This file is not the file you visited; that changes only when you save.\n\n\ 2479This file is not the file you visited; that changes only when you save.\n\n\
2480Non-nil first argument means do not print any message if successful.\n\ 2480Non-nil first argument means do not print any message if successful.\n\
2481Non-nil second argumet means save only current buffer.") 2481Non-nil second argument means save only current buffer.")
2482 (nomsg) 2482 (nomsg)
2483 Lisp_Object nomsg; 2483 Lisp_Object nomsg;
2484{ 2484{
diff --git a/src/floatfns.c b/src/floatfns.c
index 12f14ffef72..ed94c9ebafe 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -1,11 +1,11 @@
1/* Primitive operations on floating point for GNU Emacs Lisp interpreter. 1/* Primitive operations on floating point for GNU Emacs Lisp interpreter.
2 Copyright (C) 1988 Free Software Foundation, Inc. 2 Copyright (C) 1988, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -42,7 +42,7 @@ extern int errno;
42#define sinh(x) ((exp(x)-exp(-x))*0.5) 42#define sinh(x) ((exp(x)-exp(-x))*0.5)
43#endif /* VMS */ 43#endif /* VMS */
44 44
45static float_error (); 45static SIGTYPE float_error ();
46 46
47/* Nonzero while executing in floating point. 47/* Nonzero while executing in floating point.
48 This tells float_error what to do. */ 48 This tells float_error what to do. */
@@ -60,8 +60,8 @@ static Lisp_Object float_error_arg;
60 Handle errors which may result in signals or may set errno. */ 60 Handle errors which may result in signals or may set errno. */
61 61
62#define IN_FLOAT(D, NUM) \ 62#define IN_FLOAT(D, NUM) \
63(in_float = 1, errno = 0, float_error_arg = NUM, (D), \ 63(in_float = 1, errno = 0, float_error_arg = NUM, (D), \
64 (errno == ERANGE || errno == EDOM ? float_error () : 0), \ 64 (errno == ERANGE || errno == EDOM ? float_error () : (SIGTYPE) 0), \
65 in_float = 0) 65 in_float = 0)
66 66
67/* Extract a Lisp number as a `double', or signal an error. */ 67/* Extract a Lisp number as a `double', or signal an error. */
@@ -498,7 +498,7 @@ Rounds the value toward zero.")
498 return num; 498 return num;
499} 499}
500 500
501static 501static SIGTYPE
502float_error (signo) 502float_error (signo)
503 int signo; 503 int signo;
504{ 504{
diff --git a/src/lisp.h b/src/lisp.h
index 1e5d4bf9365..c7dd07058eb 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1,11 +1,11 @@
1/* Fundamental definitions for GNU Emacs Lisp interpreter. 1/* Fundamental definitions for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -506,15 +506,19 @@ typedef unsigned char UCHAR;
506 506
507/* Data type checking */ 507/* Data type checking */
508 508
509#ifdef NULL
510#undef NULL
511#endif
512#define NILP(x) (XFASTINT (x) == XFASTINT (Qnil)) 509#define NILP(x) (XFASTINT (x) == XFASTINT (Qnil))
513 510
511#ifdef LISP_FLOAT_TYPE
512#define NUMBERP(x) (XTYPE (x) == Lisp_Int || XTYPE (x) == Lisp_Float)
513#else
514#define NUMBERP(x) (XTYPE (x) == Lisp_Int)
515#endif
516
514/* #define LISTP(x) (XTYPE ((x)) == Lisp_Cons)*/ 517/* #define LISTP(x) (XTYPE ((x)) == Lisp_Cons)*/
515#define CONSP(x) (XTYPE ((x)) == Lisp_Cons) 518#define CONSP(x) (XTYPE ((x)) == Lisp_Cons)
516#define EQ(x, y) (XFASTINT (x) == XFASTINT (y)) 519#define EQ(x, y) (XFASTINT (x) == XFASTINT (y))
517 520
521
518#define CHECK_LIST(x, i) \ 522#define CHECK_LIST(x, i) \
519 { if ((XTYPE ((x)) != Lisp_Cons) && !NILP (x)) x = wrong_type_argument (Qlistp, (x)); } 523 { if ((XTYPE ((x)) != Lisp_Cons) && !NILP (x)) x = wrong_type_argument (Qlistp, (x)); }
520 524
diff --git a/src/lread.c b/src/lread.c
index 78d578758b0..c3157c8d618 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1448,14 +1448,15 @@ init_lread ()
1448 uses ../lisp, instead of the path of the installed elisp 1448 uses ../lisp, instead of the path of the installed elisp
1449 libraries. However, if it appears that Vload_path was changed 1449 libraries. However, if it appears that Vload_path was changed
1450 from the default before dumping, don't override that value. */ 1450 from the default before dumping, don't override that value. */
1451 { 1451 if (initialized)
1452 Lisp_Object normal_path; 1452 {
1453 1453 Lisp_Object dump_path;
1454 normal_path = decode_env_path ("", normal);
1455 1454
1456 if ( 1455 dump_path = decode_env_path ("", PATH_DUMPLOADSEARCH);
1457 if (initialized 1456 if (! NILP (Fequal (dump_path, Vload_path)))
1458 || EQ (Vload_path, initial_path)) 1457 Vload_path = decode_env_path ("", normal);
1458 }
1459 else
1459 Vload_path = decode_env_path ("", normal); 1460 Vload_path = decode_env_path ("", normal);
1460#endif 1461#endif
1461 1462
@@ -1487,11 +1488,6 @@ init_lread ()
1487 1488
1488 Vvalues = Qnil; 1489 Vvalues = Qnil;
1489 1490
1490 if (initialized)
1491 initial_path = Qnil;
1492 else
1493 initial_path = Vload_path;
1494
1495 load_in_progress = 0; 1491 load_in_progress = 0;
1496} 1492}
1497 1493
diff --git a/src/print.c b/src/print.c
index b65db9aedc6..8ab40735e38 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1,11 +1,11 @@
1/* Lisp object printing and output streams. 1/* Lisp object printing and output streams.
2 Copyright (C) 1985, 1986, 1988 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1988, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -566,12 +566,12 @@ Output stream is STREAM, or value of `standard-output' (which see).")
566 for the convenience of the debugger. */ 566 for the convenience of the debugger. */
567Lisp_Object Qexternal_debugging_output; 567Lisp_Object Qexternal_debugging_output;
568 568
569DEFUN ("external-debugging-output", 569DEFUN ("external-debugging-output", Fexternal_debugging_output, Sexternal_debugging_output, 1, 1, 0,
570 Fexternal_debugging_output, Sexternal_debugging_output, 570 "Write CHARACTER to stderr.\n\
571 1, 1, 0, "Write CHARACTER to stderr.\n\
572You can call print while debugging emacs, and pass it this function\n\ 571You can call print while debugging emacs, and pass it this function\n\
573to make it write to the debugging output.\n") 572to make it write to the debugging output.\n")
574 (Lisp_Object character) 573 (character)
574 Lisp_Object character;
575{ 575{
576 CHECK_NUMBER (character, 0); 576 CHECK_NUMBER (character, 0);
577 putc (XINT (character), stderr); 577 putc (XINT (character), stderr);
diff --git a/src/process.c b/src/process.c
index 1bdc27be91b..442cae6d159 100644
--- a/src/process.c
+++ b/src/process.c
@@ -403,7 +403,7 @@ status_message (status)
403} 403}
404 404
405#ifdef HAVE_PTYS 405#ifdef HAVE_PTYS
406static pty_process; 406static int pty_process;
407 407
408/* Open an available pty, returning a file descriptor. 408/* Open an available pty, returning a file descriptor.
409 Return -1 on failure. 409 Return -1 on failure.
@@ -1803,6 +1803,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
1803 if (read_kbd && detect_input_pending ()) 1803 if (read_kbd && detect_input_pending ())
1804 break; 1804 break;
1805 1805
1806#ifdef SIGIO
1806 /* If we think we have keyboard input waiting, but didn't get SIGIO 1807 /* If we think we have keyboard input waiting, but didn't get SIGIO
1807 go read it. This can happen with X on BSD after logging out. 1808 go read it. This can happen with X on BSD after logging out.
1808 In that case, there really is no input and no SIGIO, 1809 In that case, there really is no input and no SIGIO,
@@ -1813,6 +1814,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
1813 */ 1814 */
1814 if (read_kbd && interrupt_input && (FD_ISSET (fileno (stdin), &Available))) 1815 if (read_kbd && interrupt_input && (FD_ISSET (fileno (stdin), &Available)))
1815 kill (0, SIGIO); 1816 kill (0, SIGIO);
1817#endif
1816 1818
1817#ifdef vipc 1819#ifdef vipc
1818 /* Check for connection from other process */ 1820 /* Check for connection from other process */
@@ -2106,12 +2108,14 @@ send_process (proc, buf, len)
2106 while (len > 0) 2108 while (len > 0)
2107 { 2109 {
2108 int this = len; 2110 int this = len;
2111 SIGTYPE (*old_sigpipe)();
2112
2109 /* Don't send more than 500 bytes at a time. */ 2113 /* Don't send more than 500 bytes at a time. */
2110 if (this > 500) 2114 if (this > 500)
2111 this = 500; 2115 this = 500;
2112 signal (SIGPIPE, send_process_trap); 2116 old_sigpipe = signal (SIGPIPE, send_process_trap);
2113 rv = write (XFASTINT (XPROCESS (proc)->outfd), buf, this); 2117 rv = write (XFASTINT (XPROCESS (proc)->outfd), buf, this);
2114 signal (SIGPIPE, SIG_DFL); 2118 signal (SIGPIPE, old_sigpipe);
2115 if (rv < 0) 2119 if (rv < 0)
2116 { 2120 {
2117 if (0 2121 if (0
diff --git a/src/ralloc.c b/src/ralloc.c
index fe22ae4ffe1..927c2dd5477 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -27,6 +27,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
27#include "lisp.h" /* Needed for VALBITS. */ 27#include "lisp.h" /* Needed for VALBITS. */
28#undef NULL 28#undef NULL
29#include "mem_limits.h" 29#include "mem_limits.h"
30#include "getpagesize.h"
30 31
31#define NIL ((POINTER) 0) 32#define NIL ((POINTER) 0)
32 33
diff --git a/src/s/hpux.h b/src/s/hpux.h
index 33de0875602..e146501004c 100644
--- a/src/s/hpux.h
+++ b/src/s/hpux.h
@@ -228,6 +228,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
228#define HAVE_GETTIMEOFDAY 228#define HAVE_GETTIMEOFDAY
229#define HAVE_VFORK 229#define HAVE_VFORK
230#define HAVE_PERROR /* Delete this line for version 6. */ 230#define HAVE_PERROR /* Delete this line for version 6. */
231#define HAVE_RENAME
231 232
232/* The following maps shared exec file to demand loaded exec. 233/* The following maps shared exec file to demand loaded exec.
233 Don't do this as demand loaded exec is broken in hpux. */ 234 Don't do this as demand loaded exec is broken in hpux. */
@@ -253,8 +254,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
253 254
254/* This is how to get the device name of the tty end of a pty. */ 255/* This is how to get the device name of the tty end of a pty. */
255#define PTY_TTY_NAME_SPRINTF \ 256#define PTY_TTY_NAME_SPRINTF \
256 sprintf (ptyname, "/dev/pty/tty%c%x", c, i); 257 sprintf (pty_name, "/dev/pty/tty%c%x", c, i);
257 258
258/* This is how to get the device name of the control end of a pty. */ 259/* This is how to get the device name of the control end of a pty. */
259#define PTY_NAME_SPRINTF \ 260#define PTY_NAME_SPRINTF \
260 sprintf (ptyname, "/dev/ptym/pty%c%x", c, i); 261 sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);
diff --git a/src/search.c b/src/search.c
index cad14a47560..46ff1ec7e77 100644
--- a/src/search.c
+++ b/src/search.c
@@ -23,6 +23,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
23#include "syntax.h" 23#include "syntax.h"
24#include "buffer.h" 24#include "buffer.h"
25#include "commands.h" 25#include "commands.h"
26
26#include <sys/types.h> 27#include <sys/types.h>
27#include "regex.h" 28#include "regex.h"
28 29
@@ -39,9 +40,14 @@ char search_fastmap[0400];
39 40
40Lisp_Object last_regexp; 41Lisp_Object last_regexp;
41 42
42/* Every call to re_match, etc., must pass &search_regs as the regs argument 43/* Every call to re_match, etc., must pass &search_regs as the regs
43 unless you can show it is unnecessary (i.e., if re_match is certainly going 44 argument unless you can show it is unnecessary (i.e., if re_match
44 to be called again before region-around-match can be called). */ 45 is certainly going to be called again before region-around-match
46 can be called).
47
48 Since the registers are now dynamically allocated, we need to make
49 sure not to refer to the Nth register before checking that it has
50 been allocated. */
45 51
46static struct re_registers search_regs; 52static struct re_registers search_regs;
47 53
@@ -147,7 +153,7 @@ DEFUN ("looking-at", Flooking_at, Slooking_at, 1, 1, 0,
147 matcher_overflow (); 153 matcher_overflow ();
148 154
149 val = (0 <= i ? Qt : Qnil); 155 val = (0 <= i ? Qt : Qnil);
150 for (i = 0; i < RE_NREGS; i++) 156 for (i = 0; i < search_regs.num_regs; i++)
151 if (search_regs.start[i] >= 0) 157 if (search_regs.start[i] >= 0)
152 { 158 {
153 search_regs.start[i] += BEGV; 159 search_regs.start[i] += BEGV;
@@ -489,7 +495,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt)
489 /* generality of an RE search is */ 495 /* generality of an RE search is */
490 /* really needed. */ 496 /* really needed. */
491 /* first item is "exact match" */ 497 /* first item is "exact match" */
492 && *(searchbuf.buffer) == RE_EXACTN_VALUE 498 && *(searchbuf.buffer) == (char) RE_EXACTN_VALUE
493 && searchbuf.buffer[1] + 2 == searchbuf.used) /*first is ONLY item */ 499 && searchbuf.buffer[1] + 2 == searchbuf.used) /*first is ONLY item */
494 { 500 {
495 RE = 0; /* can do straight (non RE) search */ 501 RE = 0; /* can do straight (non RE) search */
@@ -542,7 +548,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt)
542 if (val >= 0) 548 if (val >= 0)
543 { 549 {
544 j = BEGV; 550 j = BEGV;
545 for (i = 0; i < RE_NREGS; i++) 551 for (i = 0; i < search_regs.num_regs; i++)
546 if (search_regs.start[i] >= 0) 552 if (search_regs.start[i] >= 0)
547 { 553 {
548 search_regs.start[i] += j; 554 search_regs.start[i] += j;
@@ -569,7 +575,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt)
569 if (val >= 0) 575 if (val >= 0)
570 { 576 {
571 j = BEGV; 577 j = BEGV;
572 for (i = 0; i < RE_NREGS; i++) 578 for (i = 0; i < search_regs.num_regs; i++)
573 if (search_regs.start[i] >= 0) 579 if (search_regs.start[i] >= 0)
574 { 580 {
575 search_regs.start[i] += j; 581 search_regs.start[i] += j;
@@ -996,6 +1002,10 @@ Leaves point at end of replacement text.")
996 1002
997 case_action = nochange; /* We tried an initialization */ 1003 case_action = nochange; /* We tried an initialization */
998 /* but some C compilers blew it */ 1004 /* but some C compilers blew it */
1005
1006 if (search_regs.num_regs <= 0)
1007 error ("replace-match called before any match found");
1008
999 if (search_regs.start[0] < BEGV 1009 if (search_regs.start[0] < BEGV
1000 || search_regs.start[0] > search_regs.end[0] 1010 || search_regs.start[0] > search_regs.end[0]
1001 || search_regs.end[0] > ZV) 1011 || search_regs.end[0] > ZV)
@@ -1068,7 +1078,7 @@ Leaves point at end of replacement text.")
1068 Finsert_buffer_substring (Fcurrent_buffer (), 1078 Finsert_buffer_substring (Fcurrent_buffer (),
1069 make_number (search_regs.start[0]), 1079 make_number (search_regs.start[0]),
1070 make_number (search_regs.end[0])); 1080 make_number (search_regs.end[0]));
1071 else if (c >= '1' && c <= RE_NREGS + '0') 1081 else if (c >= '1' && c <= search_regs.num_regs + '0')
1072 { 1082 {
1073 if (search_regs.start[c - '0'] >= 1) 1083 if (search_regs.start[c - '0'] >= 1)
1074 Finsert_buffer_substring (Fcurrent_buffer (), 1084 Finsert_buffer_substring (Fcurrent_buffer (),
@@ -1103,9 +1113,10 @@ match_limit (num, beginningp)
1103 1113
1104 CHECK_NUMBER (num, 0); 1114 CHECK_NUMBER (num, 0);
1105 n = XINT (num); 1115 n = XINT (num);
1106 if (n < 0 || n >= RE_NREGS) 1116 if (n < 0 || n >= search_regs.num_regs)
1107 args_out_of_range (num, make_number (RE_NREGS)); 1117 args_out_of_range (num, make_number (search_regs.num_regs));
1108 if (search_regs.start[n] < 0) 1118 if (search_regs.num_regs <= 0
1119 || search_regs.start[n] < 0)
1109 return Qnil; 1120 return Qnil;
1110 return (make_number ((beginningp) ? search_regs.start[n] 1121 return (make_number ((beginningp) ? search_regs.start[n]
1111 : search_regs.end[n])); 1122 : search_regs.end[n]));
@@ -1141,11 +1152,14 @@ if the last match was on a buffer; integers or nil if a string was matched.\n\
1141Use `store-match-data' to reinstate the data in this list.") 1152Use `store-match-data' to reinstate the data in this list.")
1142 () 1153 ()
1143{ 1154{
1144 Lisp_Object data[2 * RE_NREGS]; 1155 Lisp_Object *data;
1145 int i, len; 1156 int i, len;
1146 1157
1158 data = (Lisp_Object *) alloca ((2 * search_regs.num_regs)
1159 * sizeof (Lisp_Object));
1160
1147 len = -1; 1161 len = -1;
1148 for (i = 0; i < RE_NREGS; i++) 1162 for (i = 0; i < search_regs.num_regs; i++)
1149 { 1163 {
1150 int start = search_regs.start[i]; 1164 int start = search_regs.start[i];
1151 if (start >= 0) 1165 if (start >= 0)
@@ -1184,7 +1198,30 @@ LIST should have been created by calling `match-data' previously.")
1184 if (!CONSP (list) && !NILP (list)) 1198 if (!CONSP (list) && !NILP (list))
1185 list = wrong_type_argument (Qconsp, list, 0); 1199 list = wrong_type_argument (Qconsp, list, 0);
1186 1200
1187 for (i = 0; i < RE_NREGS; i++) 1201 /* Allocate registers if they don't already exist. */
1202 {
1203 int length = Flength (list) / 2;
1204
1205 if (length > search_regs.num_regs)
1206 {
1207 if (search_regs.start)
1208 search_regs.start =
1209 (regoff_t *) realloc (search_regs.start,
1210 length * sizeof (regoff_t));
1211 else
1212 search_regs.start = (regoff_t *) malloc (length * sizeof (regoff_t));
1213 if (search_regs.end)
1214 search_regs.end =
1215 (regoff_t *) realloc (search_regs.end,
1216 length * sizeof (regoff_t));
1217 else
1218 search_regs.end = (regoff_t *) malloc (length * sizeof (regoff_t));
1219
1220 search_regs.num_regs = length;
1221 }
1222 }
1223
1224 for (i = 0; i < search_regs.num_regs; i++)
1188 { 1225 {
1189 marker = Fcar (list); 1226 marker = Fcar (list);
1190 if (NILP (marker)) 1227 if (NILP (marker))
diff --git a/src/sysdep.c b/src/sysdep.c
index 1483898478d..03614f98cce 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -110,19 +110,6 @@ extern char *sys_errlist[];
110#endif /* not 4.1 */ 110#endif /* not 4.1 */
111#endif /* BSD */ 111#endif /* BSD */
112 112
113#ifdef AIX
114/* Get files for keyboard remapping */
115#define HFNKEYS 2
116#include <sys/hft.h>
117#include <sys/devinfo.h>
118#endif
119
120/* Get rid of LLITOUT in 4.1, since it is said to stimulate kernel bugs. */
121#ifdef BSD4_1
122#undef LLITOUT
123#define LLITOUT 0
124#endif /* 4.1 */
125
126#ifdef BROKEN_TIOCGWINSZ 113#ifdef BROKEN_TIOCGWINSZ
127#undef TIOCGWINSZ 114#undef TIOCGWINSZ
128#endif 115#endif
@@ -144,31 +131,6 @@ extern char *sys_errlist[];
144#endif /* TIOCGWINSZ */ 131#endif /* TIOCGWINSZ */
145#endif /* USG */ 132#endif /* USG */
146 133
147#ifdef NEED_BSDTTY
148#include <sys/bsdtty.h>
149#endif
150
151#if defined (HPUX) && defined (HAVE_PTYS)
152#include <sys/ptyio.h>
153#endif
154
155#ifdef AIX
156#include <sys/pty.h>
157#include <unistd.h>
158#endif /* AIX */
159
160#ifdef SYSV_PTYS
161#include <sys/tty.h>
162#include <sys/pty.h>
163#endif
164
165/* saka@pfu.fujitsu.co.JP writes:
166 FASYNC defined in this file. But, FASYNC don't working.
167 so no problem, because unrequest_sigio only need. */
168#if defined (pfa)
169#include <sys/file.h>
170#endif
171
172extern int quit_char; 134extern int quit_char;
173 135
174#include "screen.h" 136#include "screen.h"
@@ -2348,6 +2310,8 @@ getwd (pathname)
2348 * that files be of same type (regular->regular, dir->dir, etc). 2310 * that files be of same type (regular->regular, dir->dir, etc).
2349 */ 2311 */
2350 2312
2313#ifndef HAVE_RENAME
2314
2351rename (from, to) 2315rename (from, to)
2352 char *from; 2316 char *from;
2353 char *to; 2317 char *to;
@@ -2362,9 +2326,11 @@ rename (from, to)
2362 return (-1); 2326 return (-1);
2363} 2327}
2364 2328
2329#endif
2330
2365/* Set priority value to PRIO. */ 2331/* Set priority value to PRIO. */
2366 2332
2367void 2333int
2368setpriority (which, who, prio) 2334setpriority (which, who, prio)
2369 int which, who, prio; 2335 int which, who, prio;
2370{ 2336{
diff --git a/src/systty.h b/src/systty.h
index 07f12eb33d1..4bbf021595d 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -33,6 +33,44 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
33#endif /* not HAVE_TERMIOS */ 33#endif /* not HAVE_TERMIOS */
34#endif /* not HAVE_TERMIO */ 34#endif /* not HAVE_TERMIO */
35 35
36#ifdef AIX
37/* Get files for keyboard remapping */
38#define HFNKEYS 2
39#include <sys/hft.h>
40#include <sys/devinfo.h>
41#endif
42
43/* Get rid of LLITOUT in 4.1, since it is said to stimulate kernel bugs. */
44#ifdef BSD4_1
45#undef LLITOUT
46#define LLITOUT 0
47#endif /* 4.1 */
48
49#ifdef NEED_BSDTTY
50#include <sys/bsdtty.h>
51#endif
52
53#if defined (HPUX) && defined (HAVE_PTYS)
54#include <sys/ptyio.h>
55#endif
56
57#ifdef AIX
58#include <sys/pty.h>
59#include <unistd.h>
60#endif /* AIX */
61
62#ifdef SYSV_PTYS
63#include <sys/tty.h>
64#include <sys/pty.h>
65#endif
66
67/* saka@pfu.fujitsu.co.JP writes:
68 FASYNC defined in this file. But, FASYNC don't working.
69 so no problem, because unrequest_sigio only need. */
70#if defined (pfa)
71#include <sys/file.h>
72#endif
73
36 74
37/* Special cases - inhibiting the use of certain features. */ 75/* Special cases - inhibiting the use of certain features. */
38 76
@@ -184,6 +222,13 @@ struct emacs_tty {
184 (tcsetattr ((fd), (waitp) ? TCSAFLUSH : TCSADRAIN, &(p)->main) != -1) 222 (tcsetattr ((fd), (waitp) ? TCSAFLUSH : TCSADRAIN, &(p)->main) != -1)
185 223
186#else 224#else
225#ifdef HAVE_TERMIO
226
227#define EMACS_GET_TTY_1(fd, p) (ioctl ((fd), TCGETA, &(p)->main) != -1)
228#define EMACS_SET_TTY_1(fd, p, waitp) \
229 (ioctl ((fd), (waitp) ? TCSETAW : TCSETAF, &(p)->main) != -1)
230
231#else
187#ifdef VMS 232#ifdef VMS
188 233
189/* These definitions will really only work in sysdep.c, because of their 234/* These definitions will really only work in sysdep.c, because of their
@@ -203,6 +248,7 @@ struct emacs_tty {
203 248
204#endif 249#endif
205#endif 250#endif
251#endif
206 252
207#ifdef TIOCGLTC 253#ifdef TIOCGLTC
208 struct ltchars ltchars; 254 struct ltchars ltchars;
diff --git a/src/term.c b/src/term.c
index c23723217e5..e9f7ddbcd18 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1,11 +1,11 @@
1/* terminal control module for terminals described by TERMCAP 1/* terminal control module for terminals described by TERMCAP
2 Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -465,6 +465,7 @@ change_line_highlight (new_highlight, vpos, first_unused_hpos)
465/* Move to absolute position, specified origin 0 */ 465/* Move to absolute position, specified origin 0 */
466 466
467cursor_to (row, col) 467cursor_to (row, col)
468 int row, col;
468{ 469{
469 if (! SCREEN_IS_TERMCAP ((updating_screen 470 if (! SCREEN_IS_TERMCAP ((updating_screen
470 ? updating_screen 471 ? updating_screen
@@ -488,6 +489,7 @@ cursor_to (row, col)
488/* Similar but don't take any account of the wasted characters. */ 489/* Similar but don't take any account of the wasted characters. */
489 490
490raw_cursor_to (row, col) 491raw_cursor_to (row, col)
492 int row, col;
491{ 493{
492 if (! SCREEN_IS_TERMCAP ((updating_screen ? updating_screen : selected_screen))) 494 if (! SCREEN_IS_TERMCAP ((updating_screen ? updating_screen : selected_screen)))
493 { 495 {
@@ -1393,6 +1395,7 @@ It may be necessary to do `unsetenv TERMCAP' as well.\n",
1393 1395
1394/* VARARGS 1 */ 1396/* VARARGS 1 */
1395fatal (str, arg1, arg2) 1397fatal (str, arg1, arg2)
1398 char *str, *arg1, *arg2;
1396{ 1399{
1397 fprintf (stderr, "emacs: "); 1400 fprintf (stderr, "emacs: ");
1398 fprintf (stderr, str, arg1, arg2); 1401 fprintf (stderr, str, arg1, arg2);
diff --git a/src/xfns.c b/src/xfns.c
index 4f3a7ff9e2b..d3943a5f779 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1,11 +1,11 @@
1/* Functions for the X window system. 1/* Functions for the X window system.
2 Copyright (C) 1989 Free Software Foundation. 2 Copyright (C) 1989, 1992 Free Software Foundation.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -3950,7 +3950,8 @@ also be depressed for NEWSTRING to appear.")
3950 register Lisp_Object newstring; 3950 register Lisp_Object newstring;
3951{ 3951{
3952 char *rawstring; 3952 char *rawstring;
3953 register KeySym keysym, modifier_list[16]; 3953 register KeySym keysym;
3954 KeySym modifier_list[16];
3954 3955
3955 CHECK_STRING (x_keysym, 1); 3956 CHECK_STRING (x_keysym, 1);
3956 CHECK_STRING (newstring, 3); 3957 CHECK_STRING (newstring, 3);
diff --git a/src/xterm.c b/src/xterm.c
index 05ad3bc588d..1df1c7d36ba 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1,11 +1,11 @@
1/* X Communication module for terminals which understand the X protocol. 1/* X Communication module for terminals which understand the X protocol.
2 Copyright (C) 1989 Free Software Foundation, Inc. 2 Copyright (C) 1989, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -258,8 +258,8 @@ static void dumpqueue ();
258#endif 258#endif
259 259
260void dumpborder (); 260void dumpborder ();
261static XTcursor_to (); 261static int XTcursor_to ();
262static XTclear_end_of_line (); 262static int XTclear_end_of_line ();
263 263
264/* These hooks are called by update_screen at the beginning and end 264/* These hooks are called by update_screen at the beginning and end
265 of a screen update. We record in `updating_screen' the identity 265 of a screen update. We record in `updating_screen' the identity
@@ -361,7 +361,7 @@ XTreset_terminal_modes ()
361 where display update commands will take effect. 361 where display update commands will take effect.
362 This does not affect the place where the cursor-box is displayed. */ 362 This does not affect the place where the cursor-box is displayed. */
363 363
364static 364static int
365XTcursor_to (row, col) 365XTcursor_to (row, col)
366 register int row, col; 366 register int row, col;
367{ 367{
@@ -582,7 +582,7 @@ XTwrite_glyphs (start, len)
582 to column FIRST_UNUSED (exclusive). The idea is that everything 582 to column FIRST_UNUSED (exclusive). The idea is that everything
583 from FIRST_UNUSED onward is already erased. */ 583 from FIRST_UNUSED onward is already erased. */
584 584
585static 585static int
586XTclear_end_of_line (first_unused) 586XTclear_end_of_line (first_unused)
587 register int first_unused; 587 register int first_unused;
588{ 588{
@@ -2775,6 +2775,19 @@ x_text_icon (s, icon_name)
2775 return 0; 2775 return 0;
2776} 2776}
2777 2777
2778/* Handling X errors. */
2779
2780/* A handler for SIGPIPE, when it occurs on the X server's connection.
2781 This basically does an orderly shutdown of Emacs. */
2782static SIGTYPE
2783x_death_handler ()
2784{
2785 if (_Xdebug)
2786 abort ();
2787 else
2788 Fkill_emacs (make_number (70));
2789}
2790
2778static char *x_proto_requests[] = 2791static char *x_proto_requests[] =
2779{ 2792{
2780 "CreateWindow", 2793 "CreateWindow",
@@ -2961,14 +2974,9 @@ x_error_handler (disp, event)
2961 } 2974 }
2962 UNBLOCK_INPUT; 2975 UNBLOCK_INPUT;
2963 2976
2964 if (_Xdebug) 2977 x_death_handler ();
2965 abort ();
2966 else
2967 Fkill_emacs (make_number (70));
2968} 2978}
2969 2979
2970/* Initialize communication with the X window server. */
2971
2972#if 0 2980#if 0
2973static unsigned int x_wire_count; 2981static unsigned int x_wire_count;
2974x_trace_wire () 2982x_trace_wire ()
@@ -3740,7 +3748,7 @@ x_term_init (display_name)
3740 signal (SIGWINCH, SIG_DFL); 3748 signal (SIGWINCH, SIG_DFL);
3741#endif /* SIGWINCH */ 3749#endif /* SIGWINCH */
3742 3750
3743 signal (SIGPIPE, x_error_handler); 3751 signal (SIGPIPE, x_death_handler);
3744} 3752}
3745 3753
3746void 3754void