aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-03-21 12:42:16 -0400
committerStefan Monnier2011-03-21 12:42:16 -0400
commitcafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch)
tree7ee0c41ea8a589650ce6f4311fb10e61a63807b9
parenta08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff)
parent4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff)
downloademacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz
emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.zip
Merge from trunk
-rw-r--r--ChangeLog30
-rw-r--r--INSTALL.BZR27
-rw-r--r--Makefile.in2
-rw-r--r--admin/admin.el230
-rw-r--r--admin/make-tarball.txt9
-rw-r--r--admin/notes/BRANCH7
-rw-r--r--admin/notes/elpa62
-rwxr-xr-xautogen.sh208
-rw-r--r--autogen/Makefile.in (renamed from lib/Makefile.in)2
-rw-r--r--autogen/README14
-rw-r--r--autogen/aclocal.m4 (renamed from aclocal.m4)4
-rw-r--r--autogen/config.in (renamed from src/config.in)3
-rwxr-xr-xautogen/configure (renamed from configure)486
-rwxr-xr-xautogen/copy_autogen20
-rwxr-xr-xautogen/update_autogen183
-rw-r--r--configure.in9
-rw-r--r--doc/emacs/ChangeLog37
-rw-r--r--doc/emacs/Makefile.in2
-rw-r--r--doc/emacs/ack.texi26
-rw-r--r--doc/emacs/building.texi2
-rw-r--r--doc/emacs/custom.texi2
-rw-r--r--doc/emacs/display.texi3
-rw-r--r--doc/emacs/emacs.texi26
-rw-r--r--doc/emacs/makefile.w32-in2
-rw-r--r--doc/emacs/msdog.texi53
-rw-r--r--doc/emacs/mule.texi2
-rw-r--r--doc/emacs/search.texi8
-rw-r--r--doc/emacs/xresources.texi7
-rw-r--r--doc/lispref/ChangeLog.trunk34
-rw-r--r--doc/lispref/Makefile.in2
-rw-r--r--doc/lispref/elisp.texi2
-rw-r--r--doc/lispref/intro.texi4
-rw-r--r--doc/lispref/keymaps.texi14
-rw-r--r--doc/lispref/makefile.w32-in3
-rw-r--r--doc/lispref/modes.texi2
-rw-r--r--doc/lispref/nonascii.texi2
-rw-r--r--doc/lispref/package.texi101
-rw-r--r--doc/lispref/strings.texi4
-rw-r--r--doc/misc/ChangeLog51
-rw-r--r--doc/misc/Makefile.in13
-rw-r--r--doc/misc/auth.texi74
-rw-r--r--doc/misc/calc.texi235
-rw-r--r--doc/misc/message.texi28
-rw-r--r--doc/misc/tramp.texi29
-rw-r--r--doc/misc/trampver.texi2
-rw-r--r--etc/ChangeLog20
-rw-r--r--etc/NEWS36
-rw-r--r--etc/themes/tsdh-dark-theme.el6
-rw-r--r--etc/themes/tsdh-light-theme.el7
-rw-r--r--etc/themes/wombat-theme.el108
-rw-r--r--lib-src/ChangeLog2
-rw-r--r--lib/gnulib.mk2
-rw-r--r--lib/sys_stat.in.h16
-rw-r--r--lisp/ChangeLog.trunk420
-rw-r--r--lisp/allout-widgets.el4
-rw-r--r--lisp/allout.el99
-rw-r--r--lisp/avoid.el16
-rw-r--r--lisp/calc/README2
-rw-r--r--lisp/calc/calc-ext.el31
-rw-r--r--lisp/calc/calc-help.el4
-rw-r--r--lisp/calc/calc-menu.el105
-rw-r--r--lisp/calc/calc-units.el114
-rw-r--r--lisp/calc/calc.el6
-rw-r--r--lisp/calendar/cal-hebrew.el12
-rw-r--r--lisp/calendar/time-date.el8
-rw-r--r--lisp/cus-edit.el6
-rw-r--r--lisp/cus-start.el6
-rw-r--r--lisp/cus-theme.el10
-rw-r--r--lisp/custom.el18
-rw-r--r--lisp/dired-aux.el5
-rw-r--r--lisp/dired.el3
-rw-r--r--lisp/ebuff-menu.el101
-rw-r--r--lisp/emacs-lisp/bytecomp.el14
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el8
-rw-r--r--lisp/emacs-lisp/ert.el9
-rw-r--r--lisp/emacs-lisp/package-x.el255
-rw-r--r--lisp/emacs-lisp/package.el177
-rw-r--r--lisp/eshell/esh-opt.el55
-rw-r--r--lisp/eshell/esh-util.el3
-rw-r--r--lisp/facemenu.el37
-rw-r--r--lisp/files.el10
-rw-r--r--lisp/font-lock.el2
-rw-r--r--lisp/gnus/ChangeLog228
-rw-r--r--lisp/gnus/auth-source.el314
-rw-r--r--lisp/gnus/gnus-art.el14
-rw-r--r--lisp/gnus/gnus-group.el33
-rw-r--r--lisp/gnus/gnus-int.el4
-rw-r--r--lisp/gnus/gnus-start.el26
-rw-r--r--lisp/gnus/gnus-sum.el56
-rw-r--r--lisp/gnus/gnus-sync.el12
-rw-r--r--lisp/gnus/gnus-util.el6
-rw-r--r--lisp/gnus/gnus-win.el6
-rw-r--r--lisp/gnus/gravatar.el6
-rw-r--r--lisp/gnus/gssapi.el105
-rw-r--r--lisp/gnus/message.el18
-rw-r--r--lisp/gnus/mm-uu.el8
-rw-r--r--lisp/gnus/nnimap.el68
-rw-r--r--lisp/gnus/shr.el15
-rw-r--r--lisp/gnus/sieve-manage.el7
-rw-r--r--lisp/help-fns.el1
-rw-r--r--lisp/help.el12
-rw-r--r--lisp/ido.el8
-rw-r--r--lisp/info.el10
-rw-r--r--lisp/mail/rmail.el4
-rw-r--r--lisp/minibuffer.el10
-rw-r--r--lisp/net/ldap.el43
-rw-r--r--lisp/net/quickurl.el10
-rw-r--r--lisp/net/rcirc.el7
-rw-r--r--lisp/net/tramp-sh.el42
-rw-r--r--lisp/net/trampver.el4
-rw-r--r--lisp/net/xesam.el8
-rw-r--r--lisp/notifications.el4
-rw-r--r--lisp/org/ChangeLog10
-rw-r--r--lisp/org/ob-exp.el14
-rw-r--r--lisp/org/ob-ref.el12
-rw-r--r--lisp/org/ob-sql.el22
-rw-r--r--lisp/org/org-freemind.el6
-rw-r--r--lisp/org/org-mouse.el10
-rw-r--r--lisp/org/org-plot.el24
-rw-r--r--lisp/org/org-src.el14
-rw-r--r--lisp/play/bubbles.el50
-rw-r--r--lisp/play/gamegrid.el10
-rw-r--r--lisp/play/morse.el108
-rw-r--r--lisp/progmodes/cc-cmds.el19
-rw-r--r--lisp/progmodes/compile.el49
-rw-r--r--lisp/progmodes/delphi.el75
-rw-r--r--lisp/progmodes/ebrowse.el12
-rw-r--r--lisp/progmodes/gdb-mi.el45
-rw-r--r--lisp/progmodes/gud.el4
-rw-r--r--lisp/progmodes/ruby-mode.el2
-rw-r--r--lisp/server.el8
-rw-r--r--lisp/shell.el22
-rw-r--r--lisp/simple.el6
-rw-r--r--lisp/startup.el45
-rw-r--r--lisp/subr.el36
-rw-r--r--lisp/textmodes/texinfo.el7
-rw-r--r--lisp/vc/diff-mode.el21
-rw-r--r--lisp/vc/emerge.el23
-rw-r--r--lisp/vc/vc-bzr.el9
-rw-r--r--lisp/vc/vc-dir.el6
-rw-r--r--lisp/vc/vc-git.el22
-rw-r--r--lisp/vc/vc-hg.el13
-rw-r--r--lisp/vc/vc.el7
-rw-r--r--src/.gdbinit4
-rw-r--r--src/ChangeLog.trunk797
-rw-r--r--src/alloc.c90
-rw-r--r--src/bidi.c3
-rw-r--r--src/buffer.c283
-rw-r--r--src/buffer.h72
-rw-r--r--src/bytecode.c16
-rw-r--r--src/callint.c28
-rw-r--r--src/casefiddle.c31
-rw-r--r--src/casetab.c6
-rw-r--r--src/category.c4
-rw-r--r--src/ccl.c57
-rw-r--r--src/character.c2
-rw-r--r--src/character.h57
-rw-r--r--src/charset.c29
-rw-r--r--src/charset.h7
-rw-r--r--src/chartab.c45
-rw-r--r--src/cm.c9
-rw-r--r--src/cm.h33
-rw-r--r--src/cmds.c6
-rw-r--r--src/coding.c348
-rw-r--r--src/data.c40
-rw-r--r--src/dbusbind.c49
-rw-r--r--src/deps.mk28
-rw-r--r--src/dired.c52
-rw-r--r--src/dispextern.h8
-rw-r--r--src/doc.c36
-rw-r--r--src/editfns.c209
-rw-r--r--src/emacs.c51
-rw-r--r--src/eval.c63
-rw-r--r--src/fileio.c109
-rw-r--r--src/filelock.c10
-rw-r--r--src/floatfns.c17
-rw-r--r--src/fns.c25
-rw-r--r--src/font.c84
-rw-r--r--src/fontset.c17
-rw-r--r--src/fringe.c20
-rw-r--r--src/gtkutil.c338
-rw-r--r--src/image.c64
-rw-r--r--src/indent.c34
-rw-r--r--src/insdel.c24
-rw-r--r--src/intervals.c16
-rw-r--r--src/keyboard.c244
-rw-r--r--src/keyboard.h11
-rw-r--r--src/keymap.c76
-rw-r--r--src/lisp.h309
-rw-r--r--src/lread.c67
-rw-r--r--src/makefile.w32-in44
-rw-r--r--src/marker.c12
-rw-r--r--src/minibuf.c77
-rw-r--r--src/msdos.c7
-rw-r--r--src/msdos.h2
-rw-r--r--src/nsterm.m18
-rw-r--r--src/print.c26
-rw-r--r--src/process.c19
-rw-r--r--src/regex.c255
-rw-r--r--src/s/aix4-2.h2
-rw-r--r--src/s/cygwin.h3
-rw-r--r--src/s/darwin.h3
-rw-r--r--src/s/gnu-linux.h2
-rw-r--r--src/s/irix6-5.h3
-rw-r--r--src/scroll.c13
-rw-r--r--src/search.c29
-rw-r--r--src/syntax.c19
-rw-r--r--src/sysdep.c37
-rw-r--r--src/systime.h5
-rw-r--r--src/systty.h3
-rw-r--r--src/term.c78
-rw-r--r--src/termcap.c18
-rw-r--r--src/termchar.h93
-rw-r--r--src/termhooks.h3
-rw-r--r--src/terminal.c5
-rw-r--r--src/tparam.c16
-rw-r--r--src/tparam.h31
-rw-r--r--src/unexaix.c9
-rw-r--r--src/unexcoff.c8
-rw-r--r--src/unexcw.c9
-rw-r--r--src/unexec.h1
-rw-r--r--src/unexelf.c28
-rw-r--r--src/unexhp9k800.c6
-rw-r--r--src/unexmacosx.c8
-rw-r--r--src/unexsol.c7
-rw-r--r--src/unexw32.c6
-rw-r--r--src/w32.c5
-rw-r--r--src/w32console.c9
-rw-r--r--src/w32fns.c48
-rw-r--r--src/w32font.c3
-rw-r--r--src/w32inevt.c9
-rw-r--r--src/w32menu.c8
-rw-r--r--src/w32proc.c8
-rw-r--r--src/w32select.c2
-rw-r--r--src/w32term.c14
-rw-r--r--src/w32term.h6
-rw-r--r--src/w32uniscribe.c4
-rw-r--r--src/w32xfns.c2
-rw-r--r--src/window.c53
-rw-r--r--src/window.h1
-rw-r--r--src/xdisp.c65
-rw-r--r--src/xfaces.c90
-rw-r--r--src/xfns.c52
-rw-r--r--src/xgselect.c17
-rw-r--r--src/xmenu.c24
-rw-r--r--src/xrdb.c10
-rw-r--r--src/xselect.c34
-rw-r--r--src/xsmfns.c6
-rw-r--r--src/xterm.c222
-rw-r--r--src/xterm.h14
250 files changed, 7240 insertions, 3902 deletions
diff --git a/ChangeLog b/ChangeLog
index 949862248bd..a58a60465d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
12011-03-20 Glenn Morris <rgm@gnu.org>
2
3 * autogen/: New directory, to be excluded from releases.
4 * autogen/copy_autogen, autogen/update_autogen: New scripts.
5 * autogen/README: New file.
6 * autogen/aclocal.m4, autogen/config.in, autogen/configure:
7 * autogen/Makefile.in: Add auto-updated generated files.
8 * autogen.sh: No longer a no-op, now it tests for autotools
9 and runs them as necessary.
10 * configure.in: Defaule maintainer-mode to on.
11 * aclocal.m4, configure, lib/Makefile.in: Remove files.
12
132011-03-13 Paul Eggert <eggert@cs.ucla.edu>
14
15 Update for gnulib.
16 * Makefile.in (GNULIB_MODULES): Add intprops, as Emacs now
17 includes <intprops.h> directly.
18 * lib/sys_stat.in.h: New version from Gnulib, which fixes a bug
19 when building Emacs on Solaris 9 and running it on Solaris 10.
20
212011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22
23 * configure.in: Require 3.0 for --with-gtk3. Add HAVE_GTK3.
24
12011-03-06 Glenn Morris <rgm@gnu.org> 252011-03-06 Glenn Morris <rgm@gnu.org>
2 26
3 * configure.in (FREETYPE_LIBS): Actually set it to something. 27 * configure.in (FREETYPE_LIBS): Actually set it to something.
@@ -47,7 +71,7 @@
47 71
482011-02-21 Christoph Scholtes <cschol2112@gmail.com> 722011-02-21 Christoph Scholtes <cschol2112@gmail.com>
49 73
50 * lib/makefile.w32-in: ($(BLD)/md5.$(O)): Added dependency on 74 * lib/makefile.w32-in ($(BLD)/md5.$(O)): Added dependency on
51 $(EMACS_ROOT)/nt/inc/stdint.h. 75 $(EMACS_ROOT)/nt/inc/stdint.h.
52 76
532011-02-21 Eli Zaretskii <eliz@gnu.org> 772011-02-21 Eli Zaretskii <eliz@gnu.org>
@@ -86,7 +110,7 @@
86 way to test this so I left it alone. 110 way to test this so I left it alone.
87 * configure: Regenerate. 111 * configure: Regenerate.
88 112
892011-02-20 Christoph Scholtes <cschol2112@gmail.com> 1132011-02-20 Christoph Scholtes <cschol2112@gmail.com>
90 114
91 * lib/makefile.w32-in ($(BLD)/md5.$(O)): New recipe, moved from 115 * lib/makefile.w32-in ($(BLD)/md5.$(O)): New recipe, moved from
92 src/makefile.w32-in. 116 src/makefile.w32-in.
@@ -949,7 +973,7 @@
949 973
9502010-06-28 Jan Djärv <jan.h.d@swipnet.se> 9742010-06-28 Jan Djärv <jan.h.d@swipnet.se>
951 975
952 * configure.in: Add --with-x-toolkit=gtk3. Remove HAVE_GTK_MULTIDISPLAY, 976 * configure.in: Add --with-x-toolkit=gtk3. Remove HAVE_GTK_MULTIDISPLAY,
953 check for gtk_file_chooser_dialog_new, and HAVE_GTK_FILE_BOTH (implied 977 check for gtk_file_chooser_dialog_new, and HAVE_GTK_FILE_BOTH (implied
954 by minimum required Gtk+ 2.6). Add checks for functions introduced 978 by minimum required Gtk+ 2.6). Add checks for functions introduced
955 in Gtk+ 2.14 or newer (bug#6505). 979 in Gtk+ 2.14 or newer (bug#6505).
diff --git a/INSTALL.BZR b/INSTALL.BZR
index 710a73c7048..3859e3cd4fc 100644
--- a/INSTALL.BZR
+++ b/INSTALL.BZR
@@ -4,14 +4,29 @@ See the end of the file for license conditions.
4 4
5 Building and Installing Emacs from Bazaar 5 Building and Installing Emacs from Bazaar
6 6
7If this is the first time you go through it, you'll need to configure 7Building Emacs from Bazaar requires some tools that are not needed
8before bootstrapping: 8when building from a release. You will need:
9 9
10 $ ./configure 10autoconf - at least the version specified near the start of
11 configure.in (in the AC_PREREQ command).
12automake - we recommend at least version 1.11.
13makeinfo - not strictly necessary, but highly recommended, so that
14 you can build the manuals.
15
16The `autogen.sh' script can help you figure out if you have the
17necessary tools.
18
19The first time you build, there are a couple of extra steps.
20First, generate the `configure' script:
21
22 $ ./autogen.sh
11 23
12(Normally there is no need to run `autoconf' etc. If you do need it, 24(or you can just run `autoreconf -I m4').
13the relevant command is `autoreconf -I m4'. Be aware that this will 25
14likely lead to conflicts next time you update from Bazaar.) 26You can then configure your build (use `./configure --help' to see
27options you can set):
28
29 $ ./configure
15 30
16Some of the files that are included in the Emacs tarball, such as 31Some of the files that are included in the Emacs tarball, such as
17byte-compiled Lisp files, are not stored in Bazaar. Therefore, to 32byte-compiled Lisp files, are not stored in Bazaar. Therefore, to
diff --git a/Makefile.in b/Makefile.in
index 7bd4318bfba..19267f82121 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -332,7 +332,7 @@ DOS_gnulib_comp.m4 = gl-comp.m4
332# as per $(gnulib_srcdir)/DEPENDENCIES. 332# as per $(gnulib_srcdir)/DEPENDENCIES.
333GNULIB_MODULES = \ 333GNULIB_MODULES = \
334 crypto/md5 dtoastr filemode getloadavg getopt-gnu \ 334 crypto/md5 dtoastr filemode getloadavg getopt-gnu \
335 ignore-value lstat mktime readlink strftime symlink sys_stat 335 ignore-value intprops lstat mktime readlink strftime symlink sys_stat
336GNULIB_TOOL_FLAGS = \ 336GNULIB_TOOL_FLAGS = \
337 --import --no-changelog --no-vc-files --makefile-name=gnulib.mk 337 --import --no-changelog --no-vc-files --makefile-name=gnulib.mk
338sync-from-gnulib: $(gnulib_srcdir) 338sync-from-gnulib: $(gnulib_srcdir)
diff --git a/admin/admin.el b/admin/admin.el
index 717bfee702d..70958ce1a76 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -212,6 +212,236 @@ Root must be the root of an Emacs source tree."
212 "\\\\def\\\\year{") 212 "\\\\def\\\\year{")
213 "\\([0-9]\\{4\\}\\)}.+%.+copyright year")))))) 213 "\\([0-9]\\{4\\}\\)}.+%.+copyright year"))))))
214 214
215;;; Various bits of magic for generating the web manuals
216
217(defun make-manuals (root)
218 "Generate the web manuals for the Emacs webpage."
219 (interactive "DEmacs root directory: ")
220 (let* ((dest (expand-file-name "manual" root))
221 (html-node-dir (expand-file-name "html_node" dest))
222 (html-mono-dir (expand-file-name "html_mono" dest))
223 (txt-dir (expand-file-name "text" dest))
224 (dvi-dir (expand-file-name "dvi" dest))
225 (ps-dir (expand-file-name "ps" dest)))
226 (when (file-directory-p dest)
227 (if (y-or-n-p (format "Directory %s exists, delete it first?" dest))
228 (delete-directory dest t)
229 (error "Aborted")))
230 (make-directory dest)
231 (make-directory html-node-dir)
232 (make-directory html-mono-dir)
233 (make-directory txt-dir)
234 (make-directory dvi-dir)
235 (make-directory ps-dir)
236 ;; Emacs manual
237 (let ((texi (expand-file-name "doc/emacs/emacs.texi" root)))
238 (manual-html-node texi (expand-file-name "emacs" html-node-dir))
239 (manual-html-mono texi (expand-file-name "emacs.html" html-mono-dir))
240 (manual-txt texi (expand-file-name "emacs.txt" txt-dir))
241 (manual-pdf texi (expand-file-name "emacs.pdf" dest))
242 (manual-dvi texi (expand-file-name "emacs.dvi" dvi-dir)
243 (expand-file-name "emacs.ps" ps-dir)))
244 ;; Lisp manual
245 (let ((texi (expand-file-name "doc/lispref/elisp.texi" root)))
246 (manual-html-node texi (expand-file-name "elisp" html-node-dir))
247 (manual-html-mono texi (expand-file-name "elisp.html" html-mono-dir))
248 (manual-txt texi (expand-file-name "elisp.txt" txt-dir))
249 (manual-pdf texi (expand-file-name "elisp.pdf" dest))
250 (manual-dvi texi (expand-file-name "elisp.dvi" dvi-dir)
251 (expand-file-name "elisp.ps" ps-dir)))
252 (message "Manuals created in %s" dest)))
253
254(defconst manual-doctype-string
255 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
256\"http://www.w3.org/TR/html4/loose.dtd\">\n\n")
257
258(defconst manual-meta-string
259 "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
260<link rev=\"made\" href=\"mailto:webmasters@gnu.org\">
261<link rel=\"icon\" type=\"image/png\" href=\"/graphics/gnu-head-mini.png\">
262<meta name=\"ICBM\" content=\"42.256233,-71.006581\">
263<meta name=\"DC.title\" content=\"gnu.org\">\n\n")
264
265(defconst manual-style-string "<style type=\"text/css\">
266@import url('/style.css');\n</style>\n")
267
268(defun manual-html-mono (texi-file dest)
269 "Run Makeinfo on TEXI-FILE, emitting mono HTML output to DEST.
270This function also edits the HTML files so that they validate as
271HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using
272the @import directive."
273 (call-process "makeinfo" nil nil nil
274 "--html" "--no-split" texi-file "-o" dest)
275 (with-temp-buffer
276 (insert-file-contents dest)
277 (setq buffer-file-name dest)
278 (manual-html-fix-headers)
279 (manual-html-fix-index-1)
280 (manual-html-fix-index-2 t)
281 (manual-html-fix-node-div)
282 (goto-char (point-max))
283 (re-search-backward "</body>[\n \t]*</html>")
284 (insert "</div>\n\n")
285 (save-buffer)))
286
287(defun manual-html-node (texi-file dir)
288 "Run Makeinfo on TEXI-FILE, emitting per-node HTML output to DIR.
289This function also edits the HTML files so that they validate as
290HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using
291the @import directive."
292 (unless (file-exists-p texi-file)
293 (error "Manual file %s not found" texi-file))
294 (call-process "makeinfo" nil nil nil
295 "--html" texi-file "-o" dir)
296 ;; Loop through the node files, fixing them up.
297 (dolist (f (directory-files dir nil "\\.html\\'"))
298 (let (opoint)
299 (with-temp-buffer
300 (insert-file-contents (expand-file-name f dir))
301 (setq buffer-file-name (expand-file-name f dir))
302 (if (looking-at "<meta http-equiv")
303 ;; Ignore those HTML files that are just redirects.
304 (set-buffer-modified-p nil)
305 (manual-html-fix-headers)
306 (if (equal f "index.html")
307 (let (copyright-text)
308 (manual-html-fix-index-1)
309 ;; Move copyright notice to the end.
310 (re-search-forward "[ \t]*<p>Copyright &copy;")
311 (setq opoint (match-beginning 0))
312 (re-search-forward "</blockquote>")
313 (setq copyright-text (buffer-substring opoint (point)))
314 (delete-region opoint (point))
315 (manual-html-fix-index-2)
316 (insert copyright-text "\n</div>\n"))
317 ;; For normal nodes, give the header div a blue bg.
318 (manual-html-fix-node-div))
319 (save-buffer))))))
320
321(defun manual-txt (texi-file dest)
322 "Run Makeinfo on TEXI-FILE, emitting plaintext output to DEST."
323 (call-process "makeinfo" nil nil nil
324 "--plaintext" "--no-split" texi-file "-o" dest)
325 (shell-command (concat "gzip -c " dest " > " (concat dest ".gz"))))
326
327(defun manual-pdf (texi-file dest)
328 "Run texi2pdf on TEXI-FILE, emitting plaintext output to DEST."
329 (call-process "texi2pdf" nil nil nil texi-file "-o" dest))
330
331(defun manual-dvi (texi-file dest ps-dest)
332 "Run texi2dvi on TEXI-FILE, emitting dvi output to DEST.
333Also generate postscript output in PS-DEST."
334 (call-process "texi2dvi" nil nil nil texi-file "-o" dest)
335 (call-process "dvips" nil nil nil dest "-o" ps-dest)
336 (call-process "gzip" nil nil nil dest)
337 (call-process "gzip" nil nil nil ps-dest))
338
339(defun manual-html-fix-headers ()
340 "Fix up HTML headers for the Emacs manual in the current buffer."
341 (let (opoint)
342 (insert manual-doctype-string)
343 (search-forward "<head>\n")
344 (insert manual-meta-string)
345 (search-forward "<meta")
346 (setq opoint (match-beginning 0))
347 (re-search-forward "<!--")
348 (goto-char (match-beginning 0))
349 (delete-region opoint (point))
350 (insert manual-style-string)
351 (search-forward "<meta http-equiv=\"Content-Style")
352 (setq opoint (match-beginning 0))
353 (search-forward "</head>")
354 (delete-region opoint (match-beginning 0))))
355
356(defun manual-html-fix-node-div ()
357 "Fix up HTML \"node\" divs in the current buffer."
358 (let (opoint div-end)
359 (while (search-forward "<div class=\"node\">" nil t)
360 (replace-match
361 "<div class=\"node\" style=\"background-color:#DDDDFF\">"
362 t t)
363 (setq opoint (point))
364 (re-search-forward "</div>")
365 (setq div-end (match-beginning 0))
366 (goto-char opoint)
367 (if (search-forward "<hr>" div-end 'move)
368 (replace-match "" t t)))))
369
370(defun manual-html-fix-index-1 ()
371 (let (opoint)
372 (re-search-forward "<body>\n\\(<h1 class=\"settitle\\)")
373 (setq opoint (match-beginning 1))
374 (search-forward "<h2 class=\"unnumbered")
375 (goto-char (match-beginning 0))
376 (delete-region opoint (point))
377 (insert "<div id=\"content\" class=\"inner\">\n\n")))
378
379(defun manual-html-fix-index-2 (&optional table-workaround)
380 "Replace the index list in the current buffer with a HTML table."
381 (let (done open-td tag desc)
382 ;; Convert the list that Makeinfo made into a table.
383 (search-forward "<ul class=\"menu\">")
384 (replace-match "<table style=\"float:left\" width=\"100%\">")
385 (forward-line 1)
386 (while (not done)
387 (cond
388 ((or (looking-at "<li>\\(<a.+</a>\\):[ \t]+\\(.*\\)$")
389 (looking-at "<li>\\(<a.+</a>\\)$"))
390 (setq tag (match-string 1))
391 (setq desc (match-string 2))
392 (replace-match "" t t)
393 (when open-td
394 (save-excursion
395 (forward-char -1)
396 (skip-chars-backward " ")
397 (delete-region (point) (line-end-position))
398 (insert "</td>\n </tr>")))
399 (insert " <tr>\n ")
400 (if table-workaround
401 ;; This works around a Firefox bug in the mono file.
402 (insert "<td bgcolor=\"white\">")
403 (insert "<td>"))
404 (insert tag "</td>\n <td>" (or desc ""))
405 (setq open-td t))
406 ((eq (char-after) ?\n)
407 (delete-char 1)
408 ;; Negate the following `forward-line'.
409 (forward-line -1))
410 ((looking-at "<!-- ")
411 (search-forward "-->"))
412 ((looking-at "<p>[- ]*The Detailed Node Listing[- \n]*")
413 (replace-match " </td></tr></table>\n
414<h3>Detailed Node Listing</h3>\n\n" t t)
415 (search-forward "<p>")
416 (search-forward "<p>")
417 (goto-char (match-beginning 0))
418 (skip-chars-backward "\n ")
419 (setq open-td nil)
420 (insert "</p>\n\n<table style=\"float:left\" width=\"100%\">"))
421 ((looking-at "</li></ul>")
422 (replace-match "" t t))
423 ((looking-at "<p>")
424 (replace-match "" t t)
425 (when open-td
426 (insert " </td></tr>")
427 (setq open-td nil))
428 (insert " <tr>
429 <th colspan=\"2\" align=\"left\" style=\"text-align:left\">")
430 (re-search-forward "</p>[ \t\n]*<ul class=\"menu\">")
431 (replace-match " </th></tr>"))
432 ((looking-at "[ \t]*</ul>[ \t]*$")
433 (replace-match
434 (if open-td
435 " </td></tr>\n</table>"
436 "</table>") t t)
437 (setq done t))
438 (t
439 (if (eobp)
440 (error "Parse error in %s" f))
441 (unless open-td
442 (setq done t))))
443 (forward-line 1))))
444
215(provide 'admin) 445(provide 'admin)
216 446
217;;; admin.el ends here 447;;; admin.el ends here
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index 6a8072de06c..9c47d6e1fa2 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -28,11 +28,14 @@ For each step, check for possible errors.
28 refer to a newer release of Emacs. (This is probably needed only 28 refer to a newer release of Emacs. (This is probably needed only
29 when preparing a major Emacs release, or branching for it.) 29 when preparing a major Emacs release, or branching for it.)
30 30
315. autoreconf -I m4 --force 315. Edit configure.in so that maintainer-mode is off by default.
32 (FIXME - need to find a better way of dealing with this).
33
34 autoreconf -I m4 --force
32 make bootstrap 35 make bootstrap
33 36
346. Commit configure, src/config.in, etc/AUTHORS, all the files changed 376. Commit etc/AUTHORS, all the files changed by M-x set-version, and
35 by M-x set-version, and lisp/cus-edit.el (if modified). 38 lisp/cus-edit.el (if modified).
36 Copy lisp/loaddefs.el to lisp/ldefs-boot.el and commit lisp/ldefs-boot.el. 39 Copy lisp/loaddefs.el to lisp/ldefs-boot.el and commit lisp/ldefs-boot.el.
37 For a release, also commit the ChangeLog files in all directories. 40 For a release, also commit the ChangeLog files in all directories.
38 41
diff --git a/admin/notes/BRANCH b/admin/notes/BRANCH
index 53f3d9603ca..9f09135f206 100644
--- a/admin/notes/BRANCH
+++ b/admin/notes/BRANCH
@@ -23,3 +23,10 @@ on what branch at any time.
23If you are looking at this file in a branch other than the trunk, 23If you are looking at this file in a branch other than the trunk,
24there may be some branch-specific documentation below this line. 24there may be some branch-specific documentation below this line.
25________________________________________________________________________ 25________________________________________________________________________
26
27* elpa
28
29 This branch does not contain a copy of Emacs, but of the Emacs Lisp
30 package archive (elpa.gnu.org). See admin/notes/elpa for further
31 explanation, and the README file in the branch for usage
32 instructions.
diff --git a/admin/notes/elpa b/admin/notes/elpa
index e28d81e6d6e..db14456fe32 100644
--- a/admin/notes/elpa
+++ b/admin/notes/elpa
@@ -1,42 +1,24 @@
1NOTES ON THE EMACS PACKAGE ARCHIVE 1NOTES ON THE EMACS PACKAGE ARCHIVE
2 2
3Here are instructions on uploading files to the package archive at 3The GNU Emacs package archive, at elpa.gnu.org, is managed using a Bzr
4elpa.gnu.org, for Emacs maintainers. (If you are not a maintainer, 4branch named "elpa", hosted on Savannah. To check it out:
5contact us if you want to submit a package.) 5
6 6 bzr branch bzr+ssh://USER@bzr.savannah.gnu.org/emacs/elpa elpa
71. You will need login access to elpa.gnu.org. You will also need to 7 cd elpa
8 get the FSF sysadmins to allow ssh access through the FSF firewall 8 echo "public_branch = bzr+ssh://USER@bzr.savannah.gnu.org/emacs/elpa" >> .bzr/branch/branch.conf
9 for your local machine. Ensure that your uid, USER, is in the 9 bzr bind bzr+ssh://USERNAME@bzr.savannah.gnu.org/emacs/elpa
10 `elpa' group on elpa.gnu.org; this gives you write access to the 10 [create task branch for edits, etc.]
11 bzr repository from which the packages are managed. 11
12 12Changes to this branch propagate to elpa.gnu.org in a semi-manual way.
132. Go to your bzr repository on your local machine. Of, if you don't 13There exists a copy of the elpa branch on that machine. Someone with
14 have one (you should, if you're tracking Emacs bzr), make one: 14access logs in, pulls the latest changes from Savannah, and runs a
15 15"deployment" script. This script (which is itself kept in the Bzr
16 cd $DEVHOME 16branch) generates the content visible at http://elpa.gnu.org/packages.
17 bzr init-repo elpa/ 17
18 cd elpa 18The reason we set things up this way, instead of using the package
19 19upload commands in package-x.el, is to let Emacs hackers conveniently
20 Create a branch for elpa: 20edit the contents of the "elpa" branch. (In particular, multi-file
21 21packages are stored on the branch in source form, not as tarfiles.)
22 bzr branch bzr+ssh://USER@elpa.gnu.org/home/elpa/package-repo package-repo 22
23 23It is easy to use the elpa branch to deploy a "local" copy of the
24 Bind the branch: 24package archive. For details, see the README file in the elpa branch.
25
26 cd package-repo/
27 echo "public_branch = bzr+ssh://USER@elpa.gnu.org/home/elpa/package-repo" >> .bzr/branch/branch.conf
28 bzr bind bzr+ssh://USER@elpa.gnu.org/home/elpa/package-repo
29
30 Now you should be able to do `bzr up' and `bzr commit'.
31
323. Changes in bzr do not immediately propagate to the user-facing tree
33 (i.e., what users see when they do `M-x list-packages'). That tree
34 is created by a (daily) cron job that does "bzr export". If for
35 some reason you need to refresh the user-facing tree immediately,
36 run /home/elpa/bin/package-update.sh as the "elpa" user.
37
38 The Org mode dailies are not part of the repository. After the
39 package-update.sh script creates the user-facing tree, it copies
40 the daily tarfile hosted on orgmode.org directly into that tree.
41
424. FIXME: How to actually upload a package file.
diff --git a/autogen.sh b/autogen.sh
index 52184c46f51..a56b8d77826 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,7 +1,207 @@
1#!/bin/sh 1#!/bin/sh
2### autogen.sh - tool to help build Emacs from a bzr checkout
2 3
3echo "Please read INSTALL.BZR for instructions on how to build Emacs from Bazaar." 4## Copyright (C) 2011 Free Software Foundation, Inc.
4 5
5# Exit with failure, since people may have generic build scripts that 6## Author: Glenn Morris <rgm@gnu.org>
6# try things like "autogen.sh && ./configure && make". 7
7exit 1 8## This file is part of GNU Emacs.
9
10## GNU Emacs is free software: you can redistribute it and/or modify
11## it under the terms of the GNU General Public License as published by
12## the Free Software Foundation, either version 3 of the License, or
13## (at your option) any later version.
14
15## GNU Emacs is distributed in the hope that it will be useful,
16## but WITHOUT ANY WARRANTY; without even the implied warranty of
17## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18## GNU General Public License for more details.
19
20## You should have received a copy of the GNU General Public License
21## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22
23### Commentary:
24
25## The Emacs bzr repository does not include the configure script
26## (and associated helpers). The first time you fetch Emacs from bzr,
27## run this script to generate the necessary files.
28## For more details, see the file INSTALL.BZR.
29
30### Code:
31
32## Tools we need:
33progs="autoconf automake"
34
35## Minimum versions we need:
36autoconf_min=`sed -n 's/^ *AC_PREREQ(\([0-9\.]*\)).*/\1/p' configure.in`
37
38## FIXME how to determine this from the sources?
39automake_min=1.11
40
41
42## $1 = program, eg "autoconf".
43## Echo the version string, eg "2.59".
44## FIXME does not handle things like "1.4a", but AFAIK those are
45## all old versions, so it is OK to fail there.
46## Also note that we do not handle micro versions.
47get_version ()
48{
49 $1 --version 2>&1 | sed -n '1 s/.* \([1-9][0-9\.]*\).*/\1/p'
50}
51
52## $1 = version string, eg "2.59"
53## Echo the major version, eg "2".
54major_version ()
55{
56 echo $1 | sed -e 's/\([0-9][0-9]*\)\..*/\1/'
57}
58
59## $1 = version string, eg "2.59"
60## Echo the minor version, eg "59".
61minor_version ()
62{
63 echo $1 | sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/'
64}
65
66## $1 = program
67## $2 = minimum version.
68## Return 0 if program is present with version >= minumum version.
69## Return 1 if program is missing.
70## Return 2 if program is present but too old.
71## Return 3 for unexpected error (eg failed to parse version).
72check_version ()
73{
74 have_version=`get_version $1`
75
76 [ x"$have_version" = x ] && return 1
77
78 have_maj=`major_version $have_version`
79 need_maj=`major_version $2`
80
81 [ x"$have_maj" != x ] && [ x"$need_maj" != x ] || return 3
82
83 [ $have_maj -gt $need_maj ] && return 0
84 [ $have_maj -lt $need_maj ] && return 2
85
86 have_min=`minor_version $have_version`
87 need_min=`minor_version $2`
88
89 [ x"$have_min" != x ] && [ x"$need_min" != x ] || return 3
90
91 [ $have_min -ge $need_min ] && return 0
92 return 2
93}
94
95
96cat <<EOF
97Checking whether you have the necessary tools...
98(Read INSTALL.BZR for more details on building Emacs)
99
100EOF
101
102missing=
103
104for prog in $progs; do
105
106 eval min=\$${prog}_min
107
108 echo "Checking for $prog (need at least version $min)..."
109
110 check_version $prog $min
111
112 retval=$?
113
114 case $retval in
115 0) stat="ok" ;;
116 1) stat="missing" ;;
117 2) stat="too old" ;;
118 *) stat="unable to check" ;;
119 esac
120
121 echo $stat
122
123 if [ $retval -ne 0 ]; then
124 missing="$missing $prog"
125 eval ${prog}_why=\""$stat"\"
126 fi
127
128done
129
130
131if [ x"$missing" != x ]; then
132
133 cat <<EOF
134
135Building Emacs from Bzr requires the following specialized programs:
136EOF
137
138 for prog in $progs; do
139 eval min=\$${prog}_min
140
141 echo "$prog (minimum version $min)"
142 done
143
144
145 cat <<EOF
146
147Your system seems to be missing the following tool(s):
148EOF
149
150 for prog in $missing; do
151 eval why=\$${prog}_why
152
153 echo "$prog ($why)"
154 done
155
156 cat <<EOF
157
158If you think you have the required tools, please add them to your PATH
159and re-run this script.
160
161Otherwise, please try installing them.
162On systems using rpm and yum, try: "yum install PACKAGE"
163On systems using dpkg and apt, try: "apt-get install PACKAGE"
164Then re-run this script.
165
166If you do not have permission to do this, or if the version provided
167by your system is too old, it is normally straightforward to build
168these packages from source. You can find the sources at:
169
170ftp://ftp.gnu.org/gnu/PACKAGE/
171
172Download the package (make sure you get at least the minimum version
173listed above), extract it using tar, then run configure, make,
174make install. Add the installation directory to your PATH and re-run
175this script.
176
177If you know that the required versions are in your PATH, but this
178script has made an error, then you can simply run
179
180autoreconf -I m4
181
182instead of this script.
183
184If all else fails, you can try using the pre-built versions of the
185generated files by doing:
186
187cd autogen && ./copy_autogen
188
189This is not recommended - see the comments in \`copy_autogen'.
190
191Please report any problems with this script to bug-gnu-emacs@gnu.org .
192EOF
193
194 exit 1
195fi
196
197echo "Your system has the required tools, running autoreconf..."
198
199
200## Let autoreconf figure out what, if anything, needs doing.
201autoreconf -I m4 || exit $?
202
203echo "You can now run \`./configure'."
204
205exit 0
206
207### autogen.sh ends here
diff --git a/lib/Makefile.in b/autogen/Makefile.in
index 04ee541a09c..502b3dbb927 100644
--- a/lib/Makefile.in
+++ b/autogen/Makefile.in
@@ -24,7 +24,7 @@
24# the same distribution terms as the rest of that program. 24# the same distribution terms as the rest of that program.
25# 25#
26# Generated by gnulib-tool. 26# Generated by gnulib-tool.
27# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value lstat mktime readlink strftime symlink sys_stat 27# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink strftime symlink sys_stat
28 28
29VPATH = @srcdir@ 29VPATH = @srcdir@
30pkgdatadir = $(datadir)/@PACKAGE@ 30pkgdatadir = $(datadir)/@PACKAGE@
diff --git a/autogen/README b/autogen/README
new file mode 100644
index 00000000000..a16dc93c48a
--- /dev/null
+++ b/autogen/README
@@ -0,0 +1,14 @@
1This directory contains some pre-built generated files.
2Most people do not need to use these files - instead you should
3generate them yourself using eg `autogen.sh'.
4
5File: Destination: Created by:
6configure ../ autoconf
7config.in ../src autoheader * also used by MSDOS bzr build
8aclocal.m4 ../ aclocal
9Makefile.in ../lib automake
10
11There are also some scripts:
12
13copy_autogen - copy pre-built generated files into place
14update_autogen - regenerate generated files (for maintainers)
diff --git a/aclocal.m4 b/autogen/aclocal.m4
index 9fdc8e76c49..963faafb453 100644
--- a/aclocal.m4
+++ b/autogen/aclocal.m4
@@ -13,8 +13,8 @@
13 13
14m4_ifndef([AC_AUTOCONF_VERSION], 14m4_ifndef([AC_AUTOCONF_VERSION],
15 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 15 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, 16m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
17[m4_warning([this file was generated for autoconf 2.67. 17[m4_warning([this file was generated for autoconf 2.65.
18You have another version of autoconf. It may work, but is not guaranteed to. 18You have another version of autoconf. It may work, but is not guaranteed to.
19If you have problems, you may need to regenerate the build system entirely. 19If you have problems, you may need to regenerate the build system entirely.
20To do so, use the procedure documented by the package, typically `autoreconf'.])]) 20To do so, use the procedure documented by the package, typically `autoreconf'.])])
diff --git a/src/config.in b/autogen/config.in
index 7f33727c0b1..8889213b781 100644
--- a/src/config.in
+++ b/autogen/config.in
@@ -285,6 +285,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
285/* Define to 1 if you have the `grantpt' function. */ 285/* Define to 1 if you have the `grantpt' function. */
286#undef HAVE_GRANTPT 286#undef HAVE_GRANTPT
287 287
288/* Define to 1 if using GTK 3 or later. */
289#undef HAVE_GTK3
290
288/* Define to 1 if you have the `gtk_adjustment_get_page_size' function. */ 291/* Define to 1 if you have the `gtk_adjustment_get_page_size' function. */
289#undef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE 292#undef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
290 293
diff --git a/configure b/autogen/configure
index b8a83e66779..4c45db1badd 100755
--- a/configure
+++ b/autogen/configure
@@ -1,11 +1,11 @@
1#! /bin/sh 1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles. 2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.67 for emacs 24.0.50. 3# Generated by GNU Autoconf 2.65 for emacs 24.0.50.
4# 4#
5# 5#
6# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 6# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
7# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software 7# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
8# Foundation, Inc. 8# Inc.
9# 9#
10# 10#
11# This configure script is free software; the Free Software Foundation 11# This configure script is free software; the Free Software Foundation
@@ -316,7 +316,7 @@ $as_echo X"$as_dir" |
316 test -d "$as_dir" && break 316 test -d "$as_dir" && break
317 done 317 done
318 test -z "$as_dirs" || eval "mkdir $as_dirs" 318 test -z "$as_dirs" || eval "mkdir $as_dirs"
319 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" 319 } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
320 320
321 321
322} # as_fn_mkdir_p 322} # as_fn_mkdir_p
@@ -356,19 +356,19 @@ else
356fi # as_fn_arith 356fi # as_fn_arith
357 357
358 358
359# as_fn_error STATUS ERROR [LINENO LOG_FD] 359# as_fn_error ERROR [LINENO LOG_FD]
360# ---------------------------------------- 360# ---------------------------------
361# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are 361# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
362# provided, also output the error to LOG_FD, referencing LINENO. Then exit the 362# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
363# script with STATUS, using 1 if that was 0. 363# script with status $?, using 1 if that was 0.
364as_fn_error () 364as_fn_error ()
365{ 365{
366 as_status=$1; test $as_status -eq 0 && as_status=1 366 as_status=$?; test $as_status -eq 0 && as_status=1
367 if test "$4"; then 367 if test "$3"; then
368 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 368 as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
369 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 369 $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
370 fi 370 fi
371 $as_echo "$as_me: error: $2" >&2 371 $as_echo "$as_me: error: $1" >&2
372 as_fn_exit $as_status 372 as_fn_exit $as_status
373} # as_fn_error 373} # as_fn_error
374 374
@@ -530,7 +530,7 @@ test -n "$DJDIR" || exec 7<&0 </dev/null
530exec 6>&1 530exec 6>&1
531 531
532# Name of the host. 532# Name of the host.
533# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, 533# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
534# so uname gets run too. 534# so uname gets run too.
535ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` 535ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
536 536
@@ -1220,9 +1220,8 @@ do
1220 fi 1220 fi
1221 1221
1222 case $ac_option in 1222 case $ac_option in
1223 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; 1223 *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
1224 *=) ac_optarg= ;; 1224 *) ac_optarg=yes ;;
1225 *) ac_optarg=yes ;;
1226 esac 1225 esac
1227 1226
1228 # Accept the important Cygnus configure options, so we can diagnose typos. 1227 # Accept the important Cygnus configure options, so we can diagnose typos.
@@ -1267,7 +1266,7 @@ do
1267 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` 1266 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
1268 # Reject names that are not valid shell variable names. 1267 # Reject names that are not valid shell variable names.
1269 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 1268 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1270 as_fn_error $? "invalid feature name: $ac_useropt" 1269 as_fn_error "invalid feature name: $ac_useropt"
1271 ac_useropt_orig=$ac_useropt 1270 ac_useropt_orig=$ac_useropt
1272 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 1271 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1273 case $ac_user_opts in 1272 case $ac_user_opts in
@@ -1293,7 +1292,7 @@ do
1293 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` 1292 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
1294 # Reject names that are not valid shell variable names. 1293 # Reject names that are not valid shell variable names.
1295 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 1294 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1296 as_fn_error $? "invalid feature name: $ac_useropt" 1295 as_fn_error "invalid feature name: $ac_useropt"
1297 ac_useropt_orig=$ac_useropt 1296 ac_useropt_orig=$ac_useropt
1298 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 1297 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1299 case $ac_user_opts in 1298 case $ac_user_opts in
@@ -1497,7 +1496,7 @@ do
1497 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` 1496 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1498 # Reject names that are not valid shell variable names. 1497 # Reject names that are not valid shell variable names.
1499 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 1498 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1500 as_fn_error $? "invalid package name: $ac_useropt" 1499 as_fn_error "invalid package name: $ac_useropt"
1501 ac_useropt_orig=$ac_useropt 1500 ac_useropt_orig=$ac_useropt
1502 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 1501 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1503 case $ac_user_opts in 1502 case $ac_user_opts in
@@ -1513,7 +1512,7 @@ do
1513 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` 1512 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1514 # Reject names that are not valid shell variable names. 1513 # Reject names that are not valid shell variable names.
1515 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 1514 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1516 as_fn_error $? "invalid package name: $ac_useropt" 1515 as_fn_error "invalid package name: $ac_useropt"
1517 ac_useropt_orig=$ac_useropt 1516 ac_useropt_orig=$ac_useropt
1518 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 1517 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1519 case $ac_user_opts in 1518 case $ac_user_opts in
@@ -1543,8 +1542,8 @@ do
1543 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) 1542 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1544 x_libraries=$ac_optarg ;; 1543 x_libraries=$ac_optarg ;;
1545 1544
1546 -*) as_fn_error $? "unrecognized option: \`$ac_option' 1545 -*) as_fn_error "unrecognized option: \`$ac_option'
1547Try \`$0 --help' for more information" 1546Try \`$0 --help' for more information."
1548 ;; 1547 ;;
1549 1548
1550 *=*) 1549 *=*)
@@ -1552,7 +1551,7 @@ Try \`$0 --help' for more information"
1552 # Reject names that are not valid shell variable names. 1551 # Reject names that are not valid shell variable names.
1553 case $ac_envvar in #( 1552 case $ac_envvar in #(
1554 '' | [0-9]* | *[!_$as_cr_alnum]* ) 1553 '' | [0-9]* | *[!_$as_cr_alnum]* )
1555 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; 1554 as_fn_error "invalid variable name: \`$ac_envvar'" ;;
1556 esac 1555 esac
1557 eval $ac_envvar=\$ac_optarg 1556 eval $ac_envvar=\$ac_optarg
1558 export $ac_envvar ;; 1557 export $ac_envvar ;;
@@ -1570,13 +1569,13 @@ done
1570 1569
1571if test -n "$ac_prev"; then 1570if test -n "$ac_prev"; then
1572 ac_option=--`echo $ac_prev | sed 's/_/-/g'` 1571 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1573 as_fn_error $? "missing argument to $ac_option" 1572 as_fn_error "missing argument to $ac_option"
1574fi 1573fi
1575 1574
1576if test -n "$ac_unrecognized_opts"; then 1575if test -n "$ac_unrecognized_opts"; then
1577 case $enable_option_checking in 1576 case $enable_option_checking in
1578 no) ;; 1577 no) ;;
1579 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; 1578 fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
1580 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; 1579 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1581 esac 1580 esac
1582fi 1581fi
@@ -1599,7 +1598,7 @@ do
1599 [\\/$]* | ?:[\\/]* ) continue;; 1598 [\\/$]* | ?:[\\/]* ) continue;;
1600 NONE | '' ) case $ac_var in *prefix ) continue;; esac;; 1599 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1601 esac 1600 esac
1602 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 1601 as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
1603done 1602done
1604 1603
1605# There might be people who depend on the old broken behavior: `$host' 1604# There might be people who depend on the old broken behavior: `$host'
@@ -1613,8 +1612,8 @@ target=$target_alias
1613if test "x$host_alias" != x; then 1612if test "x$host_alias" != x; then
1614 if test "x$build_alias" = x; then 1613 if test "x$build_alias" = x; then
1615 cross_compiling=maybe 1614 cross_compiling=maybe
1616 $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. 1615 $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
1617 If a cross compiler is detected then cross compile mode will be used" >&2 1616 If a cross compiler is detected then cross compile mode will be used." >&2
1618 elif test "x$build_alias" != "x$host_alias"; then 1617 elif test "x$build_alias" != "x$host_alias"; then
1619 cross_compiling=yes 1618 cross_compiling=yes
1620 fi 1619 fi
@@ -1629,9 +1628,9 @@ test "$silent" = yes && exec 6>/dev/null
1629ac_pwd=`pwd` && test -n "$ac_pwd" && 1628ac_pwd=`pwd` && test -n "$ac_pwd" &&
1630ac_ls_di=`ls -di .` && 1629ac_ls_di=`ls -di .` &&
1631ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || 1630ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1632 as_fn_error $? "working directory cannot be determined" 1631 as_fn_error "working directory cannot be determined"
1633test "X$ac_ls_di" = "X$ac_pwd_ls_di" || 1632test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1634 as_fn_error $? "pwd does not report name of working directory" 1633 as_fn_error "pwd does not report name of working directory"
1635 1634
1636 1635
1637# Find the source files, if location was not specified. 1636# Find the source files, if location was not specified.
@@ -1670,11 +1669,11 @@ else
1670fi 1669fi
1671if test ! -r "$srcdir/$ac_unique_file"; then 1670if test ! -r "$srcdir/$ac_unique_file"; then
1672 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." 1671 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1673 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" 1672 as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
1674fi 1673fi
1675ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" 1674ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1676ac_abs_confdir=`( 1675ac_abs_confdir=`(
1677 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" 1676 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
1678 pwd)` 1677 pwd)`
1679# When building in place, set srcdir=. 1678# When building in place, set srcdir=.
1680if test "$ac_abs_confdir" = "$ac_pwd"; then 1679if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1714,7 +1713,7 @@ Configuration:
1714 --help=short display options specific to this package 1713 --help=short display options specific to this package
1715 --help=recursive display the short help of all the included packages 1714 --help=recursive display the short help of all the included packages
1716 -V, --version display version information and exit 1715 -V, --version display version information and exit
1717 -q, --quiet, --silent do not print \`checking ...' messages 1716 -q, --quiet, --silent do not print \`checking...' messages
1718 --cache-file=FILE cache test results in FILE [disabled] 1717 --cache-file=FILE cache test results in FILE [disabled]
1719 -C, --config-cache alias for \`--cache-file=config.cache' 1718 -C, --config-cache alias for \`--cache-file=config.cache'
1720 -n, --no-create do not create output files 1719 -n, --no-create do not create output files
@@ -1936,9 +1935,9 @@ test -n "$ac_init_help" && exit $ac_status
1936if $ac_init_version; then 1935if $ac_init_version; then
1937 cat <<\_ACEOF 1936 cat <<\_ACEOF
1938emacs configure 24.0.50 1937emacs configure 24.0.50
1939generated by GNU Autoconf 2.67 1938generated by GNU Autoconf 2.65
1940 1939
1941Copyright (C) 2010 Free Software Foundation, Inc. 1940Copyright (C) 2009 Free Software Foundation, Inc.
1942This configure script is free software; the Free Software Foundation 1941This configure script is free software; the Free Software Foundation
1943gives unlimited permission to copy, distribute and modify it. 1942gives unlimited permission to copy, distribute and modify it.
1944_ACEOF 1943_ACEOF
@@ -2008,7 +2007,7 @@ $as_echo "$ac_try_echo"; } >&5
2008 mv -f conftest.er1 conftest.err 2007 mv -f conftest.er1 conftest.err
2009 fi 2008 fi
2010 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 2009 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2011 test $ac_status = 0; } > conftest.i && { 2010 test $ac_status = 0; } >/dev/null && {
2012 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || 2011 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
2013 test ! -s conftest.err 2012 test ! -s conftest.err
2014 }; then : 2013 }; then :
@@ -2032,10 +2031,10 @@ fi
2032ac_fn_c_check_header_mongrel () 2031ac_fn_c_check_header_mongrel ()
2033{ 2032{
2034 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2033 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2035 if eval "test \"\${$3+set}\"" = set; then : 2034 if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2036 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 2035 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2037$as_echo_n "checking for $2... " >&6; } 2036$as_echo_n "checking for $2... " >&6; }
2038if eval "test \"\${$3+set}\"" = set; then : 2037if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2039 $as_echo_n "(cached) " >&6 2038 $as_echo_n "(cached) " >&6
2040fi 2039fi
2041eval ac_res=\$$3 2040eval ac_res=\$$3
@@ -2071,7 +2070,7 @@ if ac_fn_c_try_cpp "$LINENO"; then :
2071else 2070else
2072 ac_header_preproc=no 2071 ac_header_preproc=no
2073fi 2072fi
2074rm -f conftest.err conftest.i conftest.$ac_ext 2073rm -f conftest.err conftest.$ac_ext
2075{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 2074{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
2076$as_echo "$ac_header_preproc" >&6; } 2075$as_echo "$ac_header_preproc" >&6; }
2077 2076
@@ -2098,7 +2097,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2098esac 2097esac
2099 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 2098 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2100$as_echo_n "checking for $2... " >&6; } 2099$as_echo_n "checking for $2... " >&6; }
2101if eval "test \"\${$3+set}\"" = set; then : 2100if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2102 $as_echo_n "(cached) " >&6 2101 $as_echo_n "(cached) " >&6
2103else 2102else
2104 eval "$3=\$ac_header_compiler" 2103 eval "$3=\$ac_header_compiler"
@@ -2162,7 +2161,7 @@ ac_fn_c_check_header_compile ()
2162 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2161 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2163 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 2162 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2164$as_echo_n "checking for $2... " >&6; } 2163$as_echo_n "checking for $2... " >&6; }
2165if eval "test \"\${$3+set}\"" = set; then : 2164if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2166 $as_echo_n "(cached) " >&6 2165 $as_echo_n "(cached) " >&6
2167else 2166else
2168 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2167 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2230,18 +2229,15 @@ fi
2230 2229
2231} # ac_fn_c_try_link 2230} # ac_fn_c_try_link
2232 2231
2233# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES 2232# ac_fn_c_check_decl LINENO SYMBOL VAR
2234# --------------------------------------------- 2233# ------------------------------------
2235# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR 2234# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
2236# accordingly.
2237ac_fn_c_check_decl () 2235ac_fn_c_check_decl ()
2238{ 2236{
2239 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2237 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2240 as_decl_name=`echo $2|sed 's/ *(.*//'` 2238 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
2241 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` 2239$as_echo_n "checking whether $2 is declared... " >&6; }
2242 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 2240if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2243$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
2244if eval "test \"\${$3+set}\"" = set; then :
2245 $as_echo_n "(cached) " >&6 2241 $as_echo_n "(cached) " >&6
2246else 2242else
2247 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2243 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2250,12 +2246,8 @@ $4
2250int 2246int
2251main () 2247main ()
2252{ 2248{
2253#ifndef $as_decl_name 2249#ifndef $2
2254#ifdef __cplusplus 2250 (void) $2;
2255 (void) $as_decl_use;
2256#else
2257 (void) $as_decl_name;
2258#endif
2259#endif 2251#endif
2260 2252
2261 ; 2253 ;
@@ -2284,7 +2276,7 @@ ac_fn_c_check_header_preproc ()
2284 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2276 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2285 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 2277 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2286$as_echo_n "checking for $2... " >&6; } 2278$as_echo_n "checking for $2... " >&6; }
2287if eval "test \"\${$3+set}\"" = set; then : 2279if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2288 $as_echo_n "(cached) " >&6 2280 $as_echo_n "(cached) " >&6
2289else 2281else
2290 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2282 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2296,7 +2288,7 @@ if ac_fn_c_try_cpp "$LINENO"; then :
2296else 2288else
2297 eval "$3=no" 2289 eval "$3=no"
2298fi 2290fi
2299rm -f conftest.err conftest.i conftest.$ac_ext 2291rm -f conftest.err conftest.$ac_ext
2300fi 2292fi
2301eval ac_res=\$$3 2293eval ac_res=\$$3
2302 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 2294 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
@@ -2314,7 +2306,7 @@ ac_fn_c_check_member ()
2314 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2306 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2315 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 2307 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
2316$as_echo_n "checking for $2.$3... " >&6; } 2308$as_echo_n "checking for $2.$3... " >&6; }
2317if eval "test \"\${$4+set}\"" = set; then : 2309if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then :
2318 $as_echo_n "(cached) " >&6 2310 $as_echo_n "(cached) " >&6
2319else 2311else
2320 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2312 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2370,7 +2362,7 @@ ac_fn_c_check_func ()
2370 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2362 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2371 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 2363 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2372$as_echo_n "checking for $2... " >&6; } 2364$as_echo_n "checking for $2... " >&6; }
2373if eval "test \"\${$3+set}\"" = set; then : 2365if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2374 $as_echo_n "(cached) " >&6 2366 $as_echo_n "(cached) " >&6
2375else 2367else
2376 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2368 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2438,7 +2430,7 @@ ac_fn_c_check_type ()
2438 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2430 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2439 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 2431 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2440$as_echo_n "checking for $2... " >&6; } 2432$as_echo_n "checking for $2... " >&6; }
2441if eval "test \"\${$3+set}\"" = set; then : 2433if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2442 $as_echo_n "(cached) " >&6 2434 $as_echo_n "(cached) " >&6
2443else 2435else
2444 eval "$3=no" 2436 eval "$3=no"
@@ -2665,7 +2657,7 @@ This file contains any messages produced by compilers while
2665running configure, to aid debugging if configure makes a mistake. 2657running configure, to aid debugging if configure makes a mistake.
2666 2658
2667It was created by emacs $as_me 24.0.50, which was 2659It was created by emacs $as_me 24.0.50, which was
2668generated by GNU Autoconf 2.67. Invocation command line was 2660generated by GNU Autoconf 2.65. Invocation command line was
2669 2661
2670 $ $0 $@ 2662 $ $0 $@
2671 2663
@@ -2775,9 +2767,11 @@ trap 'exit_status=$?
2775 { 2767 {
2776 echo 2768 echo
2777 2769
2778 $as_echo "## ---------------- ## 2770 cat <<\_ASBOX
2771## ---------------- ##
2779## Cache variables. ## 2772## Cache variables. ##
2780## ---------------- ##" 2773## ---------------- ##
2774_ASBOX
2781 echo 2775 echo
2782 # The following way of writing the cache mishandles newlines in values, 2776 # The following way of writing the cache mishandles newlines in values,
2783( 2777(
@@ -2811,9 +2805,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2811) 2805)
2812 echo 2806 echo
2813 2807
2814 $as_echo "## ----------------- ## 2808 cat <<\_ASBOX
2809## ----------------- ##
2815## Output variables. ## 2810## Output variables. ##
2816## ----------------- ##" 2811## ----------------- ##
2812_ASBOX
2817 echo 2813 echo
2818 for ac_var in $ac_subst_vars 2814 for ac_var in $ac_subst_vars
2819 do 2815 do
@@ -2826,9 +2822,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2826 echo 2822 echo
2827 2823
2828 if test -n "$ac_subst_files"; then 2824 if test -n "$ac_subst_files"; then
2829 $as_echo "## ------------------- ## 2825 cat <<\_ASBOX
2826## ------------------- ##
2830## File substitutions. ## 2827## File substitutions. ##
2831## ------------------- ##" 2828## ------------------- ##
2829_ASBOX
2832 echo 2830 echo
2833 for ac_var in $ac_subst_files 2831 for ac_var in $ac_subst_files
2834 do 2832 do
@@ -2842,9 +2840,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2842 fi 2840 fi
2843 2841
2844 if test -s confdefs.h; then 2842 if test -s confdefs.h; then
2845 $as_echo "## ----------- ## 2843 cat <<\_ASBOX
2844## ----------- ##
2846## confdefs.h. ## 2845## confdefs.h. ##
2847## ----------- ##" 2846## ----------- ##
2847_ASBOX
2848 echo 2848 echo
2849 cat confdefs.h 2849 cat confdefs.h
2850 echo 2850 echo
@@ -2899,12 +2899,7 @@ _ACEOF
2899ac_site_file1=NONE 2899ac_site_file1=NONE
2900ac_site_file2=NONE 2900ac_site_file2=NONE
2901if test -n "$CONFIG_SITE"; then 2901if test -n "$CONFIG_SITE"; then
2902 # We do not want a PATH search for config.site. 2902 ac_site_file1=$CONFIG_SITE
2903 case $CONFIG_SITE in #((
2904 -*) ac_site_file1=./$CONFIG_SITE;;
2905 */*) ac_site_file1=$CONFIG_SITE;;
2906 *) ac_site_file1=./$CONFIG_SITE;;
2907 esac
2908elif test "x$prefix" != xNONE; then 2903elif test "x$prefix" != xNONE; then
2909 ac_site_file1=$prefix/share/config.site 2904 ac_site_file1=$prefix/share/config.site
2910 ac_site_file2=$prefix/etc/config.site 2905 ac_site_file2=$prefix/etc/config.site
@@ -2919,11 +2914,7 @@ do
2919 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 2914 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2920$as_echo "$as_me: loading site script $ac_site_file" >&6;} 2915$as_echo "$as_me: loading site script $ac_site_file" >&6;}
2921 sed 's/^/| /' "$ac_site_file" >&5 2916 sed 's/^/| /' "$ac_site_file" >&5
2922 . "$ac_site_file" \ 2917 . "$ac_site_file"
2923 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2924$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2925as_fn_error $? "failed to load site script $ac_site_file
2926See \`config.log' for more details" "$LINENO" 5 ; }
2927 fi 2918 fi
2928done 2919done
2929 2920
@@ -3014,7 +3005,7 @@ if $ac_cache_corrupted; then
3014$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3005$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3015 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 3006 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
3016$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} 3007$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
3017 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 3008 as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
3018fi 3009fi
3019## -------------------- ## 3010## -------------------- ##
3020## Main body of script. ## 3011## Main body of script. ##
@@ -3034,22 +3025,16 @@ am__api_version='1.11'
3034 3025
3035ac_aux_dir= 3026ac_aux_dir=
3036for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do 3027for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
3037 if test -f "$ac_dir/install-sh"; then 3028 for ac_t in install-sh install.sh shtool; do
3038 ac_aux_dir=$ac_dir 3029 if test -f "$ac_dir/$ac_t"; then
3039 ac_install_sh="$ac_aux_dir/install-sh -c" 3030 ac_aux_dir=$ac_dir
3040 break 3031 ac_install_sh="$ac_aux_dir/$ac_t -c"
3041 elif test -f "$ac_dir/install.sh"; then 3032 break 2
3042 ac_aux_dir=$ac_dir 3033 fi
3043 ac_install_sh="$ac_aux_dir/install.sh -c" 3034 done
3044 break
3045 elif test -f "$ac_dir/shtool"; then
3046 ac_aux_dir=$ac_dir
3047 ac_install_sh="$ac_aux_dir/shtool install -c"
3048 break
3049 fi
3050done 3035done
3051if test -z "$ac_aux_dir"; then 3036if test -z "$ac_aux_dir"; then
3052 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 3037 as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
3053fi 3038fi
3054 3039
3055# These three variables are undocumented and unsupported, 3040# These three variables are undocumented and unsupported,
@@ -3165,11 +3150,11 @@ am_lf='
3165' 3150'
3166case `pwd` in 3151case `pwd` in
3167 *[\\\"\#\$\&\'\`$am_lf]*) 3152 *[\\\"\#\$\&\'\`$am_lf]*)
3168 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; 3153 as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
3169esac 3154esac
3170case $srcdir in 3155case $srcdir in
3171 *[\\\"\#\$\&\'\`$am_lf\ \ ]*) 3156 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
3172 as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; 3157 as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
3173esac 3158esac
3174 3159
3175# Do `set' in a subshell so we don't clobber the current shell's 3160# Do `set' in a subshell so we don't clobber the current shell's
@@ -3191,7 +3176,7 @@ if (
3191 # if, for instance, CONFIG_SHELL is bash and it inherits a 3176 # if, for instance, CONFIG_SHELL is bash and it inherits a
3192 # broken ls alias from the environment. This has actually 3177 # broken ls alias from the environment. This has actually
3193 # happened. Such a system could not be considered "sane". 3178 # happened. Such a system could not be considered "sane".
3194 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken 3179 as_fn_error "ls -t appears to fail. Make sure there is not a broken
3195alias in your environment" "$LINENO" 5 3180alias in your environment" "$LINENO" 5
3196 fi 3181 fi
3197 3182
@@ -3201,7 +3186,7 @@ then
3201 # Ok. 3186 # Ok.
3202 : 3187 :
3203else 3188else
3204 as_fn_error $? "newly created file is older than distributed files! 3189 as_fn_error "newly created file is older than distributed files!
3205Check your system clock" "$LINENO" 5 3190Check your system clock" "$LINENO" 5
3206fi 3191fi
3207{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 3192{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -3440,7 +3425,7 @@ done
3440$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } 3425$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
3441set x ${MAKE-make} 3426set x ${MAKE-make}
3442ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` 3427ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
3443if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : 3428if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
3444 $as_echo_n "(cached) " >&6 3429 $as_echo_n "(cached) " >&6
3445else 3430else
3446 cat >conftest.make <<\_ACEOF 3431 cat >conftest.make <<\_ACEOF
@@ -3448,7 +3433,7 @@ SHELL = /bin/sh
3448all: 3433all:
3449 @echo '@@@%%%=$(MAKE)=@@@%%%' 3434 @echo '@@@%%%=$(MAKE)=@@@%%%'
3450_ACEOF 3435_ACEOF
3451# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. 3436# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3452case `${MAKE-make} -f conftest.make 2>/dev/null` in 3437case `${MAKE-make} -f conftest.make 2>/dev/null` in
3453 *@@@%%%=?*=@@@%%%*) 3438 *@@@%%%=?*=@@@%%%*)
3454 eval ac_cv_prog_make_${ac_make}_set=yes;; 3439 eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -3482,7 +3467,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then
3482 am__isrc=' -I$(srcdir)' 3467 am__isrc=' -I$(srcdir)'
3483 # test to see if srcdir already configured 3468 # test to see if srcdir already configured
3484 if test -f $srcdir/config.status; then 3469 if test -f $srcdir/config.status; then
3485 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 3470 as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
3486 fi 3471 fi
3487fi 3472fi
3488 3473
@@ -3685,7 +3670,7 @@ if test "${with_x_toolkit+set}" = set; then :
3685 g | gt | gtk ) val=gtk ;; 3670 g | gt | gtk ) val=gtk ;;
3686 gtk3 ) val=gtk3 ;; 3671 gtk3 ) val=gtk3 ;;
3687 * ) 3672 * )
3688as_fn_error $? "\`--with-x-toolkit=$withval' is invalid; 3673as_fn_error "\`--with-x-toolkit=$withval' is invalid;
3689this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk' or 3674this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk' or
3690\`gtk3'. \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5 3675\`gtk3'. \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5
3691 ;; 3676 ;;
@@ -3949,7 +3934,7 @@ fi
3949if test "${enable_maintainer_mode+set}" = set; then : 3934if test "${enable_maintainer_mode+set}" = set; then :
3950 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval 3935 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
3951else 3936else
3952 USE_MAINTAINER_MODE=no 3937 USE_MAINTAINER_MODE=yes
3953fi 3938fi
3954 3939
3955if test $USE_MAINTAINER_MODE = yes; then 3940if test $USE_MAINTAINER_MODE = yes; then
@@ -3998,7 +3983,7 @@ do
3998 stringfreelist) ac_gc_check_string_free_list=1 ;; 3983 stringfreelist) ac_gc_check_string_free_list=1 ;;
3999 xmallocoverrun) ac_xmalloc_overrun=1 ;; 3984 xmallocoverrun) ac_xmalloc_overrun=1 ;;
4000 conslist) ac_gc_check_cons_list=1 ;; 3985 conslist) ac_gc_check_cons_list=1 ;;
4001 *) as_fn_error $? "unknown check category $check" "$LINENO" 5 ;; 3986 *) as_fn_error "unknown check category $check" "$LINENO" 5 ;;
4002 esac 3987 esac
4003done 3988done
4004IFS="$ac_save_IFS" 3989IFS="$ac_save_IFS"
@@ -4113,7 +4098,7 @@ fi
4113 4098
4114# Make sure we can run config.sub. 4099# Make sure we can run config.sub.
4115$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || 4100$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
4116 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 4101 as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4117 4102
4118{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 4103{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
4119$as_echo_n "checking build system type... " >&6; } 4104$as_echo_n "checking build system type... " >&6; }
@@ -4124,16 +4109,16 @@ else
4124test "x$ac_build_alias" = x && 4109test "x$ac_build_alias" = x &&
4125 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` 4110 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
4126test "x$ac_build_alias" = x && 4111test "x$ac_build_alias" = x &&
4127 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 4112 as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
4128ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || 4113ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
4129 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 4114 as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4130 4115
4131fi 4116fi
4132{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 4117{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
4133$as_echo "$ac_cv_build" >&6; } 4118$as_echo "$ac_cv_build" >&6; }
4134case $ac_cv_build in 4119case $ac_cv_build in
4135*-*-*) ;; 4120*-*-*) ;;
4136*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; 4121*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
4137esac 4122esac
4138build=$ac_cv_build 4123build=$ac_cv_build
4139ac_save_IFS=$IFS; IFS='-' 4124ac_save_IFS=$IFS; IFS='-'
@@ -4158,7 +4143,7 @@ else
4158 ac_cv_host=$ac_cv_build 4143 ac_cv_host=$ac_cv_build
4159else 4144else
4160 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || 4145 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
4161 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 4146 as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4162fi 4147fi
4163 4148
4164fi 4149fi
@@ -4166,7 +4151,7 @@ fi
4166$as_echo "$ac_cv_host" >&6; } 4151$as_echo "$ac_cv_host" >&6; }
4167case $ac_cv_host in 4152case $ac_cv_host in
4168*-*-*) ;; 4153*-*-*) ;;
4169*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; 4154*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
4170esac 4155esac
4171host=$ac_cv_host 4156host=$ac_cv_host
4172ac_save_IFS=$IFS; IFS='-' 4157ac_save_IFS=$IFS; IFS='-'
@@ -4420,7 +4405,7 @@ fi
4420 4405
4421 4406
4422if test $unported = yes; then 4407if test $unported = yes; then
4423 as_fn_error $? "Emacs hasn't been ported to \`${canonical}' systems. 4408 as_fn_error "Emacs hasn't been ported to \`${canonical}' systems.
4424Check \`etc/MACHINES' for recognized configuration names." "$LINENO" 5 4409Check \`etc/MACHINES' for recognized configuration names." "$LINENO" 5
4425fi 4410fi
4426 4411
@@ -4738,8 +4723,8 @@ fi
4738 4723
4739test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 4724test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4740$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 4725$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4741as_fn_error $? "no acceptable C compiler found in \$PATH 4726as_fn_error "no acceptable C compiler found in \$PATH
4742See \`config.log' for more details" "$LINENO" 5 ; } 4727See \`config.log' for more details." "$LINENO" 5; }
4743 4728
4744# Provide some information about the compiler. 4729# Provide some information about the compiler.
4745$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 4730$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -4853,8 +4838,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
4853 4838
4854{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 4839{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4855$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 4840$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4856as_fn_error 77 "C compiler cannot create executables 4841{ as_fn_set_status 77
4857See \`config.log' for more details" "$LINENO" 5 ; } 4842as_fn_error "C compiler cannot create executables
4843See \`config.log' for more details." "$LINENO" 5; }; }
4858else 4844else
4859 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 4845 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4860$as_echo "yes" >&6; } 4846$as_echo "yes" >&6; }
@@ -4896,8 +4882,8 @@ done
4896else 4882else
4897 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 4883 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4898$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 4884$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4899as_fn_error $? "cannot compute suffix of executables: cannot compile and link 4885as_fn_error "cannot compute suffix of executables: cannot compile and link
4900See \`config.log' for more details" "$LINENO" 5 ; } 4886See \`config.log' for more details." "$LINENO" 5; }
4901fi 4887fi
4902rm -f conftest conftest$ac_cv_exeext 4888rm -f conftest conftest$ac_cv_exeext
4903{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 4889{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -4954,9 +4940,9 @@ $as_echo "$ac_try_echo"; } >&5
4954 else 4940 else
4955 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 4941 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4956$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 4942$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4957as_fn_error $? "cannot run C compiled programs. 4943as_fn_error "cannot run C compiled programs.
4958If you meant to cross compile, use \`--host'. 4944If you meant to cross compile, use \`--host'.
4959See \`config.log' for more details" "$LINENO" 5 ; } 4945See \`config.log' for more details." "$LINENO" 5; }
4960 fi 4946 fi
4961 fi 4947 fi
4962fi 4948fi
@@ -5007,8 +4993,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
5007 4993
5008{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 4994{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5009$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 4995$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5010as_fn_error $? "cannot compute suffix of object files: cannot compile 4996as_fn_error "cannot compute suffix of object files: cannot compile
5011See \`config.log' for more details" "$LINENO" 5 ; } 4997See \`config.log' for more details." "$LINENO" 5; }
5012fi 4998fi
5013rm -f conftest.$ac_cv_objext conftest.$ac_ext 4999rm -f conftest.$ac_cv_objext conftest.$ac_ext
5014fi 5000fi
@@ -5426,7 +5412,7 @@ $as_echo_n "checking whether cc understands -c and -o together... " >&6; }
5426fi 5412fi
5427set dummy $CC; ac_cc=`$as_echo "$2" | 5413set dummy $CC; ac_cc=`$as_echo "$2" |
5428 sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` 5414 sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
5429if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then : 5415if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then :
5430 $as_echo_n "(cached) " >&6 5416 $as_echo_n "(cached) " >&6
5431else 5417else
5432 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 5418 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5680,7 +5666,7 @@ else
5680 # Broken: fails on valid input. 5666 # Broken: fails on valid input.
5681continue 5667continue
5682fi 5668fi
5683rm -f conftest.err conftest.i conftest.$ac_ext 5669rm -f conftest.err conftest.$ac_ext
5684 5670
5685 # OK, works on sane cases. Now check whether nonexistent headers 5671 # OK, works on sane cases. Now check whether nonexistent headers
5686 # can be detected and how. 5672 # can be detected and how.
@@ -5696,11 +5682,11 @@ else
5696ac_preproc_ok=: 5682ac_preproc_ok=:
5697break 5683break
5698fi 5684fi
5699rm -f conftest.err conftest.i conftest.$ac_ext 5685rm -f conftest.err conftest.$ac_ext
5700 5686
5701done 5687done
5702# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. 5688# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5703rm -f conftest.i conftest.err conftest.$ac_ext 5689rm -f conftest.err conftest.$ac_ext
5704if $ac_preproc_ok; then : 5690if $ac_preproc_ok; then :
5705 break 5691 break
5706fi 5692fi
@@ -5739,7 +5725,7 @@ else
5739 # Broken: fails on valid input. 5725 # Broken: fails on valid input.
5740continue 5726continue
5741fi 5727fi
5742rm -f conftest.err conftest.i conftest.$ac_ext 5728rm -f conftest.err conftest.$ac_ext
5743 5729
5744 # OK, works on sane cases. Now check whether nonexistent headers 5730 # OK, works on sane cases. Now check whether nonexistent headers
5745 # can be detected and how. 5731 # can be detected and how.
@@ -5755,18 +5741,18 @@ else
5755ac_preproc_ok=: 5741ac_preproc_ok=:
5756break 5742break
5757fi 5743fi
5758rm -f conftest.err conftest.i conftest.$ac_ext 5744rm -f conftest.err conftest.$ac_ext
5759 5745
5760done 5746done
5761# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. 5747# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5762rm -f conftest.i conftest.err conftest.$ac_ext 5748rm -f conftest.err conftest.$ac_ext
5763if $ac_preproc_ok; then : 5749if $ac_preproc_ok; then :
5764 5750
5765else 5751else
5766 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 5752 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5767$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 5753$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5768as_fn_error $? "C preprocessor \"$CPP\" fails sanity check 5754as_fn_error "C preprocessor \"$CPP\" fails sanity check
5769See \`config.log' for more details" "$LINENO" 5 ; } 5755See \`config.log' for more details." "$LINENO" 5; }
5770fi 5756fi
5771 5757
5772ac_ext=c 5758ac_ext=c
@@ -5827,7 +5813,7 @@ esac
5827 done 5813 done
5828IFS=$as_save_IFS 5814IFS=$as_save_IFS
5829 if test -z "$ac_cv_path_GREP"; then 5815 if test -z "$ac_cv_path_GREP"; then
5830 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 5816 as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
5831 fi 5817 fi
5832else 5818else
5833 ac_cv_path_GREP=$GREP 5819 ac_cv_path_GREP=$GREP
@@ -5893,7 +5879,7 @@ esac
5893 done 5879 done
5894IFS=$as_save_IFS 5880IFS=$as_save_IFS
5895 if test -z "$ac_cv_path_EGREP"; then 5881 if test -z "$ac_cv_path_EGREP"; then
5896 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 5882 as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
5897 fi 5883 fi
5898else 5884else
5899 ac_cv_path_EGREP=$EGREP 5885 ac_cv_path_EGREP=$EGREP
@@ -6025,7 +6011,8 @@ do :
6025 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 6011 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
6026ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default 6012ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
6027" 6013"
6028if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 6014eval as_val=\$$as_ac_Header
6015 if test "x$as_val" = x""yes; then :
6029 cat >>confdefs.h <<_ACEOF 6016 cat >>confdefs.h <<_ACEOF
6030#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 6017#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
6031_ACEOF 6018_ACEOF
@@ -6356,7 +6343,7 @@ else
6356 # Broken: fails on valid input. 6343 # Broken: fails on valid input.
6357continue 6344continue
6358fi 6345fi
6359rm -f conftest.err conftest.i conftest.$ac_ext 6346rm -f conftest.err conftest.$ac_ext
6360 6347
6361 # OK, works on sane cases. Now check whether nonexistent headers 6348 # OK, works on sane cases. Now check whether nonexistent headers
6362 # can be detected and how. 6349 # can be detected and how.
@@ -6372,11 +6359,11 @@ else
6372ac_preproc_ok=: 6359ac_preproc_ok=:
6373break 6360break
6374fi 6361fi
6375rm -f conftest.err conftest.i conftest.$ac_ext 6362rm -f conftest.err conftest.$ac_ext
6376 6363
6377done 6364done
6378# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. 6365# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6379rm -f conftest.i conftest.err conftest.$ac_ext 6366rm -f conftest.err conftest.$ac_ext
6380if $ac_preproc_ok; then : 6367if $ac_preproc_ok; then :
6381 break 6368 break
6382fi 6369fi
@@ -6415,7 +6402,7 @@ else
6415 # Broken: fails on valid input. 6402 # Broken: fails on valid input.
6416continue 6403continue
6417fi 6404fi
6418rm -f conftest.err conftest.i conftest.$ac_ext 6405rm -f conftest.err conftest.$ac_ext
6419 6406
6420 # OK, works on sane cases. Now check whether nonexistent headers 6407 # OK, works on sane cases. Now check whether nonexistent headers
6421 # can be detected and how. 6408 # can be detected and how.
@@ -6431,18 +6418,18 @@ else
6431ac_preproc_ok=: 6418ac_preproc_ok=:
6432break 6419break
6433fi 6420fi
6434rm -f conftest.err conftest.i conftest.$ac_ext 6421rm -f conftest.err conftest.$ac_ext
6435 6422
6436done 6423done
6437# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. 6424# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6438rm -f conftest.i conftest.err conftest.$ac_ext 6425rm -f conftest.err conftest.$ac_ext
6439if $ac_preproc_ok; then : 6426if $ac_preproc_ok; then :
6440 6427
6441else 6428else
6442 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 6429 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6443$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 6430$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6444as_fn_error $? "C preprocessor \"$CPP\" fails sanity check 6431as_fn_error "C preprocessor \"$CPP\" fails sanity check
6445See \`config.log' for more details" "$LINENO" 5 ; } 6432See \`config.log' for more details." "$LINENO" 5; }
6446fi 6433fi
6447 6434
6448ac_ext=c 6435ac_ext=c
@@ -6790,7 +6777,7 @@ if test "$MAKEINFO" = "no"; then
6790 if test "x${with_makeinfo}" = "xno"; then 6777 if test "x${with_makeinfo}" = "xno"; then
6791 HAVE_MAKEINFO=no 6778 HAVE_MAKEINFO=no
6792 elif test ! -e $srcdir/info/emacs; then 6779 elif test ! -e $srcdir/info/emacs; then
6793 as_fn_error $? "You do not seem to have makeinfo >= 4.6, and your 6780 as_fn_error "You do not seem to have makeinfo >= 4.6, and your
6794source tree does not seem to have pre-built manuals in the \`info' directory. 6781source tree does not seem to have pre-built manuals in the \`info' directory.
6795Either install a suitable version of makeinfo, or re-run configure 6782Either install a suitable version of makeinfo, or re-run configure
6796with the \`--without-makeinfo' option to build without the manuals. " "$LINENO" 5 6783with the \`--without-makeinfo' option to build without the manuals. " "$LINENO" 5
@@ -6951,7 +6938,7 @@ fi
6951 if test "x$GCC" = "xyes"; then 6938 if test "x$GCC" = "xyes"; then
6952 C_SWITCH_MACHINE="-fno-common" 6939 C_SWITCH_MACHINE="-fno-common"
6953 else 6940 else
6954 as_fn_error $? "What gives? Fix me if DEC Unix supports ELF now." "$LINENO" 5 6941 as_fn_error "What gives? Fix me if DEC Unix supports ELF now." "$LINENO" 5
6955 fi 6942 fi
6956 else 6943 else
6957 UNEXEC_OBJ=unexalpha.o 6944 UNEXEC_OBJ=unexalpha.o
@@ -7227,7 +7214,7 @@ else
7227 ## Some platforms don't use any of these files, so it is not 7214 ## Some platforms don't use any of these files, so it is not
7228 ## appropriate to put this test outside the if block. 7215 ## appropriate to put this test outside the if block.
7229 test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \ 7216 test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \
7230 as_fn_error $? "crt*.o not found in specified location." "$LINENO" 5 7217 as_fn_error "crt*.o not found in specified location." "$LINENO" 5
7231 7218
7232fi 7219fi
7233 7220
@@ -7282,7 +7269,8 @@ if test "${with_sound}" != "no"; then
7282do : 7269do :
7283 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 7270 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7284ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 7271ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
7285if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 7272eval as_val=\$$as_ac_Header
7273 if test "x$as_val" = x""yes; then :
7286 cat >>confdefs.h <<_ACEOF 7274 cat >>confdefs.h <<_ACEOF
7287#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 7275#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7288_ACEOF 7276_ACEOF
@@ -7473,7 +7461,7 @@ else
7473fi 7461fi
7474rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 7462rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7475 if test "$emacs_alsa_subdir" != yes; then 7463 if test "$emacs_alsa_subdir" != yes; then
7476 as_fn_error $? "pkg-config found alsa, but it does not compile. See config.log for error messages." "$LINENO" 5 7464 as_fn_error "pkg-config found alsa, but it does not compile. See config.log for error messages." "$LINENO" 5
7477 fi 7465 fi
7478 ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE" 7466 ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
7479 fi 7467 fi
@@ -7508,7 +7496,8 @@ for ac_header in sys/select.h sys/time.h unistd.h utime.h \
7508do : 7496do :
7509 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 7497 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7510ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 7498ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
7511if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 7499eval as_val=\$$as_ac_Header
7500 if test "x$as_val" = x""yes; then :
7512 cat >>confdefs.h <<_ACEOF 7501 cat >>confdefs.h <<_ACEOF
7513#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 7502#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7514_ACEOF 7503_ACEOF
@@ -8563,8 +8552,8 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
8563 8552
8564 ;; #( 8553 ;; #(
8565 *) 8554 *)
8566 as_fn_error $? "unknown endianness 8555 as_fn_error "unknown endianness
8567 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; 8556 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
8568 esac 8557 esac
8569 8558
8570 8559
@@ -8603,7 +8592,7 @@ fi
8603$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } 8592$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
8604set x ${MAKE-make} 8593set x ${MAKE-make}
8605ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` 8594ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
8606if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : 8595if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
8607 $as_echo_n "(cached) " >&6 8596 $as_echo_n "(cached) " >&6
8608else 8597else
8609 cat >conftest.make <<\_ACEOF 8598 cat >conftest.make <<\_ACEOF
@@ -8611,7 +8600,7 @@ SHELL = /bin/sh
8611all: 8600all:
8612 @echo '@@@%%%=$(MAKE)=@@@%%%' 8601 @echo '@@@%%%=$(MAKE)=@@@%%%'
8613_ACEOF 8602_ACEOF
8614# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. 8603# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8615case `${MAKE-make} -f conftest.make 2>/dev/null` in 8604case `${MAKE-make} -f conftest.make 2>/dev/null` in
8616 *@@@%%%=?*=@@@%%%*) 8605 *@@@%%%=?*=@@@%%%*)
8617 eval ac_cv_prog_make_${ac_make}_set=yes;; 8606 eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -8747,7 +8736,7 @@ if test "x$with_x" = xno; then
8747 have_x=disabled 8736 have_x=disabled
8748else 8737else
8749 case $x_includes,$x_libraries in #( 8738 case $x_includes,$x_libraries in #(
8750 *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5 ;; #( 8739 *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #(
8751 *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : 8740 *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
8752 $as_echo_n "(cached) " >&6 8741 $as_echo_n "(cached) " >&6
8753else 8742else
@@ -8765,7 +8754,7 @@ libdir:
8765 @echo libdir='${LIBDIR}' 8754 @echo libdir='${LIBDIR}'
8766_ACEOF 8755_ACEOF
8767 if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then 8756 if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
8768 # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. 8757 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8769 for ac_var in incroot usrlibdir libdir; do 8758 for ac_var in incroot usrlibdir libdir; do
8770 eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" 8759 eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
8771 done 8760 done
@@ -8851,7 +8840,7 @@ else
8851 fi 8840 fi
8852done 8841done
8853fi 8842fi
8854rm -f conftest.err conftest.i conftest.$ac_ext 8843rm -f conftest.err conftest.$ac_ext
8855fi # $ac_x_includes = no 8844fi # $ac_x_includes = no
8856 8845
8857if test "$ac_x_libraries" = no; then 8846if test "$ac_x_libraries" = no; then
@@ -9034,7 +9023,7 @@ if test "${with_ns}" != no; then
9034if test "x$ac_cv_header_AppKit_AppKit_h" = x""yes; then : 9023if test "x$ac_cv_header_AppKit_AppKit_h" = x""yes; then :
9035 HAVE_NS=yes 9024 HAVE_NS=yes
9036else 9025else
9037 as_fn_error $? "\`--with-ns' was specified, but the include 9026 as_fn_error "\`--with-ns' was specified, but the include
9038 files are missing or cannot be compiled." "$LINENO" 5 9027 files are missing or cannot be compiled." "$LINENO" 5
9039fi 9028fi
9040 9029
@@ -9153,7 +9142,7 @@ fi
9153 if test "$HAVE_XSERVER" = true || 9142 if test "$HAVE_XSERVER" = true ||
9154 test -n "$DISPLAY" || 9143 test -n "$DISPLAY" ||
9155 test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then 9144 test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then
9156 as_fn_error $? "You seem to be running X, but no X development libraries 9145 as_fn_error "You seem to be running X, but no X development libraries
9157were found. You should install the relevant development files for X 9146were found. You should install the relevant development files for X
9158and for the toolkit you want, such as Gtk+, Lesstif or Motif. Also make 9147and for the toolkit you want, such as Gtk+, Lesstif or Motif. Also make
9159sure you have development files for image handling, i.e. 9148sure you have development files for image handling, i.e.
@@ -9276,7 +9265,8 @@ do :
9276 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 9265 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
9277ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default 9266ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
9278" 9267"
9279if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 9268eval as_val=\$$as_ac_Header
9269 if test "x$as_val" = x""yes; then :
9280 cat >>confdefs.h <<_ACEOF 9270 cat >>confdefs.h <<_ACEOF
9281#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 9271#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
9282_ACEOF 9272_ACEOF
@@ -9783,7 +9773,8 @@ XScreenNumberOfScreen XSetWMProtocols
9783do : 9773do :
9784 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 9774 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
9785ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 9775ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
9786if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 9776eval as_val=\$$as_ac_var
9777 if test "x$as_val" = x""yes; then :
9787 cat >>confdefs.h <<_ACEOF 9778 cat >>confdefs.h <<_ACEOF
9788#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 9779#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
9789_ACEOF 9780_ACEOF
@@ -10086,8 +10077,8 @@ fi
10086 10077
10087HAVE_GTK=no 10078HAVE_GTK=no
10088if test "${with_gtk3}" = "yes"; then 10079if test "${with_gtk3}" = "yes"; then
10089 GLIB_REQUIRED=2.6 10080 GLIB_REQUIRED=2.28
10090 GTK_REQUIRED=2.90 10081 GTK_REQUIRED=3.0
10091 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" 10082 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
10092 10083
10093 10084
@@ -10185,8 +10176,11 @@ $as_echo "no" >&6; }
10185 fi 10176 fi
10186 10177
10187 if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then 10178 if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
10188 as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5 10179 as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
10189 fi 10180 fi
10181
10182$as_echo "#define HAVE_GTK3 1" >>confdefs.h
10183
10190fi 10184fi
10191 10185
10192if test "$pkg_check_gtk" != "yes"; then 10186if test "$pkg_check_gtk" != "yes"; then
@@ -10291,7 +10285,7 @@ $as_echo "no" >&6; }
10291 fi 10285 fi
10292 10286
10293 if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then 10287 if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
10294 as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5 10288 as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
10295 fi 10289 fi
10296fi 10290fi
10297fi 10291fi
@@ -10318,7 +10312,7 @@ done
10318 10312
10319 if test "${GTK_COMPILES}" != "yes"; then 10313 if test "${GTK_COMPILES}" != "yes"; then
10320 if test "$USE_X_TOOLKIT" != "maybe"; then 10314 if test "$USE_X_TOOLKIT" != "maybe"; then
10321 as_fn_error $? "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5 ; 10315 as_fn_error "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5;
10322 fi 10316 fi
10323 else 10317 else
10324 HAVE_GTK=yes 10318 HAVE_GTK=yes
@@ -10448,7 +10442,8 @@ $as_echo "#define HAVE_GTK_AND_PTHREAD 1" >>confdefs.h
10448do : 10442do :
10449 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 10443 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
10450ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 10444ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
10451if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 10445eval as_val=\$$as_ac_var
10446 if test "x$as_val" = x""yes; then :
10452 cat >>confdefs.h <<_ACEOF 10447 cat >>confdefs.h <<_ACEOF
10453#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 10448#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
10454_ACEOF 10449_ACEOF
@@ -10970,7 +10965,7 @@ $as_echo "yes; using Lucid toolkit" >&6; }
10970 USE_X_TOOLKIT=LUCID 10965 USE_X_TOOLKIT=LUCID
10971 LUCID_LIBW=-lXaw 10966 LUCID_LIBW=-lXaw
10972 elif test x"${USE_X_TOOLKIT}" = xLUCID; then 10967 elif test x"${USE_X_TOOLKIT}" = xLUCID; then
10973 as_fn_error $? "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5 10968 as_fn_error "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5
10974 else 10969 else
10975 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; do not use toolkit by default" >&5 10970 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; do not use toolkit by default" >&5
10976$as_echo "no; do not use toolkit by default" >&6; } 10971$as_echo "no; do not use toolkit by default" >&6; }
@@ -11778,7 +11773,7 @@ $as_echo "no" >&6; }
11778 fi 11773 fi
11779 11774
11780 11775
11781 test "$HAVE_FREETYPE" = "no" && as_fn_error $? "libxft requires libfreetype" "$LINENO" 5 11776 test "$HAVE_FREETYPE" = "no" && as_fn_error "libxft requires libfreetype" "$LINENO" 5
11782 fi 11777 fi
11783 11778
11784 HAVE_LIBOTF=no 11779 HAVE_LIBOTF=no
@@ -12237,7 +12232,8 @@ if test "${HAVE_X11}" = "yes"; then
12237do : 12232do :
12238 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 12233 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12239ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 12234ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
12240if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 12235eval as_val=\$$as_ac_Header
12236 if test "x$as_val" = x""yes; then :
12241 cat >>confdefs.h <<_ACEOF 12237 cat >>confdefs.h <<_ACEOF
12242#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 12238#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12243_ACEOF 12239_ACEOF
@@ -12489,7 +12485,7 @@ if test "${HAVE_X11}" = "yes"; then
12489 MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no" 12485 MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
12490 12486
12491 if test "X${MISSING}" != X; then 12487 if test "X${MISSING}" != X; then
12492 as_fn_error $? "The following required libraries were not found: 12488 as_fn_error "The following required libraries were not found:
12493 $MISSING 12489 $MISSING
12494Maybe some development libraries/packages are missing? 12490Maybe some development libraries/packages are missing?
12495If you don't want to link with them give 12491If you don't want to link with them give
@@ -12978,7 +12974,8 @@ if test $ac_cv_os_cray = yes; then
12978 for ac_func in _getb67 GETB67 getb67; do 12974 for ac_func in _getb67 GETB67 getb67; do
12979 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 12975 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12980ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 12976ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12981if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 12977eval as_val=\$$as_ac_var
12978 if test "x$as_val" = x""yes; then :
12982 12979
12983cat >>confdefs.h <<_ACEOF 12980cat >>confdefs.h <<_ACEOF
12984#define CRAY_STACKSEG_END $ac_func 12981#define CRAY_STACKSEG_END $ac_func
@@ -13042,7 +13039,7 @@ fi
13042 13039
13043 13040
13044if test x"$ac_cv_func_alloca_works" != xyes; then 13041if test x"$ac_cv_func_alloca_works" != xyes; then
13045 as_fn_error $? "a system implementation of alloca is required " "$LINENO" 5 13042 as_fn_error "a system implementation of alloca is required " "$LINENO" 5
13046fi 13043fi
13047 13044
13048# fmod, logb, and frexp are found in -lm on most systems. 13045# fmod, logb, and frexp are found in -lm on most systems.
@@ -13238,7 +13235,7 @@ fi
13238 13235
13239 13236
13240 if test $ac_cv_prog_liblockfile = yes; then 13237 if test $ac_cv_prog_liblockfile = yes; then
13241 as_fn_error $? "Shared liblockfile found but can't link against it. 13238 as_fn_error "Shared liblockfile found but can't link against it.
13242This probably means that movemail could lose mail. 13239This probably means that movemail could lose mail.
13243There may be a \`development' package to install containing liblockfile." "$LINENO" 5 13240There may be a \`development' package to install containing liblockfile." "$LINENO" 5
13244 fi 13241 fi
@@ -13327,7 +13324,8 @@ cfmakeraw cfsetspeed isnan copysign __executable_start
13327do : 13324do :
13328 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 13325 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13329ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 13326ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13330if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 13327eval as_val=\$$as_ac_var
13328 if test "x$as_val" = x""yes; then :
13331 cat >>confdefs.h <<_ACEOF 13329 cat >>confdefs.h <<_ACEOF
13332#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 13330#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13333_ACEOF 13331_ACEOF
@@ -13719,8 +13717,8 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13719 13717
13720 ;; #( 13718 ;; #(
13721 *) 13719 *)
13722 as_fn_error $? "unknown endianness 13720 as_fn_error "unknown endianness
13723 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; 13721 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
13724 esac 13722 esac
13725 13723
13726 13724
@@ -14621,7 +14619,8 @@ fi
14621do : 14619do :
14622 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 14620 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
14623ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 14621ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
14624if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 14622eval as_val=\$$as_ac_var
14623 if test "x$as_val" = x""yes; then :
14625 cat >>confdefs.h <<_ACEOF 14624 cat >>confdefs.h <<_ACEOF
14626#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 14625#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
14627_ACEOF 14626_ACEOF
@@ -15353,7 +15352,7 @@ fi
15353 15352
15354# Make sure getloadavg.c is where it belongs, at configure-time. 15353# Make sure getloadavg.c is where it belongs, at configure-time.
15355test -f "$srcdir/$gl_source_base/getloadavg.c" || 15354test -f "$srcdir/$gl_source_base/getloadavg.c" ||
15356 as_fn_error $? "$srcdir/$gl_source_base/getloadavg.c is missing" "$LINENO" 5 15355 as_fn_error "$srcdir/$gl_source_base/getloadavg.c is missing" "$LINENO" 5
15357 15356
15358gl_save_LIBS=$LIBS 15357gl_save_LIBS=$LIBS
15359 15358
@@ -16951,7 +16950,8 @@ $as_echo "$gl_cv_header_working_stdint_h" >&6; }
16951do : 16950do :
16952 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 16951 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
16953ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 16952ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
16954if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 16953eval as_val=\$$as_ac_Header
16954 if test "x$as_val" = x""yes; then :
16955 cat >>confdefs.h <<_ACEOF 16955 cat >>confdefs.h <<_ACEOF
16956#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 16956#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
16957_ACEOF 16957_ACEOF
@@ -16981,7 +16981,7 @@ done
16981 for gltype in ptrdiff_t size_t ; do 16981 for gltype in ptrdiff_t size_t ; do
16982 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 16982 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
16983$as_echo_n "checking for bit size of $gltype... " >&6; } 16983$as_echo_n "checking for bit size of $gltype... " >&6; }
16984if eval "test \"\${gl_cv_bitsizeof_${gltype}+set}\"" = set; then : 16984if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then :
16985 $as_echo_n "(cached) " >&6 16985 $as_echo_n "(cached) " >&6
16986else 16986else
16987 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " 16987 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
@@ -17026,7 +17026,7 @@ _ACEOF
17026 for gltype in sig_atomic_t wchar_t wint_t ; do 17026 for gltype in sig_atomic_t wchar_t wint_t ; do
17027 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 17027 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
17028$as_echo_n "checking for bit size of $gltype... " >&6; } 17028$as_echo_n "checking for bit size of $gltype... " >&6; }
17029if eval "test \"\${gl_cv_bitsizeof_${gltype}+set}\"" = set; then : 17029if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then :
17030 $as_echo_n "(cached) " >&6 17030 $as_echo_n "(cached) " >&6
17031else 17031else
17032 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " 17032 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
@@ -17070,7 +17070,7 @@ _ACEOF
17070 for gltype in sig_atomic_t wchar_t wint_t ; do 17070 for gltype in sig_atomic_t wchar_t wint_t ; do
17071 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 17071 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
17072$as_echo_n "checking whether $gltype is signed... " >&6; } 17072$as_echo_n "checking whether $gltype is signed... " >&6; }
17073if eval "test \"\${gl_cv_type_${gltype}_signed+set}\"" = set; then : 17073if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then :
17074 $as_echo_n "(cached) " >&6 17074 $as_echo_n "(cached) " >&6
17075else 17075else
17076 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 17076 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -17129,7 +17129,7 @@ _ACEOF
17129 for gltype in ptrdiff_t size_t ; do 17129 for gltype in ptrdiff_t size_t ; do
17130 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 17130 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
17131$as_echo_n "checking for $gltype integer literal suffix... " >&6; } 17131$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
17132if eval "test \"\${gl_cv_type_${gltype}_suffix+set}\"" = set; then : 17132if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then :
17133 $as_echo_n "(cached) " >&6 17133 $as_echo_n "(cached) " >&6
17134else 17134else
17135 eval gl_cv_type_${gltype}_suffix=no 17135 eval gl_cv_type_${gltype}_suffix=no
@@ -17201,7 +17201,7 @@ _ACEOF
17201 for gltype in sig_atomic_t wchar_t wint_t ; do 17201 for gltype in sig_atomic_t wchar_t wint_t ; do
17202 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 17202 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
17203$as_echo_n "checking for $gltype integer literal suffix... " >&6; } 17203$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
17204if eval "test \"\${gl_cv_type_${gltype}_suffix+set}\"" = set; then : 17204if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then :
17205 $as_echo_n "(cached) " >&6 17205 $as_echo_n "(cached) " >&6
17206else 17206else
17207 eval gl_cv_type_${gltype}_suffix=no 17207 eval gl_cv_type_${gltype}_suffix=no
@@ -17811,7 +17811,7 @@ else
17811fi 17811fi
17812 17812
17813if test "$have_tputs_et_al" != true; then 17813if test "$have_tputs_et_al" != true; then
17814 as_fn_error $? "I couldn't find termcap functions (tputs and friends). 17814 as_fn_error "I couldn't find termcap functions (tputs and friends).
17815Maybe some development libraries/packages are missing? Try installing 17815Maybe some development libraries/packages are missing? Try installing
17816libncurses-dev(el), libterminfo-dev(el) or similar." "$LINENO" 5 17816libncurses-dev(el), libterminfo-dev(el) or similar." "$LINENO" 5
17817fi 17817fi
@@ -18937,7 +18937,8 @@ for ac_func in fork vfork
18937do : 18937do :
18938 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 18938 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
18939ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 18939ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
18940if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 18940eval as_val=\$$as_ac_var
18941 if test "x$as_val" = x""yes; then :
18941 cat >>confdefs.h <<_ACEOF 18942 cat >>confdefs.h <<_ACEOF
18942#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 18943#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
18943_ACEOF 18944_ACEOF
@@ -19257,7 +19258,7 @@ if test "x$GCC" = xyes \
19257 && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \ 19258 && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \
19258 && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \ 19259 && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \
19259 && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then 19260 && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then
19260 as_fn_error $? "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5 19261 as_fn_error "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
19261fi 19262fi
19262 19263
19263version=$PACKAGE_VERSION 19264version=$PACKAGE_VERSION
@@ -19833,7 +19834,6 @@ DEFS=-DHAVE_CONFIG_H
19833 19834
19834ac_libobjs= 19835ac_libobjs=
19835ac_ltlibobjs= 19836ac_ltlibobjs=
19836U=
19837for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue 19837for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
19838 # 1. Remove the extension, and $U if already installed. 19838 # 1. Remove the extension, and $U if already installed.
19839 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' 19839 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -19857,16 +19857,16 @@ else
19857fi 19857fi
19858 19858
19859if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then 19859if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
19860 as_fn_error $? "conditional \"AMDEP\" was never defined. 19860 as_fn_error "conditional \"AMDEP\" was never defined.
19861Usually this means the macro was only invoked conditionally." "$LINENO" 5 19861Usually this means the macro was only invoked conditionally." "$LINENO" 5
19862fi 19862fi
19863if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then 19863if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
19864 as_fn_error $? "conditional \"am__fastdepCC\" was never defined. 19864 as_fn_error "conditional \"am__fastdepCC\" was never defined.
19865Usually this means the macro was only invoked conditionally." "$LINENO" 5 19865Usually this means the macro was only invoked conditionally." "$LINENO" 5
19866fi 19866fi
19867 19867
19868if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then 19868if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
19869 as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. 19869 as_fn_error "conditional \"GL_COND_LIBTOOL\" was never defined.
19870Usually this means the macro was only invoked conditionally." "$LINENO" 5 19870Usually this means the macro was only invoked conditionally." "$LINENO" 5
19871fi 19871fi
19872 19872
@@ -20049,19 +20049,19 @@ export LANGUAGE
20049(unset CDPATH) >/dev/null 2>&1 && unset CDPATH 20049(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
20050 20050
20051 20051
20052# as_fn_error STATUS ERROR [LINENO LOG_FD] 20052# as_fn_error ERROR [LINENO LOG_FD]
20053# ---------------------------------------- 20053# ---------------------------------
20054# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are 20054# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
20055# provided, also output the error to LOG_FD, referencing LINENO. Then exit the 20055# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
20056# script with STATUS, using 1 if that was 0. 20056# script with status $?, using 1 if that was 0.
20057as_fn_error () 20057as_fn_error ()
20058{ 20058{
20059 as_status=$1; test $as_status -eq 0 && as_status=1 20059 as_status=$?; test $as_status -eq 0 && as_status=1
20060 if test "$4"; then 20060 if test "$3"; then
20061 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 20061 as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
20062 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 20062 $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
20063 fi 20063 fi
20064 $as_echo "$as_me: error: $2" >&2 20064 $as_echo "$as_me: error: $1" >&2
20065 as_fn_exit $as_status 20065 as_fn_exit $as_status
20066} # as_fn_error 20066} # as_fn_error
20067 20067
@@ -20257,7 +20257,7 @@ $as_echo X"$as_dir" |
20257 test -d "$as_dir" && break 20257 test -d "$as_dir" && break
20258 done 20258 done
20259 test -z "$as_dirs" || eval "mkdir $as_dirs" 20259 test -z "$as_dirs" || eval "mkdir $as_dirs"
20260 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" 20260 } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
20261 20261
20262 20262
20263} # as_fn_mkdir_p 20263} # as_fn_mkdir_p
@@ -20311,7 +20311,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20311# values after options handling. 20311# values after options handling.
20312ac_log=" 20312ac_log="
20313This file was extended by emacs $as_me 24.0.50, which was 20313This file was extended by emacs $as_me 24.0.50, which was
20314generated by GNU Autoconf 2.67. Invocation command line was 20314generated by GNU Autoconf 2.65. Invocation command line was
20315 20315
20316 CONFIG_FILES = $CONFIG_FILES 20316 CONFIG_FILES = $CONFIG_FILES
20317 CONFIG_HEADERS = $CONFIG_HEADERS 20317 CONFIG_HEADERS = $CONFIG_HEADERS
@@ -20377,10 +20377,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20377ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" 20377ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
20378ac_cs_version="\\ 20378ac_cs_version="\\
20379emacs config.status 24.0.50 20379emacs config.status 24.0.50
20380configured by $0, generated by GNU Autoconf 2.67, 20380configured by $0, generated by GNU Autoconf 2.65,
20381 with options \\"\$ac_cs_config\\" 20381 with options \\"\$ac_cs_config\\"
20382 20382
20383Copyright (C) 2010 Free Software Foundation, Inc. 20383Copyright (C) 2009 Free Software Foundation, Inc.
20384This config.status script is free software; the Free Software Foundation 20384This config.status script is free software; the Free Software Foundation
20385gives unlimited permission to copy, distribute and modify it." 20385gives unlimited permission to copy, distribute and modify it."
20386 20386
@@ -20398,16 +20398,11 @@ ac_need_defaults=:
20398while test $# != 0 20398while test $# != 0
20399do 20399do
20400 case $1 in 20400 case $1 in
20401 --*=?*) 20401 --*=*)
20402 ac_option=`expr "X$1" : 'X\([^=]*\)='` 20402 ac_option=`expr "X$1" : 'X\([^=]*\)='`
20403 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` 20403 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
20404 ac_shift=: 20404 ac_shift=:
20405 ;; 20405 ;;
20406 --*=)
20407 ac_option=`expr "X$1" : 'X\([^=]*\)='`
20408 ac_optarg=
20409 ac_shift=:
20410 ;;
20411 *) 20406 *)
20412 ac_option=$1 20407 ac_option=$1
20413 ac_optarg=$2 20408 ac_optarg=$2
@@ -20429,7 +20424,6 @@ do
20429 $ac_shift 20424 $ac_shift
20430 case $ac_optarg in 20425 case $ac_optarg in
20431 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; 20426 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
20432 '') as_fn_error $? "missing file argument" ;;
20433 esac 20427 esac
20434 as_fn_append CONFIG_FILES " '$ac_optarg'" 20428 as_fn_append CONFIG_FILES " '$ac_optarg'"
20435 ac_need_defaults=false;; 20429 ac_need_defaults=false;;
@@ -20442,7 +20436,7 @@ do
20442 ac_need_defaults=false;; 20436 ac_need_defaults=false;;
20443 --he | --h) 20437 --he | --h)
20444 # Conflict between --help and --header 20438 # Conflict between --help and --header
20445 as_fn_error $? "ambiguous option: \`$1' 20439 as_fn_error "ambiguous option: \`$1'
20446Try \`$0 --help' for more information.";; 20440Try \`$0 --help' for more information.";;
20447 --help | --hel | -h ) 20441 --help | --hel | -h )
20448 $as_echo "$ac_cs_usage"; exit ;; 20442 $as_echo "$ac_cs_usage"; exit ;;
@@ -20451,7 +20445,7 @@ Try \`$0 --help' for more information.";;
20451 ac_cs_silent=: ;; 20445 ac_cs_silent=: ;;
20452 20446
20453 # This is an error. 20447 # This is an error.
20454 -*) as_fn_error $? "unrecognized option: \`$1' 20448 -*) as_fn_error "unrecognized option: \`$1'
20455Try \`$0 --help' for more information." ;; 20449Try \`$0 --help' for more information." ;;
20456 20450
20457 *) as_fn_append ac_config_targets " $1" 20451 *) as_fn_append ac_config_targets " $1"
@@ -20525,7 +20519,7 @@ do
20525 "epaths") CONFIG_COMMANDS="$CONFIG_COMMANDS epaths" ;; 20519 "epaths") CONFIG_COMMANDS="$CONFIG_COMMANDS epaths" ;;
20526 "gdbinit") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbinit" ;; 20520 "gdbinit") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbinit" ;;
20527 20521
20528 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; 20522 *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
20529 esac 20523 esac
20530done 20524done
20531 20525
@@ -20563,7 +20557,7 @@ $debug ||
20563{ 20557{
20564 tmp=./conf$$-$RANDOM 20558 tmp=./conf$$-$RANDOM
20565 (umask 077 && mkdir "$tmp") 20559 (umask 077 && mkdir "$tmp")
20566} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 20560} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
20567 20561
20568# Set up the scripts for CONFIG_FILES section. 20562# Set up the scripts for CONFIG_FILES section.
20569# No need to generate them if there are no CONFIG_FILES. 20563# No need to generate them if there are no CONFIG_FILES.
@@ -20597,7 +20591,7 @@ if test "x$ac_cr" = x; then
20597fi 20591fi
20598ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` 20592ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
20599if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then 20593if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
20600 ac_cs_awk_cr='\\r' 20594 ac_cs_awk_cr='\r'
20601else 20595else
20602 ac_cs_awk_cr=$ac_cr 20596 ac_cs_awk_cr=$ac_cr
20603fi 20597fi
@@ -20614,7 +20608,7 @@ _ACEOF
20614 echo "_ACEOF" 20608 echo "_ACEOF"
20615} >conf$$files.sh && 20609} >conf$$files.sh &&
20616. ./conf$$files.sh || 20610. ./conf$$files.sh ||
20617 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 20611 as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
20618rm -f conf$$files.sh 20612rm -f conf$$files.sh
20619 20613
20620{ 20614{
@@ -20622,18 +20616,18 @@ rm -f conf$$files.sh
20622 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && 20616 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
20623 echo "_ACEOF" 20617 echo "_ACEOF"
20624} >conf$$subs.sh || 20618} >conf$$subs.sh ||
20625 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 20619 as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
20626ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` 20620ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
20627ac_delim='%!_!# ' 20621ac_delim='%!_!# '
20628for ac_last_try in false false false false false :; do 20622for ac_last_try in false false false false false :; do
20629 . ./conf$$subs.sh || 20623 . ./conf$$subs.sh ||
20630 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 20624 as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
20631 20625
20632 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` 20626 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
20633 if test $ac_delim_n = $ac_delim_num; then 20627 if test $ac_delim_n = $ac_delim_num; then
20634 break 20628 break
20635 elif $ac_last_try; then 20629 elif $ac_last_try; then
20636 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 20630 as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
20637 else 20631 else
20638 ac_delim="$ac_delim!$ac_delim _$ac_delim!! " 20632 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
20639 fi 20633 fi
@@ -20728,28 +20722,20 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
20728else 20722else
20729 cat 20723 cat
20730fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ 20724fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
20731 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 20725 || as_fn_error "could not setup config files machinery" "$LINENO" 5
20732_ACEOF 20726_ACEOF
20733 20727
20734# VPATH may cause trouble with some makes, so we remove sole $(srcdir), 20728# VPATH may cause trouble with some makes, so we remove $(srcdir),
20735# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and 20729# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
20736# trailing colons and then remove the whole line if VPATH becomes empty 20730# trailing colons and then remove the whole line if VPATH becomes empty
20737# (actually we leave an empty line to preserve line numbers). 20731# (actually we leave an empty line to preserve line numbers).
20738if test "x$srcdir" = x.; then 20732if test "x$srcdir" = x.; then
20739 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ 20733 ac_vpsub='/^[ ]*VPATH[ ]*=/{
20740h 20734s/:*\$(srcdir):*/:/
20741s/// 20735s/:*\${srcdir}:*/:/
20742s/^/:/ 20736s/:*@srcdir@:*/:/
20743s/[ ]*$/:/ 20737s/^\([^=]*=[ ]*\):*/\1/
20744s/:\$(srcdir):/:/g
20745s/:\${srcdir}:/:/g
20746s/:@srcdir@:/:/g
20747s/^:*//
20748s/:*$// 20738s/:*$//
20749x
20750s/\(=[ ]*\).*/\1/
20751G
20752s/\n//
20753s/^[^=]*=[ ]*$// 20739s/^[^=]*=[ ]*$//
20754}' 20740}'
20755fi 20741fi
@@ -20777,7 +20763,7 @@ for ac_last_try in false false :; do
20777 if test -z "$ac_t"; then 20763 if test -z "$ac_t"; then
20778 break 20764 break
20779 elif $ac_last_try; then 20765 elif $ac_last_try; then
20780 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 20766 as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
20781 else 20767 else
20782 ac_delim="$ac_delim!$ac_delim _$ac_delim!! " 20768 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
20783 fi 20769 fi
@@ -20862,7 +20848,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20862_ACAWK 20848_ACAWK
20863_ACEOF 20849_ACEOF
20864cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 20850cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20865 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 20851 as_fn_error "could not setup config headers machinery" "$LINENO" 5
20866fi # test -n "$CONFIG_HEADERS" 20852fi # test -n "$CONFIG_HEADERS"
20867 20853
20868 20854
@@ -20875,7 +20861,7 @@ do
20875 esac 20861 esac
20876 case $ac_mode$ac_tag in 20862 case $ac_mode$ac_tag in
20877 :[FHL]*:*);; 20863 :[FHL]*:*);;
20878 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; 20864 :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
20879 :[FH]-) ac_tag=-:-;; 20865 :[FH]-) ac_tag=-:-;;
20880 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; 20866 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
20881 esac 20867 esac
@@ -20903,7 +20889,7 @@ do
20903 [\\/$]*) false;; 20889 [\\/$]*) false;;
20904 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; 20890 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
20905 esac || 20891 esac ||
20906 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; 20892 as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
20907 esac 20893 esac
20908 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac 20894 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
20909 as_fn_append ac_file_inputs " '$ac_f'" 20895 as_fn_append ac_file_inputs " '$ac_f'"
@@ -20930,7 +20916,7 @@ $as_echo "$as_me: creating $ac_file" >&6;}
20930 20916
20931 case $ac_tag in 20917 case $ac_tag in
20932 *:-:* | *:-) cat >"$tmp/stdin" \ 20918 *:-:* | *:-) cat >"$tmp/stdin" \
20933 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; 20919 || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
20934 esac 20920 esac
20935 ;; 20921 ;;
20936 esac 20922 esac
@@ -21072,22 +21058,22 @@ if $ac_cs_awk_getline; then
21072else 21058else
21073 $AWK -f "$tmp/subs.awk" | $SHELL 21059 $AWK -f "$tmp/subs.awk" | $SHELL
21074fi >$tmp/out \ 21060fi >$tmp/out \
21075 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 21061 || as_fn_error "could not create $ac_file" "$LINENO" 5
21076 21062
21077test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && 21063test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
21078 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && 21064 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
21079 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && 21065 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
21080 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' 21066 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
21081which seems to be undefined. Please make sure it is defined" >&5 21067which seems to be undefined. Please make sure it is defined." >&5
21082$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' 21068$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
21083which seems to be undefined. Please make sure it is defined" >&2;} 21069which seems to be undefined. Please make sure it is defined." >&2;}
21084 21070
21085 rm -f "$tmp/stdin" 21071 rm -f "$tmp/stdin"
21086 case $ac_file in 21072 case $ac_file in
21087 -) cat "$tmp/out" && rm -f "$tmp/out";; 21073 -) cat "$tmp/out" && rm -f "$tmp/out";;
21088 *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; 21074 *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
21089 esac \ 21075 esac \
21090 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 21076 || as_fn_error "could not create $ac_file" "$LINENO" 5
21091 ;; 21077 ;;
21092 :H) 21078 :H)
21093 # 21079 #
@@ -21098,19 +21084,19 @@ which seems to be undefined. Please make sure it is defined" >&2;}
21098 $as_echo "/* $configure_input */" \ 21084 $as_echo "/* $configure_input */" \
21099 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" 21085 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
21100 } >"$tmp/config.h" \ 21086 } >"$tmp/config.h" \
21101 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 21087 || as_fn_error "could not create $ac_file" "$LINENO" 5
21102 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then 21088 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
21103 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 21089 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
21104$as_echo "$as_me: $ac_file is unchanged" >&6;} 21090$as_echo "$as_me: $ac_file is unchanged" >&6;}
21105 else 21091 else
21106 rm -f "$ac_file" 21092 rm -f "$ac_file"
21107 mv "$tmp/config.h" "$ac_file" \ 21093 mv "$tmp/config.h" "$ac_file" \
21108 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 21094 || as_fn_error "could not create $ac_file" "$LINENO" 5
21109 fi 21095 fi
21110 else 21096 else
21111 $as_echo "/* $configure_input */" \ 21097 $as_echo "/* $configure_input */" \
21112 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ 21098 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
21113 || as_fn_error $? "could not create -" "$LINENO" 5 21099 || as_fn_error "could not create -" "$LINENO" 5
21114 fi 21100 fi
21115# Compute "$ac_file"'s index in $config_headers. 21101# Compute "$ac_file"'s index in $config_headers.
21116_am_arg="$ac_file" 21102_am_arg="$ac_file"
@@ -21275,7 +21261,7 @@ _ACEOF
21275ac_clean_files=$ac_clean_files_save 21261ac_clean_files=$ac_clean_files_save
21276 21262
21277test $ac_write_fail = 0 || 21263test $ac_write_fail = 0 ||
21278 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 21264 as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
21279 21265
21280 21266
21281# configure is writing to config.log, and then calls config.status. 21267# configure is writing to config.log, and then calls config.status.
@@ -21296,7 +21282,7 @@ if test "$no_create" != yes; then
21296 exec 5>>config.log 21282 exec 5>>config.log
21297 # Use ||, not &&, to avoid exiting from the if with $? = 1, which 21283 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
21298 # would make configure fail if this is the last instruction. 21284 # would make configure fail if this is the last instruction.
21299 $ac_cs_success || as_fn_exit 1 21285 $ac_cs_success || as_fn_exit $?
21300fi 21286fi
21301if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then 21287if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
21302 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 21288 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
diff --git a/autogen/copy_autogen b/autogen/copy_autogen
new file mode 100755
index 00000000000..4abdbd87c0f
--- /dev/null
+++ b/autogen/copy_autogen
@@ -0,0 +1,20 @@
1#!/bin/sh
2
3## Helper script for those building Emacs from bzr without autoconf etc.
4## This installs some pre-generated versions of the automatically
5## generated files. It is highly recommended to install the necessary
6## tools instead of using this. Note that if eg configure.in
7## is updated, the next time you run make it will attempt to
8## regenerate configure and will fail if you do not have the required
9## tools. You will have to run this script again.
10
11if test ! -e config.in; then
12 echo "You must run this script from the autogen/ directory."
13 exit 1
14fi
15
16cp configure aclocal.m4 ../
17cp config.in ../src/
18cp Makefile.in ../lib/
19
20echo "You can now run configure"
diff --git a/autogen/update_autogen b/autogen/update_autogen
new file mode 100755
index 00000000000..0b26dd27d2b
--- /dev/null
+++ b/autogen/update_autogen
@@ -0,0 +1,183 @@
1#!/bin/bash
2### update_autogen - update the generated files in Emacs autogen/ directory
3
4## Copyright (C) 2011 Free Software Foundation, Inc.
5
6## Author: Glenn Morris <rgm@gnu.org>
7
8## This file is part of GNU Emacs.
9
10## GNU Emacs is free software: you can redistribute it and/or modify
11## it under the terms of the GNU General Public License as published by
12## the Free Software Foundation, either version 3 of the License, or
13## (at your option) any later version.
14
15## GNU Emacs is distributed in the hope that it will be useful,
16## but WITHOUT ANY WARRANTY; without even the implied warranty of
17## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18## GNU General Public License for more details.
19
20## You should have received a copy of the GNU General Public License
21## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22
23### Commentary:
24
25## This is a helper script to update the pre-built generated files in
26## the autogen/ directory. This is suitable for running from cron.
27## Only Emacs maintainers need use this, so it uses bash features.
28
29### Code:
30
31function die () # write error to stderr and exit
32{
33 [ $# -gt 0 ] && echo "$PN: $@" >&2
34 exit 1
35}
36
37PN=${0##*/} # basename of script
38PD=${0%/*}
39
40[ "$PD" = "$0" ] && PD=. # if PATH includes PWD
41
42## This should be the autogen directory.
43cd $PD
44cd ../
45[ -d autogen ] || die "Could not locate autogen directory"
46
47
48function usage ()
49{
50 cat 1>&2 <<EOF
51Usage: ${PN} [-f] [-c] [-q]
52Update the generated files in the Emacs autogen/ directory.
53Options:
54-f: force an update even if the source files are locally modified.
55-c: if the update succeeds and the generated files are modified,
56 commit them (caution).
57-q: be quiet; only give error messages, not status messages.
58EOF
59 exit 1
60}
61
62
63## Defaults.
64
65force=
66commit=
67quiet=
68
69## Parameters.
70sources="configure.in lib/Makefile.am"
71genfiles="configure aclocal.m4 src/config.in lib/Makefile.in"
72
73for g in $genfiles; do
74 basegen="$basegen ${g##*/}"
75done
76
77[ "$basegen" ] || die "internal error"
78
79tempfile=/tmp/$PN.$$
80
81trap "rm -f $tempfile 2> /dev/null" EXIT
82
83
84while getopts ":hcfq" option ; do
85 case $option in
86 (h) usage ;;
87
88 (c) commit=1 ;;
89
90 (f) force=1 ;;
91
92 (q) quiet=1 ;;
93
94 (\?) die "Bad option -$OPTARG" ;;
95
96 (:) die "Option -$OPTARG requires an argument" ;;
97
98 (*) die "getopts error" ;;
99 esac
100done
101shift $(( --OPTIND ))
102OPTIND=1
103
104[ $# -eq 0 ] || die "Wrong number of arguments"
105
106
107function msg ()
108{
109 [ "$quiet" ] && return 0
110 echo "$@"
111} # function msg
112
113
114msg "Running bzr status..."
115
116bzr status -S $sources >| $tempfile || die "bzr status error for sources"
117
118while read stat file; do
119
120 case $stat in
121 M)
122 msg "Locally modified: $file"
123 [ "$force" ] || die "There are local modifications"
124 ;;
125
126 *) die "Unexpected status ($stat) for $file" ;;
127 esac
128done < $tempfile
129
130
131msg "Running autoreconf..."
132
133autoreconf -I m4 || die "autoreconf error"
134
135
136cp $genfiles autogen/
137
138
139cd autogen
140
141
142bzr status -S $basegen >| $tempfile || \
143 die "bzr status error for generated files"
144
145
146modified=
147
148while read stat file; do
149
150 [ "$stat" != "M" ] && die "Unexpected status ($stat) for generated $file"
151
152 modified="$modified $file"
153
154done < $tempfile
155
156
157[ "$modified" ] || {
158 msg "No files were modified"
159 exit 0
160}
161
162msg "Modified file(s): $modified"
163
164[ "$commit" ] || exit 0
165
166
167msg "Committing..."
168
169## bzr status output is annoyingly always relative to top-level, not PWD.
170cd ../
171
172opt=
173[ "$quiet" ] || opt=-q
174
175bzr commit $opt -m "Auto-commit of generated files." $modified || \
176 die "bzr commit error"
177
178
179msg "Committed files: $modified"
180
181exit
182
183### update_autogen ends here
diff --git a/configure.in b/configure.in
index 69d1a1e5bd3..b38aa976259 100644
--- a/configure.in
+++ b/configure.in
@@ -229,7 +229,7 @@ AC_ARG_ENABLE(maintainer-mode,
229 [enable make rules and dependencies not useful (and sometimes 229 [enable make rules and dependencies not useful (and sometimes
230 confusing) to the casual installer])], 230 confusing) to the casual installer])],
231 USE_MAINTAINER_MODE=$enableval, 231 USE_MAINTAINER_MODE=$enableval,
232 USE_MAINTAINER_MODE=no) 232 USE_MAINTAINER_MODE=yes)
233if test $USE_MAINTAINER_MODE = yes; then 233if test $USE_MAINTAINER_MODE = yes; then
234 MAINT= 234 MAINT=
235else 235else
@@ -1826,8 +1826,8 @@ fi
1826 1826
1827HAVE_GTK=no 1827HAVE_GTK=no
1828if test "${with_gtk3}" = "yes"; then 1828if test "${with_gtk3}" = "yes"; then
1829 GLIB_REQUIRED=2.6 1829 GLIB_REQUIRED=2.28
1830 GTK_REQUIRED=2.90 1830 GTK_REQUIRED=3.0
1831 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" 1831 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
1832 1832
1833 dnl Checks for libraries. 1833 dnl Checks for libraries.
@@ -1835,6 +1835,7 @@ if test "${with_gtk3}" = "yes"; then
1835 if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then 1835 if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
1836 AC_MSG_ERROR($GTK_PKG_ERRORS) 1836 AC_MSG_ERROR($GTK_PKG_ERRORS)
1837 fi 1837 fi
1838 AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
1838fi 1839fi
1839 1840
1840if test "$pkg_check_gtk" != "yes"; then 1841if test "$pkg_check_gtk" != "yes"; then
@@ -2256,7 +2257,7 @@ if test "${HAVE_X11}" = "yes"; then
2256 dnl if -lfreetype is not specified. 2257 dnl if -lfreetype is not specified.
2257 dnl The following is needed to set FREETYPE_LIBS. 2258 dnl The following is needed to set FREETYPE_LIBS.
2258 PKG_CHECK_MODULES(FREETYPE, freetype2, HAVE_FREETYPE=yes, 2259 PKG_CHECK_MODULES(FREETYPE, freetype2, HAVE_FREETYPE=yes,
2259 HAVE_FREETYPE=no) 2260 HAVE_FREETYPE=no)
2260 2261
2261 test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(libxft requires libfreetype) 2262 test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(libxft requires libfreetype)
2262 fi 2263 fi
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index dfdef6a0b05..a30ffc07971 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,40 @@
12011-03-12 Eli Zaretskii <eliz@gnu.org>
2
3 * msdog.texi (Windows HOME): Fix the wording to clarify how Emacs sets
4 HOME on Windows and where it looks for init files. (Bug#8221)
5
62011-03-10 Eli Zaretskii <eliz@gnu.org>
7
8 * search.texi (Regexp Example):
9 * mule.texi (International Chars):
10 * building.texi (External Lisp): Don't use characters outside
11 ISO-8859-1.
12
132011-03-09 Eli Zaretskii <eliz@gnu.org>
14
15 * ack.texi (Acknowledgments): Convert to ISO-8859-1 encoding. Use
16 Texinfo @-commands for non Latin-1 characters.
17
18 * makefile.w32-in (MAKEINFO_OPTS): Add --enable-encoding.
19
20 * custom.texi (Init File): Add index entries for ".emacs".
21 (Bug#8210)
22
232011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24
25 * xresources.texi (GTK resources): ~/.emacs.d/gtkrc does not work
26 for Gtk+ 3.
27
282011-03-08 Glenn Morris <rgm@gnu.org>
29
30 * Makefile.in (MAKEINFO_OPTS): Add --enable-encoding.
31 * emacs.texi (Acknowledgments):
32 * ack.texi (Acknowledgments): Names to UTF-8.
33 * emacs.texi: Set documentencoding.
34
35 * display.texi (Optional Mode Line): Don't mention exactly where
36 display-time appears. (Bug#8193)
37
12011-03-06 Chong Yidong <cyd@stupidchicken.com> 382011-03-06 Chong Yidong <cyd@stupidchicken.com>
2 39
3 * search.texi (Isearch Yank): C-y now bound to isearch-yank-kill. 40 * search.texi (Isearch Yank): C-y now bound to isearch-yank-kill.
diff --git a/doc/emacs/Makefile.in b/doc/emacs/Makefile.in
index 0ba396e6427..ae142dba6e6 100644
--- a/doc/emacs/Makefile.in
+++ b/doc/emacs/Makefile.in
@@ -38,7 +38,7 @@ texinfodir = $(srcdir)/../misc
38# The makeinfo program is part of the Texinfo distribution. 38# The makeinfo program is part of the Texinfo distribution.
39# Use --force so that it generates output even if there are errors. 39# Use --force so that it generates output even if there are errors.
40MAKEINFO = @MAKEINFO@ 40MAKEINFO = @MAKEINFO@
41MAKEINFO_OPTS = --force -I $(srcdir) 41MAKEINFO_OPTS = --force --enable-encoding -I $(srcdir)
42 42
43TEXI2DVI = texi2dvi 43TEXI2DVI = texi2dvi
44TEXI2PDF = texi2pdf 44TEXI2PDF = texi2pdf
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi
index d49fd7b7c60..debe7149cb5 100644
--- a/doc/emacs/ack.texi
+++ b/doc/emacs/ack.texi
@@ -1,3 +1,4 @@
1@c -*- coding: iso-latin-1 -*-
1@c This is part of the Emacs manual. 2@c This is part of the Emacs manual.
2@c Copyright (C) 1994-1997, 1999-2011 Free Software Foundation, Inc. 3@c Copyright (C) 1994-1997, 1999-2011 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
@@ -51,7 +52,7 @@ files.
51Michael Albinus wrote @file{dbus.el}, a package that implements the 52Michael Albinus wrote @file{dbus.el}, a package that implements the
52D-Bus message bus protocol; @file{zeroconf.el}, a mode for browsing 53D-Bus message bus protocol; @file{zeroconf.el}, a mode for browsing
53Avahi services; and @file{xesam.el}, a Xesam-based search engine 54Avahi services; and @file{xesam.el}, a Xesam-based search engine
54interface. He and Kai Gro@ss{}johann wrote the Tramp package, which 55interface. He and Kai Großjohann wrote the Tramp package, which
55provides transparent remote file editing using rcp, ssh, ftp, and 56provides transparent remote file editing using rcp, ssh, ftp, and
56other network protocols. He and Daniel Pittman wrote 57other network protocols. He and Daniel Pittman wrote
57@file{tramp-cache.el}. 58@file{tramp-cache.el}.
@@ -190,7 +191,7 @@ prior to Emacs 23 for Mac OS.
190@item 191@item
191Chong Yidong was the Emacs co-maintainer for Emacs 23. He made many 192Chong Yidong was the Emacs co-maintainer for Emacs 23. He made many
192improvements to the Emacs display engine; and, together with Kai 193improvements to the Emacs display engine; and, together with Kai
193Gro@ss{}johann and Alex Schroeder, wrote @file{longlines.el}, a minor 194Großjohann and Alex Schroeder, wrote @file{longlines.el}, a minor
194mode for wrapping long lines. 195mode for wrapping long lines.
195 196
196@item 197@item
@@ -248,7 +249,7 @@ text replace the current selection.
248Eric Ding wrote @file{goto-addr.el}, 249Eric Ding wrote @file{goto-addr.el},
249 250
250@item 251@item
251Jan Dj@"{a}rv added support for the GTK+ toolkit and X drag-and-drop. 252Jan Djärv added support for the GTK+ toolkit and X drag-and-drop.
252 253
253@item 254@item
254Carsten Dominik wrote Ref@TeX{}, a package for setting up labels and 255Carsten Dominik wrote Ref@TeX{}, a package for setting up labels and
@@ -283,7 +284,7 @@ folders have mail waiting in them; and @file{iswitchb.el}, a feature
283for incremental reading and completion of buffer names. 284for incremental reading and completion of buffer names.
284 285
285@item 286@item
286Torbj@"orn Einarsson wrote @file{f90.el}, a mode for Fortran 90 files. 287Torbjörn Einarsson wrote @file{f90.el}, a mode for Fortran 90 files.
287 288
288@item 289@item
289Tsugutomo Enami co-wrote the support for international character sets. 290Tsugutomo Enami co-wrote the support for international character sets.
@@ -349,7 +350,7 @@ Kevin Gallo added multiple-frame support for Windows NT and wrote
349@file{w32-win.el}, support functions for the MS-Windows window system. 350@file{w32-win.el}, support functions for the MS-Windows window system.
350 351
351@item 352@item
352Juan Le@'{o}n Lahoz Garc@'{i}a wrote @file{wdired.el}, a package for 353Juan León Lahoz García wrote @file{wdired.el}, a package for
353performing file operations by directly editing Dired buffers. 354performing file operations by directly editing Dired buffers.
354 355
355@item 356@item
@@ -483,8 +484,8 @@ Emacs: @file{dns.el} for Domain Name Service lookups;
483@file{netrc.el} for parsing of @file{.netrc} files; and 484@file{netrc.el} for parsing of @file{.netrc} files; and
484@file{time-date.el} for general date and time handling. Components of 485@file{time-date.el} for general date and time handling. Components of
485Gnus have also been written by: Nagy Andras, David Blacka, Scott Byer, 486Gnus have also been written by: Nagy Andras, David Blacka, Scott Byer,
486Kevin Greiner, Kai Gro@ss{}johann, Joe Hildebrand, Paul Jarc, Sascha 487Kevin Greiner, Kai Großjohann, Joe Hildebrand, Paul Jarc, Sascha
487L@"{u}decke, David Moore, Jim Radford, Benjamin Rutt, Raymond Scholz, 488Lüdecke, David Moore, Jim Radford, Benjamin Rutt, Raymond Scholz,
488Thomas Steffen, Reiner Steib, Didier Verna, Ilja Weis, Katsumi Yamaoka, 489Thomas Steffen, Reiner Steib, Didier Verna, Ilja Weis, Katsumi Yamaoka,
489Teodor Zlatanov, and others (@pxref{Contributors,,,gnus, the Gnus Manual}). 490Teodor Zlatanov, and others (@pxref{Contributors,,,gnus, the Gnus Manual}).
490 491
@@ -524,7 +525,7 @@ S/MIME and Sieve components; and @file{tls.el} and @file{starttls.el}
524for the Transport Layer Security protocol. 525for the Transport Layer Security protocol.
525 526
526@item 527@item
527Arne J@o{}rgensen wrote @file{latexenc.el}, a package to 528Arne Jørgensen wrote @file{latexenc.el}, a package to
528automatically guess the correct coding system in LaTeX files. 529automatically guess the correct coding system in LaTeX files.
529 530
530@item 531@item
@@ -576,7 +577,7 @@ files and running a PostScript interpreter interactively from within
576Emacs. 577Emacs.
577 578
578@item 579@item
579Karel Kl@'{@dotless{i}}@v{c} contributed SELinux support, for preserving the 580Karel Klí@v{c} contributed SELinux support, for preserving the
580Security-Enchanced Linux context of files on backup and copy. 581Security-Enchanced Linux context of files on backup and copy.
581 582
582@item 583@item
@@ -667,9 +668,8 @@ directory-local variables; and the @code{info-finder} feature that
667creates a virtual Info manual of package keywords. 668creates a virtual Info manual of package keywords.
668 669
669@item 670@item
670K@'{a}roly L@H{o}rentey wrote the ``multi-terminal'' code, which 671Károly L@H{o}rentey wrote the ``multi-terminal'' code, which allows Emacs to
671allows Emacs to run on graphical and text-only terminals 672run on graphical and text-only terminals simultaneously.
672simultaneously.
673 673
674@item 674@item
675Martin Lorentzon wrote @file{vc-annotate.el}, support for version 675Martin Lorentzon wrote @file{vc-annotate.el}, support for version
@@ -933,7 +933,7 @@ Fred Pierresteguy and Paul Reilly made Emacs work with X Toolkit
933widgets. 933widgets.
934 934
935@item 935@item
936Fran@,{c}ois Pinard, Greg McGary, and Bruno Haible wrote @file{po.el}, 936François Pinard, Greg McGary, and Bruno Haible wrote @file{po.el},
937support for PO translation files. 937support for PO translation files.
938 938
939@item 939@item
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 1a02e92b67f..a07e7582011 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -1056,7 +1056,7 @@ Show file information or library names in threads buffer.
1056Show addresses for thread frames in threads buffer. 1056Show addresses for thread frames in threads buffer.
1057@end table 1057@end table
1058 1058
1059 It’s possible to observe information for several threads 1059 It's possible to observe information for several threads
1060simultaneously (in addition to buffers which show information for 1060simultaneously (in addition to buffers which show information for
1061currently selected thread) using the following keys from the threads 1061currently selected thread) using the following keys from the threads
1062buffer. 1062buffer.
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 9304e8bef08..7a696df319b 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -2114,6 +2114,8 @@ Reference Manual}.
2114@node Init File 2114@node Init File
2115@section The Init File, @file{~/.emacs} 2115@section The Init File, @file{~/.emacs}
2116@cindex init file 2116@cindex init file
2117@cindex .emacs file
2118@cindex ~/.emacs file
2117@cindex Emacs initialization file 2119@cindex Emacs initialization file
2118@cindex key rebinding, permanent 2120@cindex key rebinding, permanent
2119@cindex rebinding keys, permanently 2121@cindex rebinding keys, permanently
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index a21b660ee21..5eaf2e7e3ca 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -999,8 +999,7 @@ value is 200 characters.
999 Emacs can optionally display the time and system load in all mode 999 Emacs can optionally display the time and system load in all mode
1000lines. To enable this feature, type @kbd{M-x display-time} or customize 1000lines. To enable this feature, type @kbd{M-x display-time} or customize
1001the option @code{display-time-mode}. The information added to the mode 1001the option @code{display-time-mode}. The information added to the mode
1002line usually appears after the buffer name, before the mode names and 1002line looks like this:
1003their parentheses. It looks like this:
1004 1003
1005@example 1004@example
1006@var{hh}:@var{mm}pm @var{l.ll} 1005@var{hh}:@var{mm}pm @var{l.ll}
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index cd9a4602bf9..7ca6204a994 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -1,4 +1,4 @@
1\input texinfo 1\input texinfo @c -*- coding: iso-latin-1 -*-
2 2
3@setfilename ../../info/emacs 3@setfilename ../../info/emacs
4@settitle GNU Emacs Manual 4@settitle GNU Emacs Manual
@@ -29,6 +29,8 @@ developing GNU and promoting software freedom.''
29@end quotation 29@end quotation
30@end copying 30@end copying
31 31
32@documentencoding ISO-8859-1
33
32@dircategory Emacs 34@dircategory Emacs
33@direntry 35@direntry
34* Emacs: (emacs). The extensible self-documenting text editor. 36* Emacs: (emacs). The extensible self-documenting text editor.
@@ -1350,7 +1352,7 @@ Abrahamsson, Jay K.@: Adams, Michael Albinus, Nagy Andras, Ralf Angeli,
1350Joe Arceneaux, Miles Bader, David Bakhash, Juanma Barranquero, Eli 1352Joe Arceneaux, Miles Bader, David Bakhash, Juanma Barranquero, Eli
1351Barzilay, Thomas Baumann, Steven L.@: Baur, Jay Belanger, Alexander L.@: 1353Barzilay, Thomas Baumann, Steven L.@: Baur, Jay Belanger, Alexander L.@:
1352Belikoff, Boaz Ben-Zvi, Karl Berry, Anna M.@: Bigatti, Ray Blaak, Jim 1354Belikoff, Boaz Ben-Zvi, Karl Berry, Anna M.@: Bigatti, Ray Blaak, Jim
1353Blandy, Johan Bockg@aa{}rd, Jan Böcker, Lennart Borgman, Per Bothner, 1355Blandy, Johan Bockgård, Jan Böcker, Lennart Borgman, Per Bothner,
1354Terrence Brannon, Frank Bresz, Peter Breton, Emmanuel Briot, Kevin 1356Terrence Brannon, Frank Bresz, Peter Breton, Emmanuel Briot, Kevin
1355Broadey, Vincent Broman, David M.@: Brown, Georges Brun-Cottan, Joe 1357Broadey, Vincent Broman, David M.@: Brown, Georges Brun-Cottan, Joe
1356Buehler, W@l{}odek Bzyl, Bill Carpenter, Per Cederqvist, Hans Chalupsky, 1358Buehler, W@l{}odek Bzyl, Bill Carpenter, Per Cederqvist, Hans Chalupsky,
@@ -1358,16 +1360,16 @@ Chong Yidong, Chris Chase, Bob Chassell, Andrew Choi, Sacha Chua, James
1358Clark, Mike Clarkson, Glynn Clements, Daniel Colascione, Andrew Csillag, 1360Clark, Mike Clarkson, Glynn Clements, Daniel Colascione, Andrew Csillag,
1359Baoqiu Cui, Doug Cutting, Mathias Dahl, Julien Danjou, Satyaki Das, 1361Baoqiu Cui, Doug Cutting, Mathias Dahl, Julien Danjou, Satyaki Das,
1360Vivek Dasmohapatra, Michael DeCorte, Gary Delp, Matthieu Devin, Eri 1362Vivek Dasmohapatra, Michael DeCorte, Gary Delp, Matthieu Devin, Eri
1361Ding, Jan Dj@"{a}rv, Carsten Dominik, Scott Draves, Benjamin Drieu, 1363Ding, Jan Djärv, Carsten Dominik, Scott Draves, Benjamin Drieu,
1362Viktor Dukhovni, Dmitry Dzhus, John Eaton, Rolf Ebert, Paul Eggert, 1364Viktor Dukhovni, Dmitry Dzhus, John Eaton, Rolf Ebert, Paul Eggert,
1363Stephen Eglen, Torbj@"orn Einarsson, Tsugutomo Enami, Hans Henrik 1365Stephen Eglen, Torbjörn Einarsson, Tsugutomo Enami, Hans Henrik
1364Eriksen, Michael Ernst, Ata Etemadi, Frederick Farnbach, Oscar 1366Eriksen, Michael Ernst, Ata Etemadi, Frederick Farnbach, Oscar
1365Figueiredo, Fred Fish, Karl Fogel, Gary Foster, Romain Francoise, Noah 1367Figueiredo, Fred Fish, Karl Fogel, Gary Foster, Romain Francoise, Noah
1366Friedman, Andreas Fuchs, Hallvard Furuseth, Keith Gabryelski, Peter S.@: 1368Friedman, Andreas Fuchs, Hallvard Furuseth, Keith Gabryelski, Peter S.@:
1367Galbraith, Kevin Gallagher, Kevin Gallo, Juan Le@'{o}n Lahoz 1369Galbraith, Kevin Gallagher, Kevin Gallo, Juan León Lahoz
1368Garc@'{@dotless{i}}a, Howard Gayle, Daniel German, Stephen Gildea, 1370García, Howard Gayle, Daniel German, Stephen Gildea,
1369Julien Gilles, David Gillespie, Bob Glickstein, Deepak Goel, Boris 1371Julien Gilles, David Gillespie, Bob Glickstein, Deepak Goel, Boris
1370Goldowsky, Michelangelo Grigni, Odd Gripenstam, Kai Gro@ss{}johann, 1372Goldowsky, Michelangelo Grigni, Odd Gripenstam, Kai Großjohann,
1371Michael Gschwind, Bastien Guerry, Henry Guillaume, Doug Gwyn, Ken'ichi 1373Michael Gschwind, Bastien Guerry, Henry Guillaume, Doug Gwyn, Ken'ichi
1372Handa, Lars Hansen, Chris Hanson, K. Shane Hartman, John Heidemann, Jon 1374Handa, Lars Hansen, Chris Hanson, K. Shane Hartman, John Heidemann, Jon
1373K.@: Hellan, Jesper Harder, Magnus Henoch, Markus Heritsch, Karl Heuer, 1375K.@: Hellan, Jesper Harder, Magnus Henoch, Markus Heritsch, Karl Heuer,
@@ -1375,17 +1377,17 @@ Manabu Higashida, Anders Holst, Jeffrey C.@: Honig, Tassilo Horn, Kurt
1375Hornik, Tom Houlder, Joakim Hove, Denis Howe, Lars Ingebrigtsen, Andrew 1377Hornik, Tom Houlder, Joakim Hove, Denis Howe, Lars Ingebrigtsen, Andrew
1376Innes, Seiichiro Inoue, Philip Jackson, Pavel Janik, Paul Jarc, Ulf 1378Innes, Seiichiro Inoue, Philip Jackson, Pavel Janik, Paul Jarc, Ulf
1377Jasper, Michael K. Johnson, Kyle Jones, Terry Jones, Simon Josefsson, 1379Jasper, Michael K. Johnson, Kyle Jones, Terry Jones, Simon Josefsson,
1378Arne J@o{}rgensen, Tomoji Kagatani, Brewster Kahle, Tokuya Kameshima, 1380Arne Jørgensen, Tomoji Kagatani, Brewster Kahle, Tokuya Kameshima,
1379Lute Kamstra, David Kastrup, David Kaufman, Henry Kautz, Taichi 1381Lute Kamstra, David Kastrup, David Kaufman, Henry Kautz, Taichi
1380Kawabata, Howard Kaye, Michael Kifer, Richard King, Peter Kleiweg, Karel 1382Kawabata, Howard Kaye, Michael Kifer, Richard King, Peter Kleiweg, Karel
1381Kl@'{@dotless{i}}@v{c}, Shuhei Kobayashi, Pavel Kobiakov, Larry K.@: 1383Klí@v{c}, Shuhei Kobayashi, Pavel Kobiakov, Larry K.@:
1382Kolodney, David M.@: Koppelman, Koseki Yoshinori, Robert Krawitz, 1384Kolodney, David M.@: Koppelman, Koseki Yoshinori, Robert Krawitz,
1383Sebastian Kremer, Ryszard Kubiak, David K@aa{}gedal, Daniel LaLiberte, 1385Sebastian Kremer, Ryszard Kubiak, David Kågedal, Daniel LaLiberte,
1384Karl Landstrom, Mario Lang, Aaron Larson, James R.@: Larus, Vinicius 1386Karl Landstrom, Mario Lang, Aaron Larson, James R.@: Larus, Vinicius
1385Jose Latorre, Werner Lemberg, Frederic Lepied, Peter Liljenberg, Lars 1387Jose Latorre, Werner Lemberg, Frederic Lepied, Peter Liljenberg, Lars
1386Lindberg, Chris Lindblad, Anders Lindgren, Thomas Link, Juri Linkov, 1388Lindberg, Chris Lindblad, Anders Lindgren, Thomas Link, Juri Linkov,
1387Francis Litterio, Emilio C. Lopes, K@'{a}roly L@H{o}rentey, Dave Love, 1389Francis Litterio, Emilio C. Lopes, Károly L@H{o}rentey, Dave Love,
1388Sascha L@"{u}decke, Eric Ludlam, Alan Mackenzie, Christopher J.@: 1390Sascha Lüdecke, Eric Ludlam, Alan Mackenzie, Christopher J.@:
1389Madsen, Neil M.@: Mager, Ken Manheimer, Bill Mann, Brian Marick, Simon 1391Madsen, Neil M.@: Mager, Ken Manheimer, Bill Mann, Brian Marick, Simon
1390Marshall, Bengt Martensson, Charlie Martin, Thomas May, Roland McGrath, 1392Marshall, Bengt Martensson, Charlie Martin, Thomas May, Roland McGrath,
1391Will Mengarini, David Megginson, Ben A. Mesander, Wayne Mesard, Brad 1393Will Mengarini, David Megginson, Ben A. Mesander, Wayne Mesard, Brad
diff --git a/doc/emacs/makefile.w32-in b/doc/emacs/makefile.w32-in
index bbbcaf0528b..ad976468be9 100644
--- a/doc/emacs/makefile.w32-in
+++ b/doc/emacs/makefile.w32-in
@@ -28,7 +28,7 @@ infodir = $(srcdir)/../../info
28 28
29# The makeinfo program is part of the Texinfo distribution. 29# The makeinfo program is part of the Texinfo distribution.
30MAKEINFO = makeinfo 30MAKEINFO = makeinfo
31MAKEINFO_OPTS = --force -I$(srcdir) 31MAKEINFO_OPTS = --force --enable-encoding -I$(srcdir)
32MULTI_INSTALL_INFO = $(srcdir)\..\..\nt\multi-install-info.bat 32MULTI_INSTALL_INFO = $(srcdir)\..\..\nt\multi-install-info.bat
33INFO_TARGETS = $(infodir)/emacs 33INFO_TARGETS = $(infodir)/emacs
34DVI_TARGETS = emacs.dvi 34DVI_TARGETS = emacs.dvi
diff --git a/doc/emacs/msdog.texi b/doc/emacs/msdog.texi
index 7358773485d..0a454db86bb 100644
--- a/doc/emacs/msdog.texi
+++ b/doc/emacs/msdog.texi
@@ -404,36 +404,45 @@ names, which might cause misalignment of columns in Dired display.
404@dfn{user-specific application data directory}. The actual location 404@dfn{user-specific application data directory}. The actual location
405depends on your Windows version and system configuration; typical values 405depends on your Windows version and system configuration; typical values
406are @file{C:\Documents and Settings\@var{username}\Application Data} on 406are @file{C:\Documents and Settings\@var{username}\Application Data} on
407Windows 2K/XP and later, and either @file{C:\WINDOWS\Application Data} 407Windows 2K/XP/2K3, @file{C:\Users\@var{username}\AppData\Roaming} on
408Windows Vista/7/2K8, and either @file{C:\WINDOWS\Application Data}
408or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the 409or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the
409older Windows 9X/ME systems. 410older Windows 9X/ME systems. If this directory does not exist or
410 411cannot be accessed, Emacs falls back to @file{C:\} as the default
411 @code{HOME} can also be set in the system registry, for details see 412value of @code{HOME}.
413
414 You can override this default value of @code{HOME} by explicitly
415setting the environment variable @env{HOME} to point to any directory
416on your system. @env{HOME} can be set either from the command shell
417prompt or from the @samp{My Computer}s @samp{Properties} dialog.
418@code{HOME} can also be set in the system registry, for details see
412@ref{MS-Windows Registry}. 419@ref{MS-Windows Registry}.
413 420
414@cindex init file @file{.emacs} on MS-Windows 421 For compatibility with older versions of Emacs@footnote{
415 The home directory is where your init file @file{.emacs} is stored. 422Older versions of Emacs didn't check the application data directory.
416When Emacs starts, it first checks whether the environment variable 423}, if there is a file named @file{.emacs} in @file{C:\}, the root
417@env{HOME} is set. If it is, it looks for the init file in the 424directory of drive @file{C:}, and @env{HOME} is set neither in the
418directory pointed by @env{HOME}. If @env{HOME} is not defined, Emacs 425environment nor in the Registry, Emacs will treat @file{C:\} as the
419checks for an existing @file{.emacs} file in @file{C:\}, the root 426default @code{HOME} location, and will not look in the application
420directory of drive @file{C:}@footnote{ 427data directory, even if it exists. Note that only @file{.emacs} is
421The check in @file{C:\} is for compatibility with older versions of Emacs, 428looked for in @file{C:\}; the older name @file{_emacs} (see below) is
422which didn't check the application data directory. 429not. This use of @file{C:\.emacs} to define @code{HOME} is
423}. If there's no such file in @file{C:\}, Emacs next uses the Windows 430deprecated.
424system calls to find out the exact location of your application data 431
425directory. If that system call fails, Emacs falls back to @file{C:\}. 432 Whatever the final place is, Emacs sets the internal value of the
426 433@env{HOME} environment variable to point to it, and it will use that
427 Whatever the final place is, Emacs sets the value of the @env{HOME} 434location for other files and directories it normally looks for or
428environment variable to point to it, and it will use that location for 435creates in the user's home directory.
429other files and directories it normally creates in the user's home
430directory.
431 436
432 You can always find out where Emacs thinks is your home directory's 437 You can always find out where Emacs thinks is your home directory's
433location by typing @kbd{C-x d ~/ @key{RET}}. This should present the 438location by typing @kbd{C-x d ~/ @key{RET}}. This should present the
434list of files in the home directory, and show its full name on the 439list of files in the home directory, and show its full name on the
435first line. Likewise, to visit your init file, type @kbd{C-x C-f 440first line. Likewise, to visit your init file, type @kbd{C-x C-f
436~/.emacs @key{RET}}. 441~/.emacs @key{RET}} (assuming the file's name is @file{.emacs}).
442
443@cindex init file @file{.emacs} on MS-Windows
444 The home directory is where your init file is stored. It can have
445any name mentioned in @ref{Init File}.
437 446
438@cindex @file{_emacs} init file, MS-Windows 447@cindex @file{_emacs} init file, MS-Windows
439 Because MS-DOS does not allow file names with leading dots, and 448 Because MS-DOS does not allow file names with leading dots, and
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 22c155d26de..e12ec707063 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -237,7 +237,7 @@ preferred charset: unicode (Unicode (ISO10646))
237Character code properties: customize what to show 237Character code properties: customize what to show
238 name: LATIN CAPITAL LETTER A WITH GRAVE 238 name: LATIN CAPITAL LETTER A WITH GRAVE
239 general-category: Lu (Letter, Uppercase) 239 general-category: Lu (Letter, Uppercase)
240 decomposition: (65 768) ('A' 'Ì€') 240 decomposition: (65 768) ('A' '`')
241 old-name: LATIN CAPITAL LETTER A GRAVE 241 old-name: LATIN CAPITAL LETTER A GRAVE
242 242
243There are text properties here: 243There are text properties here:
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 9fdccc3218d..b5d426210aa 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -917,13 +917,13 @@ setting of the syntax table (@pxref{Syntax}).
917@node Regexp Example 917@node Regexp Example
918@section Regular Expression Example 918@section Regular Expression Example
919 919
920 Here is an example of a regexp---the regexp that Emacs uses, by 920 Here is an example of a regexp---similar to the regexp that Emacs
921default, to recognize the end of a sentence, not including the 921uses, by default, to recognize the end of a sentence, not including
922following space (i.e., the variable @code{sentence-end-base}): 922the following space (i.e., the variable @code{sentence-end-base}):
923 923
924@example 924@example
925@verbatim 925@verbatim
926[.?!][]\"'â€â€)}]* 926[.?!][]\"')}]*
927@end verbatim 927@end verbatim
928@end example 928@end example
929 929
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi
index 41a09a5f713..33ea83d7d6e 100644
--- a/doc/emacs/xresources.texi
+++ b/doc/emacs/xresources.texi
@@ -660,8 +660,11 @@ The color for the border shadow, on the top and the left.
660@iftex 660@iftex
661 The most common way to customize the GTK widgets Emacs uses (menus, dialogs 661 The most common way to customize the GTK widgets Emacs uses (menus, dialogs
662tool bars and scroll bars) is by choosing an appropriate theme, for example 662tool bars and scroll bars) is by choosing an appropriate theme, for example
663with the GNOME theme selector. You can also do Emacs specific customization 663with the GNOME theme selector.
664by inserting GTK style directives in the file @file{~/.emacs.d/gtkrc}. Some GTK 664
665You can also do Emacs specific customization
666by inserting GTK style directives in the file @file{~/.emacs.d/gtkrc},
667but only if you have a Gtk+ version earlier than 3 (i.e. 2). Some GTK
665themes ignore customizations in @file{~/.emacs.d/gtkrc} so not everything 668themes ignore customizations in @file{~/.emacs.d/gtkrc} so not everything
666works with all themes. To customize Emacs font, background, faces, etc., use 669works with all themes. To customize Emacs font, background, faces, etc., use
667the normal X resources (@pxref{Resources}). We will present some examples of 670the normal X resources (@pxref{Resources}). We will present some examples of
diff --git a/doc/lispref/ChangeLog.trunk b/doc/lispref/ChangeLog.trunk
index 5d28a90136e..c705aae4934 100644
--- a/doc/lispref/ChangeLog.trunk
+++ b/doc/lispref/ChangeLog.trunk
@@ -1,3 +1,37 @@
12011-03-19 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * strings.texi (String Conversion): Don't mention
4 string-make-(uni|multi)byte (bug#8262).
5 * nonascii.texi (Converting Representations): Fix up range.
6 * keymaps.texi (Key Binding Commands): Update code point, avoid
7 "unibyte character" and remove mention of unibyte bindings.
8
92011-03-10 Eli Zaretskii <eliz@gnu.org>
10
11 * modes.texi (Operator Precedence Grammars): Don't use characters
12 outside ISO-8859-1.
13
142011-03-09 Eli Zaretskii <eliz@gnu.org>
15
16 * intro.texi (Acknowledgements): Convert to ISO-8859-1 encoding.
17
18 * makefile.w32-in (MAKEINFO_OPTS): Add --enable-encoding.
19
202011-03-08 Glenn Morris <rgm@gnu.org>
21
22 * Makefile.in (MAKEINFO_OPTS): Add --enable-encoding.
23 * intro.texi (Acknowledgements): Names to UTF-8.
24 * elisp.texi: Set documentencoding.
25
262011-03-06 Chong Yidong <cyd@stupidchicken.com>
27
28 * package.texi: Update index keywords.
29 (Package Archives): New node contents. Document package-x.el.
30
312011-03-06 Juanma Barranquero <lekktu@gmail.com>
32
33 * makefile.w32-in (srcs): Add package.texi.
34
12011-03-06 Chong Yidong <cyd@stupidchicken.com> 352011-03-06 Chong Yidong <cyd@stupidchicken.com>
2 36
3 * package.texi (Packaging, Packaging Basics, Simple Packages) 37 * package.texi (Packaging, Packaging Basics, Simple Packages)
diff --git a/doc/lispref/Makefile.in b/doc/lispref/Makefile.in
index d5427f6e477..75fa884224b 100644
--- a/doc/lispref/Makefile.in
+++ b/doc/lispref/Makefile.in
@@ -31,7 +31,7 @@ texinfodir = $(srcdir)/../misc
31emacsdir = $(srcdir)/../emacs 31emacsdir = $(srcdir)/../emacs
32 32
33MAKEINFO = @MAKEINFO@ 33MAKEINFO = @MAKEINFO@
34MAKEINFO_OPTS = --force -I $(emacsdir) -I $(srcdir) 34MAKEINFO_OPTS = --force --enable-encoding -I $(emacsdir) -I $(srcdir)
35TEXI2DVI = texi2dvi 35TEXI2DVI = texi2dvi
36TEXI2PDF = texi2pdf 36TEXI2PDF = texi2pdf
37DVIPS = dvips 37DVIPS = dvips
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index fc066526614..69c50ba42be 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -62,6 +62,8 @@ developing GNU and promoting software freedom.''
62@end quotation 62@end quotation
63@end copying 63@end copying
64 64
65@documentencoding ISO-8859-1
66
65@dircategory GNU Emacs Lisp 67@dircategory GNU Emacs Lisp
66@direntry 68@direntry
67* Elisp: (elisp). The Emacs Lisp Reference Manual. 69* Elisp: (elisp). The Emacs Lisp Reference Manual.
diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi
index baa184004e2..7c070726023 100644
--- a/doc/lispref/intro.texi
+++ b/doc/lispref/intro.texi
@@ -1,4 +1,4 @@
1@c -*-texinfo-*- 1@c -*-coding: iso-latin-1-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990-1994, 2001-2011 Free Software Foundation, Inc. 3@c Copyright (C) 1990-1994, 2001-2011 Free Software Foundation, Inc.
4@c See the file elisp.texi for copying conditions. 4@c See the file elisp.texi for copying conditions.
@@ -542,6 +542,6 @@ Kirman, Bob Knighten, Frederick M. Korz, Joe Lammens, Glenn M. Lewis,
542K. Richard Magill, Brian Marick, Roland McGrath, Stefan Monnier, Skip 542K. Richard Magill, Brian Marick, Roland McGrath, Stefan Monnier, Skip
543Montanaro, John Gardiner Myers, Thomas A. Peterson, Francesco Potorti, 543Montanaro, John Gardiner Myers, Thomas A. Peterson, Francesco Potorti,
544Friedrich Pukelsheim, Arnold D. Robbins, Raul Rockwell, Jason Rumney, 544Friedrich Pukelsheim, Arnold D. Robbins, Raul Rockwell, Jason Rumney,
545Per Starb@"ack, Shinichirou Sugou, Kimmo Suominen, Edward Tharp, Bill 545Per Starbäck, Shinichirou Sugou, Kimmo Suominen, Edward Tharp, Bill
546Trost, Rickard Westman, Jean White, Eduard Wiebe, Matthew Wilding, 546Trost, Rickard Westman, Jean White, Eduard Wiebe, Matthew Wilding,
547Carl Witty, Dale Worley, Rusty Wright, and David D. Zuhn. 547Carl Witty, Dale Worley, Rusty Wright, and David D. Zuhn.
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index af24ff5aa43..2648c22ca01 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -1705,15 +1705,11 @@ or
1705 1705
1706@noindent 1706@noindent
1707and your language environment is multibyte Latin-1, these commands 1707and your language environment is multibyte Latin-1, these commands
1708actually bind the multibyte character with code 2294, not the unibyte 1708actually bind the multibyte character with code 246, not the byte
1709Latin-1 character with code 246 (@kbd{M-v}). In order to use this 1709code 246 (@kbd{M-v}) sent by a Latin-1 terminal. In order to use this
1710binding, you need to enter the multibyte Latin-1 character as keyboard 1710binding, you need to teach Emacs how to decode the keyboard by using an
1711input. One way to do this is by using an appropriate input method 1711appropriate input method (@pxref{Input Methods, , Input Methods, emacs, The GNU
1712(@pxref{Input Methods, , Input Methods, emacs, The GNU Emacs Manual}). 1712Emacs Manual}).
1713
1714 If you want to use a unibyte character in the key binding, you can
1715construct the key sequence string using @code{multibyte-char-to-unibyte}
1716or @code{string-make-unibyte} (@pxref{Converting Representations}).
1717 1713
1718@deffn Command global-set-key key binding 1714@deffn Command global-set-key key binding
1719This function sets the binding of @var{key} in the current global map 1715This function sets the binding of @var{key} in the current global map
diff --git a/doc/lispref/makefile.w32-in b/doc/lispref/makefile.w32-in
index e0bcd21f2c0..7b88e861d67 100644
--- a/doc/lispref/makefile.w32-in
+++ b/doc/lispref/makefile.w32-in
@@ -33,7 +33,7 @@ texinfodir = $(srcdir)/../misc
33TEX=tex 33TEX=tex
34INSTALL_INFO = install-info 34INSTALL_INFO = install-info
35MAKEINFO = makeinfo 35MAKEINFO = makeinfo
36MAKEINFO_OPTS = --force -I$(srcdir) -I$(emacsdir) 36MAKEINFO_OPTS = --force --enable-encoding -I$(srcdir) -I$(emacsdir)
37 37
38# The environment variable and its value to add $(srcdir) to the path 38# The environment variable and its value to add $(srcdir) to the path
39# searched for TeX input files. 39# searched for TeX input files.
@@ -87,6 +87,7 @@ srcs = \
87 $(srcdir)/numbers.texi \ 87 $(srcdir)/numbers.texi \
88 $(srcdir)/objects.texi \ 88 $(srcdir)/objects.texi \
89 $(srcdir)/os.texi \ 89 $(srcdir)/os.texi \
90 $(srcdir)/package.texi \
90 $(srcdir)/positions.texi \ 91 $(srcdir)/positions.texi \
91 $(srcdir)/processes.texi \ 92 $(srcdir)/processes.texi \
92 $(srcdir)/searching.texi \ 93 $(srcdir)/searching.texi \
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index f238f38462f..f0a8985fa75 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -3403,7 +3403,7 @@ Such pairs of precedences are sufficient to express left-associativity
3403or right-associativity of infix operators, nesting of tokens like 3403or right-associativity of infix operators, nesting of tokens like
3404parentheses and many other cases. 3404parentheses and many other cases.
3405 3405
3406@c ¡Let's leave this undocumented to leave it more open for change! 3406@c Let's leave this undocumented to leave it more open for change!
3407@c @defvar smie-grammar 3407@c @defvar smie-grammar
3408@c The value of this variable is an alist specifying the left and right 3408@c The value of this variable is an alist specifying the left and right
3409@c precedence of each token. It is meant to be initialized by using one of 3409@c precedence of each token. It is meant to be initialized by using one of
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 409ecc7e20c..6fcde611998 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -167,7 +167,7 @@ acceptable because the buffer's representation is a choice made by the
167user that cannot be overridden automatically. 167user that cannot be overridden automatically.
168 168
169 Converting unibyte text to multibyte text leaves @acronym{ASCII} 169 Converting unibyte text to multibyte text leaves @acronym{ASCII}
170characters unchanged, and converts bytes with codes 128 through 159 to 170characters unchanged, and converts bytes with codes 128 through 255 to
171the multibyte representation of raw eight-bit bytes. 171the multibyte representation of raw eight-bit bytes.
172 172
173 Converting multibyte text to unibyte converts all @acronym{ASCII} 173 Converting multibyte text to unibyte converts all @acronym{ASCII}
diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi
index 4de44fe165d..62fbc2a9a07 100644
--- a/doc/lispref/package.texi
+++ b/doc/lispref/package.texi
@@ -5,7 +5,8 @@
5@setfilename ../../info/package 5@setfilename ../../info/package
6@node Packaging, Antinews, System Interface, Top 6@node Packaging, Antinews, System Interface, Top
7@chapter Preparing Lisp code for distribution 7@chapter Preparing Lisp code for distribution
8@cindex packaging 8@cindex package
9@cindex Lisp package
9 10
10 Emacs provides a standard way to distribute Emacs Lisp code to 11 Emacs provides a standard way to distribute Emacs Lisp code to
11users. A @dfn{package} is a collection of one or more files, 12users. A @dfn{package} is a collection of one or more files,
@@ -24,8 +25,11 @@ put it in a @dfn{package archive} for others to download.
24 25
25@node Packaging Basics 26@node Packaging Basics
26@section Packaging Basics 27@section Packaging Basics
27@cindex packaging basics
28@cindex package attributes 28@cindex package attributes
29@cindex package name
30@cindex package version
31@cindex dependencies
32@cindex package dependencies
29 33
30 A package is either a @dfn{simple package} or a @dfn{multi-file 34 A package is either a @dfn{simple package} or a @dfn{multi-file
31package}. A simple package is stored in a package archive as a single 35package}. A simple package is stored in a package archive as a single
@@ -69,6 +73,7 @@ installing this package also automatically installs its dependencies;
69if any dependency cannot be found, the package cannot be installed. 73if any dependency cannot be found, the package cannot be installed.
70@end table 74@end table
71 75
76@cindex content directory, package
72 Installing a package, either via the Package Menu, or via the 77 Installing a package, either via the Package Menu, or via the
73command @code{package-install-file}, creates a subdirectory of 78command @code{package-install-file}, creates a subdirectory of
74@code{package-user-dir} named @file{@var{name}-@var{version}}, where 79@code{package-user-dir} named @file{@var{name}-@var{version}}, where
@@ -78,6 +83,7 @@ package's @dfn{content directory}. It is where Emacs puts the
78package's contents (the single Lisp file for a simple package, or the 83package's contents (the single Lisp file for a simple package, or the
79files extracted from a multi-file package). 84files extracted from a multi-file package).
80 85
86@cindex package autoloads
81 Emacs then searches every Lisp file in the content directory for 87 Emacs then searches every Lisp file in the content directory for
82autoload magic comments (@pxref{Autoload}). These autoload 88autoload magic comments (@pxref{Autoload}). These autoload
83definitions are saved to a file named @file{@var{name}-autoloads.el} 89definitions are saved to a file named @file{@var{name}-autoloads.el}
@@ -98,7 +104,8 @@ typically called to begin using the package.
98 104
99@node Simple Packages 105@node Simple Packages
100@section Simple Packages 106@section Simple Packages
101@cindex single file packages 107@cindex single file package
108@cindex simple package
102 109
103 A simple package consists of a single Emacs Lisp source file. The 110 A simple package consists of a single Emacs Lisp source file. The
104file must conform to the Emacs Lisp library header conventions 111file must conform to the Emacs Lisp library header conventions
@@ -160,7 +167,7 @@ single-file package to a package archive.
160 167
161@node Multi-file Packages 168@node Multi-file Packages
162@section Multi-file Packages 169@section Multi-file Packages
163@cindex multi-file packages 170@cindex multi-file package
164 171
165 A multi-file package is less convenient to create than a single-file 172 A multi-file package is less convenient to create than a single-file
166package, but it offers more features: it can include multiple Emacs 173package, but it offers more features: it can include multiple Emacs
@@ -206,10 +213,10 @@ file is used as the long description.
206 If the content directory contains a file named @file{dir}, this is 213 If the content directory contains a file named @file{dir}, this is
207assumed to be an Info directory file made with @command{install-info}. 214assumed to be an Info directory file made with @command{install-info}.
208@xref{Invoking install-info, Invoking install-info, Invoking 215@xref{Invoking install-info, Invoking install-info, Invoking
209install-info, texinfo, Texinfo}. The Info files listed in this 216install-info, texinfo, Texinfo}. The relevant Info files should also
210directory file should also be present in the content directory. In 217be present in the content directory. In this case, Emacs will
211this case, Emacs will automatically add the content directory to 218automatically add the content directory to @code{Info-directory-list}
212@code{Info-directory-list} when the package is activated. 219when the package is activated.
213 220
214 Do not include any @file{.elc} files in the package. Those are 221 Do not include any @file{.elc} files in the package. Those are
215created when the package is installed. Note that there is no way to 222created when the package is installed. Note that there is no way to
@@ -234,5 +241,79 @@ variable @code{load-file-name} (@pxref{Loading}). Here is an example:
234 241
235@node Package Archives 242@node Package Archives
236@section Creating and Maintaining Package Archives 243@section Creating and Maintaining Package Archives
237 244@cindex package archive
238To be done. 245
246 Via the Package Menu, users may download packages from @dfn{package
247archives}. Such archives are specified by the variable
248@code{package-archives}, whose default value contains a single entry:
249the archive hosted by the GNU project at @url{elpa.gnu.org}. This
250section describes how to set up and maintain a package archive.
251
252@cindex base location, package archive
253@defopt package-archives
254The value of this variable is an alist of package archives recognized
255by the Emacs package manager.
256
257Each alist element corresponds to one archive, and should have the
258form @code{(@var{id} . @var{location})}, where @var{id} is the name of
259the archive (a string) and @var{location} is its @dfn{base location}
260(a string).
261
262If the base location starts with @samp{http:}, it is treated as a HTTP
263URL, and packages are downloaded from this archive via HTTP (as is the
264case for the default GNU archive).
265
266Otherwise, the base location should be a directory name. In this
267case, Emacs retrieves packages from this archive via ordinary file
268access. Such ``local'' archives are mainly useful for testing.
269@end defopt
270
271 A package archive is simply a directory in which the package files,
272and associated files, are stored. If you want the archive to be
273reachable via HTTP, this directory must be accessible to a web server.
274How to accomplish this is beyond the scope of this manual.
275
276 A convenient way to set up and update a package archive is via the
277@code{package-x} library. This is included with Emacs, but not loaded
278by default; type @kbd{M-x load-library @kbd{RET} package-x @kbd{RET}}
279to load it, or add @code{(require 'package-x)} to your init file.
280@xref{Lisp Libraries,, Lisp Libraries, emacs, The GNU Emacs Manual}.
281Once loaded, you can make use of the following:
282
283@defopt package-archive-upload-base
284The value of this variable is the base location of a package archive,
285as a directory name. The commands in the @code{package-x} library
286will use this base location.
287
288The directory name should be absolute. You may specify a remote name,
289such as @file{/ssh:foo@@example.com:/var/www/packages/}, if the
290package archive is on a different machine. @xref{Remote Files,,
291Remote Files, emacs, The GNU Emacs Manual}.
292@end defopt
293
294@deffn Command package-upload-file filename
295This command prompts for @var{filename}, a file name, and uploads that
296file to @code{package-archive-upload-base}. The file must be either a
297simple package (a @file{.el} file) or a multi-file package (a
298@file{.tar} file); otherwise, an error is raised. The package
299attributes are automatically extracted, and the archive's contents
300list is updated with this information.
301
302If @code{package-archive-upload-base} does not specify a valid
303directory, the function prompts interactively for one. If the
304directory does not exist, it is created. The directory need not have
305any initial contents (i.e., you can use this command to populate an
306initially empty archive).
307@end deffn
308
309@deffn Command package-upload-buffer
310This command is similar to @code{package-upload-file}, but instead of
311prompting for a package file, it uploads the contents of the current
312buffer. The current buffer must be visiting a simple package (a
313@file{.el} file) or a multi-file package (a @file{.tar} file);
314otherwise, an error is raised.
315@end deffn
316
317@noindent
318After you create an archive, remember that it is not accessible in the
319Package Menu interface unless it is in @code{package-archives}.
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index ce080bc221f..d062c215952 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -554,8 +554,8 @@ strings and integers. @code{format} (@pxref{Formatting Strings}) and
554@code{prin1-to-string} (@pxref{Output Functions}) can also convert 554@code{prin1-to-string} (@pxref{Output Functions}) can also convert
555Lisp objects into strings. @code{read-from-string} (@pxref{Input 555Lisp objects into strings. @code{read-from-string} (@pxref{Input
556Functions}) can ``convert'' a string representation of a Lisp object 556Functions}) can ``convert'' a string representation of a Lisp object
557into an object. The functions @code{string-make-multibyte} and 557into an object. The functions @code{string-to-multibyte} and
558@code{string-make-unibyte} convert the text representation of a string 558@code{string-to-unibyte} convert the text representation of a string
559(@pxref{Converting Representations}). 559(@pxref{Converting Representations}).
560 560
561 @xref{Documentation}, for functions that produce textual descriptions 561 @xref{Documentation}, for functions that produce textual descriptions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 2c5f998737a..50f0e4e45b9 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,54 @@
12011-03-17 Jay Belanger <jay.p.belanger@gmail.com>
2
3 * calc.texi (Logarithmic Units): Update the function names.
4
52011-03-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
6
7 * message.texi (Various Commands): Document format specs in the
8 ellipsis.
9
102011-03-15 Antoine Levitt <antoine.levitt@gmail.com>
11
12 * message.texi (Insertion Variables): Document message-cite-style.
13
142011-03-14 Michael Albinus <michael.albinus@gmx.de>
15
16 * tramp.texi (Remote processes): New subsection "Running shell on
17 a remote host".
18
192011-03-12 Teodor Zlatanov <tzz@lifelogs.com>
20
21 * auth.texi (Help for developers): Update docs to explain that the
22 :save-function will only run the first time.
23
242011-03-12 Glenn Morris <rgm@gnu.org>
25
26 * Makefile.in (emacs-faq.html): Fix some more cross-refs.
27 (emacs-faq.text): New target.
28 (clean): Add emacs-faq.
29
302011-03-12 Michael Albinus <michael.albinus@gmx.de>
31
32 Sync with Tramp 2.2.1.
33
34 * trampver.texi: Update release number.
35
362011-03-11 Glenn Morris <rgm@gnu.org>
37
38 * Makefile.in (HTML_TARGETS): New.
39 (clean): Delete $HTML_TARGETS.
40 (emacs-faq.html): New, for use with the gnu.org Emacs webpage.
41
422011-03-08 Teodor Zlatanov <tzz@lifelogs.com>
43
44 * auth.texi (Help for developers): Show example of using
45 `auth-source-search' with prompts and :save-function.
46
472011-03-07 Antoine Levitt <antoine.levitt@gmail.com>
48
49 * message.texi (Message Buffers): Update default value of
50 message-generate-new-buffers.
51
12011-03-06 Jay Belanger <jay.p.belanger@gmail.com> 522011-03-06 Jay Belanger <jay.p.belanger@gmail.com>
2 53
3 * calc.texi (Logarithmic Units): Rename calc-logunits-dblevel 54 * calc.texi (Logarithmic Units): Rename calc-logunits-dblevel
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index 0a28d417c70..450199a33c5 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -197,6 +197,8 @@ PDF_TARGETS = \
197 widget.pdf \ 197 widget.pdf \
198 woman.pdf 198 woman.pdf
199 199
200HTML_TARGETS = emacs-faq.html
201
200TEXI2DVI = texi2dvi 202TEXI2DVI = texi2dvi
201TEXI2PDF = texi2pdf 203TEXI2PDF = texi2pdf
202 204
@@ -401,6 +403,15 @@ faq.dvi: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
401 $(ENVADD) $(TEXI2DVI) $< 403 $(ENVADD) $(TEXI2DVI) $<
402faq.pdf: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi 404faq.pdf: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
403 $(ENVADD) $(TEXI2PDF) $< 405 $(ENVADD) $(TEXI2PDF) $<
406## This is the name used on the Emacs web-page.
407## sed fixes up links to point to split version of the manual.
408emacs-faq.html: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
409 $(MAKEINFO) $(MAKEINFO_OPTS) --no-split \
410 --css-ref='/layout.css' --html -o $@ $<
411 sed -i -e 's|a href="\([a-z]*\)\.html#\([^"]*\)"|a href="manual/html_node/\1/\2.html"|g' \
412 -e 's|/Top\.html|/|g' $@
413emacs-faq.text: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
414 $(MAKEINFO) $(MAKEINFO_OPTS) --plaintext -o $@ $<
404 415
405flymake : $(infodir)/flymake 416flymake : $(infodir)/flymake
406$(infodir)/flymake: flymake.texi 417$(infodir)/flymake: flymake.texi
@@ -684,7 +695,7 @@ mostlyclean:
684 rm -f gnustmp.* 695 rm -f gnustmp.*
685 696
686clean: mostlyclean 697clean: mostlyclean
687 rm -f $(DVI_TARGETS) $(PDF_TARGETS) 698 rm -f $(DVI_TARGETS) $(PDF_TARGETS) $(HTML_TARGETS) emacs-faq.text
688 699
689distclean: clean 700distclean: clean
690# rm -f Makefile 701# rm -f Makefile
diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi
index 23ac23dce5b..a16da92343e 100644
--- a/doc/misc/auth.texi
+++ b/doc/misc/auth.texi
@@ -131,11 +131,11 @@ library encourages this confusion by accepting both, as you'll see
131later. 131later.
132 132
133If you have problems with the search, set @code{auth-source-debug} to 133If you have problems with the search, set @code{auth-source-debug} to
134@code{t} and see what host, port, and user the library is checking in 134@code{'trivia} and see what host, port, and user the library is
135the @code{*Messages*} buffer. Ditto for any other problems, your 135checking in the @code{*Messages*} buffer. Ditto for any other
136first step is always to see what's being checked. The second step, of 136problems, your first step is always to see what's being checked. The
137course, is to write a blog entry about it and wait for the answer in 137second step, of course, is to write a blog entry about it and wait for
138the comments. 138the answer in the comments.
139 139
140You can customize the variable @code{auth-sources}. The following may 140You can customize the variable @code{auth-sources}. The following may
141be needed if you are using an older version of Emacs or if the 141be needed if you are using an older version of Emacs or if the
@@ -232,6 +232,14 @@ TODO: how does it work generally, how does secrets.el work, some examples.
232@node Help for developers 232@node Help for developers
233@chapter Help for developers 233@chapter Help for developers
234 234
235The auth-source library lets you control logging output easily.
236
237@defvar auth-source-debug
238Set this variable to 'trivia to see lots of output in *Messages*, or
239set it to a function that behaves like @code{message} to do your own
240logging.
241@end defvar
242
235The auth-source library only has a few functions for external use. 243The auth-source library only has a few functions for external use.
236 244
237@defun auth-source-search SPEC 245@defun auth-source-search SPEC
@@ -240,6 +248,62 @@ TODO: how to include docstring?
240 248
241@end defun 249@end defun
242 250
251Let's take a look at an example of using @code{auth-source-search}
252from Gnus' @code{nnimap.el}.
253
254@example
255(defun nnimap-credentials (address ports)
256 (let* ((auth-source-creation-prompts
257 '((user . "IMAP user at %h: ")
258 (secret . "IMAP password for %u@@%h: ")))
259 (found (nth 0 (auth-source-search :max 1
260 :host address
261 :port ports
262 :require '(:user :secret)
263 :create t))))
264 (if found
265 (list (plist-get found :user)
266 (let ((secret (plist-get found :secret)))
267 (if (functionp secret)
268 (funcall secret)
269 secret))
270 (plist-get found :save-function))
271 nil)))
272@end example
273
274This call requires the user and password (secret) to be in the
275results. It also requests that an entry be created if it doesn't
276exist already. While the created entry is being assembled, the shown
277prompts will be used to interact with the user. The caller can also
278pass data in @code{auth-source-creation-defaults} to supply defaults
279for any of the prompts.
280
281Note that the password needs to be evaluated if it's a function. It's
282wrapped in a function to provide some security.
283
284Later, after a successful login, @code{nnimal.el} calls the
285@code{:save-function} like so:
286
287@example
288(when (functionp (nth 2 credentials))
289 (funcall (nth 2 credentials)))
290@end example
291
292This will work whether the @code{:save-function} was provided or not.
293@code{:save-function} will be provided only when a new entry was
294created, so this effectively says ``after a successful login, save the
295authentication information we just used, if it was newly created.''
296
297After the first time it's called, the @code{:save-function} will not
298run again (but it will log something if you have set
299@code{auth-source-debug} to @code{'trivia}). This is so it won't ask
300the same question again, which is annoying. This is so it won't ask
301the same question again, which is annoying. This is so it won't ask
302the same question again, which is annoying.
303
304So the responsibility of the API user that specified @code{:create t}
305is to call the @code{:save-function} if it's provided.
306
243@defun auth-source-delete SPEC 307@defun auth-source-delete SPEC
244 308
245TODO: how to include docstring? 309TODO: how to include docstring?
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index 88103fc0034..f732eff5690 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -28126,47 +28126,15 @@ tell Calc to use a different file for the Calc init file.)
28126@section Logarithmic Units 28126@section Logarithmic Units
28127 28127
28128The units @code{dB} (decibels) and @code{Np} (nepers) are logarithmic 28128The units @code{dB} (decibels) and @code{Np} (nepers) are logarithmic
28129units which are typically manipulated differently than standard units. 28129units which are manipulated differently than standard units. Calc
28130Calc provides commands to work with these logarithmic units. 28130provides commands to work with these logarithmic units.
28131 28131
28132Decibels and nepers are used to measure power quantities as well as 28132Decibels and nepers are used to measure power quantities as well as
28133field quantities (quantities whose squares are proportional to power). 28133field quantities (quantities whose squares are proportional to power);
28134The decibel and neper values of a quantity are relative to 28134these two types of quantities are handled slightly different from each
28135a reference quantity; for example, the decibel value of a sound 28135other. By default the Calc commands work as if power quantities are
28136pressure level of 28136being used; with the @kbd{H} prefix the Calc commands work as if field
28137@infoline @math{60 uPa} 28137quantities are being used.
28138@texline @math{60 \mu{\rm Pa}}
28139relative to
28140@infoline @math{20 uPa}
28141@texline @math{20 \mu{\rm Pa}}
28142(the threshhold of human hearing) is
28143@infoline @math{20 log10(60 uPa/ 20 uPa) dB = 20 log10(3) dB},
28144@texline @math{20 \log_{10}(60 \mu{\rm Pa}/20 \mu{\rm Pa}) {\rm dB} = 20 \log_{10}(3) {\rm dB}},
28145which is about
28146@infoline @math{9.54 dB}.
28147@texline @math{9.54 {\rm dB}}.
28148Note that in taking the ratio, the original units cancel and so these
28149logarithmic units are dimensionless.
28150
28151@vindex calc-logunits-power-reference
28152@vindex calc-logunits-field-reference
28153The Calc commands for the logarithmic units assume that power quantities
28154are being used unless the @kbd{H} prefix is used, in which case they assume that
28155field quantities are being used. For power quantities, Calc uses
28156@infoline @math{1 mW}
28157@texline @math{1 {\rm mW}}
28158as the default reference quantity; this default can be changed by changing
28159the value of the customizable variable
28160@code{calc-logunits-power-reference} (@pxref{Customizing Calc}).
28161For field quantities, Calc uses
28162@infoline @math{20 uPa}
28163@texline @math{20 \mu{\rm Pa}}
28164as the default reference quantity; this is the value used in acoustics
28165which is where decibels are commonly encountered. This default can be
28166changed by changing the value of the customizable variable
28167@code{calc-logunits-field-reference} (@pxref{Customizing Calc}). A
28168non-default reference quantity will be read from the stack if the
28169capital @kbd{O} prefix is used.
28170 28138
28171The decibel level of a power 28139The decibel level of a power
28172@infoline @math{P1}, 28140@infoline @math{P1},
@@ -28214,6 +28182,20 @@ relative to a reference
28214is defined as 28182is defined as
28215@infoline @math{20 log10(F1/F0) dB}. 28183@infoline @math{20 log10(F1/F0) dB}.
28216@texline @math{20 \log_{10}(F_{1}/F_{0}) {\rm dB}}. 28184@texline @math{20 \log_{10}(F_{1}/F_{0}) {\rm dB}}.
28185For example, the decibel value of a sound pressure level of
28186@infoline @math{60 uPa}
28187@texline @math{60 \mu{\rm Pa}}
28188relative to
28189@infoline @math{20 uPa}
28190@texline @math{20 \mu{\rm Pa}}
28191(the threshhold of human hearing) is
28192@infoline @math{20 log10(60 uPa/ 20 uPa) dB = 20 log10(3) dB},
28193@texline @math{20 \log_{10}(60 \mu{\rm Pa}/20 \mu{\rm Pa}) {\rm dB} = 20 \log_{10}(3) {\rm dB}},
28194which is about
28195@infoline @math{9.54 dB}.
28196@texline @math{9.54 {\rm dB}}.
28197Note that in taking the ratio, the original units cancel and so these
28198logarithmic units are dimensionless.
28217 28199
28218Nepers (named after John Napier, who is credited with inventing the 28200Nepers (named after John Napier, who is credited with inventing the
28219logarithm) are similar to bels except they use natural logarithms instead 28201logarithm) are similar to bels except they use natural logarithms instead
@@ -28236,55 +28218,72 @@ is
28236@infoline @math{ln(F1/F0) Np}. 28218@infoline @math{ln(F1/F0) Np}.
28237@texline @math{\ln(F_1/F_0) {\rm Np}}. 28219@texline @math{\ln(F_1/F_0) {\rm Np}}.
28238 28220
28221@vindex calc-lu-power-reference
28222@vindex calc-lu-field-reference
28223For power quantities, Calc uses
28224@infoline @math{1 mW}
28225@texline @math{1 {\rm mW}}
28226as the default reference quantity; this default can be changed by changing
28227the value of the customizable variable
28228@code{calc-lu-power-reference} (@pxref{Customizing Calc}).
28229For field quantities, Calc uses
28230@infoline @math{20 uPa}
28231@texline @math{20 \mu{\rm Pa}}
28232as the default reference quantity; this is the value used in acoustics
28233which is where decibels are commonly encountered. This default can be
28234changed by changing the value of the customizable variable
28235@code{calc-lu-field-reference} (@pxref{Customizing Calc}). A
28236non-default reference quantity will be read from the stack if the
28237capital @kbd{O} prefix is used.
28238
28239@kindex l q 28239@kindex l q
28240@pindex calc-logunits-quantity 28240@pindex calc-lu-quant
28241@tindex powerquant 28241@tindex lupquant
28242@tindex fieldquant 28242@tindex lufquant
28243The @kbd{l q} (@code{calc-logunits-quantity}) [@code{powerquant}] 28243The @kbd{l q} (@code{calc-lu-quant}) [@code{lupquant}]
28244command computes the power quantity corresponding to a given number of 28244command computes the power quantity corresponding to a given number of
28245logarithmic units. With the capital @kbd{O} prefix, @kbd{O l q}, the 28245logarithmic units. With the capital @kbd{O} prefix, @kbd{O l q}, the
28246reference level will be read from the top of the stack. (In an 28246reference level will be read from the top of the stack. (In an
28247algebraic formula, @code{powerquant} can be given an optional second 28247algebraic formula, @code{lupquant} can be given an optional second
28248argument which will be used for the reference level.) For example, 28248argument which will be used for the reference level.) For example,
28249@code{20 dB @key{RET} l q} will return @code{100 mW}; 28249@code{20 dB @key{RET} l q} will return @code{100 mW};
28250@code{20 dB @key{RET} 4 W @key{RET} O l q} will return @code{400 W}. 28250@code{20 dB @key{RET} 4 W @key{RET} O l q} will return @code{400 W}.
28251The @kbd{H l q} [@code{fieldquant}] command behaves like @kbd{l q} but 28251The @kbd{H l q} [@code{lufquant}] command behaves like @kbd{l q} but
28252computes field quantities instead of power quantities. 28252computes field quantities instead of power quantities.
28253 28253
28254@kindex l d 28254@kindex l d
28255@pindex calc-dblevel 28255@pindex calc-db
28256@tindex dbpowerlevel 28256@tindex dbpower
28257@tindex dbfieldlevel 28257@tindex dbfield
28258@kindex l n 28258@kindex l n
28259@pindex calc-nplevel 28259@pindex calc-np
28260@tindex nppowerlevel 28260@tindex nppower
28261@tindex npfieldlevel 28261@tindex npfield
28262The @kbd{l d} (@code{calc-dblevel}) [@code{dbpowerlevel}] 28262The @kbd{l d} (@code{calc-db}) [@code{dbpower}] command will compute
28263command will compute the decibel level of a power quantity using the 28263the decibel level of a power quantity using the default reference
28264default reference level; @kbd{H l d} [@code{dbfieldlevel}] will 28264level; @kbd{H l d} [@code{dbfield}] will compute the decibel level of
28265compute the decibel level of a field quantity. The commands @kbd{l n} 28265a field quantity. The commands @kbd{l n} (@code{calc-np})
28266(@code{calc-nplevel}) [@code{nppowerlevel}] and @kbd{H l n} 28266[@code{nppower}] and @kbd{H l n} [@code{npfield}] will similarly
28267[@code{npfieldlevel}] will similarly compute neper levels. With the 28267compute neper levels. With the capital @kbd{O} prefix these commands
28268capital @kbd{O} prefix these commands will read a reference level 28268will read a reference level from the stack; in an algebraic formula
28269from the stack; in an algebraic formula the reference level can be 28269the reference level can be given as an optional second argument.
28270given as an optional second argument.
28271 28270
28272@kindex l + 28271@kindex l +
28273@pindex calc-logunits-add 28272@pindex calc-lu-plus
28274@tindex lupoweradd 28273@tindex lupadd
28275@tindex lufieldadd 28274@tindex lufadd
28276@kindex l - 28275@kindex l -
28277@pindex calc-logunits-sub 28276@pindex calc-lu-minus
28278@tindex lupowersub 28277@tindex lupsub
28279@tindex lufieldsub 28278@tindex lufsub
28280@kindex l * 28279@kindex l *
28281@pindex calc-logunits-mul 28280@pindex calc-lu-times
28282@tindex lupowermul 28281@tindex lupmul
28283@tindex lufieldmul 28282@tindex lufmul
28284@kindex l / 28283@kindex l /
28285@pindex calc-logunits-div 28284@pindex calc-lu-divide
28286@tindex lupowerdiv 28285@tindex lupdiv
28287@tindex lufielddiv 28286@tindex lufdiv
28288The sum of two power or field quantities doesn't correspond to the sum 28287The sum of two power or field quantities doesn't correspond to the sum
28289of the corresponding decibel or neper levels. If the powers 28288of the corresponding decibel or neper levels. If the powers
28290corresponding to decibel levels 28289corresponding to decibel levels
@@ -28305,13 +28304,13 @@ $$ 10 \log_{10}(10^{D_1/10} + 10^{D_2/10}) {\rm dB}.$$
28305@end tex 28304@end tex
28306 28305
28307@noindent 28306@noindent
28308When field quantities are combined, it often means the 28307When field quantities are combined, it often means the corresponding
28309corresponding powers are added and so the above formula might be used. 28308powers are added and so the above formula might be used. In
28310In acoustics, for example, the decibel sound pressure level is defined 28309acoustics, for example, the sound pressure level is a field quantity
28311using the field formula but the sound pressure levels are combined 28310and so the decibels are often defined using the field formula, but the
28312as the sound power levels, and so the above formula should be used. If 28311sound pressure levels are combined as the sound power levels, and so
28313two field quantities themselves are added, the new decibel level will be 28312the above formula should be used. If two field quantities themselves
28314 28313are added, the new decibel level will be
28315 28314
28316@ifnottex 28315@ifnottex
28317@example 28316@example
@@ -28349,20 +28348,18 @@ $$ D + 20 \log_{10}(N) {\rm dB}.$$
28349@end tex 28348@end tex
28350 28349
28351@noindent 28350@noindent
28352There are similar formulas for combining nepers. 28351There are similar formulas for combining nepers. The @kbd{l +}
28353The @kbd{l +} (@code{calc-logunits-add}) [@code{lupoweradd}] command 28352(@code{calc-lu-plus}) [@code{lupadd}] command will ``add'' two
28354will ``add'' two logarithmic unit power levels this way; with the 28353logarithmic unit power levels this way; with the @kbd{H} prefix,
28355@kbd{H} prefix, @kbd{H l +} [@code{lufieldadd}] will add logarithmic 28354@kbd{H l +} [@code{lufadd}] will add logarithmic unit field levels.
28356unit field levels. Similarly, logarithmic units can be 28355Similarly, logarithmic units can be ``subtracted'' with @kbd{l -}
28357``subtracted'' with @kbd{l -} (@code{calc-logunits-sub}) 28356(@code{calc-lu-minus}) [@code{lupsub}] or @kbd{H l -} [@code{lufsub}].
28358[@code{lupowersub}] or @kbd{H l -} [@code{lufieldsub}]. 28357The @kbd{l *} (@code{calc-lu-times}) [@code{lupmul}] and @kbd{H l *}
28359The @kbd{l *} (@code{calc-logunits-mul}) [@code{lupowermul}] 28358[@code{lufmul}] commands will ``multiply'' a logarithmic unit by a
28360and @kbd{H l *} [@code{lufieldmul}] commands will ``multiply'' 28359number; the @kbd{l /} (@code{calc-lu-divide}) [@code{lupdiv}] and
28361a logarithmic unit by a number; the @kbd{l /} 28360@kbd{H l /} [@code{lufdiv}] commands will ``divide'' a logarithmic
28362(@code{calc-logunits-divide}) [@code{lupowerdiv}] and 28361unit by a number. Note that the reference quantities don't play a role
28363@kbd{H l /} [@code{lufielddiv}] commands will ``divide'' a 28362in this arithmetic.
28364logarithmic unit by a number. Note that the reference quantities don't
28365play a role in this arithmetic.
28366 28363
28367@node Musical Notes, , Logarithmic Units, Units 28364@node Musical Notes, , Logarithmic Units, Units
28368@section Musical Notes 28365@section Musical Notes
@@ -35539,16 +35536,16 @@ should also be added to @code{calc-embedded-announce-formula-alist}
35539and @code{calc-embedded-open-close-plain-alist}. 35536and @code{calc-embedded-open-close-plain-alist}.
35540@end defvar 35537@end defvar
35541 35538
35542@defvar calc-logunits-power-reference 35539@defvar calc-lu-power-reference
35543@defvarx calc-logunits-field-reference 35540@defvarx calc-lu-field-reference
35544See @ref{Logarithmic Units}.@* 35541See @ref{Logarithmic Units}.@*
35545The variables @code{calc-logunits-power-reference} and 35542The variables @code{calc-lu-power-reference} and
35546@code{calc-logunits-field-reference} are unit expressions (written as 35543@code{calc-lu-field-reference} are unit expressions (written as
35547strings) which Calc will use as reference quantities for logarithmic 35544strings) which Calc will use as reference quantities for logarithmic
35548units. 35545units.
35549 35546
35550The default value of @code{calc-logunits-power-reference} is @code{"mW"} 35547The default value of @code{calc-lu-power-reference} is @code{"mW"}
35551and the default value of @code{calc-logunits-field-reference} is 35548and the default value of @code{calc-lu-field-reference} is
35552@code{"20 uPa"}. 35549@code{"20 uPa"}.
35553@end defvar 35550@end defvar
35554 35551
@@ -36209,26 +36206,26 @@ keystrokes are not listed in this summary.
36209@r{ v x@: I k T @: @: @:ltpt@:(x,v)} 36206@r{ v x@: I k T @: @: @:ltpt@:(x,v)}
36210 36207
36211@c 36208@c
36212@r{ a b@: l + @: @: @:lupoweradd@:(a,b)} 36209@r{ a b@: l + @: @: @:lupadd@:(a,b)}
36213@r{ a b@: H l + @: @: @:lufieldadd@:(a,b)} 36210@r{ a b@: H l + @: @: @:lufadd@:(a,b)}
36214@r{ a b@: l - @: @: @:lupowersub@:(a,b)} 36211@r{ a b@: l - @: @: @:lupsub@:(a,b)}
36215@r{ a b@: H l - @: @: @:lufieldsub@:(a,b)} 36212@r{ a b@: H l - @: @: @:lufsub@:(a,b)}
36216@r{ a b@: l * @: @: @:lupowermul@:(a,b)} 36213@r{ a b@: l * @: @: @:lupmul@:(a,b)}
36217@r{ a b@: H l * @: @: @:lufieldmul@:(a,b)} 36214@r{ a b@: H l * @: @: @:lufmul@:(a,b)}
36218@r{ a b@: l / @: @: @:lupowerdiv@:(a,b)} 36215@r{ a b@: l / @: @: @:lupdiv@:(a,b)}
36219@r{ a b@: H l / @: @: @:lufielddiv@:(a,b)} 36216@r{ a b@: H l / @: @: @:lufdiv@:(a,b)}
36220@r{ a@: l d @: @: @:dbpowerlevel@:(a)} 36217@r{ a@: l d @: @: @:dbpower@:(a)}
36221@r{ a b@: O l d @: @: @:dbpowerlevel@:(a,b)} 36218@r{ a b@: O l d @: @: @:dbpower@:(a,b)}
36222@r{ a@: H l d @: @: @:dbfieldlevel@:(a)} 36219@r{ a@: H l d @: @: @:dbfield@:(a)}
36223@r{ a b@: O H l d @: @: @:dbfieldlevel@:(a,b)} 36220@r{ a b@: O H l d @: @: @:dbfield@:(a,b)}
36224@r{ a@: l n @: @: @:nppowerlevel@:(a)} 36221@r{ a@: l n @: @: @:nppower@:(a)}
36225@r{ a b@: O l n @: @: @:nppowerlevel@:(a,b)} 36222@r{ a b@: O l n @: @: @:nppower@:(a,b)}
36226@r{ a@: H l n @: @: @:npfieldlevel@:(a)} 36223@r{ a@: H l n @: @: @:npfield@:(a)}
36227@r{ a b@: O H l n @: @: @:npfieldlevel@:(a,b)} 36224@r{ a b@: O H l n @: @: @:npfield@:(a,b)}
36228@r{ a@: l q @: @: @:powerquant@:(a)} 36225@r{ a@: l q @: @: @:lupquant@:(a)}
36229@r{ a b@: O l q @: @: @:powerquant@:(a,b)} 36226@r{ a b@: O l q @: @: @:lupquant@:(a,b)}
36230@r{ a@: H l q @: @: @:fieldquant@:(a)} 36227@r{ a@: H l q @: @: @:lufquant@:(a)}
36231@r{ a b@: O H l q @: @: @:fieldquant@:(a,b)} 36228@r{ a b@: O H l q @: @: @:lufquant@:(a,b)}
36232@r{ a@: l s @: @: @:spn@:(a)} 36229@r{ a@: l s @: @: @:spn@:(a)}
36233@r{ a@: l m @: @: @:midi@:(a)} 36230@r{ a@: l m @: @: @:midi@:(a)}
36234@r{ a@: l f @: @: @:freq@:(a)} 36231@r{ a@: l f @: @: @:freq@:(a)}
diff --git a/doc/misc/message.texi b/doc/misc/message.texi
index b28639907ed..48d0028e452 100644
--- a/doc/misc/message.texi
+++ b/doc/misc/message.texi
@@ -1202,6 +1202,10 @@ The text is killed and replaced with the contents of the variable
1202@code{message-elide-ellipsis}. The default value is to use an ellipsis 1202@code{message-elide-ellipsis}. The default value is to use an ellipsis
1203(@samp{[...]}). 1203(@samp{[...]}).
1204 1204
1205This is a format-spec string, and you can use @samp{%l} to say how
1206many lines were removed, and @samp{%c} to say how many characters were
1207removed.
1208
1205@item C-c M-k 1209@item C-c M-k
1206@kindex C-c M-k 1210@kindex C-c M-k
1207@findex message-kill-address 1211@findex message-kill-address
@@ -1930,6 +1934,25 @@ posting a prepared news message.
1930@section Insertion Variables 1934@section Insertion Variables
1931 1935
1932@table @code 1936@table @code
1937@item message-cite-style
1938@vindex message-cite-style
1939The overall style to be used when replying to messages. This controls
1940things like where the reply should be put relative to the original,
1941how the citation is formatted, where the signature goes, etc.
1942
1943Value is either @code{nil} (no variable overrides) or a let-style list
1944of pairs @code{(VARIABLE VALUE)} to override default values.
1945
1946See @code{gnus-posting-styles} to set this variable for specific
1947groups. Presets to impersonate popular mail agents are available in the
1948@code{message-cite-style-*} variables.
1949
1950@item message-cite-reply-position
1951@vindex message-cite-reply-position
1952Where the reply should be positioned. Available styles are
1953@code{traditional} to reply inline, @code{above} for top-posting, and
1954@code{below} for bottom-posting
1955
1933@item message-ignored-cited-headers 1956@item message-ignored-cited-headers
1934@vindex message-ignored-cited-headers 1957@vindex message-ignored-cited-headers
1935All headers that match this regexp will be removed from yanked 1958All headers that match this regexp will be removed from yanked
@@ -2298,8 +2321,7 @@ created.
2298 2321
2299@item unique 2322@item unique
2300@item t 2323@item t
2301Create the new buffer with the name generated in the Message way. This 2324Create the new buffer with the name generated in the Message way.
2302is the default.
2303 2325
2304@item unsent 2326@item unsent
2305Similar to @code{unique} but the buffer name begins with "*unsent ". 2327Similar to @code{unique} but the buffer name begins with "*unsent ".
@@ -2315,7 +2337,7 @@ type, the To address and the group name (any of these may be
2315@code{nil}). The function should return the new buffer name. 2337@code{nil}). The function should return the new buffer name.
2316@end table 2338@end table
2317 2339
2318The default value is @code{unique}. 2340The default value is @code{unsent}.
2319 2341
2320@item message-max-buffers 2342@item message-max-buffers
2321@vindex message-max-buffers 2343@vindex message-max-buffers
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index bdbba437af7..e1c4a806de2 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -2540,7 +2540,28 @@ Another trick might be that you put @code{ForwardX11 yes} or
2540that host. 2540that host.
2541 2541
2542 2542
2543@subsection Running shell-command on a remote host 2543@subsection Running @code{shell} on a remote host
2544@cindex shell
2545
2546Calling @code{M-x shell} in a buffer related to a remote host runs the
2547local shell as defined in @option{shell-file-name}. This might be
2548also a valid path name for a shell to be applied on the remote host,
2549but it will fail at least when your local and remote hosts belong to
2550different system types, like @samp{windows-nt} and @samp{gnu/linux}.
2551
2552You must set the variable @option{explicit-shell-file-name} to the
2553shell path name on the remote host, in order to start that shell on
2554the remote host.
2555
2556@ifset emacs
2557Starting with Emacs 24 this won't be necessary, if you call
2558@code{shell} interactively. You will be asked for the remote shell
2559path, if you are on a remote buffer, and if
2560@option{explicit-shell-file-name} is equal to @code{nil}.
2561@end ifset
2562
2563
2564@subsection Running @code{shell-command} on a remote host
2544@cindex shell-command 2565@cindex shell-command
2545 2566
2546@code{shell-command} allows to execute commands in a shell, either 2567@code{shell-command} allows to execute commands in a shell, either
@@ -2556,13 +2577,13 @@ You will see the buffer @file{*Async Shell Command*}, containing the
2556continuous output of the @command{tail} command. 2577continuous output of the @command{tail} command.
2557 2578
2558 2579
2559@subsection Running eshell on a remote host 2580@subsection Running @code{eshell} on a remote host
2560@cindex eshell 2581@cindex eshell
2561 2582
2562@value{tramp} is integrated into @file{eshell.el}. That is, you can 2583@value{tramp} is integrated into @file{eshell.el}. That is, you can
2563open an interactive shell on your remote host, and run commands there. 2584open an interactive shell on your remote host, and run commands there.
2564After you have started @code{eshell}, you could perform commands like 2585After you have started @code{M-x eshell}, you could perform commands
2565this: 2586like this:
2566 2587
2567@example 2588@example
2568@b{~ $} cd @trampfn{sudo, , , /etc} @key{RET} 2589@b{~ $} cd @trampfn{sudo, , , /etc} @key{RET}
diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi
index 437b1372c11..e4c444980c8 100644
--- a/doc/misc/trampver.texi
+++ b/doc/misc/trampver.texi
@@ -8,7 +8,7 @@
8@c In the Tramp CVS, the version number is auto-frobbed from 8@c In the Tramp CVS, the version number is auto-frobbed from
9@c configure.ac, so you should edit that file and run 9@c configure.ac, so you should edit that file and run
10@c "autoconf && ./configure" to change the version number. 10@c "autoconf && ./configure" to change the version number.
11@set trampver 2.2.1-pre 11@set trampver 2.2.1
12 12
13@c Other flags from configuration 13@c Other flags from configuration
14@set instprefix /usr/local 14@set instprefix /usr/local
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 13f99b466a3..53cd307e3cc 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,17 @@
12011-03-16 Juanma Barranquero <lekktu@gmail.com>
2
3 * NEWS: Document warning about _emacs.
4
52011-03-14 Michael Albinus <michael.albinus@gmx.de>
6
7 * NEWS: `shell' prompts for the shell path name, when the default
8 directory is a remote file name and neither environment variable
9 $ESHELL nor variable `explicit-shell-file-name' is set.
10
112011-03-08 Kristoffer Grönlund <krig@koru.se>
12
13 * themes/wombat-theme.el: New file.
14
12011-03-06 Juanma Barranquero <lekktu@gmail.com> 152011-03-06 Juanma Barranquero <lekktu@gmail.com>
2 16
3 * srecode/el.srt: Fix typo. 17 * srecode/el.srt: Fix typo.
@@ -10,15 +24,15 @@
102011-02-17 Ken Manheimer <ken.manheimer@gmail.com> 242011-02-17 Ken Manheimer <ken.manheimer@gmail.com>
11 25
12 * etc/images/icons/allout-widgets/dark-bg, 26 * etc/images/icons/allout-widgets/dark-bg,
13 etc/images/icons/allout-widgets/light-bg, 27 * etc/images/icons/allout-widgets/light-bg,
14 encrypted-locked.{xpm,png}, unlocked-encrypted.{xpm,png}: 28 * encrypted-locked.{xpm,png}, unlocked-encrypted.{xpm,png}:
15 Reorganize icon directories and files to reconcile against windows 29 Reorganize icon directories and files to reconcile against windows
16 short-filename clashes. 30 short-filename clashes.
17 31
182011-02-16 Ken Manheimer <ken.manheimer@gmail.com> 322011-02-16 Ken Manheimer <ken.manheimer@gmail.com>
19 33
20 * etc/images/icons/allout-widgets-dark-bg, 34 * etc/images/icons/allout-widgets-dark-bg,
21 etc/images/icons/allout-widgets-light-bg: Icons for new 35 * etc/images/icons/allout-widgets-light-bg: Icons for new
22 allout-widgets.el. 36 allout-widgets.el.
23 37
24 * etc/images/icons/README: Include coypright and GPL 3 license for 38 * etc/images/icons/README: Include coypright and GPL 3 license for
diff --git a/etc/NEWS b/etc/NEWS
index ac7fdcbab0c..a7ec965e3d6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -62,6 +62,8 @@ longer have any effect. (They were declared obsolete in Emacs 23.)
62** New command line option `--no-site-lisp' removes site-lisp directories 62** New command line option `--no-site-lisp' removes site-lisp directories
63from load-path. -Q now implies this. 63from load-path. -Q now implies this.
64 64
65** On Windows, Emacs now warns when the obsolete _emacs init file is used.
66
65 67
66* Changes in Emacs 24.1 68* Changes in Emacs 24.1
67 69
@@ -79,6 +81,9 @@ error, its exit status is 1.
79 81
80** Completion can cycle, depending on completion-cycle-threshold. 82** Completion can cycle, depending on completion-cycle-threshold.
81 83
84** `completing-read' can be customized using the new variable
85`completing-read-function'
86
82** auto-mode-case-fold is now enabled by default. 87** auto-mode-case-fold is now enabled by default.
83 88
84+++ 89+++
@@ -183,8 +188,8 @@ If you have code that adds something to kill-emacs-hook, you should
183consider if it is still appropriate to add it in the noninteractive case. 188consider if it is still appropriate to add it in the noninteractive case.
184 189
185** New scrolling commands `scroll-up-command' and `scroll-down-command' 190** New scrolling commands `scroll-up-command' and `scroll-down-command'
186(bound to C-v/[next] and M-v/[prior]) does not signal errors at top/bottom 191(bound to C-v/[next] and M-v/[prior]) do not signal errors at top/bottom
187of buffer at first key-press (instead moves to top/bottom of buffer) 192of buffer at first key-press (instead move to top/bottom of buffer)
188when a new variable `scroll-error-top-bottom' is non-nil. 193when a new variable `scroll-error-top-bottom' is non-nil.
189 194
190** New scrolling commands `scroll-up-line' and `scroll-down-line' 195** New scrolling commands `scroll-up-line' and `scroll-down-line'
@@ -335,6 +340,10 @@ between applications.
335the lines in the current rectangle. With an prefix argument, this 340the lines in the current rectangle. With an prefix argument, this
336prompts for a number to count from and for a format string. 341prompts for a number to count from and for a format string.
337 342
343** The command shell prompts for the shell path name, when the default
344directory is a remote file name and neither environment variable
345$ESHELL nor variable `explicit-shell-file-name' is set.
346
338 347
339* Changes in Specialized Modes and Packages in Emacs 24.1 348* Changes in Specialized Modes and Packages in Emacs 24.1
340 349
@@ -359,7 +368,7 @@ Just set shell-dir-cookie-re to an appropriate regexp.
359** Archive Mode has basic support to browse 7z archives. 368** Archive Mode has basic support to browse 7z archives.
360 369
361** browse-url has gotten a new variable that is used for mailto: URLs, 370** browse-url has gotten a new variable that is used for mailto: URLs,
362 `browse-url-mailto-function', which defaults to `browse-url-mail'. 371`browse-url-mailto-function', which defaults to `browse-url-mail'.
363 372
364** Directory local variables can apply to file-less buffers, in certain modes 373** Directory local variables can apply to file-less buffers, in certain modes
365(eg dired, vc-dir, log-edit). For example, adding 374(eg dired, vc-dir, log-edit). For example, adding
@@ -645,6 +654,8 @@ binding `log-view-expanded-log-entry-function' to a suitable function.
645--- 654---
646*** `copyright-fix-years' can optionally convert consecutive years to ranges. 655*** `copyright-fix-years' can optionally convert consecutive years to ranges.
647 656
657*** New command `nato-region' converts text to NATO phonetic alphabet.
658
648 659
649* New Modes and Packages in Emacs 24.1 660* New Modes and Packages in Emacs 24.1
650 661
@@ -694,15 +705,14 @@ FIXME: This only says what was changed, but not what are the
694programmer-visible consequences. 705programmer-visible consequences.
695 706
696** Passing a nil argument to a minor mode function now turns the mode 707** Passing a nil argument to a minor mode function now turns the mode
697 ON unconditionally. 708ON unconditionally.
698 709
699** During startup, Emacs no longer adds entries for `menu-bar-lines' 710** During startup, Emacs no longer adds entries for `menu-bar-lines'
700and `tool-bar-lines' to `default-frame-alist' and 711and `tool-bar-lines' to `default-frame-alist' and `initial-frame-alist'.
701`initial-frame-alist'. With these alist entries omitted, `make-frame' 712With these alist entries omitted, `make-frame' checks the value of the
702checks the value of the variable `menu-bar-mode'/`tool-bar-mode' to 713variable `menu-bar-mode'/`tool-bar-mode' to determine whether to create
703determine whether to create a menu-bar or tool-bar, respectively. 714a menu-bar or tool-bar, respectively. If the alist entries are added,
704If the alist entries are added, they override the value of 715they override the value of `menu-bar-mode'/`tool-bar-mode'.
705`menu-bar-mode'/`tool-bar-mode'.
706 716
707** Regions created by mouse dragging are now normal active regions, 717** Regions created by mouse dragging are now normal active regions,
708similar to the ones created by shift-selection. In previous Emacs 718similar to the ones created by shift-selection. In previous Emacs
@@ -822,13 +832,13 @@ displayed with a "spinning bar".
822 832
823* Changes in Emacs 24.1 on non-free operating systems 833* Changes in Emacs 24.1 on non-free operating systems
824 834
825** New configure.bat option --enable-checking builds emacs with extra 835** New configure.bat option --enable-checking builds Emacs with extra
826runtime checks. 836runtime checks.
827 837
828** New configure.bat option --distfiles to specify files to be 838** New configure.bat option --distfiles to specify files to be
829included in binary distribution 839included in binary distribution.
830 840
831** New make target `dist' to create binary distribution for MS Windows 841** New make target `dist' to create binary distribution for MS Windows.
832 842
833 843
834---------------------------------------------------------------------- 844----------------------------------------------------------------------
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index d15677114aa..b4fe0b59237 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -58,3 +58,9 @@
58 '(window-number-face ((t (:foreground "red" :weight bold))))) 58 '(window-number-face ((t (:foreground "red" :weight bold)))))
59 59
60(provide-theme 'tsdh-dark) 60(provide-theme 'tsdh-dark)
61
62;; Local Variables:
63;; no-byte-compile: t
64;; End:
65
66;;; tsdh-dark-theme.el ends here
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index 9fac27fda1e..4eda7a4b7c3 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -57,3 +57,10 @@
57 '(window-number-face ((t (:foreground "red" :weight bold))))) 57 '(window-number-face ((t (:foreground "red" :weight bold)))))
58 58
59(provide-theme 'tsdh-light) 59(provide-theme 'tsdh-light)
60
61
62;; Local Variables:
63;; no-byte-compile: t
64;; End:
65
66;;; tsdh-light-theme.el ends here
diff --git a/etc/themes/wombat-theme.el b/etc/themes/wombat-theme.el
new file mode 100644
index 00000000000..6a16b52ee24
--- /dev/null
+++ b/etc/themes/wombat-theme.el
@@ -0,0 +1,108 @@
1;;; wombat-theme.el --- Custom face theme for Emacs
2
3;; Copyright (C) 2011 Free Software Foundation, Inc.
4
5;; Author: Kristoffer Grönlund <krig@koru.se>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22;;; Code:
23
24(deftheme wombat
25 "Theme for faces, using easy-on-the eyes colors on a dark gray background.
26Adapted, with permission, from a Vim color scheme by Lars H. Nielsen.
27Basic, Font Lock, Isearch, Gnus, Message, and Ansi-Color faces
28are included.")
29
30(let ((class '((class color) (min-colors 89))))
31 (custom-theme-set-faces
32 'wombat
33 `(default ((,class (:background "#242424" :foreground "#f6f3e8"))))
34 `(cursor ((,class (:background "#656565" :foreground "#f6f3e8"))))
35 ;; Highlighting faces
36 `(fringe ((,class (:background "#303030"))))
37 `(highlight ((,class (:background "#454545" :foreground "#ffffff"
38 :underline t))))
39 `(region ((,class (:background "#444444" :foreground "#f6f3e8"))))
40 `(secondary-selection ((,class (:background "#333366" :foreground "#f6f3e8"))))
41 `(isearch ((,class (:background "#343434" :foreground "#857b6f"))))
42 `(lazy-highlight ((,class (:background "#384048" :foreground "#a0a8b0"))))
43 ;; Mode line faces
44 `(mode-line ((,class (:background "#444444" :foreground "#f6f3e8"))))
45 `(mode-line-inactive ((,class (:background "#444444" :foreground "#857b6f"))))
46 ;; Escape and prompt faces
47 `(minibuffer-prompt ((,class (:foreground "#e5786d"))))
48 `(escape-glyph ((,class (:foreground "#ddaa6f" :weight bold))))
49 ;; Font lock faces
50 `(font-lock-builtin-face ((,class (:foreground "#e5786d"))))
51 `(font-lock-comment-face ((,class (:foreground "#99968b"))))
52 `(font-lock-constant-face ((,class (:foreground "#e5786d"))))
53 `(font-lock-function-name-face ((,class (:foreground "#cae682"))))
54 `(font-lock-keyword-face ((,class (:foreground "#8ac6f2" :weight bold))))
55 `(font-lock-string-face ((,class (:foreground "#95e454"))))
56 `(font-lock-type-face ((,class (:foreground "#92a65e" :weight bold))))
57 `(font-lock-variable-name-face ((,class (:foreground "#cae682"))))
58 `(font-lock-warning-face ((,class (:foreground "#ccaa8f"))))
59 ;; Button and link faces
60 `(link ((,class (:foreground "#8ac6f2" :underline t))))
61 `(link-visited ((,class (:foreground "#e5786d" :underline t))))
62 `(button ((,class (:background "#333333" :foreground "#f6f3e8"))))
63 `(header-line ((,class (:background "#303030" :foreground "#e7f6da"))))
64 ;; Gnus faces
65 `(gnus-group-news-1 ((,class (:weight bold :foreground "#95e454"))))
66 `(gnus-group-news-1-low ((,class (:foreground "#95e454"))))
67 `(gnus-group-news-2 ((,class (:weight bold :foreground "#cae682"))))
68 `(gnus-group-news-2-low ((,class (:foreground "#cae682"))))
69 `(gnus-group-news-3 ((,class (:weight bold :foreground "#ccaa8f"))))
70 `(gnus-group-news-3-low ((,class (:foreground "#ccaa8f"))))
71 `(gnus-group-news-4 ((,class (:weight bold :foreground "#99968b"))))
72 `(gnus-group-news-4-low ((,class (:foreground "#99968b"))))
73 `(gnus-group-news-5 ((,class (:weight bold :foreground "#cae682"))))
74 `(gnus-group-news-5-low ((,class (:foreground "#cae682"))))
75 `(gnus-group-news-low ((,class (:foreground "#99968b"))))
76 `(gnus-group-mail-1 ((,class (:weight bold :foreground "#95e454"))))
77 `(gnus-group-mail-1-low ((,class (:foreground "#95e454"))))
78 `(gnus-group-mail-2 ((,class (:weight bold :foreground "#cae682"))))
79 `(gnus-group-mail-2-low ((,class (:foreground "#cae682"))))
80 `(gnus-group-mail-3 ((,class (:weight bold :foreground "#ccaa8f"))))
81 `(gnus-group-mail-3-low ((,class (:foreground "#ccaa8f"))))
82 `(gnus-group-mail-low ((,class (:foreground "#99968b"))))
83 `(gnus-header-content ((,class (:foreground "#8ac6f2"))))
84 `(gnus-header-from ((,class (:weight bold :foreground "#95e454"))))
85 `(gnus-header-subject ((,class (:foreground "#cae682"))))
86 `(gnus-header-name ((,class (:foreground "#8ac6f2"))))
87 `(gnus-header-newsgroups ((,class (:foreground "#cae682"))))
88 ;; Message faces
89 `(message-header-name ((,class (:foreground "#8ac6f2" :weight bold))))
90 `(message-header-cc ((,class (:foreground "#95e454"))))
91 `(message-header-other ((,class (:foreground "#95e454"))))
92 `(message-header-subject ((,class (:foreground "#cae682"))))
93 `(message-header-to ((,class (:foreground "#cae682"))))
94 `(message-cited-text ((,class (:foreground "#99968b"))))
95 `(message-separator ((,class (:foreground "#e5786d" :weight bold))))))
96
97(custom-theme-set-variables
98 'wombat
99 '(ansi-color-names-vector ["#242424" "#e5786d" "#95e454" "#cae682"
100 "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"]))
101
102(provide-theme 'wombat)
103
104;; Local Variables:
105;; no-byte-compile: t
106;; End:
107
108;;; wombat-theme.el ends here
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 4b50b2dddeb..bd1a84cf0b9 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -119,7 +119,7 @@
119 ($(BLD)/etags.$(O), $(BLD)/movemail.$(O), $(BLD)/ntlib.$(O)): 119 ($(BLD)/etags.$(O), $(BLD)/movemail.$(O), $(BLD)/ntlib.$(O)):
120 Depend on $(EMACS_ROOT)/nt/inc/sys/stat.h. 120 Depend on $(EMACS_ROOT)/nt/inc/sys/stat.h.
121 121
1222011-02-21 Ben Key <bkey76@gmail.com> (tiny change) 1222011-02-21 Ben Key <bkey76@gmail.com>
123 123
124 * make-docfile.c (scan_c_file): Adapt DEFVAR_PER_BUFFER case to 124 * make-docfile.c (scan_c_file): Adapt DEFVAR_PER_BUFFER case to
125 the new BVAR macro. 125 the new BVAR macro.
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index b5fd4a358db..cd6a1d00c15 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -9,7 +9,7 @@
9# the same distribution terms as the rest of that program. 9# the same distribution terms as the rest of that program.
10# 10#
11# Generated by gnulib-tool. 11# Generated by gnulib-tool.
12# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value lstat mktime readlink strftime symlink sys_stat 12# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink strftime symlink sys_stat
13 13
14 14
15MOSTLYCLEANFILES += core *.stackdump 15MOSTLYCLEANFILES += core *.stackdump
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 61cdcc53928..13fae7b6703 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -355,7 +355,11 @@ _GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
355 355
356 356
357#if @GNULIB_FUTIMENS@ 357#if @GNULIB_FUTIMENS@
358# if @REPLACE_FUTIMENS@ 358/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens
359 implementation relies on futimesat, which on Solaris 10 makes an invocation
360 to futimens that is meant to invoke the libc's futimens(), not gnulib's
361 futimens(). */
362# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun)
359# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 363# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
360# undef futimens 364# undef futimens
361# define futimens rpl_futimens 365# define futimens rpl_futimens
@@ -368,7 +372,9 @@ _GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
368# endif 372# endif
369_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2])); 373_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
370# endif 374# endif
375# if @HAVE_FUTIMENS@
371_GL_CXXALIASWARN (futimens); 376_GL_CXXALIASWARN (futimens);
377# endif
372#elif defined GNULIB_POSIXCHECK 378#elif defined GNULIB_POSIXCHECK
373# undef futimens 379# undef futimens
374# if HAVE_RAW_DECL_FUTIMENS 380# if HAVE_RAW_DECL_FUTIMENS
@@ -612,7 +618,11 @@ _GL_WARN_ON_USE (stat, "stat is unportable - "
612 618
613 619
614#if @GNULIB_UTIMENSAT@ 620#if @GNULIB_UTIMENSAT@
615# if @REPLACE_UTIMENSAT@ 621/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat
622 implementation relies on futimesat, which on Solaris 10 makes an invocation
623 to utimensat that is meant to invoke the libc's utimensat(), not gnulib's
624 utimensat(). */
625# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun)
616# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 626# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
617# undef utimensat 627# undef utimensat
618# define utimensat rpl_utimensat 628# define utimensat rpl_utimensat
@@ -631,7 +641,9 @@ _GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
631_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name, 641_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
632 struct timespec const times[2], int flag)); 642 struct timespec const times[2], int flag));
633# endif 643# endif
644# if @HAVE_UTIMENSAT@
634_GL_CXXALIASWARN (utimensat); 645_GL_CXXALIASWARN (utimensat);
646# endif
635#elif defined GNULIB_POSIXCHECK 647#elif defined GNULIB_POSIXCHECK
636# undef utimensat 648# undef utimensat
637# if HAVE_RAW_DECL_UTIMENSAT 649# if HAVE_RAW_DECL_UTIMENSAT
diff --git a/lisp/ChangeLog.trunk b/lisp/ChangeLog.trunk
index e4d402afa76..d087982edee 100644
--- a/lisp/ChangeLog.trunk
+++ b/lisp/ChangeLog.trunk
@@ -1,3 +1,410 @@
12011-03-21 Glenn Morris <rgm@gnu.org>
2
3 * eshell/esh-opt.el (eshell-eval-using-options, eshell-process-args):
4 Doc fixes.
5
62011-03-21 Chong Yidong <cyd@stupidchicken.com>
7
8 * cus-theme.el: Add missing provide statement.
9 (customize-create-theme): Extract theme value correctly.
10 (custom-theme-visit-theme): Autoload.
11 (customize-create-theme): Prompt before inserting default faces.
12
132011-03-20 Jay Belanger <jay.p.belanger@gmail.com>
14
15 * calc/calc-menu.el (calc-units-menu): Add entries for logarithmic
16 units and musical notes.
17
182011-03-20 Leo <sdl.web@gmail.com>
19
20 * ido.el (ido-read-internal): Use completing-read-default.
21 (ido-completing-read): Fix compatibility with completing-read.
22
232011-03-20 Christian Ohler <ohler@gnu.org>
24
25 * emacs-lisp/ert.el (ert-run-tests-batch): Remove unused variable.
26 (ert-delete-all-tests): Use `called-interactively-p' rather than
27 `interactive-p'.
28 (ert--make-xrefs-region): Respect END.
29
302011-03-19 Chong Yidong <cyd@stupidchicken.com>
31
32 * dired-aux.el (dired-create-directory): Signal an error if the
33 directory already exists (Bug#8246).
34
35 * facemenu.el (list-colors-display): Call list-faces-display
36 inside with-help-window.
37 (list-colors-print): Use display property to align the final
38 column, instead of checking window-width.
39
402011-03-19 Eli Zaretskii <eliz@gnu.org>
41
42 * emerge.el (emerge-metachars): Separate value for ms-dos and
43 windows-nt systems.
44 (emerge-protect-metachars): Quote correctly for ms-dos and
45 windows-nt systems.
46
472011-03-19 Ralph Schleicher <rs@ralph-schleicher.de>
48
49 * info.el (info-initialize): Replace all uses of `:' with
50 path-separator for compatibility with non-Unix systems.
51 Cache quoting of path-separator. (Bug#8258)
52
532011-03-19 Juanma Barranquero <lekktu@gmail.com>
54
55 * avoid.el (mouse-avoidance-mode, mouse-avoidance-nudge-dist)
56 (mouse-avoidance-threshold, mouse-avoidance-banish-destination)
57 (mouse-avoidance-mode): Fix typos in docstrings.
58
592011-03-19 Chong Yidong <cyd@stupidchicken.com>
60
61 * startup.el (package-subdirectory-regexp): Move from package.el.
62 Omit \\` and \\', and let callers add them.
63
64 * emacs-lisp/package.el (package-strip-version)
65 (package-load-all-descriptors): Add \\` and \\' to
66 package-subdirectory-regexp before using it.
67 (package-untar-buffer): New arg DIR; ensure that file untars only
68 into this expected directory. Remove superfluous delete-region.
69 (package-unpack): Caller changed.
70 (package-tar-file-info): Use package-subdirectory-regexp.
71
722011-03-18 Stefan Monnier <monnier@iro.umontreal.ca>
73
74 * vc/diff-mode.el (diff-mode-map): Shadow problematic bindings from
75 diff-mode-shared-map (bug#8284).
76 (diff-mode-shared-map): Re-introduce some bindings that were problematic.
77
782011-03-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
79
80 * calendar/time-date.el (format-seconds): Use assoc instead of
81 assoc-string, since assoc-string doesn't exist in XEmacs.
82
832011-03-17 Juanma Barranquero <lekktu@gmail.com>
84
85 * custom.el (custom-known-themes): Reflow docstring.
86 (custom-theme-load-path): Fix typo in docstring.
87 (load-theme): Fix typo in error message.
88 (custom-available-themes, custom-variable-theme-value):
89 Use `let', not `let*'.
90
912011-03-17 Jay Belanger <jay.p.belanger@gmail.com>
92
93 * calc/README: Mention inclusion of musical notes.
94
95 * calc/calc-units.el (calc-lu-quant): Rename from
96 `calc-logunits-quantity'.
97 (calcFunc-lupquant): Rename from `calcFunc-powerquant'.
98 (calcFunc-lufquant): Rename from `calcFunc-fieldquant'.
99 (calc-db): Rename from `calc-dblevel'.
100 (calcFunc-dbpower): Rename from `calcFunc-dbpowerlevel'.
101 (calcFunc-dbfield): Rename from `calcFunc-dbfieldlevel'.
102 (calc-np): Rename from `calc-nplevel'.
103 (calcFunc-nppower): Rename from `calcFunc-nppowerlevel'.
104 (calcFunc-npfield): Rename from `calcFunc-npfieldlevel'.
105 (calc-lu-plus): Rename from `calc-logunits-add'.
106 (calcFunc-lupadd): Rename from `calcFunc-lupoweradd'.
107 (calcFunc-lufadd): Rename from `calcFunc-lufieldadd'.
108 (calc-lu-minus): Rename from `calc-logunits-sub'.
109 (calcFunc-lupsub): Rename from `calcFunc-lupowersub'.
110 (calcFunc-lufsub): Rename from `calcFunc-lufieldsub'.
111 (calc-lu-times): Rename from `calc-logunits-mul'.
112 (calcFunc-lupmul): Rename from `calcFunc-lupowermul'.
113 (calcFunc-lufmul): Rename from `calcFunc-lufieldmul'.
114 (calc-lu-divide): Rename from `calc-logunits-div'.
115 (calcFunc-lupdiv): Rename from `calcFunc-lupowerdiv'.
116 (calcFunc-lufdiv): Rename from `calcFunc-lufielddiv'.
117
118 * calc/calc-ext.el (calc-init-extensions): Update the names of the
119 functions being autoloaded.
120
121 * calc/calc.el (calc-lu-power-reference): Rename from
122 `calc-logunits-power-reference'.
123 (calc-lu-field-reference): Rename from
124 `calc-logunits-field-reference'.
125
126 * calc/calc-help (calc-l-prefix-help): Mention musical note functions.
127
1282011-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
129
130 * minibuffer.el (completion-all-sorted-completions):
131 Use :completion-cycle-penalty text property if present.
132
1332011-03-16 Ken Manheimer <ken.manheimer@gmail.com>
134
135 * allout.el (allout-yank-processing): Adjust for new rebulleting
136 regime so bullet being yanked is used without prompting the user
137 for a choice.
138
1392011-03-16 Juanma Barranquero <lekktu@gmail.com>
140
141 * startup.el (command-line): Warn the user that _emacs is deprecated.
142
1432011-03-16 Juanma Barranquero <lekktu@gmail.com>
144
145 * progmodes/delphi.el (delphi-search-path, delphi-indent-level)
146 (delphi-verbose, delphi-comment-face, delphi-string-face)
147 (delphi-keyword-face, delphi-ignore-changes, delphi-indent-line)
148 (delphi-mode-abbrev-table, delphi-debug-buffer, delphi-tab)
149 (delphi-find-unit, delphi-find-current-xdef, delphi-fill-comment)
150 (delphi-new-comment-line, delphi-font-lock-defaults)
151 (delphi-debug-mode-map, delphi-mode-syntax-table, delphi-mode):
152 Fix typos in docstrings.
153
1542011-03-15 Ken Manheimer <ken.manheimer@gmail.com>
155
156 * allout.el (allout-make-topic-prefix, allout-rebullet-heading):
157 Invert the roles of character and string values for INSTEAD, so a
158 string is used for the more common case of a defaulting prompt.
159
1602011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
161
162 * progmodes/ruby-mode.el (ruby-backward-sexp):
163 * progmodes/ebrowse.el (ebrowse-draw-file-member-info):
164 * play/gamegrid.el (gamegrid-make-face):
165 * play/bubbles.el (bubbles--grid-width, bubbles--grid-height)
166 (bubbles--colors, bubbles--shift-mode, bubbles--initialize-images):
167 * notifications.el (notifications-notify):
168 * net/xesam.el (xesam-search-engines):
169 * net/quickurl.el (quickurl-list-insert):
170 * vc/vc-hg.el (vc-hg-dir-printer): Fix use of case.
171
1722011-03-15 Chong Yidong <cyd@stupidchicken.com>
173
174 * startup.el (command-line): Update package subdirectory regexp.
175
1762011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
177
178 * allout.el (allout-abbreviate-flattened-numbering)
179 (allout-mode-deactivate-hook): Fix up obsolescence "date".
180
181 * subr.el (read-char-choice): Only show the cursor after the prompt,
182 not after the answer.
183
1842011-03-15 Kevin Ryde <user42@zip.com.au>
185
186 * help-fns.el (variable-at-point): Skip leading quotes, if any
187 (bug#8253).
188
1892011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
190
191 * emacs-lisp/bytecomp.el (byte-compile-save-excursion): Change the
192 warning message.
193
1942011-03-14 Michael Albinus <michael.albinus@gmx.de>
195
196 * shell.el (shell): When called interactively, offer to change the
197 shell file name on remote hosts.
198
1992011-03-13 Teodor Zlatanov <tzz@lifelogs.com>
200
201 * net/ldap.el (ldap-search-internal): Add `auth-source-search'
202 integration for LDAP parameters. The host, base, user or binddn,
203 and secret tokens can be specified in a netrc file, for instance.
204 This is optional because an `auth-source' parameter must be
205 specified in the search attributes.
206
2072011-03-13 Juanma Barranquero <lekktu@gmail.com>
208
209 * help.el (describe-mode): Link to the mode's definition (bug#8185).
210
2112011-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
212
213 * ebuff-menu.el (electric-buffer-menu-mode-map): Move initialization
214 into declaration. Remove redundant and harmful binding.
215
2162011-03-12 Eli Zaretskii <eliz@gnu.org>
217
218 * files.el (file-ownership-preserved-p): Pass `integer' as an
219 explicit 2nd argument to `file-attributes'. If the file's owner
220 is the Administrators group on Windows, and the current user is
221 Administrator, consider that a match.
222
223 * server.el (server-ensure-safe-dir): Consider server directory
224 safe on MS-Windows if its owner is the Administrators group while
225 the current Emacs user is Administrator. Use `=' to compare
226 numerical UIDs, since they could be integers or floats.
227
2282011-03-12 Juanma Barranquero <lekktu@gmail.com>
229
230 * vc/vc-bzr.el (vc-bzr-state): Handle bzr 2.3.0 (follow-up to bug#8170).
231
2322011-03-12 Michael Albinus <michael.albinus@gmx.de>
233
234 Sync with Tramp 2.2.1.
235
236 * net/tramp-sh.el (tramp-methods): Exchange "%k" marker with options.
237
238 * net/trampver.el: Update release number.
239
2402011-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
241
242 * progmodes/compile.el (compilation--previous-directory): Fix up
243 various nil/dead-marker mismatches (bug#8014).
244 (compilation-directory-properties, compilation-error-properties):
245 Don't call it at a position past the one we're about to change.
246
247 * emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable):
248 Disable obsolescence warnings in the file that declares it.
249
2502011-03-11 Ken Manheimer <ken.manheimer@gmail.com>
251
252 * allout-widgets.el (allout-widgets-tally): Initialize
253 allout-widgets-tally as a hash table rather than nil to prevent
254 mode-line redisplay warnings.
255 Also, clarify the module description and fix a comment typo.
256
2572011-03-11 Juanma Barranquero <lekktu@gmail.com>
258
259 * help-fns.el (describe-variable): Don't complete keywords.
260 Suggested by Teodor Zlatanov <tzz@lifelogs.com>.
261
2622011-03-10 Chong Yidong <cyd@stupidchicken.com>
263
264 * emacs-lisp/package.el (package-version-join): Impose a standard
265 string representation for pre/alpha/beta version lists.
266 (package-unpack-single): Standardize the directory name by passing
267 it through package-version-join.
268 (package-strip-rcs-id): Accept any version string that does not
269 signal an error in version-to-list.
270
2712011-03-10 Michael Albinus <michael.albinus@gmx.de>
272
273 * simple.el (delete-trailing-whitespace): Return nil for the
274 benefit of `write-file-functions'.
275
2762011-03-10 Glenn Morris <rgm@gnu.org>
277
278 * vc/vc-hg.el (vc-hg-pull, vc-hg-merge-branch): Use vc-hg-program.
279
280 * vc/vc-git.el (vc-git-program): New option.
281 (vc-git-branches, vc-git-pull, vc-git-merge-branch, vc-git-command)
282 (vc-git--call): Use it.
283
284 * eshell/esh-util.el (eshell-condition-case): Doc fix.
285
286 * cus-edit.el (Custom-newline): If no button at point, look
287 for a subgroup button at start-of-line. (Bug#2298)
288
289 * mail/rmail.el (rmail-msgend, rmail-msgbeg): Doc fixes.
290
2912011-03-10 Julien Danjou <julien@danjou.info>
292
293 * avoid.el (mouse-avoidance-ignore-p): Do not move the cursor if
294 `cursor-type' is nil.
295
2962011-03-09 Jay Belanger <jay.p.belanger@gmail.com>
297
298 * calc/calc.el (calc-mode-map): Don't bind "C-_" to `calc-missing-key'.
299
3002011-03-09 Ken Manheimer <ken.manheimer@gmail.com>
301
302 * allout.el Summary: Change so yank of distinctive-bullet items
303 preserves the existing header prefix, rebulleting it if necessary,
304 rather than replacing it. This is necessary for proper operation
305 of cooperative addons like allout-widgets.
306 (allout-make-topic-prefix, allout-rebullet-heading): Change
307 SOLICIT arg to INSTEAD, and interpret additionally a string value
308 as alternate bullet to be used, instead of prompting the user for
309 a bullet character.
310
3112011-03-09 Michael Albinus <michael.albinus@gmx.de>
312
313 * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Do
314 not use `tramp-file-name-port', because this returns also
315 `tramp-default-port'.
316
3172011-03-09 Deniz Dogan <deniz.a.m.dogan@gmail.com>
318
319 * net/rcirc.el (rcirc-handler-001): Remove useless
320 with-rcirc-process-buffer.
321 (rcirc-check-auth-status): Swap arguments to string-match.
322
3232011-03-09 Glenn Morris <rgm@gnu.org>
324
325 * shell.el (shell-mode):
326 Set comint-input-ring-size from HISTSIZE. (Bug#7889)
327
328 * progmodes/gdb-mi.el (gdb): Improve 2010-12-08 change.
329 Check for GDBHISTFILE, HISTSIZE, etc. (Bug#7889)
330
3312011-03-08 Chong Yidong <cyd@stupidchicken.com>
332
333 * emacs-lisp/package.el (package-refresh-contents)
334 (package-menu-execute): Use condition-case-no-debug.
335
3362011-03-08 Michael Albinus <michael.albinus@gmx.de>
337
338 * simple.el (shell-command-to-string): Use `process-file'.
339
340 * emacs-lisp/package.el (package-tar-file-info): Handle also
341 remote files.
342
343 * emacs-lisp/package-x.el (package-upload-buffer-internal): Use
344 `equal' for upload base check.
345
3462011-03-08 Arni Magnusson <arnima@hafro.is> (tiny change)
347
348 * textmodes/texinfo.el (texinfo-environments):
349 Add deftypecv, deftypeivar, deftypemethod, deftypeop, html. (Bug#2783)
350
3512011-03-08 Glenn Morris <rgm@gnu.org>
352
353 * cus-start.el (cursor-in-non-selected-windows):
354 Fix :set quoting oddness. (Bug#8192)
355
356 * font-lock.el (lisp-font-lock-keywords-1): Don't highlight `)'
357 in some setf expressions. (Bug#2159)
358
3592011-03-08 Chong Yidong <cyd@stupidchicken.com>
360
361 * custom.el (custom-available-themes): Return themes in
362 alphabetical order.
363
3642011-03-07 Chong Yidong <cyd@stupidchicken.com>
365
366 * progmodes/cc-cmds.el (c-beginning-of-statement): Fix incorrect
367 application of patch from Alan Mackenzie (Bug#7595).
368
3692011-03-07 Deniz Dogan <deniz.a.m.dogan@gmail.com>
370
371 * net/rcirc.el (rcirc-connect): Fix PASS bug.
372
3732011-03-07 Glenn Morris <rgm@gnu.org>
374
375 * vc/vc.el (vc-next-action): Add missing space to y-or-n-p prompt.
376 Give an explicit error if failed to make writable. (Bug#6146)
377
3782011-03-07 Ed Reingold <reingold@emr.cs.iit.edu>
379
380 * calendar/cal-hebrew.el (diary-hebrew-yahrzeit):
381 Add optional `after-sunset' argument. (Bug#8190)
382
3832011-03-07 Aaron S. Hawley <aaron.s.hawley@gmail.com>
384
385 * play/morse.el (nato-alphabet, nato-region, denato-region):
386 New variable and functions. (Bug#2288)
387 (morse-region, unmorse-region): Barf if read-only.
388
3892011-03-06 Stefan Monnier <monnier@iro.umontreal.ca>
390
391 * progmodes/gud.el (gdb-script-syntax-propertize-function):
392 Don't change the syntax of a \n that closes a comment (bug#8169).
393
3942011-03-06 Chong Yidong <cyd@stupidchicken.com>
395
396 * emacs-lisp/package-x.el (package-archive-upload-base): Make it a
397 defcustom.
398 (package--update-file): Doc fix. Accept relative file names.
399 (package--archive-contents-from-file): Remove the argument, since
400 it's necessarily always "archive-contents".
401 (package-maint-add-news-item): Pass relative file name args to
402 package--update-file.
403 (package-upload-buffer-internal): Prompt for a destination if
404 package-archive-upload-base is invalid. Create the directory if
405 it does not exist.
406 (package-upload-buffer, package-upload-file): Doc fix.
407
12011-03-06 Chong Yidong <cyd@stupidchicken.com> 4082011-03-06 Chong Yidong <cyd@stupidchicken.com>
2 409
3 * isearch.el (isearch-mode-map): Bind C-y to isearch-yank-kill, 410 * isearch.el (isearch-mode-map): Bind C-y to isearch-yank-kill,
@@ -11,8 +418,8 @@
11 418
122011-03-06 Jay Belanger <jay.p.belanger@gmail.com> 4192011-03-06 Jay Belanger <jay.p.belanger@gmail.com>
13 420
14 * calc/calc-ext.el (calc-init-extensions): Rename 421 * calc/calc-ext.el (calc-init-extensions):
15 calc-logunits-dblevel and calc-logunits-nplevel to calc-dblevel 422 Rename calc-logunits-dblevel and calc-logunits-nplevel to calc-dblevel
16 and calc-nplevel, respectively. Add keybindings for calc-spn, 423 and calc-nplevel, respectively. Add keybindings for calc-spn,
17 calc-midi and calc-freq. Add autoloads for calcFunc-spn, 424 calc-midi and calc-freq. Add autoloads for calcFunc-spn,
18 calcFunc-midi, calcFunc-freq, calc-spn, calc-midi and calc-freq. 425 calcFunc-midi, calcFunc-freq, calc-spn, calc-midi and calc-freq.
@@ -732,7 +1139,7 @@
7322011-02-17 Ken Manheimer <ken.manheimer@gmail.com> 11392011-02-17 Ken Manheimer <ken.manheimer@gmail.com>
733 1140
734 * lisp/allout-widgets.el (allout-widgets-icons-light-subdir) 1141 * lisp/allout-widgets.el (allout-widgets-icons-light-subdir)
735 (allout-widgets-icons-dark-subdir): Track relocations of icons 1142 (allout-widgets-icons-dark-subdir): Track relocations of icons.
736 * lisp/allout.el: Remove commentary about remove encryption 1143 * lisp/allout.el: Remove commentary about remove encryption
737 passphrase mnemonic support and verification. 1144 passphrase mnemonic support and verification.
738 (allout-encrypt-string): Recognize epg failure to decrypt gpg2 1145 (allout-encrypt-string): Recognize epg failure to decrypt gpg2
@@ -1109,10 +1516,9 @@
1109 1516
1110 (allout-auto-activation-helper, allout-setup): New autoloads 1517 (allout-auto-activation-helper, allout-setup): New autoloads
1111 implement new custom set procedure for allout-auto-activation. 1518 implement new custom set procedure for allout-auto-activation.
1112 Also, explicitly invoke 1519 Also, explicitly invoke (allout-setup) after allout-auto-activation
1113 (allout-setup) after allout-auto-activation is custom-defined, to 1520 is custom-defined, to affect the settings in emacs sessions besides
1114 effect the settings in emacs sessions besides the few where 1521 the few where allout-auto-activation customization is done.
1115 allout-auto-activation customization is donea.
1116 (allout-auto-activation): Use allout-auto-activation-helper to 1522 (allout-auto-activation): Use allout-auto-activation-helper to
1117 :set. Revise the docstring. 1523 :set. Revise the docstring.
1118 (allout-init): Reduce functionality to just customizing 1524 (allout-init): Reduce functionality to just customizing
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index cc5fd6d96fa..47f181ab76b 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -1,4 +1,4 @@
1;; allout-widgets.el --- Show allout outline structure with graphical widgets. 1;; allout-widgets.el --- Visually highlight allout outline structure.
2 2
3;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ken Manheimer 3;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ken Manheimer
4 4
@@ -238,7 +238,7 @@ buffer, and tracking increases as new widgets are added and
238decreases as obsolete widgets are garbage collected." 238decreases as obsolete widgets are garbage collected."
239 :type 'boolean 239 :type 'boolean
240 :group 'allout-widgets-developer) 240 :group 'allout-widgets-developer)
241(defvar allout-widgets-tally nil 241(defvar allout-widgets-tally (make-hash-table :test 'eq :weakness 'key)
242 "Hash-table of existing allout widgets, for debugging. 242 "Hash-table of existing allout widgets, for debugging.
243 243
244Table is maintained iff `allout-widgets-maintain-tally' is non-nil. 244Table is maintained iff `allout-widgets-maintain-tally' is non-nil.
diff --git a/lisp/allout.el b/lisp/allout.el
index c75b7a22f9a..3fb8ed7ccd5 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -310,6 +310,7 @@ Auto-layout is not.
310 310
311With value nil, inhibit any automatic allout-mode activation." 311With value nil, inhibit any automatic allout-mode activation."
312 :set 'allout-auto-activation-helper 312 :set 'allout-auto-activation-helper
313 ;; FIXME: Using strings here is unusual and less efficient than symbols.
313 :type '(choice (const :tag "On" t) 314 :type '(choice (const :tag "On" t)
314 (const :tag "Ask about layout" "ask") 315 (const :tag "Ask about layout" "ask")
315 (const :tag "Mode only" "activate") 316 (const :tag "Mode only" "activate")
@@ -752,7 +753,7 @@ Set this var to the bullet you want to use for file cross-references."
752 753
753;;;_ = allout-flattened-numbering-abbreviation 754;;;_ = allout-flattened-numbering-abbreviation
754(define-obsolete-variable-alias 'allout-abbreviate-flattened-numbering 755(define-obsolete-variable-alias 'allout-abbreviate-flattened-numbering
755 'allout-flattened-numbering-abbreviation "24.0") 756 'allout-flattened-numbering-abbreviation "24.1")
756(defcustom allout-flattened-numbering-abbreviation nil 757(defcustom allout-flattened-numbering-abbreviation nil
757 "If non-nil, `allout-flatten-exposed-to-buffer' abbreviates topic 758 "If non-nil, `allout-flatten-exposed-to-buffer' abbreviates topic
758numbers to minimal amount with some context. Otherwise, entire 759numbers to minimal amount with some context. Otherwise, entire
@@ -1402,7 +1403,7 @@ their settings before allout-mode was started."
1402(defvar allout-mode-deactivate-hook nil 1403(defvar allout-mode-deactivate-hook nil
1403 "*Hook that's run when allout mode ends.") 1404 "*Hook that's run when allout mode ends.")
1404(define-obsolete-variable-alias 'allout-mode-deactivate-hook 1405(define-obsolete-variable-alias 'allout-mode-deactivate-hook
1405 'allout-mode-off-hook "future") 1406 'allout-mode-off-hook "24.1")
1406;;;_ = allout-exposure-category 1407;;;_ = allout-exposure-category
1407(defvar allout-exposure-category nil 1408(defvar allout-exposure-category nil
1408 "Symbol for use as allout invisible-text overlay category.") 1409 "Symbol for use as allout invisible-text overlay category.")
@@ -3465,13 +3466,13 @@ Offer one suitable for current depth DEPTH as default."
3465(defun allout-make-topic-prefix (&optional prior-bullet 3466(defun allout-make-topic-prefix (&optional prior-bullet
3466 new 3467 new
3467 depth 3468 depth
3468 solicit 3469 instead
3469 number-control 3470 number-control
3470 index) 3471 index)
3471 ;; Depth null means use current depth, non-null means we're either 3472 ;; Depth null means use current depth, non-null means we're either
3472 ;; opening a new topic after current topic, lower or higher, or we're 3473 ;; opening a new topic after current topic, lower or higher, or we're
3473 ;; changing level of current topic. 3474 ;; changing level of current topic.
3474 ;; Solicit dominates specified bullet-char. 3475 ;; Instead dominates specified bullet-char.
3475;;;_ . Doc string: 3476;;;_ . Doc string:
3476 "Generate a topic prefix suitable for optional arg DEPTH, or current depth. 3477 "Generate a topic prefix suitable for optional arg DEPTH, or current depth.
3477 3478
@@ -3492,15 +3493,18 @@ bullet or previous sibling.
3492Third arg DEPTH forces the topic prefix to that depth, regardless of 3493Third arg DEPTH forces the topic prefix to that depth, regardless of
3493the current topics' depth. 3494the current topics' depth.
3494 3495
3495If SOLICIT is non-nil, then the choice of bullet is solicited from 3496If INSTEAD is:
3496user. If it's a character, then that character is offered as the 3497
3497default, otherwise the one suited to the context (according to 3498- nil, then the bullet char for the context is used, per distinction or depth
3498distinction or depth) is offered. (This overrides other options, 3499- a \(numeric) character, then character's string representation is used
3499including, eg, a distinctive PRIOR-BULLET.) If non-nil, then the 3500- a string, then the user is asked for bullet with the first char as default
3500context-specific bullet is used. 3501- anything else, the user is solicited with bullet char per context as default
3502
3503\(INSTEAD overrides other options, including, eg, a distinctive
3504PRIOR-BULLET.)
3501 3505
3502Fifth arg, NUMBER-CONTROL, matters only if `allout-numbered-bullet' 3506Fifth arg, NUMBER-CONTROL, matters only if `allout-numbered-bullet'
3503is non-nil *and* soliciting was not explicitly invoked. Then 3507is non-nil *and* no specific INSTEAD was specified. Then
3504NUMBER-CONTROL non-nil forces prefix to either numbered or 3508NUMBER-CONTROL non-nil forces prefix to either numbered or
3505denumbered format, depending on the value of the sixth arg, INDEX. 3509denumbered format, depending on the value of the sixth arg, INDEX.
3506 3510
@@ -3549,8 +3553,13 @@ index for each successive sibling)."
3549 ;; Solicitation overrides numbering and other cases: 3553 ;; Solicitation overrides numbering and other cases:
3550 ((progn (setq body (make-string (- depth 2) ?\ )) 3554 ((progn (setq body (make-string (- depth 2) ?\ ))
3551 ;; The actual condition: 3555 ;; The actual condition:
3552 solicit) 3556 instead)
3553 (let* ((got (allout-solicit-alternate-bullet depth solicit))) 3557 (let ((got (cond ((stringp instead)
3558 (if (> (length instead) 0)
3559 (allout-solicit-alternate-bullet
3560 depth (substring instead 0 1))))
3561 ((characterp instead) (char-to-string instead))
3562 (t (allout-solicit-alternate-bullet depth)))))
3554 ;; Gotta check whether we're numbering and got a numbered bullet: 3563 ;; Gotta check whether we're numbering and got a numbered bullet:
3555 (setq numbering (and allout-numbered-bullet 3564 (setq numbering (and allout-numbered-bullet
3556 (not (and number-control (not index))) 3565 (not (and number-control (not index)))
@@ -3913,7 +3922,7 @@ Note that refill of indented paragraphs is not done."
3913 (allout-end-of-prefix) 3922 (allout-end-of-prefix)
3914 (setq from allout-recent-prefix-beginning 3923 (setq from allout-recent-prefix-beginning
3915 to allout-recent-prefix-end) 3924 to allout-recent-prefix-end)
3916 (allout-rebullet-heading t ;;; solicit 3925 (allout-rebullet-heading t ;;; instead
3917 nil ;;; depth 3926 nil ;;; depth
3918 nil ;;; number-control 3927 nil ;;; number-control
3919 nil ;;; index 3928 nil ;;; index
@@ -3931,8 +3940,8 @@ Note that refill of indented paragraphs is not done."
3931 (message "Done.") 3940 (message "Done.")
3932 (cond (on-bullet (goto-char (allout-current-bullet-pos))) 3941 (cond (on-bullet (goto-char (allout-current-bullet-pos)))
3933 (initial-col (move-to-column initial-col))))) 3942 (initial-col (move-to-column initial-col)))))
3934;;;_ > allout-rebullet-heading (&optional solicit ...) 3943;;;_ > allout-rebullet-heading (&optional instead ...)
3935(defun allout-rebullet-heading (&optional solicit 3944(defun allout-rebullet-heading (&optional instead
3936 new-depth 3945 new-depth
3937 number-control 3946 number-control
3938 index 3947 index
@@ -3942,11 +3951,11 @@ Note that refill of indented paragraphs is not done."
3942 3951
3943All args are optional. 3952All args are optional.
3944 3953
3945If SOLICIT is non-nil, then the choice of bullet is solicited from 3954If INSTEAD is:
3946user. If it's a character, then that character is offered as the 3955- nil, then the bullet char for the context is used, per distinction or depth
3947default, otherwise the one suited to the context (according to 3956- a \(numeric) character, then character's string representation is used
3948distinction or depth) is offered. If non-nil, then the 3957- a string, then the user is asked for bullet with the first char as default
3949context-specific bullet is just used. 3958- anything else, the user is solicited with bullet char per context as default
3950 3959
3951Second arg DEPTH forces the topic prefix to that depth, regardless 3960Second arg DEPTH forces the topic prefix to that depth, regardless
3952of the topic's current depth. 3961of the topic's current depth.
@@ -3981,7 +3990,7 @@ this function."
3981 (new-prefix (allout-make-topic-prefix current-bullet 3990 (new-prefix (allout-make-topic-prefix current-bullet
3982 nil 3991 nil
3983 new-depth 3992 new-depth
3984 solicit 3993 instead
3985 number-control 3994 number-control
3986 index))) 3995 index)))
3987 3996
@@ -4028,7 +4037,7 @@ this function."
4028 (cond ((numberp index) (1+ index)) 4037 (cond ((numberp index) (1+ index))
4029 ((not number-control) (allout-sibling-index)))) 4038 ((not number-control) (allout-sibling-index))))
4030 (if (allout-numbered-type-prefix) 4039 (if (allout-numbered-type-prefix)
4031 (allout-rebullet-heading nil ;;; solicit 4040 (allout-rebullet-heading nil ;;; instead
4032 new-depth ;;; new-depth 4041 new-depth ;;; new-depth
4033 number-control;;; number-control 4042 number-control;;; number-control
4034 index ;;; index 4043 index ;;; index
@@ -4145,7 +4154,7 @@ a topic and its immediate offspring is greater than one.)"
4145 (when (< relative-depth 0) 4154 (when (< relative-depth 0)
4146 (save-excursion 4155 (save-excursion
4147 (goto-char local-point) 4156 (goto-char local-point)
4148 (allout-rebullet-heading nil ;;; solicit 4157 (allout-rebullet-heading nil ;;; instead
4149 (+ starting-depth relative-depth) 4158 (+ starting-depth relative-depth)
4150 nil ;;; number 4159 nil ;;; number
4151 starting-index 4160 starting-index
@@ -4203,7 +4212,7 @@ Returns final depth."
4203 ; Prime ascender for ascension: 4212 ; Prime ascender for ascension:
4204 (setq ascender (1- allout-recent-depth)) 4213 (setq ascender (1- allout-recent-depth))
4205 (if (>= allout-recent-depth depth) 4214 (if (>= allout-recent-depth depth)
4206 (allout-rebullet-heading nil ;;; solicit 4215 (allout-rebullet-heading nil ;;; instead
4207 nil ;;; depth 4216 nil ;;; depth
4208 nil ;;; number-control 4217 nil ;;; number-control
4209 nil ;;; index 4218 nil ;;; index
@@ -4230,7 +4239,7 @@ rebulleting each topic at this level."
4230 (use-bullet (equal '(16) denumber)) 4239 (use-bullet (equal '(16) denumber))
4231 (more t)) 4240 (more t))
4232 (while more 4241 (while more
4233 (allout-rebullet-heading use-bullet ;;; solicit 4242 (allout-rebullet-heading use-bullet ;;; instead
4234 depth ;;; depth 4243 depth ;;; depth
4235 t ;;; number-control 4244 t ;;; number-control
4236 index ;;; index 4245 index ;;; index
@@ -4577,32 +4586,20 @@ however, are left exactly like normal, non-allout-specific yanks."
4577 (progn (widen) 4586 (progn (widen)
4578 (forward-char -1) 4587 (forward-char -1)
4579 (narrow-to-region subj-beg (point)))))) 4588 (narrow-to-region subj-beg (point))))))
4580 ;; Preserve new bullet if it's a distinctive one, otherwise 4589 ;; Remove new heading prefix:
4581 ;; use old one: 4590 (allout-unprotected
4582 (if (string-match (regexp-quote prefix-bullet) 4591 (progn
4583 allout-distinctive-bullets-string) 4592 (delete-region (point) (+ (point)
4584 ; Delete from bullet of old to 4593 prefix-len
4585 ; before bullet of new: 4594 (- adjust-to-depth
4586 (progn 4595 subj-depth)))
4587 (beginning-of-line)
4588 (allout-unprotected
4589 (delete-region (point) subj-beg))
4590 (set-marker (allout-mark-marker t) subj-end)
4591 (goto-char subj-beg)
4592 (allout-end-of-prefix))
4593 ; Delete base subj prefix,
4594 ; leaving old one:
4595 (allout-unprotected
4596 (progn
4597 (delete-region (point) (+ (point)
4598 prefix-len
4599 (- adjust-to-depth
4600 subj-depth)))
4601 ; and delete residual subj 4596 ; and delete residual subj
4602 ; prefix digits and space: 4597 ; prefix digits and space:
4603 (while (looking-at "[0-9]") (delete-char 1)) 4598 (while (looking-at "[0-9]") (delete-char 1))
4604 (if (looking-at " ") 4599 (if (looking-at " ")
4605 (delete-char 1)))))) 4600 (delete-char 1))))
4601 ;; Assert new topic's bullet - minimal effort if unchanged:
4602 (allout-rebullet-heading (string-to-char prefix-bullet)))
4606 (exchange-point-and-mark)))) 4603 (exchange-point-and-mark))))
4607 (if rectify-numbering 4604 (if rectify-numbering
4608 (progn 4605 (progn
@@ -4613,7 +4610,7 @@ however, are left exactly like normal, non-allout-specific yanks."
4613 (goto-char subj-beg) 4610 (goto-char subj-beg)
4614 (if (allout-goto-prefix-doublechecked) 4611 (if (allout-goto-prefix-doublechecked)
4615 (allout-unprotected 4612 (allout-unprotected
4616 (allout-rebullet-heading nil ;;; solicit 4613 (allout-rebullet-heading nil ;;; instead
4617 (allout-depth) ;;; depth 4614 (allout-depth) ;;; depth
4618 nil ;;; number-control 4615 nil ;;; number-control
4619 nil ;;; index 4616 nil ;;; index
diff --git a/lisp/avoid.el b/lisp/avoid.el
index fe47a0c4a33..038927105ec 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -76,7 +76,7 @@
76 76
77;;;###autoload 77;;;###autoload
78(defcustom mouse-avoidance-mode nil 78(defcustom mouse-avoidance-mode nil
79 "Activate mouse avoidance mode. 79 "Activate Mouse Avoidance mode.
80See function `mouse-avoidance-mode' for possible values. 80See function `mouse-avoidance-mode' for possible values.
81Setting this variable directly does not take effect; 81Setting this variable directly does not take effect;
82use either \\[customize] or the function `mouse-avoidance-mode'." 82use either \\[customize] or the function `mouse-avoidance-mode'."
@@ -85,8 +85,7 @@ use either \\[customize] or the function `mouse-avoidance-mode'."
85 (mouse-avoidance-mode (or value 'none))) 85 (mouse-avoidance-mode (or value 'none)))
86 :initialize 'custom-initialize-default 86 :initialize 'custom-initialize-default
87 :type '(choice (const :tag "none" nil) (const banish) (const jump) 87 :type '(choice (const :tag "none" nil) (const banish) (const jump)
88 (const animate) (const exile) (const proteus) 88 (const animate) (const exile) (const proteus))
89 )
90 :group 'avoid 89 :group 'avoid
91 :require 'avoid 90 :require 'avoid
92 :version "20.3") 91 :version "20.3")
@@ -94,7 +93,7 @@ use either \\[customize] or the function `mouse-avoidance-mode'."
94 93
95(defcustom mouse-avoidance-nudge-dist 15 94(defcustom mouse-avoidance-nudge-dist 15
96 "Average distance that mouse will be moved when approached by cursor. 95 "Average distance that mouse will be moved when approached by cursor.
97Only applies in Mouse-Avoidance mode `jump' and its derivatives. 96Only applies in Mouse Avoidance mode `jump' and its derivatives.
98For best results make this larger than `mouse-avoidance-threshold'." 97For best results make this larger than `mouse-avoidance-threshold'."
99 :type 'integer 98 :type 'integer
100 :group 'avoid) 99 :group 'avoid)
@@ -112,7 +111,7 @@ For best results make this larger than `mouse-avoidance-threshold'."
112(defcustom mouse-avoidance-threshold 5 111(defcustom mouse-avoidance-threshold 5
113 "Mouse-pointer's flight distance. 112 "Mouse-pointer's flight distance.
114If the cursor gets closer than this, the mouse pointer will move away. 113If the cursor gets closer than this, the mouse pointer will move away.
115Only applies in mouse-avoidance-modes `animate' and `jump'." 114Only applies in Mouse Avoidance modes `animate' and `jump'."
116 :type 'integer 115 :type 'integer
117 :group 'avoid) 116 :group 'avoid)
118 117
@@ -183,7 +182,7 @@ Acceptable distance is defined by `mouse-avoidance-threshold'."
183 mouse-avoidance-threshold)))))) 182 mouse-avoidance-threshold))))))
184 183
185(defun mouse-avoidance-banish-destination () 184(defun mouse-avoidance-banish-destination ()
186 "The position to which Mouse-Avoidance mode `banish' moves the mouse. 185 "The position to which Mouse Avoidance mode `banish' moves the mouse.
187You can redefine this if you want the mouse banished to a different corner." 186You can redefine this if you want the mouse banished to a different corner."
188 (let* ((pos (window-edges))) 187 (let* ((pos (window-edges)))
189 (cons (- (nth 2 pos) 2) 188 (cons (- (nth 2 pos) 2)
@@ -278,6 +277,7 @@ redefine this function to suit your own tastes."
278(defun mouse-avoidance-ignore-p () 277(defun mouse-avoidance-ignore-p ()
279 (let ((mp (mouse-position))) 278 (let ((mp (mouse-position)))
280 (or (not (frame-pointer-visible-p)) ; The pointer is hidden 279 (or (not (frame-pointer-visible-p)) ; The pointer is hidden
280 (not cursor-type) ; There's no cursor
281 executing-kbd-macro ; don't check inside macro 281 executing-kbd-macro ; don't check inside macro
282 (null (cadr mp)) ; don't move unless in an Emacs frame 282 (null (cadr mp)) ; don't move unless in an Emacs frame
283 (not (eq (car mp) (selected-frame))) 283 (not (eq (car mp) (selected-frame)))
@@ -332,7 +332,7 @@ redefine this function to suit your own tastes."
332 332
333;;;###autoload 333;;;###autoload
334(defun mouse-avoidance-mode (&optional mode) 334(defun mouse-avoidance-mode (&optional mode)
335 "Set cursor avoidance mode to MODE. 335 "Set Mouse Avoidance mode to MODE.
336MODE should be one of the symbols `banish', `exile', `jump', `animate', 336MODE should be one of the symbols `banish', `exile', `jump', `animate',
337`cat-and-mouse', `proteus', or `none'. 337`cat-and-mouse', `proteus', or `none'.
338 338
@@ -352,7 +352,7 @@ Effects of the different modes:
352 352
353Whenever the mouse is moved, the frame is also raised. 353Whenever the mouse is moved, the frame is also raised.
354 354
355\(see `mouse-avoidance-threshold' for definition of \"too close\", 355\(See `mouse-avoidance-threshold' for definition of \"too close\",
356and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for 356and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for
357definition of \"random distance\".)" 357definition of \"random distance\".)"
358 (interactive 358 (interactive
diff --git a/lisp/calc/README b/lisp/calc/README
index 533b80baeb0..308b5115aa2 100644
--- a/lisp/calc/README
+++ b/lisp/calc/README
@@ -72,6 +72,8 @@ Summary of changes to "Calc"
72 72
73Emacs 24.1 73Emacs 24.1
74 74
75* Support for musical notes added.
76
75* Support for logarithmic units added. 77* Support for logarithmic units added.
76 78
77* Calc no longer uses the tex prefix for TeX specific unit 79* Calc no longer uses the tex prefix for TeX specific unit
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 11a26d6d125..9ea773fbb98 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -422,13 +422,13 @@
422 (define-key calc-mode-map "kT" 'calc-utpt) 422 (define-key calc-mode-map "kT" 'calc-utpt)
423 423
424 (define-key calc-mode-map "l" nil) 424 (define-key calc-mode-map "l" nil)
425 (define-key calc-mode-map "lq" 'calc-logunits-quantity) 425 (define-key calc-mode-map "lq" 'calc-lu-quant)
426 (define-key calc-mode-map "ld" 'calc-dblevel) 426 (define-key calc-mode-map "ld" 'calc-db)
427 (define-key calc-mode-map "ln" 'calc-nplevel) 427 (define-key calc-mode-map "ln" 'calc-np)
428 (define-key calc-mode-map "l+" 'calc-logunits-add) 428 (define-key calc-mode-map "l+" 'calc-lu-plus)
429 (define-key calc-mode-map "l-" 'calc-logunits-sub) 429 (define-key calc-mode-map "l-" 'calc-lu-minus)
430 (define-key calc-mode-map "l*" 'calc-logunits-mul) 430 (define-key calc-mode-map "l*" 'calc-lu-times)
431 (define-key calc-mode-map "l/" 'calc-logunits-divide) 431 (define-key calc-mode-map "l/" 'calc-lu-divide)
432 (define-key calc-mode-map "ls" 'calc-spn) 432 (define-key calc-mode-map "ls" 'calc-spn)
433 (define-key calc-mode-map "lm" 'calc-midi) 433 (define-key calc-mode-map "lm" 'calc-midi)
434 (define-key calc-mode-map "lf" 'calc-freq) 434 (define-key calc-mode-map "lf" 'calc-freq)
@@ -943,12 +943,11 @@ calc-store-value calc-var-name)
943 ("calc-stuff" calc-explain-why calcFunc-clean 943 ("calc-stuff" calc-explain-why calcFunc-clean
944calcFunc-pclean calcFunc-pfloat calcFunc-pfrac) 944calcFunc-pclean calcFunc-pfloat calcFunc-pfrac)
945 945
946 ("calc-units" calcFunc-usimplify calcFunc-lufieldadd 946 ("calc-units" calcFunc-usimplify calcFunc-lufadd calcFunc-lupadd
947calcFunc-lupoweradd calcFunc-lufieldsub calcFunc-lupowersub 947calcFunc-lufsub calcFunc-lupsub calcFunc-lufmul calcFunc-lupmul
948calcFunc-lufieldmul calcFunc-lupowermul calcFunc-lufielddiv 948calcFunc-lufdiv calcFunc-lupdiv calcFunc-lufquant calcFunc-lupquant
949calcFunc-lupowerdiv calcFunc-fieldquant calcFunc-powerquant 949calcFunc-dbfield calcFunc-dbpower calcFunc-npfield
950calcFunc-dbfieldlevel calcFunc-dbpowerlevel calcFunc-npfieldlevel 950calcFunc-nppower calcFunc-spn calcFunc-midi calcFunc-freq
951calcFunc-nppowerlevel calcFunc-spn calcFunc-midi calcFunc-freq
952math-build-units-table math-build-units-table-buffer 951math-build-units-table math-build-units-table-buffer
953math-check-unit-name math-convert-temperature math-convert-units 952math-check-unit-name math-convert-temperature math-convert-units
954math-extract-units math-remove-units math-simplify-units 953math-extract-units math-remove-units math-simplify-units
@@ -1180,9 +1179,9 @@ calc-convert-temperature calc-convert-units calc-define-unit
1180calc-enter-units-table calc-explain-units calc-extract-units 1179calc-enter-units-table calc-explain-units calc-extract-units
1181calc-get-unit-definition calc-permanent-units calc-quick-units 1180calc-get-unit-definition calc-permanent-units calc-quick-units
1182calc-remove-units calc-simplify-units calc-undefine-unit 1181calc-remove-units calc-simplify-units calc-undefine-unit
1183calc-view-units-table calc-logunits-quantity calc-dblevel 1182calc-view-units-table calc-lu-quant calc-db
1184calc-nplevel calc-logunits-add calc-logunits-sub 1183calc-np calc-lu-plus calc-lu-minus
1185calc-logunits-mul calc-logunits-divide calc-spn calc-midi 1184calc-lu-times calc-lu-divide calc-spn calc-midi
1186calc-freq) 1185calc-freq)
1187 1186
1188 ("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm 1187 ("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm
diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index d688b31b3cb..427cf6ba233 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -673,7 +673,9 @@ C-w Describe how there is no warranty for Calc."
673 (interactive) 673 (interactive)
674 (calc-do-prefix-help 674 (calc-do-prefix-help
675 '("Quantity, DB level, Np level" 675 '("Quantity, DB level, Np level"
676 "+, -, *, /") 676 "+, -, *, /"
677 "Scientific pitch notation, Midi number, Frequency"
678 )
677 "log units" ?l)) 679 "log units" ?l))
678 680
679(defun calc-v-prefix-help () 681(defun calc-v-prefix-help ()
diff --git a/lisp/calc/calc-menu.el b/lisp/calc/calc-menu.el
index aaddf3e486e..d8099b0aadc 100644
--- a/lisp/calc/calc-menu.el
+++ b/lisp/calc/calc-menu.el
@@ -960,6 +960,111 @@
960 (require 'calc-units) 960 (require 'calc-units)
961 (call-interactively 'calc-view-units-table)) 961 (call-interactively 'calc-view-units-table))
962 :keys "u V"] 962 :keys "u V"]
963 (list "Logarithmic Units"
964 ["Convert (1:) to dB (power)"
965 (progn
966 (require 'calc-units)
967 (call-interactively 'calc-db))
968 :keys "l d"
969 :active (>= (calc-stack-size) 1)]
970 ["Convert (2:) to dB (power) with reference level (1:)"
971 (progn
972 (require 'calc-units)
973 (let ((calc-option-flag t))
974 (call-interactively 'calc-db)))
975 :keys "O l d"
976 :active (>= (calc-stack-size) 2)]
977 ["Convert (1:) to Np (power)"
978 (progn
979 (require 'calc-units)
980 (call-interactively 'calc-np))
981 :keys "l n"
982 :active (>= (calc-stack-size) 1)]
983 ["Convert (2:) to Np (power) with reference level (1:)"
984 (progn
985 (require 'calc-units)
986 (let ((calc-option-flag t))
987 (call-interactively 'calc-np)))
988 :keys "O l n"
989 :active (>= (calc-stack-size) 2)]
990 ["Convert (1:) to power quantity"
991 (progn
992 (require 'calc-units)
993 (call-interactively 'calc-lu-quant))
994 :keys "l q"
995 :active (>= (calc-stack-size) 1)]
996 ["Convert (2:) to power quantity with reference level (1:)"
997 (progn
998 (require 'calc-units)
999 (let ((calc-option-flag t))
1000 (call-interactively 'calc-lu-quant)))
1001 :keys "O l q"
1002 :active (>= (calc-stack-size) 2)]
1003 "----"
1004 ["Convert (1:) to dB (field)"
1005 (progn
1006 (require 'calc-units)
1007 (let ((calc-hyperbolic-flag t))
1008 (call-interactively 'calc-db)))
1009 :keys "H l d"
1010 :active (>= (calc-stack-size) 1)]
1011 ["Convert (2:) to dB (field) with reference level (1:)"
1012 (progn
1013 (require 'calc-units)
1014 (let ((calc-option-flag t)
1015 (calc-hyperbolic-flag t))
1016 (call-interactively 'calc-db)))
1017 :keys "O H l d"
1018 :active (>= (calc-stack-size) 2)]
1019 ["Convert (1:) to Np (field)"
1020 (progn
1021 (require 'calc-units)
1022 (let ((calc-hyperbolic-flag t))
1023 (call-interactively 'calc-np)))
1024 :keys "H l n"
1025 :active (>= (calc-stack-size) 1)]
1026 ["Convert (2:) to Np (field) with reference level (1:)"
1027 (progn
1028 (require 'calc-units)
1029 (let ((calc-option-flag t)
1030 (calc-hyperbolic-flag t))
1031 (call-interactively 'calc-np)))
1032 :keys "O H l d"
1033 :active (>= (calc-stack-size) 2)]
1034 ["Convert (1:) to field quantity"
1035 (progn
1036 (require 'calc-units)
1037 (let ((calc-hyperbolic-flag t))
1038 (call-interactively 'calc-lu-quant)))
1039 :keys "H l q"
1040 :active (>= (calc-stack-size) 1)]
1041 ["Convert (2:) to field quantity with reference level (1:)"
1042 (progn
1043 (require 'calc-units)
1044 (let ((calc-option-flag t)
1045 (calc-hyperbolic-flag))
1046 (call-interactively 'calc-lu-quant)))
1047 :keys "O H l q"
1048 :active (>= (calc-stack-size) 2)])
1049 (list "Musical Notes"
1050 ["Convert (1:) to scientific pitch notation"
1051 (progn
1052 (require 'calc-units)
1053 (call-interactively 'calc-spn))
1054 :keys "l s"
1055 :active (>= (calc-stack-size) 1)]
1056 ["Convert (1:) to midi number"
1057 (progn
1058 (require 'calc-units)
1059 (call-interactively 'calc-midi))
1060 :keys "l m"
1061 :active (>= (calc-stack-size) 1)]
1062 ["Convert (1:) to frequency"
1063 (progn
1064 (require 'calc-units)
1065 (call-interactively 'calc-freq))
1066 :keys "l f"
1067 :active (>= (calc-stack-size) 1)])
963 "----" 1068 "----"
964 ["Help on Units" 1069 ["Help on Units"
965 (calc-info-goto-node "Units")]) 1070 (calc-info-goto-node "Units")])
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 7f0adc9fe7e..43cb5828e85 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -1623,39 +1623,39 @@ In symbolic mode, return the list (^ a b)."
1623 coef))) 1623 coef)))
1624 units))))))) 1624 units)))))))
1625 1625
1626(defun calcFunc-lufieldplus (a b) 1626(defun calcFunc-lufadd (a b)
1627 (math-logunits-add a b nil nil)) 1627 (math-logunits-add a b nil nil))
1628 1628
1629(defun calcFunc-lupowerplus (a b) 1629(defun calcFunc-lupadd (a b)
1630 (math-logunits-add a b nil t)) 1630 (math-logunits-add a b nil t))
1631 1631
1632(defun calcFunc-lufieldminus (a b) 1632(defun calcFunc-lufsub (a b)
1633 (math-logunits-add a b t nil)) 1633 (math-logunits-add a b t nil))
1634 1634
1635(defun calcFunc-lupowerminus (a b) 1635(defun calcFunc-lupsub (a b)
1636 (math-logunits-add a b t t)) 1636 (math-logunits-add a b t t))
1637 1637
1638(defun calc-logunits-add (arg) 1638(defun calc-lu-plus (arg)
1639 (interactive "P") 1639 (interactive "P")
1640 (calc-slow-wrapper 1640 (calc-slow-wrapper
1641 (if (calc-is-inverse) 1641 (if (calc-is-inverse)
1642 (if (calc-is-hyperbolic) 1642 (if (calc-is-hyperbolic)
1643 (calc-binary-op "lu-" 'calcFunc-lufieldminus arg) 1643 (calc-binary-op "lu-" 'calcFunc-lufsub arg)
1644 (calc-binary-op "lu-" 'calcFunc-lupowerminus arg)) 1644 (calc-binary-op "lu-" 'calcFunc-lupsub arg))
1645 (if (calc-is-hyperbolic) 1645 (if (calc-is-hyperbolic)
1646 (calc-binary-op "lu+" 'calcFunc-lufieldplus arg) 1646 (calc-binary-op "lu+" 'calcFunc-lufadd arg)
1647 (calc-binary-op "lu+" 'calcFunc-lupowerplus arg))))) 1647 (calc-binary-op "lu+" 'calcFunc-lupadd arg)))))
1648 1648
1649(defun calc-logunits-sub (arg) 1649(defun calc-lu-minus (arg)
1650 (interactive "P") 1650 (interactive "P")
1651 (calc-slow-wrapper 1651 (calc-slow-wrapper
1652 (if (calc-is-inverse) 1652 (if (calc-is-inverse)
1653 (if (calc-is-hyperbolic) 1653 (if (calc-is-hyperbolic)
1654 (calc-binary-op "lu+" 'calcFunc-lufieldplus arg) 1654 (calc-binary-op "lu+" 'calcFunc-lufadd arg)
1655 (calc-binary-op "lu+" 'calcFunc-lupowerplus arg)) 1655 (calc-binary-op "lu+" 'calcFunc-lupadd arg))
1656 (if (calc-is-hyperbolic) 1656 (if (calc-is-hyperbolic)
1657 (calc-binary-op "lu-" 'calcFunc-lufieldminus arg) 1657 (calc-binary-op "lu-" 'calcFunc-lufsub arg)
1658 (calc-binary-op "lu-" 'calcFunc-lupowerminus arg))))) 1658 (calc-binary-op "lu-" 'calcFunc-lupsub arg)))))
1659 1659
1660(defun math-logunits-mul (a b power) 1660(defun math-logunits-mul (a b power)
1661 (let (logunit coef units number) 1661 (let (logunit coef units number)
@@ -1719,39 +1719,39 @@ In symbolic mode, return the list (^ a b)."
1719 (math-div (math-conditional-apply 'calcFunc-ln b) (if power 2 1))) 1719 (math-div (math-conditional-apply 'calcFunc-ln b) (if power 2 1)))
1720 units))))))))) 1720 units)))))))))
1721 1721
1722(defun calcFunc-lufieldtimes (a b) 1722(defun calcFunc-lufmul (a b)
1723 (math-logunits-mul a b nil)) 1723 (math-logunits-mul a b nil))
1724 1724
1725(defun calcFunc-lupowertimes (a b) 1725(defun calcFunc-lupmul (a b)
1726 (math-logunits-mul a b t)) 1726 (math-logunits-mul a b t))
1727 1727
1728(defun calc-logunits-mul (arg) 1728(defun calc-lu-times (arg)
1729 (interactive "P") 1729 (interactive "P")
1730 (calc-slow-wrapper 1730 (calc-slow-wrapper
1731 (if (calc-is-inverse) 1731 (if (calc-is-inverse)
1732 (if (calc-is-hyperbolic) 1732 (if (calc-is-hyperbolic)
1733 (calc-binary-op "lu/" 'calcFunc-lufielddiv arg) 1733 (calc-binary-op "lu/" 'calcFunc-lufdiv arg)
1734 (calc-binary-op "lu/" 'calcFunc-lupowerdiv arg)) 1734 (calc-binary-op "lu/" 'calcFunc-lupdiv arg))
1735 (if (calc-is-hyperbolic) 1735 (if (calc-is-hyperbolic)
1736 (calc-binary-op "lu*" 'calcFunc-lufieldtimes arg) 1736 (calc-binary-op "lu*" 'calcFunc-lufmul arg)
1737 (calc-binary-op "lu*" 'calcFunc-lupowertimes arg))))) 1737 (calc-binary-op "lu*" 'calcFunc-lupmul arg)))))
1738 1738
1739(defun calcFunc-lufielddiv (a b) 1739(defun calcFunc-lufdiv (a b)
1740 (math-logunits-divide a b nil)) 1740 (math-logunits-divide a b nil))
1741 1741
1742(defun calcFunc-lupowerdiv (a b) 1742(defun calcFunc-lupdiv (a b)
1743 (math-logunits-divide a b t)) 1743 (math-logunits-divide a b t))
1744 1744
1745(defun calc-logunits-divide (arg) 1745(defun calc-lu-divide (arg)
1746 (interactive "P") 1746 (interactive "P")
1747 (calc-slow-wrapper 1747 (calc-slow-wrapper
1748 (if (calc-is-inverse) 1748 (if (calc-is-inverse)
1749 (if (calc-is-hyperbolic) 1749 (if (calc-is-hyperbolic)
1750 (calc-binary-op "lu*" 'calcFunc-lufieldtimes arg) 1750 (calc-binary-op "lu*" 'calcFunc-lufmul arg)
1751 (calc-binary-op "lu*" 'calcFunc-lupowertimes arg)) 1751 (calc-binary-op "lu*" 'calcFunc-lupmul arg))
1752 (if (calc-is-hyperbolic) 1752 (if (calc-is-hyperbolic)
1753 (calc-binary-op "lu/" 'calcFunc-lufielddiv arg) 1753 (calc-binary-op "lu/" 'calcFunc-lufdiv arg)
1754 (calc-binary-op "lu/" 'calcFunc-lupowerdiv arg))))) 1754 (calc-binary-op "lu/" 'calcFunc-lupdiv arg)))))
1755 1755
1756(defun math-logunits-quant (val ref power) 1756(defun math-logunits-quant (val ref power)
1757 (let* ((units (math-simplify (math-extract-units val))) 1757 (let* ((units (math-simplify (math-extract-units val)))
@@ -1777,29 +1777,29 @@ In symbolic mode, return the list (^ a b)."
1777 coeff)))) 1777 coeff))))
1778 runits))))) 1778 runits)))))
1779 1779
1780(defvar calc-logunits-field-reference) 1780(defvar calc-lu-field-reference)
1781(defvar calc-logunits-power-reference) 1781(defvar calc-lu-power-reference)
1782 1782
1783(defun calcFunc-fieldquant (val &optional ref) 1783(defun calcFunc-lufquant (val &optional ref)
1784 (unless ref 1784 (unless ref
1785 (setq ref (math-read-expr calc-logunits-field-reference))) 1785 (setq ref (math-read-expr calc-lu-field-reference)))
1786 (math-logunits-quant val ref nil)) 1786 (math-logunits-quant val ref nil))
1787 1787
1788(defun calcFunc-powerquant (val &optional ref) 1788(defun calcFunc-lupquant (val &optional ref)
1789 (unless ref 1789 (unless ref
1790 (setq ref (math-read-expr calc-logunits-power-reference))) 1790 (setq ref (math-read-expr calc-lu-power-reference)))
1791 (math-logunits-quant val ref t)) 1791 (math-logunits-quant val ref t))
1792 1792
1793(defun calc-logunits-quantity (arg) 1793(defun calc-lu-quant (arg)
1794 (interactive "P") 1794 (interactive "P")
1795 (calc-slow-wrapper 1795 (calc-slow-wrapper
1796 (if (calc-is-hyperbolic) 1796 (if (calc-is-hyperbolic)
1797 (if (calc-is-option) 1797 (if (calc-is-option)
1798 (calc-binary-op "lupq" 'calcFunc-fieldquant arg) 1798 (calc-binary-op "lupq" 'calcFunc-lufquant arg)
1799 (calc-unary-op "lupq" 'calcFunc-fieldquant arg)) 1799 (calc-unary-op "lupq" 'calcFunc-lufquant arg))
1800 (if (calc-is-option) 1800 (if (calc-is-option)
1801 (calc-binary-op "lufq" 'calcFunc-powerquant arg) 1801 (calc-binary-op "lufq" 'calcFunc-lupquant arg)
1802 (calc-unary-op "lufq" 'calcFunc-powerquant arg))))) 1802 (calc-unary-op "lufq" 'calcFunc-lupquant arg)))))
1803 1803
1804(defun math-logunits-level (val ref db power) 1804(defun math-logunits-level (val ref db power)
1805 "Compute the value of VAL in decibels or nepers." 1805 "Compute the value of VAL in decibels or nepers."
@@ -1817,47 +1817,47 @@ In symbolic mode, return the list (^ a b)."
1817 '(var Np var-Np))) 1817 '(var Np var-Np)))
1818 units))) 1818 units)))
1819 1819
1820(defun calcFunc-dbfieldlevel (val &optional ref) 1820(defun calcFunc-dbfield (val &optional ref)
1821 (unless ref 1821 (unless ref
1822 (setq ref (math-read-expr calc-logunits-field-reference))) 1822 (setq ref (math-read-expr calc-lu-field-reference)))
1823 (math-logunits-level val ref t nil)) 1823 (math-logunits-level val ref t nil))
1824 1824
1825(defun calcFunc-dbpowerlevel (val &optional ref) 1825(defun calcFunc-dbpower (val &optional ref)
1826 (unless ref 1826 (unless ref
1827 (setq ref (math-read-expr calc-logunits-power-reference))) 1827 (setq ref (math-read-expr calc-lu-power-reference)))
1828 (math-logunits-level val ref t t)) 1828 (math-logunits-level val ref t t))
1829 1829
1830(defun calcFunc-npfieldlevel (val &optional ref) 1830(defun calcFunc-npfield (val &optional ref)
1831 (unless ref 1831 (unless ref
1832 (setq ref (math-read-expr calc-logunits-field-reference))) 1832 (setq ref (math-read-expr calc-lu-field-reference)))
1833 (math-logunits-level val ref nil nil)) 1833 (math-logunits-level val ref nil nil))
1834 1834
1835(defun calcFunc-nppowerlevel (val &optional ref) 1835(defun calcFunc-nppower (val &optional ref)
1836 (unless ref 1836 (unless ref
1837 (setq ref (math-read-expr calc-logunits-power-reference))) 1837 (setq ref (math-read-expr calc-lu-power-reference)))
1838 (math-logunits-level val ref nil t)) 1838 (math-logunits-level val ref nil t))
1839 1839
1840(defun calc-dblevel (arg) 1840(defun calc-db (arg)
1841 (interactive "P") 1841 (interactive "P")
1842 (calc-slow-wrapper 1842 (calc-slow-wrapper
1843 (if (calc-is-hyperbolic) 1843 (if (calc-is-hyperbolic)
1844 (if (calc-is-option) 1844 (if (calc-is-option)
1845 (calc-binary-op "ludb" 'calcFunc-dbfieldlevel arg) 1845 (calc-binary-op "ludb" 'calcFunc-dbfield arg)
1846 (calc-unary-op "ludb" 'calcFunc-dbfieldlevel arg)) 1846 (calc-unary-op "ludb" 'calcFunc-dbfield arg))
1847 (if (calc-is-option) 1847 (if (calc-is-option)
1848 (calc-binary-op "ludb" 'calcFunc-dbpowerlevel arg) 1848 (calc-binary-op "ludb" 'calcFunc-dbpower arg)
1849 (calc-unary-op "ludb" 'calcFunc-dbpowerlevel arg))))) 1849 (calc-unary-op "ludb" 'calcFunc-dbpower arg)))))
1850 1850
1851(defun calc-nplevel (arg) 1851(defun calc-np (arg)
1852 (interactive "P") 1852 (interactive "P")
1853 (calc-slow-wrapper 1853 (calc-slow-wrapper
1854 (if (calc-is-hyperbolic) 1854 (if (calc-is-hyperbolic)
1855 (if (calc-is-option) 1855 (if (calc-is-option)
1856 (calc-binary-op "lunp" 'calcFunc-npfieldlevel arg) 1856 (calc-binary-op "lunp" 'calcFunc-npfield arg)
1857 (calc-unary-op "lunp" 'calcFunc-npfieldlevel arg)) 1857 (calc-unary-op "lunp" 'calcFunc-npfield arg))
1858 (if (calc-is-option) 1858 (if (calc-is-option)
1859 (calc-binary-op "lunp" 'calcFunc-nppowerlevel arg) 1859 (calc-binary-op "lunp" 'calcFunc-nppower arg)
1860 (calc-unary-op "lunp" 'calcFunc-nppowerlevel arg))))) 1860 (calc-unary-op "lunp" 'calcFunc-nppower arg)))))
1861 1861
1862;;; Musical notes 1862;;; Musical notes
1863 1863
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index f4d8983eb88..41f549cbe2c 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -434,13 +434,13 @@ by displaying the sub-formula in `calc-selected-face'."
434 :group 'calc 434 :group 'calc
435 :type 'boolean) 435 :type 'boolean)
436 436
437(defcustom calc-logunits-field-reference 437(defcustom calc-lu-field-reference
438 "20 uPa" 438 "20 uPa"
439 "The default reference level for logarithmic units (field)." 439 "The default reference level for logarithmic units (field)."
440 :group 'calc 440 :group 'calc
441 :type '(string)) 441 :type '(string))
442 442
443(defcustom calc-logunits-power-reference 443(defcustom calc-lu-power-reference
444 "mW" 444 "mW"
445 "The default reference level for logarithmic units (power)." 445 "The default reference level for logarithmic units (power)."
446 :group 'calc 446 :group 'calc
@@ -1084,7 +1084,7 @@ Used by `calc-user-invocation'.")
1084 "lOW") 1084 "lOW")
1085 (mapc (lambda (x) (define-key map (char-to-string x) 'calc-missing-key)) 1085 (mapc (lambda (x) (define-key map (char-to-string x) 'calc-missing-key))
1086 (concat "ABCDEFGHIJKLMNOPQRSTUVXZabcdfghjkmoprstuvwxyz" 1086 (concat "ABCDEFGHIJKLMNOPQRSTUVXZabcdfghjkmoprstuvwxyz"
1087 ":\\|!()[]<>{},;=~`\C-k\C-w\C-_")) 1087 ":\\|!()[]<>{},;=~`\C-k\C-w"))
1088 (define-key map "\M-w" 'calc-missing-key) 1088 (define-key map "\M-w" 'calc-missing-key)
1089 (define-key map "\M-k" 'calc-missing-key) 1089 (define-key map "\M-k" 'calc-missing-key)
1090 (define-key map "\M-\C-w" 'calc-missing-key) 1090 (define-key map "\M-\C-w" 'calc-missing-key)
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index 63e7484e127..e5373a28756 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -879,21 +879,27 @@ use when highlighting the day in the calendar."
879(declare-function diary-ordinal-suffix "diary-lib" (n)) 879(declare-function diary-ordinal-suffix "diary-lib" (n))
880 880
881;;;###diary-autoload 881;;;###diary-autoload
882(defun diary-hebrew-yahrzeit (death-month death-day death-year &optional mark) 882(defun diary-hebrew-yahrzeit (death-month death-day death-year
883 &optional mark after-sunset)
883 "Yahrzeit diary entry--entry applies if date is Yahrzeit or the day before. 884 "Yahrzeit diary entry--entry applies if date is Yahrzeit or the day before.
884Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary 885Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary
885entry is assumed to be the name of the person. Although the date 886entry is assumed to be the name of the person. Although the date
886of death is specified by the civil calendar, the proper Hebrew 887of death is specified by the civil calendar, the proper Hebrew
887calendar Yahrzeit is determined. 888calendar Yahrzeit is determined.
888 889
890If the death occurred after local sunset on the given civil date,
891the following civil date corresponds to the Hebrew date of
892death--set the optional parameter AFTER-SUNSET non-nil in this case.
893
889The order of the input parameters changes according to `calendar-date-style' 894The order of the input parameters changes according to `calendar-date-style'
890\(e.g. to DEATH-DAY, DEATH-MONTH, DEATH-YEAR in the European style). 895\(e.g. to DEATH-DAY, DEATH-MONTH, DEATH-YEAR in the European style).
891 896
892An optional parameter MARK specifies a face or single-character string to 897An optional parameter MARK specifies a face or single-character string to
893use when highlighting the day in the calendar." 898use when highlighting the day in the calendar."
894 (let* ((h-date (calendar-hebrew-from-absolute 899 (let* ((h-date (calendar-hebrew-from-absolute
895 (calendar-absolute-from-gregorian 900 (+ (calendar-absolute-from-gregorian
896 (diary-make-date death-month death-day death-year)))) 901 (diary-make-date death-month death-day death-year))
902 (if after-sunset 1 0))))
897 (h-month (calendar-extract-month h-date)) 903 (h-month (calendar-extract-month h-date))
898 (h-day (calendar-extract-day h-date)) 904 (h-day (calendar-extract-day h-date))
899 (h-year (calendar-extract-year h-date)) 905 (h-year (calendar-extract-year h-date))
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index a1bfad3a5f5..62203600612 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -308,13 +308,9 @@ This function does not work for SECONDS greater than `most-positive-fixnum'."
308 (setq start (match-end 0) 308 (setq start (match-end 0)
309 spec (match-string 1 string)) 309 spec (match-string 1 string))
310 (unless (string-equal spec "%") 310 (unless (string-equal spec "%")
311 ;; `assoc-string' is not available in XEmacs. So when compiling 311 (or (setq match (assoc (downcase spec) units))
312 ;; Gnus (`time-date.el' is part of Gnus) with XEmacs, we get
313 ;; a warning here. But `format-seconds' is not used anywhere in
314 ;; Gnus so it's not a real problem. --rsteib
315 (or (setq match (assoc-string spec units t))
316 (error "Bad format specifier: `%s'" spec)) 312 (error "Bad format specifier: `%s'" spec))
317 (if (assoc-string spec usedunits t) 313 (if (assoc (downcase spec) usedunits)
318 (error "Multiple instances of specifier: `%s'" spec)) 314 (error "Multiple instances of specifier: `%s'" spec))
319 (if (string-equal (car match) "z") 315 (if (string-equal (car match) "z")
320 (setq zeroflag t) 316 (setq zeroflag t)
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 88821652784..203043ebd97 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4756,6 +4756,12 @@ The format is suitable for use with `easy-menu-define'."
4756 "Invoke button at POS, or refuse to allow editing of Custom buffer." 4756 "Invoke button at POS, or refuse to allow editing of Custom buffer."
4757 (interactive "@d") 4757 (interactive "@d")
4758 (let ((button (get-char-property pos 'button))) 4758 (let ((button (get-char-property pos 'button)))
4759 ;; If there is no button at point, then use the one at the start
4760 ;; of the line, if it is a custom-group-link (bug#2298).
4761 (or button
4762 (if (setq button (get-char-property (line-beginning-position) 'button))
4763 (or (eq (widget-type button) 'custom-group-link)
4764 (setq button nil))))
4759 (if button 4765 (if button
4760 (widget-apply-action button event) 4766 (widget-apply-action button event)
4761 (error "You can't edit this part of the Custom buffer")))) 4767 (error "You can't edit this part of the Custom buffer"))))
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index d2d99ee64fb..788731e4dbc 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -111,9 +111,9 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
111 (cursor-in-non-selected-windows 111 (cursor-in-non-selected-windows
112 cursor boolean nil 112 cursor boolean nil
113 :tag "Cursor In Non-selected Windows" 113 :tag "Cursor In Non-selected Windows"
114 :set #'(lambda (symbol value) 114 :set (lambda (symbol value)
115 (set-default symbol value) 115 (set-default symbol value)
116 (force-mode-line-update t))) 116 (force-mode-line-update t)))
117 (transient-mark-mode editing-basics boolean nil 117 (transient-mark-mode editing-basics boolean nil
118 :standard (not noninteractive) 118 :standard (not noninteractive)
119 :initialize custom-initialize-delay 119 :initialize custom-initialize-delay
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index cdc066aa91a..4f9428d497b 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -100,6 +100,9 @@ named *Custom Theme*."
100 (make-local-variable 'custom-theme-insert-face-marker) 100 (make-local-variable 'custom-theme-insert-face-marker)
101 (make-local-variable 'custom-theme-insert-variable-marker) 101 (make-local-variable 'custom-theme-insert-variable-marker)
102 (make-local-variable 'custom-theme--listed-faces) 102 (make-local-variable 'custom-theme--listed-faces)
103 (when (called-interactively-p 'interactive)
104 (unless (y-or-n-p "Include basic face customizations in this theme? ")
105 (setq custom-theme--listed-faces nil)))
103 106
104 (if (eq theme 'user) 107 (if (eq theme 'user)
105 (widget-insert "This buffer contains all the Custom settings you have made. 108 (widget-insert "This buffer contains all the Custom settings you have made.
@@ -188,7 +191,7 @@ remove them from your saved Custom file.\n\n"))
188 (while vars 191 (while vars
189 (if (eq (car vars) 'custom-enabled-themes) 192 (if (eq (car vars) 'custom-enabled-themes)
190 (progn (pop vars) (pop values)) 193 (progn (pop vars) (pop values))
191 (custom-theme-add-var-1 (pop vars) (pop values))))) 194 (custom-theme-add-var-1 (pop vars) (eval (pop values))))))
192 (setq custom-theme-insert-variable-marker (point-marker)) 195 (setq custom-theme-insert-variable-marker (point-marker))
193 (widget-insert " ") 196 (widget-insert " ")
194 (widget-create 'push-button 197 (widget-create 'push-button
@@ -297,8 +300,9 @@ SPEC, if non-nil, should be a face spec to which to set the widget."
297 300
298;;; Reading and writing 301;;; Reading and writing
299 302
303;;;###autoload
300(defun custom-theme-visit-theme (theme) 304(defun custom-theme-visit-theme (theme)
301 "Load the custom theme THEME's settings into the current buffer." 305 "Set up a Custom buffer to edit custom theme THEME."
302 (interactive 306 (interactive
303 (list 307 (list
304 (intern (completing-read "Find custom theme: " 308 (intern (completing-read "Find custom theme: "
@@ -663,4 +667,6 @@ Theme files are named *-theme.el in `"))
663 (widget-toggle-action widget event) 667 (widget-toggle-action widget event)
664 (setq custom-theme-allow-multiple-selections (widget-value widget))) 668 (setq custom-theme-allow-multiple-selections (widget-value widget)))
665 669
670(provide 'cus-theme)
671
666;;; cus-theme.el ends here 672;;; cus-theme.el ends here
diff --git a/lisp/custom.el b/lisp/custom.el
index d0d11610b91..d9bb4f954bc 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -792,10 +792,10 @@ E.g. dumped variables whose default depends on run-time information."
792(defvar custom-known-themes '(user changed) 792(defvar custom-known-themes '(user changed)
793 "Themes that have been defined with `deftheme'. 793 "Themes that have been defined with `deftheme'.
794The default value is the list (user changed). The theme `changed' 794The default value is the list (user changed). The theme `changed'
795contains the settings before custom themes are applied. The 795contains the settings before custom themes are applied. The theme
796theme `user' contains all the settings the user customized and saved. 796`user' contains all the settings the user customized and saved.
797Additional themes declared with the `deftheme' macro will be added to 797Additional themes declared with the `deftheme' macro will be added
798the front of this list.") 798to the front of this list.")
799 799
800(defsubst custom-theme-p (theme) 800(defsubst custom-theme-p (theme)
801 "Non-nil when THEME has been defined." 801 "Non-nil when THEME has been defined."
@@ -1074,7 +1074,7 @@ order. Each element in the list should be one of the following:
1074 named \"themes\" in `data-directory'). 1074 named \"themes\" in `data-directory').
1075- a directory name (a string). 1075- a directory name (a string).
1076 1076
1077Each theme file is named NAME-theme.el, where THEME is the theme 1077Each theme file is named THEME-theme.el, where THEME is the theme
1078name." 1078name."
1079 :type '(repeat (choice (const :tag "custom-theme-directory" 1079 :type '(repeat (choice (const :tag "custom-theme-directory"
1080 custom-theme-directory) 1080 custom-theme-directory)
@@ -1146,7 +1146,7 @@ Return t if THEME was successfully loaded, nil otherwise."
1146 '("" "c"))) 1146 '("" "c")))
1147 hash) 1147 hash)
1148 (unless fn 1148 (unless fn
1149 (error "Unable to find theme file for `%s'." theme)) 1149 (error "Unable to find theme file for `%s'" theme))
1150 (with-temp-buffer 1150 (with-temp-buffer
1151 (insert-file-contents fn) 1151 (insert-file-contents fn)
1152 (setq hash (sha1 (current-buffer))) 1152 (setq hash (sha1 (current-buffer)))
@@ -1212,7 +1212,7 @@ NAME should be a symbol."
1212 1212
1213(defun custom-available-themes () 1213(defun custom-available-themes ()
1214 "Return a list of available Custom themes (symbols)." 1214 "Return a list of available Custom themes (symbols)."
1215 (let* (sym themes) 1215 (let (sym themes)
1216 (dolist (dir (custom-theme--load-path)) 1216 (dolist (dir (custom-theme--load-path))
1217 (when (file-directory-p dir) 1217 (when (file-directory-p dir)
1218 (dolist (file (file-expand-wildcards 1218 (dolist (file (file-expand-wildcards
@@ -1222,7 +1222,7 @@ NAME should be a symbol."
1222 (setq sym (intern (match-string 1 file))) 1222 (setq sym (intern (match-string 1 file)))
1223 (custom-theme-name-valid-p sym) 1223 (custom-theme-name-valid-p sym)
1224 (push sym themes))))) 1224 (push sym themes)))))
1225 (delete-dups themes))) 1225 (nreverse (delete-dups themes))))
1226 1226
1227(defun custom-theme--load-path () 1227(defun custom-theme--load-path ()
1228 (let (lpath) 1228 (let (lpath)
@@ -1338,7 +1338,7 @@ That is to say, it specifies what the value should be according to
1338currently enabled custom themes. 1338currently enabled custom themes.
1339 1339
1340This function returns nil if no custom theme specifies a value for VARIABLE." 1340This function returns nil if no custom theme specifies a value for VARIABLE."
1341 (let* ((theme-value (get variable 'theme-value))) 1341 (let ((theme-value (get variable 'theme-value)))
1342 (if theme-value 1342 (if theme-value
1343 (cdr (car theme-value))))) 1343 (cdr (car theme-value)))))
1344 1344
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index c533c81be0e..9ab1fcb0e2b 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1638,11 +1638,14 @@ Optional arg HOW-TO determiness how to treat the target.
1638 1638
1639;;;###autoload 1639;;;###autoload
1640(defun dired-create-directory (directory) 1640(defun dired-create-directory (directory)
1641 "Create a directory called DIRECTORY." 1641 "Create a directory called DIRECTORY.
1642If DIRECTORY already exists, signal an error."
1642 (interactive 1643 (interactive
1643 (list (read-file-name "Create directory: " (dired-current-directory)))) 1644 (list (read-file-name "Create directory: " (dired-current-directory))))
1644 (let* ((expanded (directory-file-name (expand-file-name directory))) 1645 (let* ((expanded (directory-file-name (expand-file-name directory)))
1645 (try expanded) new) 1646 (try expanded) new)
1647 (if (file-exists-p expanded)
1648 (error "Cannot create directory %s: file exists" expanded))
1646 ;; Find the topmost nonexistent parent dir (variable `new') 1649 ;; Find the topmost nonexistent parent dir (variable `new')
1647 (while (and try (not (file-exists-p try)) (not (equal new try))) 1650 (while (and try (not (file-exists-p try)) (not (equal new try)))
1648 (setq new try 1651 (setq new try
diff --git a/lisp/dired.el b/lisp/dired.el
index c8343ba7561..d72e0aad55f 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3629,7 +3629,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
3629;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command 3629;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
3630;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown 3630;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown
3631;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff 3631;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
3632;;;;;; dired-diff) "dired-aux" "dired-aux.el" "154cdfbf451aedec60c5012b625ff329") 3632;;;;;; dired-diff) "dired-aux" "dired-aux.el" "2d805d6766bd7970cd446413b4ed4ce0")
3633;;; Generated autoloads from dired-aux.el 3633;;; Generated autoloads from dired-aux.el
3634 3634
3635(autoload 'dired-diff "dired-aux" "\ 3635(autoload 'dired-diff "dired-aux" "\
@@ -3860,6 +3860,7 @@ Not documented
3860 3860
3861(autoload 'dired-create-directory "dired-aux" "\ 3861(autoload 'dired-create-directory "dired-aux" "\
3862Create a directory called DIRECTORY. 3862Create a directory called DIRECTORY.
3863If DIRECTORY already exists, signal an error.
3863 3864
3864\(fn DIRECTORY)" t nil) 3865\(fn DIRECTORY)" t nil)
3865 3866
diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el
index dd589cb58f7..a906cf8516a 100644
--- a/lisp/ebuff-menu.el
+++ b/lisp/ebuff-menu.el
@@ -34,7 +34,56 @@
34;; this depends on the format of list-buffers (from src/buffer.c) and 34;; this depends on the format of list-buffers (from src/buffer.c) and
35;; on stuff in lisp/buff-menu.el 35;; on stuff in lisp/buff-menu.el
36 36
37(defvar electric-buffer-menu-mode-map nil) 37(defvar electric-buffer-menu-mode-map
38 (let ((map (make-keymap)))
39 (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined)
40 (define-key map "\e" nil)
41 (define-key map "\C-z" 'suspend-frame)
42 (define-key map "v" 'Electric-buffer-menu-mode-view-buffer)
43 (define-key map (char-to-string help-char) 'Helper-help)
44 (define-key map "?" 'Helper-describe-bindings)
45 (define-key map "\C-c" nil)
46 (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit)
47 (define-key map "\C-]" 'Electric-buffer-menu-quit)
48 (define-key map "q" 'Electric-buffer-menu-quit)
49 (define-key map " " 'Electric-buffer-menu-select)
50 (define-key map "\C-m" 'Electric-buffer-menu-select)
51 (define-key map "\C-l" 'recenter)
52 (define-key map "s" 'Buffer-menu-save)
53 (define-key map "d" 'Buffer-menu-delete)
54 (define-key map "k" 'Buffer-menu-delete)
55 (define-key map "\C-d" 'Buffer-menu-delete-backwards)
56 ;; (define-key map "\C-k" 'Buffer-menu-delete)
57 (define-key map "\177" 'Buffer-menu-backup-unmark)
58 (define-key map "~" 'Buffer-menu-not-modified)
59 (define-key map "u" 'Buffer-menu-unmark)
60 (let ((i ?0))
61 (while (<= i ?9)
62 (define-key map (char-to-string i) 'digit-argument)
63 (define-key map (concat "\e" (char-to-string i)) 'digit-argument)
64 (setq i (1+ i))))
65 (define-key map "-" 'negative-argument)
66 (define-key map "\e-" 'negative-argument)
67 (define-key map "m" 'Buffer-menu-mark)
68 (define-key map "\C-u" 'universal-argument)
69 (define-key map "\C-p" 'previous-line)
70 (define-key map "\C-n" 'next-line)
71 (define-key map "p" 'previous-line)
72 (define-key map "n" 'next-line)
73 (define-key map "\C-v" 'scroll-up)
74 (define-key map "\ev" 'scroll-down)
75 (define-key map ">" 'scroll-right)
76 (define-key map "<" 'scroll-left)
77 (define-key map "\e\C-v" 'scroll-other-window)
78 (define-key map "\e>" 'end-of-buffer)
79 (define-key map "\e<" 'beginning-of-buffer)
80 (define-key map "\e\e" nil)
81 (define-key map "\e\e\e" 'Electric-buffer-menu-quit)
82 ;; This binding prevents the "escape => ESC" function-key-map mapping from
83 ;; kicking in!
84 ;; (define-key map [escape escape escape] 'Electric-buffer-menu-quit)
85 (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select)
86 map))
38 87
39(defvar electric-buffer-menu-mode-hook nil 88(defvar electric-buffer-menu-mode-hook nil
40 "Normal hook run by `electric-buffer-list'.") 89 "Normal hook run by `electric-buffer-list'.")
@@ -167,55 +216,7 @@ Entry to this mode via command `electric-buffer-list' calls the value of
167;; generally the same as Buffer-menu-mode-map 216;; generally the same as Buffer-menu-mode-map
168;; (except we don't indirect to global-map) 217;; (except we don't indirect to global-map)
169(put 'Electric-buffer-menu-undefined 'suppress-keymap t) 218(put 'Electric-buffer-menu-undefined 'suppress-keymap t)
170(if electric-buffer-menu-mode-map 219
171 nil
172 (let ((map (make-keymap)))
173 (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined)
174 (define-key map "\e" nil)
175 (define-key map "\C-z" 'suspend-frame)
176 (define-key map "v" 'Electric-buffer-menu-mode-view-buffer)
177 (define-key map (char-to-string help-char) 'Helper-help)
178 (define-key map "?" 'Helper-describe-bindings)
179 (define-key map "\C-c" nil)
180 (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit)
181 (define-key map "\C-]" 'Electric-buffer-menu-quit)
182 (define-key map "q" 'Electric-buffer-menu-quit)
183 (define-key map " " 'Electric-buffer-menu-select)
184 (define-key map "\C-m" 'Electric-buffer-menu-select)
185 (define-key map "\C-l" 'recenter)
186 (define-key map "s" 'Buffer-menu-save)
187 (define-key map "d" 'Buffer-menu-delete)
188 (define-key map "k" 'Buffer-menu-delete)
189 (define-key map "\C-d" 'Buffer-menu-delete-backwards)
190 ;(define-key map "\C-k" 'Buffer-menu-delete)
191 (define-key map "\177" 'Buffer-menu-backup-unmark)
192 (define-key map "~" 'Buffer-menu-not-modified)
193 (define-key map "u" 'Buffer-menu-unmark)
194 (let ((i ?0))
195 (while (<= i ?9)
196 (define-key map (char-to-string i) 'digit-argument)
197 (define-key map (concat "\e" (char-to-string i)) 'digit-argument)
198 (setq i (1+ i))))
199 (define-key map "-" 'negative-argument)
200 (define-key map "\e-" 'negative-argument)
201 (define-key map "m" 'Buffer-menu-mark)
202 (define-key map "\C-u" 'universal-argument)
203 (define-key map "\C-p" 'previous-line)
204 (define-key map "\C-n" 'next-line)
205 (define-key map "p" 'previous-line)
206 (define-key map "n" 'next-line)
207 (define-key map "\C-v" 'scroll-up)
208 (define-key map "\ev" 'scroll-down)
209 (define-key map ">" 'scroll-right)
210 (define-key map "<" 'scroll-left)
211 (define-key map "\e\C-v" 'scroll-other-window)
212 (define-key map "\e>" 'end-of-buffer)
213 (define-key map "\e<" 'beginning-of-buffer)
214 (define-key map "\e\e" nil)
215 (define-key map "\e\e\e" 'Electric-buffer-menu-quit)
216 (define-key map [escape escape escape] 'Electric-buffer-menu-quit)
217 (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select)
218 (setq electric-buffer-menu-mode-map map)))
219 220
220(defun Electric-buffer-menu-exit () 221(defun Electric-buffer-menu-exit ()
221 (interactive) 222 (interactive)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index c9a85edfca4..5a87f590020 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -4071,7 +4071,8 @@ binding slots have been popped."
4071(defun byte-compile-save-excursion (form) 4071(defun byte-compile-save-excursion (form)
4072 (if (and (eq 'set-buffer (car-safe (car-safe (cdr form)))) 4072 (if (and (eq 'set-buffer (car-safe (car-safe (cdr form))))
4073 (byte-compile-warning-enabled-p 'suspicious)) 4073 (byte-compile-warning-enabled-p 'suspicious))
4074 (byte-compile-warn "`save-excursion' defeated by `set-buffer'")) 4074 (byte-compile-warn
4075 "Use `with-current-buffer' rather than save-excursion+set-buffer"))
4075 (byte-compile-out 'byte-save-excursion 0) 4076 (byte-compile-out 'byte-save-excursion 0)
4076 (byte-compile-body-do-effect (cdr form)) 4077 (byte-compile-body-do-effect (cdr form))
4077 (byte-compile-out 'byte-unbind 1)) 4078 (byte-compile-out 'byte-unbind 1))
@@ -4120,6 +4121,17 @@ binding slots have been popped."
4120 ,@decls 4121 ,@decls
4121 ',(nth 1 form))))) 4122 ',(nth 1 form)))))
4122 4123
4124;; If foo.el declares `toto' as obsolete, it is likely that foo.el will
4125;; actually use `toto' in order for this obsolete variable to still work
4126;; correctly, so paradoxically, while byte-compiling foo.el, the presence
4127;; of a make-obsolete-variable call for `toto' is an indication that `toto'
4128;; should not trigger obsolete-warnings in foo.el.
4129(byte-defop-compiler-1 make-obsolete-variable)
4130(defun byte-compile-make-obsolete-variable (form)
4131 (when (eq 'quote (car-safe (nth 1 form)))
4132 (push (nth 1 (nth 1 form)) byte-compile-not-obsolete-vars))
4133 (byte-compile-normal-call form))
4134
4123(defun byte-compile-defvar (form) 4135(defun byte-compile-defvar (form)
4124 ;; This is not used for file-level defvar/consts with doc strings. 4136 ;; This is not used for file-level defvar/consts with doc strings.
4125 (when (and (symbolp (nth 1 form)) 4137 (when (and (symbolp (nth 1 form))
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index 3a6878ed16b..8bcbd67f46b 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -282,7 +282,7 @@ Not documented
282;;;;;; flet progv psetq do-all-symbols do-symbols dotimes dolist 282;;;;;; flet progv psetq do-all-symbols do-symbols dotimes dolist
283;;;;;; do* do loop return-from return block etypecase typecase ecase 283;;;;;; do* do loop return-from return block etypecase typecase ecase
284;;;;;; case load-time-value eval-when destructuring-bind function* 284;;;;;; case load-time-value eval-when destructuring-bind function*
285;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "80cb83265399ce021c8c0c7d1a8562f2") 285;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "c4734fbda33043d967624d39d80c3304")
286;;; Generated autoloads from cl-macs.el 286;;; Generated autoloads from cl-macs.el
287 287
288(autoload 'gensym "cl-macs" "\ 288(autoload 'gensym "cl-macs" "\
@@ -500,16 +500,16 @@ Like `let', but lexically scoped.
500The main visible difference is that lambdas inside BODY will create 500The main visible difference is that lambdas inside BODY will create
501lexical closures as in Common Lisp. 501lexical closures as in Common Lisp.
502 502
503\(fn VARLIST BODY)" nil (quote macro)) 503\(fn BINDINGS BODY)" nil (quote macro))
504 504
505(autoload 'lexical-let* "cl-macs" "\ 505(autoload 'lexical-let* "cl-macs" "\
506Like `let*', but lexically scoped. 506Like `let*', but lexically scoped.
507The main visible difference is that lambdas inside BODY, and in 507The main visible difference is that lambdas inside BODY, and in
508successive bindings within VARLIST, will create lexical closures 508successive bindings within BINDINGS, will create lexical closures
509as in Common Lisp. This is similar to the behavior of `let*' in 509as in Common Lisp. This is similar to the behavior of `let*' in
510Common Lisp. 510Common Lisp.
511 511
512\(fn VARLIST BODY)" nil (quote macro)) 512\(fn BINDINGS BODY)" nil (quote macro))
513 513
514(autoload 'multiple-value-bind "cl-macs" "\ 514(autoload 'multiple-value-bind "cl-macs" "\
515Collect multiple return values. 515Collect multiple return values.
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 5bd8fd01b1e..b2e20843856 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1482,9 +1482,8 @@ Returns the stats object."
1482 (let ((print-escape-newlines t) 1482 (let ((print-escape-newlines t)
1483 (print-level 5) 1483 (print-level 5)
1484 (print-length 10)) 1484 (print-length 10))
1485 (let ((begin (point))) 1485 (ert--pp-with-indentation-and-newline
1486 (ert--pp-with-indentation-and-newline 1486 (ert-test-result-with-condition-condition result)))
1487 (ert-test-result-with-condition-condition result))))
1488 (goto-char (1- (point-max))) 1487 (goto-char (1- (point-max)))
1489 (assert (looking-at "\n")) 1488 (assert (looking-at "\n"))
1490 (delete-char 1) 1489 (delete-char 1)
@@ -1603,7 +1602,7 @@ Nothing more than an interactive interface to `ert-make-test-unbound'."
1603(defun ert-delete-all-tests () 1602(defun ert-delete-all-tests ()
1604 "Make all symbols in `obarray' name no test." 1603 "Make all symbols in `obarray' name no test."
1605 (interactive) 1604 (interactive)
1606 (when (interactive-p) 1605 (when (called-interactively-p 'any)
1607 (unless (y-or-n-p "Delete all tests? ") 1606 (unless (y-or-n-p "Delete all tests? ")
1608 (error "Aborted"))) 1607 (error "Aborted")))
1609 ;; We can't use `ert-select-tests' here since that gives us only 1608 ;; We can't use `ert-select-tests' here since that gives us only
@@ -1793,7 +1792,7 @@ EWOC and STATS are arguments for `ert--results-update-stats-display'."
1793BEGIN and END specify a region in the current buffer." 1792BEGIN and END specify a region in the current buffer."
1794 (save-excursion 1793 (save-excursion
1795 (save-restriction 1794 (save-restriction
1796 (narrow-to-region begin (point)) 1795 (narrow-to-region begin end)
1797 ;; Inhibit optimization in `debugger-make-xrefs' that would 1796 ;; Inhibit optimization in `debugger-make-xrefs' that would
1798 ;; sometimes insert unrelated backtrace info into our buffer. 1797 ;; sometimes insert unrelated backtrace info into our buffer.
1799 (let ((debugger-previous-backtrace nil)) 1798 (let ((debugger-previous-backtrace nil))
diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el
index 61f23abf0a7..cd4b5ee231c 100644
--- a/lisp/emacs-lisp/package-x.el
+++ b/lisp/emacs-lisp/package-x.el
@@ -27,21 +27,41 @@
27 27
28;;; Commentary: 28;;; Commentary:
29 29
30;; This file currently contains parts of the package system most 30;; This file currently contains parts of the package system that many
31;; people won't need, such as package uploading. 31;; won't need, such as package uploading.
32
33;; To upload to an archive, first set `package-archive-upload-base' to
34;; some desired directory. For testing purposes, you can specify any
35;; directory you want, but if you want the archive to be accessible to
36;; others via http, this is typically a directory in the /var/www tree
37;; (possibly one on a remote machine, accessed via Tramp).
38
39;; Then call M-x package-upload-file, which prompts for a file to
40;; upload. Alternatively, M-x package-upload-buffer uploads the
41;; current buffer, if it's visiting a package file.
42
43;; Once a package is uploaded, users can access it via the Package
44;; Menu, by adding the archive to `package-archives'.
32 45
33;;; Code: 46;;; Code:
34 47
35(require 'package) 48(require 'package)
36(defvar gnus-article-buffer) 49(defvar gnus-article-buffer)
37 50
38;; Note that this only works if you have the password, which you 51(defcustom package-archive-upload-base "/path/to/archive"
39;; probably don't :-). 52 "The base location of the archive to which packages are uploaded.
40(defvar package-archive-upload-base nil 53This should be an absolute directory name. If the archive is on
41 "Base location for uploading to package archive.") 54another machine, you may specify a remote name in the usual way,
55e.g. \"/ssh:foo@example.com:/var/www/packages/\".
56See Info node `(emacs)Remote Files'.
57
58Unlike `package-archives', you can't specify a HTTP URL."
59 :type 'directory
60 :group 'package
61 :version "24.1")
42 62
43(defvar package-update-news-on-upload nil 63(defvar package-update-news-on-upload nil
44 "Whether package upload should also update NEWS and RSS feeds.") 64 "Whether uploading a package should also update NEWS and RSS feeds.")
45 65
46(defun package--encode (string) 66(defun package--encode (string)
47 "Encode a string by replacing some characters with XML entities." 67 "Encode a string by replacing some characters with XML entities."
@@ -75,13 +95,18 @@
75 title " - " (package--encode text) 95 title " - " (package--encode text)
76 " </li>\n")) 96 " </li>\n"))
77 97
78(defun package--update-file (file location text) 98(defun package--update-file (file tag text)
99 "Update the package archive file named FILE.
100FILE should be relative to `package-archive-upload-base'.
101TAG is a string that can be found within the file; TEXT is
102inserted after its first occurrence in the file."
103 (setq file (expand-file-name file package-archive-upload-base))
79 (save-excursion 104 (save-excursion
80 (let ((old-buffer (find-buffer-visiting file))) 105 (let ((old-buffer (find-buffer-visiting file)))
81 (with-current-buffer (let ((find-file-visit-truename t)) 106 (with-current-buffer (let ((find-file-visit-truename t))
82 (or old-buffer (find-file-noselect file))) 107 (or old-buffer (find-file-noselect file)))
83 (goto-char (point-min)) 108 (goto-char (point-min))
84 (search-forward location) 109 (search-forward tag)
85 (forward-line) 110 (forward-line)
86 (insert text) 111 (insert text)
87 (let ((file-precious-flag t)) 112 (let ((file-precious-flag t))
@@ -105,30 +130,31 @@ Return the file contents, as a string, or nil if unsuccessful."
105 (buffer-substring-no-properties (point-min) (point-max))) 130 (buffer-substring-no-properties (point-min) (point-max)))
106 (kill-buffer buffer)))))) 131 (kill-buffer buffer))))))
107 132
108(defun package--archive-contents-from-file (file) 133(defun package--archive-contents-from-file ()
109 "Parse the given archive-contents file." 134 "Parse the archive-contents at `package-archive-upload-base'"
110 (if (not (file-exists-p file)) 135 (let ((file (expand-file-name "archive-contents"
111 ;; no existing archive-contents, possibly a new ELPA repo. 136 package-archive-upload-base)))
112 (list package-archive-version) 137 (if (not (file-exists-p file))
113 (let ((dont-kill (find-buffer-visiting file))) 138 ;; No existing archive-contents means a new archive.
114 (with-current-buffer (let ((find-file-visit-truename t)) 139 (list package-archive-version)
115 (find-file-noselect file)) 140 (let ((dont-kill (find-buffer-visiting file)))
116 (prog1 141 (with-current-buffer (let ((find-file-visit-truename t))
117 (package-read-from-string 142 (find-file-noselect file))
118 (buffer-substring-no-properties (point-min) (point-max))) 143 (prog1
119 (unless dont-kill 144 (package-read-from-string
120 (kill-buffer (current-buffer)))))))) 145 (buffer-substring-no-properties (point-min) (point-max)))
146 (unless dont-kill
147 (kill-buffer (current-buffer)))))))))
121 148
122(defun package-maint-add-news-item (title description archive-url) 149(defun package-maint-add-news-item (title description archive-url)
123 "Add a news item to the ELPA web pages. 150 "Add a news item to the webpages associated with the package archive.
124TITLE is the title of the news item. 151TITLE is the title of the news item.
125DESCRIPTION is the text of the news item. 152DESCRIPTION is the text of the news item."
126You need administrative access to ELPA to use this."
127 (interactive "sTitle: \nsText: ") 153 (interactive "sTitle: \nsText: ")
128 (package--update-file (concat package-archive-upload-base "elpa.rss") 154 (package--update-file "elpa.rss"
129 "<description>" 155 "<description>"
130 (package--make-rss-entry title description archive-url)) 156 (package--make-rss-entry title description archive-url))
131 (package--update-file (concat package-archive-upload-base "news.html") 157 (package--update-file "news.html"
132 "New entries go here" 158 "New entries go here"
133 (package--make-html-entry title description))) 159 (package--make-html-entry title description)))
134 160
@@ -144,8 +170,8 @@ PKG-INFO is the package info, see `package-buffer-info'.
144EXTENSION is the file extension, a string. It can be either 170EXTENSION is the file extension, a string. It can be either
145\"el\" or \"tar\". 171\"el\" or \"tar\".
146 172
147The variable `package-archive-upload-base' specifies the upload 173The upload destination is given by `package-archive-upload-base'.
148destination. If this is nil, signal an error. 174If its value is invalid, prompt for a directory.
149 175
150Optional arg ARCHIVE-URL is the URL of the destination archive. 176Optional arg ARCHIVE-URL is the URL of the destination archive.
151If it is non-nil, compute the new \"archive-contents\" file 177If it is non-nil, compute the new \"archive-contents\" file
@@ -156,85 +182,97 @@ addition, if `package-update-news-on-upload' is non-nil, call
156If ARCHIVE-URL is nil, compute the new \"archive-contents\" file 182If ARCHIVE-URL is nil, compute the new \"archive-contents\" file
157from the \"archive-contents\" at `package-archive-upload-base', 183from the \"archive-contents\" at `package-archive-upload-base',
158if it exists." 184if it exists."
159 (unless package-archive-upload-base 185 (let ((package-archive-upload-base package-archive-upload-base))
160 (error "No destination specified in `package-archive-upload-base'")) 186 ;; Check if `package-archive-upload-base' is valid.
161 (save-excursion 187 (when (or (not (stringp package-archive-upload-base))
162 (save-restriction 188 (equal package-archive-upload-base
163 (let* ((file-type (cond 189 (car-safe
164 ((equal extension "el") 'single) 190 (get 'package-archive-upload-base 'standard-value))))
165 ((equal extension "tar") 'tar) 191 (setq package-archive-upload-base
166 (t (error "Unknown extension `%s'" extension)))) 192 (read-directory-name
167 (file-name (aref pkg-info 0)) 193 "Base directory for package archive: ")))
168 (pkg-name (intern file-name)) 194 (unless (file-directory-p package-archive-upload-base)
169 (requires (aref pkg-info 1)) 195 (if (y-or-n-p (format "%s does not exist; create it? "
170 (desc (if (string= (aref pkg-info 2) "") 196 package-archive-upload-base))
171 (read-string "Description of package: ") 197 (make-directory package-archive-upload-base t)
172 (aref pkg-info 2))) 198 (error "Aborted")))
173 (pkg-version (aref pkg-info 3)) 199 (save-excursion
174 (commentary (aref pkg-info 4)) 200 (save-restriction
175 (split-version (version-to-list pkg-version)) 201 (let* ((file-type (cond
176 (pkg-buffer (current-buffer))) 202 ((equal extension "el") 'single)
177 203 ((equal extension "tar") 'tar)
178 ;; Get archive-contents from ARCHIVE-URL if it's non-nil, or 204 (t (error "Unknown extension `%s'" extension))))
179 ;; from `package-archive-upload-base' otherwise. 205 (file-name (aref pkg-info 0))
180 (let ((contents (or (package--archive-contents-from-url archive-url) 206 (pkg-name (intern file-name))
181 (package--archive-contents-from-file 207 (requires (aref pkg-info 1))
182 (concat package-archive-upload-base 208 (desc (if (string= (aref pkg-info 2) "")
183 "archive-contents")))) 209 (read-string "Description of package: ")
184 (new-desc (vector split-version requires desc file-type))) 210 (aref pkg-info 2)))
185 (if (> (car contents) package-archive-version) 211 (pkg-version (aref pkg-info 3))
186 (error "Unrecognized archive version %d" (car contents))) 212 (commentary (aref pkg-info 4))
187 (let ((elt (assq pkg-name (cdr contents)))) 213 (split-version (version-to-list pkg-version))
188 (if elt 214 (pkg-buffer (current-buffer)))
189 (if (version-list-<= split-version 215
190 (package-desc-vers (cdr elt))) 216 ;; Get archive-contents from ARCHIVE-URL if it's non-nil, or
191 (error "New package has smaller version: %s" pkg-version) 217 ;; from `package-archive-upload-base' otherwise.
192 (setcdr elt new-desc)) 218 (let ((contents (or (package--archive-contents-from-url archive-url)
193 (setq contents (cons (car contents) 219 (package--archive-contents-from-file)))
194 (cons (cons pkg-name new-desc) 220 (new-desc (vector split-version requires desc file-type)))
195 (cdr contents)))))) 221 (if (> (car contents) package-archive-version)
196 222 (error "Unrecognized archive version %d" (car contents)))
197 ;; Now CONTENTS is the updated archive contents. Upload 223 (let ((elt (assq pkg-name (cdr contents))))
198 ;; this and the package itself. For now we assume ELPA is 224 (if elt
199 ;; writable via file primitives. 225 (if (version-list-<= split-version
200 (let ((print-level nil) 226 (package-desc-vers (cdr elt)))
201 (print-length nil)) 227 (error "New package has smaller version: %s" pkg-version)
202 (write-region (concat (pp-to-string contents) "\n") 228 (setcdr elt new-desc))
203 nil 229 (setq contents (cons (car contents)
204 (concat package-archive-upload-base 230 (cons (cons pkg-name new-desc)
205 "archive-contents"))) 231 (cdr contents))))))
206 232
207 ;; If there is a commentary section, write it. 233 ;; Now CONTENTS is the updated archive contents. Upload
208 (when commentary 234 ;; this and the package itself. For now we assume ELPA is
209 (write-region commentary nil 235 ;; writable via file primitives.
210 (concat package-archive-upload-base 236 (let ((print-level nil)
211 (symbol-name pkg-name) "-readme.txt"))) 237 (print-length nil))
212 238 (write-region (concat (pp-to-string contents) "\n")
213 (set-buffer pkg-buffer) 239 nil
214 (write-region (point-min) (point-max) 240 (expand-file-name "archive-contents"
215 (concat package-archive-upload-base 241 package-archive-upload-base)))
216 file-name "-" pkg-version 242
217 "." extension) 243 ;; If there is a commentary section, write it.
218 nil nil nil 'excl) 244 (when commentary
219 245 (write-region commentary nil
220 ;; Write a news entry. 246 (expand-file-name
221 (and package-update-news-on-upload 247 (concat (symbol-name pkg-name) "-readme.txt")
222 archive-url 248 package-archive-upload-base)))
223 (package--update-news (concat file-name "." extension) 249
224 pkg-version desc archive-url)) 250 (set-buffer pkg-buffer)
225 251 (write-region (point-min) (point-max)
226 ;; special-case "package": write a second copy so that the 252 (expand-file-name
227 ;; installer can easily find the latest version. 253 (concat file-name "-" pkg-version "." extension)
228 (if (string= file-name "package") 254 package-archive-upload-base)
229 (write-region (point-min) (point-max) 255 nil nil nil 'excl)
230 (concat package-archive-upload-base 256
231 file-name "." extension) 257 ;; Write a news entry.
232 nil nil nil 'ask))))))) 258 (and package-update-news-on-upload
259 archive-url
260 (package--update-news (concat file-name "." extension)
261 pkg-version desc archive-url))
262
263 ;; special-case "package": write a second copy so that the
264 ;; installer can easily find the latest version.
265 (if (string= file-name "package")
266 (write-region (point-min) (point-max)
267 (expand-file-name
268 (concat file-name "." extension)
269 package-archive-upload-base)
270 nil nil nil 'ask))))))))
233 271
234(defun package-upload-buffer () 272(defun package-upload-buffer ()
235 "Upload the current buffer as a single-file Emacs Lisp package. 273 "Upload the current buffer as a single-file Emacs Lisp package.
236The variable `package-archive-upload-base' specifies the upload 274If `package-archive-upload-base' does not specify a valid upload
237destination." 275destination, prompt for one."
238 (interactive) 276 (interactive)
239 (save-excursion 277 (save-excursion
240 (save-restriction 278 (save-restriction
@@ -247,9 +285,8 @@ destination."
247Interactively, prompt for FILE. The package is considered a 285Interactively, prompt for FILE. The package is considered a
248single-file package if FILE ends in \".el\", and a multi-file 286single-file package if FILE ends in \".el\", and a multi-file
249package if FILE ends in \".tar\". 287package if FILE ends in \".tar\".
250 288If `package-archive-upload-base' does not specify a valid upload
251The variable `package-archive-upload-base' specifies the upload 289destination, prompt for one."
252destination."
253 (interactive "fPackage file name: ") 290 (interactive "fPackage file name: ")
254 (with-temp-buffer 291 (with-temp-buffer
255 (insert-file-contents-literally file) 292 (insert-file-contents-literally file)
@@ -269,4 +306,4 @@ This should be invoked from the gnus *Summary* buffer."
269 306
270(provide 'package-x) 307(provide 'package-x)
271 308
272;;; package.el ends here 309;;; package-x.el ends here
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 2552ad4eb68..5dc2938fe08 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -319,20 +319,39 @@ Like `package-alist', but maps package name to a second alist.
319The inner alist is keyed by version.") 319The inner alist is keyed by version.")
320(put 'package-obsolete-alist 'risky-local-variable t) 320(put 'package-obsolete-alist 'risky-local-variable t)
321 321
322(defconst package-subdirectory-regexp 322(defun package-version-join (vlist)
323 "^\\([^.].*\\)-\\([0-9]+\\(?:[.][0-9]+\\)*\\)$" 323 "Return the version string corresponding to the list VLIST.
324 "Regular expression matching the name of a package subdirectory. 324This is, approximately, the inverse of `version-to-list'.
325The first subexpression is the package name. 325\(Actually, it returns only one of the possible inverses, since
326The second subexpression is the version string.") 326`version-to-list' is a many-to-one operation.)"
327 327 (if (null vlist)
328(defun package-version-join (l) 328 ""
329 "Turn a list of version numbers into a version string." 329 (let ((str-list (list "." (int-to-string (car vlist)))))
330 (mapconcat 'int-to-string l ".")) 330 (dolist (num (cdr vlist))
331 (cond
332 ((>= num 0)
333 (push (int-to-string num) str-list)
334 (push "." str-list))
335 ((< num -3)
336 (error "Invalid version list `%s'" vlist))
337 (t
338 ;; pre, or beta, or alpha
339 (cond ((equal "." (car str-list))
340 (pop str-list))
341 ((not (string-match "[0-9]+" (car str-list)))
342 (error "Invalid version list `%s'" vlist)))
343 (push (cond ((= num -1) "pre")
344 ((= num -2) "beta")
345 ((= num -3) "alpha"))
346 str-list))))
347 (if (equal "." (car str-list))
348 (pop str-list))
349 (apply 'concat (nreverse str-list)))))
331 350
332(defun package-strip-version (dirname) 351(defun package-strip-version (dirname)
333 "Strip the version from a combined package name and version. 352 "Strip the version from a combined package name and version.
334E.g., if given \"quux-23.0\", will return \"quux\"" 353E.g., if given \"quux-23.0\", will return \"quux\""
335 (if (string-match package-subdirectory-regexp dirname) 354 (if (string-match (concat "\\`" package-subdirectory-regexp "\\'") dirname)
336 (match-string 1 dirname))) 355 (match-string 1 dirname)))
337 356
338(defun package-load-descriptor (dir package) 357(defun package-load-descriptor (dir package)
@@ -357,12 +376,13 @@ In each valid package subdirectory, this function loads the
357description file containing a call to `define-package', which 376description file containing a call to `define-package', which
358updates `package-alist' and `package-obsolete-alist'." 377updates `package-alist' and `package-obsolete-alist'."
359 (let ((all (memq 'all package-load-list)) 378 (let ((all (memq 'all package-load-list))
379 (regexp (concat "\\`" package-subdirectory-regexp "\\'"))
360 name version force) 380 name version force)
361 (dolist (dir (cons package-user-dir package-directory-list)) 381 (dolist (dir (cons package-user-dir package-directory-list))
362 (when (file-directory-p dir) 382 (when (file-directory-p dir)
363 (dolist (subdir (directory-files dir)) 383 (dolist (subdir (directory-files dir))
364 (when (and (file-directory-p (expand-file-name subdir dir)) 384 (when (and (file-directory-p (expand-file-name subdir dir))
365 (string-match package-subdirectory-regexp subdir)) 385 (string-match regexp subdir))
366 (setq name (intern (match-string 1 subdir)) 386 (setq name (intern (match-string 1 subdir))
367 version (match-string 2 subdir) 387 version (match-string 2 subdir)
368 force (assq name package-load-list)) 388 force (assq name package-load-list))
@@ -554,30 +574,29 @@ EXTRA-PROPERTIES is currently unused."
554 (package-autoload-ensure-default-file generated-autoload-file)) 574 (package-autoload-ensure-default-file generated-autoload-file))
555 (update-directory-autoloads pkg-dir))) 575 (update-directory-autoloads pkg-dir)))
556 576
557(defun package-untar-buffer () 577(defvar tar-parse-info)
578(declare-function tar-untar-buffer "tar-mode" ())
579
580(defun package-untar-buffer (dir)
558 "Untar the current buffer. 581 "Untar the current buffer.
559This uses `tar-untar-buffer' if it is available. 582This uses `tar-untar-buffer' from Tar mode. All files should
560Otherwise it uses an external `tar' program. 583untar into a directory named DIR; otherwise, signal an error."
561`default-directory' should be set by the caller."
562 (require 'tar-mode) 584 (require 'tar-mode)
563 (if (fboundp 'tar-untar-buffer) 585 (tar-mode)
564 (progn 586 ;; Make sure everything extracts into DIR.
565 ;; tar-mode messes with narrowing, so we just let it have the 587 (let ((regexp (concat "\\`" (regexp-quote dir) "/")))
566 ;; whole buffer to play with. 588 (dolist (tar-data tar-parse-info)
567 (delete-region (point-min) (point)) 589 (unless (string-match regexp (aref tar-data 2))
568 (tar-mode) 590 (error "Package does not untar cleanly into directory %s/" dir))))
569 (tar-untar-buffer)) 591 (tar-untar-buffer))
570 ;; FIXME: check the result.
571 (call-process-region (point) (point-max) "tar" nil '(nil nil) nil
572 "xf" "-")))
573 592
574(defun package-unpack (name version) 593(defun package-unpack (name version)
575 (let ((pkg-dir (expand-file-name (concat (symbol-name name) "-" version) 594 (let* ((dirname (concat (symbol-name name) "-" version))
576 package-user-dir))) 595 (pkg-dir (expand-file-name dirname package-user-dir)))
577 (make-directory package-user-dir t) 596 (make-directory package-user-dir t)
578 ;; FIXME: should we delete PKG-DIR if it exists? 597 ;; FIXME: should we delete PKG-DIR if it exists?
579 (let* ((default-directory (file-name-as-directory package-user-dir))) 598 (let* ((default-directory (file-name-as-directory package-user-dir)))
580 (package-untar-buffer) 599 (package-untar-buffer dirname)
581 (package-generate-autoloads (symbol-name name) pkg-dir) 600 (package-generate-autoloads (symbol-name name) pkg-dir)
582 (let ((load-path (cons pkg-dir load-path))) 601 (let ((load-path (cons pkg-dir load-path)))
583 (byte-recompile-directory pkg-dir 0 t))))) 602 (byte-recompile-directory pkg-dir 0 t)))))
@@ -592,7 +611,9 @@ Otherwise it uses an external `tar' program.
592 (if (string= file-name "package") 611 (if (string= file-name "package")
593 (package--write-file-no-coding 612 (package--write-file-no-coding
594 (expand-file-name (concat file-name ".el") package-user-dir)) 613 (expand-file-name (concat file-name ".el") package-user-dir))
595 (let* ((pkg-dir (expand-file-name (concat file-name "-" version) 614 (let* ((pkg-dir (expand-file-name (concat file-name "-"
615 (package-version-join
616 (version-to-list version)))
596 package-user-dir)) 617 package-user-dir))
597 (el-file (expand-file-name (concat file-name ".el") pkg-dir)) 618 (el-file (expand-file-name (concat file-name ".el") pkg-dir))
598 (pkg-file (expand-file-name (concat file-name "-pkg.el") pkg-dir))) 619 (pkg-file (expand-file-name (concat file-name "-pkg.el") pkg-dir)))
@@ -848,15 +869,17 @@ The package is found on one of the archives in `package-archives'."
848 ;; Try to activate it. 869 ;; Try to activate it.
849 (package-initialize)) 870 (package-initialize))
850 871
851(defun package-strip-rcs-id (v-str) 872(defun package-strip-rcs-id (str)
852 "Strip RCS version ID from the version string. 873 "Strip RCS version ID from the version string STR.
853If the result looks like a dotted numeric version, return it. 874If the result looks like a dotted numeric version, return it.
854Otherwise return nil." 875Otherwise return nil."
855 (if v-str 876 (when str
856 (if (string-match "^[ \t]*[$]Revision:[ \t]\([0-9.]+\)[ \t]*[$]$" v-str) 877 (when (string-match "\\`[ \t]*[$]Revision:[ \t]+" str)
857 (match-string 1 v-str) 878 (setq str (substring str (match-end 0))))
858 (if (string-match "^[0-9.]*$" v-str) 879 (condition-case nil
859 v-str)))) 880 (if (version-to-list str)
881 str)
882 (error nil))))
860 883
861(defun package-buffer-info () 884(defun package-buffer-info ()
862 "Return a vector describing the package in the current buffer. 885 "Return a vector describing the package in the current buffer.
@@ -911,43 +934,47 @@ boundaries."
911 "Find package information for a tar file. 934 "Find package information for a tar file.
912FILE is the name of the tar file to examine. 935FILE is the name of the tar file to examine.
913The return result is a vector like `package-buffer-info'." 936The return result is a vector like `package-buffer-info'."
914 (unless (string-match "^\\(.+\\)-\\([0-9.]+\\)\\.tar$" file) 937 (let ((default-directory (file-name-directory file))
915 (error "Invalid package name `%s'" file)) 938 (file (file-name-nondirectory file)))
916 (let* ((pkg-name (file-name-nondirectory (match-string-no-properties 1 file))) 939 (unless (string-match (concat "\\`" package-subdirectory-regexp "\\.tar\\'")
917 (pkg-version (match-string-no-properties 2 file)) 940 file)
918 ;; Extract the package descriptor. 941 (error "Invalid package name `%s'" file))
919 (pkg-def-contents (shell-command-to-string 942 (let* ((pkg-name (match-string-no-properties 1 file))
920 ;; Requires GNU tar. 943 (pkg-version (match-string-no-properties 2 file))
921 (concat "tar -xOf " file " " 944 ;; Extract the package descriptor.
922 pkg-name "-" pkg-version "/" 945 (pkg-def-contents (shell-command-to-string
923 pkg-name "-pkg.el"))) 946 ;; Requires GNU tar.
924 (pkg-def-parsed (package-read-from-string pkg-def-contents))) 947 (concat "tar -xOf " file " "
925 (unless (eq (car pkg-def-parsed) 'define-package) 948
926 (error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name)) 949 pkg-name "-" pkg-version "/"
927 (let ((name-str (nth 1 pkg-def-parsed)) 950 pkg-name "-pkg.el")))
928 (version-string (nth 2 pkg-def-parsed)) 951 (pkg-def-parsed (package-read-from-string pkg-def-contents)))
929 (docstring (nth 3 pkg-def-parsed)) 952 (unless (eq (car pkg-def-parsed) 'define-package)
930 (requires (nth 4 pkg-def-parsed)) 953 (error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name))
931 (readme (shell-command-to-string 954 (let ((name-str (nth 1 pkg-def-parsed))
932 ;; Requires GNU tar. 955 (version-string (nth 2 pkg-def-parsed))
933 (concat "tar -xOf " file " " 956 (docstring (nth 3 pkg-def-parsed))
934 pkg-name "-" pkg-version "/README")))) 957 (requires (nth 4 pkg-def-parsed))
935 (unless (equal pkg-version version-string) 958 (readme (shell-command-to-string
936 (error "Package has inconsistent versions")) 959 ;; Requires GNU tar.
937 (unless (equal pkg-name name-str) 960 (concat "tar -xOf " file " "
938 (error "Package has inconsistent names")) 961 pkg-name "-" pkg-version "/README"))))
939 ;; Kind of a hack. 962 (unless (equal pkg-version version-string)
940 (if (string-match ": Not found in archive" readme) 963 (error "Package has inconsistent versions"))
941 (setq readme nil)) 964 (unless (equal pkg-name name-str)
942 ;; Turn string version numbers into list form. 965 (error "Package has inconsistent names"))
943 (if (eq (car requires) 'quote) 966 ;; Kind of a hack.
944 (setq requires (car (cdr requires)))) 967 (if (string-match ": Not found in archive" readme)
945 (setq requires 968 (setq readme nil))
946 (mapcar (lambda (elt) 969 ;; Turn string version numbers into list form.
947 (list (car elt) 970 (if (eq (car requires) 'quote)
948 (version-to-list (cadr elt)))) 971 (setq requires (car (cdr requires))))
949 requires)) 972 (setq requires
950 (vector pkg-name requires docstring version-string readme)))) 973 (mapcar (lambda (elt)
974 (list (car elt)
975 (version-to-list (cadr elt))))
976 requires))
977 (vector pkg-name requires docstring version-string readme)))))
951 978
952;;;###autoload 979;;;###autoload
953(defun package-install-from-buffer (pkg-info type) 980(defun package-install-from-buffer (pkg-info type)
@@ -1037,7 +1064,7 @@ makes them available for download."
1037 (unless (file-exists-p package-user-dir) 1064 (unless (file-exists-p package-user-dir)
1038 (make-directory package-user-dir t)) 1065 (make-directory package-user-dir t))
1039 (dolist (archive package-archives) 1066 (dolist (archive package-archives)
1040 (condition-case nil 1067 (condition-case-no-debug nil
1041 (package--download-one-archive archive "archive-contents") 1068 (package--download-one-archive archive "archive-contents")
1042 (error (message "Failed to download `%s' archive." 1069 (error (message "Failed to download `%s' archive."
1043 (car archive))))) 1070 (car archive)))))
@@ -1465,7 +1492,7 @@ packages marked for deletion are removed."
1465 delete-list 1492 delete-list
1466 ", ")))) 1493 ", "))))
1467 (dolist (elt delete-list) 1494 (dolist (elt delete-list)
1468 (condition-case err 1495 (condition-case-no-debug err
1469 (package-delete (car elt) (cdr elt)) 1496 (package-delete (car elt) (cdr elt))
1470 (error (message (cadr err))))) 1497 (error (message (cadr err)))))
1471 (error "Aborted"))) 1498 (error "Aborted")))
diff --git a/lisp/eshell/esh-opt.el b/lisp/eshell/esh-opt.el
index d7162406879..a9e8f11c39a 100644
--- a/lisp/eshell/esh-opt.el
+++ b/lisp/eshell/esh-opt.el
@@ -35,13 +35,51 @@ Eshell commands implemented in Lisp."
35 35
36;;; User Functions: 36;;; User Functions:
37 37
38(defmacro eshell-eval-using-options (name macro-args 38(defmacro eshell-eval-using-options (name macro-args options &rest body-forms)
39 options &rest body-forms)
40 "Process NAME's MACRO-ARGS using a set of command line OPTIONS. 39 "Process NAME's MACRO-ARGS using a set of command line OPTIONS.
41After doing so, settings will be stored in local symbols as declared 40After doing so, stores settings in local symbols as declared by OPTIONS;
42by OPTIONS; FORMS will then be evaluated -- assuming all was OK. 41then evaluates BODY-FORMS -- assuming all was OK.
43 42
44The syntax of OPTIONS is: 43OPTIONS is a list, beginning with one or more elements of the form:
44\(SHORT LONG VALUE SYMBOL HELP-STRING)
45Each of these elements represents a particular command-line switch.
46
47SHORT is either nil, or a character that can be used as a switch -SHORT.
48LONG is either nil, or a string that can be used as a switch --LONG.
49At least one of SHORT and LONG must be non-nil.
50VALUE is the value associated with the option. It can be either:
51 t - the option needs a value to be specified after the switch;
52 nil - the option is given the value t;
53 anything else - specifies the actual value for the option.
54SYMBOL is either nil, or the name of the Lisp symbol that will be bound
55to VALUE. A nil SYMBOL calls `eshell-show-usage', and so is appropriate
56for a \"--help\" type option.
57HELP-STRING is a documentation string for the option.
58
59Any remaining elements of OPTIONS are :KEYWORD arguments. Some take
60arguments, some do not. The recognized :KEYWORDS are:
61
62:external STRING
63 STRING is an external command to run if there are unknown switches.
64
65:usage STRING
66 STRING is the initial part of the command's documentation string.
67 It appears before the options are listed.
68
69:post-usage STRING
70 STRING is an optional trailing part of the command's documentation string.
71 It appears after the options, but before the final part of the
72 documentation about the associated external command (if there is one).
73
74:show-usage
75 If present, then show the usage message if the command is called with no
76 arguments.
77
78:preserve-args
79 If present, do not pass MACRO-ARGS through `eshell-flatten-list'
80and `eshell-stringify-list'.
81
82For example, OPTIONS might look like:
45 83
46 '((?C nil nil multi-column \"multi-column display\") 84 '((?C nil nil multi-column \"multi-column display\")
47 (nil \"help\" nil nil \"show this usage display\") 85 (nil \"help\" nil nil \"show this usage display\")
@@ -52,8 +90,9 @@ The syntax of OPTIONS is:
52 Sort entries alphabetically across.\") 90 Sort entries alphabetically across.\")
53 91
54`eshell-eval-using-options' returns the value of the last form in 92`eshell-eval-using-options' returns the value of the last form in
55BODY-FORMS. If instead an external command is run, the tag 93BODY-FORMS. If instead an external command is run (because of
56`eshell-external' will be thrown with the new process for its value. 94an unknown option), the tag `eshell-external' will be thrown with
95the new process for its value.
57 96
58Lastly, any remaining arguments will be available in a locally 97Lastly, any remaining arguments will be available in a locally
59interned variable `args' (created using a `let' form)." 98interned variable `args' (created using a `let' form)."
@@ -200,7 +239,7 @@ switch is unrecognized."
200 239
201(defun eshell-process-args (name args options) 240(defun eshell-process-args (name args options)
202 "Process the given ARGS using OPTIONS. 241 "Process the given ARGS using OPTIONS.
203This assumes that symbols have been intern'd by `eshell-with-options'." 242This assumes that symbols have been intern'd by `eshell-eval-using-options'."
204 (let ((ai 0) arg) 243 (let ((ai 0) arg)
205 (while (< ai (length args)) 244 (while (< ai (length args))
206 (setq arg (nth ai args)) 245 (setq arg (nth ai args))
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index dbe4f824deb..424d246a2b6 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -138,7 +138,8 @@ function `string-to-number'."
138 (memq system-type '(ms-dos windows-nt))) 138 (memq system-type '(ms-dos windows-nt)))
139 139
140(defmacro eshell-condition-case (tag form &rest handlers) 140(defmacro eshell-condition-case (tag form &rest handlers)
141 "Like `condition-case', but only if `eshell-pass-through-errors' is nil." 141 "If `eshell-handle-errors' is non-nil, this is `condition-case'.
142Otherwise, evaluates FORM with no error handling."
142 (if eshell-handle-errors 143 (if eshell-handle-errors
143 `(condition-case ,tag 144 `(condition-case ,tag
144 ,form 145 ,form
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 97862afb678..fffe09a84a5 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -567,18 +567,12 @@ You can change the color sort order by customizing `list-colors-sort'."
567 (with-help-window buffer-name 567 (with-help-window buffer-name
568 (with-current-buffer standard-output 568 (with-current-buffer standard-output
569 (erase-buffer) 569 (erase-buffer)
570 (list-colors-print list callback)
571 (set-buffer-modified-p nil)
570 (setq truncate-lines t))) 572 (setq truncate-lines t)))
571 (let ((buf (get-buffer buffer-name)) 573 (when callback
572 (inhibit-read-only t)) 574 (pop-to-buffer buffer-name)
573 ;; Display buffer before generating content, to allow 575 (message "Click on a color to select it.")))
574 ;; `list-colors-print' to get the right window-width.
575 (with-selected-window (or (get-buffer-window buf t) (selected-window))
576 (with-current-buffer buf
577 (list-colors-print list callback)
578 (set-buffer-modified-p nil)))
579 (when callback
580 (pop-to-buffer buf)
581 (message "Click on a color to select it."))))
582 576
583(defun list-colors-print (list &optional callback) 577(defun list-colors-print (list &optional callback)
584 (let ((callback-fn 578 (let ((callback-fn
@@ -595,30 +589,19 @@ You can change the color sort order by customizing `list-colors-sort'."
595 (let* ((opoint (point)) 589 (let* ((opoint (point))
596 (color-values (color-values (car color))) 590 (color-values (color-values (car color)))
597 (light-p (>= (apply 'max color-values) 591 (light-p (>= (apply 'max color-values)
598 (* (car (color-values "white")) .5))) 592 (* (car (color-values "white")) .5))))
599 (max-len (max (- (window-width) 33) 20)))
600 (insert (car color)) 593 (insert (car color))
601 (indent-to 22) 594 (indent-to 22)
602 (put-text-property opoint (point) 'face `(:background ,(car color))) 595 (put-text-property opoint (point) 'face `(:background ,(car color)))
603 (put-text-property 596 (put-text-property
604 (prog1 (point) 597 (prog1 (point)
605 (insert " ") 598 (insert " ")
606 (if (cdr color) 599 ;; Insert all color names.
607 ;; Insert as many color names as possible, fitting max-len. 600 (insert (mapconcat 'identity color ",")))
608 (let ((names (list (car color)))
609 (others (cdr color))
610 (len (length (car color)))
611 newlen)
612 (while (and others
613 (< (setq newlen (+ len 2 (length (car others))))
614 max-len))
615 (setq len newlen)
616 (push (pop others) names))
617 (insert (mapconcat 'identity (nreverse names) ", ")))
618 (insert (car color))))
619 (point) 601 (point)
620 'face (list :foreground (car color))) 602 'face (list :foreground (car color)))
621 (indent-to (max (- (window-width) 8) 44)) 603 (insert (propertize " " 'display '(space :align-to (- right 9))))
604 (insert " ")
622 (insert (propertize 605 (insert (propertize
623 (apply 'format "#%02x%02x%02x" 606 (apply 'format "#%02x%02x%02x"
624 (mapcar (lambda (c) (lsh c -8)) 607 (mapcar (lambda (c) (lsh c -8))
diff --git a/lisp/files.el b/lisp/files.el
index caf0a9752c5..38047f2fa43 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3896,11 +3896,17 @@ See also `file-name-version-regexp'."
3896 (let ((handler (find-file-name-handler file 'file-ownership-preserved-p))) 3896 (let ((handler (find-file-name-handler file 'file-ownership-preserved-p)))
3897 (if handler 3897 (if handler
3898 (funcall handler 'file-ownership-preserved-p file) 3898 (funcall handler 'file-ownership-preserved-p file)
3899 (let ((attributes (file-attributes file))) 3899 (let ((attributes (file-attributes file 'integer)))
3900 ;; Return t if the file doesn't exist, since it's true that no 3900 ;; Return t if the file doesn't exist, since it's true that no
3901 ;; information would be lost by an (attempted) delete and create. 3901 ;; information would be lost by an (attempted) delete and create.
3902 (or (null attributes) 3902 (or (null attributes)
3903 (= (nth 2 attributes) (user-uid))))))) 3903 (= (nth 2 attributes) (user-uid))
3904 ;; Files created on Windows by Administrator (RID=500)
3905 ;; have the Administrators group (RID=544) recorded as
3906 ;; their owner. Rewriting them will still preserve the
3907 ;; owner.
3908 (and (eq system-type 'windows-nt)
3909 (= (user-uid) 500) (= (nth 2 attributes) 544)))))))
3904 3910
3905(defun file-name-sans-extension (filename) 3911(defun file-name-sans-extension (filename)
3906 "Return FILENAME sans final \"extension\". 3912 "Return FILENAME sans final \"extension\".
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index b7b617fcffe..988e821d7e2 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -2242,7 +2242,7 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
2242 "\\)\\)\\>" 2242 "\\)\\)\\>"
2243 ;; Any whitespace and defined object. 2243 ;; Any whitespace and defined object.
2244 "[ \t'\(]*" 2244 "[ \t'\(]*"
2245 "\\(setf[ \t]+\\sw+)\\|\\sw+\\)?") 2245 "\\(setf[ \t]+\\sw+\\|\\sw+\\)?")
2246 (1 font-lock-keyword-face) 2246 (1 font-lock-keyword-face)
2247 (9 (cond ((match-beginning 3) font-lock-function-name-face) 2247 (9 (cond ((match-beginning 3) font-lock-function-name-face)
2248 ((match-beginning 6) font-lock-variable-name-face) 2248 ((match-beginning 6) font-lock-variable-name-face)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index c14c79a92cb..7eca03bd93b 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,182 @@
12011-03-18 Julien Danjou <julien@danjou.info>
2
3 * gnus-util.el (gnus-buffer-live-p): Simplify gnus-buffer-live-p.
4 (gnus-buffer-live-p): Check that buffer is not nil.
5
62011-03-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
7
8 * gnus-art.el: Require mouse, which the build bot seems to say is
9 needed.
10
11 * gravatar.el (gravatar-retrieve-synchronously): Use `url-retrieve' on
12 XEmacs, since it doesn't have url-retrieve-synchronously.
13
142011-03-17 Antoine Levitt <antoine.levitt@gmail.com>
15
16 * gnus-group.el (gnus-group-list-ticked): New function.
17 (gnus-group-make-menu-bar): Provide a menu entry for it.
18 (gnus-group-list-map): Provide a binding for it.
19
202011-03-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
21
22 * shr.el (shr-visit-file): New command.
23
24 * nnimap.el (nnimap-fetch-inbox): Rewrite slightly last patch.
25
262011-03-17 Bjørn Mork <bjorn@mork.no>
27
28 * nnimap.el (nnimap-fetch-inbox): Don't download bodies on ver4-capable
29 servers.
30
312011-03-16 Julien Danjou <julien@danjou.info>
32
33 * mm-uu.el (mm-uu-dissect-text-parts): Only dissect handle that are
34 inline.
35
36 * gnus-art.el (article-hide-list-identifiers): Use
37 gnus-group-get-list-identifiers.
38
39 * gnus-sum.el (gnus-group-get-list-identifiers): New function.
40 (gnus-summary-remove-list-identifiers): Use
41 gnus-group-get-list-identifiers to get regexp.
42 (gnus-select-newsgroup, gnus-summary-insert-subject)
43 (gnus-summary-insert-articles): Call
44 gnus-summary-remove-list-identifiers unconditionally.
45
462011-03-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
47
48 * gnus-sum.el (gnus-articles-to-read): Revert back to old behaviour if
49 we're selecting a group with unread articles.
50
51 * nnimap.el (nnimap-open-connection-1): Allow `network-only', too.
52
53 * gssapi.el: New file separated out from imap.el to provide a general
54 Kerberos 5 connection facility for Emacs.
55
56 * message.el (message-elide-ellipsis): Document the format spec
57 ellipsis.
58
592011-03-15 Reiner Steib <Reiner.Steib@gmx.de>
60
61 * message.el (message-elide-region): Allow the ellipsis to say how many
62 lines were removed.
63
642011-03-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
65
66 * gnus-win.el (gnus-configure-frame): Protect against trying to restore
67 window configurations containing buffers that are now dead.
68
69 * nnimap.el (nnimap-parse-flags): Remove all MODSEQ entries before
70 parsing to avoid integer overflows.
71 (nnimap-parse-flags): Simplify the last change.
72 (nnimap-parse-flags): Store HIGHESTMODSEQ as a string, since it may be
73 too large for 32-bit Emacsen.
74
752011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
76
77 * auth-source.el (auth-source-netrc-create):
78 * message.el (message-yank-original): Fix use of `case'.
79
802011-03-15 Nelson Ferreira <nelson.ferreira@ieee.org> (tiny change)
81
82 * gnus-art.el (gnus-article-treat-body-boundary): Fix boundary width on
83 XEmacs, which was one character too wide.
84
852011-03-09 Antoine Levitt <antoine.levitt@gmail.com>
86
87 * gnus-sum.el (gnus-articles-to-read): Use gnus-large-newsgroup as
88 default number of articles to display.
89 (gnus-articles-to-read): Use pretty names for prompt.
90
912011-03-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
92
93 * gnus-int.el (gnus-open-server): Ditto.
94
95 * gnus-start.el (gnus-activate-group): Give a backtrace if
96 debug-on-quit is set and the user hits `C-g'.
97 (gnus-read-active-file): Ditto.
98
99 * gnus-group.el (gnus-group-read-ephemeral-group): Ditto.
100
1012011-03-15 Teodor Zlatanov <tzz@lifelogs.com>
102
103 * message.el (message-yank-original): Use cond instead of CL case.
104
1052011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
106
107 * auth-source.el (auth-source-netrc-create): Use usual format for the
108 default in prompts.
109
1102011-03-13 Teodor Zlatanov <tzz@lifelogs.com>
111
112 * auth-source.el (auth-source-netrc-create): Show the default in the
113 prompt when prompting for token creation.
114
1152011-03-12 Teodor Zlatanov <tzz@lifelogs.com>
116
117 * auth-source.el (auth-source-format-prompt): Always convert the value
118 to a string to avoid evaluating non-string arguments.
119 (auth-source-netrc-create): Offer default properly, not as initial
120 content in `read-string'.
121 (auth-source-netrc-saver): Use a cache keyed by file name and MD5 hash
122 of line to determine if we've been run before. If so, don't run again,
123 but print a trivial message to indicate the cache was hit instead.
124
1252011-03-11 Teodor Zlatanov <tzz@lifelogs.com>
126
127 * gnus-sync.el (gnus-sync-install-hooks, gnus-sync-unload-hook):
128 Don't install `gnus-sync-read' to any hooks by default. It's buggy.
129 The user will have to run `gnus-sync-read' manually and wait for Cloudy
130 Gnus.
131
1322011-03-11 Julien Danjou <julien@danjou.info>
133
134 * mm-uu.el (mm-uu-type-alist): Add support for diff starting with "===
135 modified file".
136
1372011-03-09 Teodor Zlatanov <tzz@lifelogs.com>
138
139 * auth-source.el (auth-source-read-char-choice): New function to read a
140 character choice using `dropdown-list', `read-char-choice', or
141 `read-char'. It appends "[a/b/c] " to the prompt if the choices were
142 '(?a ?b ?c). The `dropdown-list' support is disabled for now. Use
143 `eval-when-compile' to load `dropdown-list'. Remove `dropdown-list'.
144 (auth-source-netrc-saver): Use it.
145 (auth-source-pick-first-password): New convenience function.
146
1472011-03-08 Teodor Zlatanov <tzz@lifelogs.com>
148
149 * nnimap.el (nnimap-credentials): Keep the :save-function as the third
150 parameter in the credentials.
151 (nnimap-open-connection-1): Use it after a successful login.
152 (nnimap-credentials): Add IMAP-specific user and password prompt.
153
154 * auth-source.el (auth-source-search): Add :require parameter, taking a
155 list. Document it and the :save-function return token. Pass :require
156 down. Change the CREATED message from a warning to a debug statement.
157 (auth-source-search-backends): Pass :require down.
158 (auth-source-netrc-search): Pass :require down.
159 (auth-source-netrc-parse): Use :require, if it's given, as a filter.
160 Change save prompt to indicate all modifications saved here are
161 deletions.
162 (auth-source-netrc-create): Take user login name as default in user
163 prompt. Move all the save functionality to a lexically bound function
164 under the :save-function token in the returned list. Set up clearer
165 default prompts for user, host, port, and secret.
166 (auth-source-netrc-saver): New function, intended to be wrapped for
167 :save-function.
168
1692011-03-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
170
171 * shr.el (shr-table-horizontal-line): Change the defaults for the table
172 lines to be spaces instead.
173
1742011-03-07 Julien Danjou <julien@danjou.info>
175
176 * sieve-manage.el (sieve-sasl-auth): Create auth-info if not found.
177 (sieve-sasl-auth): Check that auth-source-search did return something,
178 or just return an empty string.
179
12011-03-05 Antoine Levitt <antoine.levitt@gmail.com> 1802011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
2 181
3 * gnus.el (gnus-interactive): Use read-directory-name. 182 * gnus.el (gnus-interactive): Use read-directory-name.
@@ -12,6 +191,13 @@
12 191
132011-03-05 Lars Magne Ingebrigtsen <larsi@gnus.org> 1922011-03-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
14 193
194 * gnus-start.el (gnus-group-change-level): Allow putting foreign groups
195 onto the list of killed groups, too. This makes killed nnimap groups,
196 for instance, more reliably not reappear.
197
198 * nnimap.el (nnimap-request-thread): Don't bug out when we can't find
199 the parent.
200
15 * gnus-sum.el (gnus-update-read-articles): Fix typo. 201 * gnus-sum.el (gnus-update-read-articles): Fix typo.
16 202
17 * gnus.el (gnus-valid-select-methods): Mark nnimap as a backend that 203 * gnus.el (gnus-valid-select-methods): Mark nnimap as a backend that
@@ -24,8 +210,8 @@
24 210
252011-03-05 Antoine Levitt <antoine.levitt@gmail.com> 2112011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
26 212
27 * message.el (message-cite-reply-position, message-cite-style): New 213 * message.el (message-cite-reply-position, message-cite-style):
28 variables. 214 New variables.
29 (message-yank-original): Use the new citation styles. 215 (message-yank-original): Use the new citation styles.
30 216
312011-03-04 Daiki Ueno <ueno@unixuser.org> 2172011-03-04 Daiki Ueno <ueno@unixuser.org>
@@ -139,14 +325,14 @@
139 325
1402011-02-23 Lars Ingebrigtsen <larsi@gnus.org> 3262011-02-23 Lars Ingebrigtsen <larsi@gnus.org>
141 327
142 * gnus-start.el (gnus-dribble-read-file): Set 328 * gnus-start.el (gnus-dribble-read-file):
143 buffer-save-without-query, since we always want to save the dribble 329 Set buffer-save-without-query, since we always want to save the dribble
144 file, probably. 330 file, probably.
145 331
146 * nnmail.el (nnmail-article-group): Allow a final "" split to work on 332 * nnmail.el (nnmail-article-group): Allow a final "" split to work on
147 nnimap. 333 nnimap.
148 334
149 * gnus-sum.el (gnus-user-date-format-alist): Renamed back again from 335 * gnus-sum.el (gnus-user-date-format-alist): Rename back again from
150 -summary- since it's a user-visible variable. 336 -summary- since it's a user-visible variable.
151 337
152 * nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the 338 * nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the
@@ -392,8 +578,8 @@
3922011-02-14 Teodor Zlatanov <tzz@lifelogs.com> 5782011-02-14 Teodor Zlatanov <tzz@lifelogs.com>
393 579
394 * auth-source.el (auth-source-backend-parse-parameters): Don't rely on 580 * auth-source.el (auth-source-backend-parse-parameters): Don't rely on
395 `plist-get' to accept non-list parameters (XEmacs issue). Fix 581 `plist-get' to accept non-list parameters (XEmacs issue).
396 docstring. 582 Fix docstring.
397 (auth-source-secrets-search): Use `delete-dups', `append mapcar', and 583 (auth-source-secrets-search): Use `delete-dups', `append mapcar', and
398 `butlast' instead of `remove-duplicates', `mapcan', and `subseq'. 584 `butlast' instead of `remove-duplicates', `mapcan', and `subseq'.
399 (auth-sources, auth-source-backend-parse, auth-source-secrets-search): 585 (auth-sources, auth-source-backend-parse, auth-source-secrets-search):
@@ -433,8 +619,8 @@
433 619
4342011-02-13 Tassilo Horn <tassilo@member.fsf.org> (tiny change) 6202011-02-13 Tassilo Horn <tassilo@member.fsf.org> (tiny change)
435 621
436 * nnimap.el (nnimap-request-accept-article, nnimap-process-quirk): Fix 622 * nnimap.el (nnimap-request-accept-article, nnimap-process-quirk):
437 Gcc processing on imap. 623 Fix Gcc processing on imap.
438 624
4392011-02-10 Stefan Monnier <monnier@iro.umontreal.ca> 6252011-02-10 Stefan Monnier <monnier@iro.umontreal.ca>
440 626
@@ -522,8 +708,8 @@
522 708
5232011-02-06 Michael Albinus <michael.albinus@gmx.de> 7092011-02-06 Michael Albinus <michael.albinus@gmx.de>
524 710
525 * auth-source.el (top): Require 'eieio unconditionally. Autoload 711 * auth-source.el (top): Require 'eieio unconditionally.
526 `secrets-get-attributes' instead of `secrets-get-attribute'. 712 Autoload `secrets-get-attributes' instead of `secrets-get-attribute'.
527 (auth-source-secrets-search): Limit search when `max' is greater than 713 (auth-source-secrets-search): Limit search when `max' is greater than
528 number of results. 714 number of results.
529 715
@@ -559,7 +745,7 @@
559 (auth-source-protocol-defaults, auth-source-user-or-password-imap) 745 (auth-source-protocol-defaults, auth-source-user-or-password-imap)
560 (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) 746 (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh)
561 (auth-source-user-or-password-sftp) 747 (auth-source-user-or-password-sftp)
562 (auth-source-user-or-password-smtp): Removed. 748 (auth-source-user-or-password-smtp): Remove.
563 (auth-source-user-or-password): Deprecated and modified to be a wrapper 749 (auth-source-user-or-password): Deprecated and modified to be a wrapper
564 around `auth-source-search'. Not tested thoroughly. 750 around `auth-source-search'. Not tested thoroughly.
565 751
@@ -725,16 +911,16 @@
725 * gnus-group.el (gnus-group-jump-to-group): Allow jumping to groups 911 * gnus-group.el (gnus-group-jump-to-group): Allow jumping to groups
726 that Gnus doesn't know exists again. 912 that Gnus doesn't know exists again.
727 913
728 * gnus-art.el (gnus-article-date-lapsed-new-header): Removed. 914 * gnus-art.el (gnus-article-date-lapsed-new-header): Remove.
729 (gnus-treat-date-ut): Ditto. 915 (gnus-treat-date-ut): Ditto.
730 (gnus-article-update-date-header): Renamed. 916 (gnus-article-update-date-header): Rename.
731 (gnus-treat-date-local): Removed. 917 (gnus-treat-date-local): Remove.
732 (gnus-treat-date-english): Removed. 918 (gnus-treat-date-english): Remove.
733 (gnus-treat-date-lapsed): Removed. 919 (gnus-treat-date-lapsed): Remove.
734 (gnus-treat-date-combined-lapsed): Removed. 920 (gnus-treat-date-combined-lapsed): Remove.
735 (gnus-treat-date-original): Removed. 921 (gnus-treat-date-original): Remove.
736 (gnus-treat-date-iso8601): Removed. 922 (gnus-treat-date-iso8601): Remove.
737 (gnus-treat-date-user-defined): Removed. 923 (gnus-treat-date-user-defined): Remove.
738 (gnus-article-date-headers): New variable to control all the date 924 (gnus-article-date-headers): New variable to control all the date
739 header options. 925 header options.
740 (article-date-ut): Rewrite to allow using the new way to format date 926 (article-date-ut): Rewrite to allow using the new way to format date
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index 500de10b71c..e0bea324a25 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -54,6 +54,8 @@
54(autoload 'secrets-list-collections "secrets") 54(autoload 'secrets-list-collections "secrets")
55(autoload 'secrets-search-items "secrets") 55(autoload 'secrets-search-items "secrets")
56 56
57(autoload 'rfc2104-hash "rfc2104")
58
57(defvar secrets-enabled) 59(defvar secrets-enabled)
58 60
59(defgroup auth-source nil 61(defgroup auth-source nil
@@ -286,6 +288,28 @@ If the value is not a list, symmetric encryption will be used."
286 msg)) 288 msg))
287 289
288 290
291;;; (auth-source-read-char-choice "enter choice? " '(?a ?b ?q))
292(defun auth-source-read-char-choice (prompt choices)
293 "Read one of CHOICES by `read-char-choice', or `read-char'.
294`dropdown-list' support is disabled because it doesn't work reliably.
295Only one of CHOICES will be returned. The PROMPT is augmented
296with \"[a/b/c] \" if CHOICES is '\(?a ?b ?c\)."
297 (when choices
298 (let* ((prompt-choices
299 (apply 'concat (loop for c in choices
300 collect (format "%c/" c))))
301 (prompt-choices (concat "[" (substring prompt-choices 0 -1) "] "))
302 (full-prompt (concat prompt prompt-choices))
303 k)
304
305 (while (not (memq k choices))
306 (setq k (cond
307 ((fboundp 'read-char-choice)
308 (read-char-choice full-prompt choices))
309 (t (message "%s" full-prompt)
310 (setq k (read-char))))))
311 k)))
312
289;; (auth-source-pick nil :host "any" :port 'imap :user "joe") 313;; (auth-source-pick nil :host "any" :port 'imap :user "joe")
290;; (auth-source-pick t :host "any" :port 'imap :user "joe") 314;; (auth-source-pick t :host "any" :port 'imap :user "joe")
291;; (setq auth-sources '((:source (:secrets default) :host t :port t :user "joe") 315;; (setq auth-sources '((:source (:secrets default) :host t :port t :user "joe")
@@ -393,7 +417,7 @@ parameters."
393 417
394(defun* auth-source-search (&rest spec 418(defun* auth-source-search (&rest spec
395 &key type max host user port secret 419 &key type max host user port secret
396 create delete 420 require create delete
397 &allow-other-keys) 421 &allow-other-keys)
398 "Search or modify authentication backends according to SPEC. 422 "Search or modify authentication backends according to SPEC.
399 423
@@ -487,6 +511,11 @@ should `catch' the backend-specific error as usual. Some
487backends (netrc, at least) will prompt the user rather than throw 511backends (netrc, at least) will prompt the user rather than throw
488an error. 512an error.
489 513
514:require (A B C) means that only results that contain those
515tokens will be returned. Thus for instance requiring :secret
516will ensure that any results will actually have a :secret
517property.
518
490:delete t means to delete any found entries. nil by default. 519:delete t means to delete any found entries. nil by default.
491Use `auth-source-delete' in ELisp code instead of calling 520Use `auth-source-delete' in ELisp code instead of calling
492`auth-source-search' directly with this parameter. 521`auth-source-search' directly with this parameter.
@@ -516,11 +545,17 @@ is a plist with keys :backend :host :port :user, plus any other
516keys provided by the backend (notably :secret). But note the 545keys provided by the backend (notably :secret). But note the
517exception for :max 0, which see above. 546exception for :max 0, which see above.
518 547
548The token can hold a :save-function key. If you call that, the
549user will be prompted to save the data to the backend. You can't
550request that this should happen right after creation, because
551`auth-source-search' has no way of knowing if the token is
552actually useful. So the caller must arrange to call this function.
553
519The token's :secret key can hold a function. In that case you 554The token's :secret key can hold a function. In that case you
520must call it to obtain the actual value." 555must call it to obtain the actual value."
521 (let* ((backends (mapcar 'auth-source-backend-parse auth-sources)) 556 (let* ((backends (mapcar 'auth-source-backend-parse auth-sources))
522 (max (or max 1)) 557 (max (or max 1))
523 (ignored-keys '(:create :delete :max)) 558 (ignored-keys '(:require :create :delete :max))
524 (keys (loop for i below (length spec) by 2 559 (keys (loop for i below (length spec) by 2
525 unless (memq (nth i spec) ignored-keys) 560 unless (memq (nth i spec) ignored-keys)
526 collect (nth i spec))) 561 collect (nth i spec)))
@@ -539,6 +574,10 @@ must call it to obtain the actual value."
539 (or (eq t create) (listp create)) t 574 (or (eq t create) (listp create)) t
540 "Invalid auth-source :create parameter (must be t or a list): %s %s") 575 "Invalid auth-source :create parameter (must be t or a list): %s %s")
541 576
577 (assert
578 (listp require) t
579 "Invalid auth-source :require parameter (must be a list): %s")
580
542 (setq filtered-backends (copy-sequence backends)) 581 (setq filtered-backends (copy-sequence backends))
543 (dolist (backend backends) 582 (dolist (backend backends)
544 (dolist (key keys) 583 (dolist (key keys)
@@ -562,8 +601,9 @@ must call it to obtain the actual value."
562 spec 601 spec
563 ;; to exit early 602 ;; to exit early
564 max 603 max
565 ;; create and delete 604 ;; create is always nil here
566 nil delete)) 605 nil delete
606 require))
567 607
568 (auth-source-do-debug 608 (auth-source-do-debug
569 "auth-source-search: found %d results (max %d) matching %S" 609 "auth-source-search: found %d results (max %d) matching %S"
@@ -577,9 +617,9 @@ must call it to obtain the actual value."
577 spec 617 spec
578 ;; to exit early 618 ;; to exit early
579 max 619 max
580 ;; create and delete 620 create delete
581 create delete)) 621 require))
582 (auth-source-do-warn 622 (auth-source-do-debug
583 "auth-source-search: CREATED %d results (max %d) matching %S" 623 "auth-source-search: CREATED %d results (max %d) matching %S"
584 (length found) max spec)) 624 (length found) max spec))
585 625
@@ -589,18 +629,19 @@ must call it to obtain the actual value."
589 629
590 found)) 630 found))
591 631
592(defun auth-source-search-backends (backends spec max create delete) 632(defun auth-source-search-backends (backends spec max create delete require)
593 (let (matches) 633 (let (matches)
594 (dolist (backend backends) 634 (dolist (backend backends)
595 (when (> max (length matches)) ; when we need more matches... 635 (when (> max (length matches)) ; when we need more matches...
596 (let ((bmatches (apply 636 (let* ((bmatches (apply
597 (slot-value backend 'search-function) 637 (slot-value backend 'search-function)
598 :backend backend 638 :backend backend
599 ;; note we're overriding whatever the spec 639 ;; note we're overriding whatever the spec
600 ;; has for :create and :delete 640 ;; has for :require, :create, and :delete
601 :create create 641 :require require
602 :delete delete 642 :create create
603 spec))) 643 :delete delete
644 spec)))
604 (when bmatches 645 (when bmatches
605 (auth-source-do-trivia 646 (auth-source-do-trivia
606 "auth-source-search-backend: got %d (max %d) in %s:%s matching %S" 647 "auth-source-search-backend: got %d (max %d) in %s:%s matching %S"
@@ -713,7 +754,28 @@ while \(:host t) would find all host entries."
713 (return 'no))) 754 (return 'no)))
714 'no)))) 755 'no))))
715 756
716;;; Backend specific parsing: netrc/authinfo backend 757;;; (auth-source-pick-first-password :host "z.lifelogs.com")
758;;; (auth-source-pick-first-password :port "imap")
759(defun auth-source-pick-first-password (&rest spec)
760 "Pick the first secret found from applying SPEC to `auth-source-search'."
761 (let* ((result (nth 0 (apply 'auth-source-search (plist-put spec :max 1))))
762 (secret (plist-get result :secret)))
763
764 (if (functionp secret)
765 (funcall secret)
766 secret)))
767
768;; (auth-source-format-prompt "test %u %h %p" '((?u "user") (?h "host")))
769(defun auth-source-format-prompt (prompt alist)
770 "Format PROMPT using %x (for any character x) specifiers in ALIST."
771 (dolist (cell alist)
772 (let ((c (nth 0 cell))
773 (v (nth 1 cell)))
774 (when (and c v)
775 (setq prompt (replace-regexp-in-string (format "%%%c" c)
776 (format "%s" v)
777 prompt)))))
778 prompt)
717 779
718(defun auth-source-ensure-strings (values) 780(defun auth-source-ensure-strings (values)
719 (unless (listp values) 781 (unless (listp values)
@@ -724,12 +786,14 @@ while \(:host t) would find all host entries."
724 value)) 786 value))
725 values)) 787 values))
726 788
789;;; Backend specific parsing: netrc/authinfo backend
790
727(defvar auth-source-netrc-cache nil) 791(defvar auth-source-netrc-cache nil)
728 792
729;;; (auth-source-netrc-parse "~/.authinfo.gpg") 793;;; (auth-source-netrc-parse "~/.authinfo.gpg")
730(defun* auth-source-netrc-parse (&rest 794(defun* auth-source-netrc-parse (&rest
731 spec 795 spec
732 &key file max host user port delete 796 &key file max host user port delete require
733 &allow-other-keys) 797 &allow-other-keys)
734 "Parse FILE and return a list of all entries in the file. 798 "Parse FILE and return a list of all entries in the file.
735Note that the MAX parameter is used so we can exit the parse early." 799Note that the MAX parameter is used so we can exit the parse early."
@@ -828,7 +892,15 @@ Note that the MAX parameter is used so we can exit the parse early."
828 (or 892 (or
829 (aget alist "port") 893 (aget alist "port")
830 (aget alist "protocol") 894 (aget alist "protocol")
831 t))) 895 t))
896 (or
897 ;; the required list of keys is nil, or
898 (null require)
899 ;; every element of require is in the normalized list
900 (let ((normalized (nth 0 (auth-source-netrc-normalize
901 (list alist)))))
902 (loop for req in require
903 always (plist-get normalized req)))))
832 (decf max) 904 (decf max)
833 (push (nreverse alist) result) 905 (push (nreverse alist) result)
834 ;; to delete a line, we just comment it out 906 ;; to delete a line, we just comment it out
@@ -853,7 +925,7 @@ Note that the MAX parameter is used so we can exit the parse early."
853 (setq epa-file-encrypt-to auth-source-gpg-encrypt-to))) 925 (setq epa-file-encrypt-to auth-source-gpg-encrypt-to)))
854 926
855 ;; ask AFTER we've successfully opened the file 927 ;; ask AFTER we've successfully opened the file
856 (when (y-or-n-p (format "Save file %s? (%d modifications)" 928 (when (y-or-n-p (format "Save file %s? (%d deletions)"
857 file modified)) 929 file modified))
858 (write-region (point-min) (point-max) file nil 'silent) 930 (write-region (point-min) (point-max) file nil 'silent)
859 (auth-source-do-debug 931 (auth-source-do-debug
@@ -893,7 +965,7 @@ Note that the MAX parameter is used so we can exit the parse early."
893 965
894(defun* auth-source-netrc-search (&rest 966(defun* auth-source-netrc-search (&rest
895 spec 967 spec
896 &key backend create delete 968 &key backend require create delete
897 type max host user port 969 type max host user port
898 &allow-other-keys) 970 &allow-other-keys)
899"Given a property list SPEC, return search matches from the :backend. 971"Given a property list SPEC, return search matches from the :backend.
@@ -905,6 +977,7 @@ See `auth-source-search' for details on SPEC."
905 (let ((results (auth-source-netrc-normalize 977 (let ((results (auth-source-netrc-normalize
906 (auth-source-netrc-parse 978 (auth-source-netrc-parse
907 :max max 979 :max max
980 :require require
908 :delete delete 981 :delete delete
909 :file (oref backend source) 982 :file (oref backend source)
910 :host (or host t) 983 :host (or host t)
@@ -933,17 +1006,6 @@ See `auth-source-search' for details on SPEC."
933 (nth 0 v) 1006 (nth 0 v)
934 v)) 1007 v))
935 1008
936;; (auth-source-format-prompt "test %u %h %p" '((?u "user") (?h "host")))
937
938(defun auth-source-format-prompt (prompt alist)
939 "Format PROMPT using %x (for any character x) specifiers in ALIST."
940 (dolist (cell alist)
941 (let ((c (nth 0 cell))
942 (v (nth 1 cell)))
943 (when (and c v)
944 (setq prompt (replace-regexp-in-string (format "%%%c" c) v prompt)))))
945 prompt)
946
947;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t) 1009;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t)
948;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B))) 1010;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B)))
949 1011
@@ -992,12 +1054,12 @@ See `auth-source-search' for details on SPEC."
992 (data (auth-source-netrc-element-or-first data)) 1054 (data (auth-source-netrc-element-or-first data))
993 ;; this is the default to be offered 1055 ;; this is the default to be offered
994 (given-default (aget auth-source-creation-defaults r)) 1056 (given-default (aget auth-source-creation-defaults r))
995 ;; the default supplementals are simple: for the user, 1057 ;; the default supplementals are simple:
996 ;; try (user-login-name), otherwise take given-default 1058 ;; for the user, try `given-default' and then (user-login-name);
1059 ;; otherwise take `given-default'
997 (default (cond 1060 (default (cond
998 ;; don't default the user name 1061 ((and (not given-default) (eq r 'user))
999 ;; ((and (not given-default) (eq r 'user)) 1062 (user-login-name))
1000 ;; (user-login-name))
1001 (t given-default))) 1063 (t given-default)))
1002 (printable-defaults (list 1064 (printable-defaults (list
1003 (cons 'user 1065 (cons 'user
@@ -1020,10 +1082,10 @@ See `auth-source-search' for details on SPEC."
1020 "[any port]")))) 1082 "[any port]"))))
1021 (prompt (or (aget auth-source-creation-prompts r) 1083 (prompt (or (aget auth-source-creation-prompts r)
1022 (case r 1084 (case r
1023 ('secret "%p password for user %u, host %h: ") 1085 (secret "%p password for %u@%h: ")
1024 ('user "%p user name: ") 1086 (user "%p user name for %h: ")
1025 ('host "%p host name for user %u: ") 1087 (host "%p host name for user %u: ")
1026 ('port "%p port for user %u and host %h: ")) 1088 (port "%p port for %u@%h: "))
1027 (format "Enter %s (%%u@%%h:%%p): " r))) 1089 (format "Enter %s (%%u@%%h:%%p): " r)))
1028 (prompt (auth-source-format-prompt 1090 (prompt (auth-source-format-prompt
1029 prompt 1091 prompt
@@ -1031,14 +1093,20 @@ See `auth-source-search' for details on SPEC."
1031 (?h ,(aget printable-defaults 'host)) 1093 (?h ,(aget printable-defaults 'host))
1032 (?p ,(aget printable-defaults 'port)))))) 1094 (?p ,(aget printable-defaults 'port))))))
1033 1095
1034 ;; store the data, prompting for the password if needed 1096 ;; Store the data, prompting for the password if needed.
1035 (setq data 1097 (setq data
1036 (cond 1098 (cond
1037 ((and (null data) (eq r 'secret)) 1099 ((and (null data) (eq r 'secret))
1038 ;; special case prompt for passwords 1100 ;; Special case prompt for passwords.
1039 (read-passwd prompt)) 1101 (read-passwd prompt))
1040 ((null data) 1102 ((null data)
1041 (read-string prompt default)) 1103 (when default
1104 (setq prompt
1105 (if (string-match ": *\\'" prompt)
1106 (concat (substring prompt 0 (match-beginning 0))
1107 " (default " default "): ")
1108 (concat prompt "(default " default ") "))))
1109 (read-string prompt nil nil default))
1042 (t (or data default)))) 1110 (t (or data default))))
1043 1111
1044 (when data 1112 (when data
@@ -1049,7 +1117,7 @@ See `auth-source-search' for details on SPEC."
1049 (lambda () data)) 1117 (lambda () data))
1050 data)))) 1118 data))))
1051 1119
1052 ;; when r is not an empty string... 1120 ;; When r is not an empty string...
1053 (when (and (stringp data) 1121 (when (and (stringp data)
1054 (< 0 (length data))) 1122 (< 0 (length data)))
1055 ;; this function is not strictly necessary but I think it 1123 ;; this function is not strictly necessary but I think it
@@ -1062,79 +1130,99 @@ See `auth-source-search' for details on SPEC."
1062 (if (zerop (length add)) "" " ") 1130 (if (zerop (length add)) "" " ")
1063 ;; remap auth-source tokens to netrc 1131 ;; remap auth-source tokens to netrc
1064 (case r 1132 (case r
1065 ('user "login") 1133 (user "login")
1066 ('host "machine") 1134 (host "machine")
1067 ('secret "password") 1135 (secret "password")
1068 ('port "port") ; redundant but clearer 1136 (port "port") ; redundant but clearer
1069 (t (symbol-name r))) 1137 (t (symbol-name r)))
1070 ;; the value will be printed in %S format 1138 ;; the value will be printed in %S format
1071 data)))) 1139 data))))
1072 (setq add (concat add (funcall printer))))))) 1140 (setq add (concat add (funcall printer)))))))
1073 1141
1074 (with-temp-buffer 1142 (plist-put
1075 (when (file-exists-p file) 1143 artificial
1076 (insert-file-contents file)) 1144 :save-function
1077 (when auth-source-gpg-encrypt-to 1145 (lexical-let ((file file)
1078 ;; (see bug#7487) making `epa-file-encrypt-to' local to 1146 (add add))
1079 ;; this buffer lets epa-file skip the key selection query 1147 (lambda () (auth-source-netrc-saver file add))))
1080 ;; (see the `local-variable-p' check in 1148
1081 ;; `epa-file-write-region'). 1149 (list artificial)))
1082 (unless (local-variable-p 'epa-file-encrypt-to (current-buffer)) 1150
1083 (make-local-variable 'epa-file-encrypt-to)) 1151;;(funcall (plist-get (nth 0 (auth-source-search :host '("nonesuch2") :user "tzz" :port "imap" :create t :max 1)) :save-function))
1084 (if (listp auth-source-gpg-encrypt-to) 1152(defun auth-source-netrc-saver (file add)
1085 (setq epa-file-encrypt-to auth-source-gpg-encrypt-to))) 1153 "Save a line ADD in FILE, prompting along the way.
1086 (goto-char (point-max)) 1154Respects `auth-source-save-behavior'. Uses
1087 1155`auth-source-netrc-cache' to avoid prompting more than once."
1088 ;; ask AFTER we've successfully opened the file 1156 (let* ((key (format "%s %s" file (rfc2104-hash 'md5 64 16 file add)))
1089 (let ((prompt (format "Save auth info to file %s? %s: " 1157 (cached (assoc key auth-source-netrc-cache)))
1090 file 1158
1091 "y/n/N/e/?")) 1159 (if cached
1092 (done (not (eq auth-source-save-behavior 'ask))) 1160 (auth-source-do-trivia
1093 (bufname "*auth-source Help*") 1161 "auth-source-netrc-saver: found previous run for key %s, returning"
1094 k) 1162 key)
1095 (while (not done) 1163 (with-temp-buffer
1096 (message "%s" prompt) 1164 (when (file-exists-p file)
1097 (setq k (read-char)) 1165 (insert-file-contents file))
1098 (case k 1166 (when auth-source-gpg-encrypt-to
1099 (?y (setq done t)) 1167 ;; (see bug#7487) making `epa-file-encrypt-to' local to
1100 (?? (save-excursion 1168 ;; this buffer lets epa-file skip the key selection query
1101 (with-output-to-temp-buffer bufname 1169 ;; (see the `local-variable-p' check in
1102 (princ 1170 ;; `epa-file-write-region').
1103 (concat "(y)es, save\n" 1171 (unless (local-variable-p 'epa-file-encrypt-to (current-buffer))
1104 "(n)o but use the info\n" 1172 (make-local-variable 'epa-file-encrypt-to))
1105 "(N)o and don't ask to save again\n" 1173 (if (listp auth-source-gpg-encrypt-to)
1106 "(e)dit the line\n" 1174 (setq epa-file-encrypt-to auth-source-gpg-encrypt-to)))
1107 "(?) for help as you can see.\n")) 1175 ;; we want the new data to be found first, so insert at beginning
1108 (set-buffer standard-output) 1176 (goto-char (point-min))
1109 (help-mode)))) 1177
1110 (?n (setq add "" 1178 ;; Ask AFTER we've successfully opened the file.
1111 done t)) 1179 (let ((prompt (format "Save auth info to file %s? " file))
1112 (?N (setq add "" 1180 (done (not (eq auth-source-save-behavior 'ask)))
1113 done t 1181 (bufname "*auth-source Help*")
1114 auth-source-save-behavior nil)) 1182 k)
1115 (?e (setq add (read-string "Line to add: " add))) 1183 (while (not done)
1116 (t nil))) 1184 (setq k (auth-source-read-char-choice prompt '(?y ?n ?N ?e ??)))
1117 1185 (case k
1118 (when (get-buffer-window bufname) 1186 (?y (setq done t))
1119 (delete-window (get-buffer-window bufname))) 1187 (?? (save-excursion
1120 1188 (with-output-to-temp-buffer bufname
1121 ;; make sure the info is not saved 1189 (princ
1122 (when (null auth-source-save-behavior) 1190 (concat "(y)es, save\n"
1123 (setq add "")) 1191 "(n)o but use the info\n"
1124 1192 "(N)o and don't ask to save again\n"
1125 (when (< 0 (length add)) 1193 "(e)dit the line\n"
1126 (progn 1194 "(?) for help as you can see.\n"))
1127 (unless (bolp) 1195 ;; Why? Doesn't with-output-to-temp-buffer already do
1128 (insert "\n")) 1196 ;; the exact same thing anyway? --Stef
1129 (insert add "\n") 1197 (set-buffer standard-output)
1130 (write-region (point-min) (point-max) file nil 'silent) 1198 (help-mode))))
1131 (auth-source-do-warn 1199 (?n (setq add ""
1132 "auth-source-netrc-create: wrote 1 new line to %s" 1200 done t))
1133 file) 1201 (?N (setq add ""
1134 nil)) 1202 done t
1135 1203 auth-source-save-behavior nil))
1136 (when (eq done t) 1204 (?e (setq add (read-string "Line to add: " add)))
1137 (list artificial)))))) 1205 (t nil)))
1206
1207 (when (get-buffer-window bufname)
1208 (delete-window (get-buffer-window bufname)))
1209
1210 ;; Make sure the info is not saved.
1211 (when (null auth-source-save-behavior)
1212 (setq add ""))
1213
1214 (when (< 0 (length add))
1215 (progn
1216 (unless (bolp)
1217 (insert "\n"))
1218 (insert add "\n")
1219 (write-region (point-min) (point-max) file nil 'silent)
1220 (auth-source-do-debug
1221 "auth-source-netrc-create: wrote 1 new line to %s"
1222 file)
1223 (message "Saved new authentication information to %s" file)
1224 nil))))
1225 (aput 'auth-source-netrc-cache key "ran"))))
1138 1226
1139;;; Backend specific parsing: Secrets API backend 1227;;; Backend specific parsing: Secrets API backend
1140 1228
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index c64138b43d7..7c7e0531926 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -44,6 +44,7 @@
44(require 'wid-edit) 44(require 'wid-edit)
45(require 'mm-uu) 45(require 'mm-uu)
46(require 'message) 46(require 'message)
47(require 'mouse)
47 48
48(autoload 'gnus-msg-mail "gnus-msg" nil t) 49(autoload 'gnus-msg-mail "gnus-msg" nil t)
49(autoload 'gnus-button-mailto "gnus-msg") 50(autoload 'gnus-button-mailto "gnus-msg")
@@ -2337,10 +2338,12 @@ long lines if and only if arg is positive."
2337 (let ((start (point))) 2338 (let ((start (point)))
2338 (insert "X-Boundary: ") 2339 (insert "X-Boundary: ")
2339 (gnus-add-text-properties start (point) '(invisible t intangible t)) 2340 (gnus-add-text-properties start (point) '(invisible t intangible t))
2340 (insert (let (str) 2341 (insert (let (str (max (window-width)))
2341 (while (>= (window-width) (length str)) 2342 (if (featurep 'xemacs)
2343 (setq max (1- max)))
2344 (while (>= max (length str))
2342 (setq str (concat str gnus-body-boundary-delimiter))) 2345 (setq str (concat str gnus-body-boundary-delimiter)))
2343 (substring str 0 (window-width))) 2346 (substring str 0 max))
2344 "\n") 2347 "\n")
2345 (gnus-put-text-property start (point) 'gnus-decoration 'header))))) 2348 (gnus-put-text-property start (point) 'gnus-decoration 'header)))))
2346 2349
@@ -3074,10 +3077,7 @@ images if any to the browser, and deletes them when exiting the group
3074The `gnus-list-identifiers' variable specifies what to do." 3077The `gnus-list-identifiers' variable specifies what to do."
3075 (interactive) 3078 (interactive)
3076 (let ((inhibit-point-motion-hooks t) 3079 (let ((inhibit-point-motion-hooks t)
3077 (regexp (or (gnus-parameter-list-identifier gnus-newsgroup-name) 3080 (regexp (gnus-group-get-list-identifiers gnus-newsgroup-name))
3078 (if (consp gnus-list-identifiers)
3079 (mapconcat 'identity gnus-list-identifiers " *\\|")
3080 gnus-list-identifiers)))
3081 (inhibit-read-only t)) 3081 (inhibit-read-only t))
3082 (when regexp 3082 (when regexp
3083 (save-excursion 3083 (save-excursion
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 9ed3cf02a49..c265538e19c 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -697,7 +697,8 @@ simple manner.")
697 "M" gnus-group-list-all-matching 697 "M" gnus-group-list-all-matching
698 "l" gnus-group-list-level 698 "l" gnus-group-list-level
699 "c" gnus-group-list-cached 699 "c" gnus-group-list-cached
700 "?" gnus-group-list-dormant) 700 "?" gnus-group-list-dormant
701 "!" gnus-group-list-ticked)
701 702
702(gnus-define-keys (gnus-group-list-limit-map "/" gnus-group-list-map) 703(gnus-define-keys (gnus-group-list-limit-map "/" gnus-group-list-map)
703 "k" gnus-group-list-limit 704 "k" gnus-group-list-limit
@@ -849,7 +850,8 @@ simple manner.")
849 ["List all groups matching..." gnus-group-list-all-matching t] 850 ["List all groups matching..." gnus-group-list-all-matching t]
850 ["List active file" gnus-group-list-active t] 851 ["List active file" gnus-group-list-active t]
851 ["List groups with cached" gnus-group-list-cached t] 852 ["List groups with cached" gnus-group-list-cached t]
852 ["List groups with dormant" gnus-group-list-dormant t]) 853 ["List groups with dormant" gnus-group-list-dormant t]
854 ["List groups with ticked" gnus-group-list-ticked t])
853 ("Sort" 855 ("Sort"
854 ["Default sort" gnus-group-sort-groups t] 856 ["Default sort" gnus-group-sort-groups t]
855 ["Sort by method" gnus-group-sort-groups-by-method t] 857 ["Sort by method" gnus-group-sort-groups-by-method t]
@@ -2313,9 +2315,10 @@ Return the name of the group if selection was successful."
2313 gnus-fetch-old-ephemeral-headers)) 2315 gnus-fetch-old-ephemeral-headers))
2314 (gnus-group-read-group (or number t) t group select-articles)) 2316 (gnus-group-read-group (or number t) t group select-articles))
2315 group) 2317 group)
2316 ;;(error nil)
2317 (quit 2318 (quit
2318 (message "Quit reading the ephemeral group") 2319 (if debug-on-quit
2320 (debug "Quit")
2321 (message "Quit reading the ephemeral group"))
2319 nil))))) 2322 nil)))))
2320 2323
2321(defcustom gnus-gmane-group-download-format 2324(defcustom gnus-gmane-group-download-format
@@ -4535,6 +4538,28 @@ This command may read the active file."
4535 (goto-char (point-min)) 4538 (goto-char (point-min))
4536 (gnus-group-position-point)) 4539 (gnus-group-position-point))
4537 4540
4541(defun gnus-group-list-ticked (level &optional lowest)
4542 "List all groups with ticked articles.
4543If the prefix LEVEL is non-nil, it should be a number that says which
4544level to cut off listing groups.
4545If LOWEST, don't list groups with level lower than LOWEST.
4546
4547This command may read the active file."
4548 (interactive "P")
4549 (when level
4550 (setq level (prefix-numeric-value level)))
4551 (when (or (not level) (>= level gnus-level-zombie))
4552 (gnus-cache-open))
4553 (funcall gnus-group-prepare-function
4554 (or level gnus-level-subscribed)
4555 #'(lambda (info)
4556 (let ((marks (gnus-info-marks info)))
4557 (assq 'tick marks)))
4558 lowest
4559 'ignore)
4560 (goto-char (point-min))
4561 (gnus-group-position-point))
4562
4538(defun gnus-group-listed-groups () 4563(defun gnus-group-listed-groups ()
4539 "Return a list of listed groups." 4564 "Return a list of listed groups."
4540 (let (point groups) 4565 (let (point groups)
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index a67063bb970..ef15a479892 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -270,7 +270,9 @@ If it is down, start it up (again)."
270 server (error-message-string err)) 270 server (error-message-string err))
271 nil) 271 nil)
272 (quit 272 (quit
273 (gnus-message 1 "Quit trying to open server %s" server) 273 (if debug-on-quit
274 (debug "Quit")
275 (gnus-message 1 "Quit trying to open server %s" server))
274 nil))) 276 nil)))
275 open-offline) 277 open-offline)
276 ;; If this hasn't been opened before, we add it to the list. 278 ;; If this hasn't been opened before, we add it to the list.
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index ebfa53f841e..afded87fe37 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -1306,16 +1306,13 @@ for new groups, and subscribe the new groups as zombies."
1306 ((>= level gnus-level-zombie) 1306 ((>= level gnus-level-zombie)
1307 ;; Remove from the hash table. 1307 ;; Remove from the hash table.
1308 (gnus-sethash group nil gnus-newsrc-hashtb) 1308 (gnus-sethash group nil gnus-newsrc-hashtb)
1309 ;; We do not enter foreign groups into the list of dead 1309 (if (= level gnus-level-zombie)
1310 ;; groups. 1310 (push group gnus-zombie-list)
1311 (unless (gnus-group-foreign-p group) 1311 (if (= oldlevel gnus-level-killed)
1312 (if (= level gnus-level-zombie) 1312 ;; Remove from active hashtb.
1313 (push group gnus-zombie-list) 1313 (unintern group gnus-active-hashtb)
1314 (if (= oldlevel gnus-level-killed) 1314 ;; Don't add it into killed-list if it was killed.
1315 ;; Remove from active hashtb. 1315 (push group gnus-killed-list))))
1316 (unintern group gnus-active-hashtb)
1317 ;; Don't add it into killed-list if it was killed.
1318 (push group gnus-killed-list)))))
1319 (t 1316 (t
1320 ;; If the list is to be entered into the newsrc assoc, and 1317 ;; If the list is to be entered into the newsrc assoc, and
1321 ;; it was killed, we have to create an entry in the newsrc 1318 ;; it was killed, we have to create an entry in the newsrc
@@ -1465,9 +1462,10 @@ If SCAN, request a scan of that group as well."
1465 (inline (gnus-request-group group (or dont-sub-check dont-check) 1462 (inline (gnus-request-group group (or dont-sub-check dont-check)
1466 method 1463 method
1467 (gnus-get-info group))) 1464 (gnus-get-info group)))
1468 ;;(error nil)
1469 (quit 1465 (quit
1470 (message "Quit activating %s" group) 1466 (if debug-on-quit
1467 (debug "Quit")
1468 (message "Quit activating %s" group))
1471 nil))) 1469 nil)))
1472 (unless dont-check 1470 (unless dont-check
1473 (setq active (gnus-parse-active)) 1471 (setq active (gnus-parse-active))
@@ -2007,7 +2005,9 @@ If SCAN, request a scan of that group as well."
2007 ;; We catch C-g so that we can continue past servers 2005 ;; We catch C-g so that we can continue past servers
2008 ;; that do not respond. 2006 ;; that do not respond.
2009 (quit 2007 (quit
2010 (message "Quit reading the active file") 2008 (if debug-on-quit
2009 (debug "Quit")
2010 (message "Quit reading the active file"))
2011 nil)))))))) 2011 nil))))))))
2012 2012
2013(defun gnus-read-active-file-1 (method force) 2013(defun gnus-read-active-file-1 (method force)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index a8786e39c7b..29a98b7d11d 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -5510,12 +5510,17 @@ or a straight list of headers."
5510 (cdr (assq number gnus-newsgroup-scored)) 5510 (cdr (assq number gnus-newsgroup-scored))
5511 (memq number gnus-newsgroup-processable)))))) 5511 (memq number gnus-newsgroup-processable))))))
5512 5512
5513(defun gnus-group-get-list-identifiers (group)
5514 "Get list identifier regexp for GROUP."
5515 (or (gnus-parameter-list-identifier group)
5516 (if (consp gnus-list-identifiers)
5517 (mapconcat 'identity gnus-list-identifiers " *\\|")
5518 gnus-list-identifiers)))
5519
5513(defun gnus-summary-remove-list-identifiers () 5520(defun gnus-summary-remove-list-identifiers ()
5514 "Remove list identifiers in `gnus-list-identifiers' from articles in the current group." 5521 "Remove list identifiers in `gnus-list-identifiers' from articles in the current group."
5515 (let ((regexp (if (consp gnus-list-identifiers) 5522 (let ((regexp (gnus-group-get-list-identifiers gnus-newsgroup-name))
5516 (mapconcat 'identity gnus-list-identifiers " *\\|") 5523 changed subject)
5517 gnus-list-identifiers))
5518 changed subject)
5519 (when regexp 5524 (when regexp
5520 (setq regexp (concat "^\\(?:R[Ee]: +\\)*\\(" regexp " *\\)")) 5525 (setq regexp (concat "^\\(?:R[Ee]: +\\)*\\(" regexp " *\\)"))
5521 (dolist (header gnus-newsgroup-headers) 5526 (dolist (header gnus-newsgroup-headers)
@@ -5707,8 +5712,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5707 (when gnus-agent 5712 (when gnus-agent
5708 (gnus-agent-get-undownloaded-list)) 5713 (gnus-agent-get-undownloaded-list))
5709 ;; Remove list identifiers from subject 5714 ;; Remove list identifiers from subject
5710 (when gnus-list-identifiers 5715 (gnus-summary-remove-list-identifiers)
5711 (gnus-summary-remove-list-identifiers))
5712 ;; Check whether auto-expire is to be done in this group. 5716 ;; Check whether auto-expire is to be done in this group.
5713 (setq gnus-newsgroup-auto-expire 5717 (setq gnus-newsgroup-auto-expire
5714 (gnus-group-auto-expirable-p group)) 5718 (gnus-group-auto-expirable-p group))
@@ -5798,7 +5802,8 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5798 5802
5799(defun gnus-articles-to-read (group &optional read-all) 5803(defun gnus-articles-to-read (group &optional read-all)
5800 "Find out what articles the user wants to read." 5804 "Find out what articles the user wants to read."
5801 (let* ((articles 5805 (let* ((only-read-p t)
5806 (articles
5802 ;; Select all articles if `read-all' is non-nil, or if there 5807 ;; Select all articles if `read-all' is non-nil, or if there
5803 ;; are no unread articles. 5808 ;; are no unread articles.
5804 (if (or read-all 5809 (if (or read-all
@@ -5822,6 +5827,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5822 (gnus-uncompress-range (gnus-active group))) 5827 (gnus-uncompress-range (gnus-active group)))
5823 (gnus-cache-articles-in-group group)) 5828 (gnus-cache-articles-in-group group))
5824 ;; Select only the "normal" subset of articles. 5829 ;; Select only the "normal" subset of articles.
5830 (setq only-read-p nil)
5825 (gnus-sorted-nunion 5831 (gnus-sorted-nunion
5826 (gnus-sorted-union gnus-newsgroup-dormant gnus-newsgroup-marked) 5832 (gnus-sorted-union gnus-newsgroup-dormant gnus-newsgroup-marked)
5827 gnus-newsgroup-unreads))) 5833 gnus-newsgroup-unreads)))
@@ -5845,16 +5851,25 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5845 (let* ((cursor-in-echo-area nil) 5851 (let* ((cursor-in-echo-area nil)
5846 (initial (gnus-parameter-large-newsgroup-initial 5852 (initial (gnus-parameter-large-newsgroup-initial
5847 gnus-newsgroup-name)) 5853 gnus-newsgroup-name))
5854 (default (if only-read-p
5855 (or initial gnus-large-newsgroup)
5856 number))
5848 (input 5857 (input
5849 (read-string 5858 (read-string
5850 (format 5859 (if only-read-p
5851 "How many articles from %s (%s %d): " 5860 (format
5852 (gnus-group-decoded-name gnus-newsgroup-name) 5861 "How many articles from %s (available %d, default %d): "
5853 (if initial "max" "default") 5862 (gnus-group-decoded-name
5854 number) 5863 (gnus-group-real-name gnus-newsgroup-name))
5855 (if initial 5864 number default)
5856 (cons (number-to-string initial) 5865 (format
5857 0))))) 5866 "How many articles from %s (%d available): "
5867 (gnus-group-decoded-name
5868 (gnus-group-real-name gnus-newsgroup-name))
5869 default))
5870 nil
5871 nil
5872 (number-to-string default))))
5858 (if (string-match "^[ \t]*$" input) number input))) 5873 (if (string-match "^[ \t]*$" input) number input)))
5859 ((and (> scored marked) (< scored number) 5874 ((and (> scored marked) (< scored number)
5860 (> (- scored number) 20)) 5875 (> (- scored number) 20))
@@ -5862,7 +5877,8 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5862 (read-string 5877 (read-string
5863 (format "%s %s (%d scored, %d total): " 5878 (format "%s %s (%d scored, %d total): "
5864 "How many articles from" 5879 "How many articles from"
5865 (gnus-group-decoded-name group) 5880 (gnus-group-decoded-name
5881 (gnus-group-real-name gnus-newsgroup-name))
5866 scored number)))) 5882 scored number))))
5867 (if (string-match "^[ \t]*$" input) 5883 (if (string-match "^[ \t]*$" input)
5868 number input))) 5884 number input)))
@@ -6564,9 +6580,8 @@ the subject line on."
6564 (1+ (point-at-eol)) 6580 (1+ (point-at-eol))
6565 (gnus-delete-line)))))) 6581 (gnus-delete-line))))))
6566 ;; Remove list identifiers from subject. 6582 ;; Remove list identifiers from subject.
6567 (when gnus-list-identifiers 6583 (let ((gnus-newsgroup-headers (list header)))
6568 (let ((gnus-newsgroup-headers (list header))) 6584 (gnus-summary-remove-list-identifiers))
6569 (gnus-summary-remove-list-identifiers)))
6570 (when old-header 6585 (when old-header
6571 (mail-header-set-number header (mail-header-number old-header))) 6586 (mail-header-set-number header (mail-header-number old-header)))
6572 (setq gnus-newsgroup-sparse 6587 (setq gnus-newsgroup-sparse
@@ -12670,8 +12685,7 @@ returned."
12670 (when gnus-agent 12685 (when gnus-agent
12671 (gnus-agent-get-undownloaded-list)) 12686 (gnus-agent-get-undownloaded-list))
12672 ;; Remove list identifiers from subject 12687 ;; Remove list identifiers from subject
12673 (when gnus-list-identifiers 12688 (gnus-summary-remove-list-identifiers)
12674 (gnus-summary-remove-list-identifiers))
12675 ;; First and last article in this newsgroup. 12689 ;; First and last article in this newsgroup.
12676 (when gnus-newsgroup-headers 12690 (when gnus-newsgroup-headers
12677 (setq gnus-newsgroup-begin 12691 (setq gnus-newsgroup-begin
diff --git a/lisp/gnus/gnus-sync.el b/lisp/gnus/gnus-sync.el
index 892b10a0d0e..fbdacdd2fbe 100644
--- a/lisp/gnus/gnus-sync.el
+++ b/lisp/gnus/gnus-sync.el
@@ -25,7 +25,8 @@
25;; This is the gnus-sync.el package. 25;; This is the gnus-sync.el package.
26 26
27;; It's due for a rewrite using gnus-after-set-mark-hook and 27;; It's due for a rewrite using gnus-after-set-mark-hook and
28;; gnus-before-update-mark-hook. Until then please consider it 28;; gnus-before-update-mark-hook, and my plan is to do this once No
29;; Gnus development is done. Until then please consider it
29;; experimental. 30;; experimental.
30 31
31;; Put this in your startup file (~/.gnus.el for instance) 32;; Put this in your startup file (~/.gnus.el for instance)
@@ -42,7 +43,8 @@
42 43
43;; TODO: 44;; TODO:
44 45
45;; - after gnus-sync-read, the message counts are wrong 46;; - after gnus-sync-read, the message counts are wrong. So it's not
47;; run automatically, you have to call it with M-x gnus-sync-read
46 48
47;; - use gnus-after-set-mark-hook and gnus-before-update-mark-hook to 49;; - use gnus-after-set-mark-hook and gnus-before-update-mark-hook to
48;; catch the mark updates 50;; catch the mark updates
@@ -220,13 +222,13 @@ synchronized, I believe). Also see `gnus-variable-list'."
220 "Install the sync hooks." 222 "Install the sync hooks."
221 (interactive) 223 (interactive)
222 ;; (add-hook 'gnus-get-new-news-hook 'gnus-sync-read) 224 ;; (add-hook 'gnus-get-new-news-hook 'gnus-sync-read)
223 (add-hook 'gnus-save-newsrc-hook 'gnus-sync-save) 225 ;; (add-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read)
224 (add-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read)) 226 (add-hook 'gnus-save-newsrc-hook 'gnus-sync-save))
225 227
226(defun gnus-sync-unload-hook () 228(defun gnus-sync-unload-hook ()
227 "Uninstall the sync hooks." 229 "Uninstall the sync hooks."
228 (interactive) 230 (interactive)
229 ;; (remove-hook 'gnus-get-new-news-hook 'gnus-sync-read) 231 (remove-hook 'gnus-get-new-news-hook 'gnus-sync-read)
230 (remove-hook 'gnus-save-newsrc-hook 'gnus-sync-save) 232 (remove-hook 'gnus-save-newsrc-hook 'gnus-sync-save)
231 (remove-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read)) 233 (remove-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read))
232 234
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 42dbd5948cf..3f66b45aaab 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -672,11 +672,9 @@ If N, return the Nth ancestor instead."
672 (when (string-match "\\(<[^<]+>\\)[ \t]*\\'" references) 672 (when (string-match "\\(<[^<]+>\\)[ \t]*\\'" references)
673 (match-string 1 references)))))) 673 (match-string 1 references))))))
674 674
675(defun gnus-buffer-live-p (buffer) 675(defsubst gnus-buffer-live-p (buffer)
676 "Say whether BUFFER is alive or not." 676 "Say whether BUFFER is alive or not."
677 (and buffer 677 (and buffer (buffer-live-p (get-buffer buffer))))
678 (get-buffer buffer)
679 (buffer-name (get-buffer buffer))))
680 678
681(defun gnus-horizontal-recenter () 679(defun gnus-horizontal-recenter ()
682 "Recenter the current buffer horizontally." 680 "Recenter the current buffer horizontally."
diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el
index 156f9a020fd..c38f57d96cb 100644
--- a/lisp/gnus/gnus-win.el
+++ b/lisp/gnus/gnus-win.el
@@ -268,8 +268,10 @@ See the Gnus manual for an explanation of the syntax used.")
268 (error "Invalid buffer type: %s" type)) 268 (error "Invalid buffer type: %s" type))
269 (let ((buf (gnus-get-buffer-create 269 (let ((buf (gnus-get-buffer-create
270 (gnus-window-to-buffer-helper buffer)))) 270 (gnus-window-to-buffer-helper buffer))))
271 (if (eq buf (window-buffer (selected-window))) (set-buffer buf) 271 (when (buffer-name buf)
272 (switch-to-buffer buf))) 272 (if (eq buf (window-buffer (selected-window)))
273 (set-buffer buf)
274 (switch-to-buffer buf))))
273 (when (memq 'frame-focus split) 275 (when (memq 'frame-focus split)
274 (setq gnus-window-frame-focus window)) 276 (setq gnus-window-frame-focus window))
275 ;; We return the window if it has the `point' spec. 277 ;; We return the window if it has the `point' spec.
diff --git a/lisp/gnus/gravatar.el b/lisp/gnus/gravatar.el
index 0c97080d847..4b0c9a16283 100644
--- a/lisp/gnus/gravatar.el
+++ b/lisp/gnus/gravatar.el
@@ -129,8 +129,10 @@ You can provide a list of argument to pass to CB in CBARGS."
129 "Retrieve MAIL-ADDRESS gravatar and returns it." 129 "Retrieve MAIL-ADDRESS gravatar and returns it."
130 (let ((url (gravatar-build-url mail-address))) 130 (let ((url (gravatar-build-url mail-address)))
131 (if (gravatar-cache-expired url) 131 (if (gravatar-cache-expired url)
132 (with-current-buffer (url-retrieve-synchronously url) 132 (with-current-buffer (if (featurep 'xemacs)
133 (when gravatar-automatic-caching 133 (url-retrieve url)
134 (url-retrieve-synchronously url))
135 (when gravatar-automatic-caching
134 (url-store-in-cache (current-buffer))) 136 (url-store-in-cache (current-buffer)))
135 (let ((data (gravatar-data->image))) 137 (let ((data (gravatar-data->image)))
136 (kill-buffer (current-buffer)) 138 (kill-buffer (current-buffer))
diff --git a/lisp/gnus/gssapi.el b/lisp/gnus/gssapi.el
new file mode 100644
index 00000000000..3765fb84ee8
--- /dev/null
+++ b/lisp/gnus/gssapi.el
@@ -0,0 +1,105 @@
1;;; gssapi.el --- GSSAPI/Kerberos 5 interface for Emacs
2
3;; Copyright (C) 2011 Free Software Foundation, Inc.
4
5;; Author: Simon Josefsson <simon@josefsson.org>
6;; Lars Magne Ingebrigtsen <larsi@gnus.org>
7;; Keywords: network
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software: you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation, either version 3 of the License, or
14;; (at your option) any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
24;;; Commentary:
25
26;;; Code:
27
28(require 'format-spec)
29
30(defcustom gssapi-program (list
31 (concat "gsasl %s %p "
32 "--mechanism GSSAPI "
33 "--authentication-id %l")
34 "imtest -m gssapi -u %l -p %p %s")
35 "List of strings containing commands for GSSAPI (krb5) authentication.
36%s is replaced with server hostname, %p with port to connect to, and
37%l with the value of `imap-default-user'. The program should accept
38IMAP commands on stdin and return responses to stdout. Each entry in
39the list is tried until a successful connection is made."
40 :group 'network
41 :type '(repeat string))
42
43(defun open-gssapi-stream (name buffer server port)
44 (let ((cmds gssapi-program)
45 cmd done)
46 (with-current-buffer buffer
47 (while (and (not done)
48 (setq cmd (pop cmds)))
49 (message "Opening GSSAPI connection with `%s'..." cmd)
50 (erase-buffer)
51 (let* ((coding-system-for-read 'binary)
52 (coding-system-for-write 'binary)
53 (process (start-process
54 name buffer shell-file-name shell-command-switch
55 (format-spec
56 cmd
57 (format-spec-make
58 ?s server
59 ?p (number-to-string port)
60 ?l imap-default-user))))
61 response)
62 (when process
63 (while (and (memq (process-status process) '(open run))
64 (goto-char (point-min))
65 ;; Athena IMTEST can output SSL verify errors
66 (or (while (looking-at "^verify error:num=")
67 (forward-line))
68 t)
69 (or (while (looking-at "^TLS connection established")
70 (forward-line))
71 t)
72 ;; cyrus 1.6.x (13? < x <= 22) queries capabilities
73 (or (while (looking-at "^C:")
74 (forward-line))
75 t)
76 ;; cyrus 1.6 imtest print "S: " before server greeting
77 (or (not (looking-at "S: "))
78 (forward-char 3)
79 t)
80 ;; GNU SASL may print 'Trying ...' first.
81 (or (not (looking-at "Trying "))
82 (forward-line)
83 t)
84 (not (and (looking-at "\\* \\(OK\\|PREAUTH\\|BYE\\) ")
85 ;; success in imtest 1.6:
86 (re-search-forward
87 (concat "^\\(\\(Authenticat.*\\)\\|\\("
88 "Client authentication "
89 "finished.*\\)\\)")
90 nil t)
91 (setq response (match-string 1)))))
92 (accept-process-output process 1)
93 (sit-for 1))
94 (erase-buffer)
95 (message "GSSAPI IMAP connection: %s" (or response "failed"))
96 (if (and response (let ((case-fold-search nil))
97 (not (string-match "failed" response))))
98 (setq done process)
99 (delete-process process)
100 nil))))
101 done)))
102
103(provide 'gssapi)
104
105;;; gssapi.el ends here
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 08c59b00bfc..bb9215aca7c 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -49,6 +49,7 @@
49(require 'mail-parse) 49(require 'mail-parse)
50(require 'mml) 50(require 'mml)
51(require 'rfc822) 51(require 'rfc822)
52(require 'format-spec)
52 53
53(autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/ 54(autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
54 55
@@ -438,7 +439,10 @@ whitespace)."
438 :group 'message-various) 439 :group 'message-various)
439 440
440(defcustom message-elide-ellipsis "\n[...]\n\n" 441(defcustom message-elide-ellipsis "\n[...]\n\n"
441 "*The string which is inserted for elided text." 442 "*The string which is inserted for elided text.
443This is a format-spec string, and you can use %l to say how many
444lines were removed, and %c to say how many characters were
445removed."
442 :type 'string 446 :type 'string
443 :link '(custom-manual "(message)Various Commands") 447 :link '(custom-manual "(message)Various Commands")
444 :group 'message-various) 448 :group 'message-various)
@@ -3535,8 +3539,12 @@ Note that this should not be used in newsgroups."
3535An ellipsis (from `message-elide-ellipsis') will be inserted where the 3539An ellipsis (from `message-elide-ellipsis') will be inserted where the
3536text was killed." 3540text was killed."
3537 (interactive "r") 3541 (interactive "r")
3538 (kill-region b e) 3542 (let ((lines (count-lines b e))
3539 (insert message-elide-ellipsis)) 3543 (chars (- e b)))
3544 (kill-region b e)
3545 (insert (format-spec message-elide-ellipsis
3546 `((?l . ,lines)
3547 (?c . ,chars))))))
3540 3548
3541(defvar message-caesar-translation-table nil) 3549(defvar message-caesar-translation-table nil)
3542 3550
@@ -3749,12 +3757,12 @@ prefix, and don't delete any headers."
3749 (insert-before-markers ?\n) 3757 (insert-before-markers ?\n)
3750 (goto-char pt)))) 3758 (goto-char pt))))
3751 (case message-cite-reply-position 3759 (case message-cite-reply-position
3752 ('above 3760 (above
3753 (message-goto-body) 3761 (message-goto-body)
3754 (insert body-text) 3762 (insert body-text)
3755 (insert (if (bolp) "\n" "\n\n")) 3763 (insert (if (bolp) "\n" "\n\n"))
3756 (message-goto-body)) 3764 (message-goto-body))
3757 ('below 3765 (below
3758 (message-goto-signature))) 3766 (message-goto-signature)))
3759 ;; Add a `message-setup-very-last-hook' here? 3767 ;; Add a `message-setup-very-last-hook' here?
3760 ;; Add `gnus-article-highlight-citation' here? 3768 ;; Add `gnus-article-highlight-citation' here?
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 14b44198303..4f7b5ed26b3 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -158,6 +158,12 @@ This can be either \"inline\" or \"attachment\".")
158 mm-uu-diff-extract 158 mm-uu-diff-extract
159 nil 159 nil
160 mm-uu-diff-test) 160 mm-uu-diff-test)
161 (diff
162 "^=== modified file "
163 nil
164 mm-uu-diff-extract
165 nil
166 mm-uu-diff-test)
161 (git-format-patch 167 (git-format-patch
162 "^diff --git " 168 "^diff --git "
163 "^-- " 169 "^-- "
@@ -699,6 +705,8 @@ Assume text has been decoded if DECODED is non-nil."
699 ;; Mutt still uses application/pgp even though 705 ;; Mutt still uses application/pgp even though
700 ;; it has already been withdrawn. 706 ;; it has already been withdrawn.
701 (string-match "\\`text/\\|\\`application/pgp\\'" type) 707 (string-match "\\`text/\\|\\`application/pgp\\'" type)
708 (equal (car (mm-handle-disposition handle))
709 "inline")
702 (setq 710 (setq
703 children 711 children
704 (with-current-buffer buffer 712 (with-current-buffer buffer
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index aa4ecbc3b0f..bcbe7b678d5 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -279,16 +279,21 @@ textual parts.")
279 (current-buffer))) 279 (current-buffer)))
280 280
281(defun nnimap-credentials (address ports) 281(defun nnimap-credentials (address ports)
282 (let ((found (nth 0 (auth-source-search :max 1 282 (let* ((auth-source-creation-prompts
283 :host address 283 '((user . "IMAP user at %h: ")
284 :port ports 284 (secret . "IMAP password for %u@%h: ")))
285 :create t)))) 285 (found (nth 0 (auth-source-search :max 1
286 :host address
287 :port ports
288 :require '(:user :secret)
289 :create t))))
286 (if found 290 (if found
287 (list (plist-get found :user) 291 (list (plist-get found :user)
288 (let ((secret (plist-get found :secret))) 292 (let ((secret (plist-get found :secret)))
289 (if (functionp secret) 293 (if (functionp secret)
290 (funcall secret) 294 (funcall secret)
291 secret))) 295 secret))
296 (plist-get found :save-function))
292 nil))) 297 nil)))
293 298
294(defun nnimap-keepalive () 299(defun nnimap-keepalive ()
@@ -335,6 +340,7 @@ textual parts.")
335 (ports 340 (ports
336 (cond 341 (cond
337 ((or (eq nnimap-stream 'network) 342 ((or (eq nnimap-stream 'network)
343 (eq nnimap-stream 'network-only)
338 (eq nnimap-stream 'starttls)) 344 (eq nnimap-stream 'starttls))
339 (nnheader-message 7 "Opening connection to %s..." 345 (nnheader-message 7 "Opening connection to %s..."
340 nnimap-address) 346 nnimap-address)
@@ -396,7 +402,12 @@ textual parts.")
396 (let ((nnimap-inhibit-logging t)) 402 (let ((nnimap-inhibit-logging t))
397 (setq login-result 403 (setq login-result
398 (nnimap-login (car credentials) (cadr credentials)))) 404 (nnimap-login (car credentials) (cadr credentials))))
399 (unless (car login-result) 405 (if (car login-result)
406 ;; save the credentials if a save function exists
407 ;; (such a function will only be passed if a new
408 ;; token was created)
409 (when (functionp (nth 2 credentials))
410 (funcall (nth 2 credentials)))
400 ;; If the login failed, then forget the credentials 411 ;; If the login failed, then forget the credentials
401 ;; that are now possibly cached. 412 ;; that are now possibly cached.
402 (dolist (host (list (nnoo-current-server 'nnimap) 413 (dolist (host (list (nnoo-current-server 'nnimap)
@@ -1442,6 +1453,11 @@ textual parts.")
1442 ;; Change \Delete etc to %Delete, so that the reader can read it. 1453 ;; Change \Delete etc to %Delete, so that the reader can read it.
1443 (subst-char-in-region (point-min) (point-max) 1454 (subst-char-in-region (point-min) (point-max)
1444 ?\\ ?% t) 1455 ?\\ ?% t)
1456 ;; Remove any MODSEQ entries in the buffer, because they may contain
1457 ;; numbers that are too large for 32-bit Emacsen.
1458 (while (re-search-forward " MODSEQ ([0-9]+)" nil t)
1459 (replace-match "" t t))
1460 (goto-char (point-min))
1445 (let (start end articles groups uidnext elems permanent-flags 1461 (let (start end articles groups uidnext elems permanent-flags
1446 uidvalidity vanished highestmodseq) 1462 uidvalidity vanished highestmodseq)
1447 (dolist (elem sequences) 1463 (dolist (elem sequences)
@@ -1481,9 +1497,9 @@ textual parts.")
1481 (match-string 1))) 1497 (match-string 1)))
1482 (goto-char start) 1498 (goto-char start)
1483 (setq highestmodseq 1499 (setq highestmodseq
1484 (and (search-forward "HIGHESTMODSEQ " 1500 (and (re-search-forward "HIGHESTMODSEQ \\([0-9]+\\)"
1485 (or end (point-min)) t) 1501 (or end (point-min)) t)
1486 (read (current-buffer)))) 1502 (match-string 1)))
1487 (goto-char end) 1503 (goto-char end)
1488 (forward-line -1)) 1504 (forward-line -1))
1489 ;; The UID FETCH FLAGS was successful. 1505 ;; The UID FETCH FLAGS was successful.
@@ -1497,18 +1513,7 @@ textual parts.")
1497 (goto-char end)) 1513 (goto-char end))
1498 (while (re-search-forward "^\\* [0-9]+ FETCH " start t) 1514 (while (re-search-forward "^\\* [0-9]+ FETCH " start t)
1499 (let ((p (point))) 1515 (let ((p (point)))
1500 ;; FIXME: For FETCH lines like "* 2971 FETCH (FLAGS (%Recent) UID 1516 (setq elems (read (current-buffer)))
1501 ;; 12509 MODSEQ (13419098521433281274))" we get an
1502 ;; overflow-error. The handler simply deletes that large number
1503 ;; and reads again. But maybe there's a better fix...
1504 (setq elems (condition-case nil (read (current-buffer))
1505 (overflow-error
1506 ;; After an overflow-error, point is just after
1507 ;; the too large number. So delete it and try
1508 ;; again.
1509 (delete-region (point) (progn (backward-word) (point)))
1510 (goto-char p)
1511 (read (current-buffer)))))
1512 (push (cons (cadr (memq 'UID elems)) 1517 (push (cons (cadr (memq 'UID elems))
1513 (cadr (memq 'FLAGS elems))) 1518 (cadr (memq 'FLAGS elems)))
1514 articles))) 1519 articles)))
@@ -1545,10 +1550,11 @@ textual parts.")
1545 refid refid value))))) 1550 refid refid value)))))
1546 (result (with-current-buffer (nnimap-buffer) 1551 (result (with-current-buffer (nnimap-buffer)
1547 (nnimap-command "UID SEARCH %s" cmd)))) 1552 (nnimap-command "UID SEARCH %s" cmd))))
1548 (gnus-fetch-headers 1553 (when result
1549 (and (car result) (delete 0 (mapcar #'string-to-number 1554 (gnus-fetch-headers
1550 (cdr (assoc "SEARCH" (cdr result)))))) 1555 (and (car result) (delete 0 (mapcar #'string-to-number
1551 nil t))) 1556 (cdr (assoc "SEARCH" (cdr result))))))
1557 nil t))))
1552 1558
1553(defun nnimap-possibly-change-group (group server) 1559(defun nnimap-possibly-change-group (group server)
1554 (let ((open-result t)) 1560 (let ((open-result t))
@@ -1663,6 +1669,8 @@ textual parts.")
1663 (goto-char (point-max))) 1669 (goto-char (point-max)))
1664 openp) 1670 openp)
1665 (quit 1671 (quit
1672 (when debug-on-quit
1673 (debug "Quit"))
1666 ;; The user hit C-g while we were waiting: kill the process, in case 1674 ;; The user hit C-g while we were waiting: kill the process, in case
1667 ;; it's a gnutls-cli process that's stuck (tends to happen a lot behind 1675 ;; it's a gnutls-cli process that's stuck (tends to happen a lot behind
1668 ;; NAT routers). 1676 ;; NAT routers).
@@ -1754,11 +1762,15 @@ textual parts.")
1754 (format "(UID %s%s)" 1762 (format "(UID %s%s)"
1755 (format 1763 (format
1756 (if (nnimap-ver4-p) 1764 (if (nnimap-ver4-p)
1757 "BODY.PEEK[HEADER] BODY.PEEK" 1765 "BODY.PEEK"
1758 "RFC822.PEEK")) 1766 "RFC822.PEEK"))
1759 (if nnimap-split-download-body-default 1767 (cond
1760 "[]" 1768 (nnimap-split-download-body-default
1761 "[1]"))) 1769 "[]")
1770 ((nnimap-ver4-p)
1771 "[HEADER]")
1772 (t
1773 "[1]"))))
1762 t)) 1774 t))
1763 1775
1764(defun nnimap-split-incoming-mail () 1776(defun nnimap-split-incoming-mail ()
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index bb9695ebb72..113137a0046 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -53,17 +53,17 @@ fit these criteria."
53 :group 'shr 53 :group 'shr
54 :type 'regexp) 54 :type 'regexp)
55 55
56(defcustom shr-table-horizontal-line ?- 56(defcustom shr-table-horizontal-line ?
57 "Character used to draw horizontal table lines." 57 "Character used to draw horizontal table lines."
58 :group 'shr 58 :group 'shr
59 :type 'character) 59 :type 'character)
60 60
61(defcustom shr-table-vertical-line ?| 61(defcustom shr-table-vertical-line ?
62 "Character used to draw vertical table lines." 62 "Character used to draw vertical table lines."
63 :group 'shr 63 :group 'shr
64 :type 'character) 64 :type 'character)
65 65
66(defcustom shr-table-corner ?+ 66(defcustom shr-table-corner ?
67 "Character used to draw table corners." 67 "Character used to draw table corners."
68 :group 'shr 68 :group 'shr
69 :type 'character) 69 :type 'character)
@@ -113,6 +113,15 @@ cid: URL as the argument.")
113 113
114;; Public functions and commands. 114;; Public functions and commands.
115 115
116(defun shr-visit-file (file)
117 (interactive "fHTML file name: ")
118 (pop-to-buffer "*html*")
119 (erase-buffer)
120 (shr-insert-document
121 (with-temp-buffer
122 (insert-file-contents file)
123 (libxml-parse-html-region (point-min) (point-max)))))
124
116;;;###autoload 125;;;###autoload
117(defun shr-insert-document (dom) 126(defun shr-insert-document (dom)
118 (setq shr-content-cache nil) 127 (setq shr-content-cache nil)
diff --git a/lisp/gnus/sieve-manage.el b/lisp/gnus/sieve-manage.el
index c9a0df20590..5c2e775a211 100644
--- a/lisp/gnus/sieve-manage.el
+++ b/lisp/gnus/sieve-manage.el
@@ -275,9 +275,10 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
275 (with-current-buffer buffer 275 (with-current-buffer buffer
276 (let* ((auth-info (auth-source-search :host sieve-manage-server 276 (let* ((auth-info (auth-source-search :host sieve-manage-server
277 :port "sieve" 277 :port "sieve"
278 :max 1)) 278 :max 1
279 (user-name (plist-get (nth 0 auth-info) :user)) 279 :create t))
280 (user-password (plist-get (nth 0 auth-info) :secret)) 280 (user-name (or (plist-get (nth 0 auth-info) :user) ""))
281 (user-password (or (plist-get (nth 0 auth-info) :secret) ""))
281 (user-password (if (functionp user-password) 282 (user-password (if (functionp user-password)
282 (funcall user-password) 283 (funcall user-password)
283 user-password)) 284 user-password))
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 8209cdebd3c..392e894965c 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -575,6 +575,7 @@ If ANY-SYMBOL is non-nil, don't insist the symbol be bound."
575 (with-syntax-table emacs-lisp-mode-syntax-table 575 (with-syntax-table emacs-lisp-mode-syntax-table
576 (or (condition-case () 576 (or (condition-case ()
577 (save-excursion 577 (save-excursion
578 (skip-chars-forward "'")
578 (or (not (zerop (skip-syntax-backward "_w"))) 579 (or (not (zerop (skip-syntax-backward "_w")))
579 (eq (char-syntax (following-char)) ?w) 580 (eq (char-syntax (following-char)) ?w)
580 (eq (char-syntax (following-char)) ?_) 581 (eq (char-syntax (following-char)) ?_)
diff --git a/lisp/help.el b/lisp/help.el
index 9fcb06c559f..e148e5ef6ab 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -871,7 +871,17 @@ whose documentation describes the minor mode."
871 (let ((start (point))) 871 (let ((start (point)))
872 (insert (format-mode-line mode nil nil buffer)) 872 (insert (format-mode-line mode nil nil buffer))
873 (add-text-properties start (point) '(face bold))))) 873 (add-text-properties start (point) '(face bold)))))
874 (princ " mode:\n") 874 (princ " mode")
875 (let* ((mode major-mode)
876 (file-name (find-lisp-object-file-name mode nil)))
877 (when file-name
878 (princ (concat " defined in `" (file-name-nondirectory file-name) "'"))
879 ;; Make a hyperlink to the library.
880 (with-current-buffer standard-output
881 (save-excursion
882 (re-search-backward "`\\([^`']+\\)'" nil t)
883 (help-xref-button 1 'help-function-def mode file-name)))))
884 (princ ":\n")
875 (princ (documentation major-mode))))) 885 (princ (documentation major-mode)))))
876 ;; For the sake of IELM and maybe others 886 ;; For the sake of IELM and maybe others
877 nil) 887 nil)
diff --git a/lisp/ido.el b/lisp/ido.el
index 2e67e367a8f..2a5c7cf2f0e 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1983,7 +1983,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1983 (setq ido-exit nil) 1983 (setq ido-exit nil)
1984 (setq ido-final-text 1984 (setq ido-final-text
1985 (catch 'ido 1985 (catch 'ido
1986 (completing-read 1986 (completing-read-default
1987 (ido-make-prompt item prompt) 1987 (ido-make-prompt item prompt)
1988 '(("dummy" . 1)) nil nil ; table predicate require-match 1988 '(("dummy" . 1)) nil nil ; table predicate require-match
1989 (prog1 ido-text-init (setq ido-text-init nil)) ;initial-contents 1989 (prog1 ido-text-init (setq ido-text-init nil)) ;initial-contents
@@ -4740,13 +4740,13 @@ See `read-directory-name' for additional parameters."
4740 (concat ido-current-directory filename))))) 4740 (concat ido-current-directory filename)))))
4741 4741
4742;;;###autoload 4742;;;###autoload
4743(defun ido-completing-read (prompt choices &optional predicate require-match initial-input hist def) 4743(defun ido-completing-read (prompt choices &optional predicate require-match initial-input hist def inherit-input-method)
4744 "Ido replacement for the built-in `completing-read'. 4744 "Ido replacement for the built-in `completing-read'.
4745Read a string in the minibuffer with ido-style completion. 4745Read a string in the minibuffer with ido-style completion.
4746PROMPT is a string to prompt with; normally it ends in a colon and a space. 4746PROMPT is a string to prompt with; normally it ends in a colon and a space.
4747CHOICES is a list of strings which are the possible completions. 4747CHOICES is a list of strings which are the possible completions.
4748PREDICATE is currently ignored; it is included to be compatible 4748PREDICATE and INHERIT-INPUT-METHOD is currently ignored; it is included
4749 with `completing-read'. 4749 to be compatible with `completing-read'.
4750If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless 4750If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless
4751 the input is (or completes to) an element of CHOICES or is null. 4751 the input is (or completes to) an element of CHOICES or is null.
4752 If the input is null, `ido-completing-read' returns DEF, or an empty 4752 If the input is null, `ido-completing-read' returns DEF, or an empty
diff --git a/lisp/info.el b/lisp/info.el
index bc2062e72b2..fb753659737 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -594,15 +594,15 @@ in `Info-file-supports-index-cookies-list'."
594(defun info-initialize () 594(defun info-initialize ()
595 "Initialize `Info-directory-list', if that hasn't been done yet." 595 "Initialize `Info-directory-list', if that hasn't been done yet."
596 (unless Info-directory-list 596 (unless Info-directory-list
597 (let ((path (getenv "INFOPATH"))) 597 (let ((path (getenv "INFOPATH"))
598 (sep (regexp-quote path-separator)))
598 (setq Info-directory-list 599 (setq Info-directory-list
599 (prune-directory-list 600 (prune-directory-list
600 (if path 601 (if path
601 (if (string-match ":\\'" path) 602 (if (string-match-p (concat sep "\\'") path)
602 (append (split-string (substring path 0 -1) 603 (append (split-string (substring path 0 -1) sep)
603 (regexp-quote path-separator))
604 (Info-default-dirs)) 604 (Info-default-dirs))
605 (split-string path (regexp-quote path-separator))) 605 (split-string path sep))
606 (Info-default-dirs))))))) 606 (Info-default-dirs)))))))
607 607
608;;;###autoload 608;;;###autoload
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 9a892f493d7..200aadda651 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -2306,11 +2306,11 @@ change; nil means current message."
2306;;;; *** Rmail Message Selection And Support *** 2306;;;; *** Rmail Message Selection And Support ***
2307 2307
2308(defun rmail-msgend (n) 2308(defun rmail-msgend (n)
2309 "Return the start position for message number N." 2309 "Return the end position for message number N."
2310 (marker-position (aref rmail-message-vector (1+ n)))) 2310 (marker-position (aref rmail-message-vector (1+ n))))
2311 2311
2312(defun rmail-msgbeg (n) 2312(defun rmail-msgbeg (n)
2313 "Return the end position for message number N." 2313 "Return the start position for message number N."
2314 (marker-position (aref rmail-message-vector n))) 2314 (marker-position (aref rmail-message-vector n)))
2315 2315
2316(defun rmail-apply-in-message (msgnum function &rest args) 2316(defun rmail-apply-in-message (msgnum function &rest args)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 531a0e26eaf..4a2deb6b3bf 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -698,7 +698,15 @@ scroll the window of possible completions."
698 (when last 698 (when last
699 (setcdr last nil) 699 (setcdr last nil)
700 ;; Prefer shorter completions. 700 ;; Prefer shorter completions.
701 (setq all (sort all (lambda (c1 c2) (< (length c1) (length c2))))) 701 (setq all (sort all (lambda (c1 c2)
702 (let ((s1 (get-text-property
703 0 :completion-cycle-penalty c1))
704 (s2 (get-text-property
705 0 :completion-cycle-penalty c2)))
706 (if (eq s1 s2)
707 (< (length c1) (length c2))
708 (< (or s1 (length c1))
709 (or s2 (length c2))))))))
702 ;; Prefer recently used completions. 710 ;; Prefer recently used completions.
703 (let ((hist (symbol-value minibuffer-history-variable))) 711 (let ((hist (symbol-value minibuffer-history-variable)))
704 (setq all (sort all (lambda (c1 c2) 712 (setq all (sort all (lambda (c1 c2)
diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el
index 3ccad277ffb..2caf8dec30f 100644
--- a/lisp/net/ldap.el
+++ b/lisp/net/ldap.el
@@ -36,6 +36,8 @@
36(require 'custom) 36(require 'custom)
37(eval-when-compile (require 'cl)) 37(eval-when-compile (require 'cl))
38 38
39(autoload 'auth-source-search "auth-source")
40
39(defgroup ldap nil 41(defgroup ldap nil
40 "Lightweight Directory Access Protocol." 42 "Lightweight Directory Access Protocol."
41 :version "21.1" 43 :version "21.1"
@@ -480,6 +482,22 @@ Additional search parameters can be specified through
480 "Perform a search on a LDAP server. 482 "Perform a search on a LDAP server.
481SEARCH-PLIST is a property list describing the search request. 483SEARCH-PLIST is a property list describing the search request.
482Valid keys in that list are: 484Valid keys in that list are:
485
486 `auth-source', if non-nil, will use `auth-source-search' and
487will grab the :host, :secret, :base, and (:user or :binddn)
488tokens into the `host', `passwd', `base', and `binddn' parameters
489respectively if they are not provided in SEARCH-PLIST. So for
490instance *each* of these netrc lines has the same effect if you
491ask for the host \"ldapserver:2400\":
492
493 machine ldapserver:2400 login myDN secret myPassword base myBase
494 machine ldapserver:2400 binddn myDN secret myPassword port ldap
495 login myDN secret myPassword base myBase
496
497but if you have more than one in your netrc file, only the first
498matching one will be used. Note the \"port ldap\" part is NOT
499required.
500
483 `host' is a string naming one or more (blank-separated) LDAP servers to 501 `host' is a string naming one or more (blank-separated) LDAP servers to
484to try to connect to. Each host name may optionally be of the form HOST:PORT. 502to try to connect to. Each host name may optionally be of the form HOST:PORT.
485 `filter' is a filter string for the search as described in RFC 1558. 503 `filter' is a filter string for the search as described in RFC 1558.
@@ -500,19 +518,34 @@ not their associated values.
500its distinguished name DN. 518its distinguished name DN.
501The function returns a list of matching entries. Each entry is itself 519The function returns a list of matching entries. Each entry is itself
502an alist of attribute/value pairs." 520an alist of attribute/value pairs."
503 (let ((buf (get-buffer-create " *ldap-search*")) 521 (let* ((buf (get-buffer-create " *ldap-search*"))
504 (bufval (get-buffer-create " *ldap-value*")) 522 (bufval (get-buffer-create " *ldap-value*"))
505 (host (or (plist-get search-plist 'host) 523 (host (or (plist-get search-plist 'host)
506 ldap-default-host)) 524 ldap-default-host))
525 ;; find entries with port "ldap" that match the requested host if any
526 (asfound (when (plist-get search-plist 'auth-source)
527 (nth 0 (auth-source-search :host (or host t)
528 :create t))))
529 ;; if no host was requested, get it from the auth-source entry
530 (host (or host (plist-get asfound :host)))
531 ;; get the password from the auth-source
532 (passwd (or (plist-get search-plist 'passwd)
533 (plist-get asfound :secret)))
534 ;; convert the password from a function call if needed
535 (passwd (if (functionp passwd) (funcall passwd) passwd))
536 ;; get the binddn from the search-list or from the
537 ;; auth-source user or binddn tokens
538 (binddn (or (plist-get search-plist 'binddn)
539 (plist-get asfound :user)
540 (plist-get asfound :binddn)))
541 (base (or (plist-get search-plist 'base)
542 (plist-get asfound :base)
543 ldap-default-base))
507 (filter (plist-get search-plist 'filter)) 544 (filter (plist-get search-plist 'filter))
508 (attributes (plist-get search-plist 'attributes)) 545 (attributes (plist-get search-plist 'attributes))
509 (attrsonly (plist-get search-plist 'attrsonly)) 546 (attrsonly (plist-get search-plist 'attrsonly))
510 (base (or (plist-get search-plist 'base)
511 ldap-default-base))
512 (scope (plist-get search-plist 'scope)) 547 (scope (plist-get search-plist 'scope))
513 (binddn (plist-get search-plist 'binddn))
514 (auth (plist-get search-plist 'auth)) 548 (auth (plist-get search-plist 'auth))
515 (passwd (plist-get search-plist 'passwd))
516 (deref (plist-get search-plist 'deref)) 549 (deref (plist-get search-plist 'deref))
517 (timelimit (plist-get search-plist 'timelimit)) 550 (timelimit (plist-get search-plist 'timelimit))
518 (sizelimit (plist-get search-plist 'sizelimit)) 551 (sizelimit (plist-get search-plist 'sizelimit))
diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el
index 4045a443640..c3da1707165 100644
--- a/lisp/net/quickurl.el
+++ b/lisp/net/quickurl.el
@@ -511,15 +511,15 @@ TYPE dictates what will be inserted, options are:
511 (with-current-buffer quickurl-list-last-buffer 511 (with-current-buffer quickurl-list-last-buffer
512 (insert 512 (insert
513 (case type 513 (case type
514 ('url (funcall quickurl-format-function url)) 514 (url (funcall quickurl-format-function url))
515 ('naked-url (quickurl-url-url url)) 515 (naked-url (quickurl-url-url url))
516 ('with-lookup (format "%s <URL:%s>" 516 (with-lookup (format "%s <URL:%s>"
517 (quickurl-url-keyword url) 517 (quickurl-url-keyword url)
518 (quickurl-url-url url))) 518 (quickurl-url-url url)))
519 ('with-desc (format "%S <URL:%s>" 519 (with-desc (format "%S <URL:%s>"
520 (quickurl-url-description url) 520 (quickurl-url-description url)
521 (quickurl-url-url url))) 521 (quickurl-url-url url)))
522 ('lookup (quickurl-url-keyword url))))) 522 (lookup (quickurl-url-keyword url)))))
523 (error "No URL details on that line")) 523 (error "No URL details on that line"))
524 url)) 524 url))
525 525
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 1e3ee91092d..71aa0dd22bc 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -548,7 +548,7 @@ If ARG is non-nil, instead prompt for connection parameters."
548 (add-hook 'auto-save-hook 'rcirc-log-write) 548 (add-hook 'auto-save-hook 'rcirc-log-write)
549 549
550 ;; identify 550 ;; identify
551 (when password 551 (unless (zerop (length password))
552 (rcirc-send-string process (concat "PASS " password))) 552 (rcirc-send-string process (concat "PASS " password)))
553 (rcirc-send-string process (concat "NICK " nick)) 553 (rcirc-send-string process (concat "NICK " nick))
554 (rcirc-send-string process (concat "USER " user-name 554 (rcirc-send-string process (concat "USER " user-name
@@ -2449,8 +2449,7 @@ keywords when no KEYWORD is given."
2449 (if rcirc-auto-authenticate-flag 2449 (if rcirc-auto-authenticate-flag
2450 (if rcirc-authenticate-before-join 2450 (if rcirc-authenticate-before-join
2451 (progn 2451 (progn
2452 (with-rcirc-process-buffer process 2452 (add-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t t)
2453 (add-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t t))
2454 (rcirc-authenticate)) 2453 (rcirc-authenticate))
2455 (rcirc-authenticate) 2454 (rcirc-authenticate)
2456 (rcirc-join-channels process rcirc-startup-channels)) 2455 (rcirc-join-channels process rcirc-startup-channels))
@@ -2515,7 +2514,7 @@ the only argument."
2515 (and ;; quakenet 2514 (and ;; quakenet
2516 (string= sender "Q") 2515 (string= sender "Q")
2517 (string= target rcirc-nick) 2516 (string= target rcirc-nick)
2518 (string-match message "\\`You are now logged in as .+\\.\\'"))) 2517 (string-match "\\`You are now logged in as .+\\.\\'" message)))
2519 (setq rcirc-user-authenticated t) 2518 (setq rcirc-user-authenticated t)
2520 (run-hook-with-args 'rcirc-authenticated-hook process) 2519 (run-hook-with-args 'rcirc-authenticated-hook process)
2521 (remove-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t)))))) 2520 (remove-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t))))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 63a4c19eccf..ec5c46b2897 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -90,7 +90,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
90 (tramp-login-args (("%h") ("-l" "%u"))) 90 (tramp-login-args (("%h") ("-l" "%u")))
91 (tramp-remote-sh "/bin/sh") 91 (tramp-remote-sh "/bin/sh")
92 (tramp-copy-program "rcp") 92 (tramp-copy-program "rcp")
93 (tramp-copy-args (("%k" "-p") ("-r"))) 93 (tramp-copy-args (("-p" "%k") ("-r")))
94 (tramp-copy-keep-date t) 94 (tramp-copy-keep-date t)
95 (tramp-copy-recursive t))) 95 (tramp-copy-recursive t)))
96;;;###tramp-autoload 96;;;###tramp-autoload
@@ -100,7 +100,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
100 (tramp-login-args (("%h") ("-l" "%u"))) 100 (tramp-login-args (("%h") ("-l" "%u")))
101 (tramp-remote-sh "/bin/sh") 101 (tramp-remote-sh "/bin/sh")
102 (tramp-copy-program "rcp") 102 (tramp-copy-program "rcp")
103 (tramp-copy-args (("%k" "-p"))) 103 (tramp-copy-args (("-p" "%k")))
104 (tramp-copy-keep-date t))) 104 (tramp-copy-keep-date t)))
105;;;###tramp-autoload 105;;;###tramp-autoload
106(add-to-list 'tramp-methods 106(add-to-list 'tramp-methods
@@ -110,7 +110,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
110 (tramp-async-args (("-q"))) 110 (tramp-async-args (("-q")))
111 (tramp-remote-sh "/bin/sh") 111 (tramp-remote-sh "/bin/sh")
112 (tramp-copy-program "scp") 112 (tramp-copy-program "scp")
113 (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r"))) 113 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")))
114 (tramp-copy-keep-date t) 114 (tramp-copy-keep-date t)
115 (tramp-copy-recursive t) 115 (tramp-copy-recursive t)
116 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 116 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -126,7 +126,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
126 (tramp-async-args (("-q"))) 126 (tramp-async-args (("-q")))
127 (tramp-remote-sh "/bin/sh") 127 (tramp-remote-sh "/bin/sh")
128 (tramp-copy-program "scp") 128 (tramp-copy-program "scp")
129 (tramp-copy-args (("-1") ("-P" "%p") ("%k" "-p") ("-q") ("-r"))) 129 (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
130 (tramp-copy-keep-date t) 130 (tramp-copy-keep-date t)
131 (tramp-copy-recursive t) 131 (tramp-copy-recursive t)
132 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 132 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -142,7 +142,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
142 (tramp-async-args (("-q"))) 142 (tramp-async-args (("-q")))
143 (tramp-remote-sh "/bin/sh") 143 (tramp-remote-sh "/bin/sh")
144 (tramp-copy-program "scp") 144 (tramp-copy-program "scp")
145 (tramp-copy-args (("-2") ("-P" "%p") ("%k" "-p") ("-q") ("-r"))) 145 (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
146 (tramp-copy-keep-date t) 146 (tramp-copy-keep-date t)
147 (tramp-copy-recursive t) 147 (tramp-copy-recursive t)
148 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 148 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -160,7 +160,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
160 (tramp-async-args (("-q"))) 160 (tramp-async-args (("-q")))
161 (tramp-remote-sh "/bin/sh") 161 (tramp-remote-sh "/bin/sh")
162 (tramp-copy-program "scp") 162 (tramp-copy-program "scp")
163 (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r") 163 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")
164 ("-o" "ControlPath=%t.%%r@%%h:%%p") 164 ("-o" "ControlPath=%t.%%r@%%h:%%p")
165 ("-o" "ControlMaster=auto"))) 165 ("-o" "ControlMaster=auto")))
166 (tramp-copy-keep-date t) 166 (tramp-copy-keep-date t)
@@ -179,7 +179,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
179 (tramp-async-args (("-q"))) 179 (tramp-async-args (("-q")))
180 (tramp-remote-sh "/bin/sh") 180 (tramp-remote-sh "/bin/sh")
181 (tramp-copy-program "scp") 181 (tramp-copy-program "scp")
182 (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r"))) 182 (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")))
183 (tramp-copy-keep-date t) 183 (tramp-copy-keep-date t)
184 (tramp-copy-recursive t) 184 (tramp-copy-recursive t)
185 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") 185 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -202,7 +202,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
202 (tramp-async-args (("-q"))) 202 (tramp-async-args (("-q")))
203 (tramp-remote-sh "/bin/sh") 203 (tramp-remote-sh "/bin/sh")
204 (tramp-copy-program "rsync") 204 (tramp-copy-program "rsync")
205 (tramp-copy-args (("-e" "ssh") ("%k" "-t") ("-r"))) 205 (tramp-copy-args (("-e" "ssh") ("-t" "%k") ("-r")))
206 (tramp-copy-keep-date t) 206 (tramp-copy-keep-date t)
207 (tramp-copy-keep-tmpfile t) 207 (tramp-copy-keep-tmpfile t)
208 (tramp-copy-recursive t))) 208 (tramp-copy-recursive t)))
@@ -217,7 +217,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
217 (tramp-async-args (("-q"))) 217 (tramp-async-args (("-q")))
218 (tramp-remote-sh "/bin/sh") 218 (tramp-remote-sh "/bin/sh")
219 (tramp-copy-program "rsync") 219 (tramp-copy-program "rsync")
220 (tramp-copy-args (("%k" "-t") ("-r"))) 220 (tramp-copy-args (("-t" "%k") ("-r")))
221 (tramp-copy-env (("RSYNC_RSH") 221 (tramp-copy-env (("RSYNC_RSH")
222 (,(concat 222 (,(concat
223 "ssh" 223 "ssh"
@@ -353,7 +353,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
353 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) 353 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
354 (tramp-remote-sh "/bin/sh") 354 (tramp-remote-sh "/bin/sh")
355 (tramp-copy-program "pscp") 355 (tramp-copy-program "pscp")
356 (tramp-copy-args (("-P" "%p") ("-scp") ("%k" "-p") 356 (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k")
357 ("-q") ("-r"))) 357 ("-q") ("-r")))
358 (tramp-copy-keep-date t) 358 (tramp-copy-keep-date t)
359 (tramp-copy-recursive t) 359 (tramp-copy-recursive t)
@@ -366,7 +366,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
366 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) 366 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
367 (tramp-remote-sh "/bin/sh") 367 (tramp-remote-sh "/bin/sh")
368 (tramp-copy-program "pscp") 368 (tramp-copy-program "pscp")
369 (tramp-copy-args (("-P" "%p") ("-sftp") ("%k" "-p") 369 (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k")
370 ("-q") ("-r"))) 370 ("-q") ("-r")))
371 (tramp-copy-keep-date t) 371 (tramp-copy-keep-date t)
372 (tramp-copy-recursive t) 372 (tramp-copy-recursive t)
@@ -378,7 +378,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
378 (tramp-login-args (("%h") ("-l" "%u") ("sh" "-i"))) 378 (tramp-login-args (("%h") ("-l" "%u") ("sh" "-i")))
379 (tramp-remote-sh "/bin/sh -i") 379 (tramp-remote-sh "/bin/sh -i")
380 (tramp-copy-program "fcp") 380 (tramp-copy-program "fcp")
381 (tramp-copy-args (("%k" "-p"))) 381 (tramp-copy-args (("-p" "%k")))
382 (tramp-copy-keep-date t))) 382 (tramp-copy-keep-date t)))
383 383
384;;;###tramp-autoload 384;;;###tramp-autoload
@@ -2251,11 +2251,15 @@ The method used must be an out-of-band method."
2251 'identity) 2251 'identity)
2252 (if t2 (tramp-make-copy-program-file-name v) newname))) 2252 (if t2 (tramp-make-copy-program-file-name v) newname)))
2253 2253
2254 ;; Check for port number. Until now, there's no need for handling 2254 ;; Check for host and port number. We cannot use
2255 ;; like method, user, host. 2255 ;; `tramp-file-name-port', because this returns also
2256 (setq host (tramp-file-name-real-host v) 2256 ;; `tramp-default-port', which might clash with settings in
2257 port (tramp-file-name-port v) 2257 ;; "~/.ssh/config".
2258 port (or (and port (number-to-string port)) "")) 2258 (setq host (tramp-file-name-host v)
2259 port "")
2260 (when (string-match tramp-host-with-port-regexp host)
2261 (setq host (string-to-number (match-string 1 host))
2262 port (string-to-number (match-string 2 host))))
2259 2263
2260 ;; Compose copy command. 2264 ;; Compose copy command.
2261 (setq spec (format-spec-make 2265 (setq spec (format-spec-make
@@ -2270,7 +2274,7 @@ The method used must be an out-of-band method."
2270 copy-args 2274 copy-args
2271 (delete 2275 (delete
2272 ;; " " has either been a replacement of "%k" (when 2276 ;; " " has either been a replacement of "%k" (when
2273 ;; keep-date argument is non-nil), or a replacemtent 2277 ;; keep-date argument is non-nil), or a replacement
2274 ;; for the whole keep-date sublist. 2278 ;; for the whole keep-date sublist.
2275 " " 2279 " "
2276 (dolist 2280 (dolist
@@ -2281,7 +2285,7 @@ The method used must be an out-of-band method."
2281 (append 2285 (append
2282 copy-args 2286 copy-args
2283 (let ((y (mapcar (lambda (z) (format-spec z spec)) x))) 2287 (let ((y (mapcar (lambda (z) (format-spec z spec)) x)))
2284 (if (zerop (length (car y))) '(" ") y)))))) 2288 (if (member "" y) '(" ") y))))))
2285 copy-env 2289 copy-env
2286 (delq 2290 (delq
2287 nil 2291 nil
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 1f3064c7066..462b8f11397 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -31,7 +31,7 @@
31;; should be changed only there. 31;; should be changed only there.
32 32
33;;;###tramp-autoload 33;;;###tramp-autoload
34(defconst tramp-version "2.2.1-pre" 34(defconst tramp-version "2.2.1"
35 "This version of Tramp.") 35 "This version of Tramp.")
36 36
37;;;###tramp-autoload 37;;;###tramp-autoload
@@ -44,7 +44,7 @@
44 (= emacs-major-version 21) 44 (= emacs-major-version 21)
45 (>= emacs-minor-version 4))) 45 (>= emacs-minor-version 4)))
46 "ok" 46 "ok"
47 (format "Tramp 2.2.1-pre is not fit for %s" 47 (format "Tramp 2.2.1 is not fit for %s"
48 (when (string-match "^.*$" (emacs-version)) 48 (when (string-match "^.*$" (emacs-version))
49 (match-string 0 (emacs-version))))))) 49 (match-string 0 (emacs-version)))))))
50 (unless (string-match "\\`ok\\'" x) (error "%s" x))) 50 (unless (string-match "\\`ok\\'" x) (error "%s" x)))
diff --git a/lisp/net/xesam.el b/lisp/net/xesam.el
index 21a22749408..64c26cfb2c9 100644
--- a/lisp/net/xesam.el
+++ b/lisp/net/xesam.el
@@ -414,18 +414,18 @@ If there is no registered search engine at all, the function returns `nil'."
414 ;; Hopefully, this will change later. 414 ;; Hopefully, this will change later.
415 (setq hit-fields 415 (setq hit-fields
416 (case (intern vendor-id) 416 (case (intern vendor-id)
417 ('Beagle 417 (Beagle
418 '("xesam:mimeType" "xesam:url")) 418 '("xesam:mimeType" "xesam:url"))
419 ('Strigi 419 (Strigi
420 '("xesam:author" "xesam:cc" "xesam:charset" 420 '("xesam:author" "xesam:cc" "xesam:charset"
421 "xesam:contentType" "xesam:fileExtension" 421 "xesam:contentType" "xesam:fileExtension"
422 "xesam:id" "xesam:lineCount" "xesam:links" 422 "xesam:id" "xesam:lineCount" "xesam:links"
423 "xesam:mimeType" "xesam:name" "xesam:size" 423 "xesam:mimeType" "xesam:name" "xesam:size"
424 "xesam:sourceModified" "xesam:subject" "xesam:to" 424 "xesam:sourceModified" "xesam:subject" "xesam:to"
425 "xesam:url")) 425 "xesam:url"))
426 ('TrackerXesamSession 426 (TrackerXesamSession
427 '("xesam:relevancyRating" "xesam:url")) 427 '("xesam:relevancyRating" "xesam:url"))
428 ('Debbugs 428 (Debbugs
429 '("xesam:keyword" "xesam:owner" "xesam:title" 429 '("xesam:keyword" "xesam:owner" "xesam:title"
430 "xesam:url" "xesam:sourceModified" "xesam:mimeType" 430 "xesam:url" "xesam:sourceModified" "xesam:mimeType"
431 "debbugs:key")) 431 "debbugs:key"))
diff --git a/lisp/notifications.el b/lisp/notifications.el
index 893b9ed095f..adb9fdd641a 100644
--- a/lisp/notifications.el
+++ b/lisp/notifications.el
@@ -210,8 +210,8 @@ used to manipulate the notification item with
210 (add-to-list 'hints `(:dict-entry 210 (add-to-list 'hints `(:dict-entry
211 "urgency" 211 "urgency"
212 (:variant :byte ,(case urgency 212 (:variant :byte ,(case urgency
213 ('low 0) 213 (low 0)
214 ('critical 2) 214 (critical 2)
215 (t 1)))) t)) 215 (t 1)))) t))
216 (when category 216 (when category
217 (add-to-list 'hints `(:dict-entry 217 (add-to-list 'hints `(:dict-entry
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index e75821b6860..44a2cb15b7e 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,13 @@
12011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * org-src.el (org-src-switch-to-buffer):
4 * org-plot.el (org-plot/gnuplot-script, org-plot/gnuplot):
5 * org-mouse.el (org-mouse-agenda-type):
6 * org-freemind.el (org-freemind-node-to-org):
7 * ob-sql.el (org-babel-execute:sql):
8 * ob-exp.el (org-babel-exp-do-export, org-babel-exp-code):
9 * ob-ref.el (org-babel-ref-resolve): Fix use of case.
10
12011-03-06 Juanma Barranquero <lekktu@gmail.com> 112011-03-06 Juanma Barranquero <lekktu@gmail.com>
2 12
3 * org.el (org-blank-before-new-entry, org-context-in-file-links) 13 * org.el (org-blank-before-new-entry, org-context-in-file-links)
diff --git a/lisp/org/ob-exp.el b/lisp/org/ob-exp.el
index 1be45198e0d..3215bcf4d8a 100644
--- a/lisp/org/ob-exp.el
+++ b/lisp/org/ob-exp.el
@@ -231,10 +231,10 @@ The function respects the value of the :exports header argument."
231 (org-babel-exp-results info type 'silent)))) 231 (org-babel-exp-results info type 'silent))))
232 (clean () (org-babel-remove-result info))) 232 (clean () (org-babel-remove-result info)))
233 (case (intern (or (cdr (assoc :exports (nth 2 info))) "code")) 233 (case (intern (or (cdr (assoc :exports (nth 2 info))) "code"))
234 ('none (silently) (clean) "") 234 (none (silently) (clean) "")
235 ('code (silently) (clean) (org-babel-exp-code info type)) 235 (code (silently) (clean) (org-babel-exp-code info type))
236 ('results (org-babel-exp-results info type)) 236 (results (org-babel-exp-results info type))
237 ('both (concat (org-babel-exp-code info type) 237 (both (concat (org-babel-exp-code info type)
238 "\n\n" 238 "\n\n"
239 (org-babel-exp-results info type)))))) 239 (org-babel-exp-results info type))))))
240 240
@@ -250,8 +250,8 @@ The code block is not evaluated."
250 (name (nth 4 info)) 250 (name (nth 4 info))
251 (args (mapcar #'cdr (org-babel-get-header (nth 2 info) :var)))) 251 (args (mapcar #'cdr (org-babel-get-header (nth 2 info) :var))))
252 (case type 252 (case type
253 ('inline (format "=%s=" body)) 253 (inline (format "=%s=" body))
254 ('block 254 (block
255 (let ((str 255 (let ((str
256 (format "#+BEGIN_SRC %s %s\n%s%s#+END_SRC\n" lang switches body 256 (format "#+BEGIN_SRC %s %s\n%s%s#+END_SRC\n" lang switches body
257 (if (and body (string-match "\n$" body)) 257 (if (and body (string-match "\n$" body))
@@ -265,7 +265,7 @@ The code block is not evaluated."
265 (mapconcat #'identity args ", "))) 265 (mapconcat #'identity args ", ")))
266 str)) 266 str))
267 str)) 267 str))
268 ('lob 268 (lob
269 (let ((call-line (and (string-match "results=" (car args)) 269 (let ((call-line (and (string-match "results=" (car args))
270 (substring (car args) (match-end 0))))) 270 (substring (car args) (match-end 0)))))
271 (cond 271 (cond
diff --git a/lisp/org/ob-ref.el b/lisp/org/ob-ref.el
index 7b06e90f924..96819df8ea1 100644
--- a/lisp/org/ob-ref.el
+++ b/lisp/org/ob-ref.el
@@ -147,12 +147,12 @@ the variable."
147 (let ((params (append args '((:results . "silent"))))) 147 (let ((params (append args '((:results . "silent")))))
148 (setq result 148 (setq result
149 (case type 149 (case type
150 ('results-line (org-babel-read-result)) 150 (results-line (org-babel-read-result))
151 ('table (org-babel-read-table)) 151 (table (org-babel-read-table))
152 ('list (org-babel-read-list)) 152 (list (org-babel-read-list))
153 ('file (org-babel-read-link)) 153 (file (org-babel-read-link))
154 ('source-block (org-babel-execute-src-block nil nil params)) 154 (source-block (org-babel-execute-src-block nil nil params))
155 ('lob (org-babel-execute-src-block nil lob-info params))))) 155 (lob (org-babel-execute-src-block nil lob-info params)))))
156 (if (symbolp result) 156 (if (symbolp result)
157 (format "%S" result) 157 (format "%S" result)
158 (if (and index (listp result)) 158 (if (and index (listp result))
diff --git a/lisp/org/ob-sql.el b/lisp/org/ob-sql.el
index 3bd10d6b2bd..49859d24a17 100644
--- a/lisp/org/ob-sql.el
+++ b/lisp/org/ob-sql.el
@@ -66,18 +66,18 @@ This function is called by `org-babel-execute-src-block'."
66 (out-file (or (cdr (assoc :out-file params)) 66 (out-file (or (cdr (assoc :out-file params))
67 (org-babel-temp-file "sql-out-"))) 67 (org-babel-temp-file "sql-out-")))
68 (command (case (intern engine) 68 (command (case (intern engine)
69 ('msosql (format "osql %s -s \"\t\" -i %s -o %s" 69 (msosql (format "osql %s -s \"\t\" -i %s -o %s"
70 (or cmdline "")
71 (org-babel-process-file-name in-file)
72 (org-babel-process-file-name out-file)))
73 ('mysql (format "mysql %s -e \"source %s\" > %s"
74 (or cmdline "") 70 (or cmdline "")
75 (org-babel-process-file-name in-file) 71 (org-babel-process-file-name in-file)
76 (org-babel-process-file-name out-file))) 72 (org-babel-process-file-name out-file)))
77 ('postgresql (format "psql -A -P footer=off -F \"\t\" -f %s -o %s %s" 73 (mysql (format "mysql %s -e \"source %s\" > %s"
78 (org-babel-process-file-name in-file) 74 (or cmdline "")
79 (org-babel-process-file-name out-file) 75 (org-babel-process-file-name in-file)
80 (or cmdline ""))) 76 (org-babel-process-file-name out-file)))
77 (postgresql (format "psql -A -P footer=off -F \"\t\" -f %s -o %s %s"
78 (org-babel-process-file-name in-file)
79 (org-babel-process-file-name out-file)
80 (or cmdline "")))
81 (t (error "no support for the %s sql engine" engine))))) 81 (t (error "no support for the %s sql engine" engine)))))
82 (with-temp-file in-file 82 (with-temp-file in-file
83 (insert (org-babel-expand-body:sql body params))) 83 (insert (org-babel-expand-body:sql body params)))
diff --git a/lisp/org/org-freemind.el b/lisp/org/org-freemind.el
index c85b4bac36a..dccdf449296 100644
--- a/lisp/org/org-freemind.el
+++ b/lisp/org/org-freemind.el
@@ -1172,8 +1172,8 @@ PATH should be a list of steps, where each step has the form
1172 (when (< 0 (- level skip-levels)) 1172 (when (< 0 (- level skip-levels))
1173 (dolist (attrib attributes) 1173 (dolist (attrib attributes)
1174 (case (car attrib) 1174 (case (car attrib)
1175 ('TEXT (setq text (cdr attrib))) 1175 (TEXT (setq text (cdr attrib)))
1176 ('text (setq text (cdr attrib))))) 1176 (text (setq text (cdr attrib)))))
1177 (unless text 1177 (unless text
1178 ;; There should be a richcontent node holding the text: 1178 ;; There should be a richcontent node holding the text:
1179 (setq text (org-freemind-get-richcontent-node-text node))) 1179 (setq text (org-freemind-get-richcontent-node-text node)))
@@ -1193,7 +1193,7 @@ PATH should be a list of steps, where each step has the form
1193 (setq text (replace-regexp-in-string "\n $" "" text)) 1193 (setq text (replace-regexp-in-string "\n $" "" text))
1194 (insert text)) 1194 (insert text))
1195 (case qname 1195 (case qname
1196 ('node 1196 (node
1197 (insert (make-string (- level skip-levels) ?*) " " text "\n") 1197 (insert (make-string (- level skip-levels) ?*) " " text "\n")
1198 (when note 1198 (when note
1199 (insert ":COMMENT:\n" note "\n:END:\n")) 1199 (insert ":COMMENT:\n" note "\n:END:\n"))
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index d30f172f42f..cec19d89de1 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -476,11 +476,11 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
476 476
477(defun org-mouse-agenda-type (type) 477(defun org-mouse-agenda-type (type)
478 (case type 478 (case type
479 ('tags "Tags: ") 479 (tags "Tags: ")
480 ('todo "TODO: ") 480 (todo "TODO: ")
481 ('tags-tree "Tags tree: ") 481 (tags-tree "Tags tree: ")
482 ('todo-tree "TODO tree: ") 482 (todo-tree "TODO tree: ")
483 ('occur-tree "Occur tree: ") 483 (occur-tree "Occur tree: ")
484 (t "Agenda command ???"))) 484 (t "Agenda command ???")))
485 485
486 486
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el
index c5f4bff24fa..10722403f7e 100644
--- a/lisp/org/org-plot.el
+++ b/lisp/org/org-plot.el
@@ -206,18 +206,18 @@ manner suitable for prepending to a user-specified script."
206 (y-labels (plist-get params :ylabels)) 206 (y-labels (plist-get params :ylabels))
207 (plot-str "'%s' using %s%d%s with %s title '%s'") 207 (plot-str "'%s' using %s%d%s with %s title '%s'")
208 (plot-cmd (case type 208 (plot-cmd (case type
209 ('2d "plot") 209 (2d "plot")
210 ('3d "splot") 210 (3d "splot")
211 ('grid "splot"))) 211 (grid "splot")))
212 (script "reset") plot-lines) 212 (script "reset") plot-lines)
213 (flet ((add-to-script (line) (setf script (format "%s\n%s" script line)))) 213 (flet ((add-to-script (line) (setf script (format "%s\n%s" script line))))
214 (when file ;; output file 214 (when file ;; output file
215 (add-to-script (format "set term %s" (file-name-extension file))) 215 (add-to-script (format "set term %s" (file-name-extension file)))
216 (add-to-script (format "set output '%s'" file))) 216 (add-to-script (format "set output '%s'" file)))
217 (case type ;; type 217 (case type ;; type
218 ('2d ()) 218 (2d ())
219 ('3d (if map (add-to-script "set map"))) 219 (3d (if map (add-to-script "set map")))
220 ('grid (if map 220 (grid (if map
221 (add-to-script "set pm3d map") 221 (add-to-script "set pm3d map")
222 (add-to-script "set pm3d")))) 222 (add-to-script "set pm3d"))))
223 (when title (add-to-script (format "set title '%s'" title))) ;; title 223 (when title (add-to-script (format "set title '%s'" title))) ;; title
@@ -243,7 +243,7 @@ manner suitable for prepending to a user-specified script."
243 "%Y-%m-%d-%H:%M:%S") "\""))) 243 "%Y-%m-%d-%H:%M:%S") "\"")))
244 (unless preface 244 (unless preface
245 (case type ;; plot command 245 (case type ;; plot command
246 ('2d (dotimes (col num-cols) 246 (2d (dotimes (col num-cols)
247 (unless (and (equal type '2d) 247 (unless (and (equal type '2d)
248 (or (and ind (equal (+ 1 col) ind)) 248 (or (and ind (equal (+ 1 col) ind))
249 (and deps (not (member (+ 1 col) deps))))) 249 (and deps (not (member (+ 1 col) deps)))))
@@ -258,10 +258,10 @@ manner suitable for prepending to a user-specified script."
258 with 258 with
259 (or (nth col col-labels) (format "%d" (+ 1 col)))) 259 (or (nth col col-labels) (format "%d" (+ 1 col))))
260 plot-lines))))) 260 plot-lines)))))
261 ('3d 261 (3d
262 (setq plot-lines (list (format "'%s' matrix with %s title ''" 262 (setq plot-lines (list (format "'%s' matrix with %s title ''"
263 data-file with)))) 263 data-file with))))
264 ('grid 264 (grid
265 (setq plot-lines (list (format "'%s' with %s title ''" 265 (setq plot-lines (list (format "'%s' with %s title ''"
266 data-file with))))) 266 data-file with)))))
267 (add-to-script 267 (add-to-script
@@ -305,9 +305,9 @@ line directly before or after the table."
305 (setf params (org-plot/collect-options params)))) 305 (setf params (org-plot/collect-options params))))
306 ;; dump table to datafile (very different for grid) 306 ;; dump table to datafile (very different for grid)
307 (case (plist-get params :plot-type) 307 (case (plist-get params :plot-type)
308 ('2d (org-plot/gnuplot-to-data table data-file params)) 308 (2d (org-plot/gnuplot-to-data table data-file params))
309 ('3d (org-plot/gnuplot-to-data table data-file params)) 309 (3d (org-plot/gnuplot-to-data table data-file params))
310 ('grid (let ((y-labels (org-plot/gnuplot-to-grid-data 310 (grid (let ((y-labels (org-plot/gnuplot-to-grid-data
311 table data-file params))) 311 table data-file params)))
312 (when y-labels (plist-put params :ylabels y-labels))))) 312 (when y-labels (plist-put params :ylabels y-labels)))))
313 ;; check for timestamp ind column 313 ;; check for timestamp ind column
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index 98fdb75423d..bd1c3802044 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -335,26 +335,26 @@ buffer."
335 335
336(defun org-src-switch-to-buffer (buffer context) 336(defun org-src-switch-to-buffer (buffer context)
337 (case org-src-window-setup 337 (case org-src-window-setup
338 ('current-window 338 (current-window
339 (switch-to-buffer buffer)) 339 (switch-to-buffer buffer))
340 ('other-window 340 (other-window
341 (switch-to-buffer-other-window buffer)) 341 (switch-to-buffer-other-window buffer))
342 ('other-frame 342 (other-frame
343 (case context 343 (case context
344 ('exit 344 (exit
345 (let ((frame (selected-frame))) 345 (let ((frame (selected-frame)))
346 (switch-to-buffer-other-frame buffer) 346 (switch-to-buffer-other-frame buffer)
347 (delete-frame frame))) 347 (delete-frame frame)))
348 ('save 348 (save
349 (kill-buffer (current-buffer)) 349 (kill-buffer (current-buffer))
350 (switch-to-buffer buffer)) 350 (switch-to-buffer buffer))
351 (t 351 (t
352 (switch-to-buffer-other-frame buffer)))) 352 (switch-to-buffer-other-frame buffer))))
353 ('reorganize-frame 353 (reorganize-frame
354 (if (eq context 'edit) (delete-other-windows)) 354 (if (eq context 'edit) (delete-other-windows))
355 (org-switch-to-buffer-other-window buffer) 355 (org-switch-to-buffer-other-window buffer)
356 (if (eq context 'exit) (delete-other-windows))) 356 (if (eq context 'exit) (delete-other-windows)))
357 ('switch-invisibly 357 (switch-invisibly
358 (set-buffer buffer)) 358 (set-buffer buffer))
359 (t 359 (t
360 (message "Invalid value %s for org-src-window-setup" 360 (message "Invalid value %s for org-src-window-setup"
diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el
index 8fea2cef6ad..0dc556007ba 100644
--- a/lisp/play/bubbles.el
+++ b/lisp/play/bubbles.el
@@ -719,57 +719,57 @@ static char * dot3d_xpm[] = {
719(defsubst bubbles--grid-width () 719(defsubst bubbles--grid-width ()
720 "Return the grid width for the current game theme." 720 "Return the grid width for the current game theme."
721 (car (case bubbles-game-theme 721 (car (case bubbles-game-theme
722 ('easy 722 (easy
723 bubbles--grid-small) 723 bubbles--grid-small)
724 ('medium 724 (medium
725 bubbles--grid-medium) 725 bubbles--grid-medium)
726 ('difficult 726 (difficult
727 bubbles--grid-large) 727 bubbles--grid-large)
728 ('hard 728 (hard
729 bubbles--grid-huge) 729 bubbles--grid-huge)
730 ('user-defined 730 (user-defined
731 bubbles-grid-size)))) 731 bubbles-grid-size))))
732 732
733(defsubst bubbles--grid-height () 733(defsubst bubbles--grid-height ()
734 "Return the grid height for the current game theme." 734 "Return the grid height for the current game theme."
735 (cdr (case bubbles-game-theme 735 (cdr (case bubbles-game-theme
736 ('easy 736 (easy
737 bubbles--grid-small) 737 bubbles--grid-small)
738 ('medium 738 (medium
739 bubbles--grid-medium) 739 bubbles--grid-medium)
740 ('difficult 740 (difficult
741 bubbles--grid-large) 741 bubbles--grid-large)
742 ('hard 742 (hard
743 bubbles--grid-huge) 743 bubbles--grid-huge)
744 ('user-defined 744 (user-defined
745 bubbles-grid-size)))) 745 bubbles-grid-size))))
746 746
747(defsubst bubbles--colors () 747(defsubst bubbles--colors ()
748 "Return the color list for the current game theme." 748 "Return the color list for the current game theme."
749 (case bubbles-game-theme 749 (case bubbles-game-theme
750 ('easy 750 (easy
751 bubbles--colors-2) 751 bubbles--colors-2)
752 ('medium 752 (medium
753 bubbles--colors-3) 753 bubbles--colors-3)
754 ('difficult 754 (difficult
755 bubbles--colors-4) 755 bubbles--colors-4)
756 ('hard 756 (hard
757 bubbles--colors-5) 757 bubbles--colors-5)
758 ('user-defined 758 (user-defined
759 bubbles-colors))) 759 bubbles-colors)))
760 760
761(defsubst bubbles--shift-mode () 761(defsubst bubbles--shift-mode ()
762 "Return the shift mode for the current game theme." 762 "Return the shift mode for the current game theme."
763 (case bubbles-game-theme 763 (case bubbles-game-theme
764 ('easy 764 (easy
765 'default) 765 'default)
766 ('medium 766 (medium
767 'default) 767 'default)
768 ('difficult 768 (difficult
769 'always) 769 'always)
770 ('hard 770 (hard
771 'always) 771 'always)
772 ('user-defined 772 (user-defined
773 bubbles-shift-mode))) 773 bubbles-shift-mode)))
774 774
775(defun bubbles-save-settings () 775(defun bubbles-save-settings ()
@@ -1346,11 +1346,11 @@ Return t if new char is non-empty."
1346 (when (and (display-images-p) 1346 (when (and (display-images-p)
1347 (not (eq bubbles-graphics-theme 'ascii))) 1347 (not (eq bubbles-graphics-theme 'ascii)))
1348 (let ((template (case bubbles-graphics-theme 1348 (let ((template (case bubbles-graphics-theme
1349 ('circles bubbles--image-template-circle) 1349 (circles bubbles--image-template-circle)
1350 ('balls bubbles--image-template-ball) 1350 (balls bubbles--image-template-ball)
1351 ('squares bubbles--image-template-square) 1351 (squares bubbles--image-template-square)
1352 ('diamonds bubbles--image-template-diamond) 1352 (diamonds bubbles--image-template-diamond)
1353 ('emacs bubbles--image-template-emacs)))) 1353 (emacs bubbles--image-template-emacs))))
1354 (setq bubbles--empty-image 1354 (setq bubbles--empty-image
1355 (create-image (replace-regexp-in-string 1355 (create-image (replace-regexp-in-string
1356 "^\"\\(.*\\)\t.*c .*\",$" 1356 "^\"\\(.*\\)\t.*c .*\",$"
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el
index d3d8350a43f..99e3b487437 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -213,19 +213,19 @@ static unsigned char gamegrid_bits[] = {
213 (let ((data (gamegrid-match-spec-list data-spec-list)) 213 (let ((data (gamegrid-match-spec-list data-spec-list))
214 (color (gamegrid-match-spec-list color-spec-list))) 214 (color (gamegrid-match-spec-list color-spec-list)))
215 (case data 215 (case data
216 ('color-x 216 (color-x
217 (gamegrid-make-color-x-face color)) 217 (gamegrid-make-color-x-face color))
218 ('grid-x 218 (grid-x
219 (unless gamegrid-grid-x-face 219 (unless gamegrid-grid-x-face
220 (setq gamegrid-grid-x-face (gamegrid-make-grid-x-face))) 220 (setq gamegrid-grid-x-face (gamegrid-make-grid-x-face)))
221 gamegrid-grid-x-face) 221 gamegrid-grid-x-face)
222 ('mono-x 222 (mono-x
223 (unless gamegrid-mono-x-face 223 (unless gamegrid-mono-x-face
224 (setq gamegrid-mono-x-face (gamegrid-make-mono-x-face))) 224 (setq gamegrid-mono-x-face (gamegrid-make-mono-x-face)))
225 gamegrid-mono-x-face) 225 gamegrid-mono-x-face)
226 ('color-tty 226 (color-tty
227 (gamegrid-make-color-tty-face color)) 227 (gamegrid-make-color-tty-face color))
228 ('mono-tty 228 (mono-tty
229 (unless gamegrid-mono-tty-face 229 (unless gamegrid-mono-tty-face
230 (setq gamegrid-mono-tty-face (gamegrid-make-mono-tty-face))) 230 (setq gamegrid-mono-tty-face (gamegrid-make-mono-tty-face)))
231 gamegrid-mono-tty-face)))) 231 gamegrid-mono-tty-face))))
diff --git a/lisp/play/morse.el b/lisp/play/morse.el
index d4a0224ede5..b88f1b264cb 100644
--- a/lisp/play/morse.el
+++ b/lisp/play/morse.el
@@ -25,6 +25,9 @@
25;; Converts text to Morse code and back with M-x morse-region and 25;; Converts text to Morse code and back with M-x morse-region and
26;; M-x unmorse-region (though Morse code is no longer official :-(). 26;; M-x unmorse-region (though Morse code is no longer official :-().
27 27
28;; Converts text to NATO phonetic alphabet and back with M-x
29;; nato-region and M-x denato-region.
30
28;;; Code: 31;;; Code:
29 32
30(defvar morse-code '(("a" . ".-") 33(defvar morse-code '(("a" . ".-")
@@ -91,10 +94,64 @@
91 ("@" . ".--.-.")) 94 ("@" . ".--.-."))
92 "Morse code character set.") 95 "Morse code character set.")
93 96
97(defvar nato-alphabet '(("a" . "Alfa")
98 ("b" . "Bravo")
99 ("c" . "Charlie")
100 ("d" . "Delta")
101 ("e" . "Echo")
102 ("f" . "Foxtrot")
103 ("g" . "Golf")
104 ("h" . "Hotel")
105 ("i" . "India")
106 ("j" . "Juliett")
107 ("k" . "Kilo")
108 ("l" . "Lima")
109 ("m" . "Mike")
110 ("n" . "November")
111 ("o" . "Oscar")
112 ("p" . "Papa")
113 ("q" . "Quebec")
114 ("r" . "Romeo")
115 ("s" . "Sierra")
116 ("t" . "Tango")
117 ("u" . "Uniform")
118 ("v" . "Victor")
119 ("w" . "Whiskey")
120 ("x" . "Xray")
121 ("y" . "Yankee")
122 ("z" . "Zulu")
123 ;; Numbers
124 ("0" . "Zero")
125 ("1" . "One")
126 ("2" . "Two")
127 ("3" . "Three")
128 ("4" . "Four")
129 ("5" . "Five")
130 ("6" . "Six")
131 ("7" . "Seven")
132 ("8" . "Eight")
133 ("9" . "Niner")
134 ;; Punctuation is not part of standard
135 ("=" . "Equals")
136 ("?" . "Query")
137 ("/" . "Slash")
138 ("," . "Comma")
139 ("." . "Stop")
140 (":" . "Colon")
141 ("'" . "Apostrophe")
142 ("-" . "Dash")
143 ("(" . "Open")
144 (")" . "Close")
145 ("@" . "At"))
146 "NATO phonetic alphabet.
147See ''International Code of Signals'' (INTERCO), United States
148Edition, 1969 Edition (Revised 2003) available from National
149Geospatial-Intelligence Agency at http://www.nga.mil/")
150
94;;;###autoload 151;;;###autoload
95(defun morse-region (beg end) 152(defun morse-region (beg end)
96 "Convert all text in a given region to morse code." 153 "Convert all text in a given region to morse code."
97 (interactive "r") 154 (interactive "*r")
98 (if (integerp end) 155 (if (integerp end)
99 (setq end (copy-marker end))) 156 (setq end (copy-marker end)))
100 (save-excursion 157 (save-excursion
@@ -117,7 +174,7 @@
117;;;###autoload 174;;;###autoload
118(defun unmorse-region (beg end) 175(defun unmorse-region (beg end)
119 "Convert morse coded text in region to ordinary ASCII text." 176 "Convert morse coded text in region to ordinary ASCII text."
120 (interactive "r") 177 (interactive "*r")
121 (if (integerp end) 178 (if (integerp end)
122 (setq end (copy-marker end))) 179 (setq end (copy-marker end)))
123 (save-excursion 180 (save-excursion
@@ -136,6 +193,53 @@
136 (if (looking-at "/") 193 (if (looking-at "/")
137 (delete-char 1)))))))) 194 (delete-char 1))))))))
138 195
196;;;###autoload
197(defun nato-region (beg end)
198 "Convert all text in a given region to NATO phonetic alphabet."
199 ;; Copied from morse-region. -- ashawley 2009-02-10
200 (interactive "*r")
201 (if (integerp end)
202 (setq end (copy-marker end)))
203 (save-excursion
204 (let ((sep "")
205 str nato)
206 (goto-char beg)
207 (while (< (point) end)
208 (setq str (downcase (buffer-substring (point) (1+ (point)))))
209 (cond ((looking-at "\\s-+")
210 (goto-char (match-end 0))
211 (setq sep ""))
212 ((setq nato (assoc str nato-alphabet))
213 (delete-char 1)
214 (insert sep (cdr nato))
215 (setq sep "-"))
216 (t
217 (forward-char 1)
218 (setq sep "")))))))
219
220;;;###autoload
221(defun denato-region (beg end)
222 "Convert NATO phonetic alphabet in region to ordinary ASCII text."
223 ;; Copied from unmorse-region. -- ashawley 2009-02-10
224 (interactive "*r")
225 (if (integerp end)
226 (setq end (copy-marker end)))
227 (save-excursion
228 (let (str paren nato)
229 (goto-char beg)
230 (while (< (point) end)
231 (if (null (looking-at "[a-z]+"))
232 (forward-char 1)
233 (setq str (buffer-substring (match-beginning 0) (match-end 0)))
234 (if (null (setq nato (rassoc str nato-alphabet)))
235 (goto-char (match-end 0))
236 (replace-match
237 (if (string-equal "(" (car nato))
238 (if (setq paren (null paren)) "(" ")")
239 (car nato)) t)
240 (if (looking-at "-")
241 (delete-char 1))))))))
242
139(provide 'morse) 243(provide 'morse)
140 244
141;;; morse.el ends here 245;;; morse.el ends here
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 5ac30bc28ce..0f873e678c3 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -2564,19 +2564,12 @@ be more \"DWIM:ey\"."
2564 ;; Are we about to move backwards into or out of a 2564 ;; Are we about to move backwards into or out of a
2565 ;; preprocessor command? If so, locate its beginning. 2565 ;; preprocessor command? If so, locate its beginning.
2566 (when (eq (cdr res) 'macro-boundary) 2566 (when (eq (cdr res) 'macro-boundary)
2567 (setq macro-fence 2567 (save-excursion
2568 (save-excursion 2568 (beginning-of-line)
2569 (if macro-fence 2569 (setq macro-fence
2570 (progn 2570 (and (not (bobp))
2571 (end-of-line) 2571 (progn (c-skip-ws-backward) (c-beginning-of-macro))
2572 (and (not (eobp)) 2572 (point)))))
2573 (progn (c-skip-ws-forward)
2574 (c-beginning-of-macro))
2575 (progn (c-end-of-macro)
2576 (point))))
2577 (and (not (eobp))
2578 (c-beginning-of-macro)
2579 (progn (c-end-of-macro) (point)))))))
2580 ;; Are we about to move backwards into a literal? 2573 ;; Are we about to move backwards into a literal?
2581 (when (memq (cdr res) '(macro-boundary literal)) 2574 (when (memq (cdr res) '(macro-boundary literal))
2582 (setq range (c-ascertain-preceding-literal))) 2575 (setq range (c-ascertain-preceding-literal)))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 88f418f934a..40383c6bc31 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -860,27 +860,29 @@ POS and RES.")
860 (car compilation--previous-directory-cache))) 860 (car compilation--previous-directory-cache)))
861 (prev 861 (prev
862 (previous-single-property-change 862 (previous-single-property-change
863 pos 'compilation-directory nil cache))) 863 pos 'compilation-directory nil cache))
864 (cond 864 (res
865 ((null cache) 865 (cond
866 (setq compilation--previous-directory-cache 866 ((null cache)
867 (cons (copy-marker pos) (copy-marker prev))) 867 (setq compilation--previous-directory-cache
868 prev) 868 (cons (copy-marker pos) (if prev (copy-marker prev))))
869 ((eq prev cache) 869 prev)
870 (if cache 870 ((and prev (= prev cache))
871 (set-marker (car compilation--previous-directory-cache) pos) 871 (if cache
872 (setq compilation--previous-directory-cache 872 (set-marker (car compilation--previous-directory-cache) pos)
873 (cons (copy-marker pos) nil))) 873 (setq compilation--previous-directory-cache
874 (cdr compilation--previous-directory-cache)) 874 (cons (copy-marker pos) nil)))
875 (t 875 (cdr compilation--previous-directory-cache))
876 (if cache 876 (t
877 (progn 877 (if cache
878 (set-marker (car compilation--previous-directory-cache) pos) 878 (progn
879 (setcdr compilation--previous-directory-cache 879 (set-marker cache pos)
880 (copy-marker prev))) 880 (setcdr compilation--previous-directory-cache
881 (setq compilation--previous-directory-cache 881 (copy-marker prev)))
882 (cons (copy-marker pos) (copy-marker prev)))) 882 (setq compilation--previous-directory-cache
883 prev))))) 883 (cons (copy-marker pos) (if prev (copy-marker prev)))))
884 prev))))
885 (if (markerp res) (marker-position res) res))))
884 886
885;; Internal function for calculating the text properties of a directory 887;; Internal function for calculating the text properties of a directory
886;; change message. The compilation-directory property is important, because it 888;; change message. The compilation-directory property is important, because it
@@ -889,7 +891,7 @@ POS and RES.")
889(defun compilation-directory-properties (idx leave) 891(defun compilation-directory-properties (idx leave)
890 (if leave (setq leave (match-end leave))) 892 (if leave (setq leave (match-end leave)))
891 ;; find previous stack, and push onto it, or if `leave' pop it 893 ;; find previous stack, and push onto it, or if `leave' pop it
892 (let ((dir (compilation--previous-directory (point)))) 894 (let ((dir (compilation--previous-directory (match-beginning 0))))
893 (setq dir (if dir (or (get-text-property (1- dir) 'compilation-directory) 895 (setq dir (if dir (or (get-text-property (1- dir) 'compilation-directory)
894 (get-text-property dir 'compilation-directory)))) 896 (get-text-property dir 'compilation-directory))))
895 `(font-lock-face ,(if leave 897 `(font-lock-face ,(if leave
@@ -948,7 +950,8 @@ POS and RES.")
948 (match-string-no-properties file)))) 950 (match-string-no-properties file))))
949 (let ((dir 951 (let ((dir
950 (unless (file-name-absolute-p file) 952 (unless (file-name-absolute-p file)
951 (let ((pos (compilation--previous-directory (point)))) 953 (let ((pos (compilation--previous-directory
954 (match-beginning 0))))
952 (when pos 955 (when pos
953 (or (get-text-property (1- pos) 'compilation-directory) 956 (or (get-text-property (1- pos) 'compilation-directory)
954 (get-text-property pos 'compilation-directory))))))) 957 (get-text-property pos 'compilation-directory)))))))
diff --git a/lisp/progmodes/delphi.el b/lisp/progmodes/delphi.el
index c376b25fae0..0f823c806e0 100644
--- a/lisp/progmodes/delphi.el
+++ b/lisp/progmodes/delphi.el
@@ -26,14 +26,14 @@
26 26
27;; To enter Delphi mode when you find a Delphi source file, one must override 27;; To enter Delphi mode when you find a Delphi source file, one must override
28;; the auto-mode-alist to associate Delphi with .pas (and .dpr and .dpk) 28;; the auto-mode-alist to associate Delphi with .pas (and .dpr and .dpk)
29;; files. Emacs, by default, will otherwise enter Pascal mode. E.g. 29;; files. Emacs, by default, will otherwise enter Pascal mode. E.g.
30;; 30;;
31;; (autoload 'delphi-mode "delphi") 31;; (autoload 'delphi-mode "delphi")
32;; (setq auto-mode-alist 32;; (setq auto-mode-alist
33;; (cons '("\\.\\(pas\\|dpr\\|dpk\\)$" . delphi-mode) auto-mode-alist)) 33;; (cons '("\\.\\(pas\\|dpr\\|dpk\\)$" . delphi-mode) auto-mode-alist))
34 34
35;; To get keyword, comment, and string literal coloring, be sure that font-lock 35;; To get keyword, comment, and string literal coloring, be sure that font-lock
36;; is running. One can manually do M-x font-lock-mode in a Delphi buffer, or 36;; is running. One can manually do M-x font-lock-mode in a Delphi buffer, or
37;; one can put in .emacs: 37;; one can put in .emacs:
38;; 38;;
39;; (add-hook 'delphi-mode-hook 'turn-on-font-lock) 39;; (add-hook 'delphi-mode-hook 'turn-on-font-lock)
@@ -56,8 +56,8 @@
56;; When you have entered Delphi mode, you may get more info by pressing 56;; When you have entered Delphi mode, you may get more info by pressing
57;; C-h m. 57;; C-h m.
58 58
59;; This delphi mode implementation is fairly tolerant of syntax errors, relying 59;; This Delphi mode implementation is fairly tolerant of syntax errors, relying
60;; as much as possible on the indentation of the previous statement. This also 60;; as much as possible on the indentation of the previous statement. This also
61;; makes it faster and simpler, since there is less searching for properly 61;; makes it faster and simpler, since there is less searching for properly
62;; constructed beginnings. 62;; constructed beginnings.
63 63
@@ -74,15 +74,16 @@
74 "True if in debug mode.") 74 "True if in debug mode.")
75 75
76(defcustom delphi-search-path "." 76(defcustom delphi-search-path "."
77 "*Directories to search when finding external units. It is a list of 77 "*Directories to search when finding external units.
78directory strings. If only a single directory, it can be a single 78It is a list of directory strings. If only a single directory,
79string instead of a list. If a directory ends in \"...\" then that 79it can be a single string instead of a list. If a directory
80directory is recursively searched." 80ends in \"...\" then that directory is recursively searched."
81 :type 'string 81 :type 'string
82 :group 'delphi) 82 :group 'delphi)
83 83
84(defcustom delphi-indent-level 3 84(defcustom delphi-indent-level 3
85 "*Indentation of Delphi statements with respect to containing block. E.g. 85 "*Indentation of Delphi statements with respect to containing block.
86E.g.
86 87
87begin 88begin
88 // This is an indent of 3. 89 // This is an indent of 3.
@@ -117,7 +118,7 @@ end; end;"
117 :group 'delphi) 118 :group 'delphi)
118 119
119(defcustom delphi-verbose t ; nil 120(defcustom delphi-verbose t ; nil
120 "*If true then delphi token processing progress is reported to the user." 121 "*If true then Delphi token processing progress is reported to the user."
121 :type 'boolean 122 :type 'boolean
122 :group 'delphi) 123 :group 'delphi)
123 124
@@ -137,17 +138,17 @@ differs from the default."
137 :group 'delphi) 138 :group 'delphi)
138 139
139(defcustom delphi-comment-face 'font-lock-comment-face 140(defcustom delphi-comment-face 'font-lock-comment-face
140 "*Face used to color delphi comments." 141 "*Face used to color Delphi comments."
141 :type 'face 142 :type 'face
142 :group 'delphi) 143 :group 'delphi)
143 144
144(defcustom delphi-string-face 'font-lock-string-face 145(defcustom delphi-string-face 'font-lock-string-face
145 "*Face used to color delphi strings." 146 "*Face used to color Delphi strings."
146 :type 'face 147 :type 'face
147 :group 'delphi) 148 :group 'delphi)
148 149
149(defcustom delphi-keyword-face 'font-lock-keyword-face 150(defcustom delphi-keyword-face 'font-lock-keyword-face
150 "*Face used to color delphi keywords." 151 "*Face used to color Delphi keywords."
151 :type 'face 152 :type 'face
152 :group 'delphi) 153 :group 'delphi)
153 154
@@ -720,9 +721,9 @@ routine.")
720 (delphi-progress-done))))) 721 (delphi-progress-done)))))
721 722
722(defvar delphi-ignore-changes t 723(defvar delphi-ignore-changes t
723 "Internal flag to control if the delphi-mode responds to buffer changes. 724 "Internal flag to control if the Delphi mode responds to buffer changes.
724Defaults to t in case the delphi-after-change function is called on a 725Defaults to t in case the `delphi-after-change' function is called on a
725non-delphi buffer. Set to nil in a delphi buffer. To override, just do: 726non-Delphi buffer. Set to nil in a Delphi buffer. To override, just do:
726 (let ((delphi-ignore-changes t)) ...)") 727 (let ((delphi-ignore-changes t)) ...)")
727 728
728(defun delphi-after-change (change-start change-end old-length) 729(defun delphi-after-change (change-start change-end old-length)
@@ -1521,8 +1522,8 @@ non-delphi buffer. Set to nil in a delphi buffer. To override, just do:
1521 indent))) 1522 indent)))
1522 1523
1523(defun delphi-indent-line () 1524(defun delphi-indent-line ()
1524 "Indent the current line according to the current language construct. If 1525 "Indent the current line according to the current language construct.
1525before the indent, the point is moved to the indent." 1526If before the indent, the point is moved to the indent."
1526 (interactive) 1527 (interactive)
1527 (delphi-save-match-data 1528 (delphi-save-match-data
1528 (let ((marked-point (point-marker)) ; Maintain our position reliably. 1529 (let ((marked-point (point-marker)) ; Maintain our position reliably.
@@ -1547,7 +1548,7 @@ before the indent, the point is moved to the indent."
1547 (set-marker marked-point nil)))) 1548 (set-marker marked-point nil))))
1548 1549
1549(defvar delphi-mode-abbrev-table nil 1550(defvar delphi-mode-abbrev-table nil
1550 "Abbrev table in use in delphi-mode buffers.") 1551 "Abbrev table in use in Delphi mode buffers.")
1551(define-abbrev-table 'delphi-mode-abbrev-table ()) 1552(define-abbrev-table 'delphi-mode-abbrev-table ())
1552 1553
1553(defmacro delphi-ensure-buffer (buffer-var buffer-name) 1554(defmacro delphi-ensure-buffer (buffer-var buffer-name)
@@ -1568,7 +1569,7 @@ before the indent, the point is moved to the indent."
1568;; Debugging helpers: 1569;; Debugging helpers:
1569 1570
1570(defvar delphi-debug-buffer nil 1571(defvar delphi-debug-buffer nil
1571 "Buffer to write delphi-mode debug messages to. Created on demand.") 1572 "Buffer to write Delphi mode debug messages to. Created on demand.")
1572 1573
1573(defun delphi-debug-log (format-string &rest args) 1574(defun delphi-debug-log (format-string &rest args)
1574 ;; Writes a message to the log buffer. 1575 ;; Writes a message to the log buffer.
@@ -1679,7 +1680,7 @@ before the indent, the point is moved to the indent."
1679 1680
1680(defun delphi-tab () 1681(defun delphi-tab ()
1681 "Indent the region, when Transient Mark mode is enabled and the region is 1682 "Indent the region, when Transient Mark mode is enabled and the region is
1682active. Otherwise, indent the current line or insert a TAB, depending on the 1683active. Otherwise, indent the current line or insert a TAB, depending on the
1683value of `delphi-tab-always-indents' and the current line position." 1684value of `delphi-tab-always-indents' and the current line position."
1684 (interactive) 1685 (interactive)
1685 (cond ((use-region-p) 1686 (cond ((use-region-p)
@@ -1768,8 +1769,8 @@ value of `delphi-tab-always-indents' and the current line position."
1768 nil)) 1769 nil))
1769 1770
1770(defun delphi-find-unit (unit) 1771(defun delphi-find-unit (unit)
1771 "Finds the specified delphi source file according to `delphi-search-path'. 1772 "Find the specified Delphi source file according to `delphi-search-path'.
1772If no extension is specified, .pas is assumed. Creates a buffer for the unit." 1773If no extension is specified, .pas is assumed. Creates a buffer for the unit."
1773 (interactive "sDelphi unit name: ") 1774 (interactive "sDelphi unit name: ")
1774 (let* ((unit-file (if (string-match "^\\(.*\\)\\.[a-z]+$" unit) 1775 (let* ((unit-file (if (string-match "^\\(.*\\)\\.[a-z]+$" unit)
1775 unit 1776 unit
@@ -1791,7 +1792,7 @@ If no extension is specified, .pas is assumed. Creates a buffer for the unit."
1791 "Find the definition of the identifier under the current point, searching 1792 "Find the definition of the identifier under the current point, searching
1792in external units if necessary (as listed in the current unit's use clause). 1793in external units if necessary (as listed in the current unit's use clause).
1793The set of directories to search for a unit is specified by the global variable 1794The set of directories to search for a unit is specified by the global variable
1794delphi-search-path." 1795`delphi-search-path'."
1795 (interactive) 1796 (interactive)
1796 (error "delphi-find-current-xdef: not implemented yet")) 1797 (error "delphi-find-current-xdef: not implemented yet"))
1797 1798
@@ -1802,7 +1803,7 @@ it is a routine."
1802 (error "delphi-find-current-body: not implemented yet")) 1803 (error "delphi-find-current-body: not implemented yet"))
1803 1804
1804(defun delphi-fill-comment () 1805(defun delphi-fill-comment ()
1805 "Fills the text of the current comment, according to `fill-column'. 1806 "Fill the text of the current comment, according to `fill-column'.
1806An error is raised if not in a comment." 1807An error is raised if not in a comment."
1807 (interactive) 1808 (interactive)
1808 (save-excursion 1809 (save-excursion
@@ -1888,8 +1889,8 @@ An error is raised if not in a comment."
1888 (delphi-progress-done))))))) 1889 (delphi-progress-done)))))))
1889 1890
1890(defun delphi-new-comment-line () 1891(defun delphi-new-comment-line ()
1891 "If in a // comment, does a newline, indented such that one is still in the 1892 "If in a // comment, do a newline, indented such that one is still in the
1892comment block. If not in a // comment, just does a normal newline." 1893comment block. If not in a // comment, just does a normal newline."
1893 (interactive) 1894 (interactive)
1894 (let ((comment (delphi-current-token))) 1895 (let ((comment (delphi-current-token)))
1895 (if (not (eq 'comment-single-line (delphi-token-kind comment))) 1896 (if (not (eq 'comment-single-line (delphi-token-kind comment)))
@@ -1923,7 +1924,7 @@ comment block. If not in a // comment, just does a normal newline."
1923 nil ; Syntax begin movement doesn't apply 1924 nil ; Syntax begin movement doesn't apply
1924 (font-lock-fontify-region-function . delphi-fontify-region) 1925 (font-lock-fontify-region-function . delphi-fontify-region)
1925 (font-lock-verbose . delphi-fontifying-progress-step)) 1926 (font-lock-verbose . delphi-fontifying-progress-step))
1926 "Delphi mode font-lock defaults. Syntactic fontification is ignored.") 1927 "Delphi mode font-lock defaults. Syntactic fontification is ignored.")
1927 1928
1928(defvar delphi-debug-mode-map 1929(defvar delphi-debug-mode-map
1929 (let ((kmap (make-sparse-keymap))) 1930 (let ((kmap (make-sparse-keymap)))
@@ -1944,7 +1945,7 @@ comment block. If not in a // comment, just does a normal newline."
1944 ("x" delphi-debug-show-is-stable) 1945 ("x" delphi-debug-show-is-stable)
1945 )) 1946 ))
1946 kmap) 1947 kmap)
1947 "Keystrokes for delphi-mode debug commands.") 1948 "Keystrokes for Delphi mode debug commands.")
1948 1949
1949(defvar delphi-mode-map 1950(defvar delphi-mode-map
1950 (let ((kmap (make-sparse-keymap))) 1951 (let ((kmap (make-sparse-keymap)))
@@ -1964,7 +1965,7 @@ comment block. If not in a // comment, just does a normal newline."
1964 "Keymap used in Delphi mode.") 1965 "Keymap used in Delphi mode.")
1965 1966
1966(defconst delphi-mode-syntax-table (make-syntax-table) 1967(defconst delphi-mode-syntax-table (make-syntax-table)
1967 "Delphi mode's syntax table. It is just a standard syntax table. 1968 "Delphi mode's syntax table. It is just a standard syntax table.
1968This is ok since we do our own keyword/comment/string face coloring.") 1969This is ok since we do our own keyword/comment/string face coloring.")
1969 1970
1970;;;###autoload 1971;;;###autoload
@@ -1976,7 +1977,7 @@ This is ok since we do our own keyword/comment/string face coloring.")
1976\\[delphi-fill-comment]\t- Fill the current comment. 1977\\[delphi-fill-comment]\t- Fill the current comment.
1977\\[delphi-new-comment-line]\t- If in a // comment, do a new comment line. 1978\\[delphi-new-comment-line]\t- If in a // comment, do a new comment line.
1978 1979
1979M-x indent-region also works for indenting a whole region. 1980\\[indent-region] also works for indenting a whole region.
1980 1981
1981Customization: 1982Customization:
1982 1983
@@ -1996,21 +1997,21 @@ Customization:
1996 `delphi-search-path' (default .) 1997 `delphi-search-path' (default .)
1997 Directories to search when finding external units. 1998 Directories to search when finding external units.
1998 `delphi-verbose' (default nil) 1999 `delphi-verbose' (default nil)
1999 If true then delphi token processing progress is reported to the user. 2000 If true then Delphi token processing progress is reported to the user.
2000 2001
2001Coloring: 2002Coloring:
2002 2003
2003 `delphi-comment-face' (default font-lock-comment-face) 2004 `delphi-comment-face' (default font-lock-comment-face)
2004 Face used to color delphi comments. 2005 Face used to color Delphi comments.
2005 `delphi-string-face' (default font-lock-string-face) 2006 `delphi-string-face' (default font-lock-string-face)
2006 Face used to color delphi strings. 2007 Face used to color Delphi strings.
2007 `delphi-keyword-face' (default font-lock-keyword-face) 2008 `delphi-keyword-face' (default font-lock-keyword-face)
2008 Face used to color delphi keywords. 2009 Face used to color Delphi keywords.
2009 `delphi-other-face' (default nil) 2010 `delphi-other-face' (default nil)
2010 Face used to color everything else. 2011 Face used to color everything else.
2011 2012
2012Turning on Delphi mode calls the value of the variable delphi-mode-hook with 2013Turning on Delphi mode calls the value of the variable `delphi-mode-hook'
2013no args, if that value is non-nil." 2014with no args, if that value is non-nil."
2014 (interactive) 2015 (interactive)
2015 (kill-all-local-variables) 2016 (kill-all-local-variables)
2016 (use-local-map delphi-mode-map) 2017 (use-local-map delphi-mode-map)
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index d674484345a..87e5875c943 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -3566,12 +3566,12 @@ KIND is an additional string printed in the buffer."
3566 (insert kind) 3566 (insert kind)
3567 (indent-to 50) 3567 (indent-to 50)
3568 (insert (case (second info) 3568 (insert (case (second info)
3569 ('ebrowse-ts-member-functions "member function") 3569 (ebrowse-ts-member-functions "member function")
3570 ('ebrowse-ts-member-variables "member variable") 3570 (ebrowse-ts-member-variables "member variable")
3571 ('ebrowse-ts-static-functions "static function") 3571 (ebrowse-ts-static-functions "static function")
3572 ('ebrowse-ts-static-variables "static variable") 3572 (ebrowse-ts-static-variables "static variable")
3573 ('ebrowse-ts-friends (if globals-p "define" "friend")) 3573 (ebrowse-ts-friends (if globals-p "define" "friend"))
3574 ('ebrowse-ts-types "type") 3574 (ebrowse-ts-types "type")
3575 (t "unknown")) 3575 (t "unknown"))
3576 "\n"))) 3576 "\n")))
3577 3577
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 25d1410621a..ab315f9eefd 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -648,21 +648,36 @@ detailed description of this mode.
648 (set (make-local-variable 'gud-minor-mode) 'gdbmi) 648 (set (make-local-variable 'gud-minor-mode) 'gdbmi)
649 (setq comint-input-sender 'gdb-send) 649 (setq comint-input-sender 'gdb-send)
650 (when (ring-empty-p comint-input-ring) ; cf shell-mode 650 (when (ring-empty-p comint-input-ring) ; cf shell-mode
651 (let (hfile) 651 (let ((hfile (expand-file-name (or (getenv "GBDHISTFILE")
652 (when (catch 'done 652 (if (eq system-type 'ms-dos)
653 (dolist (file '(".gdbinit" "~/.gdbinit")) 653 "_gdb_history"
654 (if (file-readable-p (setq file (expand-file-name file))) 654 ".gdb_history"))))
655 (with-temp-buffer 655 ;; gdb defaults to 256, but we'll default to comint-input-ring-size.
656 (insert-file-contents file) 656 (hsize (getenv "HISTSIZE")))
657 (and (re-search-forward 657 (dolist (file (append '("~/.gdbinit")
658 "^ *set history filename *\\(.*\\)" nil t) 658 (unless (string-equal (expand-file-name ".")
659 (file-readable-p 659 (expand-file-name "~"))
660 (setq hfile (expand-file-name 660 '(".gdbinit"))))
661 (match-string 1) 661 (if (file-readable-p (setq file (expand-file-name file)))
662 (file-name-directory file)))) 662 (with-temp-buffer
663 (throw 'done t)))))) 663 (insert-file-contents file)
664 (set (make-local-variable 'comint-input-ring-file-name) hfile) 664 ;; TODO? check for "set history save\\( *on\\)?" and do
665 (comint-read-input-ring t)))) 665 ;; not use history otherwise?
666 (while (re-search-forward
667 "^ *set history \\(filename\\|size\\) *\\(.*\\)" nil t)
668 (cond ((string-equal (match-string 1) "filename")
669 (setq hfile (expand-file-name
670 (match-string 2)
671 (file-name-directory file))))
672 ((string-equal (match-string 1) "size")
673 (setq hsize (match-string 2))))))))
674 (and (stringp hsize)
675 (integerp (setq hsize (string-to-number hsize)))
676 (> hsize 0)
677 (set (make-local-variable 'comint-input-ring-size) hsize))
678 (if (stringp hfile)
679 (set (make-local-variable 'comint-input-ring-file-name) hfile))
680 (comint-read-input-ring t)))
666 (gud-def gud-tbreak "tbreak %f:%l" "\C-t" 681 (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
667 "Set temporary breakpoint at current line.") 682 "Set temporary breakpoint at current line.")
668 (gud-def gud-jump 683 (gud-def gud-jump
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 53918b903ee..47cbdf19ed2 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -3127,7 +3127,9 @@ class of the file (using s to separate nested class ids)."
3127 ("^document\\s-.*\\(\n\\)" (1 "< b")) 3127 ("^document\\s-.*\\(\n\\)" (1 "< b"))
3128 ("^end\\(\\>\\)" 3128 ("^end\\(\\>\\)"
3129 (1 (ignore 3129 (1 (ignore
3130 (unless (eq (match-beginning 0) (point-min)) 3130 (when (and (> (match-beginning 0) (point-min))
3131 (eq 1 (nth 7 (save-excursion
3132 (syntax-ppss (1- (match-beginning 0)))))))
3131 ;; We change the \n in front, which is more difficult, but results 3133 ;; We change the \n in front, which is more difficult, but results
3132 ;; in better highlighting. If the doc is empty, the single \n is 3134 ;; in better highlighting. If the doc is empty, the single \n is
3133 ;; both the beginning and the end of the docstring, which can't be 3135 ;; both the beginning and the end of the docstring, which can't be
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 9d40b4d8fd7..c8b156c5441 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -974,7 +974,7 @@ With ARG, do it many times. Negative ARG means move forward."
974 (goto-char (scan-sexps (1+ (point)) -1)) 974 (goto-char (scan-sexps (1+ (point)) -1))
975 (case (char-before) 975 (case (char-before)
976 (?% (forward-char -1)) 976 (?% (forward-char -1))
977 ('(?q ?Q ?w ?W ?r ?x) 977 ((?q ?Q ?w ?W ?r ?x)
978 (if (eq (char-before (1- (point))) ?%) (forward-char -2)))) 978 (if (eq (char-before (1- (point))) ?%) (forward-char -2))))
979 nil) 979 nil)
980 ((looking-at "\\s\"\\|\\\\\\S_") 980 ((looking-at "\\s\"\\|\\\\\\S_")
diff --git a/lisp/server.el b/lisp/server.el
index 019a16a43d7..ce14f133f0a 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -486,7 +486,13 @@ See variable `server-auth-dir' for details."
486 (file-name-as-directory dir)) 486 (file-name-as-directory dir))
487 :warning) 487 :warning)
488 (throw :safe t)) 488 (throw :safe t))
489 (unless (eql uid (user-uid)) ; is the dir ours? 489 (unless (or (= uid (user-uid)) ; is the dir ours?
490 (and w32
491 ;; Files created on Windows by
492 ;; Administrator (RID=500) have
493 ;; the Administrators (RID=544)
494 ;; group recorded as the owner.
495 (= uid 544) (= (user-uid) 500)))
490 (throw :safe nil)) 496 (throw :safe nil))
491 (when w32 ; on NTFS? 497 (when w32 ; on NTFS?
492 (throw :safe t)) 498 (throw :safe t))
diff --git a/lisp/shell.el b/lisp/shell.el
index 2f11cc6314c..dde81c6cb95 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -459,7 +459,12 @@ buffer."
459 ;; shell-dependent assignments. 459 ;; shell-dependent assignments.
460 (when (ring-empty-p comint-input-ring) 460 (when (ring-empty-p comint-input-ring)
461 (let ((shell (file-name-nondirectory (car 461 (let ((shell (file-name-nondirectory (car
462 (process-command (get-buffer-process (current-buffer))))))) 462 (process-command (get-buffer-process (current-buffer))))))
463 (hsize (getenv "HISTSIZE")))
464 (and (stringp hsize)
465 (integerp (setq hsize (string-to-number hsize)))
466 (> hsize 0)
467 (set (make-local-variable 'comint-input-ring-size) hsize))
463 (setq comint-input-ring-file-name 468 (setq comint-input-ring-file-name
464 (or (getenv "HISTFILE") 469 (or (getenv "HISTFILE")
465 (cond ((string-equal shell "bash") "~/.bash_history") 470 (cond ((string-equal shell "bash") "~/.bash_history")
@@ -578,6 +583,21 @@ Otherwise, one argument `-i' is passed to the shell.
578 (get-buffer-create (or buffer "*shell*")) 583 (get-buffer-create (or buffer "*shell*"))
579 ;; If the current buffer is a dead shell buffer, use it. 584 ;; If the current buffer is a dead shell buffer, use it.
580 (current-buffer))) 585 (current-buffer)))
586
587 ;; On remote hosts, the local `shell-file-name' might be useless.
588 (if (and (interactive-p)
589 (file-remote-p default-directory)
590 (null explicit-shell-file-name)
591 (null (getenv "ESHELL")))
592 (with-current-buffer buffer
593 (set (make-local-variable 'explicit-shell-file-name)
594 (file-remote-p
595 (expand-file-name
596 (read-file-name
597 "Remote shell path: " default-directory shell-file-name
598 t shell-file-name))
599 'localname))))
600
581 ;; Pop to buffer, so that the buffer's window will be correctly set 601 ;; Pop to buffer, so that the buffer's window will be correctly set
582 ;; when we call comint (so that comint sets the COLUMNS env var properly). 602 ;; when we call comint (so that comint sets the COLUMNS env var properly).
583 (pop-to-buffer buffer) 603 (pop-to-buffer buffer)
diff --git a/lisp/simple.el b/lisp/simple.el
index 7a191f0cc9a..e4c742b56f4 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -636,7 +636,9 @@ If the region is active, only delete whitespace within the region."
636 (if (looking-at ".*\f") 636 (if (looking-at ".*\f")
637 (goto-char (match-end 0)))) 637 (goto-char (match-end 0))))
638 (delete-region (point) (match-end 0))) 638 (delete-region (point) (match-end 0)))
639 (set-marker end-marker nil))))) 639 (set-marker end-marker nil))))
640 ;; Return nil for the benefit of `write-file-functions'.
641 nil)
640 642
641(defun newline-and-indent () 643(defun newline-and-indent ()
642 "Insert a newline, then indent according to major mode. 644 "Insert a newline, then indent according to major mode.
@@ -2627,7 +2629,7 @@ specifies the value of ERROR-BUFFER."
2627 (with-output-to-string 2629 (with-output-to-string
2628 (with-current-buffer 2630 (with-current-buffer
2629 standard-output 2631 standard-output
2630 (call-process shell-file-name nil t nil shell-command-switch command)))) 2632 (process-file shell-file-name nil t nil shell-command-switch command))))
2631 2633
2632(defun process-file (program &optional infile buffer display &rest args) 2634(defun process-file (program &optional infile buffer display &rest args)
2633 "Process files synchronously in a separate process. 2635 "Process files synchronously in a separate process.
diff --git a/lisp/startup.el b/lisp/startup.el
index 4dbf41d3ac6..765ca1540ee 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -392,6 +392,15 @@ Warning Warning!!! Pure space overflow !!!Warning Warning
392 :type 'directory 392 :type 'directory
393 :initialize 'custom-initialize-delay) 393 :initialize 'custom-initialize-delay)
394 394
395(defconst package-subdirectory-regexp
396 "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)"
397 "Regular expression matching the name of a package subdirectory.
398The first subexpression is the package name.
399The second subexpression is the version string.
400
401The regexp should not contain a starting \"\\`\" or a trailing
402 \"\\'\"; those are added automatically by callers.")
403
395(defun normal-top-level-add-subdirs-to-load-path () 404(defun normal-top-level-add-subdirs-to-load-path ()
396 "Add all subdirectories of current directory to `load-path'. 405 "Add all subdirectories of current directory to `load-path'.
397More precisely, this uses only the subdirectories whose names 406More precisely, this uses only the subdirectories whose names
@@ -1006,19 +1015,23 @@ opening the first frame (e.g. open a connection to an X server).")
1006 (if init-file-user 1015 (if init-file-user
1007 (let ((user-init-file-1 1016 (let ((user-init-file-1
1008 (cond 1017 (cond
1009 ((eq system-type 'ms-dos) 1018 ((eq system-type 'ms-dos)
1010 (concat "~" init-file-user "/_emacs")) 1019 (concat "~" init-file-user "/_emacs"))
1011 ((eq system-type 'windows-nt) 1020 ((not (eq system-type 'windows-nt))
1012 ;; Prefer .emacs on Windows. 1021 (concat "~" init-file-user "/.emacs"))
1013 (if (directory-files "~" nil "^\\.emacs\\(\\.elc?\\)?$") 1022 ;; Else deal with the Windows situation
1014 "~/.emacs" 1023 ((directory-files "~" nil "^\\.emacs\\(\\.elc?\\)?$")
1015 ;; Also support _emacs for compatibility. 1024 ;; Prefer .emacs on Windows.
1016 (if (directory-files "~" nil "^_emacs\\(\\.elc?\\)?$") 1025 "~/.emacs")
1017 "~/_emacs" 1026 ((directory-files "~" nil "^_emacs\\(\\.elc?\\)?$")
1018 ;; But default to .emacs if _emacs does not exist. 1027 ;; Also support _emacs for compatibility, but warn about it.
1019 "~/.emacs"))) 1028 (display-warning
1020 (t 1029 'initialization
1021 (concat "~" init-file-user "/.emacs"))))) 1030 "`_emacs' init file is deprecated, please use `.emacs'"
1031 :warning)
1032 "~/_emacs")
1033 (t ;; But default to .emacs if _emacs does not exist.
1034 "~/.emacs"))))
1022 ;; This tells `load' to store the file name found 1035 ;; This tells `load' to store the file name found
1023 ;; into user-init-file. 1036 ;; into user-init-file.
1024 (setq user-init-file t) 1037 (setq user-init-file t)
@@ -1190,9 +1203,9 @@ the `--debug-init' option to view a complete error backtrace."
1190 (when (file-directory-p dir) 1203 (when (file-directory-p dir)
1191 (dolist (subdir (directory-files dir)) 1204 (dolist (subdir (directory-files dir))
1192 (when (and (file-directory-p (expand-file-name subdir dir)) 1205 (when (and (file-directory-p (expand-file-name subdir dir))
1193 ;; package-subdirectory-regexp from package.el 1206 (string-match
1194 (string-match "^\\([^.].*\\)-\\([0-9]+\\(?:[.][0-9]+\\)*\\)$" 1207 (concat "\\`" package-subdirectory-regexp "\\'")
1195 subdir)) 1208 subdir))
1196 (throw 'package-dir-found t))))))) 1209 (throw 'package-dir-found t)))))))
1197 (package-initialize)) 1210 (package-initialize))
1198 1211
diff --git a/lisp/subr.el b/lisp/subr.el
index 45cfb56bdc1..9f4e35fcbe0 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2066,24 +2066,24 @@ If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
2066keyboard-quit events while waiting for a valid input." 2066keyboard-quit events while waiting for a valid input."
2067 (unless (consp chars) 2067 (unless (consp chars)
2068 (error "Called `read-char-choice' without valid char choices")) 2068 (error "Called `read-char-choice' without valid char choices"))
2069 (let ((cursor-in-echo-area t) 2069 (let (char done)
2070 (executing-kbd-macro executing-kbd-macro) 2070 (let ((cursor-in-echo-area t)
2071 char done) 2071 (executing-kbd-macro executing-kbd-macro))
2072 (while (not done) 2072 (while (not done)
2073 (unless (get-text-property 0 'face prompt) 2073 (unless (get-text-property 0 'face prompt)
2074 (setq prompt (propertize prompt 'face 'minibuffer-prompt))) 2074 (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
2075 (setq char (let ((inhibit-quit inhibit-keyboard-quit)) 2075 (setq char (let ((inhibit-quit inhibit-keyboard-quit))
2076 (read-key prompt))) 2076 (read-key prompt)))
2077 (cond 2077 (cond
2078 ((not (numberp char))) 2078 ((not (numberp char)))
2079 ((memq char chars) 2079 ((memq char chars)
2080 (setq done t)) 2080 (setq done t))
2081 ((and executing-kbd-macro (= char -1)) 2081 ((and executing-kbd-macro (= char -1))
2082 ;; read-event returns -1 if we are in a kbd macro and 2082 ;; read-event returns -1 if we are in a kbd macro and
2083 ;; there are no more events in the macro. Attempt to 2083 ;; there are no more events in the macro. Attempt to
2084 ;; get an event interactively. 2084 ;; get an event interactively.
2085 (setq executing-kbd-macro nil)))) 2085 (setq executing-kbd-macro nil)))))
2086 ;; Display the question with the answer. 2086 ;; Display the question with the answer. But without cursor-in-echo-area.
2087 (message "%s%s" prompt (char-to-string char)) 2087 (message "%s%s" prompt (char-to-string char))
2088 char)) 2088 char))
2089 2089
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index dfd12a005a9..7e9ce9aff6d 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -318,11 +318,12 @@ chapter."
318 318
319(defconst texinfo-environments 319(defconst texinfo-environments
320 '("cartouche" "copying" "defcv" "deffn" "defivar" "defmac" 320 '("cartouche" "copying" "defcv" "deffn" "defivar" "defmac"
321 "defmethod" "defop" "defopt" "defspec" "deftp" "deftypefn" 321 "defmethod" "defop" "defopt" "defspec" "deftp" "deftypecv"
322 "deftypefun" "deftypevar" "deftypevr" "defun" "defvar" 322 "deftypefn" "deftypefun" "deftypeivar" "deftypemethod"
323 "deftypeop" "deftypevar" "deftypevr" "defun" "defvar"
323 "defvr" "description" "detailmenu" "direntry" "display" 324 "defvr" "description" "detailmenu" "direntry" "display"
324 "documentdescription" "enumerate" "example" "flushleft" 325 "documentdescription" "enumerate" "example" "flushleft"
325 "flushright" "format" "ftable" "group" "ifclear" "ifset" 326 "flushright" "format" "ftable" "group" "html" "ifclear" "ifset"
326 "ifhtml" "ifinfo" "ifnothtml" "ifnotinfo" "ifnotplaintext" 327 "ifhtml" "ifinfo" "ifnothtml" "ifnotinfo" "ifnotplaintext"
327 "ifnottex" "ifplaintext" "iftex" "ignore" "itemize" "lisp" 328 "ifnottex" "ifplaintext" "iftex" "ignore" "itemize" "lisp"
328 "macro" "menu" "multitable" "quotation" "smalldisplay" 329 "macro" "menu" "multitable" "quotation" "smalldisplay"
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index f55629b3ea1..50f20cea779 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -122,8 +122,7 @@ when editing big diffs)."
122 ("\C-m" . diff-goto-source) 122 ("\C-m" . diff-goto-source)
123 ([mouse-2] . diff-goto-source) 123 ([mouse-2] . diff-goto-source)
124 ;; From XEmacs' diff-mode. 124 ;; From XEmacs' diff-mode.
125 ;; Standard M-w is useful, so don't change M-W. 125 ("W" . widen)
126 ;;("W" . widen)
127 ;;("." . diff-goto-source) ;display-buffer 126 ;;("." . diff-goto-source) ;display-buffer
128 ;;("f" . diff-goto-source) ;find-file 127 ;;("f" . diff-goto-source) ;find-file
129 ("o" . diff-goto-source) ;other-window 128 ("o" . diff-goto-source) ;other-window
@@ -135,17 +134,21 @@ when editing big diffs)."
135 ;; Not useful if you have to metafy them. 134 ;; Not useful if you have to metafy them.
136 ;;(" " . scroll-up) 135 ;;(" " . scroll-up)
137 ;;("\177" . scroll-down) 136 ;;("\177" . scroll-down)
138 ;; Standard M-a is useful, so don't change M-A. 137 ("A" . diff-ediff-patch)
139 ;;("A" . diff-ediff-patch) 138 ("r" . diff-restrict-view)
140 ;; Standard M-r is useful, so don't change M-r or M-R. 139 ("R" . diff-reverse-direction))
141 ;;("r" . diff-restrict-view)
142 ;;("R" . diff-reverse-direction)
143 )
144 "Basic keymap for `diff-mode', bound to various prefix keys." 140 "Basic keymap for `diff-mode', bound to various prefix keys."
145 :inherit special-mode-map) 141 :inherit special-mode-map)
146 142
147(easy-mmode-defmap diff-mode-map 143(easy-mmode-defmap diff-mode-map
148 `(("\e" . ,diff-mode-shared-map) 144 `(("\e" . ,(let ((map (make-sparse-keymap)))
145 ;; We want to inherit most bindings from diff-mode-shared-map,
146 ;; but not all since they may hide useful M-<foo> global
147 ;; bindings when editing.
148 (set-keymap-parent map diff-mode-shared-map)
149 (dolist (key '("A" "r" "R" "g" "q" "W"))
150 (define-key map key nil))
151 map))
149 ;; From compilation-minor-mode. 152 ;; From compilation-minor-mode.
150 ("\C-c\C-c" . diff-goto-source) 153 ("\C-c\C-c" . diff-goto-source)
151 ;; By analogy with the global C-x 4 a binding. 154 ;; By analogy with the global C-x 4 a binding.
diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el
index 601b6b1e597..5435a840ac9 100644
--- a/lisp/vc/emerge.el
+++ b/lisp/vc/emerge.el
@@ -3176,21 +3176,26 @@ See also `auto-save-file-name-p'."
3176 3176
3177;; Metacharacters that have to be protected from the shell when executing 3177;; Metacharacters that have to be protected from the shell when executing
3178;; a diff/diff3 command. 3178;; a diff/diff3 command.
3179(defcustom emerge-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]" 3179(defcustom emerge-metachars
3180 "Characters that must be quoted with \\ when used in a shell command line. 3180 (if (memq system-type '(ms-dos windows-nt))
3181 "[ \t\"<>|?*^&=]"
3182 "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]")
3183 "Characters that must be quoted when used in a shell command line.
3181More precisely, a [...] regexp to match any one such character." 3184More precisely, a [...] regexp to match any one such character."
3182 :type 'regexp 3185 :type 'regexp
3183 :group 'emerge) 3186 :group 'emerge)
3184 3187
3185;; Quote metacharacters (using \) when executing a diff/diff3 command. 3188;; Quote metacharacters (using \) when executing a diff/diff3 command.
3186(defun emerge-protect-metachars (s) 3189(defun emerge-protect-metachars (s)
3187 (let ((limit 0)) 3190 (if (memq system-type '(ms-dos windows-nt))
3188 (while (string-match emerge-metachars s limit) 3191 (shell-quote-argument s)
3189 (setq s (concat (substring s 0 (match-beginning 0)) 3192 (let ((limit 0))
3190 "\\" 3193 (while (string-match emerge-metachars s limit)
3191 (substring s (match-beginning 0)))) 3194 (setq s (concat (substring s 0 (match-beginning 0))
3192 (setq limit (1+ (match-end 0))))) 3195 "\\"
3193 s) 3196 (substring s (match-beginning 0))))
3197 (setq limit (1+ (match-end 0)))))
3198 s))
3194 3199
3195(provide 'emerge) 3200(provide 'emerge)
3196 3201
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index a0a16601ed7..21cb86a9840 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -435,8 +435,13 @@ If any error occurred in running `bzr status', then return nil."
435(defun vc-bzr-state (file) 435(defun vc-bzr-state (file)
436 (lexical-let ((result (vc-bzr-status file))) 436 (lexical-let ((result (vc-bzr-status file)))
437 (when (consp result) 437 (when (consp result)
438 (when (cdr result) 438 (let ((warnings (cdr result)))
439 (message "Warnings in `bzr' output: %s" (cdr result))) 439 (when warnings
440 ;; bzr 2.3.0 returns info about shelves, which is not really a warning
441 (when (string-match "[1-9]+ shel\\(f\\|ves\\) exists?\\..*?\n" warnings)
442 (setq warnings (replace-match "" nil nil warnings)))
443 (unless (string= warnings "")
444 (message "Warnings in `bzr' output: %s" warnings))))
440 (cdr (assq (car result) 445 (cdr (assq (car result)
441 '((added . added) 446 '((added . added)
442 (kindchanged . edited) 447 (kindchanged . edited)
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index d4970207b94..01b6f2fc26e 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -104,7 +104,7 @@ See `run-hooks'."
104 ;; We pass a filename to create-file-buffer because it is what 104 ;; We pass a filename to create-file-buffer because it is what
105 ;; the function expects, and also what uniquify needs (if active) 105 ;; the function expects, and also what uniquify needs (if active)
106 (with-current-buffer (create-file-buffer (expand-file-name bname dir)) 106 (with-current-buffer (create-file-buffer (expand-file-name bname dir))
107 (cd dir) 107 (setq default-directory dir)
108 (vc-setup-buffer (current-buffer)) 108 (vc-setup-buffer (current-buffer))
109 ;; Reset the vc-parent-buffer-name so that it does not appear 109 ;; Reset the vc-parent-buffer-name so that it does not appear
110 ;; in the mode-line. 110 ;; in the mode-line.
@@ -1002,7 +1002,7 @@ specific headers."
1002 (generate-new-buffer (format " *VC-%s* tmp status" backend)))) 1002 (generate-new-buffer (format " *VC-%s* tmp status" backend))))
1003 (lexical-let ((buffer (current-buffer))) 1003 (lexical-let ((buffer (current-buffer)))
1004 (with-current-buffer vc-dir-process-buffer 1004 (with-current-buffer vc-dir-process-buffer
1005 (cd def-dir) 1005 (setq default-directory def-dir)
1006 (erase-buffer) 1006 (erase-buffer)
1007 (vc-call-backend 1007 (vc-call-backend
1008 backend 'dir-status-files def-dir files default-state 1008 backend 'dir-status-files def-dir files default-state
@@ -1067,7 +1067,7 @@ Throw an error if another update process is in progress."
1067 (ewoc-set-hf vc-ewoc (vc-dir-headers backend def-dir) "") 1067 (ewoc-set-hf vc-ewoc (vc-dir-headers backend def-dir) "")
1068 (lexical-let ((buffer (current-buffer))) 1068 (lexical-let ((buffer (current-buffer)))
1069 (with-current-buffer vc-dir-process-buffer 1069 (with-current-buffer vc-dir-process-buffer
1070 (cd def-dir) 1070 (setq default-directory def-dir)
1071 (erase-buffer) 1071 (erase-buffer)
1072 (vc-call-backend 1072 (vc-call-backend
1073 backend 'dir-status def-dir 1073 backend 'dir-status def-dir
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 3b4d0e5f421..711a573ba99 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -119,6 +119,12 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
119 :version "23.1" 119 :version "23.1"
120 :group 'vc) 120 :group 'vc)
121 121
122(defcustom vc-git-program "git"
123 "Name of the Git executable (excluding any arguments)."
124 :version "24.1"
125 :type 'string
126 :group 'vc)
127
122(defcustom vc-git-root-log-format 128(defcustom vc-git-root-log-format
123 '("%d%h..: %an %ad %s" 129 '("%d%h..: %an %ad %s"
124 ;; The first shy group matches the characters drawn by --graph. 130 ;; The first shy group matches the characters drawn by --graph.
@@ -554,7 +560,7 @@ or an empty string if none."
554 "Return the existing branches, as a list of strings. 560 "Return the existing branches, as a list of strings.
555The car of the list is the current branch." 561The car of the list is the current branch."
556 (with-temp-buffer 562 (with-temp-buffer
557 (call-process "git" nil t nil "branch") 563 (call-process vc-git-program nil t nil "branch")
558 (goto-char (point-min)) 564 (goto-char (point-min))
559 (let (current-branch branches) 565 (let (current-branch branches)
560 (while (not (eobp)) 566 (while (not (eobp))
@@ -633,13 +639,13 @@ for the Git command to run."
633 (let* ((root (vc-git-root default-directory)) 639 (let* ((root (vc-git-root default-directory))
634 (buffer (format "*vc-git : %s*" (expand-file-name root))) 640 (buffer (format "*vc-git : %s*" (expand-file-name root)))
635 (command "pull") 641 (command "pull")
636 (git-program "git") 642 (git-program vc-git-program)
637 args) 643 args)
638 ;; If necessary, prompt for the exact command. 644 ;; If necessary, prompt for the exact command.
639 (when prompt 645 (when prompt
640 (setq args (split-string 646 (setq args (split-string
641 (read-shell-command "Git pull command: " 647 (read-shell-command "Git pull command: "
642 "git pull" 648 (format "%s pull" git-program)
643 'vc-git-history) 649 'vc-git-history)
644 " " t)) 650 " " t))
645 (setq git-program (car args) 651 (setq git-program (car args)
@@ -663,7 +669,7 @@ This prompts for a branch to merge from."
663 branches 669 branches
664 (cons "FETCH_HEAD" branches)) 670 (cons "FETCH_HEAD" branches))
665 nil t))) 671 nil t)))
666 (apply 'vc-do-async-command buffer root "git" "merge" 672 (apply 'vc-do-async-command buffer root vc-git-program "merge"
667 (list merge-source)) 673 (list merge-source))
668 (vc-set-async-update buffer))) 674 (vc-set-async-update buffer)))
669 675
@@ -1083,8 +1089,10 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
1083 1089
1084(defun vc-git-command (buffer okstatus file-or-list &rest flags) 1090(defun vc-git-command (buffer okstatus file-or-list &rest flags)
1085 "A wrapper around `vc-do-command' for use in vc-git.el. 1091 "A wrapper around `vc-do-command' for use in vc-git.el.
1086The difference to vc-do-command is that this function always invokes `git'." 1092The difference to vc-do-command is that this function always invokes
1087 (apply 'vc-do-command (or buffer "*vc*") okstatus "git" file-or-list flags)) 1093`vc-git-program'."
1094 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program
1095 file-or-list flags))
1088 1096
1089(defun vc-git--empty-db-p () 1097(defun vc-git--empty-db-p ()
1090 "Check if the git db is empty (no commit done yet)." 1098 "Check if the git db is empty (no commit done yet)."
@@ -1095,7 +1103,7 @@ The difference to vc-do-command is that this function always invokes `git'."
1095 ;; We don't need to care the arguments. If there is a file name, it 1103 ;; We don't need to care the arguments. If there is a file name, it
1096 ;; is always a relative one. This works also for remote 1104 ;; is always a relative one. This works also for remote
1097 ;; directories. 1105 ;; directories.
1098 (apply 'process-file "git" nil buffer nil command args)) 1106 (apply 'process-file vc-git-program nil buffer nil command args))
1099 1107
1100(defun vc-git--out-ok (command &rest args) 1108(defun vc-git--out-ok (command &rest args)
1101 (zerop (apply 'vc-git--call '(t nil) command args))) 1109 (zerop (apply 'vc-git--call '(t nil) command args)))
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index d283c39362a..0516abbf024 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -529,9 +529,9 @@ REV is the revision to check out into WORKFILE."
529 (insert (propertize 529 (insert (propertize
530 (format " (%s %s)" 530 (format " (%s %s)"
531 (case (vc-hg-extra-fileinfo->rename-state extra) 531 (case (vc-hg-extra-fileinfo->rename-state extra)
532 ('copied "copied from") 532 (copied "copied from")
533 ('renamed-from "renamed from") 533 (renamed-from "renamed from")
534 ('renamed-to "renamed to")) 534 (renamed-to "renamed to"))
535 (vc-hg-extra-fileinfo->extra-name extra)) 535 (vc-hg-extra-fileinfo->extra-name extra))
536 'face 'font-lock-comment-face))))) 536 'face 'font-lock-comment-face)))))
537 537
@@ -663,14 +663,15 @@ then attempts to update the working directory."
663 (let* ((root (vc-hg-root default-directory)) 663 (let* ((root (vc-hg-root default-directory))
664 (buffer (format "*vc-hg : %s*" (expand-file-name root))) 664 (buffer (format "*vc-hg : %s*" (expand-file-name root)))
665 (command "pull") 665 (command "pull")
666 (hg-program "hg") 666 (hg-program vc-hg-program)
667 ;; Fixme: before updating the working copy to the latest 667 ;; Fixme: before updating the working copy to the latest
668 ;; state, should check if it's visiting an old revision. 668 ;; state, should check if it's visiting an old revision.
669 (args '("-u"))) 669 (args '("-u")))
670 ;; If necessary, prompt for the exact command. 670 ;; If necessary, prompt for the exact command.
671 (when prompt 671 (when prompt
672 (setq args (split-string 672 (setq args (split-string
673 (read-shell-command "Run Hg (like this): " "hg pull -u" 673 (read-shell-command "Run Hg (like this): "
674 (format "%s pull -u" hg-program)
674 'vc-hg-history) 675 'vc-hg-history)
675 " " t)) 676 " " t))
676 (setq hg-program (car args) 677 (setq hg-program (car args)
@@ -685,7 +686,7 @@ then attempts to update the working directory."
685This runs the command \"hg merge\"." 686This runs the command \"hg merge\"."
686 (let* ((root (vc-hg-root default-directory)) 687 (let* ((root (vc-hg-root default-directory))
687 (buffer (format "*vc-hg : %s*" (expand-file-name root)))) 688 (buffer (format "*vc-hg : %s*" (expand-file-name root))))
688 (apply 'vc-do-async-command buffer root "hg" '("merge")) 689 (apply 'vc-do-async-command buffer root vc-hg-program '("merge"))
689 (vc-set-async-update buffer))) 690 (vc-set-async-update buffer)))
690 691
691;;; Internal functions 692;;; Internal functions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 200291bd925..7f55ffdbdad 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1115,9 +1115,12 @@ merge in the changes into your working copy."
1115 (dolist (file files) 1115 (dolist (file files)
1116 (unless (file-writable-p file) 1116 (unless (file-writable-p file)
1117 ;; Make the file+buffer read-write. 1117 ;; Make the file+buffer read-write.
1118 (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue?" file)) 1118 (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue? " file))
1119 (error "Aborted")) 1119 (error "Aborted"))
1120 (set-file-modes file (logior (file-modes file) 128)) 1120 ;; Maybe we somehow lost permissions on the directory.
1121 (condition-case nil
1122 (set-file-modes file (logior (file-modes file) 128))
1123 (error (error "Unable to make file writable")))
1121 (let ((visited (get-file-buffer file))) 1124 (let ((visited (get-file-buffer file)))
1122 (when visited 1125 (when visited
1123 (with-current-buffer visited 1126 (with-current-buffer visited
diff --git a/src/.gdbinit b/src/.gdbinit
index 3072dc956b9..2cf5663df91 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -392,7 +392,7 @@ define pwinx
392 printf "Window %d ", $int 392 printf "Window %d ", $int
393 xgetptr $w->buffer 393 xgetptr $w->buffer
394 set $tem = (struct buffer *) $ptr 394 set $tem = (struct buffer *) $ptr
395 xgetptr $tem->name 395 xgetptr $tem->name_
396 printf "%s", ((struct Lisp_String *) $ptr)->data 396 printf "%s", ((struct Lisp_String *) $ptr)->data
397 printf "\n" 397 printf "\n"
398 xgetptr $w->start 398 xgetptr $w->start
@@ -938,7 +938,7 @@ end
938define xbuffer 938define xbuffer
939 xgetptr $ 939 xgetptr $
940 print (struct buffer *) $ptr 940 print (struct buffer *) $ptr
941 xgetptr $->name 941 xgetptr $->name_
942 output ((struct Lisp_String *) $ptr)->data 942 output ((struct Lisp_String *) $ptr)->data
943 echo \n 943 echo \n
944end 944end
diff --git a/src/ChangeLog.trunk b/src/ChangeLog.trunk
index a96edcdfdca..6fa2d821565 100644
--- a/src/ChangeLog.trunk
+++ b/src/ChangeLog.trunk
@@ -1,3 +1,796 @@
12011-03-20 Glenn Morris <rgm@gnu.org>
2
3 * config.in: Remove file.
4
52011-03-20 Juanma Barranquero <lekktu@gmail.com>
6
7 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
8 are now in src/globals.h.
9 (syms_of_minibuf): Remove spurious & from previous change.
10
112011-03-20 Leo <sdl.web@gmail.com>
12
13 * minibuf.c (completing-read-function): New variable.
14 (completing-read-default): Rename from completing-read.
15 (completing-read): Call completing-read-function.
16
172011-03-19 Juanma Barranquero <lekktu@gmail.com>
18
19 * xfaces.c (Fx_load_color_file):
20 Read color file from absolute filename (bug#8250).
21
222011-03-19 Juanma Barranquero <lekktu@gmail.com>
23
24 * makefile.w32-in: Update dependencies.
25
262011-03-17 Eli Zaretskii <eliz@gnu.org>
27
28 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
29
302011-03-17 Paul Eggert <eggert@cs.ucla.edu>
31
32 Fix more problems found by GCC 4.5.2's static checks.
33
34 * process.c (make_serial_process_unwind, send_process_trap):
35 (sigchld_handler): Now static.
36
37 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
38 That way, the code declares only the vars that it needs.
39 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
40 * s/cygwin.h (PTY_ITERATION): Likewise.
41 * s/darwin.h (PTY_ITERATION): Likewise.
42 * s/gnu-linux.h (PTY_ITERATION): Likewise.
43
44 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
45 * process.c (allocate_pty): Don't declare stb unless it's needed.
46
47 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
48 (CONSTANTLIM): Remove; unused.
49 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
50 Define only if needed.
51
52 * unexelf.c (unexec): Name an expression,
53 to avoid gcc -Wbad-function-cast warning.
54 Use a different way to cause a compilation error if anyone uses
55 n rather than nn, a way that does not involve shadowing.
56 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
57
58 * deps.mk (unexalpha.o): Remove; unused.
59
60 New file unexec.h, the (simple) interface for unexec (Bug#8267).
61 * unexec.h: New file.
62 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
63 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
64 Depend on unexec.h.
65 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
66 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
67 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
68 Change as necessary to match prototype in unexec.h.
69
70 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
71 shadowing.
72 (back_comment, skip_chars): Mark vars as initialized.
73
74 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
75 Rename locals to avoid shadowing.
76
77 * lread.c (read1): Rewrite so as not to use empty "else".
78 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
79
80 * print.c (Fredirect_debugging_output): Fix pointer signedess.
81
82 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
83 warning when compiling print.c.
84
85 * font.c (font_unparse_fcname): Abort in an "impossible" situation
86 instead of using an uninitialized var.
87 (font_sort_entities): Mark var as initialized.
88
89 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
90
91 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
92 pointers to constants.
93 (font_parse_fcname): Remove unused vars.
94 (font_delete_unmatched): Now static.
95 (font_get_spec): Remove; unused.
96 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
97 (font_update_drivers, Ffont_get_glyphs, font_add_log):
98 Rename or move locals to avoid shadowing.
99
100 * fns.c (require_nesting_list, require_unwind): Now static.
101 (Ffillarray): Rename locals to avoid shadowing.
102
103 * floatfns.c (domain_error2): Define only if needed.
104 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
105
106 * alloc.c (mark_backtrace): Move decl from here ...
107 * lisp.h: ... to here, so that it can be checked.
108
109 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
110 (Fdefvar): Rewrite so as not to use empty "else".
111 (lisp_indirect_variable): Name an expression,
112 to avoid gcc -Wbad-function-cast warning.
113 (Fdefvar): Rename locals to avoid shadowing.
114
115 * callint.c (quotify_arg, quotify_args): Now static.
116 (Fcall_interactively): Rename locals to avoid shadowing.
117 Use const pointer when appropriate.
118
119 * lisp.h (get_system_name, get_operating_system_release):
120 Move decls here, to check interfaces.
121 * process.c (get_operating_system_release): Move decl to lisp.h.
122 * xrdb.c (get_system_name): Likewise.
123 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
124 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
125 some of which prompt warnings from gcc -Wbad-function-cast.
126 (Fformat_time_string, Fencode_time, Finsert_char):
127 (Ftranslate_region_internal, Fformat):
128 Rename or remove local vars to avoid shadowing.
129 (Ftranslate_region_internal): Mark var as initialized.
130
131 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
132 avoid shadowing.
133
134 * lisp.h (eassert): Check that the argument compiles, even if
135 ENABLE_CHECKING is not defined.
136
137 * data.c (Findirect_variable): Name an expression, to avoid
138 gcc -Wbad-function-cast warning.
139 (default_value, arithcompare, arith_driver, arith_error): Now static.
140 (store_symval_forwarding): Rename local to avoid shadowing.
141 (Fmake_variable_buffer_local, Fmake_local_variable): Mark
142 variables as initialized.
143 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
144
145 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
146 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
147 Rename locals to avoid shadowing.
148 (mark_stack): Move local variables into the #ifdef region where
149 they're used.
150 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
151 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
152 needed otherwise.
153 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
154 (GC_STRING_CHARS): Remove; not used.
155 (Fmemory_limit): Cast sbrk's returned value to char *.
156
157 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
158 avoids undefined behavior in theory.
159
160 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
161
162 Use functions, not macros, for up- and down-casing (Bug#8254).
163 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
164 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
165 to use the following functions instead of these macros.
166 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
167 EMACS_INT, since callers assume the returned value fits in int.
168 (upcase1): Likewise, for UPCASE_TABLE.
169 (uppercasep, lowercasep, upcase): New static inline functions.
170 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
171 the race-condition problem in the old DOWNCASE.
172
173 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
174 Rename locals to avoid shadowing.
175 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
176 (regex_compile, re_search_2, re_match_2_internal):
177 Remove unused local vars.
178 (FREE_VAR): Rewrite so as not to use empty "else",
179 which gcc can warn about.
180 (regex_compile, re_match_2_internal): Mark locals as initialized.
181 (RETALLOC_IF): Define only if needed.
182 (WORDCHAR_P): Likewise. This one is never needed, but is used
183 only in a comment talking about a compiler bug, so put inside
184 the #if 0 of that comment.
185 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
186 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
187 Remove; unused.
188
189 * search.c (boyer_moore): Rename locals to avoid shadowing.
190 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
191 (PREV_CHAR_BOUNDARY): Likewise.
192
193 * search.c (simple_search): Remove unused var.
194
195 * dired.c (compile_pattern): Move decl from here ...
196 * lisp.h: ... to here, so that it can be checked.
197 (struct re_registers): New forward decl.
198
199 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
200
201 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
202 All uses changed.
203 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
204 Rename locals to avoid shadowing.
205 (Fvertical_motion): Mark locals as initialized.
206
207 * casefiddle.c (casify_object, casify_region): Now static.
208 (casify_region): Mark local as initialized.
209
210 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
211
212 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
213 New macros, so that the caller can use some names other than
214 gcpro1, gcpro2, etc.
215 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
216 of the new macros.
217 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
218 argument, for consistency with GCPRO2_VAR, etc: it is now the
219 prefix of the variable, not the variable itself. All uses
220 changed.
221 * dired.c (directory_files_internal, file_name_completion):
222 Rename locals to avoid shadowing.
223
224 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
225 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
226 dired.c's scmp function, had undefined behavior.
227 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
228 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
229 * buffer.h: ... to here, because these macros use current_buffer,
230 and the new implementation with inline functions needs to have
231 current_buffer in scope now, rather than later when the macros
232 are used.
233 (downcase, upcase1): New static inline functions.
234 (DOWNCASE, UPCASE1): Reimplement using these functions.
235 This avoids undefined behavior in expressions like
236 DOWNCASE (x) == DOWNCASE (y), which previously suffered
237 from race conditions in accessing the global variables
238 case_temp1 and case_temp2.
239 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
240 * lisp.h (case_temp1, case_temp2): Remove their decls.
241 * character.h (ASCII_CHAR_P): Move from here ...
242 * lisp.h: ... to here, so that the inline functions mentioned
243 above can use them.
244
245 * dired.c (directory_files_internal_unwind): Now static.
246
247 * fileio.c (file_name_as_directory, directory_file_name):
248 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
249 Now static.
250 (file_name_as_directory): Use const pointers when appropriate.
251 (Fexpand_file_name): Likewise. In particular, newdir might
252 point at constant storage, so make it a const pointer.
253 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
254 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
255 signedness issues.
256 (Fset_file_times, Finsert_file_contents, auto_save_error):
257 Rename locals to avoid shadowing.
258
259 * minibuf.c (choose_minibuf_frame_1): Now static.
260 (Ftry_completion, Fall_completions): Rename or remove locals
261 to avoid shadowing.
262
263 * marker.c (bytepos_to_charpos): Remove; unused.
264
265 * lisp.h (verify_bytepos, count_markers): New decls,
266 so that gcc does not warn that these functions aren't declared.
267
268 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
269 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
270 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
271 (copy_text): Remove unused local var.
272
273 * filelock.c (within_one_second): Now static.
274 (lock_file_1): Rename local to avoid shadowing.
275
276 * buffer.c (fix_overlays_before): Mark locals as initialized.
277 (fix_start_end_in_overlays): Likewise. This function should be
278 simplified by using pointers-to-pointers, but that's a different
279 matter.
280 (switch_to_buffer_1): Now static.
281 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
282 (report_overlay_modification): Rename locals to avoid shadowing.
283
284 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
285 Fix pointer signedness issue.
286 (sys_subshell): Mark local as volatile if checking for lint,
287 to suppress a gcc -Wclobbered warning that does not seem to be right.
288 (MAXPATHLEN): Define only if needed.
289
290 * process.c (serial_open, serial_configure): Move decls from here ...
291 * systty.h: ... to here, so that they can be checked.
292
293 * fns.c (get_random, seed_random): Move extern decls from here ...
294 * lisp.h: ... to here, so that they can be checked.
295
296 * sysdep.c (reset_io): Now static.
297 (wait_for_termination_signal): Remove; unused.
298
299 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
300 (copy_keymap_item, append_key, push_text_char_description):
301 Now static.
302 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
303 (DENSE_TABLE_SIZE): Remove; unused.
304 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
305 (describe_map_tree):
306 Rename locals to avoid shadowing.
307
308 * keyboard.c: Declare functions static if they are not used elsewhere.
309 (echo_char, echo_dash, cmd_error, top_level_2):
310 (poll_for_input, handle_async_input): Now static.
311 (read_char, kbd_buffer_get_event, make_lispy_position):
312 (make_lispy_event, make_lispy_movement, apply_modifiers):
313 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
314 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
315 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
316 (read_key_sequence, read_char): Mark locals as initialized.
317 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
318
319 * keyboard.h (make_ctrl_char): New decl.
320 (mark_kboards): Move decl here ...
321 * alloc.c (mark_kboards): ... from here.
322
323 * lisp.h (force_auto_save_soon): New decl.
324
325 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
326 (DEFINE_DUMMY_FUNCTION): New macro.
327 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
328 Use it.
329 (main): Add casts to avoid warnings
330 if GCC considers string literals to be constants.
331
332 * lisp.h (fatal_error_signal): Add decl, since it's exported.
333
334 * dbusbind.c: Pointer signedness fixes.
335 (xd_signature, xd_append_arg, xd_initialize):
336 (Fdbus_call_method, Fdbus_call_method_asynchronously):
337 (Fdbus_method_return_internal, Fdbus_method_error_internal):
338 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
339 (Fdbus_register_signal): Use SSDATA when the context wants char *.
340
341 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
342 if GCC considers string literals to be constants.
343 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
344
3452011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
346
347 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
348 (print_preprocess, print_object): New macro to fix last change.
349
350 * print.c (print_preprocess): Don't forget font objects.
351
3522011-03-16 Juanma Barranquero <lekktu@gmail.com>
353
354 * emacs.c (USAGE3): Doc fixes.
355
3562011-03-15 Andreas Schwab <schwab@linux-m68k.org>
357
358 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
359 structure.
360
3612011-03-14 Juanma Barranquero <lekktu@gmail.com>
362
363 * lisp.h (VWindow_system, Qfile_name_history):
364 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
365 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
366 (w32_system_caret_x, w32_system_caret_y): Declare extern.
367
368 * w32select.c: Don't #include "keyboard.h".
369 (run_protected): Add extern declaration for waiting_for_input.
370
371 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
372 * w32console.c (detect_input_pending, read_input_pending)
373 (encode_terminal_code):
374 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
375 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
376 (w32_system_caret_y, Qfile_name_history):
377 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
378 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
379 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
380 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
381 * w32proc.c (Qlocal, report_file_error):
382 * w32term.c (Vwindow_system, updating_frame):
383 * w32uniscribe.c (initialized, uniscribe_font_driver):
384 Remove unneeded extern declarations.
385
3862011-03-14 Chong Yidong <cyd@stupidchicken.com>
387
388 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
389
3902011-03-13 Chong Yidong <cyd@stupidchicken.com>
391
392 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
393 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
394 These macros can no longer be used for assignment.
395
396 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Assign
397 struct members directly, instead of using BUF_BEGV etc.
398 (record_buffer_markers, fetch_buffer_markers): New functions for
399 recording and fetching special buffer markers.
400 (set_buffer_internal_1, set_buffer_temp): Use them.
401
402 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
403
404 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
405
406 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
407 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
408
409 * xdisp.c (hscroll_window_tree):
410 (reconsider_clip_changes): Use PT instead of BUF_PT.
411
4122011-03-13 Eli Zaretskii <eliz@gnu.org>
413
414 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
415 $(EMACS_ROOT)/lib/intprops.h.
416
4172011-03-13 Paul Eggert <eggert@cs.ucla.edu>
418
419 Fix more problems found by GCC 4.5.2's static checks.
420
421 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
422 to unsigned char * to avoid compiler diagnostic.
423 (xg_free_frame_widgets): Make it clear that a local variable is
424 needed only if USE_GTK_TOOLTIP.
425 (gdk_window_get_screen): Make it clear that this macro is needed
426 only if USE_GTK_TOOLTIP.
427 (int_gtk_range_get_value): New function, which avoids a diagnostic
428 from gcc -Wbad-function-cast.
429 (xg_set_toolkit_scroll_bar_thumb): Use it.
430 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
431 diagnostic from gcc -Wbad-function-cast.
432 (get_utf8_string, xg_get_file_with_chooser):
433 Rename locals to avoid shadowing.
434 (create_dialog): Move locals to avoid shadowing.
435
436 * xgselect.c (xg_select): Remove unused var.
437
438 * image.c (four_corners_best): Mark locals as initialized.
439 (gif_load): Initialize transparent_p to zero (Bug#8238).
440 Mark another local as initialized.
441 (my_png_error, my_error_exit): Mark with NO_RETURN.
442
443 * image.c (clear_image_cache): Now static.
444 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
445 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
446 (x_edge_detection): Remove unnecessary cast that
447 gcc -Wbad-function-cast diagnoses.
448 (gif_load): Fix pointer signedness.
449 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
450 (jpeg_load, gif_load): Rename locals to avoid shadowing.
451
4522011-03-11 Paul Eggert <eggert@cs.ucla.edu>
453
454 Improve quality of tests for time stamp overflow.
455 For example, without this patch (encode-time 0 0 0 1 1
456 1152921504606846976) returns the obviously-bogus value (-948597
457 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
458 reports time overflow. See
459 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
460 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
461 * editfns.c: Include limits.h and intprops.h.
462 (TIME_T_MIN, TIME_T_MAX): New macros.
463 (time_overflow): Move earlier, to before first use.
464 (hi_time, lo_time): New functions, for an accurate test for
465 out-of-range times.
466 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
467 (Fget_internal_run_time): Don't assume time_t fits in int.
468 (make_time): Use list2 instead of Fcons twice.
469 (Fdecode_time): More accurate test for out-of-range times.
470 (check_tm_member): New function.
471 (Fencode_time): Use it, to test for out-of-range times.
472 (lisp_time_argument): Don't rely on undefined left-shift and
473 right-shift behavior when checking for time stamp overflow.
474
475 * editfns.c (time_overflow): New function, refactoring common code.
476 (Fformat_time_string, Fdecode_time, Fencode_time):
477 (Fcurrent_time_string): Use it.
478
479 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
480 * dired.c (make_time): Move to ...
481 * editfns.c (make_time): ... here.
482 * systime.h: Note the move.
483
4842011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
485
486 * fringe.c (update_window_fringes): Remove unused variables.
487
488 * unexmacosx.c (copy_data_segment): Also copy __got section.
489 (Bug#8223)
490
4912011-03-12 Eli Zaretskii <eliz@gnu.org>
492
493 * termcap.c [MSDOS]: Include "msdos.h".
494 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
495 Constify `char *' arguments and their references according to
496 prototypes in tparam.h.
497
498 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
499
500 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
501 Adapt all references accordingly.
502
503 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
504
5052011-03-11 Tom Tromey <tromey@redhat.com>
506
507 * buffer.c (syms_of_buffer): Remove obsolete comment.
508
5092011-03-11 Eli Zaretskii <eliz@gnu.org>
510
511 * termhooks.h (encode_terminal_code): Declare prototype.
512
513 * msdos.c (encode_terminal_code): Don't declare prototype.
514
515 * term.c (encode_terminal_code): Now external again, used by
516 w32console.c and msdos.c.
517
518 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)): Depend
519 on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
520
5212011-03-11 Paul Eggert <eggert@cs.ucla.edu>
522
523 Fix some minor problems found by GCC 4.5.2's static checks.
524
525 * fringe.c (update_window_fringes): Mark locals as initialized
526 (Bug#8227).
527 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
528
529 * alloc.c (mark_fringe_data): Move decl from here ...
530 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
531 to check its interface.
532 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
533
534 * fontset.c (free_realized_fontset): Now static.
535 (Fset_fontset_font): Rename local to avoid shadowing.
536 (fontset_font): Mark local as initialized.
537 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
538
539 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
540
541 * xselect.c (x_disown_buffer_selections): Remove; not used.
542 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
543 (x_own_selection, Fx_disown_selection_internal): Rename locals
544 to avoid shadowing.
545 (x_handle_dnd_message): Remove local to avoid shadowing.
546
547 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
548 so that the caller can use some name other than gcpro1.
549 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
550 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
551 (Fx_backspace_delete_keys_p):
552 Use them to avoid shadowing, and rename vars to avoid shadowing.
553 (x_decode_color, x_set_name, x_window): Now static.
554 (Fx_create_frame): Add braces to silence GCC warning.
555 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
556 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
557 Remove unused locals.
558 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
559 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
560 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
561 macros.
562
563 * xterm.h (x_mouse_leave): New decl.
564
565 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
566 Remove unused functions.
567 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
568 (x_calc_absolute_position): Now static.
569 (XTread_socket): Don't define label "out" unless it's used.
570 Don't declare local "event" unless it's used.
571 (x_iconify_frame, x_free_frame_resources): Don't declare locals
572 unless they are used.
573 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
574 (x_fatal_error_signal): Remove; not used.
575 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
576 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
577 (x_error_catcher, x_connection_closed, x_error_handler):
578 (x_error_quitter, xembed_send_message, x_iconify_frame):
579 (my_log_handler): Rename locals to avoid shadowing.
580 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
581 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
582
583 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font): Rename
584 or move locals to avoid shadowing.
585 (tty_defined_color, merge_face_heights): Now static.
586 (free_realized_faces_for_fontset): Remove; not used.
587 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
588 does not deduce is never used uninitialized.
589 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
590 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
591
592 * terminal.c (store_terminal_param): Now static.
593
594 * xmenu.c (menu_highlight_callback): Now static.
595 (set_frame_menubar): Remove unused local.
596 (xmenu_show): Rename parameter to avoid shadowing.
597 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
598 since they might point to immutable storage.
599 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
600 since it's unused otherwise.
601
602 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
603 Add a FIXME, since the code still doesn't look right. (Bug#8215)
604 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
605 avoids a gcc -Wuninitialized diagnostic.
606 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
607 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
608 does not deduce are never used uninitialized.
609
610 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
611
612 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
613 * window.c (window_loop, size_window):
614 (run_window_configuration_change_hook, enlarge_window): Likewise.
615
616 * window.c (display_buffer): Now static.
617 (size_window): Mark variables that gcc -Wuninitialized
618 does not deduce are never used uninitialized.
619 * window.h (check_all_windows): New decl, to forestall
620 gcc -Wmissing-prototypes diagnostic.
621 * dispextern.h (bidi_dump_cached_states): Likewise.
622
623 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
624 shadowing.
625 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
626 Include <limits.h>.
627 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
628 and to avoid gcc -Wuninitialized warning.
629 (load_charset_map): Mark variables that gcc -Wuninitialized
630 does not deduce are never used uninitialized.
631 (load_charset): Abort instead of using uninitialized var (Bug#8229).
632
633 * coding.c (coding_set_source, coding_set_destination):
634 Use "else { /* comment */ }" rather than "else /* comment */;"
635 for clarity, and to avoid gcc -Wempty-body warning.
636 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
637 a block, when the outer 'i' will do.
638 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
639 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
640 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
641 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
642 (Fdecode_sjis_char, Fdefine_coding_system_internal):
643 Rename locals to avoid shadowing.
644 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
645 * coding.c (emacs_mule_char, encode_invocation_designation):
646 Now static, since they're not used elsewhere.
647 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
648 (decode_coding_object, encode_coding_object, detect_coding_system):
649 (decode_coding_emacs_mule): Mark variables that gcc
650 -Wuninitialized does not deduce are never used uninitialized.
651 (detect_coding_iso_2022): Initialize a local variable that might
652 be used uninitialized. Leave a FIXME because it's not clear that
653 this initialization is needed. (Bug#8211)
654 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
655 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
656 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
657 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
658 Remove unused macros.
659
660 * category.c (hash_get_category_set): Remove unused local var.
661 (copy_category_table): Now static, since it's not used elsewhere.
662 * character.c (string_count_byte8): Likewise.
663
664 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
665 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
666
667 * chartab.c (copy_sub_char_table): Now static, since it's not used
668 elsewhere.
669 (sub_char_table_ref_and_range, char_table_ref_and_range):
670 Rename locals to avoid shadowing.
671 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
672
673 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
674 (BIDI_BOB): Remove unused macro.
675
676 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
677 deduce are never used uninitialized.
678 * term.c (encode_terminal_code): Likewise.
679
680 * term.c (encode_terminal_code): Now static. Remove unused local.
681
682 * tparam.h: New file.
683 * term.c, tparam.h: Include it.
684 * deps.mk (term.o, tparam.o): Depend on tparam.h.
685 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
686 Move these decls to tparam.h, and make them agree with what
687 is actually in tparam.c. The previous trick of using incompatible
688 decls in different modules does not conform to the C standard.
689 All callers of tparam changed to use tparam's actual API.
690 * tparam.c (tparam1, tparam, tgoto):
691 Use const pointers where appropriate.
692
693 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
694 * cm.h (struct cm): Likewise.
695 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
696 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
697 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
698 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
699 (turn_on_face, init_tty): Likewise.
700 * termchar.h (struct tty_display_info): Likewise.
701
702 * term.c (term_mouse_position): Rename local to avoid shadowing.
703
704 * alloc.c (mark_ttys): Move decl from here ...
705 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
706
7072011-03-11 Andreas Schwab <schwab@linux-m68k.org>
708
709 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
710
7112011-03-09 Juanma Barranquero <lekktu@gmail.com>
712
713 * search.c (compile_pattern_1): Remove argument regp, unused since
714 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
715 (compile_pattern): Don't pass it.
716
7172011-03-08 Jan Djärv <jan.h.d@swipnet.se>
718
719 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
720 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
721 for ! HAVE_GTK3.
722 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
723
724 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
725
726 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
727 gdk_window_get_screen, gdk_window_get_geometry,
728 gdk_x11_window_lookup_for_display and GDK_KEY_g.
729 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
730 (xg_get_pixbuf_from_pixmap): New function.
731 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
732 to Pixmap, take frame as parameter, remove GdkColormap parameter.
733 Call xg_get_pixbuf_from_pixmap instead of
734 gdk_pixbuf_get_from_drawable.
735 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
736 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
737 (xg_check_special_colors): Use GtkStyleContext and its functions
738 for HAVE_GTK3.
739 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
740 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
741 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
742 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes): Call
743 gtk_widget_get_preferred_size.
744 (xg_frame_resized): gdk_window_get_geometry only takes 5
745 parameters.
746 (xg_win_to_widget, xg_event_is_for_menubar): Call
747 gdk_x11_window_lookup_for_display.
748 (xg_set_widget_bg): New function.
749 (delete_cb): New function.
750 (xg_create_frame_widgets): connect delete-event to delete_cb.
751 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
752 (xg_set_background_color): Call xg_set_widget_bg.
753 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
754 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
755 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
756 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
757 if ! HAVE_GTK3.
758 (update_frame_tool_bar): Call gtk_widget_hide.
759 (xg_initialize): Use GDK_KEY_g.
760
761 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
762 if ! HAVE_GTK3
763 (x_session_initialize): Call gdk_x11_set_sm_client_id.
764
765 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
766 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
767 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
768
7692011-03-08 Juanma Barranquero <lekktu@gmail.com>
770
771 * w32xfns.c (select_palette): Check success of RealizePalette against
772 GDI_ERROR, not zero.
773
7742011-03-07 Ben Key <bkey76@gmail.com>
775
776 * w32fns.c (FILE_NAME_COMBO_BOX, FILE_NAME_LIST): Define.
777 (file_dialog_callback): Fix locating the window handle of the File Name
778 text field. After disabling it, set focus on the list control.
779 (Fx_file_dialog): If only_dir_p is non-nil, set the text of the File
780 Name text field to "Current Directory" if it does not already have
781 another value. (Bug#8181)
782
7832011-03-07 Adrian Robert <Adrian.B.Robert@gmail.com>
784
785 * nsterm.m (ns_draw_window_cursor): Fix handling of "cursor_width"
786 parameter for hbar cursors. Based on a patch by Ben Key
787 <bkey76@gmail.com>.
788
7892011-03-06 Chong Yidong <cyd@stupidchicken.com>
790
791 * xdisp.c (redisplay_window): Revert incorrect logic in 2011-03-06
792 change.
793
12011-03-06 Paul Eggert <eggert@cs.ucla.edu> 7942011-03-06 Paul Eggert <eggert@cs.ucla.edu>
2 795
3 current_column: Now returns EMACS_INT, fixing some iftc 796 current_column: Now returns EMACS_INT, fixing some iftc
@@ -46,7 +839,7 @@
46 * xdisp.c (BUILD_GLYPHLESS_GLYPH_STRING): Omit unused local var. 839 * xdisp.c (BUILD_GLYPHLESS_GLYPH_STRING): Omit unused local var.
47 (produce_glyphless_glyph): Make a pointer "const" 840 (produce_glyphless_glyph): Make a pointer "const"
48 since it might point to immutable storage. 841 since it might point to immutable storage.
49 (update_window_cursor): Now static, since it's not used elsewhere. 842 (update_window_cursor): Now static, since it's not used elsewhere.
50 (SKIP_GLYPHS): Removed unused macro. 843 (SKIP_GLYPHS): Removed unused macro.
51 844
522011-03-06 Michael Shields <shields@msrl.com> (tiny change) 8452011-03-06 Michael Shields <shields@msrl.com> (tiny change)
@@ -132,7 +925,7 @@
132 as per recent filemodestring API change. Reported by Jonas Öster in 925 as per recent filemodestring API change. Reported by Jonas Öster in
133 <http://lists.gnu.org/archive/html/emacs-devel/2011-02/msg01069.html>. 926 <http://lists.gnu.org/archive/html/emacs-devel/2011-02/msg01069.html>.
134 927
1352011-02-23 Ben Key <bkey76@gmail.com> (tiny change) 9282011-02-23 Ben Key <bkey76@gmail.com>
136 929
137 * nsterm.m (ns_draw_window_cursor): Obey the cursor_width argument 930 * nsterm.m (ns_draw_window_cursor): Obey the cursor_width argument
138 directly, for bar cursors. 931 directly, for bar cursors.
diff --git a/src/alloc.c b/src/alloc.c
index c7fd8747f74..0ca702fe0cd 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -92,7 +92,8 @@ extern __malloc_size_t __malloc_extra_blocks;
92 92
93#endif /* not DOUG_LEA_MALLOC */ 93#endif /* not DOUG_LEA_MALLOC */
94 94
95#if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) 95#if ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT
96#ifdef HAVE_GTK_AND_PTHREAD
96 97
97/* When GTK uses the file chooser dialog, different backends can be loaded 98/* When GTK uses the file chooser dialog, different backends can be loaded
98 dynamically. One such a backend is the Gnome VFS backend that gets loaded 99 dynamically. One such a backend is the Gnome VFS backend that gets loaded
@@ -130,12 +131,13 @@ static pthread_mutex_t alloc_mutex;
130 } \ 131 } \
131 while (0) 132 while (0)
132 133
133#else /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ 134#else /* ! defined HAVE_GTK_AND_PTHREAD */
134 135
135#define BLOCK_INPUT_ALLOC BLOCK_INPUT 136#define BLOCK_INPUT_ALLOC BLOCK_INPUT
136#define UNBLOCK_INPUT_ALLOC UNBLOCK_INPUT 137#define UNBLOCK_INPUT_ALLOC UNBLOCK_INPUT
137 138
138#endif /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ 139#endif /* ! defined HAVE_GTK_AND_PTHREAD */
140#endif /* ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT */
139 141
140/* Value of _bytes_used, when spare_memory was freed. */ 142/* Value of _bytes_used, when spare_memory was freed. */
141 143
@@ -152,13 +154,11 @@ static __malloc_size_t bytes_used_when_full;
152#define VECTOR_UNMARK(V) ((V)->size &= ~ARRAY_MARK_FLAG) 154#define VECTOR_UNMARK(V) ((V)->size &= ~ARRAY_MARK_FLAG)
153#define VECTOR_MARKED_P(V) (((V)->size & ARRAY_MARK_FLAG) != 0) 155#define VECTOR_MARKED_P(V) (((V)->size & ARRAY_MARK_FLAG) != 0)
154 156
155/* Value is the number of bytes/chars of S, a pointer to a struct 157/* Value is the number of bytes of S, a pointer to a struct Lisp_String.
156 Lisp_String. This must be used instead of STRING_BYTES (S) or 158 Be careful during GC, because S->size contains the mark bit for
157 S->size during GC, because S->size contains the mark bit for
158 strings. */ 159 strings. */
159 160
160#define GC_STRING_BYTES(S) (STRING_BYTES (S)) 161#define GC_STRING_BYTES(S) (STRING_BYTES (S))
161#define GC_STRING_CHARS(S) ((S)->size & ~ARRAY_MARK_FLAG)
162 162
163/* Global variables. */ 163/* Global variables. */
164struct emacs_globals globals; 164struct emacs_globals globals;
@@ -270,17 +270,10 @@ Lisp_Object Qpost_gc_hook;
270 270
271static void mark_buffer (Lisp_Object); 271static void mark_buffer (Lisp_Object);
272static void mark_terminals (void); 272static void mark_terminals (void);
273extern void mark_kboards (void);
274extern void mark_ttys (void);
275extern void mark_backtrace (void);
276static void gc_sweep (void); 273static void gc_sweep (void);
277static void mark_glyph_matrix (struct glyph_matrix *); 274static void mark_glyph_matrix (struct glyph_matrix *);
278static void mark_face_cache (struct face_cache *); 275static void mark_face_cache (struct face_cache *);
279 276
280#ifdef HAVE_WINDOW_SYSTEM
281extern void mark_fringe_data (void);
282#endif /* HAVE_WINDOW_SYSTEM */
283
284static struct Lisp_String *allocate_string (void); 277static struct Lisp_String *allocate_string (void);
285static void compact_small_strings (void); 278static void compact_small_strings (void);
286static void free_large_strings (void); 279static void free_large_strings (void);
@@ -2659,17 +2652,17 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
2659 return val; 2652 return val;
2660} 2653}
2661 2654
2655#ifdef GC_CHECK_CONS_LIST
2662/* Get an error now if there's any junk in the cons free list. */ 2656/* Get an error now if there's any junk in the cons free list. */
2663void 2657void
2664check_cons_list (void) 2658check_cons_list (void)
2665{ 2659{
2666#ifdef GC_CHECK_CONS_LIST
2667 struct Lisp_Cons *tail = cons_free_list; 2660 struct Lisp_Cons *tail = cons_free_list;
2668 2661
2669 while (tail) 2662 while (tail)
2670 tail = tail->u.chain; 2663 tail = tail->u.chain;
2671#endif
2672} 2664}
2665#endif
2673 2666
2674/* Make a list of 1, 2, 3, 4 or 5 specified objects. */ 2667/* Make a list of 1, 2, 3, 4 or 5 specified objects. */
2675 2668
@@ -2909,15 +2902,15 @@ See also the function `vector'. */)
2909{ 2902{
2910 Lisp_Object vector; 2903 Lisp_Object vector;
2911 register EMACS_INT sizei; 2904 register EMACS_INT sizei;
2912 register EMACS_INT index; 2905 register EMACS_INT i;
2913 register struct Lisp_Vector *p; 2906 register struct Lisp_Vector *p;
2914 2907
2915 CHECK_NATNUM (length); 2908 CHECK_NATNUM (length);
2916 sizei = XFASTINT (length); 2909 sizei = XFASTINT (length);
2917 2910
2918 p = allocate_vector (sizei); 2911 p = allocate_vector (sizei);
2919 for (index = 0; index < sizei; index++) 2912 for (i = 0; i < sizei; i++)
2920 p->contents[index] = init; 2913 p->contents[i] = init;
2921 2914
2922 XSETVECTOR (vector, p); 2915 XSETVECTOR (vector, p);
2923 return vector; 2916 return vector;
@@ -2931,14 +2924,14 @@ usage: (vector &rest OBJECTS) */)
2931 (register int nargs, Lisp_Object *args) 2924 (register int nargs, Lisp_Object *args)
2932{ 2925{
2933 register Lisp_Object len, val; 2926 register Lisp_Object len, val;
2934 register int index; 2927 register int i;
2935 register struct Lisp_Vector *p; 2928 register struct Lisp_Vector *p;
2936 2929
2937 XSETFASTINT (len, nargs); 2930 XSETFASTINT (len, nargs);
2938 val = Fmake_vector (len, Qnil); 2931 val = Fmake_vector (len, Qnil);
2939 p = XVECTOR (val); 2932 p = XVECTOR (val);
2940 for (index = 0; index < nargs; index++) 2933 for (i = 0; i < nargs; i++)
2941 p->contents[index] = args[index]; 2934 p->contents[i] = args[i];
2942 return val; 2935 return val;
2943} 2936}
2944 2937
@@ -2962,7 +2955,7 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT
2962 (register int nargs, Lisp_Object *args) 2955 (register int nargs, Lisp_Object *args)
2963{ 2956{
2964 register Lisp_Object len, val; 2957 register Lisp_Object len, val;
2965 register int index; 2958 register int i;
2966 register struct Lisp_Vector *p; 2959 register struct Lisp_Vector *p;
2967 2960
2968 XSETFASTINT (len, nargs); 2961 XSETFASTINT (len, nargs);
@@ -2980,11 +2973,11 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT
2980 args[1] = Fstring_as_unibyte (args[1]); 2973 args[1] = Fstring_as_unibyte (args[1]);
2981 2974
2982 p = XVECTOR (val); 2975 p = XVECTOR (val);
2983 for (index = 0; index < nargs; index++) 2976 for (i = 0; i < nargs; i++)
2984 { 2977 {
2985 if (!NILP (Vpurify_flag)) 2978 if (!NILP (Vpurify_flag))
2986 args[index] = Fpurecopy (args[index]); 2979 args[i] = Fpurecopy (args[i]);
2987 p->contents[index] = args[index]; 2980 p->contents[i] = args[i];
2988 } 2981 }
2989 XSETPVECTYPE (p, PVEC_COMPILED); 2982 XSETPVECTYPE (p, PVEC_COMPILED);
2990 XSETCOMPILED (val, p); 2983 XSETCOMPILED (val, p);
@@ -4328,12 +4321,6 @@ static void
4328mark_stack (void) 4321mark_stack (void)
4329{ 4322{
4330 int i; 4323 int i;
4331 /* jmp_buf may not be aligned enough on darwin-ppc64 */
4332 union aligned_jmpbuf {
4333 Lisp_Object o;
4334 jmp_buf j;
4335 } j;
4336 volatile int stack_grows_down_p = (char *) &j > (char *) stack_base;
4337 void *end; 4324 void *end;
4338 4325
4339#ifdef HAVE___BUILTIN_UNWIND_INIT 4326#ifdef HAVE___BUILTIN_UNWIND_INIT
@@ -4343,6 +4330,14 @@ mark_stack (void)
4343 __builtin_unwind_init (); 4330 __builtin_unwind_init ();
4344 end = &end; 4331 end = &end;
4345#else /* not HAVE___BUILTIN_UNWIND_INIT */ 4332#else /* not HAVE___BUILTIN_UNWIND_INIT */
4333#ifndef GC_SAVE_REGISTERS_ON_STACK
4334 /* jmp_buf may not be aligned enough on darwin-ppc64 */
4335 union aligned_jmpbuf {
4336 Lisp_Object o;
4337 jmp_buf j;
4338 } j;
4339 volatile int stack_grows_down_p = (char *) &j > (char *) stack_base;
4340#endif
4346 /* This trick flushes the register windows so that all the state of 4341 /* This trick flushes the register windows so that all the state of
4347 the process is contained in the stack. */ 4342 the process is contained in the stack. */
4348 /* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is 4343 /* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is
@@ -5079,18 +5074,18 @@ returns nil, because real GC can't be done. */)
5079 5074
5080 if (FLOATP (Vgc_cons_percentage)) 5075 if (FLOATP (Vgc_cons_percentage))
5081 { /* Set gc_cons_combined_threshold. */ 5076 { /* Set gc_cons_combined_threshold. */
5082 EMACS_INT total = 0; 5077 EMACS_INT tot = 0;
5083 5078
5084 total += total_conses * sizeof (struct Lisp_Cons); 5079 tot += total_conses * sizeof (struct Lisp_Cons);
5085 total += total_symbols * sizeof (struct Lisp_Symbol); 5080 tot += total_symbols * sizeof (struct Lisp_Symbol);
5086 total += total_markers * sizeof (union Lisp_Misc); 5081 tot += total_markers * sizeof (union Lisp_Misc);
5087 total += total_string_size; 5082 tot += total_string_size;
5088 total += total_vector_size * sizeof (Lisp_Object); 5083 tot += total_vector_size * sizeof (Lisp_Object);
5089 total += total_floats * sizeof (struct Lisp_Float); 5084 tot += total_floats * sizeof (struct Lisp_Float);
5090 total += total_intervals * sizeof (struct interval); 5085 tot += total_intervals * sizeof (struct interval);
5091 total += total_strings * sizeof (struct Lisp_String); 5086 tot += total_strings * sizeof (struct Lisp_String);
5092 5087
5093 gc_relative_threshold = total * XFLOAT_DATA (Vgc_cons_percentage); 5088 gc_relative_threshold = tot * XFLOAT_DATA (Vgc_cons_percentage);
5094 } 5089 }
5095 else 5090 else
5096 gc_relative_threshold = 0; 5091 gc_relative_threshold = 0;
@@ -5139,9 +5134,9 @@ returns nil, because real GC can't be done. */)
5139 5134
5140 if (!NILP (Vpost_gc_hook)) 5135 if (!NILP (Vpost_gc_hook))
5141 { 5136 {
5142 int count = inhibit_garbage_collection (); 5137 int gc_count = inhibit_garbage_collection ();
5143 safe_run_hooks (Qpost_gc_hook); 5138 safe_run_hooks (Qpost_gc_hook);
5144 unbind_to (count, Qnil); 5139 unbind_to (gc_count, Qnil);
5145 } 5140 }
5146 5141
5147 /* Accumulate statistics. */ 5142 /* Accumulate statistics. */
@@ -5320,7 +5315,6 @@ mark_object (Lisp_Object arg)
5320 5315
5321#else /* not GC_CHECK_MARKED_OBJECTS */ 5316#else /* not GC_CHECK_MARKED_OBJECTS */
5322 5317
5323#define CHECK_ALLOCATED() (void) 0
5324#define CHECK_LIVE(LIVEP) (void) 0 5318#define CHECK_LIVE(LIVEP) (void) 0
5325#define CHECK_ALLOCATED_AND_LIVE(LIVEP) (void) 0 5319#define CHECK_ALLOCATED_AND_LIVE(LIVEP) (void) 0
5326 5320
@@ -6072,7 +6066,7 @@ We divide the value by 1024 to make sure it fits in a Lisp integer. */)
6072{ 6066{
6073 Lisp_Object end; 6067 Lisp_Object end;
6074 6068
6075 XSETINT (end, (EMACS_INT) sbrk (0) / 1024); 6069 XSETINT (end, (EMACS_INT) (char *) sbrk (0) / 1024);
6076 6070
6077 return end; 6071 return end;
6078} 6072}
diff --git a/src/bidi.c b/src/bidi.c
index eeacf65bd5c..3457e177436 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -72,7 +72,6 @@ static Lisp_Object bidi_type_table, bidi_mirror_table;
72#define RLO_CHAR 0x202E 72#define RLO_CHAR 0x202E
73 73
74#define BIDI_EOB -1 74#define BIDI_EOB -1
75#define BIDI_BOB -2 /* FIXME: Is this needed? */
76 75
77/* Local data structures. (Look in dispextern.h for the rest.) */ 76/* Local data structures. (Look in dispextern.h for the rest.) */
78 77
@@ -180,7 +179,7 @@ bidi_get_type (int ch, bidi_dir_t override)
180 } 179 }
181} 180}
182 181
183void 182static void
184bidi_check_type (bidi_type_t type) 183bidi_check_type (bidi_type_t type)
185{ 184{
186 if (type < UNKNOWN_BT || type > NEUTRAL_ON) 185 if (type < UNKNOWN_BT || type > NEUTRAL_ON)
diff --git a/src/buffer.c b/src/buffer.c
index 1b413ccb8b0..d301e7f14f9 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -330,15 +330,17 @@ even if it is dead. The return value is never nil. */)
330 if (! BUF_BEG_ADDR (b)) 330 if (! BUF_BEG_ADDR (b))
331 buffer_memory_full (); 331 buffer_memory_full ();
332 332
333 BUF_PT (b) = BEG; 333 b->pt = BEG;
334 b->begv = BEG;
335 b->zv = BEG;
336 b->pt_byte = BEG_BYTE;
337 b->begv_byte = BEG_BYTE;
338 b->zv_byte = BEG_BYTE;
339
334 BUF_GPT (b) = BEG; 340 BUF_GPT (b) = BEG;
335 BUF_BEGV (b) = BEG;
336 BUF_ZV (b) = BEG;
337 BUF_Z (b) = BEG;
338 BUF_PT_BYTE (b) = BEG_BYTE;
339 BUF_GPT_BYTE (b) = BEG_BYTE; 341 BUF_GPT_BYTE (b) = BEG_BYTE;
340 BUF_BEGV_BYTE (b) = BEG_BYTE; 342
341 BUF_ZV_BYTE (b) = BEG_BYTE; 343 BUF_Z (b) = BEG;
342 BUF_Z_BYTE (b) = BEG_BYTE; 344 BUF_Z_BYTE (b) = BEG_BYTE;
343 BUF_MODIFF (b) = 1; 345 BUF_MODIFF (b) = 1;
344 BUF_CHARS_MODIFF (b) = 1; 346 BUF_CHARS_MODIFF (b) = 1;
@@ -489,6 +491,53 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
489 BVAR (to, local_var_alist) = buffer_lisp_local_variables (from); 491 BVAR (to, local_var_alist) = buffer_lisp_local_variables (from);
490} 492}
491 493
494
495/* If buffer B has markers to record PT, BEGV and ZV when it is not
496 current, update these markers. */
497
498static void
499record_buffer_markers (struct buffer *b)
500{
501 if (! NILP (BVAR (b, pt_marker)))
502 {
503 Lisp_Object buffer;
504
505 eassert (!NILP (BVAR (b, begv_marker)));
506 eassert (!NILP (BVAR (b, zv_marker)));
507
508 XSETBUFFER (buffer, b);
509 set_marker_both (BVAR (b, pt_marker), buffer, b->pt, b->pt_byte);
510 set_marker_both (BVAR (b, begv_marker), buffer, b->begv, b->begv_byte);
511 set_marker_both (BVAR (b, zv_marker), buffer, b->zv, b->zv_byte);
512 }
513}
514
515
516/* If buffer B has markers to record PT, BEGV and ZV when it is not
517 current, fetch these values into B->begv etc. */
518
519static void
520fetch_buffer_markers (struct buffer *b)
521{
522 if (! NILP (BVAR (b, pt_marker)))
523 {
524 Lisp_Object m;
525
526 eassert (!NILP (BVAR (b, begv_marker)));
527 eassert (!NILP (BVAR (b, zv_marker)));
528
529 m = BVAR (b, pt_marker);
530 SET_BUF_PT_BOTH (b, marker_position (m), marker_byte_position (m));
531
532 m = BVAR (b, begv_marker);
533 SET_BUF_BEGV_BOTH (b, marker_position (m), marker_byte_position (m));
534
535 m = BVAR (b, zv_marker);
536 SET_BUF_ZV_BOTH (b, marker_position (m), marker_byte_position (m));
537 }
538}
539
540
492DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, 541DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer,
493 2, 3, 542 2, 3,
494 "bMake indirect buffer (to buffer): \nBName of indirect buffer: ", 543 "bMake indirect buffer (to buffer): \nBName of indirect buffer: ",
@@ -527,12 +576,12 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
527 /* Use the base buffer's text object. */ 576 /* Use the base buffer's text object. */
528 b->text = b->base_buffer->text; 577 b->text = b->base_buffer->text;
529 578
530 BUF_BEGV (b) = BUF_BEGV (b->base_buffer); 579 b->pt = b->base_buffer->pt;
531 BUF_ZV (b) = BUF_ZV (b->base_buffer); 580 b->begv = b->base_buffer->begv;
532 BUF_PT (b) = BUF_PT (b->base_buffer); 581 b->zv = b->base_buffer->zv;
533 BUF_BEGV_BYTE (b) = BUF_BEGV_BYTE (b->base_buffer); 582 b->pt_byte = b->base_buffer->pt_byte;
534 BUF_ZV_BYTE (b) = BUF_ZV_BYTE (b->base_buffer); 583 b->begv_byte = b->base_buffer->begv_byte;
535 BUF_PT_BYTE (b) = BUF_PT_BYTE (b->base_buffer); 584 b->zv_byte = b->base_buffer->zv_byte;
536 585
537 b->newline_cache = 0; 586 b->newline_cache = 0;
538 b->width_run_cache = 0; 587 b->width_run_cache = 0;
@@ -562,24 +611,23 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
562 /* Make sure the base buffer has markers for its narrowing. */ 611 /* Make sure the base buffer has markers for its narrowing. */
563 if (NILP (BVAR (b->base_buffer, pt_marker))) 612 if (NILP (BVAR (b->base_buffer, pt_marker)))
564 { 613 {
614 eassert (NILP (BVAR (b->base_buffer, begv_marker)));
615 eassert (NILP (BVAR (b->base_buffer, zv_marker)));
616
565 BVAR (b->base_buffer, pt_marker) = Fmake_marker (); 617 BVAR (b->base_buffer, pt_marker) = Fmake_marker ();
566 set_marker_both (BVAR (b->base_buffer, pt_marker), base_buffer, 618 set_marker_both (BVAR (b->base_buffer, pt_marker), base_buffer,
567 BUF_PT (b->base_buffer), 619 b->base_buffer->pt,
568 BUF_PT_BYTE (b->base_buffer)); 620 b->base_buffer->pt_byte);
569 } 621
570 if (NILP (BVAR (b->base_buffer, begv_marker)))
571 {
572 BVAR (b->base_buffer, begv_marker) = Fmake_marker (); 622 BVAR (b->base_buffer, begv_marker) = Fmake_marker ();
573 set_marker_both (BVAR (b->base_buffer, begv_marker), base_buffer, 623 set_marker_both (BVAR (b->base_buffer, begv_marker), base_buffer,
574 BUF_BEGV (b->base_buffer), 624 b->base_buffer->begv,
575 BUF_BEGV_BYTE (b->base_buffer)); 625 b->base_buffer->begv_byte);
576 } 626
577 if (NILP (BVAR (b->base_buffer, zv_marker)))
578 {
579 BVAR (b->base_buffer, zv_marker) = Fmake_marker (); 627 BVAR (b->base_buffer, zv_marker) = Fmake_marker ();
580 set_marker_both (BVAR (b->base_buffer, zv_marker), base_buffer, 628 set_marker_both (BVAR (b->base_buffer, zv_marker), base_buffer,
581 BUF_ZV (b->base_buffer), 629 b->base_buffer->zv,
582 BUF_ZV_BYTE (b->base_buffer)); 630 b->base_buffer->zv_byte);
583 XMARKER (BVAR (b->base_buffer, zv_marker))->insertion_type = 1; 631 XMARKER (BVAR (b->base_buffer, zv_marker))->insertion_type = 1;
584 } 632 }
585 633
@@ -587,11 +635,11 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
587 { 635 {
588 /* Give the indirect buffer markers for its narrowing. */ 636 /* Give the indirect buffer markers for its narrowing. */
589 BVAR (b, pt_marker) = Fmake_marker (); 637 BVAR (b, pt_marker) = Fmake_marker ();
590 set_marker_both (BVAR (b, pt_marker), buf, BUF_PT (b), BUF_PT_BYTE (b)); 638 set_marker_both (BVAR (b, pt_marker), buf, b->pt, b->pt_byte);
591 BVAR (b, begv_marker) = Fmake_marker (); 639 BVAR (b, begv_marker) = Fmake_marker ();
592 set_marker_both (BVAR (b, begv_marker), buf, BUF_BEGV (b), BUF_BEGV_BYTE (b)); 640 set_marker_both (BVAR (b, begv_marker), buf, b->begv, b->begv_byte);
593 BVAR (b, zv_marker) = Fmake_marker (); 641 BVAR (b, zv_marker) = Fmake_marker ();
594 set_marker_both (BVAR (b, zv_marker), buf, BUF_ZV (b), BUF_ZV_BYTE (b)); 642 set_marker_both (BVAR (b, zv_marker), buf, b->zv, b->zv_byte);
595 XMARKER (BVAR (b, zv_marker))->insertion_type = 1; 643 XMARKER (BVAR (b, zv_marker))->insertion_type = 1;
596 } 644 }
597 else 645 else
@@ -1416,9 +1464,9 @@ with SIGHUP. */)
1416 don't re-kill them. */ 1464 don't re-kill them. */
1417 if (other->base_buffer == b && !NILP (BVAR (other, name))) 1465 if (other->base_buffer == b && !NILP (BVAR (other, name)))
1418 { 1466 {
1419 Lisp_Object buffer; 1467 Lisp_Object buf;
1420 XSETBUFFER (buffer, other); 1468 XSETBUFFER (buf, other);
1421 Fkill_buffer (buffer); 1469 Fkill_buffer (buf);
1422 } 1470 }
1423 1471
1424 UNGCPRO; 1472 UNGCPRO;
@@ -1479,9 +1527,9 @@ with SIGHUP. */)
1479 && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) 1527 && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)
1480 && NILP (Fsymbol_value (intern ("auto-save-visited-file-name")))) 1528 && NILP (Fsymbol_value (intern ("auto-save-visited-file-name"))))
1481 { 1529 {
1482 Lisp_Object tem; 1530 Lisp_Object delete;
1483 tem = Fsymbol_value (intern ("delete-auto-save-files")); 1531 delete = Fsymbol_value (intern ("delete-auto-save-files"));
1484 if (! NILP (tem)) 1532 if (! NILP (delete))
1485 internal_delete_file (BVAR (b, auto_save_file_name)); 1533 internal_delete_file (BVAR (b, auto_save_file_name));
1486 } 1534 }
1487 1535
@@ -1553,19 +1601,19 @@ with SIGHUP. */)
1553void 1601void
1554record_buffer (Lisp_Object buf) 1602record_buffer (Lisp_Object buf)
1555{ 1603{
1556 register Lisp_Object link, prev; 1604 register Lisp_Object list, prev;
1557 Lisp_Object frame; 1605 Lisp_Object frame;
1558 frame = selected_frame; 1606 frame = selected_frame;
1559 1607
1560 prev = Qnil; 1608 prev = Qnil;
1561 for (link = Vbuffer_alist; CONSP (link); link = XCDR (link)) 1609 for (list = Vbuffer_alist; CONSP (list); list = XCDR (list))
1562 { 1610 {
1563 if (EQ (XCDR (XCAR (link)), buf)) 1611 if (EQ (XCDR (XCAR (list)), buf))
1564 break; 1612 break;
1565 prev = link; 1613 prev = list;
1566 } 1614 }
1567 1615
1568 /* Effectively do Vbuffer_alist = Fdelq (link, Vbuffer_alist); 1616 /* Effectively do Vbuffer_alist = Fdelq (list, Vbuffer_alist);
1569 we cannot use Fdelq itself here because it allows quitting. */ 1617 we cannot use Fdelq itself here because it allows quitting. */
1570 1618
1571 if (NILP (prev)) 1619 if (NILP (prev))
@@ -1573,40 +1621,40 @@ record_buffer (Lisp_Object buf)
1573 else 1621 else
1574 XSETCDR (prev, XCDR (XCDR (prev))); 1622 XSETCDR (prev, XCDR (XCDR (prev)));
1575 1623
1576 XSETCDR (link, Vbuffer_alist); 1624 XSETCDR (list, Vbuffer_alist);
1577 Vbuffer_alist = link; 1625 Vbuffer_alist = list;
1578 1626
1579 /* Effectively do a delq on buried_buffer_list. */ 1627 /* Effectively do a delq on buried_buffer_list. */
1580 1628
1581 prev = Qnil; 1629 prev = Qnil;
1582 for (link = XFRAME (frame)->buried_buffer_list; CONSP (link); 1630 for (list = XFRAME (frame)->buried_buffer_list; CONSP (list);
1583 link = XCDR (link)) 1631 list = XCDR (list))
1584 { 1632 {
1585 if (EQ (XCAR (link), buf)) 1633 if (EQ (XCAR (list), buf))
1586 { 1634 {
1587 if (NILP (prev)) 1635 if (NILP (prev))
1588 XFRAME (frame)->buried_buffer_list = XCDR (link); 1636 XFRAME (frame)->buried_buffer_list = XCDR (list);
1589 else 1637 else
1590 XSETCDR (prev, XCDR (XCDR (prev))); 1638 XSETCDR (prev, XCDR (XCDR (prev)));
1591 break; 1639 break;
1592 } 1640 }
1593 prev = link; 1641 prev = list;
1594 } 1642 }
1595 1643
1596 /* Now move this buffer to the front of frame_buffer_list also. */ 1644 /* Now move this buffer to the front of frame_buffer_list also. */
1597 1645
1598 prev = Qnil; 1646 prev = Qnil;
1599 for (link = frame_buffer_list (frame); CONSP (link); 1647 for (list = frame_buffer_list (frame); CONSP (list);
1600 link = XCDR (link)) 1648 list = XCDR (list))
1601 { 1649 {
1602 if (EQ (XCAR (link), buf)) 1650 if (EQ (XCAR (list), buf))
1603 break; 1651 break;
1604 prev = link; 1652 prev = list;
1605 } 1653 }
1606 1654
1607 /* Effectively do delq. */ 1655 /* Effectively do delq. */
1608 1656
1609 if (CONSP (link)) 1657 if (CONSP (list))
1610 { 1658 {
1611 if (NILP (prev)) 1659 if (NILP (prev))
1612 set_frame_buffer_list (frame, 1660 set_frame_buffer_list (frame,
@@ -1614,8 +1662,8 @@ record_buffer (Lisp_Object buf)
1614 else 1662 else
1615 XSETCDR (prev, XCDR (XCDR (prev))); 1663 XSETCDR (prev, XCDR (XCDR (prev)));
1616 1664
1617 XSETCDR (link, frame_buffer_list (frame)); 1665 XSETCDR (list, frame_buffer_list (frame));
1618 set_frame_buffer_list (frame, link); 1666 set_frame_buffer_list (frame, list);
1619 } 1667 }
1620 else 1668 else
1621 set_frame_buffer_list (frame, Fcons (buf, frame_buffer_list (frame))); 1669 set_frame_buffer_list (frame, Fcons (buf, frame_buffer_list (frame)));
@@ -1664,7 +1712,7 @@ the current buffer's major mode. */)
1664/* Switch to buffer BUFFER in the selected window. 1712/* Switch to buffer BUFFER in the selected window.
1665 If NORECORD is non-nil, don't call record_buffer. */ 1713 If NORECORD is non-nil, don't call record_buffer. */
1666 1714
1667Lisp_Object 1715static Lisp_Object
1668switch_to_buffer_1 (Lisp_Object buffer_or_name, Lisp_Object norecord) 1716switch_to_buffer_1 (Lisp_Object buffer_or_name, Lisp_Object norecord)
1669{ 1717{
1670 register Lisp_Object buffer; 1718 register Lisp_Object buffer;
@@ -1796,27 +1844,7 @@ set_buffer_internal_1 (register struct buffer *b)
1796 1844
1797 /* If the old current buffer has markers to record PT, BEGV and ZV 1845 /* If the old current buffer has markers to record PT, BEGV and ZV
1798 when it is not current, update them now. */ 1846 when it is not current, update them now. */
1799 if (! NILP (BVAR (old_buf, pt_marker))) 1847 record_buffer_markers (old_buf);
1800 {
1801 Lisp_Object obuf;
1802 XSETBUFFER (obuf, old_buf);
1803 set_marker_both (BVAR (old_buf, pt_marker), obuf,
1804 BUF_PT (old_buf), BUF_PT_BYTE (old_buf));
1805 }
1806 if (! NILP (BVAR (old_buf, begv_marker)))
1807 {
1808 Lisp_Object obuf;
1809 XSETBUFFER (obuf, old_buf);
1810 set_marker_both (BVAR (old_buf, begv_marker), obuf,
1811 BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf));
1812 }
1813 if (! NILP (BVAR (old_buf, zv_marker)))
1814 {
1815 Lisp_Object obuf;
1816 XSETBUFFER (obuf, old_buf);
1817 set_marker_both (BVAR (old_buf, zv_marker), obuf,
1818 BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf));
1819 }
1820 } 1848 }
1821 1849
1822 /* Get the undo list from the base buffer, so that it appears 1850 /* Get the undo list from the base buffer, so that it appears
@@ -1826,21 +1854,7 @@ set_buffer_internal_1 (register struct buffer *b)
1826 1854
1827 /* If the new current buffer has markers to record PT, BEGV and ZV 1855 /* If the new current buffer has markers to record PT, BEGV and ZV
1828 when it is not current, fetch them now. */ 1856 when it is not current, fetch them now. */
1829 if (! NILP (BVAR (b, pt_marker))) 1857 fetch_buffer_markers (b);
1830 {
1831 BUF_PT (b) = marker_position (BVAR (b, pt_marker));
1832 BUF_PT_BYTE (b) = marker_byte_position (BVAR (b, pt_marker));
1833 }
1834 if (! NILP (BVAR (b, begv_marker)))
1835 {
1836 BUF_BEGV (b) = marker_position (BVAR (b, begv_marker));
1837 BUF_BEGV_BYTE (b) = marker_byte_position (BVAR (b, begv_marker));
1838 }
1839 if (! NILP (BVAR (b, zv_marker)))
1840 {
1841 BUF_ZV (b) = marker_position (BVAR (b, zv_marker));
1842 BUF_ZV_BYTE (b) = marker_byte_position (BVAR (b, zv_marker));
1843 }
1844 1858
1845 /* Look down buffer's list of local Lisp variables 1859 /* Look down buffer's list of local Lisp variables
1846 to find and update any that forward into C variables. */ 1860 to find and update any that forward into C variables. */
@@ -1876,50 +1890,13 @@ set_buffer_temp (struct buffer *b)
1876 old_buf = current_buffer; 1890 old_buf = current_buffer;
1877 current_buffer = b; 1891 current_buffer = b;
1878 1892
1879 if (old_buf) 1893 /* If the old current buffer has markers to record PT, BEGV and ZV
1880 { 1894 when it is not current, update them now. */
1881 /* If the old current buffer has markers to record PT, BEGV and ZV 1895 record_buffer_markers (old_buf);
1882 when it is not current, update them now. */
1883 if (! NILP (BVAR (old_buf, pt_marker)))
1884 {
1885 Lisp_Object obuf;
1886 XSETBUFFER (obuf, old_buf);
1887 set_marker_both (BVAR (old_buf, pt_marker), obuf,
1888 BUF_PT (old_buf), BUF_PT_BYTE (old_buf));
1889 }
1890 if (! NILP (BVAR (old_buf, begv_marker)))
1891 {
1892 Lisp_Object obuf;
1893 XSETBUFFER (obuf, old_buf);
1894 set_marker_both (BVAR (old_buf, begv_marker), obuf,
1895 BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf));
1896 }
1897 if (! NILP (BVAR (old_buf, zv_marker)))
1898 {
1899 Lisp_Object obuf;
1900 XSETBUFFER (obuf, old_buf);
1901 set_marker_both (BVAR (old_buf, zv_marker), obuf,
1902 BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf));
1903 }
1904 }
1905 1896
1906 /* If the new current buffer has markers to record PT, BEGV and ZV 1897 /* If the new current buffer has markers to record PT, BEGV and ZV
1907 when it is not current, fetch them now. */ 1898 when it is not current, fetch them now. */
1908 if (! NILP (BVAR (b, pt_marker))) 1899 fetch_buffer_markers (b);
1909 {
1910 BUF_PT (b) = marker_position (BVAR (b, pt_marker));
1911 BUF_PT_BYTE (b) = marker_byte_position (BVAR (b, pt_marker));
1912 }
1913 if (! NILP (BVAR (b, begv_marker)))
1914 {
1915 BUF_BEGV (b) = marker_position (BVAR (b, begv_marker));
1916 BUF_BEGV_BYTE (b) = marker_byte_position (BVAR (b, begv_marker));
1917 }
1918 if (! NILP (BVAR (b, zv_marker)))
1919 {
1920 BUF_ZV (b) = marker_position (BVAR (b, zv_marker));
1921 BUF_ZV_BYTE (b) = marker_byte_position (BVAR (b, zv_marker));
1922 }
1923} 1900}
1924 1901
1925DEFUN ("set-buffer", Fset_buffer, Sset_buffer, 1, 1, 0, 1902DEFUN ("set-buffer", Fset_buffer, Sset_buffer, 1, 1, 0,
@@ -2007,13 +1984,13 @@ its frame, iconify that frame. */)
2007 buffer is killed. */ 1984 buffer is killed. */
2008 if (!NILP (BVAR (XBUFFER (buffer), name))) 1985 if (!NILP (BVAR (XBUFFER (buffer), name)))
2009 { 1986 {
2010 Lisp_Object aelt, link; 1987 Lisp_Object aelt, list;
2011 1988
2012 aelt = Frassq (buffer, Vbuffer_alist); 1989 aelt = Frassq (buffer, Vbuffer_alist);
2013 link = Fmemq (aelt, Vbuffer_alist); 1990 list = Fmemq (aelt, Vbuffer_alist);
2014 Vbuffer_alist = Fdelq (aelt, Vbuffer_alist); 1991 Vbuffer_alist = Fdelq (aelt, Vbuffer_alist);
2015 XSETCDR (link, Qnil); 1992 XSETCDR (list, Qnil);
2016 Vbuffer_alist = nconc2 (Vbuffer_alist, link); 1993 Vbuffer_alist = nconc2 (Vbuffer_alist, list);
2017 1994
2018 XFRAME (selected_frame)->buffer_list 1995 XFRAME (selected_frame)->buffer_list
2019 = Fdelq (buffer, XFRAME (selected_frame)->buffer_list); 1996 = Fdelq (buffer, XFRAME (selected_frame)->buffer_list);
@@ -2358,12 +2335,12 @@ current buffer is cleared. */)
2358 && GPT_BYTE > 1 && GPT_BYTE < Z_BYTE 2335 && GPT_BYTE > 1 && GPT_BYTE < Z_BYTE
2359 && ! CHAR_HEAD_P (*(GAP_END_ADDR))) 2336 && ! CHAR_HEAD_P (*(GAP_END_ADDR)))
2360 { 2337 {
2361 unsigned char *p = GPT_ADDR - 1; 2338 unsigned char *q = GPT_ADDR - 1;
2362 2339
2363 while (! CHAR_HEAD_P (*p) && p > BEG_ADDR) p--; 2340 while (! CHAR_HEAD_P (*q) && q > BEG_ADDR) q--;
2364 if (LEADING_CODE_P (*p)) 2341 if (LEADING_CODE_P (*q))
2365 { 2342 {
2366 EMACS_INT new_gpt = GPT_BYTE - (GPT_ADDR - p); 2343 EMACS_INT new_gpt = GPT_BYTE - (GPT_ADDR - q);
2367 2344
2368 move_gap_both (new_gpt, new_gpt); 2345 move_gap_both (new_gpt, new_gpt);
2369 } 2346 }
@@ -2447,14 +2424,14 @@ current buffer is cleared. */)
2447 ZV = chars_in_text (BEG_ADDR, ZV_BYTE - BEG_BYTE) + BEG; 2424 ZV = chars_in_text (BEG_ADDR, ZV_BYTE - BEG_BYTE) + BEG;
2448 2425
2449 { 2426 {
2450 EMACS_INT pt_byte = advance_to_char_boundary (PT_BYTE); 2427 EMACS_INT byte = advance_to_char_boundary (PT_BYTE);
2451 EMACS_INT pt; 2428 EMACS_INT position;
2452 2429
2453 if (pt_byte > GPT_BYTE) 2430 if (byte > GPT_BYTE)
2454 pt = chars_in_text (GAP_END_ADDR, pt_byte - GPT_BYTE) + GPT; 2431 position = chars_in_text (GAP_END_ADDR, byte - GPT_BYTE) + GPT;
2455 else 2432 else
2456 pt = chars_in_text (BEG_ADDR, pt_byte - BEG_BYTE) + BEG; 2433 position = chars_in_text (BEG_ADDR, byte - BEG_BYTE) + BEG;
2457 TEMP_SET_PT_BOTH (pt, pt_byte); 2434 TEMP_SET_PT_BOTH (position, byte);
2458 } 2435 }
2459 2436
2460 tail = markers = BUF_MARKERS (current_buffer); 2437 tail = markers = BUF_MARKERS (current_buffer);
@@ -3421,7 +3398,8 @@ void
3421fix_start_end_in_overlays (register EMACS_INT start, register EMACS_INT end) 3398fix_start_end_in_overlays (register EMACS_INT start, register EMACS_INT end)
3422{ 3399{
3423 Lisp_Object overlay; 3400 Lisp_Object overlay;
3424 struct Lisp_Overlay *before_list, *after_list; 3401 struct Lisp_Overlay *before_list IF_LINT (= NULL);
3402 struct Lisp_Overlay *after_list IF_LINT (= NULL);
3425 /* These are either nil, indicating that before_list or after_list 3403 /* These are either nil, indicating that before_list or after_list
3426 should be assigned, or the cons cell the cdr of which should be 3404 should be assigned, or the cons cell the cdr of which should be
3427 assigned. */ 3405 assigned. */
@@ -3569,7 +3547,7 @@ fix_overlays_before (struct buffer *bp, EMACS_INT prev, EMACS_INT pos)
3569 /* If parent is nil, replace overlays_before; otherwise, parent->next. */ 3547 /* If parent is nil, replace overlays_before; otherwise, parent->next. */
3570 struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; 3548 struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair;
3571 Lisp_Object tem; 3549 Lisp_Object tem;
3572 EMACS_INT end; 3550 EMACS_INT end IF_LINT (= 0);
3573 3551
3574 /* After the insertion, the several overlays may be in incorrect 3552 /* After the insertion, the several overlays may be in incorrect
3575 order. The possibility is that, in the list `overlays_before', 3553 order. The possibility is that, in the list `overlays_before',
@@ -4345,10 +4323,10 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, int after,
4345 4323
4346 for (i = 0; i < size;) 4324 for (i = 0; i < size;)
4347 { 4325 {
4348 Lisp_Object prop, overlay; 4326 Lisp_Object prop_i, overlay_i;
4349 prop = copy[i++]; 4327 prop_i = copy[i++];
4350 overlay = copy[i++]; 4328 overlay_i = copy[i++];
4351 call_overlay_mod_hooks (prop, overlay, after, arg1, arg2, arg3); 4329 call_overlay_mod_hooks (prop_i, overlay_i, after, arg1, arg2, arg3);
4352 } 4330 }
4353 } 4331 }
4354 UNGCPRO; 4332 UNGCPRO;
@@ -5333,9 +5311,6 @@ syms_of_buffer (void)
5333 Fput (Qprotected_field, Qerror_message, 5311 Fput (Qprotected_field, Qerror_message,
5334 make_pure_c_string ("Attempt to modify a protected field")); 5312 make_pure_c_string ("Attempt to modify a protected field"));
5335 5313
5336 /* All these use DEFVAR_LISP_NOPRO because the slots in
5337 buffer_defaults will all be marked via Vbuffer_defaults. */
5338
5339 DEFVAR_BUFFER_DEFAULTS ("default-mode-line-format", 5314 DEFVAR_BUFFER_DEFAULTS ("default-mode-line-format",
5340 mode_line_format, 5315 mode_line_format,
5341 doc: /* Default value of `mode-line-format' for buffers that don't override it. 5316 doc: /* Default value of `mode-line-format' for buffers that don't override it.
diff --git a/src/buffer.h b/src/buffer.h
index 65c7168d60a..d80875a0811 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -107,27 +107,46 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
107#define BUF_BEG(buf) (BEG) 107#define BUF_BEG(buf) (BEG)
108#define BUF_BEG_BYTE(buf) (BEG_BYTE) 108#define BUF_BEG_BYTE(buf) (BEG_BYTE)
109 109
110/* !!!FIXME: all the BUF_BEGV/BUF_ZV/BUF_PT macros are flawed: 110/* The BUF_BEGV[_BYTE], BUF_ZV[_BYTE], and BUF_PT[_BYTE] macros cannot
111 on indirect (or base) buffers, that value is only correct if that buffer 111 be used for assignment; use SET_BUF_* macros below for that. */
112 is the current_buffer, or if the buffer's text hasn't been modified (via
113 an indirect buffer) since it was last current. */
114 112
115/* Position of beginning of accessible range of buffer. */ 113/* Position of beginning of accessible range of buffer. */
116#define BUF_BEGV(buf) ((buf)->begv) 114#define BUF_BEGV(buf) \
117#define BUF_BEGV_BYTE(buf) ((buf)->begv_byte) 115 (buf == current_buffer ? BEGV \
116 : NILP (BVAR (buf, begv_marker)) ? buf->begv \
117 : marker_position (BVAR (buf, begv_marker)))
118
119#define BUF_BEGV_BYTE(buf) \
120 (buf == current_buffer ? BEGV_BYTE \
121 : NILP (BVAR (buf, begv_marker)) ? buf->begv_byte \
122 : marker_byte_position (BVAR (buf, begv_marker)))
118 123
119/* Position of point in buffer. */ 124/* Position of point in buffer. */
120#define BUF_PT(buf) ((buf)->pt) 125#define BUF_PT(buf) \
121#define BUF_PT_BYTE(buf) ((buf)->pt_byte) 126 (buf == current_buffer ? PT \
127 : NILP (BVAR (buf, pt_marker)) ? buf->pt \
128 : marker_position (BVAR (buf, pt_marker)))
129
130#define BUF_PT_BYTE(buf) \
131 (buf == current_buffer ? PT_BYTE \
132 : NILP (BVAR (buf, pt_marker)) ? buf->pt_byte \
133 : marker_byte_position (BVAR (buf, pt_marker)))
134
135/* Position of end of accessible range of buffer. */
136#define BUF_ZV(buf) \
137 (buf == current_buffer ? ZV \
138 : NILP (BVAR (buf, zv_marker)) ? buf->zv \
139 : marker_position (BVAR (buf, zv_marker)))
140
141#define BUF_ZV_BYTE(buf) \
142 (buf == current_buffer ? ZV_BYTE \
143 : NILP (BVAR (buf, zv_marker)) ? buf->zv_byte \
144 : marker_byte_position (BVAR (buf, zv_marker)))
122 145
123/* Position of gap in buffer. */ 146/* Position of gap in buffer. */
124#define BUF_GPT(buf) ((buf)->text->gpt) 147#define BUF_GPT(buf) ((buf)->text->gpt)
125#define BUF_GPT_BYTE(buf) ((buf)->text->gpt_byte) 148#define BUF_GPT_BYTE(buf) ((buf)->text->gpt_byte)
126 149
127/* Position of end of accessible range of buffer. */
128#define BUF_ZV(buf) ((buf)->zv)
129#define BUF_ZV_BYTE(buf) ((buf)->zv_byte)
130
131/* Position of end of buffer. */ 150/* Position of end of buffer. */
132#define BUF_Z(buf) ((buf)->text->z) 151#define BUF_Z(buf) ((buf)->text->z)
133#define BUF_Z_BYTE(buf) ((buf)->text->z_byte) 152#define BUF_Z_BYTE(buf) ((buf)->text->z_byte)
@@ -235,8 +254,6 @@ extern void enlarge_buffer_text (struct buffer *, EMACS_INT);
235 254
236/* Macros for setting the BEGV, ZV or PT of a given buffer. 255/* Macros for setting the BEGV, ZV or PT of a given buffer.
237 256
238 SET_BUF_PT* seet to be redundant. Get rid of them?
239
240 The ..._BOTH macros take both a charpos and a bytepos, 257 The ..._BOTH macros take both a charpos and a bytepos,
241 which must correspond to each other. 258 which must correspond to each other.
242 259
@@ -1009,4 +1026,31 @@ extern int last_per_buffer_idx;
1009 1026
1010#define PER_BUFFER_VALUE(BUFFER, OFFSET) \ 1027#define PER_BUFFER_VALUE(BUFFER, OFFSET) \
1011 (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER))) 1028 (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER)))
1029
1030/* Downcase a character C, or make no change if that cannot be done. */
1031static inline int
1032downcase (int c)
1033{
1034 Lisp_Object downcase_table = BVAR (current_buffer, downcase_table);
1035 Lisp_Object down = CHAR_TABLE_REF (downcase_table, c);
1036 return NATNUMP (down) ? XFASTINT (down) : c;
1037}
1038
1039/* 1 if C is upper case. */
1040static inline int uppercasep (int c) { return downcase (c) != c; }
1041
1042/* Upcase a character C known to be not upper case. */
1043static inline int
1044upcase1 (int c)
1045{
1046 Lisp_Object upcase_table = BVAR (current_buffer, upcase_table);
1047 Lisp_Object up = CHAR_TABLE_REF (upcase_table, c);
1048 return NATNUMP (up) ? XFASTINT (up) : c;
1049}
1050
1051/* 1 if C is lower case. */
1052static inline int lowercasep (int c)
1053{ return !uppercasep (c) && upcase1 (c) != c; }
1012 1054
1055/* Upcase a character C, or make no change if that cannot be done. */
1056static inline int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); }
diff --git a/src/bytecode.c b/src/bytecode.c
index ba3c012bd1a..d887668dd39 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -76,11 +76,7 @@ Lisp_Object Qbyte_code_meter;
76 } \ 76 } \
77} 77}
78 78
79#else /* no BYTE_CODE_METER */ 79#endif /* BYTE_CODE_METER */
80
81#define METER_CODE(last_code, this_code)
82
83#endif /* no BYTE_CODE_METER */
84 80
85 81
86Lisp_Object Qbytecode; 82Lisp_Object Qbytecode;
@@ -148,7 +144,9 @@ extern Lisp_Object Qand_optional, Qand_rest;
148#define Bpreceding_char 0150 144#define Bpreceding_char 0150
149#define Bcurrent_column 0151 145#define Bcurrent_column 0151
150#define Bindent_to 0152 146#define Bindent_to 0152
147#ifdef BYTE_CODE_SAFE
151#define Bscan_buffer 0153 /* No longer generated as of v18 */ 148#define Bscan_buffer 0153 /* No longer generated as of v18 */
149#endif
152#define Beolp 0154 150#define Beolp 0154
153#define Beobp 0155 151#define Beobp 0155
154#define Bbolp 0156 152#define Bbolp 0156
@@ -156,8 +154,12 @@ extern Lisp_Object Qand_optional, Qand_rest;
156#define Bcurrent_buffer 0160 154#define Bcurrent_buffer 0160
157#define Bset_buffer 0161 155#define Bset_buffer 0161
158#define Bsave_current_buffer_1 0162 /* Replacing Bsave_current_buffer. */ 156#define Bsave_current_buffer_1 0162 /* Replacing Bsave_current_buffer. */
157#if 0
159#define Bread_char 0162 /* No longer generated as of v19 */ 158#define Bread_char 0162 /* No longer generated as of v19 */
159#endif
160#ifdef BYTE_CODE_SAFE
160#define Bset_mark 0163 /* this loser is no longer generated as of v18 */ 161#define Bset_mark 0163 /* this loser is no longer generated as of v18 */
162#endif
161#define Binteractive_p 0164 /* Obsolete. */ 163#define Binteractive_p 0164 /* Obsolete. */
162 164
163#define Bforward_char 0165 165#define Bforward_char 0165
@@ -234,7 +236,6 @@ extern Lisp_Object Qand_optional, Qand_rest;
234#define BdiscardN 0266 236#define BdiscardN 0266
235 237
236#define Bconstant 0300 238#define Bconstant 0300
237#define CONSTANTLIM 0100
238 239
239/* Whether to maintain a `top' and `bottom' field in the stack frame. */ 240/* Whether to maintain a `top' and `bottom' field in the stack frame. */
240#define BYTE_MAINTAIN_TOP (BYTE_CODE_SAFE || BYTE_MARK_STACK) 241#define BYTE_MAINTAIN_TOP (BYTE_CODE_SAFE || BYTE_MARK_STACK)
@@ -370,6 +371,7 @@ unmark_byte_stack (void)
370 We do this at every branch, to avoid loops that never GC. */ 371 We do this at every branch, to avoid loops that never GC. */
371 372
372#define MAYBE_GC() \ 373#define MAYBE_GC() \
374 do { \
373 if (consing_since_gc > gc_cons_threshold \ 375 if (consing_since_gc > gc_cons_threshold \
374 && consing_since_gc > gc_relative_threshold) \ 376 && consing_since_gc > gc_relative_threshold) \
375 { \ 377 { \
@@ -377,7 +379,7 @@ unmark_byte_stack (void)
377 Fgarbage_collect (); \ 379 Fgarbage_collect (); \
378 AFTER_POTENTIAL_GC (); \ 380 AFTER_POTENTIAL_GC (); \
379 } \ 381 } \
380 else 382 } while (0)
381 383
382/* Check for jumping out of range. */ 384/* Check for jumping out of range. */
383 385
diff --git a/src/callint.c b/src/callint.c
index a0efc4bbfe4..3c520742e27 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -118,7 +118,7 @@ usage: (interactive &optional ARGS) */)
118 118
119/* Quotify EXP: if EXP is constant, return it. 119/* Quotify EXP: if EXP is constant, return it.
120 If EXP is not constant, return (quote EXP). */ 120 If EXP is not constant, return (quote EXP). */
121Lisp_Object 121static Lisp_Object
122quotify_arg (register Lisp_Object exp) 122quotify_arg (register Lisp_Object exp)
123{ 123{
124 if (CONSP (exp) 124 if (CONSP (exp)
@@ -130,7 +130,7 @@ quotify_arg (register Lisp_Object exp)
130} 130}
131 131
132/* Modify EXP by quotifying each element (except the first). */ 132/* Modify EXP by quotifying each element (except the first). */
133Lisp_Object 133static Lisp_Object
134quotify_args (Lisp_Object exp) 134quotify_args (Lisp_Object exp)
135{ 135{
136 register Lisp_Object tail; 136 register Lisp_Object tail;
@@ -262,7 +262,7 @@ invoke it. If KEYS is omitted or nil, the return value of
262 262
263 Lisp_Object prefix_arg; 263 Lisp_Object prefix_arg;
264 char *string; 264 char *string;
265 char *tem; 265 const char *tem;
266 266
267 /* If varies[i] > 0, the i'th argument shouldn't just have its value 267 /* If varies[i] > 0, the i'th argument shouldn't just have its value
268 in this call quoted in the command history. It should be 268 in this call quoted in the command history. It should be
@@ -415,25 +415,25 @@ invoke it. If KEYS is omitted or nil, the return value of
415 string++; 415 string++;
416 else if (*string == '@') 416 else if (*string == '@')
417 { 417 {
418 Lisp_Object event, tem; 418 Lisp_Object event, w;
419 419
420 event = (next_event < key_count 420 event = (next_event < key_count
421 ? AREF (keys, next_event) 421 ? AREF (keys, next_event)
422 : Qnil); 422 : Qnil);
423 if (EVENT_HAS_PARAMETERS (event) 423 if (EVENT_HAS_PARAMETERS (event)
424 && (tem = XCDR (event), CONSP (tem)) 424 && (w = XCDR (event), CONSP (w))
425 && (tem = XCAR (tem), CONSP (tem)) 425 && (w = XCAR (w), CONSP (w))
426 && (tem = XCAR (tem), WINDOWP (tem))) 426 && (w = XCAR (w), WINDOWP (w)))
427 { 427 {
428 if (MINI_WINDOW_P (XWINDOW (tem)) 428 if (MINI_WINDOW_P (XWINDOW (w))
429 && ! (minibuf_level > 0 && EQ (tem, minibuf_window))) 429 && ! (minibuf_level > 0 && EQ (w, minibuf_window)))
430 error ("Attempt to select inactive minibuffer window"); 430 error ("Attempt to select inactive minibuffer window");
431 431
432 /* If the current buffer wants to clean up, let it. */ 432 /* If the current buffer wants to clean up, let it. */
433 if (!NILP (Vmouse_leave_buffer_hook)) 433 if (!NILP (Vmouse_leave_buffer_hook))
434 call1 (Vrun_hooks, Qmouse_leave_buffer_hook); 434 call1 (Vrun_hooks, Qmouse_leave_buffer_hook);
435 435
436 Fselect_window (tem, Qnil); 436 Fselect_window (w, Qnil);
437 } 437 }
438 string++; 438 string++;
439 } 439 }
@@ -686,7 +686,7 @@ invoke it. If KEYS is omitted or nil, the return value of
686 int first = 1; 686 int first = 1;
687 do 687 do
688 { 688 {
689 Lisp_Object tem; 689 Lisp_Object str;
690 if (! first) 690 if (! first)
691 { 691 {
692 message ("Please enter a number."); 692 message ("Please enter a number.");
@@ -694,13 +694,13 @@ invoke it. If KEYS is omitted or nil, the return value of
694 } 694 }
695 first = 0; 695 first = 0;
696 696
697 tem = Fread_from_minibuffer (callint_message, 697 str = Fread_from_minibuffer (callint_message,
698 Qnil, Qnil, Qnil, Qnil, Qnil, 698 Qnil, Qnil, Qnil, Qnil, Qnil,
699 Qnil); 699 Qnil);
700 if (! STRINGP (tem) || SCHARS (tem) == 0) 700 if (! STRINGP (str) || SCHARS (str) == 0)
701 args[i] = Qnil; 701 args[i] = Qnil;
702 else 702 else
703 args[i] = Fread (tem); 703 args[i] = Fread (str);
704 } 704 }
705 while (! NUMBERP (args[i])); 705 while (! NUMBERP (args[i]));
706 } 706 }
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 26fa0db2d77..43ecd38dc7d 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -32,7 +32,7 @@ enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP};
32 32
33Lisp_Object Qidentity; 33Lisp_Object Qidentity;
34 34
35Lisp_Object 35static Lisp_Object
36casify_object (enum case_action flag, Lisp_Object obj) 36casify_object (enum case_action flag, Lisp_Object obj)
37{ 37{
38 register int c, c1; 38 register int c, c1;
@@ -64,13 +64,13 @@ casify_object (enum case_action flag, Lisp_Object obj)
64 multibyte = 1; 64 multibyte = 1;
65 if (! multibyte) 65 if (! multibyte)
66 MAKE_CHAR_MULTIBYTE (c1); 66 MAKE_CHAR_MULTIBYTE (c1);
67 c = DOWNCASE (c1); 67 c = downcase (c1);
68 if (inword) 68 if (inword)
69 XSETFASTINT (obj, c | flags); 69 XSETFASTINT (obj, c | flags);
70 else if (c == (XFASTINT (obj) & ~flagbits)) 70 else if (c == (XFASTINT (obj) & ~flagbits))
71 { 71 {
72 if (! inword) 72 if (! inword)
73 c = UPCASE1 (c1); 73 c = upcase1 (c1);
74 if (! multibyte) 74 if (! multibyte)
75 MAKE_CHAR_UNIBYTE (c); 75 MAKE_CHAR_UNIBYTE (c);
76 XSETFASTINT (obj, c | flags); 76 XSETFASTINT (obj, c | flags);
@@ -92,10 +92,10 @@ casify_object (enum case_action flag, Lisp_Object obj)
92 MAKE_CHAR_MULTIBYTE (c); 92 MAKE_CHAR_MULTIBYTE (c);
93 c1 = c; 93 c1 = c;
94 if (inword && flag != CASE_CAPITALIZE_UP) 94 if (inword && flag != CASE_CAPITALIZE_UP)
95 c = DOWNCASE (c); 95 c = downcase (c);
96 else if (!UPPERCASEP (c) 96 else if (!uppercasep (c)
97 && (!inword || flag != CASE_CAPITALIZE_UP)) 97 && (!inword || flag != CASE_CAPITALIZE_UP))
98 c = UPCASE1 (c1); 98 c = upcase1 (c1);
99 if ((int) flag >= (int) CASE_CAPITALIZE) 99 if ((int) flag >= (int) CASE_CAPITALIZE)
100 inword = (SYNTAX (c) == Sword); 100 inword = (SYNTAX (c) == Sword);
101 if (c != c1) 101 if (c != c1)
@@ -133,10 +133,10 @@ casify_object (enum case_action flag, Lisp_Object obj)
133 } 133 }
134 c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i_byte, len); 134 c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i_byte, len);
135 if (inword && flag != CASE_CAPITALIZE_UP) 135 if (inword && flag != CASE_CAPITALIZE_UP)
136 c = DOWNCASE (c); 136 c = downcase (c);
137 else if (!UPPERCASEP (c) 137 else if (!uppercasep (c)
138 && (!inword || flag != CASE_CAPITALIZE_UP)) 138 && (!inword || flag != CASE_CAPITALIZE_UP))
139 c = UPCASE1 (c); 139 c = upcase1 (c);
140 if ((int) flag >= (int) CASE_CAPITALIZE) 140 if ((int) flag >= (int) CASE_CAPITALIZE)
141 inword = (SYNTAX (c) == Sword); 141 inword = (SYNTAX (c) == Sword);
142 o += CHAR_STRING (c, o); 142 o += CHAR_STRING (c, o);
@@ -193,7 +193,7 @@ The argument object is not altered--the value is a copy. */)
193/* flag is CASE_UP, CASE_DOWN or CASE_CAPITALIZE or CASE_CAPITALIZE_UP. 193/* flag is CASE_UP, CASE_DOWN or CASE_CAPITALIZE or CASE_CAPITALIZE_UP.
194 b and e specify range of buffer to operate on. */ 194 b and e specify range of buffer to operate on. */
195 195
196void 196static void
197casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e) 197casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
198{ 198{
199 register int c; 199 register int c;
@@ -201,7 +201,10 @@ casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
201 register int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); 201 register int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
202 EMACS_INT start, end; 202 EMACS_INT start, end;
203 EMACS_INT start_byte, end_byte; 203 EMACS_INT start_byte, end_byte;
204 EMACS_INT first = -1, last; /* Position of first and last changes. */ 204
205 /* Position of first and last changes. */
206 EMACS_INT first = -1, last IF_LINT (= 0);
207
205 EMACS_INT opoint = PT; 208 EMACS_INT opoint = PT;
206 EMACS_INT opoint_byte = PT_BYTE; 209 EMACS_INT opoint_byte = PT_BYTE;
207 210
@@ -240,10 +243,10 @@ casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
240 } 243 }
241 c2 = c; 244 c2 = c;
242 if (inword && flag != CASE_CAPITALIZE_UP) 245 if (inword && flag != CASE_CAPITALIZE_UP)
243 c = DOWNCASE (c); 246 c = downcase (c);
244 else if (!UPPERCASEP (c) 247 else if (!uppercasep (c)
245 && (!inword || flag != CASE_CAPITALIZE_UP)) 248 && (!inword || flag != CASE_CAPITALIZE_UP))
246 c = UPCASE1 (c); 249 c = upcase1 (c);
247 if ((int) flag >= (int) CASE_CAPITALIZE) 250 if ((int) flag >= (int) CASE_CAPITALIZE)
248 inword = ((SYNTAX (c) == Sword) 251 inword = ((SYNTAX (c) == Sword)
249 && (inword || !syntax_prefix_flag_p (c))); 252 && (inword || !syntax_prefix_flag_p (c)));
diff --git a/src/casetab.c b/src/casetab.c
index 5207e5315ae..56f6b065358 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -28,11 +28,6 @@ Lisp_Object Qcase_table_p, Qcase_table;
28Lisp_Object Vascii_downcase_table, Vascii_upcase_table; 28Lisp_Object Vascii_downcase_table, Vascii_upcase_table;
29Lisp_Object Vascii_canon_table, Vascii_eqv_table; 29Lisp_Object Vascii_canon_table, Vascii_eqv_table;
30 30
31/* Used as a temporary in DOWNCASE and other macros in lisp.h. No
32 need to mark it, since it is used only very temporarily. */
33int case_temp1;
34Lisp_Object case_temp2;
35
36static void set_canon (Lisp_Object case_table, Lisp_Object range, Lisp_Object elt); 31static void set_canon (Lisp_Object case_table, Lisp_Object range, Lisp_Object elt);
37static void set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt); 32static void set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt);
38static void shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt); 33static void shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt);
@@ -302,4 +297,3 @@ syms_of_casetab (void)
302 defsubr (&Sset_case_table); 297 defsubr (&Sset_case_table);
303 defsubr (&Sset_standard_case_table); 298 defsubr (&Sset_standard_case_table);
304} 299}
305
diff --git a/src/category.c b/src/category.c
index bcd73d3a487..cc7ff88474f 100644
--- a/src/category.c
+++ b/src/category.c
@@ -61,7 +61,6 @@ static Lisp_Object hash_get_category_set (Lisp_Object, Lisp_Object);
61static Lisp_Object 61static Lisp_Object
62hash_get_category_set (Lisp_Object table, Lisp_Object category_set) 62hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
63{ 63{
64 Lisp_Object val;
65 struct Lisp_Hash_Table *h; 64 struct Lisp_Hash_Table *h;
66 int i; 65 int i;
67 unsigned hash; 66 unsigned hash;
@@ -228,7 +227,7 @@ copy_category_entry (Lisp_Object table, Lisp_Object c, Lisp_Object val)
228 the original and the copy. This function is called recursively by 227 the original and the copy. This function is called recursively by
229 binding TABLE to a sub char table. */ 228 binding TABLE to a sub char table. */
230 229
231Lisp_Object 230static Lisp_Object
232copy_category_table (Lisp_Object table) 231copy_category_table (Lisp_Object table)
233{ 232{
234 table = copy_char_table (table); 233 table = copy_char_table (table);
@@ -538,4 +537,3 @@ See the documentation of the variable `word-combining-categories'. */);
538 537
539 category_table_version = 0; 538 category_table_version = 0;
540} 539}
541
diff --git a/src/ccl.c b/src/ccl.c
index 411c041b22a..5428e94c69a 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -758,18 +758,18 @@ while(0)
758 buffer. */ 758 buffer. */
759#define CCL_WRITE_STRING(len) \ 759#define CCL_WRITE_STRING(len) \
760 do { \ 760 do { \
761 int i; \ 761 int ccli; \
762 if (!dst) \ 762 if (!dst) \
763 CCL_INVALID_CMD; \ 763 CCL_INVALID_CMD; \
764 else if (dst + len <= dst_end) \ 764 else if (dst + len <= dst_end) \
765 { \ 765 { \
766 if (XFASTINT (ccl_prog[ic]) & 0x1000000) \ 766 if (XFASTINT (ccl_prog[ic]) & 0x1000000) \
767 for (i = 0; i < len; i++) \ 767 for (ccli = 0; ccli < len; ccli++) \
768 *dst++ = XFASTINT (ccl_prog[ic + i]) & 0xFFFFFF; \ 768 *dst++ = XFASTINT (ccl_prog[ic + ccli]) & 0xFFFFFF; \
769 else \ 769 else \
770 for (i = 0; i < len; i++) \ 770 for (ccli = 0; ccli < len; ccli++) \
771 *dst++ = ((XFASTINT (ccl_prog[ic + (i / 3)])) \ 771 *dst++ = ((XFASTINT (ccl_prog[ic + (ccli / 3)])) \
772 >> ((2 - (i % 3)) * 8)) & 0xFF; \ 772 >> ((2 - (ccli % 3)) * 8)) & 0xFF; \
773 } \ 773 } \
774 else \ 774 else \
775 CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ 775 CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \
@@ -806,15 +806,15 @@ while(0)
806 806
807#define CCL_ENCODE_CHAR(c, charset_list, id, encoded) \ 807#define CCL_ENCODE_CHAR(c, charset_list, id, encoded) \
808 do { \ 808 do { \
809 unsigned code; \ 809 unsigned ncode; \
810 \ 810 \
811 charset = char_charset ((c), (charset_list), &code); \ 811 charset = char_charset ((c), (charset_list), &ncode); \
812 if (! charset && ! NILP (charset_list)) \ 812 if (! charset && ! NILP (charset_list)) \
813 charset = char_charset ((c), Qnil, &code); \ 813 charset = char_charset ((c), Qnil, &ncode); \
814 if (charset) \ 814 if (charset) \
815 { \ 815 { \
816 (id) = CHARSET_ID (charset); \ 816 (id) = CHARSET_ID (charset); \
817 (encoded) = code; \ 817 (encoded) = ncode; \
818 } \ 818 } \
819 } while (0) 819 } while (0)
820 820
@@ -2092,22 +2092,22 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
2092 { 2092 {
2093 const unsigned char *p = SDATA (str) + consumed_bytes; 2093 const unsigned char *p = SDATA (str) + consumed_bytes;
2094 const unsigned char *endp = SDATA (str) + str_bytes; 2094 const unsigned char *endp = SDATA (str) + str_bytes;
2095 int i = 0; 2095 int j = 0;
2096 int *src, src_size; 2096 int *src, src_size;
2097 2097
2098 if (endp - p == str_chars - consumed_chars) 2098 if (endp - p == str_chars - consumed_chars)
2099 while (i < CCL_EXECUTE_BUF_SIZE && p < endp) 2099 while (j < CCL_EXECUTE_BUF_SIZE && p < endp)
2100 source[i++] = *p++; 2100 source[j++] = *p++;
2101 else 2101 else
2102 while (i < CCL_EXECUTE_BUF_SIZE && p < endp) 2102 while (j < CCL_EXECUTE_BUF_SIZE && p < endp)
2103 source[i++] = STRING_CHAR_ADVANCE (p); 2103 source[j++] = STRING_CHAR_ADVANCE (p);
2104 consumed_chars += i; 2104 consumed_chars += j;
2105 consumed_bytes = p - SDATA (str); 2105 consumed_bytes = p - SDATA (str);
2106 2106
2107 if (consumed_bytes == str_bytes) 2107 if (consumed_bytes == str_bytes)
2108 ccl.last_block = NILP (contin); 2108 ccl.last_block = NILP (contin);
2109 src = source; 2109 src = source;
2110 src_size = i; 2110 src_size = j;
2111 while (1) 2111 while (1)
2112 { 2112 {
2113 ccl_driver (&ccl, src, destination, src_size, CCL_EXECUTE_BUF_SIZE, 2113 ccl_driver (&ccl, src, destination, src_size, CCL_EXECUTE_BUF_SIZE,
@@ -2123,8 +2123,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
2123 outbuf = (unsigned char *) xrealloc (outbuf, outbufsize); 2123 outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
2124 outp = outbuf + offset; 2124 outp = outbuf + offset;
2125 } 2125 }
2126 for (i = 0; i < ccl.produced; i++) 2126 for (j = 0; j < ccl.produced; j++)
2127 CHAR_STRING_ADVANCE (destination[i], outp); 2127 CHAR_STRING_ADVANCE (destination[j], outp);
2128 } 2128 }
2129 else 2129 else
2130 { 2130 {
@@ -2135,8 +2135,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
2135 outbuf = (unsigned char *) xrealloc (outbuf, outbufsize); 2135 outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
2136 outp = outbuf + offset; 2136 outp = outbuf + offset;
2137 } 2137 }
2138 for (i = 0; i < ccl.produced; i++) 2138 for (j = 0; j < ccl.produced; j++)
2139 *outp++ = destination[i]; 2139 *outp++ = destination[j];
2140 } 2140 }
2141 src += ccl.consumed; 2141 src += ccl.consumed;
2142 src_size -= ccl.consumed; 2142 src_size -= ccl.consumed;
@@ -2253,7 +2253,7 @@ Return index number of the registered map. */)
2253{ 2253{
2254 int len = ASIZE (Vcode_conversion_map_vector); 2254 int len = ASIZE (Vcode_conversion_map_vector);
2255 int i; 2255 int i;
2256 Lisp_Object index; 2256 Lisp_Object idx;
2257 2257
2258 CHECK_SYMBOL (symbol); 2258 CHECK_SYMBOL (symbol);
2259 CHECK_VECTOR (map); 2259 CHECK_VECTOR (map);
@@ -2267,11 +2267,11 @@ Return index number of the registered map. */)
2267 2267
2268 if (EQ (symbol, XCAR (slot))) 2268 if (EQ (symbol, XCAR (slot)))
2269 { 2269 {
2270 index = make_number (i); 2270 idx = make_number (i);
2271 XSETCDR (slot, map); 2271 XSETCDR (slot, map);
2272 Fput (symbol, Qcode_conversion_map, map); 2272 Fput (symbol, Qcode_conversion_map, map);
2273 Fput (symbol, Qcode_conversion_map_id, index); 2273 Fput (symbol, Qcode_conversion_map_id, idx);
2274 return index; 2274 return idx;
2275 } 2275 }
2276 } 2276 }
2277 2277
@@ -2279,11 +2279,11 @@ Return index number of the registered map. */)
2279 Vcode_conversion_map_vector = larger_vector (Vcode_conversion_map_vector, 2279 Vcode_conversion_map_vector = larger_vector (Vcode_conversion_map_vector,
2280 len * 2, Qnil); 2280 len * 2, Qnil);
2281 2281
2282 index = make_number (i); 2282 idx = make_number (i);
2283 Fput (symbol, Qcode_conversion_map, map); 2283 Fput (symbol, Qcode_conversion_map, map);
2284 Fput (symbol, Qcode_conversion_map_id, index); 2284 Fput (symbol, Qcode_conversion_map_id, idx);
2285 ASET (Vcode_conversion_map_vector, i, Fcons (symbol, map)); 2285 ASET (Vcode_conversion_map_vector, i, Fcons (symbol, map));
2286 return index; 2286 return idx;
2287} 2287}
2288 2288
2289 2289
@@ -2341,4 +2341,3 @@ used by CCL. */);
2341 defsubr (&Sregister_ccl_program); 2341 defsubr (&Sregister_ccl_program);
2342 defsubr (&Sregister_code_conversion_map); 2342 defsubr (&Sregister_code_conversion_map);
2343} 2343}
2344
diff --git a/src/character.c b/src/character.c
index 6f3312fec29..fdaf22f04f8 100644
--- a/src/character.c
+++ b/src/character.c
@@ -786,7 +786,7 @@ str_to_unibyte (const unsigned char *src, unsigned char *dst, EMACS_INT chars, i
786} 786}
787 787
788 788
789EMACS_INT 789static EMACS_INT
790string_count_byte8 (Lisp_Object string) 790string_count_byte8 (Lisp_Object string)
791{ 791{
792 int multibyte = STRING_MULTIBYTE (string); 792 int multibyte = STRING_MULTIBYTE (string);
diff --git a/src/character.h b/src/character.h
index fb29ced66b7..4c468e14d2c 100644
--- a/src/character.h
+++ b/src/character.h
@@ -128,9 +128,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
128 XSETCDR ((x), tmp); \ 128 XSETCDR ((x), tmp); \
129 } while (0) 129 } while (0)
130 130
131/* Nonzero iff C is an ASCII character. */
132#define ASCII_CHAR_P(c) ((unsigned) (c) < 0x80)
133
134/* Nonzero iff C is a character of code less than 0x100. */ 131/* Nonzero iff C is a character of code less than 0x100. */
135#define SINGLE_BYTE_CHAR_P(c) ((unsigned) (c) < 0x100) 132#define SINGLE_BYTE_CHAR_P(c) ((unsigned) (c) < 0x100)
136 133
@@ -281,11 +278,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
281 do { \ 278 do { \
282 if ((p) > (limit)) \ 279 if ((p) > (limit)) \
283 { \ 280 { \
284 const unsigned char *p0 = (p); \ 281 const unsigned char *pcb = (p); \
285 do { \ 282 do { \
286 p0--; \ 283 pcb--; \
287 } while (p0 >= limit && ! CHAR_HEAD_P (*p0)); \ 284 } while (pcb >= limit && ! CHAR_HEAD_P (*pcb)); \
288 (p) = (BYTES_BY_CHAR_HEAD (*p0) == (p) - p0) ? p0 : (p) - 1; \ 285 (p) = (BYTES_BY_CHAR_HEAD (*pcb) == (p) - pcb) ? pcb : (p) - 1; \
289 } \ 286 } \
290 } while (0) 287 } while (0)
291 288
@@ -356,11 +353,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
356 CHARIDX++; \ 353 CHARIDX++; \
357 if (STRING_MULTIBYTE (STRING)) \ 354 if (STRING_MULTIBYTE (STRING)) \
358 { \ 355 { \
359 unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \ 356 unsigned char *string_ptr = &SDATA (STRING)[BYTEIDX]; \
360 int len; \ 357 int string_len; \
361 \ 358 \
362 OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \ 359 OUTPUT = STRING_CHAR_AND_LENGTH (string_ptr, string_len); \
363 BYTEIDX += len; \ 360 BYTEIDX += string_len; \
364 } \ 361 } \
365 else \ 362 else \
366 { \ 363 { \
@@ -380,10 +377,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
380 if (STRING_MULTIBYTE (STRING)) \ 377 if (STRING_MULTIBYTE (STRING)) \
381 { \ 378 { \
382 unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \ 379 unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \
383 int len; \ 380 int ptrlen; \
384 \ 381 \
385 OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \ 382 OUTPUT = STRING_CHAR_AND_LENGTH (ptr, ptrlen); \
386 BYTEIDX += len; \ 383 BYTEIDX += ptrlen; \
387 } \ 384 } \
388 else \ 385 else \
389 { \ 386 { \
@@ -400,11 +397,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
400#define FETCH_STRING_CHAR_ADVANCE_NO_CHECK(OUTPUT, STRING, CHARIDX, BYTEIDX) \ 397#define FETCH_STRING_CHAR_ADVANCE_NO_CHECK(OUTPUT, STRING, CHARIDX, BYTEIDX) \
401 do \ 398 do \
402 { \ 399 { \
403 unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \ 400 unsigned char *fetch_ptr = &SDATA (STRING)[BYTEIDX]; \
404 int len; \ 401 int fetch_len; \
405 \ 402 \
406 OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \ 403 OUTPUT = STRING_CHAR_AND_LENGTH (fetch_ptr, fetch_len); \
407 BYTEIDX += len; \ 404 BYTEIDX += fetch_len; \
408 CHARIDX++; \ 405 CHARIDX++; \
409 } \ 406 } \
410 while (0) 407 while (0)
@@ -420,10 +417,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
420 if (!NILP (BVAR (current_buffer, enable_multibyte_characters))) \ 417 if (!NILP (BVAR (current_buffer, enable_multibyte_characters))) \
421 { \ 418 { \
422 unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \ 419 unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
423 int len; \ 420 int string_len; \
424 \ 421 \
425 OUTPUT= STRING_CHAR_AND_LENGTH (ptr, len); \ 422 OUTPUT= STRING_CHAR_AND_LENGTH (ptr, string_len); \
426 BYTEIDX += len; \ 423 BYTEIDX += string_len; \
427 } \ 424 } \
428 else \ 425 else \
429 { \ 426 { \
@@ -454,8 +451,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
454 451
455#define INC_POS(pos_byte) \ 452#define INC_POS(pos_byte) \
456 do { \ 453 do { \
457 unsigned char *p = BYTE_POS_ADDR (pos_byte); \ 454 unsigned char *ptr = BYTE_POS_ADDR (pos_byte); \
458 pos_byte += BYTES_BY_CHAR_HEAD (*p); \ 455 pos_byte += BYTES_BY_CHAR_HEAD (*ptr); \
459 } while (0) 456 } while (0)
460 457
461 458
@@ -464,16 +461,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
464 461
465#define DEC_POS(pos_byte) \ 462#define DEC_POS(pos_byte) \
466 do { \ 463 do { \
467 unsigned char *p; \ 464 unsigned char *ptr; \
468 \ 465 \
469 pos_byte--; \ 466 pos_byte--; \
470 if (pos_byte < GPT_BYTE) \ 467 if (pos_byte < GPT_BYTE) \
471 p = BEG_ADDR + pos_byte - BEG_BYTE; \ 468 ptr = BEG_ADDR + pos_byte - BEG_BYTE; \
472 else \ 469 else \
473 p = BEG_ADDR + GAP_SIZE + pos_byte - BEG_BYTE;\ 470 ptr = BEG_ADDR + GAP_SIZE + pos_byte - BEG_BYTE; \
474 while (!CHAR_HEAD_P (*p)) \ 471 while (!CHAR_HEAD_P (*ptr)) \
475 { \ 472 { \
476 p--; \ 473 ptr--; \
477 pos_byte--; \ 474 pos_byte--; \
478 } \ 475 } \
479 } while (0) 476 } while (0)
@@ -513,8 +510,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
513 510
514#define BUF_INC_POS(buf, pos_byte) \ 511#define BUF_INC_POS(buf, pos_byte) \
515 do { \ 512 do { \
516 unsigned char *p = BUF_BYTE_ADDRESS (buf, pos_byte); \ 513 unsigned char *bbp = BUF_BYTE_ADDRESS (buf, pos_byte); \
517 pos_byte += BYTES_BY_CHAR_HEAD (*p); \ 514 pos_byte += BYTES_BY_CHAR_HEAD (*bbp); \
518 } while (0) 515 } while (0)
519 516
520 517
diff --git a/src/charset.c b/src/charset.c
index 3624e740acb..d82b29ae44b 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -29,6 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
29#include <stdio.h> 29#include <stdio.h>
30#include <unistd.h> 30#include <unistd.h>
31#include <ctype.h> 31#include <ctype.h>
32#include <limits.h>
32#include <sys/types.h> 33#include <sys/types.h>
33#include <setjmp.h> 34#include <setjmp.h>
34#include "lisp.h" 35#include "lisp.h"
@@ -250,7 +251,7 @@ struct charset_map_entries
250static void 251static void
251load_charset_map (struct charset *charset, struct charset_map_entries *entries, int n_entries, int control_flag) 252load_charset_map (struct charset *charset, struct charset_map_entries *entries, int n_entries, int control_flag)
252{ 253{
253 Lisp_Object vec, table; 254 Lisp_Object vec IF_LINT (= Qnil), table IF_LINT (= Qnil);
254 unsigned max_code = CHARSET_MAX_CODE (charset); 255 unsigned max_code = CHARSET_MAX_CODE (charset);
255 int ascii_compatible_p = charset->ascii_compatible_p; 256 int ascii_compatible_p = charset->ascii_compatible_p;
256 int min_char, max_char, nonascii_min_char; 257 int min_char, max_char, nonascii_min_char;
@@ -629,8 +630,12 @@ load_charset (struct charset *charset, int control_flag)
629 630
630 if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP) 631 if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP)
631 map = CHARSET_MAP (charset); 632 map = CHARSET_MAP (charset);
632 else if (CHARSET_UNIFIED_P (charset)) 633 else
633 map = CHARSET_UNIFY_MAP (charset); 634 {
635 if (! CHARSET_UNIFIED_P (charset))
636 abort ();
637 map = CHARSET_UNIFY_MAP (charset);
638 }
634 if (STRINGP (map)) 639 if (STRINGP (map))
635 load_charset_map_from_file (charset, map, control_flag); 640 load_charset_map_from_file (charset, map, control_flag);
636 else 641 else
@@ -668,9 +673,9 @@ map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), Lisp_Object
668 673
669 while (1) 674 while (1)
670 { 675 {
671 int index = GET_TEMP_CHARSET_WORK_ENCODER (c); 676 int idx = GET_TEMP_CHARSET_WORK_ENCODER (c);
672 677
673 if (index >= from_idx && index <= to_idx) 678 if (idx >= from_idx && idx <= to_idx)
674 { 679 {
675 if (NILP (XCAR (range))) 680 if (NILP (XCAR (range)))
676 XSETCAR (range, make_number (c)); 681 XSETCAR (range, make_number (c));
@@ -2066,10 +2071,10 @@ that case, find the charset from what supported by that coding system. */)
2066 2071
2067 for (; CONSP (restriction); restriction = XCDR (restriction)) 2072 for (; CONSP (restriction); restriction = XCDR (restriction))
2068 { 2073 {
2069 struct charset *charset; 2074 struct charset *rcharset;
2070 2075
2071 CHECK_CHARSET_GET_CHARSET (XCAR (restriction), charset); 2076 CHECK_CHARSET_GET_CHARSET (XCAR (restriction), rcharset);
2072 if (ENCODE_CHAR (charset, c) != CHARSET_INVALID_CODE (charset)) 2077 if (ENCODE_CHAR (rcharset, c) != CHARSET_INVALID_CODE (rcharset))
2073 return XCAR (restriction); 2078 return XCAR (restriction);
2074 } 2079 }
2075 return Qnil; 2080 return Qnil;
@@ -2250,7 +2255,7 @@ See also `charset-priority-list' and `set-charset-priority'. */)
2250 int n = XFASTINT (len), i, j, done; 2255 int n = XFASTINT (len), i, j, done;
2251 Lisp_Object tail, elt, attrs; 2256 Lisp_Object tail, elt, attrs;
2252 struct charset_sort_data *sort_data; 2257 struct charset_sort_data *sort_data;
2253 int id, min_id, max_id; 2258 int id, min_id = INT_MAX, max_id = INT_MIN;
2254 USE_SAFE_ALLOCA; 2259 USE_SAFE_ALLOCA;
2255 2260
2256 if (n == 0) 2261 if (n == 0)
@@ -2262,11 +2267,9 @@ See also `charset-priority-list' and `set-charset-priority'. */)
2262 CHECK_CHARSET_GET_ATTR (elt, attrs); 2267 CHECK_CHARSET_GET_ATTR (elt, attrs);
2263 sort_data[i].charset = elt; 2268 sort_data[i].charset = elt;
2264 sort_data[i].id = id = XINT (CHARSET_ATTR_ID (attrs)); 2269 sort_data[i].id = id = XINT (CHARSET_ATTR_ID (attrs));
2265 if (i == 0) 2270 if (id < min_id)
2266 min_id = max_id = id;
2267 else if (id < min_id)
2268 min_id = id; 2271 min_id = id;
2269 else if (id > max_id) 2272 if (id > max_id)
2270 max_id = id; 2273 max_id = id;
2271 } 2274 }
2272 for (done = 0, tail = Vcharset_ordered_list, i = 0; 2275 for (done = 0, tail = Vcharset_ordered_list, i = 0;
diff --git a/src/charset.h b/src/charset.h
index 1fc552a5bd3..8c87ffe6c3d 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -358,9 +358,9 @@ extern int emacs_mule_charset[256];
358 358
359#define CHECK_CHARSET_GET_CHARSET(x, charset) \ 359#define CHECK_CHARSET_GET_CHARSET(x, charset) \
360 do { \ 360 do { \
361 int id; \ 361 int csid; \
362 CHECK_CHARSET_GET_ID (x, id); \ 362 CHECK_CHARSET_GET_ID (x, csid); \
363 charset = CHARSET_FROM_ID (id); \ 363 charset = CHARSET_FROM_ID (csid); \
364 } while (0) 364 } while (0)
365 365
366 366
@@ -541,4 +541,3 @@ extern void map_charset_chars (void (*) (Lisp_Object, Lisp_Object),
541 struct charset *, unsigned, unsigned); 541 struct charset *, unsigned, unsigned);
542 542
543#endif /* EMACS_CHARSET_H */ 543#endif /* EMACS_CHARSET_H */
544
diff --git a/src/chartab.c b/src/chartab.c
index cd8aa784eb4..85aa5932ac3 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -118,7 +118,7 @@ char_table_ascii (Lisp_Object table)
118 return XSUB_CHAR_TABLE (sub)->contents[0]; 118 return XSUB_CHAR_TABLE (sub)->contents[0];
119} 119}
120 120
121Lisp_Object 121static Lisp_Object
122copy_sub_char_table (Lisp_Object table) 122copy_sub_char_table (Lisp_Object table)
123{ 123{
124 Lisp_Object copy; 124 Lisp_Object copy;
@@ -216,16 +216,16 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp
216 int depth = XINT (tbl->depth); 216 int depth = XINT (tbl->depth);
217 int min_char = XINT (tbl->min_char); 217 int min_char = XINT (tbl->min_char);
218 int max_char = min_char + chartab_chars[depth - 1] - 1; 218 int max_char = min_char + chartab_chars[depth - 1] - 1;
219 int index = CHARTAB_IDX (c, depth, min_char), idx; 219 int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx;
220 Lisp_Object val; 220 Lisp_Object val;
221 221
222 val = tbl->contents[index]; 222 val = tbl->contents[chartab_idx];
223 if (SUB_CHAR_TABLE_P (val)) 223 if (SUB_CHAR_TABLE_P (val))
224 val = sub_char_table_ref_and_range (val, c, from, to, defalt); 224 val = sub_char_table_ref_and_range (val, c, from, to, defalt);
225 else if (NILP (val)) 225 else if (NILP (val))
226 val = defalt; 226 val = defalt;
227 227
228 idx = index; 228 idx = chartab_idx;
229 while (idx > 0 && *from < min_char + idx * chartab_chars[depth]) 229 while (idx > 0 && *from < min_char + idx * chartab_chars[depth])
230 { 230 {
231 Lisp_Object this_val; 231 Lisp_Object this_val;
@@ -244,13 +244,13 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp
244 break; 244 break;
245 } 245 }
246 } 246 }
247 while ((c = min_char + (index + 1) * chartab_chars[depth]) <= max_char 247 while ((c = min_char + (chartab_idx + 1) * chartab_chars[depth]) <= max_char
248 && *to >= c) 248 && *to >= c)
249 { 249 {
250 Lisp_Object this_val; 250 Lisp_Object this_val;
251 251
252 index++; 252 chartab_idx++;
253 this_val = tbl->contents[index]; 253 this_val = tbl->contents[chartab_idx];
254 if (SUB_CHAR_TABLE_P (this_val)) 254 if (SUB_CHAR_TABLE_P (this_val))
255 this_val = sub_char_table_ref_and_range (this_val, c, from, to, defalt); 255 this_val = sub_char_table_ref_and_range (this_val, c, from, to, defalt);
256 else if (NILP (this_val)) 256 else if (NILP (this_val))
@@ -275,10 +275,10 @@ Lisp_Object
275char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to) 275char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
276{ 276{
277 struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); 277 struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
278 int index = CHARTAB_IDX (c, 0, 0), idx; 278 int chartab_idx = CHARTAB_IDX (c, 0, 0), idx;
279 Lisp_Object val; 279 Lisp_Object val;
280 280
281 val = tbl->contents[index]; 281 val = tbl->contents[chartab_idx];
282 if (*from < 0) 282 if (*from < 0)
283 *from = 0; 283 *from = 0;
284 if (*to < 0) 284 if (*to < 0)
@@ -288,7 +288,7 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
288 else if (NILP (val)) 288 else if (NILP (val))
289 val = tbl->defalt; 289 val = tbl->defalt;
290 290
291 idx = index; 291 idx = chartab_idx;
292 while (*from < idx * chartab_chars[0]) 292 while (*from < idx * chartab_chars[0])
293 { 293 {
294 Lisp_Object this_val; 294 Lisp_Object this_val;
@@ -308,13 +308,13 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
308 break; 308 break;
309 } 309 }
310 } 310 }
311 while (*to >= (index + 1) * chartab_chars[0]) 311 while (*to >= (chartab_idx + 1) * chartab_chars[0])
312 { 312 {
313 Lisp_Object this_val; 313 Lisp_Object this_val;
314 314
315 index++; 315 chartab_idx++;
316 c = index * chartab_chars[0]; 316 c = chartab_idx * chartab_chars[0];
317 this_val = tbl->contents[index]; 317 this_val = tbl->contents[chartab_idx];
318 if (SUB_CHAR_TABLE_P (this_val)) 318 if (SUB_CHAR_TABLE_P (this_val))
319 this_val = sub_char_table_ref_and_range (this_val, c, from, to, 319 this_val = sub_char_table_ref_and_range (this_val, c, from, to,
320 tbl->defalt); 320 tbl->defalt);
@@ -331,20 +331,6 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
331} 331}
332 332
333 333
334#define ASET_RANGE(ARRAY, FROM, TO, LIMIT, VAL) \
335 do { \
336 int limit = (TO) < (LIMIT) ? (TO) : (LIMIT); \
337 for (; (FROM) < limit; (FROM)++) (ARRAY)->contents[(FROM)] = (VAL); \
338 } while (0)
339
340#define GET_SUB_CHAR_TABLE(TABLE, SUBTABLE, IDX, DEPTH, MIN_CHAR) \
341 do { \
342 (SUBTABLE) = (TABLE)->contents[(IDX)]; \
343 if (!SUB_CHAR_TABLE_P (SUBTABLE)) \
344 (SUBTABLE) = make_sub_char_table ((DEPTH), (MIN_CHAR), (SUBTABLE)); \
345 } while (0)
346
347
348static void 334static void
349sub_char_table_set (Lisp_Object table, int c, Lisp_Object val) 335sub_char_table_set (Lisp_Object table, int c, Lisp_Object val)
350{ 336{
@@ -951,7 +937,7 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
951 map_charset_chars. */ 937 map_charset_chars. */
952 938
953void 939void
954map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), 940map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
955 Lisp_Object function, Lisp_Object table, Lisp_Object arg, 941 Lisp_Object function, Lisp_Object table, Lisp_Object arg,
956 struct charset *charset, 942 struct charset *charset,
957 unsigned from, unsigned to) 943 unsigned from, unsigned to)
@@ -1012,4 +998,3 @@ syms_of_chartab (void)
1012 defsubr (&Soptimize_char_table); 998 defsubr (&Soptimize_char_table);
1013 defsubr (&Smap_char_table); 999 defsubr (&Smap_char_table);
1014} 1000}
1015
diff --git a/src/cm.c b/src/cm.c
index d4aedad6db4..108ee5720f3 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -199,7 +199,7 @@ calccost (struct tty_display_info *tty,
199 tabx, 199 tabx,
200 tab2x, 200 tab2x,
201 tabcost; 201 tabcost;
202 register char *p; 202 register const char *p;
203 203
204 /* If have just wrapped on a terminal with xn, 204 /* If have just wrapped on a terminal with xn,
205 don't believe the cursor position: give up here 205 don't believe the cursor position: give up here
@@ -330,9 +330,9 @@ cmgoto (struct tty_display_info *tty, int row, int col)
330 llcost, 330 llcost,
331 relcost, 331 relcost,
332 directcost; 332 directcost;
333 int use; 333 int use IF_LINT (= 0);
334 char *p, 334 char *p;
335 *dcm; 335 const char *dcm;
336 336
337 /* First the degenerate case */ 337 /* First the degenerate case */
338 if (row == curY (tty) && col == curX (tty)) /* already there */ 338 if (row == curY (tty) && col == curX (tty)) /* already there */
@@ -460,4 +460,3 @@ Wcm_init (struct tty_display_info *tty)
460 return - 2; 460 return - 2;
461 return 0; 461 return 0;
462} 462}
463
diff --git a/src/cm.h b/src/cm.h
index 7b4bedd4e88..5d430598f0c 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -35,25 +35,25 @@ struct cm
35 int cm_curX; /* Current column */ 35 int cm_curX; /* Current column */
36 36
37 /* Capabilities from termcap */ 37 /* Capabilities from termcap */
38 char *cm_up; /* up (up) */ 38 const char *cm_up; /* up (up) */
39 char *cm_down; /* down (do) */ 39 const char *cm_down; /* down (do) */
40 char *cm_left; /* left (le) */ 40 const char *cm_left; /* left (le) */
41 char *cm_right; /* right (nd) */ 41 const char *cm_right; /* right (nd) */
42 char *cm_home; /* home (ho) */ 42 const char *cm_home; /* home (ho) */
43 char *cm_cr; /* carriage return (cr) */ 43 const char *cm_cr; /* carriage return (cr) */
44 char *cm_ll; /* last line (ll) */ 44 const char *cm_ll; /* last line (ll) */
45 char *cm_tab; /* tab (ta) */ 45 const char *cm_tab; /* tab (ta) */
46 char *cm_backtab; /* backtab (bt) */ 46 const char *cm_backtab; /* backtab (bt) */
47 char *cm_abs; /* absolute (cm) */ 47 char *cm_abs; /* absolute (cm) */
48 char *cm_habs; /* horizontal absolute (ch) */ 48 const char *cm_habs; /* horizontal absolute (ch) */
49 char *cm_vabs; /* vertical absolute (cv) */ 49 const char *cm_vabs; /* vertical absolute (cv) */
50#if 0 50#if 0
51 char *cm_ds; /* "don't send" string (ds) */ 51 const char *cm_ds; /* "don't send" string (ds) */
52#endif 52#endif
53 char *cm_multiup; /* multiple up (UP) */ 53 const char *cm_multiup; /* multiple up (UP) */
54 char *cm_multidown; /* multiple down (DO) */ 54 const char *cm_multidown; /* multiple down (DO) */
55 char *cm_multileft; /* multiple left (LE) */ 55 const char *cm_multileft; /* multiple left (LE) */
56 char *cm_multiright; /* multiple right (RI) */ 56 const char *cm_multiright; /* multiple right (RI) */
57 int cm_cols; /* number of cols on screen (co) */ 57 int cm_cols; /* number of cols on screen (co) */
58 int cm_rows; /* number of rows on screen (li) */ 58 int cm_rows; /* number of rows on screen (li) */
59 int cm_tabwidth; /* tab width (it) */ 59 int cm_tabwidth; /* tab width (it) */
@@ -168,4 +168,3 @@ extern void cmcostinit (struct tty_display_info *);
168extern void cmgoto (struct tty_display_info *, int, int); 168extern void cmgoto (struct tty_display_info *, int, int);
169extern void Wcm_clear (struct tty_display_info *); 169extern void Wcm_clear (struct tty_display_info *);
170extern int Wcm_init (struct tty_display_info *); 170extern int Wcm_init (struct tty_display_info *);
171
diff --git a/src/cmds.c b/src/cmds.c
index 5e6884c0807..fa1ac5028ae 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -485,18 +485,18 @@ internal_self_insert (int c, EMACS_INT n)
485 : (c == ' ' || c == '\n')) 485 : (c == ' ' || c == '\n'))
486 && !NILP (BVAR (current_buffer, auto_fill_function))) 486 && !NILP (BVAR (current_buffer, auto_fill_function)))
487 { 487 {
488 Lisp_Object tem; 488 Lisp_Object auto_fill_result;
489 489
490 if (c == '\n') 490 if (c == '\n')
491 /* After inserting a newline, move to previous line and fill 491 /* After inserting a newline, move to previous line and fill
492 that. Must have the newline in place already so filling and 492 that. Must have the newline in place already so filling and
493 justification, if any, know where the end is going to be. */ 493 justification, if any, know where the end is going to be. */
494 SET_PT_BOTH (PT - 1, PT_BYTE - 1); 494 SET_PT_BOTH (PT - 1, PT_BYTE - 1);
495 tem = call0 (BVAR (current_buffer, auto_fill_function)); 495 auto_fill_result = call0 (BVAR (current_buffer, auto_fill_function));
496 /* Test PT < ZV in case the auto-fill-function is strange. */ 496 /* Test PT < ZV in case the auto-fill-function is strange. */
497 if (c == '\n' && PT < ZV) 497 if (c == '\n' && PT < ZV)
498 SET_PT_BOTH (PT + 1, PT_BYTE + 1); 498 SET_PT_BOTH (PT + 1, PT_BYTE + 1);
499 if (!NILP (tem)) 499 if (!NILP (auto_fill_result))
500 hairy = 2; 500 hairy = 2;
501 } 501 }
502 502
diff --git a/src/coding.c b/src/coding.c
index f6310369ad3..0c2836c19f6 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -395,8 +395,6 @@ Lisp_Object Vbig5_coding_system;
395 395
396/* Control characters of ISO2022. */ 396/* Control characters of ISO2022. */
397 /* code */ /* function */ 397 /* code */ /* function */
398#define ISO_CODE_LF 0x0A /* line-feed */
399#define ISO_CODE_CR 0x0D /* carriage-return */
400#define ISO_CODE_SO 0x0E /* shift-out */ 398#define ISO_CODE_SO 0x0E /* shift-out */
401#define ISO_CODE_SI 0x0F /* shift-in */ 399#define ISO_CODE_SI 0x0F /* shift-in */
402#define ISO_CODE_SS2_7 0x19 /* single-shift-2 for 7-bit code */ 400#define ISO_CODE_SS2_7 0x19 /* single-shift-2 for 7-bit code */
@@ -479,7 +477,7 @@ enum iso_code_class_type
479 477
480#define CODING_ISO_FLAG_COMPOSITION 0x2000 478#define CODING_ISO_FLAG_COMPOSITION 0x2000
481 479
482#define CODING_ISO_FLAG_EUC_TW_SHIFT 0x4000 480/* #define CODING_ISO_FLAG_EUC_TW_SHIFT 0x4000 */
483 481
484#define CODING_ISO_FLAG_USE_ROMAN 0x8000 482#define CODING_ISO_FLAG_USE_ROMAN 0x8000
485 483
@@ -721,25 +719,6 @@ static struct coding_system coding_categories[coding_category_max];
721 } while (0) 719 } while (0)
722 720
723 721
724#define ONE_MORE_BYTE_NO_CHECK(c) \
725 do { \
726 c = *src++; \
727 if (multibytep && (c & 0x80)) \
728 { \
729 if ((c & 0xFE) == 0xC0) \
730 c = ((c & 1) << 6) | *src++; \
731 else \
732 { \
733 src--; \
734 c = - string_char (src, &src, NULL); \
735 record_conversion_result \
736 (coding, CODING_RESULT_INVALID_SRC); \
737 } \
738 } \
739 consumed_chars++; \
740 } while (0)
741
742
743/* Store a byte C in the place pointed by DST and increment DST to the 722/* Store a byte C in the place pointed by DST and increment DST to the
744 next free point, and increment PRODUCED_CHARS. The caller should 723 next free point, and increment PRODUCED_CHARS. The caller should
745 assure that C is 0..127, and declare and set the variable `dst' 724 assure that C is 0..127, and declare and set the variable `dst'
@@ -1051,9 +1030,10 @@ coding_set_source (struct coding_system *coding)
1051 coding->source = SDATA (coding->src_object) + coding->src_pos_byte; 1030 coding->source = SDATA (coding->src_object) + coding->src_pos_byte;
1052 } 1031 }
1053 else 1032 else
1054 /* Otherwise, the source is C string and is never relocated 1033 {
1055 automatically. Thus we don't have to update anything. */ 1034 /* Otherwise, the source is C string and is never relocated
1056 ; 1035 automatically. Thus we don't have to update anything. */
1036 }
1057} 1037}
1058 1038
1059static void 1039static void
@@ -1079,9 +1059,10 @@ coding_set_destination (struct coding_system *coding)
1079 } 1059 }
1080 } 1060 }
1081 else 1061 else
1082 /* Otherwise, the destination is C string and is never relocated 1062 {
1083 automatically. Thus we don't have to update anything. */ 1063 /* Otherwise, the destination is C string and is never relocated
1084 ; 1064 automatically. Thus we don't have to update anything. */
1065 }
1085} 1066}
1086 1067
1087 1068
@@ -1217,7 +1198,6 @@ alloc_destination (struct coding_system *coding, EMACS_INT nbytes,
1217#define UTF_8_4_OCTET_LEADING_P(c) (((c) & 0xF8) == 0xF0) 1198#define UTF_8_4_OCTET_LEADING_P(c) (((c) & 0xF8) == 0xF0)
1218#define UTF_8_5_OCTET_LEADING_P(c) (((c) & 0xFC) == 0xF8) 1199#define UTF_8_5_OCTET_LEADING_P(c) (((c) & 0xFC) == 0xF8)
1219 1200
1220#define UTF_BOM 0xFEFF
1221#define UTF_8_BOM_1 0xEF 1201#define UTF_8_BOM_1 0xEF
1222#define UTF_8_BOM_2 0xBB 1202#define UTF_8_BOM_2 0xBB
1223#define UTF_8_BOM_3 0xBF 1203#define UTF_8_BOM_3 0xBF
@@ -1318,7 +1298,7 @@ decode_coding_utf_8 (struct coding_system *coding)
1318 int multibytep = coding->src_multibyte; 1298 int multibytep = coding->src_multibyte;
1319 enum utf_bom_type bom = CODING_UTF_8_BOM (coding); 1299 enum utf_bom_type bom = CODING_UTF_8_BOM (coding);
1320 Lisp_Object attr, charset_list; 1300 Lisp_Object attr, charset_list;
1321 int eol_crlf = 1301 int eol_dos =
1322 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); 1302 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
1323 int byte_after_cr = -1; 1303 int byte_after_cr = -1;
1324 1304
@@ -1379,7 +1359,7 @@ decode_coding_utf_8 (struct coding_system *coding)
1379 } 1359 }
1380 else if (UTF_8_1_OCTET_P (c1)) 1360 else if (UTF_8_1_OCTET_P (c1))
1381 { 1361 {
1382 if (eol_crlf && c1 == '\r') 1362 if (eol_dos && c1 == '\r')
1383 ONE_MORE_BYTE (byte_after_cr); 1363 ONE_MORE_BYTE (byte_after_cr);
1384 c = c1; 1364 c = c1;
1385 } 1365 }
@@ -1533,11 +1513,6 @@ encode_coding_utf_8 (struct coding_system *coding)
1533#define UTF_16_LOW_SURROGATE_P(val) \ 1513#define UTF_16_LOW_SURROGATE_P(val) \
1534 (((val) & 0xFC00) == 0xDC00) 1514 (((val) & 0xFC00) == 0xDC00)
1535 1515
1536#define UTF_16_INVALID_P(val) \
1537 (((val) == 0xFFFE) \
1538 || ((val) == 0xFFFF) \
1539 || UTF_16_LOW_SURROGATE_P (val))
1540
1541 1516
1542static int 1517static int
1543detect_coding_utf_16 (struct coding_system *coding, 1518detect_coding_utf_16 (struct coding_system *coding,
@@ -1637,7 +1612,7 @@ decode_coding_utf_16 (struct coding_system *coding)
1637 enum utf_16_endian_type endian = CODING_UTF_16_ENDIAN (coding); 1612 enum utf_16_endian_type endian = CODING_UTF_16_ENDIAN (coding);
1638 int surrogate = CODING_UTF_16_SURROGATE (coding); 1613 int surrogate = CODING_UTF_16_SURROGATE (coding);
1639 Lisp_Object attr, charset_list; 1614 Lisp_Object attr, charset_list;
1640 int eol_crlf = 1615 int eol_dos =
1641 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); 1616 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
1642 int byte_after_cr1 = -1, byte_after_cr2 = -1; 1617 int byte_after_cr1 = -1, byte_after_cr2 = -1;
1643 1618
@@ -1734,7 +1709,7 @@ decode_coding_utf_16 (struct coding_system *coding)
1734 CODING_UTF_16_SURROGATE (coding) = surrogate = c; 1709 CODING_UTF_16_SURROGATE (coding) = surrogate = c;
1735 else 1710 else
1736 { 1711 {
1737 if (eol_crlf && c == '\r') 1712 if (eol_dos && c == '\r')
1738 { 1713 {
1739 ONE_MORE_BYTE (byte_after_cr1); 1714 ONE_MORE_BYTE (byte_after_cr1);
1740 ONE_MORE_BYTE (byte_after_cr2); 1715 ONE_MORE_BYTE (byte_after_cr2);
@@ -1918,17 +1893,17 @@ detect_coding_emacs_mule (struct coding_system *coding,
1918 it because analyzing it is too heavy for detecting. But, 1893 it because analyzing it is too heavy for detecting. But,
1919 at least, we check that the composite character 1894 at least, we check that the composite character
1920 constitutes of more than 4 bytes. */ 1895 constitutes of more than 4 bytes. */
1921 const unsigned char *src_base; 1896 const unsigned char *src_start;
1922 1897
1923 repeat: 1898 repeat:
1924 src_base = src; 1899 src_start = src;
1925 do 1900 do
1926 { 1901 {
1927 ONE_MORE_BYTE (c); 1902 ONE_MORE_BYTE (c);
1928 } 1903 }
1929 while (c >= 0xA0); 1904 while (c >= 0xA0);
1930 1905
1931 if (src - src_base <= 4) 1906 if (src - src_start <= 4)
1932 break; 1907 break;
1933 found = CATEGORY_MASK_EMACS_MULE; 1908 found = CATEGORY_MASK_EMACS_MULE;
1934 if (c == 0x80) 1909 if (c == 0x80)
@@ -1980,7 +1955,7 @@ detect_coding_emacs_mule (struct coding_system *coding,
1980 the decoded character or rule. If an invalid byte is found, return 1955 the decoded character or rule. If an invalid byte is found, return
1981 -1. If SRC is too short, return -2. */ 1956 -1. If SRC is too short, return -2. */
1982 1957
1983int 1958static int
1984emacs_mule_char (struct coding_system *coding, const unsigned char *src, 1959emacs_mule_char (struct coding_system *coding, const unsigned char *src,
1985 int *nbytes, int *nchars, int *id, 1960 int *nbytes, int *nchars, int *id,
1986 struct composition_status *cmp_status) 1961 struct composition_status *cmp_status)
@@ -1988,7 +1963,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
1988 const unsigned char *src_end = coding->source + coding->src_bytes; 1963 const unsigned char *src_end = coding->source + coding->src_bytes;
1989 const unsigned char *src_base = src; 1964 const unsigned char *src_base = src;
1990 int multibytep = coding->src_multibyte; 1965 int multibytep = coding->src_multibyte;
1991 int charset_id; 1966 int charset_ID;
1992 unsigned code; 1967 unsigned code;
1993 int c; 1968 int c;
1994 int consumed_chars = 0; 1969 int consumed_chars = 0;
@@ -1998,7 +1973,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
1998 if (c < 0) 1973 if (c < 0)
1999 { 1974 {
2000 c = -c; 1975 c = -c;
2001 charset_id = emacs_mule_charset[0]; 1976 charset_ID = emacs_mule_charset[0];
2002 } 1977 }
2003 else 1978 else
2004 { 1979 {
@@ -2034,7 +2009,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2034 switch (emacs_mule_bytes[c]) 2009 switch (emacs_mule_bytes[c])
2035 { 2010 {
2036 case 2: 2011 case 2:
2037 if ((charset_id = emacs_mule_charset[c]) < 0) 2012 if ((charset_ID = emacs_mule_charset[c]) < 0)
2038 goto invalid_code; 2013 goto invalid_code;
2039 ONE_MORE_BYTE (c); 2014 ONE_MORE_BYTE (c);
2040 if (c < 0xA0) 2015 if (c < 0xA0)
@@ -2047,7 +2022,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2047 || c == EMACS_MULE_LEADING_CODE_PRIVATE_12) 2022 || c == EMACS_MULE_LEADING_CODE_PRIVATE_12)
2048 { 2023 {
2049 ONE_MORE_BYTE (c); 2024 ONE_MORE_BYTE (c);
2050 if (c < 0xA0 || (charset_id = emacs_mule_charset[c]) < 0) 2025 if (c < 0xA0 || (charset_ID = emacs_mule_charset[c]) < 0)
2051 goto invalid_code; 2026 goto invalid_code;
2052 ONE_MORE_BYTE (c); 2027 ONE_MORE_BYTE (c);
2053 if (c < 0xA0) 2028 if (c < 0xA0)
@@ -2056,7 +2031,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2056 } 2031 }
2057 else 2032 else
2058 { 2033 {
2059 if ((charset_id = emacs_mule_charset[c]) < 0) 2034 if ((charset_ID = emacs_mule_charset[c]) < 0)
2060 goto invalid_code; 2035 goto invalid_code;
2061 ONE_MORE_BYTE (c); 2036 ONE_MORE_BYTE (c);
2062 if (c < 0xA0) 2037 if (c < 0xA0)
@@ -2071,7 +2046,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2071 2046
2072 case 4: 2047 case 4:
2073 ONE_MORE_BYTE (c); 2048 ONE_MORE_BYTE (c);
2074 if (c < 0 || (charset_id = emacs_mule_charset[c]) < 0) 2049 if (c < 0 || (charset_ID = emacs_mule_charset[c]) < 0)
2075 goto invalid_code; 2050 goto invalid_code;
2076 ONE_MORE_BYTE (c); 2051 ONE_MORE_BYTE (c);
2077 if (c < 0xA0) 2052 if (c < 0xA0)
@@ -2085,21 +2060,21 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2085 2060
2086 case 1: 2061 case 1:
2087 code = c; 2062 code = c;
2088 charset_id = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit; 2063 charset_ID = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit;
2089 break; 2064 break;
2090 2065
2091 default: 2066 default:
2092 abort (); 2067 abort ();
2093 } 2068 }
2094 CODING_DECODE_CHAR (coding, src, src_base, src_end, 2069 CODING_DECODE_CHAR (coding, src, src_base, src_end,
2095 CHARSET_FROM_ID (charset_id), code, c); 2070 CHARSET_FROM_ID (charset_ID), code, c);
2096 if (c < 0) 2071 if (c < 0)
2097 goto invalid_code; 2072 goto invalid_code;
2098 } 2073 }
2099 *nbytes = src - src_base; 2074 *nbytes = src - src_base;
2100 *nchars = consumed_chars; 2075 *nchars = consumed_chars;
2101 if (id) 2076 if (id)
2102 *id = charset_id; 2077 *id = charset_ID;
2103 return (mseq_found ? -c : c); 2078 return (mseq_found ? -c : c);
2104 2079
2105 no_more_source: 2080 no_more_source:
@@ -2372,7 +2347,7 @@ decode_coding_emacs_mule (struct coding_system *coding)
2372 int char_offset = coding->produced_char; 2347 int char_offset = coding->produced_char;
2373 int last_offset = char_offset; 2348 int last_offset = char_offset;
2374 int last_id = charset_ascii; 2349 int last_id = charset_ascii;
2375 int eol_crlf = 2350 int eol_dos =
2376 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); 2351 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
2377 int byte_after_cr = -1; 2352 int byte_after_cr = -1;
2378 struct composition_status *cmp_status = &coding->spec.emacs_mule.cmp_status; 2353 struct composition_status *cmp_status = &coding->spec.emacs_mule.cmp_status;
@@ -2390,7 +2365,7 @@ decode_coding_emacs_mule (struct coding_system *coding)
2390 2365
2391 while (1) 2366 while (1)
2392 { 2367 {
2393 int c, id; 2368 int c, id IF_LINT (= 0);
2394 2369
2395 src_base = src; 2370 src_base = src;
2396 consumed_chars_base = consumed_chars; 2371 consumed_chars_base = consumed_chars;
@@ -2422,7 +2397,7 @@ decode_coding_emacs_mule (struct coding_system *coding)
2422 2397
2423 if (c < 0x80) 2398 if (c < 0x80)
2424 { 2399 {
2425 if (eol_crlf && c == '\r') 2400 if (eol_dos && c == '\r')
2426 ONE_MORE_BYTE (byte_after_cr); 2401 ONE_MORE_BYTE (byte_after_cr);
2427 id = charset_ascii; 2402 id = charset_ascii;
2428 if (cmp_status->state != COMPOSING_NO) 2403 if (cmp_status->state != COMPOSING_NO)
@@ -2435,7 +2410,7 @@ decode_coding_emacs_mule (struct coding_system *coding)
2435 } 2410 }
2436 else 2411 else
2437 { 2412 {
2438 int nchars, nbytes; 2413 int nchars IF_LINT (= 0), nbytes IF_LINT (= 0);
2439 /* emacs_mule_char can load a charset map from a file, which 2414 /* emacs_mule_char can load a charset map from a file, which
2440 allocates a large structure and might cause buffer text 2415 allocates a large structure and might cause buffer text
2441 to be relocated as result. Thus, we need to remember the 2416 to be relocated as result. Thus, we need to remember the
@@ -2903,10 +2878,6 @@ enum iso_code_class_type iso_code_class[256];
2903 ((id) <= (coding)->max_charset_id \ 2878 ((id) <= (coding)->max_charset_id \
2904 && (coding)->safe_charsets[id] != 255) 2879 && (coding)->safe_charsets[id] != 255)
2905 2880
2906
2907#define SHIFT_OUT_OK(category) \
2908 (CODING_ISO_INITIAL (&coding_categories[category], 1) >= 0)
2909
2910static void 2881static void
2911setup_iso_safe_charsets (Lisp_Object attrs) 2882setup_iso_safe_charsets (Lisp_Object attrs)
2912{ 2883{
@@ -3023,40 +2994,11 @@ detect_coding_iso_2022 (struct coding_system *coding,
3023 break; 2994 break;
3024 single_shifting = 0; 2995 single_shifting = 0;
3025 ONE_MORE_BYTE (c); 2996 ONE_MORE_BYTE (c);
3026 if (c >= '(' && c <= '/') 2997 if (c == 'N' || c == 'O')
3027 {
3028 /* Designation sequence for a charset of dimension 1. */
3029 ONE_MORE_BYTE (c1);
3030 if (c1 < ' ' || c1 >= 0x80
3031 || (id = iso_charset_table[0][c >= ','][c1]) < 0)
3032 /* Invalid designation sequence. Just ignore. */
3033 break;
3034 }
3035 else if (c == '$')
3036 {
3037 /* Designation sequence for a charset of dimension 2. */
3038 ONE_MORE_BYTE (c);
3039 if (c >= '@' && c <= 'B')
3040 /* Designation for JISX0208.1978, GB2312, or JISX0208. */
3041 id = iso_charset_table[1][0][c];
3042 else if (c >= '(' && c <= '/')
3043 {
3044 ONE_MORE_BYTE (c1);
3045 if (c1 < ' ' || c1 >= 0x80
3046 || (id = iso_charset_table[1][c >= ','][c1]) < 0)
3047 /* Invalid designation sequence. Just ignore. */
3048 break;
3049 }
3050 else
3051 /* Invalid designation sequence. Just ignore it. */
3052 break;
3053 }
3054 else if (c == 'N' || c == 'O')
3055 { 2998 {
3056 /* ESC <Fe> for SS2 or SS3. */ 2999 /* ESC <Fe> for SS2 or SS3. */
3057 single_shifting = 1; 3000 single_shifting = 1;
3058 rejected |= CATEGORY_MASK_ISO_7BIT | CATEGORY_MASK_ISO_8BIT; 3001 rejected |= CATEGORY_MASK_ISO_7BIT | CATEGORY_MASK_ISO_8BIT;
3059 break;
3060 } 3002 }
3061 else if (c == '1') 3003 else if (c == '1')
3062 { 3004 {
@@ -3072,36 +3014,66 @@ detect_coding_iso_2022 (struct coding_system *coding,
3072 { 3014 {
3073 /* ESC <Fp> for start/end composition. */ 3015 /* ESC <Fp> for start/end composition. */
3074 composition_count = 0; 3016 composition_count = 0;
3075 break;
3076 } 3017 }
3077 else 3018 else
3078 { 3019 {
3079 /* Invalid escape sequence. Just ignore it. */ 3020 if (c >= '(' && c <= '/')
3080 break; 3021 {
3081 } 3022 /* Designation sequence for a charset of dimension 1. */
3023 ONE_MORE_BYTE (c1);
3024 if (c1 < ' ' || c1 >= 0x80
3025 || (id = iso_charset_table[0][c >= ','][c1]) < 0)
3026 /* Invalid designation sequence. Just ignore. */
3027 break;
3028 }
3029 else if (c == '$')
3030 {
3031 /* Designation sequence for a charset of dimension 2. */
3032 ONE_MORE_BYTE (c);
3033 if (c >= '@' && c <= 'B')
3034 /* Designation for JISX0208.1978, GB2312, or JISX0208. */
3035 id = iso_charset_table[1][0][c];
3036 else if (c >= '(' && c <= '/')
3037 {
3038 ONE_MORE_BYTE (c1);
3039 if (c1 < ' ' || c1 >= 0x80
3040 || (id = iso_charset_table[1][c >= ','][c1]) < 0)
3041 /* Invalid designation sequence. Just ignore. */
3042 break;
3043 }
3044 else
3045 /* Invalid designation sequence. Just ignore it. */
3046 break;
3047 }
3048 else
3049 {
3050 /* Invalid escape sequence. Just ignore it. */
3051 break;
3052 }
3082 3053
3083 /* We found a valid designation sequence for CHARSET. */ 3054 /* We found a valid designation sequence for CHARSET. */
3084 rejected |= CATEGORY_MASK_ISO_8BIT; 3055 rejected |= CATEGORY_MASK_ISO_8BIT;
3085 if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7], 3056 if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7],
3086 id)) 3057 id))
3087 found |= CATEGORY_MASK_ISO_7; 3058 found |= CATEGORY_MASK_ISO_7;
3088 else 3059 else
3089 rejected |= CATEGORY_MASK_ISO_7; 3060 rejected |= CATEGORY_MASK_ISO_7;
3090 if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_tight], 3061 if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_tight],
3091 id)) 3062 id))
3092 found |= CATEGORY_MASK_ISO_7_TIGHT; 3063 found |= CATEGORY_MASK_ISO_7_TIGHT;
3093 else 3064 else
3094 rejected |= CATEGORY_MASK_ISO_7_TIGHT; 3065 rejected |= CATEGORY_MASK_ISO_7_TIGHT;
3095 if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_else], 3066 if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_else],
3096 id)) 3067 id))
3097 found |= CATEGORY_MASK_ISO_7_ELSE; 3068 found |= CATEGORY_MASK_ISO_7_ELSE;
3098 else 3069 else
3099 rejected |= CATEGORY_MASK_ISO_7_ELSE; 3070 rejected |= CATEGORY_MASK_ISO_7_ELSE;
3100 if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_8_else], 3071 if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_8_else],
3101 id)) 3072 id))
3102 found |= CATEGORY_MASK_ISO_8_ELSE; 3073 found |= CATEGORY_MASK_ISO_8_ELSE;
3103 else 3074 else
3104 rejected |= CATEGORY_MASK_ISO_8_ELSE; 3075 rejected |= CATEGORY_MASK_ISO_8_ELSE;
3076 }
3105 break; 3077 break;
3106 3078
3107 case ISO_CODE_SO: 3079 case ISO_CODE_SO:
@@ -3129,13 +3101,32 @@ detect_coding_iso_2022 (struct coding_system *coding,
3129 rejected |= CATEGORY_MASK_ISO_7BIT; 3101 rejected |= CATEGORY_MASK_ISO_7BIT;
3130 if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1]) 3102 if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1])
3131 & CODING_ISO_FLAG_SINGLE_SHIFT) 3103 & CODING_ISO_FLAG_SINGLE_SHIFT)
3132 found |= CATEGORY_MASK_ISO_8_1, single_shifting = 1; 3104 {
3105 found |= CATEGORY_MASK_ISO_8_1;
3106 single_shifting = 1;
3107 }
3133 if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_2]) 3108 if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_2])
3134 & CODING_ISO_FLAG_SINGLE_SHIFT) 3109 & CODING_ISO_FLAG_SINGLE_SHIFT)
3135 found |= CATEGORY_MASK_ISO_8_2, single_shifting = 1; 3110 {
3111 found |= CATEGORY_MASK_ISO_8_2;
3112 single_shifting = 1;
3113 }
3136 if (single_shifting) 3114 if (single_shifting)
3137 break; 3115 break;
3138 goto check_extra_latin; 3116 check_extra_latin:
3117 if (! VECTORP (Vlatin_extra_code_table)
3118 || NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))
3119 {
3120 rejected = CATEGORY_MASK_ISO;
3121 break;
3122 }
3123 if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1])
3124 & CODING_ISO_FLAG_LATIN_EXTRA)
3125 found |= CATEGORY_MASK_ISO_8_1;
3126 else
3127 rejected |= CATEGORY_MASK_ISO_8_1;
3128 rejected |= CATEGORY_MASK_ISO_8_2;
3129 break;
3139 3130
3140 default: 3131 default:
3141 if (c < 0) 3132 if (c < 0)
@@ -3158,7 +3149,7 @@ detect_coding_iso_2022 (struct coding_system *coding,
3158 if (! single_shifting 3149 if (! single_shifting
3159 && ! (rejected & CATEGORY_MASK_ISO_8_2)) 3150 && ! (rejected & CATEGORY_MASK_ISO_8_2))
3160 { 3151 {
3161 int i = 1; 3152 int len = 1;
3162 while (src < src_end) 3153 while (src < src_end)
3163 { 3154 {
3164 src_base = src; 3155 src_base = src;
@@ -3168,38 +3159,24 @@ detect_coding_iso_2022 (struct coding_system *coding,
3168 src = src_base; 3159 src = src_base;
3169 break; 3160 break;
3170 } 3161 }
3171 i++; 3162 len++;
3172 } 3163 }
3173 3164
3174 if (i & 1 && src < src_end) 3165 if (len & 1 && src < src_end)
3175 { 3166 {
3176 rejected |= CATEGORY_MASK_ISO_8_2; 3167 rejected |= CATEGORY_MASK_ISO_8_2;
3177 if (composition_count >= 0) 3168 if (composition_count >= 0)
3178 composition_count += i; 3169 composition_count += len;
3179 } 3170 }
3180 else 3171 else
3181 { 3172 {
3182 found |= CATEGORY_MASK_ISO_8_2; 3173 found |= CATEGORY_MASK_ISO_8_2;
3183 if (composition_count >= 0) 3174 if (composition_count >= 0)
3184 composition_count += i / 2; 3175 composition_count += len / 2;
3185 } 3176 }
3186 } 3177 }
3187 break; 3178 break;
3188 } 3179 }
3189 check_extra_latin:
3190 single_shifting = 0;
3191 if (! VECTORP (Vlatin_extra_code_table)
3192 || NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))
3193 {
3194 rejected = CATEGORY_MASK_ISO;
3195 break;
3196 }
3197 if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1])
3198 & CODING_ISO_FLAG_LATIN_EXTRA)
3199 found |= CATEGORY_MASK_ISO_8_1;
3200 else
3201 rejected |= CATEGORY_MASK_ISO_8_1;
3202 rejected |= CATEGORY_MASK_ISO_8_2;
3203 } 3180 }
3204 } 3181 }
3205 detect_info->rejected |= CATEGORY_MASK_ISO; 3182 detect_info->rejected |= CATEGORY_MASK_ISO;
@@ -3309,10 +3286,10 @@ detect_coding_iso_2022 (struct coding_system *coding,
3309 } \ 3286 } \
3310 else /* new format (after ver.21) */ \ 3287 else /* new format (after ver.21) */ \
3311 { \ 3288 { \
3312 int c; \ 3289 int b; \
3313 \ 3290 \
3314 ONE_MORE_BYTE (c); \ 3291 ONE_MORE_BYTE (b); \
3315 rule = COMPOSITION_ENCODE_RULE (rule - 81, c - 32); \ 3292 rule = COMPOSITION_ENCODE_RULE (rule - 81, b - 32); \
3316 if (rule >= 0) \ 3293 if (rule >= 0) \
3317 rule += 0x100; /* to destinguish it from the old format */ \ 3294 rule += 0x100; /* to destinguish it from the old format */ \
3318 nbytes = 2; \ 3295 nbytes = 2; \
@@ -3504,7 +3481,7 @@ decode_coding_iso_2022 (struct coding_system *coding)
3504 int char_offset = coding->produced_char; 3481 int char_offset = coding->produced_char;
3505 int last_offset = char_offset; 3482 int last_offset = char_offset;
3506 int last_id = charset_ascii; 3483 int last_id = charset_ascii;
3507 int eol_crlf = 3484 int eol_dos =
3508 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); 3485 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
3509 int byte_after_cr = -1; 3486 int byte_after_cr = -1;
3510 int i; 3487 int i;
@@ -3624,7 +3601,7 @@ decode_coding_iso_2022 (struct coding_system *coding)
3624 break; 3601 break;
3625 3602
3626 case ISO_control_0: 3603 case ISO_control_0:
3627 if (eol_crlf && c1 == '\r') 3604 if (eol_dos && c1 == '\r')
3628 ONE_MORE_BYTE (byte_after_cr); 3605 ONE_MORE_BYTE (byte_after_cr);
3629 MAYBE_FINISH_COMPOSITION (); 3606 MAYBE_FINISH_COMPOSITION ();
3630 charset = CHARSET_FROM_ID (charset_ascii); 3607 charset = CHARSET_FROM_ID (charset_ascii);
@@ -3897,6 +3874,10 @@ decode_coding_iso_2022 (struct coding_system *coding)
3897 } 3874 }
3898 continue; 3875 continue;
3899 } 3876 }
3877 break;
3878
3879 default:
3880 abort ();
3900 } 3881 }
3901 3882
3902 if (cmp_status->state == COMPOSING_NO 3883 if (cmp_status->state == COMPOSING_NO
@@ -4029,7 +4010,6 @@ decode_coding_iso_2022 (struct coding_system *coding)
4029 const char *intermediate_char_94 = "()*+"; \ 4010 const char *intermediate_char_94 = "()*+"; \
4030 const char *intermediate_char_96 = ",-./"; \ 4011 const char *intermediate_char_96 = ",-./"; \
4031 int revision = -1; \ 4012 int revision = -1; \
4032 int c; \
4033 \ 4013 \
4034 if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_REVISION) \ 4014 if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_REVISION) \
4035 revision = CHARSET_ISO_REVISION (charset); \ 4015 revision = CHARSET_ISO_REVISION (charset); \
@@ -4042,11 +4022,12 @@ decode_coding_iso_2022 (struct coding_system *coding)
4042 EMIT_ONE_ASCII_BYTE (ISO_CODE_ESC); \ 4022 EMIT_ONE_ASCII_BYTE (ISO_CODE_ESC); \
4043 if (CHARSET_DIMENSION (charset) == 1) \ 4023 if (CHARSET_DIMENSION (charset) == 1) \
4044 { \ 4024 { \
4025 int b; \
4045 if (! CHARSET_ISO_CHARS_96 (charset)) \ 4026 if (! CHARSET_ISO_CHARS_96 (charset)) \
4046 c = intermediate_char_94[reg]; \ 4027 b = intermediate_char_94[reg]; \
4047 else \ 4028 else \
4048 c = intermediate_char_96[reg]; \ 4029 b = intermediate_char_96[reg]; \
4049 EMIT_ONE_ASCII_BYTE (c); \ 4030 EMIT_ONE_ASCII_BYTE (b); \
4050 } \ 4031 } \
4051 else \ 4032 else \
4052 { \ 4033 { \
@@ -4226,7 +4207,7 @@ decode_coding_iso_2022 (struct coding_system *coding)
4226 to use CHARSET. The element `spec.iso_2022' of *CODING is updated. 4207 to use CHARSET. The element `spec.iso_2022' of *CODING is updated.
4227 Return new DST. */ 4208 Return new DST. */
4228 4209
4229unsigned char * 4210static unsigned char *
4230encode_invocation_designation (struct charset *charset, 4211encode_invocation_designation (struct charset *charset,
4231 struct coding_system *coding, 4212 struct coding_system *coding,
4232 unsigned char *dst, int *p_nchars) 4213 unsigned char *dst, int *p_nchars)
@@ -4289,30 +4270,6 @@ encode_invocation_designation (struct charset *charset,
4289 return dst; 4270 return dst;
4290} 4271}
4291 4272
4292/* The following three macros produce codes for indicating direction
4293 of text. */
4294#define ENCODE_CONTROL_SEQUENCE_INTRODUCER \
4295 do { \
4296 if (CODING_ISO_FLAGS (coding) == CODING_ISO_FLAG_SEVEN_BITS) \
4297 EMIT_TWO_ASCII_BYTES (ISO_CODE_ESC, '['); \
4298 else \
4299 EMIT_ONE_BYTE (ISO_CODE_CSI); \
4300 } while (0)
4301
4302
4303#define ENCODE_DIRECTION_R2L() \
4304 do { \
4305 ENCODE_CONTROL_SEQUENCE_INTRODUCER (dst); \
4306 EMIT_TWO_ASCII_BYTES ('2', ']'); \
4307 } while (0)
4308
4309
4310#define ENCODE_DIRECTION_L2R() \
4311 do { \
4312 ENCODE_CONTROL_SEQUENCE_INTRODUCER (dst); \
4313 EMIT_TWO_ASCII_BYTES ('0', ']'); \
4314 } while (0)
4315
4316 4273
4317/* Produce codes for designation and invocation to reset the graphic 4274/* Produce codes for designation and invocation to reset the graphic
4318 planes and registers to initial state. */ 4275 planes and registers to initial state. */
@@ -4707,7 +4664,7 @@ decode_coding_sjis (struct coding_system *coding)
4707 int char_offset = coding->produced_char; 4664 int char_offset = coding->produced_char;
4708 int last_offset = char_offset; 4665 int last_offset = char_offset;
4709 int last_id = charset_ascii; 4666 int last_id = charset_ascii;
4710 int eol_crlf = 4667 int eol_dos =
4711 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); 4668 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
4712 int byte_after_cr = -1; 4669 int byte_after_cr = -1;
4713 4670
@@ -4742,7 +4699,7 @@ decode_coding_sjis (struct coding_system *coding)
4742 goto invalid_code; 4699 goto invalid_code;
4743 if (c < 0x80) 4700 if (c < 0x80)
4744 { 4701 {
4745 if (eol_crlf && c == '\r') 4702 if (eol_dos && c == '\r')
4746 ONE_MORE_BYTE (byte_after_cr); 4703 ONE_MORE_BYTE (byte_after_cr);
4747 charset = charset_roman; 4704 charset = charset_roman;
4748 } 4705 }
@@ -4824,7 +4781,7 @@ decode_coding_big5 (struct coding_system *coding)
4824 int char_offset = coding->produced_char; 4781 int char_offset = coding->produced_char;
4825 int last_offset = char_offset; 4782 int last_offset = char_offset;
4826 int last_id = charset_ascii; 4783 int last_id = charset_ascii;
4827 int eol_crlf = 4784 int eol_dos =
4828 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); 4785 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
4829 int byte_after_cr = -1; 4786 int byte_after_cr = -1;
4830 4787
@@ -4857,7 +4814,7 @@ decode_coding_big5 (struct coding_system *coding)
4857 goto invalid_code; 4814 goto invalid_code;
4858 if (c < 0x80) 4815 if (c < 0x80)
4859 { 4816 {
4860 if (eol_crlf && c == '\r') 4817 if (eol_dos && c == '\r')
4861 ONE_MORE_BYTE (byte_after_cr); 4818 ONE_MORE_BYTE (byte_after_cr);
4862 charset = charset_roman; 4819 charset = charset_roman;
4863 } 4820 }
@@ -5261,13 +5218,13 @@ encode_coding_ccl (struct coding_system *coding)
5261static void 5218static void
5262decode_coding_raw_text (struct coding_system *coding) 5219decode_coding_raw_text (struct coding_system *coding)
5263{ 5220{
5264 int eol_crlf = 5221 int eol_dos =
5265 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); 5222 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
5266 5223
5267 coding->chars_at_source = 1; 5224 coding->chars_at_source = 1;
5268 coding->consumed_char = coding->src_chars; 5225 coding->consumed_char = coding->src_chars;
5269 coding->consumed = coding->src_bytes; 5226 coding->consumed = coding->src_bytes;
5270 if (eol_crlf && coding->source[coding->src_bytes - 1] == '\r') 5227 if (eol_dos && coding->source[coding->src_bytes - 1] == '\r')
5271 { 5228 {
5272 coding->consumed_char--; 5229 coding->consumed_char--;
5273 coding->consumed--; 5230 coding->consumed--;
@@ -5480,7 +5437,7 @@ decode_coding_charset (struct coding_system *coding)
5480 int char_offset = coding->produced_char; 5437 int char_offset = coding->produced_char;
5481 int last_offset = char_offset; 5438 int last_offset = char_offset;
5482 int last_id = charset_ascii; 5439 int last_id = charset_ascii;
5483 int eol_crlf = 5440 int eol_dos =
5484 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); 5441 !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
5485 int byte_after_cr = -1; 5442 int byte_after_cr = -1;
5486 5443
@@ -5514,7 +5471,7 @@ decode_coding_charset (struct coding_system *coding)
5514 else 5471 else
5515 { 5472 {
5516 ONE_MORE_BYTE (c); 5473 ONE_MORE_BYTE (c);
5517 if (eol_crlf && c == '\r') 5474 if (eol_dos && c == '\r')
5518 ONE_MORE_BYTE (byte_after_cr); 5475 ONE_MORE_BYTE (byte_after_cr);
5519 } 5476 }
5520 if (c < 0) 5477 if (c < 0)
@@ -6607,15 +6564,15 @@ get_translation_table (Lisp_Object attrs, int encodep, int *max_lookup)
6607 } 6564 }
6608 else if (CONSP (translation_table)) 6565 else if (CONSP (translation_table))
6609 { 6566 {
6610 Lisp_Object tail, val; 6567 Lisp_Object tail;
6611 6568
6612 for (tail = translation_table; CONSP (tail); tail = XCDR (tail)) 6569 for (tail = translation_table; CONSP (tail); tail = XCDR (tail))
6613 if (CHAR_TABLE_P (XCAR (tail)) 6570 if (CHAR_TABLE_P (XCAR (tail))
6614 && CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (XCAR (tail))) > 1) 6571 && CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (XCAR (tail))) > 1)
6615 { 6572 {
6616 val = XCHAR_TABLE (XCAR (tail))->extras[1]; 6573 Lisp_Object tailval = XCHAR_TABLE (XCAR (tail))->extras[1];
6617 if (NATNUMP (val) && *max_lookup < XFASTINT (val)) 6574 if (NATNUMP (tailval) && *max_lookup < XFASTINT (tailval))
6618 *max_lookup = XFASTINT (val); 6575 *max_lookup = XFASTINT (tailval);
6619 } 6576 }
6620 } 6577 }
6621 } 6578 }
@@ -7652,12 +7609,12 @@ decode_coding_object (struct coding_system *coding,
7652 Lisp_Object dst_object) 7609 Lisp_Object dst_object)
7653{ 7610{
7654 int count = SPECPDL_INDEX (); 7611 int count = SPECPDL_INDEX ();
7655 unsigned char *destination; 7612 unsigned char *destination IF_LINT (= NULL);
7656 EMACS_INT dst_bytes; 7613 EMACS_INT dst_bytes IF_LINT (= 0);
7657 EMACS_INT chars = to - from; 7614 EMACS_INT chars = to - from;
7658 EMACS_INT bytes = to_byte - from_byte; 7615 EMACS_INT bytes = to_byte - from_byte;
7659 Lisp_Object attrs; 7616 Lisp_Object attrs;
7660 int saved_pt = -1, saved_pt_byte; 7617 int saved_pt = -1, saved_pt_byte IF_LINT (= 0);
7661 int need_marker_adjustment = 0; 7618 int need_marker_adjustment = 0;
7662 Lisp_Object old_deactivate_mark; 7619 Lisp_Object old_deactivate_mark;
7663 7620
@@ -7845,7 +7802,7 @@ encode_coding_object (struct coding_system *coding,
7845 EMACS_INT chars = to - from; 7802 EMACS_INT chars = to - from;
7846 EMACS_INT bytes = to_byte - from_byte; 7803 EMACS_INT bytes = to_byte - from_byte;
7847 Lisp_Object attrs; 7804 Lisp_Object attrs;
7848 int saved_pt = -1, saved_pt_byte; 7805 int saved_pt = -1, saved_pt_byte IF_LINT (= 0);
7849 int need_marker_adjustment = 0; 7806 int need_marker_adjustment = 0;
7850 int kill_src_buffer = 0; 7807 int kill_src_buffer = 0;
7851 Lisp_Object old_deactivate_mark; 7808 Lisp_Object old_deactivate_mark;
@@ -8178,8 +8135,8 @@ detect_coding_system (const unsigned char *src,
8178 base_category = XINT (CODING_ATTR_CATEGORY (attrs)); 8135 base_category = XINT (CODING_ATTR_CATEGORY (attrs));
8179 if (base_category == coding_category_undecided) 8136 if (base_category == coding_category_undecided)
8180 { 8137 {
8181 enum coding_category category; 8138 enum coding_category category IF_LINT (= 0);
8182 struct coding_system *this; 8139 struct coding_system *this IF_LINT (= NULL);
8183 int c, i; 8140 int c, i;
8184 8141
8185 /* Skip all ASCII bytes except for a few ISO2022 controls. */ 8142 /* Skip all ASCII bytes except for a few ISO2022 controls. */
@@ -9112,10 +9069,10 @@ Return the corresponding character. */)
9112 } 9069 }
9113 else 9070 else
9114 { 9071 {
9115 int s1 = c >> 8, s2 = c & 0xFF; 9072 int c1 = c >> 8, c2 = c & 0xFF;
9116 9073
9117 if (s1 < 0x81 || (s1 > 0x9F && s1 < 0xE0) || s1 > 0xEF 9074 if (c1 < 0x81 || (c1 > 0x9F && c1 < 0xE0) || c1 > 0xEF
9118 || s2 < 0x40 || s2 == 0x7F || s2 > 0xFC) 9075 || c2 < 0x40 || c2 == 0x7F || c2 > 0xFC)
9119 error ("Invalid code: %d", code); 9076 error ("Invalid code: %d", code);
9120 SJIS_TO_JIS (c); 9077 SJIS_TO_JIS (c);
9121 charset = charset_kanji; 9078 charset = charset_kanji;
@@ -9798,7 +9755,6 @@ usage: (define-coding-system-internal ...) */)
9798 else if (EQ (coding_type, Qiso_2022)) 9755 else if (EQ (coding_type, Qiso_2022))
9799 { 9756 {
9800 Lisp_Object initial, reg_usage, request, flags; 9757 Lisp_Object initial, reg_usage, request, flags;
9801 int i;
9802 9758
9803 if (nargs < coding_arg_iso2022_max) 9759 if (nargs < coding_arg_iso2022_max)
9804 goto short_args; 9760 goto short_args;
@@ -9830,12 +9786,12 @@ usage: (define-coding-system-internal ...) */)
9830 for (tail = request; ! NILP (tail); tail = Fcdr (tail)) 9786 for (tail = request; ! NILP (tail); tail = Fcdr (tail))
9831 { 9787 {
9832 int id; 9788 int id;
9833 Lisp_Object tmp; 9789 Lisp_Object tmp1;
9834 9790
9835 val = Fcar (tail); 9791 val = Fcar (tail);
9836 CHECK_CONS (val); 9792 CHECK_CONS (val);
9837 tmp = XCAR (val); 9793 tmp1 = XCAR (val);
9838 CHECK_CHARSET_GET_ID (tmp, id); 9794 CHECK_CHARSET_GET_ID (tmp1, id);
9839 CHECK_NATNUM_CDR (val); 9795 CHECK_NATNUM_CDR (val);
9840 if (XINT (XCDR (val)) >= 4) 9796 if (XINT (XCDR (val)) >= 4)
9841 error ("Invalid graphic register number: %d", XINT (XCDR (val))); 9797 error ("Invalid graphic register number: %d", XINT (XCDR (val)));
diff --git a/src/data.c b/src/data.c
index 6039743b1d5..e5c485f5322 100644
--- a/src/data.c
+++ b/src/data.c
@@ -807,7 +807,10 @@ variable chain of symbols. */)
807 (Lisp_Object object) 807 (Lisp_Object object)
808{ 808{
809 if (SYMBOLP (object)) 809 if (SYMBOLP (object))
810 XSETSYMBOL (object, indirect_variable (XSYMBOL (object))); 810 {
811 struct Lisp_Symbol *sym = indirect_variable (XSYMBOL (object));
812 XSETSYMBOL (object, sym);
813 }
811 return object; 814 return object;
812} 815}
813 816
@@ -817,9 +820,6 @@ variable chain of symbols. */)
817 This does not handle buffer-local variables; use 820 This does not handle buffer-local variables; use
818 swap_in_symval_forwarding for that. */ 821 swap_in_symval_forwarding for that. */
819 822
820#define do_blv_forwarding(blv) \
821 ((blv)->forwarded ? do_symval_forwarding (BLV_FWD (blv)) : BLV_VALUE (blv))
822
823Lisp_Object 823Lisp_Object
824do_symval_forwarding (register union Lisp_Fwd *valcontents) 824do_symval_forwarding (register union Lisp_Fwd *valcontents)
825{ 825{
@@ -866,14 +866,6 @@ do_symval_forwarding (register union Lisp_Fwd *valcontents)
866 BUF non-zero means set the value in buffer BUF instead of the 866 BUF non-zero means set the value in buffer BUF instead of the
867 current buffer. This only plays a role for per-buffer variables. */ 867 current buffer. This only plays a role for per-buffer variables. */
868 868
869#define store_blv_forwarding(blv, newval, buf) \
870 do { \
871 if ((blv)->forwarded) \
872 store_symval_forwarding (BLV_FWD (blv), (newval), (buf)); \
873 else \
874 SET_BLV_VALUE (blv, newval); \
875 } while (0)
876
877static void 869static void
878store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newval, struct buffer *buf) 870store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newval, struct buffer *buf)
879{ 871{
@@ -909,12 +901,12 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva
909 901
910 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) 902 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
911 { 903 {
912 Lisp_Object buf; 904 Lisp_Object lbuf;
913 struct buffer *b; 905 struct buffer *b;
914 906
915 buf = Fcdr (XCAR (tail)); 907 lbuf = Fcdr (XCAR (tail));
916 if (!BUFFERP (buf)) continue; 908 if (!BUFFERP (lbuf)) continue;
917 b = XBUFFER (buf); 909 b = XBUFFER (lbuf);
918 910
919 if (! PER_BUFFER_VALUE_P (b, idx)) 911 if (! PER_BUFFER_VALUE_P (b, idx))
920 PER_BUFFER_VALUE (b, offset) = newval; 912 PER_BUFFER_VALUE (b, offset) = newval;
@@ -1271,7 +1263,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
1271/* Return the default value of SYMBOL, but don't check for voidness. 1263/* Return the default value of SYMBOL, but don't check for voidness.
1272 Return Qunbound if it is void. */ 1264 Return Qunbound if it is void. */
1273 1265
1274Lisp_Object 1266static Lisp_Object
1275default_value (Lisp_Object symbol) 1267default_value (Lisp_Object symbol)
1276{ 1268{
1277 struct Lisp_Symbol *sym; 1269 struct Lisp_Symbol *sym;
@@ -1505,8 +1497,8 @@ The function `default-value' gets the default value and `set-default' sets it.
1505{ 1497{
1506 struct Lisp_Symbol *sym; 1498 struct Lisp_Symbol *sym;
1507 struct Lisp_Buffer_Local_Value *blv = NULL; 1499 struct Lisp_Buffer_Local_Value *blv = NULL;
1508 union Lisp_Val_Fwd valcontents; 1500 union Lisp_Val_Fwd valcontents IF_LINT (= {0});
1509 int forwarded; 1501 int forwarded IF_LINT (= 0);
1510 1502
1511 CHECK_SYMBOL (variable); 1503 CHECK_SYMBOL (variable);
1512 sym = XSYMBOL (variable); 1504 sym = XSYMBOL (variable);
@@ -1581,8 +1573,8 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
1581 (register Lisp_Object variable) 1573 (register Lisp_Object variable)
1582{ 1574{
1583 register Lisp_Object tem; 1575 register Lisp_Object tem;
1584 int forwarded; 1576 int forwarded IF_LINT (= 0);
1585 union Lisp_Val_Fwd valcontents; 1577 union Lisp_Val_Fwd valcontents IF_LINT (= {0});
1586 struct Lisp_Symbol *sym; 1578 struct Lisp_Symbol *sym;
1587 struct Lisp_Buffer_Local_Value *blv = NULL; 1579 struct Lisp_Buffer_Local_Value *blv = NULL;
1588 1580
@@ -2218,7 +2210,7 @@ bool-vector. IDX starts at 0. */)
2218 2210
2219enum comparison { equal, notequal, less, grtr, less_or_equal, grtr_or_equal }; 2211enum comparison { equal, notequal, less, grtr, less_or_equal, grtr_or_equal };
2220 2212
2221Lisp_Object 2213static Lisp_Object
2222arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison) 2214arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison)
2223{ 2215{
2224 double f1 = 0, f2 = 0; 2216 double f1 = 0, f2 = 0;
@@ -2486,7 +2478,7 @@ enum arithop
2486 2478
2487static Lisp_Object float_arith_driver (double, int, enum arithop, 2479static Lisp_Object float_arith_driver (double, int, enum arithop,
2488 int, Lisp_Object *); 2480 int, Lisp_Object *);
2489Lisp_Object 2481static Lisp_Object
2490arith_driver (enum arithop code, int nargs, register Lisp_Object *args) 2482arith_driver (enum arithop code, int nargs, register Lisp_Object *args)
2491{ 2483{
2492 register Lisp_Object val; 2484 register Lisp_Object val;
@@ -3310,7 +3302,7 @@ syms_of_data (void)
3310 XSYMBOL (intern_c_string ("most-negative-fixnum"))->constant = 1; 3302 XSYMBOL (intern_c_string ("most-negative-fixnum"))->constant = 1;
3311} 3303}
3312 3304
3313SIGTYPE 3305static SIGTYPE
3314arith_error (int signo) 3306arith_error (int signo)
3315{ 3307{
3316 sigsetmask (SIGEMPTYMASK); 3308 sigsetmask (SIGEMPTYMASK);
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 7e5104026cd..2c8de20a4d4 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -325,7 +325,7 @@ xd_signature (char *signature, unsigned int dtype, unsigned int parent_type, Lis
325 if ((subtype == DBUS_TYPE_SIGNATURE) 325 if ((subtype == DBUS_TYPE_SIGNATURE)
326 && STRINGP (CAR_SAFE (XD_NEXT_VALUE (elt))) 326 && STRINGP (CAR_SAFE (XD_NEXT_VALUE (elt)))
327 && NILP (CDR_SAFE (XD_NEXT_VALUE (elt)))) 327 && NILP (CDR_SAFE (XD_NEXT_VALUE (elt))))
328 strcpy (x, SDATA (CAR_SAFE (XD_NEXT_VALUE (elt)))); 328 strcpy (x, SSDATA (CAR_SAFE (XD_NEXT_VALUE (elt))));
329 329
330 while (!NILP (elt)) 330 while (!NILP (elt))
331 { 331 {
@@ -531,7 +531,7 @@ xd_append_arg (unsigned int dtype, Lisp_Object object, DBusMessageIter *iter)
531 but by not encoding it, we guarantee it's valid utf-8, even if 531 but by not encoding it, we guarantee it's valid utf-8, even if
532 it contains eight-bit-bytes. Of course, you can still send 532 it contains eight-bit-bytes. Of course, you can still send
533 manually-crafted junk by passing a unibyte string. */ 533 manually-crafted junk by passing a unibyte string. */
534 char *val = SDATA (object); 534 char *val = SSDATA (object);
535 XD_DEBUG_MESSAGE ("%c %s", dtype, val); 535 XD_DEBUG_MESSAGE ("%c %s", dtype, val);
536 if (!dbus_message_iter_append_basic (iter, dtype, &val)) 536 if (!dbus_message_iter_append_basic (iter, dtype, &val))
537 XD_SIGNAL2 (build_string ("Unable to append argument"), object); 537 XD_SIGNAL2 (build_string ("Unable to append argument"), object);
@@ -569,7 +569,7 @@ xd_append_arg (unsigned int dtype, Lisp_Object object, DBusMessageIter *iter)
569 && STRINGP (CAR_SAFE (XD_NEXT_VALUE (object))) 569 && STRINGP (CAR_SAFE (XD_NEXT_VALUE (object)))
570 && NILP (CDR_SAFE (XD_NEXT_VALUE (object)))) 570 && NILP (CDR_SAFE (XD_NEXT_VALUE (object))))
571 { 571 {
572 strcpy (signature, SDATA (CAR_SAFE (XD_NEXT_VALUE (object)))); 572 strcpy (signature, SSDATA (CAR_SAFE (XD_NEXT_VALUE (object))));
573 object = CDR_SAFE (XD_NEXT_VALUE (object)); 573 object = CDR_SAFE (XD_NEXT_VALUE (object));
574 } 574 }
575 575
@@ -789,7 +789,7 @@ xd_initialize (Lisp_Object bus, int raise_error)
789 dbus_error_init (&derror); 789 dbus_error_init (&derror);
790 790
791 if (STRINGP (bus)) 791 if (STRINGP (bus))
792 connection = dbus_connection_open (SDATA (bus), &derror); 792 connection = dbus_connection_open (SSDATA (bus), &derror);
793 else 793 else
794 if (EQ (bus, QCdbus_system_bus)) 794 if (EQ (bus, QCdbus_system_bus))
795 connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror); 795 connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror);
@@ -936,7 +936,7 @@ DEFUN ("dbus-init-bus", Fdbus_init_bus, Sdbus_init_bus, 1, 1, 0,
936 Vdbus_registered_buses = Fcons (bus, Vdbus_registered_buses); 936 Vdbus_registered_buses = Fcons (bus, Vdbus_registered_buses);
937 937
938 /* We do not want to abort. */ 938 /* We do not want to abort. */
939 putenv ("DBUS_FATAL_WARNINGS=0"); 939 putenv ((char *) "DBUS_FATAL_WARNINGS=0");
940 940
941 /* Return. */ 941 /* Return. */
942 return Qnil; 942 return Qnil;
@@ -1089,10 +1089,10 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TI
1089 connection = xd_initialize (bus, TRUE); 1089 connection = xd_initialize (bus, TRUE);
1090 1090
1091 /* Create the message. */ 1091 /* Create the message. */
1092 dmessage = dbus_message_new_method_call (SDATA (service), 1092 dmessage = dbus_message_new_method_call (SSDATA (service),
1093 SDATA (path), 1093 SSDATA (path),
1094 SDATA (interface), 1094 SSDATA (interface),
1095 SDATA (method)); 1095 SSDATA (method));
1096 UNGCPRO; 1096 UNGCPRO;
1097 if (dmessage == NULL) 1097 if (dmessage == NULL)
1098 XD_SIGNAL1 (build_string ("Unable to create a new message")); 1098 XD_SIGNAL1 (build_string ("Unable to create a new message"));
@@ -1272,10 +1272,10 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE
1272 connection = xd_initialize (bus, TRUE); 1272 connection = xd_initialize (bus, TRUE);
1273 1273
1274 /* Create the message. */ 1274 /* Create the message. */
1275 dmessage = dbus_message_new_method_call (SDATA (service), 1275 dmessage = dbus_message_new_method_call (SSDATA (service),
1276 SDATA (path), 1276 SSDATA (path),
1277 SDATA (interface), 1277 SSDATA (interface),
1278 SDATA (method)); 1278 SSDATA (method));
1279 if (dmessage == NULL) 1279 if (dmessage == NULL)
1280 XD_SIGNAL1 (build_string ("Unable to create a new message")); 1280 XD_SIGNAL1 (build_string ("Unable to create a new message"));
1281 1281
@@ -1386,7 +1386,7 @@ usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */)
1386 dmessage = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_RETURN); 1386 dmessage = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_RETURN);
1387 if ((dmessage == NULL) 1387 if ((dmessage == NULL)
1388 || (!dbus_message_set_reply_serial (dmessage, XUINT (serial))) 1388 || (!dbus_message_set_reply_serial (dmessage, XUINT (serial)))
1389 || (!dbus_message_set_destination (dmessage, SDATA (service)))) 1389 || (!dbus_message_set_destination (dmessage, SSDATA (service))))
1390 { 1390 {
1391 UNGCPRO; 1391 UNGCPRO;
1392 XD_SIGNAL1 (build_string ("Unable to create a return message")); 1392 XD_SIGNAL1 (build_string ("Unable to create a return message"));
@@ -1475,7 +1475,7 @@ usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */)
1475 if ((dmessage == NULL) 1475 if ((dmessage == NULL)
1476 || (!dbus_message_set_error_name (dmessage, DBUS_ERROR_FAILED)) 1476 || (!dbus_message_set_error_name (dmessage, DBUS_ERROR_FAILED))
1477 || (!dbus_message_set_reply_serial (dmessage, XUINT (serial))) 1477 || (!dbus_message_set_reply_serial (dmessage, XUINT (serial)))
1478 || (!dbus_message_set_destination (dmessage, SDATA (service)))) 1478 || (!dbus_message_set_destination (dmessage, SSDATA (service))))
1479 { 1479 {
1480 UNGCPRO; 1480 UNGCPRO;
1481 XD_SIGNAL1 (build_string ("Unable to create a error message")); 1481 XD_SIGNAL1 (build_string ("Unable to create a error message"));
@@ -1591,9 +1591,9 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
1591 connection = xd_initialize (bus, TRUE); 1591 connection = xd_initialize (bus, TRUE);
1592 1592
1593 /* Create the message. */ 1593 /* Create the message. */
1594 dmessage = dbus_message_new_signal (SDATA (path), 1594 dmessage = dbus_message_new_signal (SSDATA (path),
1595 SDATA (interface), 1595 SSDATA (interface),
1596 SDATA (signal)); 1596 SSDATA (signal));
1597 UNGCPRO; 1597 UNGCPRO;
1598 if (dmessage == NULL) 1598 if (dmessage == NULL)
1599 XD_SIGNAL1 (build_string ("Unable to create a new message")); 1599 XD_SIGNAL1 (build_string ("Unable to create a new message"));
@@ -1745,11 +1745,11 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus)
1745 /* key has the structure (UNAME SERVICE PATH HANDLER). */ 1745 /* key has the structure (UNAME SERVICE PATH HANDLER). */
1746 if (((uname == NULL) 1746 if (((uname == NULL)
1747 || (NILP (CAR_SAFE (key))) 1747 || (NILP (CAR_SAFE (key)))
1748 || (strcmp (uname, SDATA (CAR_SAFE (key))) == 0)) 1748 || (strcmp (uname, SSDATA (CAR_SAFE (key))) == 0))
1749 && ((path == NULL) 1749 && ((path == NULL)
1750 || (NILP (CAR_SAFE (CDR_SAFE (CDR_SAFE (key))))) 1750 || (NILP (CAR_SAFE (CDR_SAFE (CDR_SAFE (key)))))
1751 || (strcmp (path, 1751 || (strcmp (path,
1752 SDATA (CAR_SAFE (CDR_SAFE (CDR_SAFE (key))))) 1752 SSDATA (CAR_SAFE (CDR_SAFE (CDR_SAFE (key)))))
1753 == 0)) 1753 == 0))
1754 && (!NILP (CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (key))))))) 1754 && (!NILP (CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (key)))))))
1755 { 1755 {
@@ -1888,7 +1888,6 @@ usage: (dbus-register-service BUS SERVICE &rest FLAGS) */)
1888 (int nargs, register Lisp_Object *args) 1888 (int nargs, register Lisp_Object *args)
1889{ 1889{
1890 Lisp_Object bus, service; 1890 Lisp_Object bus, service;
1891 struct gcpro gcpro1, gcpro2;
1892 DBusConnection *connection; 1891 DBusConnection *connection;
1893 unsigned int i; 1892 unsigned int i;
1894 unsigned int value; 1893 unsigned int value;
@@ -1921,7 +1920,7 @@ usage: (dbus-register-service BUS SERVICE &rest FLAGS) */)
1921 1920
1922 /* Request the known name from the bus. */ 1921 /* Request the known name from the bus. */
1923 dbus_error_init (&derror); 1922 dbus_error_init (&derror);
1924 result = dbus_bus_request_name (connection, SDATA (service), flags, 1923 result = dbus_bus_request_name (connection, SSDATA (service), flags,
1925 &derror); 1924 &derror);
1926 if (dbus_error_is_set (&derror)) 1925 if (dbus_error_is_set (&derror))
1927 XD_ERROR (derror); 1926 XD_ERROR (derror);
@@ -2019,8 +2018,8 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG
2019 name of "org.freedesktop.DBus" is that string itself. */ 2018 name of "org.freedesktop.DBus" is that string itself. */
2020 if ((STRINGP (service)) 2019 if ((STRINGP (service))
2021 && (SBYTES (service) > 0) 2020 && (SBYTES (service) > 0)
2022 && (strcmp (SDATA (service), DBUS_SERVICE_DBUS) != 0) 2021 && (strcmp (SSDATA (service), DBUS_SERVICE_DBUS) != 0)
2023 && (strncmp (SDATA (service), ":", 1) != 0)) 2022 && (strncmp (SSDATA (service), ":", 1) != 0))
2024 { 2023 {
2025 uname = call2 (intern ("dbus-get-name-owner"), bus, service); 2024 uname = call2 (intern ("dbus-get-name-owner"), bus, service);
2026 /* When there is no unique name, we mark it with an empty 2025 /* When there is no unique name, we mark it with an empty
@@ -2122,7 +2121,6 @@ discovering the still incomplete interface.*/)
2122 Lisp_Object dont_register_service) 2121 Lisp_Object dont_register_service)
2123{ 2122{
2124 Lisp_Object key, key1, value; 2123 Lisp_Object key, key1, value;
2125 DBusError derror;
2126 Lisp_Object args[2] = { bus, service }; 2124 Lisp_Object args[2] = { bus, service };
2127 2125
2128 /* Check parameters. */ 2126 /* Check parameters. */
@@ -2350,4 +2348,3 @@ be called when the D-Bus reply message arrives. */);
2350} 2348}
2351 2349
2352#endif /* HAVE_DBUS */ 2350#endif /* HAVE_DBUS */
2353
diff --git a/src/deps.mk b/src/deps.mk
index 77994bcaadb..35754dfa7de 100644
--- a/src/deps.mk
+++ b/src/deps.mk
@@ -87,12 +87,13 @@ dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
87 msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \ 87 msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \
88 lisp.h $(config_h) 88 lisp.h $(config_h)
89editfns.o: editfns.c window.h buffer.h systime.h $(INTERVALS_H) character.h \ 89editfns.o: editfns.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
90 coding.h frame.h blockinput.h atimer.h ../lib/unistd.h ../lib/strftime.h \ 90 coding.h frame.h blockinput.h atimer.h \
91 ../lib/intprops.h ../lib/strftime.h ../lib/unistd.h \
91 lisp.h globals.h $(config_h) 92 lisp.h globals.h $(config_h)
92emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \ 93emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
93 termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \ 94 termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \
94 globals.h ../lib/unistd.h window.h dispextern.h keyboard.h keymap.h \ 95 globals.h ../lib/unistd.h window.h dispextern.h keyboard.h keymap.h \
95 frame.h coding.h gnutls.h msdos.h 96 frame.h coding.h gnutls.h msdos.h unexec.h
96fileio.o: fileio.c window.h buffer.h systime.h $(INTERVALS_H) character.h \ 97fileio.o: fileio.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
97 coding.h msdos.h blockinput.h atimer.h lisp.h $(config_h) frame.h \ 98 coding.h msdos.h blockinput.h atimer.h lisp.h $(config_h) frame.h \
98 commands.h globals.h ../lib/unistd.h 99 commands.h globals.h ../lib/unistd.h
@@ -190,24 +191,23 @@ sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \
190term.o: term.c termchar.h termhooks.h termopts.h lisp.h globals.h $(config_h) \ 191term.o: term.c termchar.h termhooks.h termopts.h lisp.h globals.h $(config_h) \
191 cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \ 192 cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \
192 xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \ 193 xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \
193 systty.h syssignal.h $(INTERVALS_H) buffer.h ../lib/unistd.h 194 systty.h syssignal.h tparam.h $(INTERVALS_H) buffer.h ../lib/unistd.h
194termcap.o: termcap.c lisp.h $(config_h) 195termcap.o: termcap.c lisp.h tparam.h msdos.h $(config_h)
195terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \ 196terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
196 keyboard.h lisp.h globals.h $(config_h) dispextern.h composite.h systime.h \ 197 keyboard.h lisp.h globals.h $(config_h) dispextern.h composite.h systime.h \
197 msdos.h 198 msdos.h
198terminfo.o: terminfo.c lisp.h globals.h $(config_h) 199terminfo.o: terminfo.c lisp.h globals.h $(config_h)
199tparam.o: tparam.c lisp.h $(config_h) 200tparam.o: tparam.c tparam.h lisp.h $(config_h)
200undo.o: undo.c buffer.h commands.h window.h dispextern.h msdos.h \ 201undo.o: undo.c buffer.h commands.h window.h dispextern.h msdos.h \
201 lisp.h globals.h $(config_h) 202 lisp.h globals.h $(config_h)
202unexaix.o: unexaix.c lisp.h $(config_h) 203unexaix.o: unexaix.c lisp.h unexec.h $(config_h)
203unexalpha.o: unexalpha.c $(config_h) 204unexcw.o: unexcw.c lisp.h unexec.h $(config_h)
204unexcw.o: unexcw.c lisp.h $(config_h) 205unexcoff.o: unexcoff.c lisp.h unexec.h $(config_h)
205unexcoff.o: unexcoff.c lisp.h $(config_h) 206unexelf.o: unexelf.c unexec.h ../lib/unistd.h $(config_h)
206unexelf.o: unexelf.c ../lib/unistd.h $(config_h) 207unexhp9k800.o: unexhp9k800.c unexec.h $(config_h)
207unexhp9k800.o: unexhp9k800.c $(config_h) 208unexmacosx.o: unexmacosx.c unexec.h $(config_h)
208unexmacosx.o: unexmacosx.c $(config_h) 209unexsol.o: unexsol.c lisp.h unexec.h $(config_h)
209unexsol.o: unexsol.c lisp.h $(config_h) 210unexw32.o: unexw32.c unexec.h $(config_h)
210unexw32.o: unexw32.c $(config_h)
211w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \ 211w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \
212 msdos.h buffer.h charset.h coding.h composite.h lisp.h $(config_h) 212 msdos.h buffer.h charset.h coding.h composite.h lisp.h $(config_h)
213widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \ 213widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \
diff --git a/src/dired.c b/src/dired.c
index 96063680d4d..176f14925b4 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -79,11 +79,6 @@ extern struct direct *readdir (DIR *);
79#include "regex.h" 79#include "regex.h"
80#include "blockinput.h" 80#include "blockinput.h"
81 81
82/* Returns a search buffer, with a fastmap allocated and ready to go. */
83extern struct re_pattern_buffer *compile_pattern (Lisp_Object,
84 struct re_registers *,
85 Lisp_Object, int, int);
86
87Lisp_Object Qdirectory_files; 82Lisp_Object Qdirectory_files;
88Lisp_Object Qdirectory_files_and_attributes; 83Lisp_Object Qdirectory_files_and_attributes;
89Lisp_Object Qfile_name_completion; 84Lisp_Object Qfile_name_completion;
@@ -102,7 +97,7 @@ directory_files_internal_w32_unwind (Lisp_Object arg)
102} 97}
103#endif 98#endif
104 99
105Lisp_Object 100static Lisp_Object
106directory_files_internal_unwind (Lisp_Object dh) 101directory_files_internal_unwind (Lisp_Object dh)
107{ 102{
108 DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer; 103 DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer;
@@ -233,11 +228,11 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
233 int len; 228 int len;
234 int wanted = 0; 229 int wanted = 0;
235 Lisp_Object name, finalname; 230 Lisp_Object name, finalname;
236 struct gcpro gcpro1, gcpro2; 231 struct gcpro inner_gcpro1, inner_gcpro2;
237 232
238 len = NAMLEN (dp); 233 len = NAMLEN (dp);
239 name = finalname = make_unibyte_string (dp->d_name, len); 234 name = finalname = make_unibyte_string (dp->d_name, len);
240 GCPRO2 (finalname, name); 235 GCPRO2_VAR (finalname, name, inner_gcpro);
241 236
242 /* Note: DECODE_FILE can GC; it should protect its argument, 237 /* Note: DECODE_FILE can GC; it should protect its argument,
243 though. */ 238 though. */
@@ -293,23 +288,23 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
293 /* Construct an expanded filename for the directory entry. 288 /* Construct an expanded filename for the directory entry.
294 Use the decoded names for input to Ffile_attributes. */ 289 Use the decoded names for input to Ffile_attributes. */
295 Lisp_Object decoded_fullname, fileattrs; 290 Lisp_Object decoded_fullname, fileattrs;
296 struct gcpro gcpro1, gcpro2; 291 struct gcpro innermost_gcpro1, innermost_gcpro2;
297 292
298 decoded_fullname = fileattrs = Qnil; 293 decoded_fullname = fileattrs = Qnil;
299 GCPRO2 (decoded_fullname, fileattrs); 294 GCPRO2_VAR (decoded_fullname, fileattrs, innermost_gcpro);
300 295
301 /* Both Fexpand_file_name and Ffile_attributes can GC. */ 296 /* Both Fexpand_file_name and Ffile_attributes can GC. */
302 decoded_fullname = Fexpand_file_name (name, directory); 297 decoded_fullname = Fexpand_file_name (name, directory);
303 fileattrs = Ffile_attributes (decoded_fullname, id_format); 298 fileattrs = Ffile_attributes (decoded_fullname, id_format);
304 299
305 list = Fcons (Fcons (finalname, fileattrs), list); 300 list = Fcons (Fcons (finalname, fileattrs), list);
306 UNGCPRO; 301 UNGCPRO_VAR (innermost_gcpro);
307 } 302 }
308 else 303 else
309 list = Fcons (finalname, list); 304 list = Fcons (finalname, list);
310 } 305 }
311 306
312 UNGCPRO; 307 UNGCPRO_VAR (inner_gcpro);
313 } 308 }
314 } 309 }
315 310
@@ -676,11 +671,11 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
676 if (!NILP (predicate)) 671 if (!NILP (predicate))
677 { 672 {
678 Lisp_Object val; 673 Lisp_Object val;
679 struct gcpro gcpro1; 674 struct gcpro inner_gcpro1;
680 675
681 GCPRO1 (name); 676 GCPRO1_VAR (name, inner_gcpro);
682 val = call1 (predicate, name); 677 val = call1 (predicate, name);
683 UNGCPRO; 678 UNGCPRO_VAR (inner_gcpro);
684 679
685 if (NILP (val)) 680 if (NILP (val))
686 continue; 681 continue;
@@ -702,16 +697,16 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
702 Lisp_Object zero = make_number (0); 697 Lisp_Object zero = make_number (0);
703 /* FIXME: This is a copy of the code in Ftry_completion. */ 698 /* FIXME: This is a copy of the code in Ftry_completion. */
704 int compare = min (bestmatchsize, SCHARS (name)); 699 int compare = min (bestmatchsize, SCHARS (name));
705 Lisp_Object tem 700 Lisp_Object cmp
706 = Fcompare_strings (bestmatch, zero, 701 = Fcompare_strings (bestmatch, zero,
707 make_number (compare), 702 make_number (compare),
708 name, zero, 703 name, zero,
709 make_number (compare), 704 make_number (compare),
710 completion_ignore_case ? Qt : Qnil); 705 completion_ignore_case ? Qt : Qnil);
711 int matchsize 706 int matchsize
712 = (EQ (tem, Qt) ? compare 707 = (EQ (cmp, Qt) ? compare
713 : XINT (tem) < 0 ? - XINT (tem) - 1 708 : XINT (cmp) < 0 ? - XINT (cmp) - 1
714 : XINT (tem) - 1); 709 : XINT (cmp) - 1);
715 710
716 if (completion_ignore_case) 711 if (completion_ignore_case)
717 { 712 {
@@ -735,18 +730,18 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
735 (((matchsize == SCHARS (name)) 730 (((matchsize == SCHARS (name))
736 == 731 ==
737 (matchsize + !!directoryp == SCHARS (bestmatch))) 732 (matchsize + !!directoryp == SCHARS (bestmatch)))
738 && (tem = Fcompare_strings (name, zero, 733 && (cmp = Fcompare_strings (name, zero,
739 make_number (SCHARS (file)), 734 make_number (SCHARS (file)),
740 file, zero, 735 file, zero,
741 Qnil, 736 Qnil,
742 Qnil), 737 Qnil),
743 EQ (Qt, tem)) 738 EQ (Qt, cmp))
744 && (tem = Fcompare_strings (bestmatch, zero, 739 && (cmp = Fcompare_strings (bestmatch, zero,
745 make_number (SCHARS (file)), 740 make_number (SCHARS (file)),
746 file, zero, 741 file, zero,
747 Qnil, 742 Qnil,
748 Qnil), 743 Qnil),
749 ! EQ (Qt, tem)))) 744 ! EQ (Qt, cmp))))
750 bestmatch = name; 745 bestmatch = name;
751 } 746 }
752 bestmatchsize = matchsize; 747 bestmatchsize = matchsize;
@@ -795,8 +790,8 @@ scmp (const char *s1, const char *s2, int len)
795 if (completion_ignore_case) 790 if (completion_ignore_case)
796 { 791 {
797 while (l 792 while (l
798 && (DOWNCASE ((unsigned char) *s1++) 793 && (downcase ((unsigned char) *s1++)
799 == DOWNCASE ((unsigned char) *s2++))) 794 == downcase ((unsigned char) *s2++)))
800 l--; 795 l--;
801 } 796 }
802 else 797 else
@@ -848,13 +843,6 @@ file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_ad
848 return value; 843 return value;
849} 844}
850 845
851Lisp_Object
852make_time (time_t time)
853{
854 return Fcons (make_number (time >> 16),
855 Fcons (make_number (time & 0177777), Qnil));
856}
857
858static char * 846static char *
859stat_uname (struct stat *st) 847stat_uname (struct stat *st)
860{ 848{
diff --git a/src/dispextern.h b/src/dispextern.h
index 37ae7ee5fd5..9843dfd1fcd 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2944,6 +2944,7 @@ enum tool_bar_item_image
2944 2944
2945extern void bidi_init_it (EMACS_INT, EMACS_INT, struct bidi_it *); 2945extern void bidi_init_it (EMACS_INT, EMACS_INT, struct bidi_it *);
2946extern void bidi_move_to_visually_next (struct bidi_it *); 2946extern void bidi_move_to_visually_next (struct bidi_it *);
2947extern void bidi_dump_cached_states (void);
2947extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int); 2948extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int);
2948extern int bidi_mirror_char (int); 2949extern int bidi_mirror_char (int);
2949 2950
@@ -3325,9 +3326,10 @@ extern struct terminal *init_tty (const char *, const char *, int);
3325 3326
3326extern int scrolling_max_lines_saved (int, int, int *, int *, int *); 3327extern int scrolling_max_lines_saved (int, int, int *, int *, int *);
3327extern int scroll_cost (struct frame *, int, int, int); 3328extern int scroll_cost (struct frame *, int, int, int);
3328extern void do_line_insertion_deletion_costs (struct frame *, char *, 3329extern void do_line_insertion_deletion_costs (struct frame *, const char *,
3329 char *, char *, char *, 3330 const char *, const char *,
3330 char *, char *, int); 3331 const char *, const char *,
3332 const char *, int);
3331void scrolling_1 (struct frame *, int, int, int, int *, int *, int *, 3333void scrolling_1 (struct frame *, int, int, int, int *, int *, int *,
3332 int *, int); 3334 int *, int);
3333 3335
diff --git a/src/doc.c b/src/doc.c
index b56464e7219..158b09790f7 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -323,17 +323,20 @@ string is passed through `substitute-command-keys'. */)
323{ 323{
324 Lisp_Object fun; 324 Lisp_Object fun;
325 Lisp_Object funcar; 325 Lisp_Object funcar;
326 Lisp_Object tem, doc; 326 Lisp_Object doc;
327 int try_reload = 1; 327 int try_reload = 1;
328 328
329 documentation: 329 documentation:
330 330
331 doc = Qnil; 331 doc = Qnil;
332 332
333 if (SYMBOLP (function) 333 if (SYMBOLP (function))
334 && (tem = Fget (function, Qfunction_documentation), 334 {
335 !NILP (tem))) 335 Lisp_Object tem = Fget (function, Qfunction_documentation);
336 return Fdocumentation_property (function, Qfunction_documentation, raw); 336 if (!NILP (tem))
337 return Fdocumentation_property (function, Qfunction_documentation,
338 raw);
339 }
337 340
338 fun = Findirect_function (function, Qnil); 341 fun = Findirect_function (function, Qnil);
339 if (SUBRP (fun)) 342 if (SUBRP (fun))
@@ -349,13 +352,16 @@ string is passed through `substitute-command-keys'. */)
349 { 352 {
350 if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING) 353 if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING)
351 return Qnil; 354 return Qnil;
352 tem = AREF (fun, COMPILED_DOC_STRING);
353 if (STRINGP (tem))
354 doc = tem;
355 else if (NATNUMP (tem) || CONSP (tem))
356 doc = tem;
357 else 355 else
358 return Qnil; 356 {
357 Lisp_Object tem = AREF (fun, COMPILED_DOC_STRING);
358 if (STRINGP (tem))
359 doc = tem;
360 else if (NATNUMP (tem) || CONSP (tem))
361 doc = tem;
362 else
363 return Qnil;
364 }
359 } 365 }
360 else if (STRINGP (fun) || VECTORP (fun)) 366 else if (STRINGP (fun) || VECTORP (fun))
361 { 367 {
@@ -372,9 +378,8 @@ string is passed through `substitute-command-keys'. */)
372 || (EQ (funcar, Qclosure) && (fun = XCDR (fun), 1)) 378 || (EQ (funcar, Qclosure) && (fun = XCDR (fun), 1))
373 || EQ (funcar, Qautoload)) 379 || EQ (funcar, Qautoload))
374 { 380 {
375 Lisp_Object tem1; 381 Lisp_Object tem1 = Fcdr (Fcdr (fun));
376 tem1 = Fcdr (Fcdr (fun)); 382 Lisp_Object tem = Fcar (tem1);
377 tem = Fcar (tem1);
378 if (STRINGP (tem)) 383 if (STRINGP (tem))
379 doc = tem; 384 doc = tem;
380 /* Handle a doc reference--but these never come last 385 /* Handle a doc reference--but these never come last
@@ -542,7 +547,7 @@ the same file name is found in the `doc-directory'. */)
542 char buf[1024 + 1]; 547 char buf[1024 + 1];
543 register EMACS_INT filled; 548 register EMACS_INT filled;
544 register EMACS_INT pos; 549 register EMACS_INT pos;
545 register char *p, *end; 550 register char *p;
546 Lisp_Object sym; 551 Lisp_Object sym;
547 char *name; 552 char *name;
548 int skip_file = 0; 553 int skip_file = 0;
@@ -601,6 +606,7 @@ the same file name is found in the `doc-directory'. */)
601 pos = 0; 606 pos = 0;
602 while (1) 607 while (1)
603 { 608 {
609 register char *end;
604 if (filled < 512) 610 if (filled < 512)
605 filled += emacs_read (fd, &buf[filled], sizeof buf - 1 - filled); 611 filled += emacs_read (fd, &buf[filled], sizeof buf - 1 - filled);
606 if (!filled) 612 if (!filled)
diff --git a/src/editfns.c b/src/editfns.c
index 28690e7c76d..1f98ff040b3 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -45,6 +45,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
45#endif 45#endif
46 46
47#include <ctype.h> 47#include <ctype.h>
48#include <limits.h>
49#include <intprops.h>
48#include <strftime.h> 50#include <strftime.h>
49 51
50#include "intervals.h" 52#include "intervals.h"
@@ -87,6 +89,7 @@ extern char **environ;
87extern Lisp_Object w32_get_internal_run_time (void); 89extern Lisp_Object w32_get_internal_run_time (void);
88#endif 90#endif
89 91
92static void time_overflow (void) NO_RETURN;
90static int tm_diff (struct tm *, struct tm *); 93static int tm_diff (struct tm *, struct tm *);
91static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, 94static void find_field (Lisp_Object, Lisp_Object, Lisp_Object,
92 EMACS_INT *, Lisp_Object, EMACS_INT *); 95 EMACS_INT *, Lisp_Object, EMACS_INT *);
@@ -119,7 +122,7 @@ Lisp_Object Qboundary;
119void 122void
120init_editfns (void) 123init_editfns (void)
121{ 124{
122 char *user_name; 125 const char *user_name;
123 register char *p; 126 register char *p;
124 struct passwd *pw; /* password entry for the current user */ 127 struct passwd *pw; /* password entry for the current user */
125 Lisp_Object tem; 128 Lisp_Object tem;
@@ -133,7 +136,7 @@ init_editfns (void)
133 return; 136 return;
134#endif /* not CANNOT_DUMP */ 137#endif /* not CANNOT_DUMP */
135 138
136 pw = (struct passwd *) getpwuid (getuid ()); 139 pw = getpwuid (getuid ());
137#ifdef MSDOS 140#ifdef MSDOS
138 /* We let the real user name default to "root" because that's quite 141 /* We let the real user name default to "root" because that's quite
139 accurate on MSDOG and because it lets Emacs find the init file. 142 accurate on MSDOG and because it lets Emacs find the init file.
@@ -145,17 +148,17 @@ init_editfns (void)
145 148
146 /* Get the effective user name, by consulting environment variables, 149 /* Get the effective user name, by consulting environment variables,
147 or the effective uid if those are unset. */ 150 or the effective uid if those are unset. */
148 user_name = (char *) getenv ("LOGNAME"); 151 user_name = getenv ("LOGNAME");
149 if (!user_name) 152 if (!user_name)
150#ifdef WINDOWSNT 153#ifdef WINDOWSNT
151 user_name = (char *) getenv ("USERNAME"); /* it's USERNAME on NT */ 154 user_name = getenv ("USERNAME"); /* it's USERNAME on NT */
152#else /* WINDOWSNT */ 155#else /* WINDOWSNT */
153 user_name = (char *) getenv ("USER"); 156 user_name = getenv ("USER");
154#endif /* WINDOWSNT */ 157#endif /* WINDOWSNT */
155 if (!user_name) 158 if (!user_name)
156 { 159 {
157 pw = (struct passwd *) getpwuid (geteuid ()); 160 pw = getpwuid (geteuid ());
158 user_name = (char *) (pw ? pw->pw_name : "unknown"); 161 user_name = pw ? pw->pw_name : "unknown";
159 } 162 }
160 Vuser_login_name = build_string (user_name); 163 Vuser_login_name = build_string (user_name);
161 164
@@ -1263,9 +1266,9 @@ of the user with that uid, or nil if there is no such user. */)
1263 if (NILP (uid)) 1266 if (NILP (uid))
1264 return Vuser_login_name; 1267 return Vuser_login_name;
1265 1268
1266 id = (uid_t)XFLOATINT (uid); 1269 id = XFLOATINT (uid);
1267 BLOCK_INPUT; 1270 BLOCK_INPUT;
1268 pw = (struct passwd *) getpwuid (id); 1271 pw = getpwuid (id);
1269 UNBLOCK_INPUT; 1272 UNBLOCK_INPUT;
1270 return (pw ? build_string (pw->pw_name) : Qnil); 1273 return (pw ? build_string (pw->pw_name) : Qnil);
1271} 1274}
@@ -1297,7 +1300,7 @@ Value is an integer or a float, depending on the value. */)
1297 /* Make sure we don't produce a negative UID due to signed integer 1300 /* Make sure we don't produce a negative UID due to signed integer
1298 overflow. */ 1301 overflow. */
1299 if (euid < 0) 1302 if (euid < 0)
1300 return make_float ((double)geteuid ()); 1303 return make_float (geteuid ());
1301 return make_fixnum_or_float (euid); 1304 return make_fixnum_or_float (euid);
1302} 1305}
1303 1306
@@ -1313,7 +1316,7 @@ Value is an integer or a float, depending on the value. */)
1313 /* Make sure we don't produce a negative UID due to signed integer 1316 /* Make sure we don't produce a negative UID due to signed integer
1314 overflow. */ 1317 overflow. */
1315 if (uid < 0) 1318 if (uid < 0)
1316 return make_float ((double)getuid ()); 1319 return make_float (getuid ());
1317 return make_fixnum_or_float (uid); 1320 return make_fixnum_or_float (uid);
1318} 1321}
1319 1322
@@ -1336,14 +1339,15 @@ name, or nil if there is no such user. */)
1336 return Vuser_full_name; 1339 return Vuser_full_name;
1337 else if (NUMBERP (uid)) 1340 else if (NUMBERP (uid))
1338 { 1341 {
1342 uid_t u = XFLOATINT (uid);
1339 BLOCK_INPUT; 1343 BLOCK_INPUT;
1340 pw = (struct passwd *) getpwuid ((uid_t) XFLOATINT (uid)); 1344 pw = getpwuid (u);
1341 UNBLOCK_INPUT; 1345 UNBLOCK_INPUT;
1342 } 1346 }
1343 else if (STRINGP (uid)) 1347 else if (STRINGP (uid))
1344 { 1348 {
1345 BLOCK_INPUT; 1349 BLOCK_INPUT;
1346 pw = (struct passwd *) getpwnam (SSDATA (uid)); 1350 pw = getpwnam (SSDATA (uid));
1347 UNBLOCK_INPUT; 1351 UNBLOCK_INPUT;
1348 } 1352 }
1349 else 1353 else
@@ -1371,7 +1375,7 @@ name, or nil if there is no such user. */)
1371 memcpy (r, p, q - p); 1375 memcpy (r, p, q - p);
1372 r[q - p] = 0; 1376 r[q - p] = 0;
1373 strcat (r, SSDATA (login)); 1377 strcat (r, SSDATA (login));
1374 r[q - p] = UPCASE ((unsigned char) r[q - p]); 1378 r[q - p] = upcase ((unsigned char) r[q - p]);
1375 strcat (r, q + 1); 1379 strcat (r, q + 1);
1376 full = build_string (r); 1380 full = build_string (r);
1377 } 1381 }
@@ -1387,8 +1391,6 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
1387 return Vsystem_name; 1391 return Vsystem_name;
1388} 1392}
1389 1393
1390/* For the benefit of callers who don't want to include lisp.h */
1391
1392const char * 1394const char *
1393get_system_name (void) 1395get_system_name (void)
1394{ 1396{
@@ -1414,6 +1416,49 @@ DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0,
1414 return make_number (getpid ()); 1416 return make_number (getpid ());
1415} 1417}
1416 1418
1419
1420
1421#ifndef TIME_T_MIN
1422# define TIME_T_MIN TYPE_MINIMUM (time_t)
1423#endif
1424#ifndef TIME_T_MAX
1425# define TIME_T_MAX TYPE_MAXIMUM (time_t)
1426#endif
1427
1428/* Report that a time value is out of range for Emacs. */
1429static void
1430time_overflow (void)
1431{
1432 error ("Specified time is not representable");
1433}
1434
1435/* Return the upper part of the time T (everything but the bottom 16 bits),
1436 making sure that it is representable. */
1437static EMACS_INT
1438hi_time (time_t t)
1439{
1440 time_t hi = t >> 16;
1441
1442 /* Check for overflow, helping the compiler for common cases where
1443 no runtime check is needed, and taking care not to convert
1444 negative numbers to unsigned before comparing them. */
1445 if (! ((! TYPE_SIGNED (time_t)
1446 || MOST_NEGATIVE_FIXNUM <= TIME_T_MIN >> 16
1447 || MOST_NEGATIVE_FIXNUM <= hi)
1448 && (TIME_T_MAX >> 16 <= MOST_POSITIVE_FIXNUM
1449 || hi <= MOST_POSITIVE_FIXNUM)))
1450 time_overflow ();
1451
1452 return hi;
1453}
1454
1455/* Return the bottom 16 bits of the time T. */
1456static EMACS_INT
1457lo_time (time_t t)
1458{
1459 return t & ((1 << 16) - 1);
1460}
1461
1417DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0, 1462DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0,
1418 doc: /* Return the current time, as the number of seconds since 1970-01-01 00:00:00. 1463 doc: /* Return the current time, as the number of seconds since 1970-01-01 00:00:00.
1419The time is returned as a list of three integers. The first has the 1464The time is returned as a list of three integers. The first has the
@@ -1428,8 +1473,8 @@ resolution finer than a second. */)
1428 EMACS_TIME t; 1473 EMACS_TIME t;
1429 1474
1430 EMACS_GET_TIME (t); 1475 EMACS_GET_TIME (t);
1431 return list3 (make_number ((EMACS_SECS (t) >> 16) & 0xffff), 1476 return list3 (make_number (hi_time (EMACS_SECS (t))),
1432 make_number ((EMACS_SECS (t) >> 0) & 0xffff), 1477 make_number (lo_time (EMACS_SECS (t))),
1433 make_number (EMACS_USECS (t))); 1478 make_number (EMACS_USECS (t)));
1434} 1479}
1435 1480
@@ -1448,7 +1493,8 @@ on systems that do not provide resolution finer than a second. */)
1448{ 1493{
1449#ifdef HAVE_GETRUSAGE 1494#ifdef HAVE_GETRUSAGE
1450 struct rusage usage; 1495 struct rusage usage;
1451 int secs, usecs; 1496 time_t secs;
1497 int usecs;
1452 1498
1453 if (getrusage (RUSAGE_SELF, &usage) < 0) 1499 if (getrusage (RUSAGE_SELF, &usage) < 0)
1454 /* This shouldn't happen. What action is appropriate? */ 1500 /* This shouldn't happen. What action is appropriate? */
@@ -1463,8 +1509,8 @@ on systems that do not provide resolution finer than a second. */)
1463 secs++; 1509 secs++;
1464 } 1510 }
1465 1511
1466 return list3 (make_number ((secs >> 16) & 0xffff), 1512 return list3 (make_number (hi_time (secs)),
1467 make_number ((secs >> 0) & 0xffff), 1513 make_number (lo_time (secs)),
1468 make_number (usecs)); 1514 make_number (usecs));
1469#else /* ! HAVE_GETRUSAGE */ 1515#else /* ! HAVE_GETRUSAGE */
1470#ifdef WINDOWSNT 1516#ifdef WINDOWSNT
@@ -1476,6 +1522,19 @@ on systems that do not provide resolution finer than a second. */)
1476} 1522}
1477 1523
1478 1524
1525/* Make a Lisp list that represents the time T. */
1526Lisp_Object
1527make_time (time_t t)
1528{
1529 return list2 (make_number (hi_time (t)),
1530 make_number (lo_time (t)));
1531}
1532
1533/* Decode a Lisp list SPECIFIED_TIME that represents a time.
1534 If SPECIFIED_TIME is nil, use the current time.
1535 Set *RESULT to seconds since the Epoch.
1536 If USEC is not null, set *USEC to the microseconds component.
1537 Return nonzero if successful. */
1479int 1538int
1480lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec) 1539lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec)
1481{ 1540{
@@ -1496,6 +1555,7 @@ lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec)
1496 else 1555 else
1497 { 1556 {
1498 Lisp_Object high, low; 1557 Lisp_Object high, low;
1558 EMACS_INT hi;
1499 high = Fcar (specified_time); 1559 high = Fcar (specified_time);
1500 CHECK_NUMBER (high); 1560 CHECK_NUMBER (high);
1501 low = Fcdr (specified_time); 1561 low = Fcdr (specified_time);
@@ -1519,8 +1579,21 @@ lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec)
1519 else if (usec) 1579 else if (usec)
1520 *usec = 0; 1580 *usec = 0;
1521 CHECK_NUMBER (low); 1581 CHECK_NUMBER (low);
1522 *result = (XINT (high) << 16) + (XINT (low) & 0xffff); 1582 hi = XINT (high);
1523 return *result >> 16 == XINT (high); 1583
1584 /* Check for overflow, helping the compiler for common cases
1585 where no runtime check is needed, and taking care not to
1586 convert negative numbers to unsigned before comparing them. */
1587 if (! ((TYPE_SIGNED (time_t)
1588 ? (TIME_T_MIN >> 16 <= MOST_NEGATIVE_FIXNUM
1589 || TIME_T_MIN >> 16 <= hi)
1590 : 0 <= hi)
1591 && (MOST_POSITIVE_FIXNUM <= TIME_T_MAX >> 16
1592 || hi <= TIME_T_MAX >> 16)))
1593 return 0;
1594
1595 *result = (hi << 16) + (XINT (low) & 0xffff);
1596 return 1;
1524 } 1597 }
1525} 1598}
1526 1599
@@ -1648,7 +1721,7 @@ The modifiers are `E' and `O'. For certain characters X,
1648%OX is like %X, but uses the locale's number symbols. 1721%OX is like %X, but uses the locale's number symbols.
1649 1722
1650For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */) 1723For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */)
1651 (Lisp_Object format_string, Lisp_Object time, Lisp_Object universal) 1724 (Lisp_Object format_string, Lisp_Object timeval, Lisp_Object universal)
1652{ 1725{
1653 time_t value; 1726 time_t value;
1654 int size; 1727 int size;
@@ -1659,7 +1732,7 @@ For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */)
1659 1732
1660 CHECK_STRING (format_string); 1733 CHECK_STRING (format_string);
1661 1734
1662 if (! (lisp_time_argument (time, &value, &usec) 1735 if (! (lisp_time_argument (timeval, &value, &usec)
1663 && 0 <= usec && usec < 1000000)) 1736 && 0 <= usec && usec < 1000000))
1664 error ("Invalid time specification"); 1737 error ("Invalid time specification");
1665 ns = usec * 1000; 1738 ns = usec * 1000;
@@ -1674,7 +1747,7 @@ For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */)
1674 tm = ut ? gmtime (&value) : localtime (&value); 1747 tm = ut ? gmtime (&value) : localtime (&value);
1675 UNBLOCK_INPUT; 1748 UNBLOCK_INPUT;
1676 if (! tm) 1749 if (! tm)
1677 error ("Specified time is not representable"); 1750 time_overflow ();
1678 1751
1679 synchronize_system_time_locale (); 1752 synchronize_system_time_locale ();
1680 1753
@@ -1732,8 +1805,10 @@ DOW and ZONE.) */)
1732 BLOCK_INPUT; 1805 BLOCK_INPUT;
1733 decoded_time = localtime (&time_spec); 1806 decoded_time = localtime (&time_spec);
1734 UNBLOCK_INPUT; 1807 UNBLOCK_INPUT;
1735 if (! decoded_time) 1808 if (! (decoded_time
1736 error ("Specified time is not representable"); 1809 && MOST_NEGATIVE_FIXNUM - TM_YEAR_BASE <= decoded_time->tm_year
1810 && decoded_time->tm_year <= MOST_POSITIVE_FIXNUM - TM_YEAR_BASE))
1811 time_overflow ();
1737 XSETFASTINT (list_args[0], decoded_time->tm_sec); 1812 XSETFASTINT (list_args[0], decoded_time->tm_sec);
1738 XSETFASTINT (list_args[1], decoded_time->tm_min); 1813 XSETFASTINT (list_args[1], decoded_time->tm_min);
1739 XSETFASTINT (list_args[2], decoded_time->tm_hour); 1814 XSETFASTINT (list_args[2], decoded_time->tm_hour);
@@ -1757,6 +1832,20 @@ DOW and ZONE.) */)
1757 return Flist (9, list_args); 1832 return Flist (9, list_args);
1758} 1833}
1759 1834
1835/* Return OBJ - OFFSET, checking that OBJ is a valid fixnum and that
1836 the result is representable as an int. Assume OFFSET is small and
1837 nonnegative. */
1838static int
1839check_tm_member (Lisp_Object obj, int offset)
1840{
1841 EMACS_INT n;
1842 CHECK_NUMBER (obj);
1843 n = XINT (obj);
1844 if (! (INT_MIN + offset <= n && n - offset <= INT_MAX))
1845 time_overflow ();
1846 return n - offset;
1847}
1848
1760DEFUN ("encode-time", Fencode_time, Sencode_time, 6, MANY, 0, 1849DEFUN ("encode-time", Fencode_time, Sencode_time, 6, MANY, 0,
1761 doc: /* Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time. 1850 doc: /* Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time.
1762This is the reverse operation of `decode-time', which see. 1851This is the reverse operation of `decode-time', which see.
@@ -1781,23 +1870,16 @@ year values as low as 1901 do work.
1781usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */) 1870usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
1782 (int nargs, register Lisp_Object *args) 1871 (int nargs, register Lisp_Object *args)
1783{ 1872{
1784 time_t time; 1873 time_t value;
1785 struct tm tm; 1874 struct tm tm;
1786 Lisp_Object zone = (nargs > 6 ? args[nargs - 1] : Qnil); 1875 Lisp_Object zone = (nargs > 6 ? args[nargs - 1] : Qnil);
1787 1876
1788 CHECK_NUMBER (args[0]); /* second */ 1877 tm.tm_sec = check_tm_member (args[0], 0);
1789 CHECK_NUMBER (args[1]); /* minute */ 1878 tm.tm_min = check_tm_member (args[1], 0);
1790 CHECK_NUMBER (args[2]); /* hour */ 1879 tm.tm_hour = check_tm_member (args[2], 0);
1791 CHECK_NUMBER (args[3]); /* day */ 1880 tm.tm_mday = check_tm_member (args[3], 0);
1792 CHECK_NUMBER (args[4]); /* month */ 1881 tm.tm_mon = check_tm_member (args[4], 1);
1793 CHECK_NUMBER (args[5]); /* year */ 1882 tm.tm_year = check_tm_member (args[5], TM_YEAR_BASE);
1794
1795 tm.tm_sec = XINT (args[0]);
1796 tm.tm_min = XINT (args[1]);
1797 tm.tm_hour = XINT (args[2]);
1798 tm.tm_mday = XINT (args[3]);
1799 tm.tm_mon = XINT (args[4]) - 1;
1800 tm.tm_year = XINT (args[5]) - TM_YEAR_BASE;
1801 tm.tm_isdst = -1; 1883 tm.tm_isdst = -1;
1802 1884
1803 if (CONSP (zone)) 1885 if (CONSP (zone))
@@ -1805,7 +1887,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
1805 if (NILP (zone)) 1887 if (NILP (zone))
1806 { 1888 {
1807 BLOCK_INPUT; 1889 BLOCK_INPUT;
1808 time = mktime (&tm); 1890 value = mktime (&tm);
1809 UNBLOCK_INPUT; 1891 UNBLOCK_INPUT;
1810 } 1892 }
1811 else 1893 else
@@ -1833,7 +1915,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
1833 set_time_zone_rule (tzstring); 1915 set_time_zone_rule (tzstring);
1834 1916
1835 BLOCK_INPUT; 1917 BLOCK_INPUT;
1836 time = mktime (&tm); 1918 value = mktime (&tm);
1837 UNBLOCK_INPUT; 1919 UNBLOCK_INPUT;
1838 1920
1839 /* Restore TZ to previous value. */ 1921 /* Restore TZ to previous value. */
@@ -1845,10 +1927,10 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
1845#endif 1927#endif
1846 } 1928 }
1847 1929
1848 if (time == (time_t) -1) 1930 if (value == (time_t) -1)
1849 error ("Specified time is not representable"); 1931 time_overflow ();
1850 1932
1851 return make_time (time); 1933 return make_time (value);
1852} 1934}
1853 1935
1854DEFUN ("current-time-string", Fcurrent_time_string, Scurrent_time_string, 0, 1, 0, 1936DEFUN ("current-time-string", Fcurrent_time_string, Scurrent_time_string, 0, 1, 0,
@@ -1881,7 +1963,7 @@ but this is considered obsolete. */)
1881 tm = localtime (&value); 1963 tm = localtime (&value);
1882 UNBLOCK_INPUT; 1964 UNBLOCK_INPUT;
1883 if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) && (tem = asctime (tm)))) 1965 if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) && (tem = asctime (tm))))
1884 error ("Specified time is not representable"); 1966 time_overflow ();
1885 1967
1886 /* Remove the trailing newline. */ 1968 /* Remove the trailing newline. */
1887 tem[strlen (tem) - 1] = '\0'; 1969 tem[strlen (tem) - 1] = '\0';
@@ -2258,7 +2340,7 @@ from adjoining text, if those properties are sticky. */)
2258 (Lisp_Object character, Lisp_Object count, Lisp_Object inherit) 2340 (Lisp_Object character, Lisp_Object count, Lisp_Object inherit)
2259{ 2341{
2260 register char *string; 2342 register char *string;
2261 register EMACS_INT strlen; 2343 register EMACS_INT stringlen;
2262 register int i; 2344 register int i;
2263 register EMACS_INT n; 2345 register EMACS_INT n;
2264 int len; 2346 int len;
@@ -2276,18 +2358,18 @@ from adjoining text, if those properties are sticky. */)
2276 n = XINT (count) * len; 2358 n = XINT (count) * len;
2277 if (n <= 0) 2359 if (n <= 0)
2278 return Qnil; 2360 return Qnil;
2279 strlen = min (n, 256 * len); 2361 stringlen = min (n, 256 * len);
2280 string = (char *) alloca (strlen); 2362 string = (char *) alloca (stringlen);
2281 for (i = 0; i < strlen; i++) 2363 for (i = 0; i < stringlen; i++)
2282 string[i] = str[i % len]; 2364 string[i] = str[i % len];
2283 while (n >= strlen) 2365 while (n >= stringlen)
2284 { 2366 {
2285 QUIT; 2367 QUIT;
2286 if (!NILP (inherit)) 2368 if (!NILP (inherit))
2287 insert_and_inherit (string, strlen); 2369 insert_and_inherit (string, stringlen);
2288 else 2370 else
2289 insert (string, strlen); 2371 insert (string, stringlen);
2290 n -= strlen; 2372 n -= stringlen;
2291 } 2373 }
2292 if (n > 0) 2374 if (n > 0)
2293 { 2375 {
@@ -2946,8 +3028,7 @@ It returns the number of characters changed. */)
2946 EMACS_INT size; /* Size of translate table. */ 3028 EMACS_INT size; /* Size of translate table. */
2947 EMACS_INT pos, pos_byte, end_pos; 3029 EMACS_INT pos, pos_byte, end_pos;
2948 int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); 3030 int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
2949 int string_multibyte; 3031 int string_multibyte IF_LINT (= 0);
2950 Lisp_Object val;
2951 3032
2952 validate_region (&start, &end); 3033 validate_region (&start, &end);
2953 if (CHAR_TABLE_P (table)) 3034 if (CHAR_TABLE_P (table))
@@ -3846,7 +3927,7 @@ usage: (format STRING &rest OBJECTS) */)
3846 /* handle case (precision[n] >= 0) */ 3927 /* handle case (precision[n] >= 0) */
3847 3928
3848 int width, padding; 3929 int width, padding;
3849 EMACS_INT nbytes, start, end; 3930 EMACS_INT nbytes, start;
3850 EMACS_INT nchars_string; 3931 EMACS_INT nchars_string;
3851 3932
3852 /* lisp_string_width ignores a precision of 0, but GNU 3933 /* lisp_string_width ignores a precision of 0, but GNU
@@ -3878,7 +3959,6 @@ usage: (format STRING &rest OBJECTS) */)
3878 3959
3879 info[n].start = start = nchars; 3960 info[n].start = start = nchars;
3880 nchars += nchars_string; 3961 nchars += nchars_string;
3881 end = nchars;
3882 3962
3883 if (p > buf 3963 if (p > buf
3884 && multibyte 3964 && multibyte
@@ -4130,7 +4210,7 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
4130{ 4210{
4131 int i1, i2; 4211 int i1, i2;
4132 /* Check they're chars, not just integers, otherwise we could get array 4212 /* Check they're chars, not just integers, otherwise we could get array
4133 bounds violations in DOWNCASE. */ 4213 bounds violations in downcase. */
4134 CHECK_CHARACTER (c1); 4214 CHECK_CHARACTER (c1);
4135 CHECK_CHARACTER (c2); 4215 CHECK_CHARACTER (c2);
4136 4216
@@ -4139,9 +4219,6 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
4139 if (NILP (BVAR (current_buffer, case_fold_search))) 4219 if (NILP (BVAR (current_buffer, case_fold_search)))
4140 return Qnil; 4220 return Qnil;
4141 4221
4142 /* Do these in separate statements,
4143 then compare the variables.
4144 because of the way DOWNCASE uses temp variables. */
4145 i1 = XFASTINT (c1); 4222 i1 = XFASTINT (c1);
4146 if (NILP (BVAR (current_buffer, enable_multibyte_characters)) 4223 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
4147 && ! ASCII_CHAR_P (i1)) 4224 && ! ASCII_CHAR_P (i1))
@@ -4154,9 +4231,7 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
4154 { 4231 {
4155 MAKE_CHAR_MULTIBYTE (i2); 4232 MAKE_CHAR_MULTIBYTE (i2);
4156 } 4233 }
4157 i1 = DOWNCASE (i1); 4234 return (downcase (i1) == downcase (i2) ? Qt : Qnil);
4158 i2 = DOWNCASE (i2);
4159 return (i1 == i2 ? Qt : Qnil);
4160} 4235}
4161 4236
4162/* Transpose the markers in two regions of the current buffer, and 4237/* Transpose the markers in two regions of the current buffer, and
diff --git a/src/emacs.c b/src/emacs.c
index 4455e6b4d9f..052f22ea622 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -141,7 +141,7 @@ Lisp_Object Qfile_name_handler_alist;
141 141
142Lisp_Object Qrisky_local_variable; 142Lisp_Object Qrisky_local_variable;
143 143
144/* If non-zero, emacs should not attempt to use a window-specific code, 144/* If non-zero, Emacs should not attempt to use a window-specific code,
145 but instead should use the virtual terminal under which it was started. */ 145 but instead should use the virtual terminal under which it was started. */
146int inhibit_window_system; 146int inhibit_window_system;
147 147
@@ -169,7 +169,6 @@ static unsigned long heap_bss_diff;
169#define MAX_HEAP_BSS_DIFF (1024*1024) 169#define MAX_HEAP_BSS_DIFF (1024*1024)
170 170
171/* Nonzero means running Emacs without interactive terminal. */ 171/* Nonzero means running Emacs without interactive terminal. */
172
173int noninteractive; 172int noninteractive;
174 173
175/* Nonzero means remove site-lisp directories from load-path. */ 174/* Nonzero means remove site-lisp directories from load-path. */
@@ -249,14 +248,14 @@ Display options:\n\
249--border-color, -bd COLOR main border color\n\ 248--border-color, -bd COLOR main border color\n\
250--border-width, -bw WIDTH width of main border\n\ 249--border-width, -bw WIDTH width of main border\n\
251--color, --color=MODE override color mode for character terminals;\n\ 250--color, --color=MODE override color mode for character terminals;\n\
252 MODE defaults to `auto', and can also\n\ 251 MODE defaults to `auto', and\n\
253 be `never', `auto', `always',\n\ 252 can also be `never', `always',\n\
254 or a mode name like `ansi8'\n\ 253 or a mode name like `ansi8'\n\
255--cursor-color, -cr COLOR color of the Emacs cursor indicating point\n\ 254--cursor-color, -cr COLOR color of the Emacs cursor indicating point\n\
256--font, -fn FONT default font; must be fixed-width\n\ 255--font, -fn FONT default font; must be fixed-width\n\
257--foreground-color, -fg COLOR window foreground color\n\ 256--foreground-color, -fg COLOR window foreground color\n\
258--fullheight, -fh make the first frame high as the screen\n\ 257--fullheight, -fh make the first frame high as the screen\n\
259--fullscreen, -fs make first frame fullscreen\n\ 258--fullscreen, -fs make the first frame fullscreen\n\
260--fullwidth, -fw make the first frame wide as the screen\n\ 259--fullwidth, -fw make the first frame wide as the screen\n\
261--maximized, -mm make the first frame maximized\n\ 260--maximized, -mm make the first frame maximized\n\
262--geometry, -g GEOMETRY window geometry\n\ 261--geometry, -g GEOMETRY window geometry\n\
@@ -382,7 +381,7 @@ static void
382init_cmdargs (int argc, char **argv, int skip_args) 381init_cmdargs (int argc, char **argv, int skip_args)
383{ 382{
384 register int i; 383 register int i;
385 Lisp_Object name, dir, tem; 384 Lisp_Object name, dir, handler;
386 int count = SPECPDL_INDEX (); 385 int count = SPECPDL_INDEX ();
387 Lisp_Object raw_name; 386 Lisp_Object raw_name;
388 387
@@ -393,8 +392,8 @@ init_cmdargs (int argc, char **argv, int skip_args)
393 392
394 /* Add /: to the front of the name 393 /* Add /: to the front of the name
395 if it would otherwise be treated as magic. */ 394 if it would otherwise be treated as magic. */
396 tem = Ffind_file_name_handler (raw_name, Qt); 395 handler = Ffind_file_name_handler (raw_name, Qt);
397 if (! NILP (tem)) 396 if (! NILP (handler))
398 raw_name = concat2 (build_string ("/:"), raw_name); 397 raw_name = concat2 (build_string ("/:"), raw_name);
399 398
400 Vinvocation_name = Ffile_name_nondirectory (raw_name); 399 Vinvocation_name = Ffile_name_nondirectory (raw_name);
@@ -411,8 +410,8 @@ init_cmdargs (int argc, char **argv, int skip_args)
411 { 410 {
412 /* Add /: to the front of the name 411 /* Add /: to the front of the name
413 if it would otherwise be treated as magic. */ 412 if it would otherwise be treated as magic. */
414 tem = Ffind_file_name_handler (found, Qt); 413 handler = Ffind_file_name_handler (found, Qt);
415 if (! NILP (tem)) 414 if (! NILP (handler))
416 found = concat2 (build_string ("/:"), found); 415 found = concat2 (build_string ("/:"), found);
417 Vinvocation_directory = Ffile_name_directory (found); 416 Vinvocation_directory = Ffile_name_directory (found);
418 } 417 }
@@ -547,21 +546,22 @@ static char dump_tz[] = "UtC0";
547 Provide dummy definitions to avoid error. 546 Provide dummy definitions to avoid error.
548 (We don't have any real constructors or destructors.) */ 547 (We don't have any real constructors or destructors.) */
549#ifdef __GNUC__ 548#ifdef __GNUC__
549
550/* Define a dummy function F. Declare F too, to pacify gcc
551 -Wmissing-prototypes. */
552#define DEFINE_DUMMY_FUNCTION(f) void f (void); void f (void) {}
553
550#ifndef GCC_CTORS_IN_LIBC 554#ifndef GCC_CTORS_IN_LIBC
551void __do_global_ctors (void) 555DEFINE_DUMMY_FUNCTION (__do_global_ctors)
552{} 556DEFINE_DUMMY_FUNCTION (__do_global_ctors_aux)
553void __do_global_ctors_aux (void) 557DEFINE_DUMMY_FUNCTION (__do_global_dtors)
554{}
555void __do_global_dtors (void)
556{}
557/* GNU/Linux has a bug in its library; avoid an error. */ 558/* GNU/Linux has a bug in its library; avoid an error. */
558#ifndef GNU_LINUX 559#ifndef GNU_LINUX
559char * __CTOR_LIST__[2] = { (char *) (-1), 0 }; 560char * __CTOR_LIST__[2] = { (char *) (-1), 0 };
560#endif 561#endif
561char * __DTOR_LIST__[2] = { (char *) (-1), 0 }; 562char * __DTOR_LIST__[2] = { (char *) (-1), 0 };
562#endif /* GCC_CTORS_IN_LIBC */ 563#endif /* GCC_CTORS_IN_LIBC */
563void __main (void) 564DEFINE_DUMMY_FUNCTION (__main)
564{}
565#endif /* __GNUC__ */ 565#endif /* __GNUC__ */
566#endif /* ORDINARY_LINK */ 566#endif /* ORDINARY_LINK */
567 567
@@ -576,7 +576,8 @@ void __main (void)
576 enough information to do it right. */ 576 enough information to do it right. */
577 577
578static int 578static int
579argmatch (char **argv, int argc, const char *sstr, const char *lstr, int minlen, char **valptr, int *skipptr) 579argmatch (char **argv, int argc, const char *sstr, const char *lstr,
580 int minlen, char **valptr, int *skipptr)
580{ 581{
581 char *p = NULL; 582 char *p = NULL;
582 int arglen; 583 int arglen;
@@ -948,7 +949,7 @@ main (int argc, char **argv)
948 /* Convert --script to -scriptload, un-skip it, and sort again 949 /* Convert --script to -scriptload, un-skip it, and sort again
949 so that it will be handled in proper sequence. */ 950 so that it will be handled in proper sequence. */
950 /* FIXME broken for --script=FILE - is that supposed to work? */ 951 /* FIXME broken for --script=FILE - is that supposed to work? */
951 argv[skip_args - 1] = "-scriptload"; 952 argv[skip_args - 1] = (char *) "-scriptload";
952 skip_args -= 2; 953 skip_args -= 2;
953 sort_args (argc, argv); 954 sort_args (argc, argv);
954 } 955 }
@@ -1347,7 +1348,7 @@ main (int argc, char **argv)
1347 1348
1348 for (j = 0; j < count_before + 1; j++) 1349 for (j = 0; j < count_before + 1; j++)
1349 new[j] = argv[j]; 1350 new[j] = argv[j];
1350 new[count_before + 1] = "-d"; 1351 new[count_before + 1] = (char *) "-d";
1351 new[count_before + 2] = displayname; 1352 new[count_before + 2] = displayname;
1352 for (j = count_before + 2; j <argc; j++) 1353 for (j = count_before + 2; j <argc; j++)
1353 new[j + 1] = argv[j]; 1354 new[j + 1] = argv[j];
@@ -1357,7 +1358,7 @@ main (int argc, char **argv)
1357 /* Change --display to -d, when its arg is separate. */ 1358 /* Change --display to -d, when its arg is separate. */
1358 else if (displayname != 0 && skip_args > count_before 1359 else if (displayname != 0 && skip_args > count_before
1359 && argv[count_before + 1][1] == '-') 1360 && argv[count_before + 1][1] == '-')
1360 argv[count_before + 1] = "-d"; 1361 argv[count_before + 1] = (char *) "-d";
1361 1362
1362 if (! no_site_lisp) 1363 if (! no_site_lisp)
1363 { 1364 {
@@ -2084,9 +2085,7 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff)
2084 2085
2085#ifndef CANNOT_DUMP 2086#ifndef CANNOT_DUMP
2086 2087
2087/* FIXME: maybe this should go into header file, config.h seems the 2088#include "unexec.h"
2088 only one appropriate. */
2089extern int unexec (const char *, const char *);
2090 2089
2091DEFUN ("dump-emacs", Fdump_emacs, Sdump_emacs, 2, 2, 0, 2090DEFUN ("dump-emacs", Fdump_emacs, Sdump_emacs, 2, 2, 0,
2092 doc: /* Dump current state of Emacs into executable file FILENAME. 2091 doc: /* Dump current state of Emacs into executable file FILENAME.
@@ -2380,7 +2379,7 @@ Special values:
2380Anything else (in Emacs 24.1, the possibilities are: aix, berkeley-unix, 2379Anything else (in Emacs 24.1, the possibilities are: aix, berkeley-unix,
2381hpux, irix, usg-unix-v) indicates some sort of Unix system. */); 2380hpux, irix, usg-unix-v) indicates some sort of Unix system. */);
2382 Vsystem_type = intern_c_string (SYSTEM_TYPE); 2381 Vsystem_type = intern_c_string (SYSTEM_TYPE);
2383 /* Above values are from SYSTEM_TYPE in src/s/*.h. */ 2382 /* The above values are from SYSTEM_TYPE in include files under src/s. */
2384 2383
2385 DEFVAR_LISP ("system-configuration", Vsystem_configuration, 2384 DEFVAR_LISP ("system-configuration", Vsystem_configuration,
2386 doc: /* Value is string indicating configuration Emacs was built for. 2385 doc: /* Value is string indicating configuration Emacs was built for.
diff --git a/src/eval.c b/src/eval.c
index 2fb89ce404e..c22e7d3f571 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -160,7 +160,7 @@ restore_stack_limits (Lisp_Object data)
160 160
161/* Call the Lisp debugger, giving it argument ARG. */ 161/* Call the Lisp debugger, giving it argument ARG. */
162 162
163Lisp_Object 163static Lisp_Object
164call_debugger (Lisp_Object arg) 164call_debugger (Lisp_Object arg)
165{ 165{
166 int debug_while_redisplaying; 166 int debug_while_redisplaying;
@@ -216,7 +216,7 @@ call_debugger (Lisp_Object arg)
216 return unbind_to (count, val); 216 return unbind_to (count, val);
217} 217}
218 218
219void 219static void
220do_debug_on_call (Lisp_Object code) 220do_debug_on_call (Lisp_Object code)
221{ 221{
222 debug_on_next_call = 0; 222 debug_on_next_call = 0;
@@ -796,11 +796,11 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
796 if (SYMBOL_CONSTANT_P (sym)) 796 if (SYMBOL_CONSTANT_P (sym))
797 { 797 {
798 /* For upward compatibility, allow (defvar :foo (quote :foo)). */ 798 /* For upward compatibility, allow (defvar :foo (quote :foo)). */
799 Lisp_Object tem = Fcar (tail); 799 Lisp_Object tem1 = Fcar (tail);
800 if (! (CONSP (tem) 800 if (! (CONSP (tem1)
801 && EQ (XCAR (tem), Qquote) 801 && EQ (XCAR (tem1), Qquote)
802 && CONSP (XCDR (tem)) 802 && CONSP (XCDR (tem1))
803 && EQ (XCAR (XCDR (tem)), sym))) 803 && EQ (XCAR (XCDR (tem1)), sym)))
804 error ("Constant symbol `%s' specified in defvar", 804 error ("Constant symbol `%s' specified in defvar",
805 SDATA (SYMBOL_NAME (sym))); 805 SDATA (SYMBOL_NAME (sym)));
806 } 806 }
@@ -840,11 +840,12 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
840 Vinternal_interpreter_environment = 840 Vinternal_interpreter_environment =
841 Fcons (sym, Vinternal_interpreter_environment); 841 Fcons (sym, Vinternal_interpreter_environment);
842 else 842 else
843 /* Simple (defvar <var>) should not count as a definition at all. 843 {
844 It could get in the way of other definitions, and unloading this 844 /* Simple (defvar <var>) should not count as a definition at all.
845 package could try to make the variable unbound. */ 845 It could get in the way of other definitions, and unloading this
846 ; 846 package could try to make the variable unbound. */
847 847 }
848
848 return sym; 849 return sym;
849} 850}
850 851
@@ -895,7 +896,8 @@ user_variable_p_eh (Lisp_Object ignore)
895static Lisp_Object 896static Lisp_Object
896lisp_indirect_variable (Lisp_Object sym) 897lisp_indirect_variable (Lisp_Object sym)
897{ 898{
898 XSETSYMBOL (sym, indirect_variable (XSYMBOL (sym))); 899 struct Lisp_Symbol *s = indirect_variable (XSYMBOL (sym));
900 XSETSYMBOL (sym, s);
899 return sym; 901 return sym;
900} 902}
901 903
@@ -1720,7 +1722,7 @@ See also the function `condition-case'. */)
1720 if (!NILP (clause)) 1722 if (!NILP (clause))
1721 break; 1723 break;
1722 } 1724 }
1723 1725
1724 if (/* Don't run the debugger for a memory-full error. 1726 if (/* Don't run the debugger for a memory-full error.
1725 (There is no room in memory to do that!) */ 1727 (There is no room in memory to do that!) */
1726 !NILP (error_symbol) 1728 !NILP (error_symbol)
@@ -1737,13 +1739,13 @@ See also the function `condition-case'. */)
1737 can continue code which has signaled a quit. */ 1739 can continue code which has signaled a quit. */
1738 if (debugger_called && EQ (real_error_symbol, Qquit)) 1740 if (debugger_called && EQ (real_error_symbol, Qquit))
1739 return Qnil; 1741 return Qnil;
1740 } 1742 }
1741 1743
1742 if (!NILP (clause)) 1744 if (!NILP (clause))
1743 { 1745 {
1744 Lisp_Object unwind_data 1746 Lisp_Object unwind_data
1745 = (NILP (error_symbol) ? data : Fcons (error_symbol, data)); 1747 = (NILP (error_symbol) ? data : Fcons (error_symbol, data));
1746 1748
1747 h->chosen_clause = clause; 1749 h->chosen_clause = clause;
1748 unwind_to_catch (h->tag, unwind_data); 1750 unwind_to_catch (h->tag, unwind_data);
1749 } 1751 }
@@ -1755,7 +1757,7 @@ See also the function `condition-case'. */)
1755 1757
1756 if (! NILP (error_symbol)) 1758 if (! NILP (error_symbol))
1757 data = Fcons (error_symbol, data); 1759 data = Fcons (error_symbol, data);
1758 1760
1759 string = Ferror_message_string (data); 1761 string = Ferror_message_string (data);
1760 fatal ("%s", SDATA (string), 0); 1762 fatal ("%s", SDATA (string), 0);
1761} 1763}
@@ -2648,8 +2650,8 @@ run_hook_with_args (int nargs, Lisp_Object *args, enum run_hooks_condition cond)
2648 } 2650 }
2649 else 2651 else
2650 { 2652 {
2651 Lisp_Object globals = Qnil; 2653 Lisp_Object global_vals = Qnil;
2652 GCPRO3 (sym, val, globals); 2654 GCPRO3 (sym, val, global_vals);
2653 2655
2654 for (; 2656 for (;
2655 CONSP (val) && ((cond == to_completion) 2657 CONSP (val) && ((cond == to_completion)
@@ -2661,23 +2663,25 @@ run_hook_with_args (int nargs, Lisp_Object *args, enum run_hooks_condition cond)
2661 { 2663 {
2662 /* t indicates this hook has a local binding; 2664 /* t indicates this hook has a local binding;
2663 it means to run the global binding too. */ 2665 it means to run the global binding too. */
2664 globals = Fdefault_value (sym); 2666 global_vals = Fdefault_value (sym);
2665 if (NILP (globals)) continue; 2667 if (NILP (global_vals)) continue;
2666 2668
2667 if (!CONSP (globals) || EQ (XCAR (globals), Qlambda)) 2669 if (!CONSP (global_vals) || EQ (XCAR (global_vals), Qlambda))
2668 { 2670 {
2669 args[0] = globals; 2671 args[0] = global_vals;
2670 ret = Ffuncall (nargs, args); 2672 ret = Ffuncall (nargs, args);
2671 } 2673 }
2672 else 2674 else
2673 { 2675 {
2674 for (; 2676 for (;
2675 CONSP (globals) && ((cond == to_completion) 2677 (CONSP (global_vals)
2676 || (cond == until_success ? NILP (ret) 2678 && (cond == to_completion
2677 : !NILP (ret))); 2679 || (cond == until_success
2678 globals = XCDR (globals)) 2680 ? NILP (ret)
2681 : !NILP (ret))));
2682 global_vals = XCDR (global_vals))
2679 { 2683 {
2680 args[0] = XCAR (globals); 2684 args[0] = XCAR (global_vals);
2681 /* In a global value, t should not occur. If it does, we 2685 /* In a global value, t should not occur. If it does, we
2682 must ignore it to avoid an endless loop. */ 2686 must ignore it to avoid an endless loop. */
2683 if (!EQ (args[0], Qt)) 2687 if (!EQ (args[0], Qt))
@@ -3248,7 +3252,7 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode,
3248 return object; 3252 return object;
3249} 3253}
3250 3254
3251void 3255static void
3252grow_specpdl (void) 3256grow_specpdl (void)
3253{ 3257{
3254 register int count = SPECPDL_INDEX (); 3258 register int count = SPECPDL_INDEX ();
@@ -3823,4 +3827,3 @@ alist of active lexical bindings. */);
3823 defsubr (&Sspecial_variable_p); 3827 defsubr (&Sspecial_variable_p);
3824 defsubr (&Sfunctionp); 3828 defsubr (&Sfunctionp);
3825} 3829}
3826
diff --git a/src/fileio.c b/src/fileio.c
index 18e9dbe9680..5d33fb93878 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -178,7 +178,7 @@ report_file_error (const char *string, Lisp_Object data)
178 178
179 str = SSDATA (errstring); 179 str = SSDATA (errstring);
180 c = STRING_CHAR ((unsigned char *) str); 180 c = STRING_CHAR ((unsigned char *) str);
181 Faset (errstring, make_number (0), make_number (DOWNCASE (c))); 181 Faset (errstring, make_number (0), make_number (downcase (c)));
182 } 182 }
183 183
184 xsignal (Qfile_error, 184 xsignal (Qfile_error,
@@ -433,8 +433,8 @@ get a current directory to run processes in. */)
433} 433}
434 434
435 435
436char * 436static char *
437file_name_as_directory (char *out, char *in) 437file_name_as_directory (char *out, const char *in)
438{ 438{
439 int size = strlen (in) - 1; 439 int size = strlen (in) - 1;
440 440
@@ -496,7 +496,7 @@ For a Unix-syntax file name, just appends a slash. */)
496 * Value is nonzero if the string output is different from the input. 496 * Value is nonzero if the string output is different from the input.
497 */ 497 */
498 498
499int 499static int
500directory_file_name (char *src, char *dst) 500directory_file_name (char *src, char *dst)
501{ 501{
502 long slen; 502 long slen;
@@ -728,7 +728,8 @@ filesystem tree, not (expand-file-name ".." dirname). */)
728{ 728{
729 /* These point to SDATA and need to be careful with string-relocation 729 /* These point to SDATA and need to be careful with string-relocation
730 during GC (via DECODE_FILE). */ 730 during GC (via DECODE_FILE). */
731 char *nm, *newdir; 731 char *nm;
732 const char *newdir;
732 /* This should only point to alloca'd data. */ 733 /* This should only point to alloca'd data. */
733 char *target; 734 char *target;
734 735
@@ -1013,21 +1014,23 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1013 if (!newdir && drive) 1014 if (!newdir && drive)
1014 { 1015 {
1015 /* Get default directory if needed to make nm absolute. */ 1016 /* Get default directory if needed to make nm absolute. */
1017 char *adir = NULL;
1016 if (!IS_DIRECTORY_SEP (nm[0])) 1018 if (!IS_DIRECTORY_SEP (nm[0]))
1017 { 1019 {
1018 newdir = alloca (MAXPATHLEN + 1); 1020 adir = alloca (MAXPATHLEN + 1);
1019 if (!getdefdir (toupper (drive) - 'A' + 1, newdir)) 1021 if (!getdefdir (toupper (drive) - 'A' + 1, adir))
1020 newdir = NULL; 1022 adir = NULL;
1021 } 1023 }
1022 if (!newdir) 1024 if (!adir)
1023 { 1025 {
1024 /* Either nm starts with /, or drive isn't mounted. */ 1026 /* Either nm starts with /, or drive isn't mounted. */
1025 newdir = alloca (4); 1027 adir = alloca (4);
1026 newdir[0] = DRIVE_LETTER (drive); 1028 adir[0] = DRIVE_LETTER (drive);
1027 newdir[1] = ':'; 1029 adir[1] = ':';
1028 newdir[2] = '/'; 1030 adir[2] = '/';
1029 newdir[3] = 0; 1031 adir[3] = 0;
1030 } 1032 }
1033 newdir = adir;
1031 } 1034 }
1032#endif /* DOS_NT */ 1035#endif /* DOS_NT */
1033 1036
@@ -1074,7 +1077,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1074 when we have pointers into lisp strings, we accomplish this 1077 when we have pointers into lisp strings, we accomplish this
1075 indirectly by prepending newdir to nm if necessary, and using 1078 indirectly by prepending newdir to nm if necessary, and using
1076 cwd (or the wd of newdir's drive) as the new newdir. */ 1079 cwd (or the wd of newdir's drive) as the new newdir. */
1077 1080 char *adir;
1078 if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1])) 1081 if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1]))
1079 { 1082 {
1080 drive = (unsigned char) newdir[0]; 1083 drive = (unsigned char) newdir[0];
@@ -1087,14 +1090,15 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1087 strcat (tmp, nm); 1090 strcat (tmp, nm);
1088 nm = tmp; 1091 nm = tmp;
1089 } 1092 }
1090 newdir = alloca (MAXPATHLEN + 1); 1093 adir = alloca (MAXPATHLEN + 1);
1091 if (drive) 1094 if (drive)
1092 { 1095 {
1093 if (!getdefdir (toupper (drive) - 'A' + 1, newdir)) 1096 if (!getdefdir (toupper (drive) - 'A' + 1, adir))
1094 newdir = "/"; 1097 newdir = "/";
1095 } 1098 }
1096 else 1099 else
1097 getwd (newdir); 1100 getwd (adir);
1101 newdir = adir;
1098 } 1102 }
1099 1103
1100 /* Strip off drive name from prefix, if present. */ 1104 /* Strip off drive name from prefix, if present. */
@@ -1111,13 +1115,13 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1111#ifdef WINDOWSNT 1115#ifdef WINDOWSNT
1112 if (IS_DIRECTORY_SEP (newdir[0]) && IS_DIRECTORY_SEP (newdir[1])) 1116 if (IS_DIRECTORY_SEP (newdir[0]) && IS_DIRECTORY_SEP (newdir[1]))
1113 { 1117 {
1114 char *p; 1118 char *adir = strcpy (alloca (strlen (newdir) + 1), newdir);
1115 newdir = strcpy (alloca (strlen (newdir) + 1), newdir); 1119 char *p = adir + 2;
1116 p = newdir + 2;
1117 while (*p && !IS_DIRECTORY_SEP (*p)) p++; 1120 while (*p && !IS_DIRECTORY_SEP (*p)) p++;
1118 p++; 1121 p++;
1119 while (*p && !IS_DIRECTORY_SEP (*p)) p++; 1122 while (*p && !IS_DIRECTORY_SEP (*p)) p++;
1120 *p = 0; 1123 *p = 0;
1124 newdir = adir;
1121 } 1125 }
1122 else 1126 else
1123#endif 1127#endif
@@ -1734,7 +1738,7 @@ expand_and_dir_to_file (Lisp_Object filename, Lisp_Object defdir)
1734 1738
1735 If QUICK is nonzero, we ask for y or n, not yes or no. */ 1739 If QUICK is nonzero, we ask for y or n, not yes or no. */
1736 1740
1737void 1741static void
1738barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring, 1742barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring,
1739 int interactive, struct stat *statptr, int quick) 1743 int interactive, struct stat *statptr, int quick)
1740{ 1744{
@@ -2041,7 +2045,6 @@ DEFUN ("delete-directory-internal", Fdelete_directory_internal,
2041 (Lisp_Object directory) 2045 (Lisp_Object directory)
2042{ 2046{
2043 const char *dir; 2047 const char *dir;
2044 Lisp_Object handler;
2045 Lisp_Object encoded_dir; 2048 Lisp_Object encoded_dir;
2046 2049
2047 CHECK_STRING (directory); 2050 CHECK_STRING (directory);
@@ -2753,7 +2756,7 @@ if file does not exist, is not accessible, or SELinux is disabled */)
2753#if HAVE_LIBSELINUX 2756#if HAVE_LIBSELINUX
2754 if (is_selinux_enabled ()) 2757 if (is_selinux_enabled ())
2755 { 2758 {
2756 conlength = lgetfilecon (SDATA (absname), &con); 2759 conlength = lgetfilecon (SSDATA (absname), &con);
2757 if (conlength > 0) 2760 if (conlength > 0)
2758 { 2761 {
2759 context = context_new (con); 2762 context = context_new (con);
@@ -2808,34 +2811,35 @@ is disabled. */)
2808 if (is_selinux_enabled ()) 2811 if (is_selinux_enabled ())
2809 { 2812 {
2810 /* Get current file context. */ 2813 /* Get current file context. */
2811 conlength = lgetfilecon (SDATA (encoded_absname), &con); 2814 conlength = lgetfilecon (SSDATA (encoded_absname), &con);
2812 if (conlength > 0) 2815 if (conlength > 0)
2813 { 2816 {
2814 parsed_con = context_new (con); 2817 parsed_con = context_new (con);
2815 /* Change the parts defined in the parameter.*/ 2818 /* Change the parts defined in the parameter.*/
2816 if (STRINGP (user)) 2819 if (STRINGP (user))
2817 { 2820 {
2818 if (context_user_set (parsed_con, SDATA (user))) 2821 if (context_user_set (parsed_con, SSDATA (user)))
2819 error ("Doing context_user_set"); 2822 error ("Doing context_user_set");
2820 } 2823 }
2821 if (STRINGP (role)) 2824 if (STRINGP (role))
2822 { 2825 {
2823 if (context_role_set (parsed_con, SDATA (role))) 2826 if (context_role_set (parsed_con, SSDATA (role)))
2824 error ("Doing context_role_set"); 2827 error ("Doing context_role_set");
2825 } 2828 }
2826 if (STRINGP (type)) 2829 if (STRINGP (type))
2827 { 2830 {
2828 if (context_type_set (parsed_con, SDATA (type))) 2831 if (context_type_set (parsed_con, SSDATA (type)))
2829 error ("Doing context_type_set"); 2832 error ("Doing context_type_set");
2830 } 2833 }
2831 if (STRINGP (range)) 2834 if (STRINGP (range))
2832 { 2835 {
2833 if (context_range_set (parsed_con, SDATA (range))) 2836 if (context_range_set (parsed_con, SSDATA (range)))
2834 error ("Doing context_range_set"); 2837 error ("Doing context_range_set");
2835 } 2838 }
2836 2839
2837 /* Set the modified context back to the file. */ 2840 /* Set the modified context back to the file. */
2838 fail = lsetfilecon (SDATA (encoded_absname), context_str (parsed_con)); 2841 fail = lsetfilecon (SSDATA (encoded_absname),
2842 context_str (parsed_con));
2839 if (fail) 2843 if (fail)
2840 report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil)); 2844 report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil));
2841 2845
@@ -2937,19 +2941,19 @@ The value is an integer. */)
2937 2941
2938 2942
2939DEFUN ("set-file-times", Fset_file_times, Sset_file_times, 1, 2, 0, 2943DEFUN ("set-file-times", Fset_file_times, Sset_file_times, 1, 2, 0,
2940 doc: /* Set times of file FILENAME to TIME. 2944 doc: /* Set times of file FILENAME to TIMESTAMP.
2941Set both access and modification times. 2945Set both access and modification times.
2942Return t on success, else nil. 2946Return t on success, else nil.
2943Use the current time if TIME is nil. TIME is in the format of 2947Use the current time if TIMESTAMP is nil. TIMESTAMP is in the format of
2944`current-time'. */) 2948`current-time'. */)
2945 (Lisp_Object filename, Lisp_Object time) 2949 (Lisp_Object filename, Lisp_Object timestamp)
2946{ 2950{
2947 Lisp_Object absname, encoded_absname; 2951 Lisp_Object absname, encoded_absname;
2948 Lisp_Object handler; 2952 Lisp_Object handler;
2949 time_t sec; 2953 time_t sec;
2950 int usec; 2954 int usec;
2951 2955
2952 if (! lisp_time_argument (time, &sec, &usec)) 2956 if (! lisp_time_argument (timestamp, &sec, &usec))
2953 error ("Invalid time specification"); 2957 error ("Invalid time specification");
2954 2958
2955 absname = Fexpand_file_name (filename, BVAR (current_buffer, directory)); 2959 absname = Fexpand_file_name (filename, BVAR (current_buffer, directory));
@@ -2958,7 +2962,7 @@ Use the current time if TIME is nil. TIME is in the format of
2958 call the corresponding file handler. */ 2962 call the corresponding file handler. */
2959 handler = Ffind_file_name_handler (absname, Qset_file_times); 2963 handler = Ffind_file_name_handler (absname, Qset_file_times);
2960 if (!NILP (handler)) 2964 if (!NILP (handler))
2961 return call3 (handler, Qset_file_times, absname, time); 2965 return call3 (handler, Qset_file_times, absname, timestamp);
2962 2966
2963 encoded_absname = ENCODE_FILE (absname); 2967 encoded_absname = ENCODE_FILE (absname);
2964 2968
@@ -3354,13 +3358,13 @@ variable `last-coding-system-used' to the coding system actually used. */)
3354 else if (nread > 0) 3358 else if (nread > 0)
3355 { 3359 {
3356 struct buffer *prev = current_buffer; 3360 struct buffer *prev = current_buffer;
3357 Lisp_Object buffer; 3361 Lisp_Object workbuf;
3358 struct buffer *buf; 3362 struct buffer *buf;
3359 3363
3360 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); 3364 record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
3361 3365
3362 buffer = Fget_buffer_create (build_string (" *code-converting-work*")); 3366 workbuf = Fget_buffer_create (build_string (" *code-converting-work*"));
3363 buf = XBUFFER (buffer); 3367 buf = XBUFFER (workbuf);
3364 3368
3365 delete_all_overlays (buf); 3369 delete_all_overlays (buf);
3366 BVAR (buf, directory) = BVAR (current_buffer, directory); 3370 BVAR (buf, directory) = BVAR (current_buffer, directory);
@@ -3872,7 +3876,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3872 3876
3873 if (not_regular) 3877 if (not_regular)
3874 { 3878 {
3875 Lisp_Object val; 3879 Lisp_Object nbytes;
3876 3880
3877 /* Maybe make more room. */ 3881 /* Maybe make more room. */
3878 if (gap_size < trytry) 3882 if (gap_size < trytry)
@@ -3887,15 +3891,16 @@ variable `last-coding-system-used' to the coding system actually used. */)
3887 non_regular_fd = fd; 3891 non_regular_fd = fd;
3888 non_regular_inserted = inserted; 3892 non_regular_inserted = inserted;
3889 non_regular_nbytes = trytry; 3893 non_regular_nbytes = trytry;
3890 val = internal_condition_case_1 (read_non_regular, Qnil, Qerror, 3894 nbytes = internal_condition_case_1 (read_non_regular,
3891 read_non_regular_quit); 3895 Qnil, Qerror,
3892 if (NILP (val)) 3896 read_non_regular_quit);
3897 if (NILP (nbytes))
3893 { 3898 {
3894 read_quit = 1; 3899 read_quit = 1;
3895 break; 3900 break;
3896 } 3901 }
3897 3902
3898 this = XINT (val); 3903 this = XINT (nbytes);
3899 } 3904 }
3900 else 3905 else
3901 { 3906 {
@@ -3986,7 +3991,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3986 care of marker adjustment. By this way, we can run Lisp 3991 care of marker adjustment. By this way, we can run Lisp
3987 program safely before decoding the inserted text. */ 3992 program safely before decoding the inserted text. */
3988 Lisp_Object unwind_data; 3993 Lisp_Object unwind_data;
3989 int count = SPECPDL_INDEX (); 3994 int count1 = SPECPDL_INDEX ();
3990 3995
3991 unwind_data = Fcons (BVAR (current_buffer, enable_multibyte_characters), 3996 unwind_data = Fcons (BVAR (current_buffer, enable_multibyte_characters),
3992 Fcons (BVAR (current_buffer, undo_list), 3997 Fcons (BVAR (current_buffer, undo_list),
@@ -4013,7 +4018,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
4013 if (CONSP (coding_system)) 4018 if (CONSP (coding_system))
4014 coding_system = XCAR (coding_system); 4019 coding_system = XCAR (coding_system);
4015 } 4020 }
4016 unbind_to (count, Qnil); 4021 unbind_to (count1, Qnil);
4017 inserted = Z_BYTE - BEG_BYTE; 4022 inserted = Z_BYTE - BEG_BYTE;
4018 } 4023 }
4019 4024
@@ -4116,7 +4121,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
4116 if (inserted > 0) 4121 if (inserted > 0)
4117 { 4122 {
4118 /* Don't run point motion or modification hooks when decoding. */ 4123 /* Don't run point motion or modification hooks when decoding. */
4119 int count = SPECPDL_INDEX (); 4124 int count1 = SPECPDL_INDEX ();
4120 EMACS_INT old_inserted = inserted; 4125 EMACS_INT old_inserted = inserted;
4121 specbind (Qinhibit_point_motion_hooks, Qt); 4126 specbind (Qinhibit_point_motion_hooks, Qt);
4122 specbind (Qinhibit_modification_hooks, Qt); 4127 specbind (Qinhibit_modification_hooks, Qt);
@@ -4228,7 +4233,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
4228 Otherwise start with an empty undo_list. */ 4233 Otherwise start with an empty undo_list. */
4229 BVAR (current_buffer, undo_list) = EQ (old_undo, Qt) ? Qt : Qnil; 4234 BVAR (current_buffer, undo_list) = EQ (old_undo, Qt) ? Qt : Qnil;
4230 4235
4231 unbind_to (count, Qnil); 4236 unbind_to (count1, Qnil);
4232 } 4237 }
4233 4238
4234 /* Call after-change hooks for the inserted text, aside from the case 4239 /* Call after-change hooks for the inserted text, aside from the case
@@ -5059,8 +5064,8 @@ An argument specifies the modification time value to use
5059 return Qnil; 5064 return Qnil;
5060} 5065}
5061 5066
5062Lisp_Object 5067static Lisp_Object
5063auto_save_error (Lisp_Object error) 5068auto_save_error (Lisp_Object error_val)
5064{ 5069{
5065 Lisp_Object args[3], msg; 5070 Lisp_Object args[3], msg;
5066 int i, nbytes; 5071 int i, nbytes;
@@ -5074,7 +5079,7 @@ auto_save_error (Lisp_Object error)
5074 5079
5075 args[0] = build_string ("Auto-saving %s: %s"); 5080 args[0] = build_string ("Auto-saving %s: %s");
5076 args[1] = BVAR (current_buffer, name); 5081 args[1] = BVAR (current_buffer, name);
5077 args[2] = Ferror_message_string (error); 5082 args[2] = Ferror_message_string (error_val);
5078 msg = Fformat (3, args); 5083 msg = Fformat (3, args);
5079 GCPRO1 (msg); 5084 GCPRO1 (msg);
5080 nbytes = SBYTES (msg); 5085 nbytes = SBYTES (msg);
@@ -5095,7 +5100,7 @@ auto_save_error (Lisp_Object error)
5095 return Qnil; 5100 return Qnil;
5096} 5101}
5097 5102
5098Lisp_Object 5103static Lisp_Object
5099auto_save_1 (void) 5104auto_save_1 (void)
5100{ 5105{
5101 struct stat st; 5106 struct stat st;
@@ -5426,7 +5431,7 @@ before any other event (mouse or keypress) is handled. */)
5426Lisp_Object 5431Lisp_Object
5427Fread_file_name (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object initial, Lisp_Object predicate) 5432Fread_file_name (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object initial, Lisp_Object predicate)
5428{ 5433{
5429 struct gcpro gcpro1, gcpro2; 5434 struct gcpro gcpro1;
5430 Lisp_Object args[7]; 5435 Lisp_Object args[7];
5431 5436
5432 GCPRO1 (default_filename); 5437 GCPRO1 (default_filename);
diff --git a/src/filelock.c b/src/filelock.c
index 7f8f0e1c0fb..2138eaa502b 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -344,13 +344,13 @@ static int
344lock_file_1 (char *lfname, int force) 344lock_file_1 (char *lfname, int force)
345{ 345{
346 register int err; 346 register int err;
347 time_t boot_time; 347 time_t boot;
348 const char *user_name; 348 const char *user_name;
349 const char *host_name; 349 const char *host_name;
350 char *lock_info_str; 350 char *lock_info_str;
351 351
352 /* Call this first because it can GC. */ 352 /* Call this first because it can GC. */
353 boot_time = get_boot_time (); 353 boot = get_boot_time ();
354 354
355 if (STRINGP (Fuser_login_name (Qnil))) 355 if (STRINGP (Fuser_login_name (Qnil)))
356 user_name = SSDATA (Fuser_login_name (Qnil)); 356 user_name = SSDATA (Fuser_login_name (Qnil));
@@ -363,9 +363,9 @@ lock_file_1 (char *lfname, int force)
363 lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name) 363 lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name)
364 + LOCK_PID_MAX + 30); 364 + LOCK_PID_MAX + 30);
365 365
366 if (boot_time) 366 if (boot)
367 sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name, 367 sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name,
368 (unsigned long) getpid (), (unsigned long) boot_time); 368 (unsigned long) getpid (), (unsigned long) boot);
369 else 369 else
370 sprintf (lock_info_str, "%s@%s.%lu", user_name, host_name, 370 sprintf (lock_info_str, "%s@%s.%lu", user_name, host_name,
371 (unsigned long) getpid ()); 371 (unsigned long) getpid ());
@@ -382,7 +382,7 @@ lock_file_1 (char *lfname, int force)
382 382
383/* Return 1 if times A and B are no more than one second apart. */ 383/* Return 1 if times A and B are no more than one second apart. */
384 384
385int 385static int
386within_one_second (time_t a, time_t b) 386within_one_second (time_t a, time_t b)
387{ 387{
388 return (a - b >= -1 && a - b <= 1); 388 return (a - b >= -1 && a - b <= 1);
diff --git a/src/floatfns.c b/src/floatfns.c
index c00923643d1..bc03509b757 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -187,8 +187,10 @@ static const char *float_error_fn_name;
187 xsignal3 (Qrange_error, build_string ((op)), (a1), (a2)) 187 xsignal3 (Qrange_error, build_string ((op)), (a1), (a2))
188#define domain_error(op,arg) \ 188#define domain_error(op,arg) \
189 xsignal2 (Qdomain_error, build_string ((op)), (arg)) 189 xsignal2 (Qdomain_error, build_string ((op)), (arg))
190#ifdef FLOAT_CHECK_DOMAIN
190#define domain_error2(op,a1,a2) \ 191#define domain_error2(op,a1,a2) \
191 xsignal3 (Qdomain_error, build_string ((op)), (a1), (a2)) 192 xsignal3 (Qdomain_error, build_string ((op)), (a1), (a2))
193#endif
192 194
193/* Extract a Lisp number as a `double', or signal an error. */ 195/* Extract a Lisp number as a `double', or signal an error. */
194 196
@@ -326,9 +328,9 @@ If X is zero, both parts (SGNFCAND and EXP) are zero. */)
326 return Fcons (make_float (0.0), make_number (0)); 328 return Fcons (make_float (0.0), make_number (0));
327 else 329 else
328 { 330 {
329 int exp; 331 int exponent;
330 double sgnfcand = frexp (f, &exp); 332 double sgnfcand = frexp (f, &exponent);
331 return Fcons (make_float (sgnfcand), make_number (exp)); 333 return Fcons (make_float (sgnfcand), make_number (exponent));
332 } 334 }
333} 335}
334 336
@@ -336,10 +338,10 @@ DEFUN ("ldexp", Fldexp, Sldexp, 1, 2, 0,
336 doc: /* Construct number X from significand SGNFCAND and exponent EXP. 338 doc: /* Construct number X from significand SGNFCAND and exponent EXP.
337Returns the floating point value resulting from multiplying SGNFCAND 339Returns the floating point value resulting from multiplying SGNFCAND
338(the significand) by 2 raised to the power of EXP (the exponent). */) 340(the significand) by 2 raised to the power of EXP (the exponent). */)
339 (Lisp_Object sgnfcand, Lisp_Object exp) 341 (Lisp_Object sgnfcand, Lisp_Object exponent)
340{ 342{
341 CHECK_NUMBER (exp); 343 CHECK_NUMBER (exponent);
342 return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exp))); 344 return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exponent)));
343} 345}
344#endif 346#endif
345 347
@@ -1037,7 +1039,7 @@ syms_of_floatfns (void)
1037 defsubr (&Scopysign); 1039 defsubr (&Scopysign);
1038 defsubr (&Sfrexp); 1040 defsubr (&Sfrexp);
1039 defsubr (&Sldexp); 1041 defsubr (&Sldexp);
1040#endif 1042#endif
1041#if 0 1043#if 0
1042 defsubr (&Sacosh); 1044 defsubr (&Sacosh);
1043 defsubr (&Sasinh); 1045 defsubr (&Sasinh);
@@ -1074,4 +1076,3 @@ syms_of_floatfns (void)
1074 defsubr (&Sround); 1076 defsubr (&Sround);
1075 defsubr (&Struncate); 1077 defsubr (&Struncate);
1076} 1078}
1077
diff --git a/src/fns.c b/src/fns.c
index b800846b781..9a009c8ab44 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -57,9 +57,6 @@ Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper;
57 57
58static int internal_equal (Lisp_Object , Lisp_Object, int, int); 58static int internal_equal (Lisp_Object , Lisp_Object, int, int);
59 59
60extern long get_random (void);
61extern void seed_random (long);
62
63#ifndef HAVE_UNISTD_H 60#ifndef HAVE_UNISTD_H
64extern long time (); 61extern long time ();
65#endif 62#endif
@@ -2136,15 +2133,15 @@ DEFUN ("fillarray", Ffillarray, Sfillarray, 2, 2, 0,
2136ARRAY is a vector, string, char-table, or bool-vector. */) 2133ARRAY is a vector, string, char-table, or bool-vector. */)
2137 (Lisp_Object array, Lisp_Object item) 2134 (Lisp_Object array, Lisp_Object item)
2138{ 2135{
2139 register EMACS_INT size, index; 2136 register EMACS_INT size, idx;
2140 int charval; 2137 int charval;
2141 2138
2142 if (VECTORP (array)) 2139 if (VECTORP (array))
2143 { 2140 {
2144 register Lisp_Object *p = XVECTOR (array)->contents; 2141 register Lisp_Object *p = XVECTOR (array)->contents;
2145 size = ASIZE (array); 2142 size = ASIZE (array);
2146 for (index = 0; index < size; index++) 2143 for (idx = 0; idx < size; idx++)
2147 p[index] = item; 2144 p[idx] = item;
2148 } 2145 }
2149 else if (CHAR_TABLE_P (array)) 2146 else if (CHAR_TABLE_P (array))
2150 { 2147 {
@@ -2180,8 +2177,8 @@ ARRAY is a vector, string, char-table, or bool-vector. */)
2180 *p++ = str[i % len]; 2177 *p++ = str[i % len];
2181 } 2178 }
2182 else 2179 else
2183 for (index = 0; index < size; index++) 2180 for (idx = 0; idx < size; idx++)
2184 p[index] = charval; 2181 p[idx] = charval;
2185 } 2182 }
2186 else if (BOOL_VECTOR_P (array)) 2183 else if (BOOL_VECTOR_P (array))
2187 { 2184 {
@@ -2191,14 +2188,14 @@ ARRAY is a vector, string, char-table, or bool-vector. */)
2191 / BOOL_VECTOR_BITS_PER_CHAR); 2188 / BOOL_VECTOR_BITS_PER_CHAR);
2192 2189
2193 charval = (! NILP (item) ? -1 : 0); 2190 charval = (! NILP (item) ? -1 : 0);
2194 for (index = 0; index < size_in_chars - 1; index++) 2191 for (idx = 0; idx < size_in_chars - 1; idx++)
2195 p[index] = charval; 2192 p[idx] = charval;
2196 if (index < size_in_chars) 2193 if (idx < size_in_chars)
2197 { 2194 {
2198 /* Mask out bits beyond the vector size. */ 2195 /* Mask out bits beyond the vector size. */
2199 if (XBOOL_VECTOR (array)->size % BOOL_VECTOR_BITS_PER_CHAR) 2196 if (XBOOL_VECTOR (array)->size % BOOL_VECTOR_BITS_PER_CHAR)
2200 charval &= (1 << (XBOOL_VECTOR (array)->size % BOOL_VECTOR_BITS_PER_CHAR)) - 1; 2197 charval &= (1 << (XBOOL_VECTOR (array)->size % BOOL_VECTOR_BITS_PER_CHAR)) - 1;
2201 p[index] = charval; 2198 p[idx] = charval;
2202 } 2199 }
2203 } 2200 }
2204 else 2201 else
@@ -2601,9 +2598,9 @@ particular subfeatures supported in this version of FEATURE. */)
2601 2598
2602/* List of features currently being require'd, innermost first. */ 2599/* List of features currently being require'd, innermost first. */
2603 2600
2604Lisp_Object require_nesting_list; 2601static Lisp_Object require_nesting_list;
2605 2602
2606Lisp_Object 2603static Lisp_Object
2607require_unwind (Lisp_Object old_value) 2604require_unwind (Lisp_Object old_value)
2608{ 2605{
2609 return require_nesting_list = old_value; 2606 return require_nesting_list = old_value;
diff --git a/src/font.c b/src/font.c
index 35821ae34f9..9e8b7029c22 100644
--- a/src/font.c
+++ b/src/font.c
@@ -311,10 +311,10 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val, int noerror
311{ 311{
312 Lisp_Object table = AREF (font_style_table, prop - FONT_WEIGHT_INDEX); 312 Lisp_Object table = AREF (font_style_table, prop - FONT_WEIGHT_INDEX);
313 int len = ASIZE (table); 313 int len = ASIZE (table);
314 int i, j;
315 314
316 if (SYMBOLP (val)) 315 if (SYMBOLP (val))
317 { 316 {
317 int i, j;
318 char *s; 318 char *s;
319 Lisp_Object args[2], elt; 319 Lisp_Object args[2], elt;
320 320
@@ -500,10 +500,9 @@ font_prop_validate_style (Lisp_Object style, Lisp_Object val)
500 enum font_property_index prop = (EQ (style, QCweight) ? FONT_WEIGHT_INDEX 500 enum font_property_index prop = (EQ (style, QCweight) ? FONT_WEIGHT_INDEX
501 : EQ (style, QCslant) ? FONT_SLANT_INDEX 501 : EQ (style, QCslant) ? FONT_SLANT_INDEX
502 : FONT_WIDTH_INDEX); 502 : FONT_WIDTH_INDEX);
503 int n;
504 if (INTEGERP (val)) 503 if (INTEGERP (val))
505 { 504 {
506 n = XINT (val); 505 int n = XINT (val);
507 if (((n >> 4) & 0xF) 506 if (((n >> 4) & 0xF)
508 >= ASIZE (AREF (font_style_table, prop - FONT_WEIGHT_INDEX))) 507 >= ASIZE (AREF (font_style_table, prop - FONT_WEIGHT_INDEX)))
509 val = Qerror; 508 val = Qerror;
@@ -1163,7 +1162,8 @@ font_parse_xlfd (char *name, Lisp_Object font)
1163int 1162int
1164font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes) 1163font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
1165{ 1164{
1166 char *f[XLFD_REGISTRY_INDEX + 1]; 1165 char *p;
1166 const char *f[XLFD_REGISTRY_INDEX + 1];
1167 Lisp_Object val; 1167 Lisp_Object val;
1168 int i, j, len = 0; 1168 int i, j, len = 0;
1169 1169
@@ -1194,14 +1194,14 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
1194 /* Change "jisx0208*" and "jisx0208" to "jisx0208*-*". */ 1194 /* Change "jisx0208*" and "jisx0208" to "jisx0208*-*". */
1195 if (SDATA (val)[SBYTES (val) - 1] == '*') 1195 if (SDATA (val)[SBYTES (val) - 1] == '*')
1196 { 1196 {
1197 f[j] = alloca (SBYTES (val) + 3); 1197 f[j] = p = alloca (SBYTES (val) + 3);
1198 sprintf (f[j], "%s-*", SDATA (val)); 1198 sprintf (p, "%s-*", SDATA (val));
1199 len += SBYTES (val) + 3; 1199 len += SBYTES (val) + 3;
1200 } 1200 }
1201 else 1201 else
1202 { 1202 {
1203 f[j] = alloca (SBYTES (val) + 4); 1203 f[j] = p = alloca (SBYTES (val) + 4);
1204 sprintf (f[j], "%s*-*", SDATA (val)); 1204 sprintf (p, "%s*-*", SDATA (val));
1205 len += SBYTES (val) + 4; 1205 len += SBYTES (val) + 4;
1206 } 1206 }
1207 } 1207 }
@@ -1232,8 +1232,8 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
1232 i = pixel_size; 1232 i = pixel_size;
1233 if (i > 0) 1233 if (i > 0)
1234 { 1234 {
1235 f[XLFD_PIXEL_INDEX] = alloca (22); 1235 f[XLFD_PIXEL_INDEX] = p = alloca (22);
1236 len += sprintf (f[XLFD_PIXEL_INDEX], "%d-*", i) + 1; 1236 len += sprintf (p, "%d-*", i) + 1;
1237 } 1237 }
1238 else 1238 else
1239 f[XLFD_PIXEL_INDEX] = "*-*", len += 4; 1239 f[XLFD_PIXEL_INDEX] = "*-*", len += 4;
@@ -1241,8 +1241,8 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
1241 else if (FLOATP (val)) 1241 else if (FLOATP (val))
1242 { 1242 {
1243 i = XFLOAT_DATA (val) * 10; 1243 i = XFLOAT_DATA (val) * 10;
1244 f[XLFD_PIXEL_INDEX] = alloca (12); 1244 f[XLFD_PIXEL_INDEX] = p = alloca (12);
1245 len += sprintf (f[XLFD_PIXEL_INDEX], "*-%d", i) + 1; 1245 len += sprintf (p, "*-%d", i) + 1;
1246 } 1246 }
1247 else 1247 else
1248 f[XLFD_PIXEL_INDEX] = "*-*", len += 4; 1248 f[XLFD_PIXEL_INDEX] = "*-*", len += 4;
@@ -1250,9 +1250,8 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
1250 if (INTEGERP (AREF (font, FONT_DPI_INDEX))) 1250 if (INTEGERP (AREF (font, FONT_DPI_INDEX)))
1251 { 1251 {
1252 i = XINT (AREF (font, FONT_DPI_INDEX)); 1252 i = XINT (AREF (font, FONT_DPI_INDEX));
1253 f[XLFD_RESX_INDEX] = alloca (22); 1253 f[XLFD_RESX_INDEX] = p = alloca (22);
1254 len += sprintf (f[XLFD_RESX_INDEX], 1254 len += sprintf (p, "%d-%d", i, i) + 1;
1255 "%d-%d", i, i) + 1;
1256 } 1255 }
1257 else 1256 else
1258 f[XLFD_RESX_INDEX] = "*-*", len += 4; 1257 f[XLFD_RESX_INDEX] = "*-*", len += 4;
@@ -1270,8 +1269,8 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
1270 f[XLFD_SPACING_INDEX] = "*", len += 2; 1269 f[XLFD_SPACING_INDEX] = "*", len += 2;
1271 if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX))) 1270 if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX)))
1272 { 1271 {
1273 f[XLFD_AVGWIDTH_INDEX] = alloca (11); 1272 f[XLFD_AVGWIDTH_INDEX] = p = alloca (11);
1274 len += sprintf (f[XLFD_AVGWIDTH_INDEX], "%ld", 1273 len += sprintf (p, "%ld",
1275 (long) XINT (AREF (font, FONT_AVGWIDTH_INDEX))) + 1; 1274 (long) XINT (AREF (font, FONT_AVGWIDTH_INDEX))) + 1;
1276 } 1275 }
1277 else 1276 else
@@ -1448,12 +1447,10 @@ font_parse_fcname (char *name, Lisp_Object font)
1448 { 1447 {
1449 /* Either a fontconfig-style name with no size and property 1448 /* Either a fontconfig-style name with no size and property
1450 data, or a GTK-style name. */ 1449 data, or a GTK-style name. */
1451 Lisp_Object prop;
1452 Lisp_Object weight = Qnil, slant = Qnil; 1450 Lisp_Object weight = Qnil, slant = Qnil;
1453 Lisp_Object width = Qnil, size = Qnil; 1451 Lisp_Object width = Qnil, size = Qnil;
1454 char *word_start; 1452 char *word_start;
1455 int word_len; 1453 int word_len;
1456 int size_found = 0;
1457 1454
1458 /* Scan backwards from the end, looking for a size. */ 1455 /* Scan backwards from the end, looking for a size. */
1459 for (p = name + len - 1; p >= name; p--) 1456 for (p = name + len - 1; p >= name; p--)
@@ -1569,8 +1566,10 @@ font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes)
1569 point_size = -1; 1566 point_size = -1;
1570 len += 21; /* for ":pixelsize=NUM" */ 1567 len += 21; /* for ":pixelsize=NUM" */
1571 } 1568 }
1572 else if (FLOATP (val)) 1569 else
1573 { 1570 {
1571 if (! FLOATP (val))
1572 abort ();
1574 pixel_size = -1; 1573 pixel_size = -1;
1575 point_size = (int) XFLOAT_DATA (val); 1574 point_size = (int) XFLOAT_DATA (val);
1576 len += 11; /* for "-NUM" */ 1575 len += 11; /* for "-NUM" */
@@ -1604,15 +1603,15 @@ font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes)
1604 len += strlen (":scalable=false"); /* or ":scalable=true" */ 1603 len += strlen (":scalable=false"); /* or ":scalable=true" */
1605 for (tail = AREF (font, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail)) 1604 for (tail = AREF (font, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail))
1606 { 1605 {
1607 Lisp_Object key = XCAR (XCAR (tail)), val = XCDR (XCAR (tail)); 1606 Lisp_Object key = XCAR (XCAR (tail)), value = XCDR (XCAR (tail));
1608 1607
1609 len += SBYTES (SYMBOL_NAME (key)) + 1; /* for :KEY= */ 1608 len += SBYTES (SYMBOL_NAME (key)) + 1; /* for :KEY= */
1610 if (STRINGP (val)) 1609 if (STRINGP (value))
1611 len += SBYTES (val); 1610 len += SBYTES (value);
1612 else if (INTEGERP (val)) 1611 else if (INTEGERP (value))
1613 len += sprintf (work, "%ld", (long) XINT (val)); 1612 len += sprintf (work, "%ld", (long) XINT (value));
1614 else if (SYMBOLP (val)) 1613 else if (SYMBOLP (value))
1615 len += (NILP (val) ? 5 : 4); /* for "false" or "true" */ 1614 len += (NILP (value) ? 5 : 4); /* for "false" or "true" */
1616 } 1615 }
1617 1616
1618 if (len > nbytes) 1617 if (len > nbytes)
@@ -2178,7 +2177,7 @@ font_sort_entities (Lisp_Object list, Lisp_Object prefer, Lisp_Object frame, int
2178 unsigned best_score; 2177 unsigned best_score;
2179 Lisp_Object best_entity; 2178 Lisp_Object best_entity;
2180 struct frame *f = XFRAME (frame); 2179 struct frame *f = XFRAME (frame);
2181 Lisp_Object tail, vec; 2180 Lisp_Object tail, vec IF_LINT (= Qnil);
2182 USE_SAFE_ALLOCA; 2181 USE_SAFE_ALLOCA;
2183 2182
2184 for (i = FONT_WEIGHT_INDEX; i <= FONT_AVGWIDTH_INDEX; i++) 2183 for (i = FONT_WEIGHT_INDEX; i <= FONT_AVGWIDTH_INDEX; i++)
@@ -2602,7 +2601,7 @@ static Lisp_Object scratch_font_spec, scratch_font_prefer;
2602 (2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil). 2601 (2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil).
2603*/ 2602*/
2604 2603
2605Lisp_Object 2604static Lisp_Object
2606font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size) 2605font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size)
2607{ 2606{
2608 Lisp_Object entity, val; 2607 Lisp_Object entity, val;
@@ -2951,22 +2950,6 @@ font_get_name (Lisp_Object font_object)
2951} 2950}
2952 2951
2953 2952
2954/* Return the specification of FONT_OBJECT. */
2955
2956Lisp_Object
2957font_get_spec (Lisp_Object font_object)
2958{
2959 Lisp_Object spec = font_make_spec ();
2960 int i;
2961
2962 for (i = 0; i < FONT_SIZE_INDEX; i++)
2963 ASET (spec, i, AREF (font_object, i));
2964 ASET (spec, FONT_SIZE_INDEX,
2965 make_number (XFONT_OBJECT (font_object)->pixel_size));
2966 return spec;
2967}
2968
2969
2970/* Create a new font spec from FONT_NAME, and return it. If FONT_NAME 2953/* Create a new font spec from FONT_NAME, and return it. If FONT_NAME
2971 could not be parsed by font_parse_name, return Qnil. */ 2954 could not be parsed by font_parse_name, return Qnil. */
2972 2955
@@ -3436,14 +3419,13 @@ Lisp_Object
3436font_update_drivers (FRAME_PTR f, Lisp_Object new_drivers) 3419font_update_drivers (FRAME_PTR f, Lisp_Object new_drivers)
3437{ 3420{
3438 Lisp_Object active_drivers = Qnil; 3421 Lisp_Object active_drivers = Qnil;
3439 struct font_driver *driver;
3440 struct font_driver_list *list; 3422 struct font_driver_list *list;
3441 3423
3442 /* At first, turn off non-requested drivers, and turn on requested 3424 /* At first, turn off non-requested drivers, and turn on requested
3443 drivers. */ 3425 drivers. */
3444 for (list = f->font_driver_list; list; list = list->next) 3426 for (list = f->font_driver_list; list; list = list->next)
3445 { 3427 {
3446 driver = list->driver; 3428 struct font_driver *driver = list->driver;
3447 if ((EQ (new_drivers, Qt) || ! NILP (Fmemq (driver->type, new_drivers))) 3429 if ((EQ (new_drivers, Qt) || ! NILP (Fmemq (driver->type, new_drivers)))
3448 != list->on) 3430 != list->on)
3449 { 3431 {
@@ -4669,7 +4651,7 @@ the corresponding element is nil. */)
4669 Lisp_Object object) 4651 Lisp_Object object)
4670{ 4652{
4671 struct font *font; 4653 struct font *font;
4672 int i, len, c; 4654 int i, len;
4673 Lisp_Object *chars, vec; 4655 Lisp_Object *chars, vec;
4674 USE_SAFE_ALLOCA; 4656 USE_SAFE_ALLOCA;
4675 4657
@@ -4687,6 +4669,7 @@ the corresponding element is nil. */)
4687 bytepos = CHAR_TO_BYTE (charpos); 4669 bytepos = CHAR_TO_BYTE (charpos);
4688 for (i = 0; charpos < XFASTINT (to); i++) 4670 for (i = 0; charpos < XFASTINT (to); i++)
4689 { 4671 {
4672 int c;
4690 FETCH_CHAR_ADVANCE (c, charpos, bytepos); 4673 FETCH_CHAR_ADVANCE (c, charpos, bytepos);
4691 chars[i] = make_number (c); 4674 chars[i] = make_number (c);
4692 } 4675 }
@@ -4708,7 +4691,7 @@ the corresponding element is nil. */)
4708 if (STRING_MULTIBYTE (object)) 4691 if (STRING_MULTIBYTE (object))
4709 for (i = 0; i < len; i++) 4692 for (i = 0; i < len; i++)
4710 { 4693 {
4711 c = STRING_CHAR_ADVANCE (p); 4694 int c = STRING_CHAR_ADVANCE (p);
4712 chars[i] = make_number (c); 4695 chars[i] = make_number (c);
4713 } 4696 }
4714 else 4697 else
@@ -4959,7 +4942,7 @@ static Lisp_Object Vfont_log_deferred;
4959void 4942void
4960font_add_log (const char *action, Lisp_Object arg, Lisp_Object result) 4943font_add_log (const char *action, Lisp_Object arg, Lisp_Object result)
4961{ 4944{
4962 Lisp_Object tail, val; 4945 Lisp_Object val;
4963 int i; 4946 int i;
4964 4947
4965 if (EQ (Vfont_log, Qt)) 4948 if (EQ (Vfont_log, Qt))
@@ -5015,6 +4998,7 @@ font_add_log (const char *action, Lisp_Object arg, Lisp_Object result)
5015 } 4998 }
5016 else if (CONSP (result)) 4999 else if (CONSP (result))
5017 { 5000 {
5001 Lisp_Object tail;
5018 result = Fcopy_sequence (result); 5002 result = Fcopy_sequence (result);
5019 for (tail = result; CONSP (tail); tail = XCDR (tail)) 5003 for (tail = result; CONSP (tail); tail = XCDR (tail))
5020 { 5004 {
diff --git a/src/fontset.c b/src/fontset.c
index f297fd10a71..b5d8a0db434 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -233,14 +233,14 @@ fontset_id_valid_p (int id)
233/* Macros to access special values of (base) FONTSET. */ 233/* Macros to access special values of (base) FONTSET. */
234#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] 234#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1]
235#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4] 235#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4]
236#define FONTSET_SPEC(fontset) XCHAR_TABLE (fontset)->extras[5] 236/* #define FONTSET_SPEC(fontset) XCHAR_TABLE (fontset)->extras[5] */
237 237
238/* Macros to access special values of (realized) FONTSET. */ 238/* Macros to access special values of (realized) FONTSET. */
239#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2] 239#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2]
240#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3] 240#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3]
241#define FONTSET_OBJLIST(fontset) XCHAR_TABLE (fontset)->extras[4] 241#define FONTSET_OBJLIST(fontset) XCHAR_TABLE (fontset)->extras[4]
242#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5] 242#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5]
243#define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6] 243/* #define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6] */
244#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7] 244#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7]
245 245
246/* For both base and realized fontset. */ 246/* For both base and realized fontset. */
@@ -266,7 +266,6 @@ fontset_id_valid_p (int id)
266 ASET ((rfont_def), 0, make_number (face_id)) 266 ASET ((rfont_def), 0, make_number (face_id))
267#define RFONT_DEF_FONT_DEF(rfont_def) AREF (rfont_def, 1) 267#define RFONT_DEF_FONT_DEF(rfont_def) AREF (rfont_def, 1)
268#define RFONT_DEF_SPEC(rfont_def) FONT_DEF_SPEC (AREF (rfont_def, 1)) 268#define RFONT_DEF_SPEC(rfont_def) FONT_DEF_SPEC (AREF (rfont_def, 1))
269#define RFONT_DEF_REPERTORY(rfont_def) FONT_DEF_REPERTORY (AREF (rfont_def, 1))
270#define RFONT_DEF_OBJECT(rfont_def) AREF (rfont_def, 2) 269#define RFONT_DEF_OBJECT(rfont_def) AREF (rfont_def, 2)
271#define RFONT_DEF_SET_OBJECT(rfont_def, object) \ 270#define RFONT_DEF_SET_OBJECT(rfont_def, object) \
272 ASET ((rfont_def), 2, (object)) 271 ASET ((rfont_def), 2, (object))
@@ -713,7 +712,7 @@ fontset_find_font (Lisp_Object fontset, int c, struct face *face, int id, int fa
713static Lisp_Object 712static Lisp_Object
714fontset_font (Lisp_Object fontset, int c, struct face *face, int id) 713fontset_font (Lisp_Object fontset, int c, struct face *face, int id)
715{ 714{
716 Lisp_Object rfont_def, default_rfont_def; 715 Lisp_Object rfont_def, default_rfont_def IF_LINT (= Qnil);
717 Lisp_Object base_fontset; 716 Lisp_Object base_fontset;
718 717
719 /* Try a font-group of FONTSET. */ 718 /* Try a font-group of FONTSET. */
@@ -836,7 +835,7 @@ fontset_ascii (int id)
836 return elt; 835 return elt;
837} 836}
838 837
839void 838static void
840free_realized_fontset (FRAME_PTR f, Lisp_Object fontset) 839free_realized_fontset (FRAME_PTR f, Lisp_Object fontset)
841{ 840{
842 Lisp_Object tail; 841 Lisp_Object tail;
@@ -1583,14 +1582,14 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
1583 1582
1584 if (ascii_changed) 1583 if (ascii_changed)
1585 { 1584 {
1586 Lisp_Object tail, frame, alist; 1585 Lisp_Object tail, fr, alist;
1587 int fontset_id = XINT (FONTSET_ID (fontset)); 1586 int fontset_id = XINT (FONTSET_ID (fontset));
1588 1587
1589 FONTSET_ASCII (fontset) = fontname; 1588 FONTSET_ASCII (fontset) = fontname;
1590 name = FONTSET_NAME (fontset); 1589 name = FONTSET_NAME (fontset);
1591 FOR_EACH_FRAME (tail, frame) 1590 FOR_EACH_FRAME (tail, fr)
1592 { 1591 {
1593 FRAME_PTR f = XFRAME (frame); 1592 FRAME_PTR f = XFRAME (fr);
1594 Lisp_Object font_object; 1593 Lisp_Object font_object;
1595 struct face *face; 1594 struct face *face;
1596 1595
@@ -1607,7 +1606,7 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
1607 { 1606 {
1608 update_auto_fontset_alist (font_object, fontset); 1607 update_auto_fontset_alist (font_object, fontset);
1609 alist = Fcons (Fcons (Qfont, Fcons (name, font_object)), Qnil); 1608 alist = Fcons (Fcons (Qfont, Fcons (name, font_object)), Qnil);
1610 Fmodify_frame_parameters (frame, alist); 1609 Fmodify_frame_parameters (fr, alist);
1611 } 1610 }
1612 } 1611 }
1613 } 1612 }
diff --git a/src/fringe.c b/src/fringe.c
index d42d6467f31..ce75df766ee 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -913,7 +913,12 @@ update_window_fringes (struct window *w, int keep_current_p)
913 int bitmap_cache[MAX_BITMAP_CACHE]; 913 int bitmap_cache[MAX_BITMAP_CACHE];
914 int top_ind_rn, bot_ind_rn; 914 int top_ind_rn, bot_ind_rn;
915 int top_ind_min_y, bot_ind_max_y; 915 int top_ind_min_y, bot_ind_max_y;
916 int top_row_ends_at_zv_p, bot_row_ends_at_zv_p; 916
917 /* top_ind_rn is set to a nonnegative value whenver
918 row->indicate_bob_p is set, so it's OK that top_row_ends_at_zv_p
919 is not initialized here. Similarly for bot_ind_rn,
920 row->indicate_eob_p and bot_row_ends_at_zv_p. */
921 int top_row_ends_at_zv_p IF_LINT (= 0), bot_row_ends_at_zv_p IF_LINT (= 0);
917 922
918 if (w->pseudo_window_p) 923 if (w->pseudo_window_p)
919 return 0; 924 return 0;
@@ -949,18 +954,10 @@ update_window_fringes (struct window *w, int keep_current_p)
949 y < yb && rn < nrows; 954 y < yb && rn < nrows;
950 y += row->height, ++rn) 955 y += row->height, ++rn)
951 { 956 {
952 unsigned indicate_bob_p, indicate_top_line_p;
953 unsigned indicate_eob_p, indicate_bottom_line_p;
954
955 row = w->desired_matrix->rows + rn; 957 row = w->desired_matrix->rows + rn;
956 if (!row->enabled_p) 958 if (!row->enabled_p)
957 row = w->current_matrix->rows + rn; 959 row = w->current_matrix->rows + rn;
958 960
959 indicate_bob_p = row->indicate_bob_p;
960 indicate_top_line_p = row->indicate_top_line_p;
961 indicate_eob_p = row->indicate_eob_p;
962 indicate_bottom_line_p = row->indicate_bottom_line_p;
963
964 row->indicate_bob_p = row->indicate_top_line_p = 0; 961 row->indicate_bob_p = row->indicate_top_line_p = 0;
965 row->indicate_eob_p = row->indicate_bottom_line_p = 0; 962 row->indicate_eob_p = row->indicate_bottom_line_p = 0;
966 963
@@ -1380,7 +1377,7 @@ compute_fringe_widths (struct frame *f, int redraw)
1380 1377
1381/* Free resources used by a user-defined bitmap. */ 1378/* Free resources used by a user-defined bitmap. */
1382 1379
1383void 1380static void
1384destroy_fringe_bitmap (int n) 1381destroy_fringe_bitmap (int n)
1385{ 1382{
1386 struct fringe_bitmap **fbp; 1383 struct fringe_bitmap **fbp;
@@ -1448,7 +1445,7 @@ static const unsigned char swap_nibble[16] = {
1448 0x3, 0xb, 0x7, 0xf}; /* 0011 1011 0111 1111 */ 1445 0x3, 0xb, 0x7, 0xf}; /* 0011 1011 0111 1111 */
1449#endif /* HAVE_X_WINDOWS */ 1446#endif /* HAVE_X_WINDOWS */
1450 1447
1451void 1448static void
1452init_fringe_bitmap (int which, struct fringe_bitmap *fb, int once_p) 1449init_fringe_bitmap (int which, struct fringe_bitmap *fb, int once_p)
1453{ 1450{
1454 if (once_p || fb->dynamic) 1451 if (once_p || fb->dynamic)
@@ -1831,4 +1828,3 @@ w32_reset_fringes (void)
1831#endif /* HAVE_NTGUI */ 1828#endif /* HAVE_NTGUI */
1832 1829
1833#endif /* HAVE_WINDOW_SYSTEM */ 1830#endif /* HAVE_WINDOW_SYSTEM */
1834
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 6ecd5d624af..754f61e366d 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -40,6 +40,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
40#include <X11/Xft/Xft.h> 40#include <X11/Xft/Xft.h>
41#endif 41#endif
42 42
43#ifdef HAVE_GTK3
44#include <gtk/gtkx.h>
45#endif
46
43#define FRAME_TOTAL_PIXEL_HEIGHT(f) \ 47#define FRAME_TOTAL_PIXEL_HEIGHT(f) \
44 (FRAME_PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f)) 48 (FRAME_PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f))
45 49
@@ -69,8 +73,26 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
69#define remove_submenu(w) gtk_menu_item_remove_submenu ((w)) 73#define remove_submenu(w) gtk_menu_item_remove_submenu ((w))
70#endif 74#endif
71 75
76#ifndef HAVE_GTK3
77#ifdef USE_GTK_TOOLTIP
78#define gdk_window_get_screen(w) gdk_drawable_get_screen (w)
79#endif
80#define gdk_window_get_geometry(w, a, b, c, d) \
81 gdk_window_get_geometry (w, a, b, c, d, 0)
82#define gdk_x11_window_lookup_for_display(d, w) \
83 gdk_xid_table_lookup_for_display (d, w)
84#define GDK_KEY_g GDK_g
85#endif
86
72#define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x)) 87#define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x))
73 88
89/* Get the current value of the range, truncated to an integer. */
90static int
91int_gtk_range_get_value (GtkRange *range)
92{
93 return gtk_range_get_value (range);
94}
95
74 96
75/*********************************************************************** 97/***********************************************************************
76 Display handling functions 98 Display handling functions
@@ -88,7 +110,7 @@ static GdkDisplay *gdpy_def;
88static void 110static void
89xg_set_screen (GtkWidget *w, FRAME_PTR f) 111xg_set_screen (GtkWidget *w, FRAME_PTR f)
90{ 112{
91 if (FRAME_X_DISPLAY (f) != GDK_DISPLAY ()) 113 if (FRAME_X_DISPLAY (f) != DEFAULT_GDK_DISPLAY ())
92 { 114 {
93 GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); 115 GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
94 GdkScreen *gscreen = gdk_display_get_default_screen (gdpy); 116 GdkScreen *gscreen = gdk_display_get_default_screen (gdpy);
@@ -229,29 +251,55 @@ xg_create_default_cursor (Display *dpy)
229 return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR); 251 return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR);
230} 252}
231 253
254static GdkPixbuf *
255xg_get_pixbuf_from_pixmap (FRAME_PTR f, Pixmap pix)
256{
257 int iunused;
258 GdkPixbuf *tmp_buf;
259 Window wunused;
260 unsigned int width, height, uunused;
261 XImage *xim;
262
263 XGetGeometry (FRAME_X_DISPLAY (f), pix, &wunused, &iunused, &iunused,
264 &width, &height, &uunused, &uunused);
265
266 xim = XGetImage (FRAME_X_DISPLAY (f), pix, 0, 0, width, height,
267 ~0, XYPixmap);
268 if (!xim) return 0;
269
270 tmp_buf = gdk_pixbuf_new_from_data ((guchar *) xim->data,
271 GDK_COLORSPACE_RGB,
272 FALSE,
273 xim->bitmap_unit,
274 (int) width,
275 (int) height,
276 xim->bytes_per_line,
277 NULL,
278 NULL);
279 XDestroyImage (xim);
280 return tmp_buf;
281}
282
232/* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */ 283/* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */
233 284
234static GdkPixbuf * 285static GdkPixbuf *
235xg_get_pixbuf_from_pix_and_mask (GdkPixmap *gpix, 286xg_get_pixbuf_from_pix_and_mask (FRAME_PTR f,
236 GdkPixmap *gmask, 287 Pixmap pix,
237 GdkColormap *cmap) 288 Pixmap mask)
238{ 289{
239 int width, height; 290 int width, height;
240 GdkPixbuf *icon_buf, *tmp_buf; 291 GdkPixbuf *icon_buf, *tmp_buf;
241 292
242 gdk_drawable_get_size (gpix, &width, &height); 293 tmp_buf = xg_get_pixbuf_from_pixmap (f, pix);
243 tmp_buf = gdk_pixbuf_get_from_drawable (NULL, gpix, cmap,
244 0, 0, 0, 0, width, height);
245 icon_buf = gdk_pixbuf_add_alpha (tmp_buf, FALSE, 0, 0, 0); 294 icon_buf = gdk_pixbuf_add_alpha (tmp_buf, FALSE, 0, 0, 0);
246 g_object_unref (G_OBJECT (tmp_buf)); 295 g_object_unref (G_OBJECT (tmp_buf));
247 296
248 if (gmask) 297 width = gdk_pixbuf_get_width (icon_buf);
298 height = gdk_pixbuf_get_height (icon_buf);
299
300 if (mask)
249 { 301 {
250 GdkPixbuf *mask_buf = gdk_pixbuf_get_from_drawable (NULL, 302 GdkPixbuf *mask_buf = xg_get_pixbuf_from_pixmap (f, mask);
251 gmask,
252 NULL,
253 0, 0, 0, 0,
254 width, height);
255 guchar *pixels = gdk_pixbuf_get_pixels (icon_buf); 303 guchar *pixels = gdk_pixbuf_get_pixels (icon_buf);
256 guchar *mask_pixels = gdk_pixbuf_get_pixels (mask_buf); 304 guchar *mask_pixels = gdk_pixbuf_get_pixels (mask_buf);
257 int rowstride = gdk_pixbuf_get_rowstride (icon_buf); 305 int rowstride = gdk_pixbuf_get_rowstride (icon_buf);
@@ -316,10 +364,6 @@ xg_get_image_for_pixmap (FRAME_PTR f,
316 GtkWidget *widget, 364 GtkWidget *widget,
317 GtkImage *old_widget) 365 GtkImage *old_widget)
318{ 366{
319 GdkPixmap *gpix;
320 GdkPixmap *gmask;
321 GdkDisplay *gdpy;
322 GdkColormap *cmap;
323 GdkPixbuf *icon_buf; 367 GdkPixbuf *icon_buf;
324 368
325 /* If we have a file, let GTK do all the image handling. 369 /* If we have a file, let GTK do all the image handling.
@@ -347,10 +391,6 @@ xg_get_image_for_pixmap (FRAME_PTR f,
347 on a monochrome display, and sometimes bad on all displays with 391 on a monochrome display, and sometimes bad on all displays with
348 certain themes. */ 392 certain themes. */
349 393
350 gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
351 gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap);
352 gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0;
353
354 /* This is a workaround to make icons look good on pseudo color 394 /* This is a workaround to make icons look good on pseudo color
355 displays. Apparently GTK expects the images to have an alpha 395 displays. Apparently GTK expects the images to have an alpha
356 channel. If they don't, insensitive and activated icons will 396 channel. If they don't, insensitive and activated icons will
@@ -360,18 +400,17 @@ xg_get_image_for_pixmap (FRAME_PTR f,
360 not associated with the img->pixmap. The img->pixmap may be removed 400 not associated with the img->pixmap. The img->pixmap may be removed
361 by clearing the image cache and then the tool bar redraw fails, since 401 by clearing the image cache and then the tool bar redraw fails, since
362 Gtk+ assumes the pixmap is always there. */ 402 Gtk+ assumes the pixmap is always there. */
363 cmap = gtk_widget_get_colormap (widget); 403 icon_buf = xg_get_pixbuf_from_pix_and_mask (f, img->pixmap, img->mask);
364 icon_buf = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap);
365 404
366 if (! old_widget) 405 if (icon_buf)
367 old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf)); 406 {
368 else 407 if (! old_widget)
369 gtk_image_set_from_pixbuf (old_widget, icon_buf); 408 old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf));
370 409 else
371 g_object_unref (G_OBJECT (icon_buf)); 410 gtk_image_set_from_pixbuf (old_widget, icon_buf);
372 411
373 g_object_unref (G_OBJECT (gpix)); 412 g_object_unref (G_OBJECT (icon_buf));
374 if (gmask) g_object_unref (G_OBJECT (gmask)); 413 }
375 414
376 return GTK_WIDGET (old_widget); 415 return GTK_WIDGET (old_widget);
377} 416}
@@ -455,22 +494,22 @@ get_utf8_string (const char *str)
455 gsize bytes_written; 494 gsize bytes_written;
456 unsigned char *p = (unsigned char *)str; 495 unsigned char *p = (unsigned char *)str;
457 char *cp, *up; 496 char *cp, *up;
458 GError *error = NULL; 497 GError *err = NULL;
459 498
460 while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read, 499 while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read,
461 &bytes_written, &error)) 500 &bytes_written, &err))
462 && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE) 501 && err->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
463 { 502 {
464 ++nr_bad; 503 ++nr_bad;
465 p += bytes_written+1; 504 p += bytes_written+1;
466 g_error_free (error); 505 g_error_free (err);
467 error = NULL; 506 err = NULL;
468 } 507 }
469 508
470 if (error) 509 if (err)
471 { 510 {
472 g_error_free (error); 511 g_error_free (err);
473 error = NULL; 512 err = NULL;
474 } 513 }
475 if (cp) g_free (cp); 514 if (cp) g_free (cp);
476 515
@@ -478,16 +517,16 @@ get_utf8_string (const char *str)
478 p = (unsigned char *)str; 517 p = (unsigned char *)str;
479 518
480 while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read, 519 while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read,
481 &bytes_written, &error)) 520 &bytes_written, &err))
482 && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE) 521 && err->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
483 { 522 {
484 strncpy (up, (char *)p, bytes_written); 523 strncpy (up, (char *)p, bytes_written);
485 sprintf (up + bytes_written, "\\%03o", p[bytes_written]); 524 sprintf (up + bytes_written, "\\%03o", p[bytes_written]);
486 up[bytes_written+4] = '\0'; 525 up[bytes_written+4] = '\0';
487 up += bytes_written+4; 526 up += bytes_written+4;
488 p += bytes_written+1; 527 p += bytes_written+1;
489 g_error_free (error); 528 g_error_free (err);
490 error = NULL; 529 err = NULL;
491 } 530 }
492 531
493 if (cp) 532 if (cp)
@@ -495,10 +534,10 @@ get_utf8_string (const char *str)
495 strcat (utf8_str, cp); 534 strcat (utf8_str, cp);
496 g_free (cp); 535 g_free (cp);
497 } 536 }
498 if (error) 537 if (err)
499 { 538 {
500 g_error_free (error); 539 g_error_free (err);
501 error = NULL; 540 err = NULL;
502 } 541 }
503 } 542 }
504 return utf8_str; 543 return utf8_str;
@@ -514,28 +553,43 @@ xg_check_special_colors (struct frame *f,
514 XColor *color) 553 XColor *color)
515{ 554{
516 int success_p = 0; 555 int success_p = 0;
517 if (FRAME_GTK_WIDGET (f)) 556 int get_bg = strcmp ("gtk_selection_bg_color", color_name) == 0;
518 { 557 int get_fg = !get_bg && strcmp ("gtk_selection_fg_color", color_name) == 0;
519 if (strcmp ("gtk_selection_bg_color", color_name) == 0)
520 {
521 GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f));
522 color->red = gsty->bg[GTK_STATE_SELECTED].red;
523 color->green = gsty->bg[GTK_STATE_SELECTED].green;
524 color->blue = gsty->bg[GTK_STATE_SELECTED].blue;
525 color->pixel = gsty->bg[GTK_STATE_SELECTED].pixel;
526 success_p = 1;
527 }
528 else if (strcmp ("gtk_selection_fg_color", color_name) == 0)
529 {
530 GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f));
531 color->red = gsty->fg[GTK_STATE_SELECTED].red;
532 color->green = gsty->fg[GTK_STATE_SELECTED].green;
533 color->blue = gsty->fg[GTK_STATE_SELECTED].blue;
534 color->pixel = gsty->fg[GTK_STATE_SELECTED].pixel;
535 success_p = 1;
536 }
537 }
538 558
559 if (! FRAME_GTK_WIDGET (f) || ! (get_bg || get_fg))
560 return success_p;
561
562 BLOCK_INPUT;
563 {
564#ifdef HAVE_GTK3
565 GtkStyleContext *gsty
566 = gtk_widget_get_style_context (FRAME_GTK_OUTER_WIDGET (f));
567 GdkRGBA col;
568 char buf[64];
569 int state = GTK_STATE_FLAG_SELECTED|GTK_STATE_FLAG_FOCUSED;
570 if (get_fg)
571 gtk_style_context_get_color (gsty, state, &col);
572 else
573 gtk_style_context_get_background_color (gsty, state, &col);
574
575 sprintf (buf, "rgbi:%lf/%lf/%lf", col.red, col.green, col.blue);
576 success_p = XParseColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f),
577 buf, color);
578#else
579 GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f));
580 GdkColor *grgb = get_bg
581 ? &gsty->bg[GTK_STATE_SELECTED]
582 : &gsty->fg[GTK_STATE_SELECTED];
583
584 color->red = grgb->red;
585 color->green = grgb->green;
586 color->blue = grgb->blue;
587 color->pixel = grgb->pixel;
588 success_p = 1;
589#endif
590
591 }
592 UNBLOCK_INPUT;
539 return success_p; 593 return success_p;
540} 594}
541 595
@@ -629,7 +683,7 @@ xg_prepare_tooltip (FRAME_PTR f,
629 encoded_string = ENCODE_UTF_8 (string); 683 encoded_string = ENCODE_UTF_8 (string);
630 widget = GTK_WIDGET (x->ttip_lbl); 684 widget = GTK_WIDGET (x->ttip_lbl);
631 gwin = gtk_widget_get_window (GTK_WIDGET (x->ttip_window)); 685 gwin = gtk_widget_get_window (GTK_WIDGET (x->ttip_window));
632 screen = gdk_drawable_get_screen (gwin); 686 screen = gdk_window_get_screen (gwin);
633 settings = gtk_settings_get_for_screen (screen); 687 settings = gtk_settings_get_for_screen (screen);
634 g_object_get (settings, "gtk-enable-tooltips", &tt_enabled, NULL); 688 g_object_get (settings, "gtk-enable-tooltips", &tt_enabled, NULL);
635 if (tt_enabled) 689 if (tt_enabled)
@@ -650,7 +704,7 @@ xg_prepare_tooltip (FRAME_PTR f,
650 gtk_tooltip_set_custom (x->ttip_widget, widget); 704 gtk_tooltip_set_custom (x->ttip_widget, widget);
651 705
652 gtk_tooltip_set_text (x->ttip_widget, SDATA (encoded_string)); 706 gtk_tooltip_set_text (x->ttip_widget, SDATA (encoded_string));
653 gtk_widget_size_request (GTK_WIDGET (x->ttip_window), &req); 707 gtk_widget_get_preferred_size (GTK_WIDGET (x->ttip_window), NULL, &req);
654 if (width) *width = req.width; 708 if (width) *width = req.width;
655 if (height) *height = req.height; 709 if (height) *height = req.height;
656 710
@@ -696,7 +750,7 @@ xg_hide_tooltip (FRAME_PTR f)
696 if (g_object_get_data (G_OBJECT (win), "restore-tt")) 750 if (g_object_get_data (G_OBJECT (win), "restore-tt"))
697 { 751 {
698 GdkWindow *gwin = gtk_widget_get_window (GTK_WIDGET (win)); 752 GdkWindow *gwin = gtk_widget_get_window (GTK_WIDGET (win));
699 GdkScreen *screen = gdk_drawable_get_screen (gwin); 753 GdkScreen *screen = gdk_window_get_screen (gwin);
700 GtkSettings *settings = gtk_settings_get_for_screen (screen); 754 GtkSettings *settings = gtk_settings_get_for_screen (screen);
701 g_object_set (settings, "gtk-enable-tooltips", TRUE, NULL); 755 g_object_set (settings, "gtk-enable-tooltips", TRUE, NULL);
702 } 756 }
@@ -797,7 +851,7 @@ xg_frame_resized (FRAME_PTR f, int pixelwidth, int pixelheight)
797 if (FRAME_GTK_WIDGET (f) && gtk_widget_get_mapped (FRAME_GTK_WIDGET (f))) 851 if (FRAME_GTK_WIDGET (f) && gtk_widget_get_mapped (FRAME_GTK_WIDGET (f)))
798 gdk_window_get_geometry (gtk_widget_get_window (FRAME_GTK_WIDGET (f)), 852 gdk_window_get_geometry (gtk_widget_get_window (FRAME_GTK_WIDGET (f)),
799 0, 0, 853 0, 0,
800 &pixelwidth, &pixelheight, 0); 854 &pixelwidth, &pixelheight);
801 else return; 855 else return;
802 } 856 }
803 857
@@ -910,8 +964,8 @@ xg_win_to_widget (Display *dpy, Window wdesc)
910 964
911 BLOCK_INPUT; 965 BLOCK_INPUT;
912 966
913 gdkwin = gdk_xid_table_lookup_for_display (gdk_x11_lookup_xdisplay (dpy), 967 gdkwin = gdk_x11_window_lookup_for_display (gdk_x11_lookup_xdisplay (dpy),
914 wdesc); 968 wdesc);
915 if (gdkwin) 969 if (gdkwin)
916 { 970 {
917 GdkEvent event; 971 GdkEvent event;
@@ -923,14 +977,29 @@ xg_win_to_widget (Display *dpy, Window wdesc)
923 return gwdesc; 977 return gwdesc;
924} 978}
925 979
926/* Fill in the GdkColor C so that it represents PIXEL. 980/* Set the background of widget W to PIXEL. */
927 W is the widget that color will be used for. Used to find colormap. */
928 981
929static void 982static void
930xg_pix_to_gcolor (GtkWidget *w, long unsigned int pixel, GdkColor *c) 983xg_set_widget_bg (FRAME_PTR f, GtkWidget *w, long unsigned int pixel)
931{ 984{
985#ifdef HAVE_GTK3
986 GdkRGBA bg;
987 XColor xbg;
988 xbg.pixel = pixel;
989 if (XQueryColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), &xbg))
990 {
991 bg.red = (double)xbg.red/65536.0;
992 bg.green = (double)xbg.green/65536.0;
993 bg.blue = (double)xbg.blue/65536.0;
994 bg.alpha = 1.0;
995 gtk_widget_override_background_color (w, GTK_STATE_FLAG_NORMAL, &bg);
996 }
997#else
998 GdkColor bg;
932 GdkColormap *map = gtk_widget_get_colormap (w); 999 GdkColormap *map = gtk_widget_get_colormap (w);
933 gdk_colormap_query_color (map, pixel, c); 1000 gdk_colormap_query_color (map, pixel, &bg);
1001 gtk_widget_modify_bg (FRAME_GTK_WIDGET (f), GTK_STATE_NORMAL, &bg);
1002#endif
934} 1003}
935 1004
936/* Callback called when the gtk theme changes. 1005/* Callback called when the gtk theme changes.
@@ -953,6 +1022,28 @@ style_changed_cb (GObject *go,
953 kbd_buffer_store_event (&event); 1022 kbd_buffer_store_event (&event);
954} 1023}
955 1024
1025/* Called when a delete-event occurs on WIDGET. */
1026
1027static gboolean
1028delete_cb (GtkWidget *widget,
1029 GdkEvent *event,
1030 gpointer user_data)
1031{
1032#ifdef HAVE_GTK3
1033 /* The event doesn't arrive in the normal event loop. Send event
1034 here. */
1035 FRAME_PTR f = (FRAME_PTR) user_data;
1036 struct input_event ie;
1037
1038 EVENT_INIT (ie);
1039 ie.kind = DELETE_WINDOW_EVENT;
1040 XSETFRAME (ie.frame_or_window, f);
1041 kbd_buffer_store_event (&ie);
1042#endif
1043
1044 return TRUE;
1045}
1046
956/* Create and set up the GTK widgets for frame F. 1047/* Create and set up the GTK widgets for frame F.
957 Return 0 if creation failed, non-zero otherwise. */ 1048 Return 0 if creation failed, non-zero otherwise. */
958 1049
@@ -962,7 +1053,6 @@ xg_create_frame_widgets (FRAME_PTR f)
962 GtkWidget *wtop; 1053 GtkWidget *wtop;
963 GtkWidget *wvbox, *whbox; 1054 GtkWidget *wvbox, *whbox;
964 GtkWidget *wfixed; 1055 GtkWidget *wfixed;
965 GdkColor bg;
966 GtkRcStyle *style; 1056 GtkRcStyle *style;
967 char *title = 0; 1057 char *title = 0;
968 1058
@@ -1029,7 +1119,7 @@ xg_create_frame_widgets (FRAME_PTR f)
1029 /* Add callback to do nothing on WM_DELETE_WINDOW. The default in 1119 /* Add callback to do nothing on WM_DELETE_WINDOW. The default in
1030 GTK is to destroy the widget. We want Emacs to do that instead. */ 1120 GTK is to destroy the widget. We want Emacs to do that instead. */
1031 g_signal_connect (G_OBJECT (wtop), "delete-event", 1121 g_signal_connect (G_OBJECT (wtop), "delete-event",
1032 G_CALLBACK (gtk_true), 0); 1122 G_CALLBACK (delete_cb), f);
1033 1123
1034 /* Convert our geometry parameters into a geometry string 1124 /* Convert our geometry parameters into a geometry string
1035 and specify it. 1125 and specify it.
@@ -1057,9 +1147,9 @@ xg_create_frame_widgets (FRAME_PTR f)
1057 1147
1058 /* Since GTK clears its window by filling with the background color, 1148 /* Since GTK clears its window by filling with the background color,
1059 we must keep X and GTK background in sync. */ 1149 we must keep X and GTK background in sync. */
1060 xg_pix_to_gcolor (wfixed, FRAME_BACKGROUND_PIXEL (f), &bg); 1150 xg_set_widget_bg (f, wfixed, FRAME_BACKGROUND_PIXEL (f));
1061 gtk_widget_modify_bg (wfixed, GTK_STATE_NORMAL, &bg);
1062 1151
1152#ifndef HAVE_GTK3
1063 /* Also, do not let any background pixmap to be set, this looks very 1153 /* Also, do not let any background pixmap to be set, this looks very
1064 bad as Emacs overwrites the background pixmap with its own idea 1154 bad as Emacs overwrites the background pixmap with its own idea
1065 of background color. */ 1155 of background color. */
@@ -1068,6 +1158,9 @@ xg_create_frame_widgets (FRAME_PTR f)
1068 /* Must use g_strdup because gtk_widget_modify_style does g_free. */ 1158 /* Must use g_strdup because gtk_widget_modify_style does g_free. */
1069 style->bg_pixmap_name[GTK_STATE_NORMAL] = g_strdup ("<none>"); 1159 style->bg_pixmap_name[GTK_STATE_NORMAL] = g_strdup ("<none>");
1070 gtk_widget_modify_style (wfixed, style); 1160 gtk_widget_modify_style (wfixed, style);
1161#else
1162 gtk_widget_set_can_focus (wfixed, TRUE);
1163#endif
1071 1164
1072#ifdef USE_GTK_TOOLTIP 1165#ifdef USE_GTK_TOOLTIP
1073 /* Steal a tool tip window we can move ourselves. */ 1166 /* Steal a tool tip window we can move ourselves. */
@@ -1104,7 +1197,9 @@ xg_free_frame_widgets (FRAME_PTR f)
1104{ 1197{
1105 if (FRAME_GTK_OUTER_WIDGET (f)) 1198 if (FRAME_GTK_OUTER_WIDGET (f))
1106 { 1199 {
1200#ifdef USE_GTK_TOOLTIP
1107 struct x_output *x = f->output_data.x; 1201 struct x_output *x = f->output_data.x;
1202#endif
1108 gtk_widget_destroy (FRAME_GTK_OUTER_WIDGET (f)); 1203 gtk_widget_destroy (FRAME_GTK_OUTER_WIDGET (f));
1109 FRAME_X_WINDOW (f) = 0; /* Set to avoid XDestroyWindow in xterm.c */ 1204 FRAME_X_WINDOW (f) = 0; /* Set to avoid XDestroyWindow in xterm.c */
1110 FRAME_GTK_OUTER_WIDGET (f) = 0; 1205 FRAME_GTK_OUTER_WIDGET (f) = 0;
@@ -1224,11 +1319,8 @@ xg_set_background_color (FRAME_PTR f, long unsigned int bg)
1224{ 1319{
1225 if (FRAME_GTK_WIDGET (f)) 1320 if (FRAME_GTK_WIDGET (f))
1226 { 1321 {
1227 GdkColor gdk_bg;
1228
1229 BLOCK_INPUT; 1322 BLOCK_INPUT;
1230 xg_pix_to_gcolor (FRAME_GTK_WIDGET (f), bg, &gdk_bg); 1323 xg_set_widget_bg (f, FRAME_GTK_WIDGET (f), FRAME_BACKGROUND_PIXEL (f));
1231 gtk_widget_modify_bg (FRAME_GTK_WIDGET (f), GTK_STATE_NORMAL, &gdk_bg);
1232 UNBLOCK_INPUT; 1324 UNBLOCK_INPUT;
1233 } 1325 }
1234} 1326}
@@ -1240,11 +1332,10 @@ xg_set_background_color (FRAME_PTR f, long unsigned int bg)
1240void 1332void
1241xg_set_frame_icon (FRAME_PTR f, Pixmap icon_pixmap, Pixmap icon_mask) 1333xg_set_frame_icon (FRAME_PTR f, Pixmap icon_pixmap, Pixmap icon_mask)
1242{ 1334{
1243 GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); 1335 GdkPixbuf *gp = xg_get_pixbuf_from_pix_and_mask (f,
1244 GdkPixmap *gpix = gdk_pixmap_foreign_new_for_display (gdpy, icon_pixmap); 1336 icon_pixmap,
1245 GdkPixmap *gmask = gdk_pixmap_foreign_new_for_display (gdpy, icon_mask); 1337 icon_mask);
1246 GdkPixbuf *gp = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, NULL); 1338 if (gp)
1247
1248 gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), gp); 1339 gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), gp);
1249} 1340}
1250 1341
@@ -1326,8 +1417,6 @@ create_dialog (widget_value *wv,
1326 GtkDialog *wd = GTK_DIALOG (wdialog); 1417 GtkDialog *wd = GTK_DIALOG (wdialog);
1327 GtkBox *cur_box = GTK_BOX (gtk_dialog_get_action_area (wd)); 1418 GtkBox *cur_box = GTK_BOX (gtk_dialog_get_action_area (wd));
1328 widget_value *item; 1419 widget_value *item;
1329 GtkWidget *wvbox;
1330 GtkWidget *whbox_up;
1331 GtkWidget *whbox_down; 1420 GtkWidget *whbox_down;
1332 1421
1333 /* If the number of buttons is greater than 4, make two rows of buttons 1422 /* If the number of buttons is greater than 4, make two rows of buttons
@@ -1343,8 +1432,8 @@ create_dialog (widget_value *wv,
1343 1432
1344 if (make_two_rows) 1433 if (make_two_rows)
1345 { 1434 {
1346 wvbox = gtk_vbox_new (TRUE, button_spacing); 1435 GtkWidget *wvbox = gtk_vbox_new (TRUE, button_spacing);
1347 whbox_up = gtk_hbox_new (FALSE, 0); 1436 GtkWidget *whbox_up = gtk_hbox_new (FALSE, 0);
1348 whbox_down = gtk_hbox_new (FALSE, 0); 1437 whbox_down = gtk_hbox_new (FALSE, 0);
1349 1438
1350 gtk_box_pack_start (cur_box, wvbox, FALSE, FALSE, 0); 1439 gtk_box_pack_start (cur_box, wvbox, FALSE, FALSE, 0);
@@ -1381,7 +1470,7 @@ create_dialog (widget_value *wv,
1381 /* Try to make dialog look better. Must realize first so 1470 /* Try to make dialog look better. Must realize first so
1382 the widget can calculate the size it needs. */ 1471 the widget can calculate the size it needs. */
1383 gtk_widget_realize (w); 1472 gtk_widget_realize (w);
1384 gtk_widget_size_request (w, &req); 1473 gtk_widget_get_preferred_size (w, NULL, &req);
1385 gtk_box_set_spacing (wvbox, req.height); 1474 gtk_box_set_spacing (wvbox, req.height);
1386 if (item->value && strlen (item->value) > 0) 1475 if (item->value && strlen (item->value) > 0)
1387 button_spacing = 2*req.width/strlen (item->value); 1476 button_spacing = 2*req.width/strlen (item->value);
@@ -1613,7 +1702,7 @@ xg_get_file_with_chooser (FRAME_PTR f,
1613 int mustmatch_p, int only_dir_p, 1702 int mustmatch_p, int only_dir_p,
1614 xg_get_file_func *func) 1703 xg_get_file_func *func)
1615{ 1704{
1616 char message[1024]; 1705 char msgbuf[1024];
1617 1706
1618 GtkWidget *filewin, *wtoggle, *wbox, *wmessage; 1707 GtkWidget *filewin, *wtoggle, *wbox, *wmessage;
1619 GtkWindow *gwin = GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)); 1708 GtkWindow *gwin = GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f));
@@ -1649,16 +1738,16 @@ xg_get_file_with_chooser (FRAME_PTR f,
1649 1738
1650 if (x_gtk_file_dialog_help_text) 1739 if (x_gtk_file_dialog_help_text)
1651 { 1740 {
1652 message[0] = '\0'; 1741 msgbuf[0] = '\0';
1653 /* Gtk+ 2.10 has the file name text entry box integrated in the dialog. 1742 /* Gtk+ 2.10 has the file name text entry box integrated in the dialog.
1654 Show the C-l help text only for versions < 2.10. */ 1743 Show the C-l help text only for versions < 2.10. */
1655 if (gtk_check_version (2, 10, 0) && action != GTK_FILE_CHOOSER_ACTION_SAVE) 1744 if (gtk_check_version (2, 10, 0) && action != GTK_FILE_CHOOSER_ACTION_SAVE)
1656 strcat (message, "\nType C-l to display a file name text entry box.\n"); 1745 strcat (msgbuf, "\nType C-l to display a file name text entry box.\n");
1657 strcat (message, "\nIf you don't like this file selector, use the " 1746 strcat (msgbuf, "\nIf you don't like this file selector, use the "
1658 "corresponding\nkey binding or customize " 1747 "corresponding\nkey binding or customize "
1659 "use-file-dialog to turn it off."); 1748 "use-file-dialog to turn it off.");
1660 1749
1661 wmessage = gtk_label_new (message); 1750 wmessage = gtk_label_new (msgbuf);
1662 gtk_widget_show (wmessage); 1751 gtk_widget_show (wmessage);
1663 } 1752 }
1664 1753
@@ -3028,7 +3117,7 @@ menubar_map_cb (GtkWidget *w, gpointer user_data)
3028{ 3117{
3029 GtkRequisition req; 3118 GtkRequisition req;
3030 FRAME_PTR f = (FRAME_PTR) user_data; 3119 FRAME_PTR f = (FRAME_PTR) user_data;
3031 gtk_widget_size_request (w, &req); 3120 gtk_widget_get_preferred_size (w, NULL, &req);
3032 if (FRAME_MENUBAR_HEIGHT (f) != req.height) 3121 if (FRAME_MENUBAR_HEIGHT (f) != req.height)
3033 { 3122 {
3034 FRAME_MENUBAR_HEIGHT (f) = req.height; 3123 FRAME_MENUBAR_HEIGHT (f) = req.height;
@@ -3059,7 +3148,7 @@ xg_update_frame_menubar (FRAME_PTR f)
3059 3148
3060 g_signal_connect (x->menubar_widget, "map", G_CALLBACK (menubar_map_cb), f); 3149 g_signal_connect (x->menubar_widget, "map", G_CALLBACK (menubar_map_cb), f);
3061 gtk_widget_show_all (x->menubar_widget); 3150 gtk_widget_show_all (x->menubar_widget);
3062 gtk_widget_size_request (x->menubar_widget, &req); 3151 gtk_widget_get_preferred_size (x->menubar_widget, NULL, &req);
3063 3152
3064 /* If menu bar doesn't know its height yet, cheat a little so the frame 3153 /* If menu bar doesn't know its height yet, cheat a little so the frame
3065 doesn't jump so much when resized later in menubar_map_cb. */ 3154 doesn't jump so much when resized later in menubar_map_cb. */
@@ -3120,7 +3209,7 @@ xg_event_is_for_menubar (FRAME_PTR f, XEvent *event)
3120 return 0; 3209 return 0;
3121 3210
3122 gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); 3211 gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
3123 gw = gdk_xid_table_lookup_for_display (gdpy, event->xbutton.window); 3212 gw = gdk_x11_window_lookup_for_display (gdpy, event->xbutton.window);
3124 if (! gw) return 0; 3213 if (! gw) return 0;
3125 gevent.any.window = gw; 3214 gevent.any.window = gw;
3126 gwdesc = gtk_get_event_widget (&gevent); 3215 gwdesc = gtk_get_event_widget (&gevent);
@@ -3284,8 +3373,12 @@ xg_create_scroll_bar (FRAME_PTR f,
3284{ 3373{
3285 GtkWidget *wscroll; 3374 GtkWidget *wscroll;
3286 GtkWidget *webox; 3375 GtkWidget *webox;
3287 GtkObject *vadj;
3288 int scroll_id; 3376 int scroll_id;
3377#ifdef HAVE_GTK3
3378 GtkAdjustment *vadj;
3379#else
3380 GtkObject *vadj;
3381#endif
3289 3382
3290 /* Page, step increment values are not so important here, they 3383 /* Page, step increment values are not so important here, they
3291 will be corrected in x_set_toolkit_scroll_bar_thumb. */ 3384 will be corrected in x_set_toolkit_scroll_bar_thumb. */
@@ -3295,7 +3388,9 @@ xg_create_scroll_bar (FRAME_PTR f,
3295 wscroll = gtk_vscrollbar_new (GTK_ADJUSTMENT (vadj)); 3388 wscroll = gtk_vscrollbar_new (GTK_ADJUSTMENT (vadj));
3296 webox = gtk_event_box_new (); 3389 webox = gtk_event_box_new ();
3297 gtk_widget_set_name (wscroll, scroll_bar_name); 3390 gtk_widget_set_name (wscroll, scroll_bar_name);
3391#ifndef HAVE_GTK3
3298 gtk_range_set_update_policy (GTK_RANGE (wscroll), GTK_UPDATE_CONTINUOUS); 3392 gtk_range_set_update_policy (GTK_RANGE (wscroll), GTK_UPDATE_CONTINUOUS);
3393#endif
3299 g_object_set_data (G_OBJECT (wscroll), XG_FRAME_DATA, (gpointer)f); 3394 g_object_set_data (G_OBJECT (wscroll), XG_FRAME_DATA, (gpointer)f);
3300 3395
3301 scroll_id = xg_store_widget_in_map (wscroll); 3396 scroll_id = xg_store_widget_in_map (wscroll);
@@ -3474,7 +3569,7 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
3474 changed = 1; 3569 changed = 1;
3475 } 3570 }
3476 3571
3477 if (changed || (int) gtk_range_get_value (GTK_RANGE (wscroll)) != value) 3572 if (changed || int_gtk_range_get_value (GTK_RANGE (wscroll)) != value)
3478 { 3573 {
3479 BLOCK_INPUT; 3574 BLOCK_INPUT;
3480 3575
@@ -3482,7 +3577,7 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
3482 ignore_gtk_scrollbar to make the callback do nothing */ 3577 ignore_gtk_scrollbar to make the callback do nothing */
3483 xg_ignore_gtk_scrollbar = 1; 3578 xg_ignore_gtk_scrollbar = 1;
3484 3579
3485 if ((int) gtk_range_get_value (GTK_RANGE (wscroll)) != value) 3580 if (int_gtk_range_get_value (GTK_RANGE (wscroll)) != value)
3486 gtk_range_set_value (GTK_RANGE (wscroll), (gdouble)value); 3581 gtk_range_set_value (GTK_RANGE (wscroll), (gdouble)value);
3487 else if (changed) 3582 else if (changed)
3488 gtk_adjustment_changed (adj); 3583 gtk_adjustment_changed (adj);
@@ -3578,8 +3673,8 @@ xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
3578{ 3673{
3579 /* The EMACS_INT cast avoids a warning. */ 3674 /* The EMACS_INT cast avoids a warning. */
3580 int idx = (int) (EMACS_INT) client_data; 3675 int idx = (int) (EMACS_INT) client_data;
3581 int mod = (int) (EMACS_INT) g_object_get_data (G_OBJECT (w), 3676 gpointer gmod = g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER);
3582 XG_TOOL_BAR_LAST_MODIFIER); 3677 int mod = (int) (EMACS_INT) gmod;
3583 3678
3584 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); 3679 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
3585 Lisp_Object key, frame; 3680 Lisp_Object key, frame;
@@ -3793,8 +3888,8 @@ xg_tool_bar_detach_callback (GtkHandleBox *wbox,
3793 { 3888 {
3794 GtkRequisition req, req2; 3889 GtkRequisition req, req2;
3795 FRAME_X_OUTPUT (f)->toolbar_detached = 1; 3890 FRAME_X_OUTPUT (f)->toolbar_detached = 1;
3796 gtk_widget_size_request (GTK_WIDGET (wbox), &req); 3891 gtk_widget_get_preferred_size (GTK_WIDGET (wbox), NULL, &req);
3797 gtk_widget_size_request (w, &req2); 3892 gtk_widget_get_preferred_size (w, NULL, &req2);
3798 req.width -= req2.width; 3893 req.width -= req2.width;
3799 req.height -= req2.height; 3894 req.height -= req2.height;
3800 if (FRAME_TOOLBAR_TOP_HEIGHT (f) != 0) 3895 if (FRAME_TOOLBAR_TOP_HEIGHT (f) != 0)
@@ -3828,8 +3923,8 @@ xg_tool_bar_attach_callback (GtkHandleBox *wbox,
3828 { 3923 {
3829 GtkRequisition req, req2; 3924 GtkRequisition req, req2;
3830 FRAME_X_OUTPUT (f)->toolbar_detached = 0; 3925 FRAME_X_OUTPUT (f)->toolbar_detached = 0;
3831 gtk_widget_size_request (GTK_WIDGET (wbox), &req); 3926 gtk_widget_get_preferred_size (GTK_WIDGET (wbox), NULL, &req);
3832 gtk_widget_size_request (w, &req2); 3927 gtk_widget_get_preferred_size (w, NULL, &req2);
3833 req.width += req2.width; 3928 req.width += req2.width;
3834 req.height += req2.height; 3929 req.height += req2.height;
3835 if (FRAME_TOOLBAR_TOP_HEIGHT (f) != 0) 3930 if (FRAME_TOOLBAR_TOP_HEIGHT (f) != 0)
@@ -3894,6 +3989,7 @@ xg_tool_bar_help_callback (GtkWidget *w,
3894 3989
3895 Returns FALSE to tell GTK to keep processing this event. */ 3990 Returns FALSE to tell GTK to keep processing this event. */
3896 3991
3992#ifndef HAVE_GTK3
3897static gboolean 3993static gboolean
3898xg_tool_bar_item_expose_callback (GtkWidget *w, 3994xg_tool_bar_item_expose_callback (GtkWidget *w,
3899 GdkEventExpose *event, 3995 GdkEventExpose *event,
@@ -3902,7 +3998,6 @@ xg_tool_bar_item_expose_callback (GtkWidget *w,
3902 gint width, height; 3998 gint width, height;
3903 3999
3904 gdk_drawable_get_size (event->window, &width, &height); 4000 gdk_drawable_get_size (event->window, &width, &height);
3905
3906 event->area.x -= width > event->area.width ? width-event->area.width : 0; 4001 event->area.x -= width > event->area.width ? width-event->area.width : 0;
3907 event->area.y -= height > event->area.height ? height-event->area.height : 0; 4002 event->area.y -= height > event->area.height ? height-event->area.height : 0;
3908 4003
@@ -3914,6 +4009,7 @@ xg_tool_bar_item_expose_callback (GtkWidget *w,
3914 4009
3915 return FALSE; 4010 return FALSE;
3916} 4011}
4012#endif
3917 4013
3918#ifdef HAVE_GTK_ORIENTABLE_SET_ORIENTATION 4014#ifdef HAVE_GTK_ORIENTABLE_SET_ORIENTATION
3919#define toolbar_set_orientation(w, o) \ 4015#define toolbar_set_orientation(w, o) \
@@ -4063,13 +4159,14 @@ xg_make_tool_item (FRAME_PTR f,
4063 4159
4064 g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f); 4160 g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f);
4065 4161
4162#ifndef HAVE_GTK3
4066 /* Catch expose events to overcome an annoying redraw bug, see 4163 /* Catch expose events to overcome an annoying redraw bug, see
4067 comment for xg_tool_bar_item_expose_callback. */ 4164 comment for xg_tool_bar_item_expose_callback. */
4068 g_signal_connect (G_OBJECT (ti), 4165 g_signal_connect (G_OBJECT (ti),
4069 "expose-event", 4166 "expose-event",
4070 G_CALLBACK (xg_tool_bar_item_expose_callback), 4167 G_CALLBACK (xg_tool_bar_item_expose_callback),
4071 0); 4168 0);
4072 4169#endif
4073 gtk_tool_item_set_homogeneous (ti, FALSE); 4170 gtk_tool_item_set_homogeneous (ti, FALSE);
4074 4171
4075 /* Callback to save modifyer mask (Shift/Control, etc). GTK makes 4172 /* Callback to save modifyer mask (Shift/Control, etc). GTK makes
@@ -4128,9 +4225,9 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
4128 } 4225 }
4129 else 4226 else
4130 { 4227 {
4131 Pixmap old_img 4228 gpointer gold_img = g_object_get_data (G_OBJECT (wimage),
4132 = (Pixmap) g_object_get_data (G_OBJECT (wimage), 4229 XG_TOOL_BAR_IMAGE_DATA);
4133 XG_TOOL_BAR_IMAGE_DATA); 4230 Pixmap old_img = (Pixmap) gold_img;
4134 if (old_img != img->pixmap) 4231 if (old_img != img->pixmap)
4135 return 1; 4232 return 1;
4136 } 4233 }
@@ -4153,7 +4250,7 @@ xg_update_tool_bar_sizes (FRAME_PTR f)
4153 GtkRequisition req; 4250 GtkRequisition req;
4154 int nl = 0, nr = 0, nt = 0, nb = 0; 4251 int nl = 0, nr = 0, nt = 0, nb = 0;
4155 4252
4156 gtk_widget_size_request (GTK_WIDGET (x->handlebox_widget), &req); 4253 gtk_widget_get_preferred_size (GTK_WIDGET (x->handlebox_widget), NULL, &req);
4157 if (x->toolbar_in_hbox) 4254 if (x->toolbar_in_hbox)
4158 { 4255 {
4159 int pos; 4256 int pos;
@@ -4203,7 +4300,6 @@ update_frame_tool_bar (FRAME_PTR f)
4203 GtkToolItem *ti; 4300 GtkToolItem *ti;
4204 GtkTextDirection dir; 4301 GtkTextDirection dir;
4205 int pack_tool_bar = x->handlebox_widget == NULL; 4302 int pack_tool_bar = x->handlebox_widget == NULL;
4206
4207 Lisp_Object style; 4303 Lisp_Object style;
4208 int text_image, horiz; 4304 int text_image, horiz;
4209 4305
@@ -4551,13 +4647,13 @@ xg_initialize (void)
4551 /* Make dialogs close on C-g. Since file dialog inherits from 4647 /* Make dialogs close on C-g. Since file dialog inherits from
4552 dialog, this works for them also. */ 4648 dialog, this works for them also. */
4553 binding_set = gtk_binding_set_by_class (g_type_class_ref (GTK_TYPE_DIALOG)); 4649 binding_set = gtk_binding_set_by_class (g_type_class_ref (GTK_TYPE_DIALOG));
4554 gtk_binding_entry_add_signal (binding_set, GDK_g, GDK_CONTROL_MASK, 4650 gtk_binding_entry_add_signal (binding_set, GDK_KEY_g, GDK_CONTROL_MASK,
4555 "close", 0); 4651 "close", 0);
4556 4652
4557 /* Make menus close on C-g. */ 4653 /* Make menus close on C-g. */
4558 binding_set = gtk_binding_set_by_class (g_type_class_ref 4654 binding_set = gtk_binding_set_by_class (g_type_class_ref
4559 (GTK_TYPE_MENU_SHELL)); 4655 (GTK_TYPE_MENU_SHELL));
4560 gtk_binding_entry_add_signal (binding_set, GDK_g, GDK_CONTROL_MASK, 4656 gtk_binding_entry_add_signal (binding_set, GDK_KEY_g, GDK_CONTROL_MASK,
4561 "cancel", 0); 4657 "cancel", 0);
4562} 4658}
4563 4659
diff --git a/src/image.c b/src/image.c
index 73a45633f3b..91308c540b5 100644
--- a/src/image.c
+++ b/src/image.c
@@ -550,10 +550,6 @@ x_create_bitmap_mask (struct frame *f, int id)
550 Image types 550 Image types
551 ***********************************************************************/ 551 ***********************************************************************/
552 552
553/* Value is the number of elements of vector VECTOR. */
554
555#define DIM(VECTOR) (sizeof (VECTOR) / sizeof *(VECTOR))
556
557/* List of supported image types. Use define_image_type to add new 553/* List of supported image types. Use define_image_type to add new
558 types. Use lookup_image_type to find a type for a given symbol. */ 554 types. Use lookup_image_type to find a type for a given symbol. */
559 555
@@ -1139,7 +1135,7 @@ static RGB_PIXEL_COLOR
1139four_corners_best (XImagePtr_or_DC ximg, int *corners, 1135four_corners_best (XImagePtr_or_DC ximg, int *corners,
1140 unsigned long width, unsigned long height) 1136 unsigned long width, unsigned long height)
1141{ 1137{
1142 RGB_PIXEL_COLOR corner_pixels[4], best; 1138 RGB_PIXEL_COLOR corner_pixels[4], best IF_LINT (= 0);
1143 int i, best_count; 1139 int i, best_count;
1144 1140
1145 if (corners && corners[BOT_CORNER] >= 0) 1141 if (corners && corners[BOT_CORNER] >= 0)
@@ -1491,7 +1487,7 @@ free_image_cache (struct frame *f)
1491 If image-cache-eviction-delay is non-nil, this frees images in the cache 1487 If image-cache-eviction-delay is non-nil, this frees images in the cache
1492 which weren't displayed for at least that many seconds. */ 1488 which weren't displayed for at least that many seconds. */
1493 1489
1494void 1490static void
1495clear_image_cache (struct frame *f, Lisp_Object filter) 1491clear_image_cache (struct frame *f, Lisp_Object filter)
1496{ 1492{
1497 struct image_cache *c = FRAME_IMAGE_CACHE (f); 1493 struct image_cache *c = FRAME_IMAGE_CACHE (f);
@@ -1559,9 +1555,9 @@ clear_image_cache (struct frame *f, Lisp_Object filter)
1559 1555
1560 FOR_EACH_FRAME (tail, frame) 1556 FOR_EACH_FRAME (tail, frame)
1561 { 1557 {
1562 struct frame *f = XFRAME (frame); 1558 struct frame *fr = XFRAME (frame);
1563 if (FRAME_IMAGE_CACHE (f) == c) 1559 if (FRAME_IMAGE_CACHE (fr) == c)
1564 clear_current_matrices (f); 1560 clear_current_matrices (fr);
1565 } 1561 }
1566 1562
1567 ++windows_or_buffers_changed; 1563 ++windows_or_buffers_changed;
@@ -2653,11 +2649,11 @@ xbm_read_bitmap_data (struct frame *f, unsigned char *contents, unsigned char *e
2653 2649
2654 if (LA1 == XBM_TK_NUMBER) 2650 if (LA1 == XBM_TK_NUMBER)
2655 { 2651 {
2656 char *p = strrchr (buffer, '_'); 2652 char *q = strrchr (buffer, '_');
2657 p = p ? p + 1 : buffer; 2653 q = q ? q + 1 : buffer;
2658 if (strcmp (p, "width") == 0) 2654 if (strcmp (q, "width") == 0)
2659 *width = value; 2655 *width = value;
2660 else if (strcmp (p, "height") == 0) 2656 else if (strcmp (q, "height") == 0)
2661 *height = value; 2657 *height = value;
2662 } 2658 }
2663 expect (XBM_TK_NUMBER); 2659 expect (XBM_TK_NUMBER);
@@ -3427,11 +3423,12 @@ xpm_load (struct frame *f, struct image *img)
3427 { 3423 {
3428 Lisp_Object name; 3424 Lisp_Object name;
3429 Lisp_Object color; 3425 Lisp_Object color;
3426 char *empty_string = (char *) "";
3430 3427
3431 if (!CONSP (XCAR (tail))) 3428 if (!CONSP (XCAR (tail)))
3432 { 3429 {
3433 xpm_syms[i].name = ""; 3430 xpm_syms[i].name = empty_string;
3434 xpm_syms[i].value = ""; 3431 xpm_syms[i].value = empty_string;
3435 continue; 3432 continue;
3436 } 3433 }
3437 name = XCAR (XCAR (tail)); 3434 name = XCAR (XCAR (tail));
@@ -3442,14 +3439,14 @@ xpm_load (struct frame *f, struct image *img)
3442 strcpy (xpm_syms[i].name, SSDATA (name)); 3439 strcpy (xpm_syms[i].name, SSDATA (name));
3443 } 3440 }
3444 else 3441 else
3445 xpm_syms[i].name = ""; 3442 xpm_syms[i].name = empty_string;
3446 if (STRINGP (color)) 3443 if (STRINGP (color))
3447 { 3444 {
3448 xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1); 3445 xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1);
3449 strcpy (xpm_syms[i].value, SSDATA (color)); 3446 strcpy (xpm_syms[i].value, SSDATA (color));
3450 } 3447 }
3451 else 3448 else
3452 xpm_syms[i].value = ""; 3449 xpm_syms[i].value = empty_string;
3453 } 3450 }
3454 } 3451 }
3455 3452
@@ -4605,14 +4602,14 @@ x_detect_edges (struct frame *f, struct image *img, int *matrix, int color_adjus
4605 4602
4606 for (x = 1; x < img->width - 1; ++x, ++p) 4603 for (x = 1; x < img->width - 1; ++x, ++p)
4607 { 4604 {
4608 int r, g, b, y1, x1; 4605 int r, g, b, yy, xx;
4609 4606
4610 r = g = b = i = 0; 4607 r = g = b = i = 0;
4611 for (y1 = y - 1; y1 < y + 2; ++y1) 4608 for (yy = y - 1; yy < y + 2; ++yy)
4612 for (x1 = x - 1; x1 < x + 2; ++x1, ++i) 4609 for (xx = x - 1; xx < x + 2; ++xx, ++i)
4613 if (matrix[i]) 4610 if (matrix[i])
4614 { 4611 {
4615 XColor *t = COLOR (colors, x1, y1); 4612 XColor *t = COLOR (colors, xx, yy);
4616 r += matrix[i] * t->red; 4613 r += matrix[i] * t->red;
4617 g += matrix[i] * t->green; 4614 g += matrix[i] * t->green;
4618 b += matrix[i] * t->blue; 4615 b += matrix[i] * t->blue;
@@ -4688,7 +4685,7 @@ x_edge_detection (struct frame *f, struct image *img, Lisp_Object matrix,
4688 color_adjust = make_number (0xffff / 2); 4685 color_adjust = make_number (0xffff / 2);
4689 4686
4690 if (i == 9 && NUMBERP (color_adjust)) 4687 if (i == 9 && NUMBERP (color_adjust))
4691 x_detect_edges (f, img, trans, (int) XFLOATINT (color_adjust)); 4688 x_detect_edges (f, img, trans, XFLOATINT (color_adjust));
4692} 4689}
4693 4690
4694 4691
@@ -5531,6 +5528,7 @@ init_png_functions (Lisp_Object libraries)
5531/* Error and warning handlers installed when the PNG library 5528/* Error and warning handlers installed when the PNG library
5532 is initialized. */ 5529 is initialized. */
5533 5530
5531static void my_png_error (png_struct *, const char *) NO_RETURN;
5534static void 5532static void
5535my_png_error (png_struct *png_ptr, const char *msg) 5533my_png_error (png_struct *png_ptr, const char *msg)
5536{ 5534{
@@ -6030,7 +6028,6 @@ jpeg_image_p (Lisp_Object object)
6030/* Work around a warning about HAVE_STDLIB_H being redefined in 6028/* Work around a warning about HAVE_STDLIB_H being redefined in
6031 jconfig.h. */ 6029 jconfig.h. */
6032#ifdef HAVE_STDLIB_H 6030#ifdef HAVE_STDLIB_H
6033#define HAVE_STDLIB_H_1
6034#undef HAVE_STDLIB_H 6031#undef HAVE_STDLIB_H
6035#endif /* HAVE_STLIB_H */ 6032#endif /* HAVE_STLIB_H */
6036 6033
@@ -6106,6 +6103,7 @@ struct my_jpeg_error_mgr
6106}; 6103};
6107 6104
6108 6105
6106static void my_error_exit (j_common_ptr) NO_RETURN;
6109static void 6107static void
6110my_error_exit (j_common_ptr cinfo) 6108my_error_exit (j_common_ptr cinfo)
6111{ 6109{
@@ -6366,10 +6364,10 @@ jpeg_load (struct frame *f, struct image *img)
6366 if (rc == 1) 6364 if (rc == 1)
6367 { 6365 {
6368 /* Called from my_error_exit. Display a JPEG error. */ 6366 /* Called from my_error_exit. Display a JPEG error. */
6369 char buffer[JMSG_LENGTH_MAX]; 6367 char buf[JMSG_LENGTH_MAX];
6370 cinfo.err->format_message ((j_common_ptr) &cinfo, buffer); 6368 cinfo.err->format_message ((j_common_ptr) &cinfo, buf);
6371 image_error ("Error reading JPEG image `%s': %s", img->spec, 6369 image_error ("Error reading JPEG image `%s': %s", img->spec,
6372 build_string (buffer)); 6370 build_string (buf));
6373 } 6371 }
6374 6372
6375 /* Close the input file and destroy the JPEG object. */ 6373 /* Close the input file and destroy the JPEG object. */
@@ -7105,7 +7103,7 @@ gif_load (struct frame *f, struct image *img)
7105 Lisp_Object file, specified_file; 7103 Lisp_Object file, specified_file;
7106 Lisp_Object specified_data; 7104 Lisp_Object specified_data;
7107 int rc, width, height, x, y, i; 7105 int rc, width, height, x, y, i;
7108 boolean transparent_p; 7106 boolean transparent_p = 0;
7109 XImagePtr ximg; 7107 XImagePtr ximg;
7110 ColorMapObject *gif_color_map; 7108 ColorMapObject *gif_color_map;
7111 unsigned long pixel_colors[256]; 7109 unsigned long pixel_colors[256];
@@ -7114,7 +7112,7 @@ gif_load (struct frame *f, struct image *img)
7114 int ino, image_height, image_width; 7112 int ino, image_height, image_width;
7115 gif_memory_source memsrc; 7113 gif_memory_source memsrc;
7116 unsigned char *raster; 7114 unsigned char *raster;
7117 unsigned int transparency_color_index; 7115 unsigned int transparency_color_index IF_LINT (= 0);
7118 7116
7119 specified_file = image_spec_value (img->spec, QCfile, NULL); 7117 specified_file = image_spec_value (img->spec, QCfile, NULL);
7120 specified_data = image_spec_value (img->spec, QCdata, NULL); 7118 specified_data = image_spec_value (img->spec, QCdata, NULL);
@@ -7129,7 +7127,7 @@ gif_load (struct frame *f, struct image *img)
7129 } 7127 }
7130 7128
7131 /* Open the GIF file. */ 7129 /* Open the GIF file. */
7132 gif = fn_DGifOpenFileName (SDATA (file)); 7130 gif = fn_DGifOpenFileName (SSDATA (file));
7133 if (gif == NULL) 7131 if (gif == NULL)
7134 { 7132 {
7135 image_error ("Cannot open `%s'", file, Qnil); 7133 image_error ("Cannot open `%s'", file, Qnil);
@@ -7302,9 +7300,9 @@ gif_load (struct frame *f, struct image *img)
7302 7300
7303 for (x = 0; x < image_width; x++) 7301 for (x = 0; x < image_width; x++)
7304 { 7302 {
7305 int i = raster[(y * image_width) + x]; 7303 int c = raster[(y * image_width) + x];
7306 XPutPixel (ximg, x + img->corners[LEFT_CORNER], 7304 XPutPixel (ximg, x + img->corners[LEFT_CORNER],
7307 row + img->corners[TOP_CORNER], pixel_colors[i]); 7305 row + img->corners[TOP_CORNER], pixel_colors[c]);
7308 } 7306 }
7309 7307
7310 row += interlace_increment[pass]; 7308 row += interlace_increment[pass];
@@ -7315,9 +7313,9 @@ gif_load (struct frame *f, struct image *img)
7315 for (y = 0; y < image_height; ++y) 7313 for (y = 0; y < image_height; ++y)
7316 for (x = 0; x < image_width; ++x) 7314 for (x = 0; x < image_width; ++x)
7317 { 7315 {
7318 int i = raster[y * image_width + x]; 7316 int c = raster[y * image_width + x];
7319 XPutPixel (ximg, x + img->corners[LEFT_CORNER], 7317 XPutPixel (ximg, x + img->corners[LEFT_CORNER],
7320 y + img->corners[TOP_CORNER], pixel_colors[i]); 7318 y + img->corners[TOP_CORNER], pixel_colors[c]);
7321 } 7319 }
7322 } 7320 }
7323 7321
diff --git a/src/indent.c b/src/indent.c
index 37ce647556d..baea0641948 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -274,20 +274,20 @@ skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p, EMACS_INT to, Lisp_Ob
274 This macro is used in current_column_1, Fmove_to_column, and 274 This macro is used in current_column_1, Fmove_to_column, and
275 compute_motion. */ 275 compute_motion. */
276 276
277#define MULTIBYTE_BYTES_WIDTH(p, dp) \ 277#define MULTIBYTE_BYTES_WIDTH(p, dp, bytes, width) \
278 do { \ 278 do { \
279 int c; \ 279 int ch; \
280 \ 280 \
281 wide_column = 0; \ 281 wide_column = 0; \
282 c = STRING_CHAR_AND_LENGTH (p, bytes); \ 282 ch = STRING_CHAR_AND_LENGTH (p, bytes); \
283 if (BYTES_BY_CHAR_HEAD (*p) != bytes) \ 283 if (BYTES_BY_CHAR_HEAD (*p) != bytes) \
284 width = bytes * 4; \ 284 width = bytes * 4; \
285 else \ 285 else \
286 { \ 286 { \
287 if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c))) \ 287 if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, ch))) \
288 width = XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; \ 288 width = XVECTOR (DISP_CHAR_VECTOR (dp, ch))->size; \
289 else \ 289 else \
290 width = CHAR_WIDTH (c); \ 290 width = CHAR_WIDTH (ch); \
291 if (width > 1) \ 291 if (width > 1) \
292 wide_column = width; \ 292 wide_column = width; \
293 } \ 293 } \
@@ -569,14 +569,14 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
569 prev_col = col; 569 prev_col = col;
570 570
571 { /* Check display property. */ 571 { /* Check display property. */
572 EMACS_INT end; 572 EMACS_INT endp;
573 int width = check_display_width (scan, col, &end); 573 int width = check_display_width (scan, col, &endp);
574 if (width >= 0) 574 if (width >= 0)
575 { 575 {
576 col += width; 576 col += width;
577 if (end > scan) /* Avoid infinite loops with 0-width overlays. */ 577 if (endp > scan) /* Avoid infinite loops with 0-width overlays. */
578 { 578 {
579 scan = end; scan_byte = charpos_to_bytepos (scan); 579 scan = endp; scan_byte = charpos_to_bytepos (scan);
580 continue; 580 continue;
581 } 581 }
582 } 582 }
@@ -669,7 +669,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
669 int bytes, width, wide_column; 669 int bytes, width, wide_column;
670 670
671 ptr = BYTE_POS_ADDR (scan_byte); 671 ptr = BYTE_POS_ADDR (scan_byte);
672 MULTIBYTE_BYTES_WIDTH (ptr, dp); 672 MULTIBYTE_BYTES_WIDTH (ptr, dp, bytes, width);
673 /* Subtract one to compensate for the increment 673 /* Subtract one to compensate for the increment
674 that is going to happen below. */ 674 that is going to happen below. */
675 scan_byte += bytes - 1; 675 scan_byte += bytes - 1;
@@ -1657,15 +1657,15 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
1657 { 1657 {
1658 /* Start of multi-byte form. */ 1658 /* Start of multi-byte form. */
1659 unsigned char *ptr; 1659 unsigned char *ptr;
1660 int bytes, width, wide_column; 1660 int mb_bytes, mb_width, wide_column;
1661 1661
1662 pos_byte--; /* rewind POS_BYTE */ 1662 pos_byte--; /* rewind POS_BYTE */
1663 ptr = BYTE_POS_ADDR (pos_byte); 1663 ptr = BYTE_POS_ADDR (pos_byte);
1664 MULTIBYTE_BYTES_WIDTH (ptr, dp); 1664 MULTIBYTE_BYTES_WIDTH (ptr, dp, mb_bytes, mb_width);
1665 pos_byte += bytes; 1665 pos_byte += mb_bytes;
1666 if (wide_column) 1666 if (wide_column)
1667 wide_column_end_hpos = hpos + wide_column; 1667 wide_column_end_hpos = hpos + wide_column;
1668 hpos += width; 1668 hpos += mb_width;
1669 } 1669 }
1670 else if (VECTORP (charvec)) 1670 else if (VECTORP (charvec))
1671 ++hpos; 1671 ++hpos;
@@ -1995,7 +1995,7 @@ whether or not it is currently displayed in some window. */)
1995 Lisp_Object old_buffer; 1995 Lisp_Object old_buffer;
1996 struct gcpro gcpro1; 1996 struct gcpro gcpro1;
1997 Lisp_Object lcols = Qnil; 1997 Lisp_Object lcols = Qnil;
1998 double cols; 1998 double cols IF_LINT (= 0);
1999 1999
2000 /* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */ 2000 /* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */
2001 if (CONSP (lines) && (NUMBERP (XCAR (lines)))) 2001 if (CONSP (lines) && (NUMBERP (XCAR (lines))))
@@ -2029,7 +2029,7 @@ whether or not it is currently displayed in some window. */)
2029 } 2029 }
2030 else 2030 else
2031 { 2031 {
2032 int it_start, first_x, it_overshoot_expected; 2032 int it_start, first_x, it_overshoot_expected IF_LINT (= 0);
2033 2033
2034 SET_TEXT_POS (pt, PT, PT_BYTE); 2034 SET_TEXT_POS (pt, PT, PT_BYTE);
2035 start_display (&it, w, pt); 2035 start_display (&it, w, pt);
diff --git a/src/insdel.c b/src/insdel.c
index 7fcf9522a33..ad3460f9a64 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -70,11 +70,14 @@ Lisp_Object combine_after_change_buffer;
70Lisp_Object Qinhibit_modification_hooks; 70Lisp_Object Qinhibit_modification_hooks;
71 71
72#define CHECK_MARKERS() \ 72#define CHECK_MARKERS() \
73 if (check_markers_debug_flag) \ 73 do \
74 check_markers (); \ 74 { \
75 else 75 if (check_markers_debug_flag) \
76 check_markers (); \
77 } \
78 while (0)
76 79
77void 80static void
78check_markers (void) 81check_markers (void)
79{ 82{
80 register struct Lisp_Marker *tail; 83 register struct Lisp_Marker *tail;
@@ -411,9 +414,7 @@ adjust_markers_for_insert (EMACS_INT from, EMACS_INT from_byte,
411static void 414static void
412adjust_point (EMACS_INT nchars, EMACS_INT nbytes) 415adjust_point (EMACS_INT nchars, EMACS_INT nbytes)
413{ 416{
414 BUF_PT (current_buffer) += nchars; 417 SET_BUF_PT_BOTH (current_buffer, PT + nchars, PT_BYTE + nbytes);
415 BUF_PT_BYTE (current_buffer) += nbytes;
416
417 /* In a single-byte buffer, the two positions must be equal. */ 418 /* In a single-byte buffer, the two positions must be equal. */
418 eassert (PT_BYTE >= PT && PT_BYTE - PT <= ZV_BYTE - ZV); 419 eassert (PT_BYTE >= PT && PT_BYTE - PT <= ZV_BYTE - ZV);
419} 420}
@@ -453,7 +454,7 @@ adjust_markers_for_replace (EMACS_INT from, EMACS_INT from_byte,
453 454
454/* Make the gap NBYTES_ADDED bytes longer. */ 455/* Make the gap NBYTES_ADDED bytes longer. */
455 456
456void 457static void
457make_gap_larger (EMACS_INT nbytes_added) 458make_gap_larger (EMACS_INT nbytes_added)
458{ 459{
459 Lisp_Object tem; 460 Lisp_Object tem;
@@ -508,7 +509,7 @@ make_gap_larger (EMACS_INT nbytes_added)
508 509
509/* Make the gap NBYTES_REMOVED bytes shorter. */ 510/* Make the gap NBYTES_REMOVED bytes shorter. */
510 511
511void 512static void
512make_gap_smaller (EMACS_INT nbytes_removed) 513make_gap_smaller (EMACS_INT nbytes_removed)
513{ 514{
514 Lisp_Object tem; 515 Lisp_Object tem;
@@ -595,7 +596,6 @@ copy_text (const unsigned char *from_addr, unsigned char *to_addr,
595 { 596 {
596 EMACS_INT nchars = 0; 597 EMACS_INT nchars = 0;
597 EMACS_INT bytes_left = nbytes; 598 EMACS_INT bytes_left = nbytes;
598 Lisp_Object tbl = Qnil;
599 599
600 while (bytes_left > 0) 600 while (bytes_left > 0)
601 { 601 {
@@ -2101,7 +2101,7 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end,
2101 VARIABLE is the variable to maybe set to nil. 2101 VARIABLE is the variable to maybe set to nil.
2102 NO-ERROR-FLAG is nil if there was an error, 2102 NO-ERROR-FLAG is nil if there was an error,
2103 anything else meaning no error (so this function does nothing). */ 2103 anything else meaning no error (so this function does nothing). */
2104Lisp_Object 2104static Lisp_Object
2105reset_var_on_error (Lisp_Object val) 2105reset_var_on_error (Lisp_Object val)
2106{ 2106{
2107 if (NILP (XCDR (val))) 2107 if (NILP (XCDR (val)))
@@ -2265,7 +2265,7 @@ signal_after_change (EMACS_INT charpos, EMACS_INT lendel, EMACS_INT lenins)
2265 unbind_to (count, Qnil); 2265 unbind_to (count, Qnil);
2266} 2266}
2267 2267
2268Lisp_Object 2268static Lisp_Object
2269Fcombine_after_change_execute_1 (Lisp_Object val) 2269Fcombine_after_change_execute_1 (Lisp_Object val)
2270{ 2270{
2271 Vcombine_after_change_calls = val; 2271 Vcombine_after_change_calls = val;
diff --git a/src/intervals.c b/src/intervals.c
index 6aee6e9d7fa..12b2789cc77 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1892,8 +1892,7 @@ temp_set_point_both (struct buffer *buffer,
1892 if (charpos > BUF_ZV (buffer) || charpos < BUF_BEGV (buffer)) 1892 if (charpos > BUF_ZV (buffer) || charpos < BUF_BEGV (buffer))
1893 abort (); 1893 abort ();
1894 1894
1895 BUF_PT_BYTE (buffer) = bytepos; 1895 SET_BUF_PT_BOTH (buffer, charpos, bytepos);
1896 BUF_PT (buffer) = charpos;
1897} 1896}
1898 1897
1899/* Set point "temporarily", without checking any text properties. */ 1898/* Set point "temporarily", without checking any text properties. */
@@ -2312,10 +2311,9 @@ get_local_map (register EMACS_INT position, register struct buffer *buffer,
2312 old_zv = BUF_ZV (buffer); 2311 old_zv = BUF_ZV (buffer);
2313 old_begv_byte = BUF_BEGV_BYTE (buffer); 2312 old_begv_byte = BUF_BEGV_BYTE (buffer);
2314 old_zv_byte = BUF_ZV_BYTE (buffer); 2313 old_zv_byte = BUF_ZV_BYTE (buffer);
2315 BUF_BEGV (buffer) = BUF_BEG (buffer); 2314
2316 BUF_ZV (buffer) = BUF_Z (buffer); 2315 SET_BUF_BEGV_BOTH (buffer, BUF_BEG (buffer), BUF_BEG_BYTE (buffer));
2317 BUF_BEGV_BYTE (buffer) = BUF_BEG_BYTE (buffer); 2316 SET_BUF_ZV_BOTH (buffer, BUF_Z (buffer), BUF_Z_BYTE (buffer));
2318 BUF_ZV_BYTE (buffer) = BUF_Z_BYTE (buffer);
2319 2317
2320 XSETFASTINT (lispy_position, position); 2318 XSETFASTINT (lispy_position, position);
2321 XSETBUFFER (lispy_buffer, buffer); 2319 XSETBUFFER (lispy_buffer, buffer);
@@ -2329,10 +2327,8 @@ get_local_map (register EMACS_INT position, register struct buffer *buffer,
2329 if (NILP (prop)) 2327 if (NILP (prop))
2330 prop = get_pos_property (lispy_position, type, lispy_buffer); 2328 prop = get_pos_property (lispy_position, type, lispy_buffer);
2331 2329
2332 BUF_BEGV (buffer) = old_begv; 2330 SET_BUF_BEGV_BOTH (buffer, old_begv, old_begv_byte);
2333 BUF_ZV (buffer) = old_zv; 2331 SET_BUF_ZV_BOTH (buffer, old_zv, old_zv_byte);
2334 BUF_BEGV_BYTE (buffer) = old_begv_byte;
2335 BUF_ZV_BYTE (buffer) = old_zv_byte;
2336 2332
2337 /* Use the local map only if it is valid. */ 2333 /* Use the local map only if it is valid. */
2338 prop = get_keymap (prop, 0, 0); 2334 prop = get_keymap (prop, 0, 0);
diff --git a/src/keyboard.c b/src/keyboard.c
index 78aa1cfea77..63e7573fbe9 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -451,7 +451,7 @@ static int store_user_signal_events (void);
451 C can be a character, which is printed prettily ("M-C-x" and all that 451 C can be a character, which is printed prettily ("M-C-x" and all that
452 jazz), or a symbol, whose name is printed. */ 452 jazz), or a symbol, whose name is printed. */
453 453
454void 454static void
455echo_char (Lisp_Object c) 455echo_char (Lisp_Object c)
456{ 456{
457 if (current_kboard->immediate_echo) 457 if (current_kboard->immediate_echo)
@@ -538,7 +538,7 @@ echo_char (Lisp_Object c)
538/* Temporarily add a dash to the end of the echo string if it's not 538/* Temporarily add a dash to the end of the echo string if it's not
539 empty, so that it serves as a mini-prompt for the very next character. */ 539 empty, so that it serves as a mini-prompt for the very next character. */
540 540
541void 541static void
542echo_dash (void) 542echo_dash (void)
543{ 543{
544 /* Do nothing if not echoing at all. */ 544 /* Do nothing if not echoing at all. */
@@ -967,7 +967,7 @@ restore_kboard_configuration (Lisp_Object was_locked)
967/* Handle errors that are not handled at inner levels 967/* Handle errors that are not handled at inner levels
968 by printing an error message and returning to the editor command loop. */ 968 by printing an error message and returning to the editor command loop. */
969 969
970Lisp_Object 970static Lisp_Object
971cmd_error (Lisp_Object data) 971cmd_error (Lisp_Object data)
972{ 972{
973 Lisp_Object old_level, old_length; 973 Lisp_Object old_level, old_length;
@@ -1132,7 +1132,7 @@ command_loop_2 (Lisp_Object ignore)
1132 return Qnil; 1132 return Qnil;
1133} 1133}
1134 1134
1135Lisp_Object 1135static Lisp_Object
1136top_level_2 (void) 1136top_level_2 (void)
1137{ 1137{
1138 return Feval (Vtop_level, Qnil); 1138 return Feval (Vtop_level, Qnil);
@@ -1169,6 +1169,7 @@ This also exits all active minibuffers. */)
1169 Fthrow (Qtop_level, Qnil); 1169 Fthrow (Qtop_level, Qnil);
1170} 1170}
1171 1171
1172Lisp_Object Fexit_recursive_edit (void) NO_RETURN;
1172DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "", 1173DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "",
1173 doc: /* Exit from the innermost recursive edit or minibuffer. */) 1174 doc: /* Exit from the innermost recursive edit or minibuffer. */)
1174 (void) 1175 (void)
@@ -1179,6 +1180,7 @@ DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0,
1179 error ("No recursive edit is in progress"); 1180 error ("No recursive edit is in progress");
1180} 1181}
1181 1182
1183Lisp_Object Fabort_recursive_edit (void) NO_RETURN;
1182DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "", 1184DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "",
1183 doc: /* Abort the command that requested this recursive edit or minibuffer input. */) 1185 doc: /* Abort the command that requested this recursive edit or minibuffer input. */)
1184 (void) 1186 (void)
@@ -1885,7 +1887,7 @@ poll_for_input_1 (void)
1885/* Timer callback function for poll_timer. TIMER is equal to 1887/* Timer callback function for poll_timer. TIMER is equal to
1886 poll_timer. */ 1888 poll_timer. */
1887 1889
1888void 1890static void
1889poll_for_input (struct atimer *timer) 1891poll_for_input (struct atimer *timer)
1890{ 1892{
1891 if (poll_suppress_count == 0) 1893 if (poll_suppress_count == 0)
@@ -2184,7 +2186,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2184 int *used_mouse_menu, struct timeval *end_time) 2186 int *used_mouse_menu, struct timeval *end_time)
2185{ 2187{
2186 volatile Lisp_Object c; 2188 volatile Lisp_Object c;
2187 int count, jmpcount; 2189 int jmpcount;
2188 jmp_buf local_getcjmp; 2190 jmp_buf local_getcjmp;
2189 jmp_buf save_jump; 2191 jmp_buf save_jump;
2190 volatile int key_already_recorded = 0; 2192 volatile int key_already_recorded = 0;
@@ -2461,21 +2463,21 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2461 KBOARD *kb = FRAME_KBOARD (XFRAME (selected_frame)); 2463 KBOARD *kb = FRAME_KBOARD (XFRAME (selected_frame));
2462 if (kb != current_kboard) 2464 if (kb != current_kboard)
2463 { 2465 {
2464 Lisp_Object link = KVAR (kb, kbd_queue); 2466 Lisp_Object last = KVAR (kb, kbd_queue);
2465 /* We shouldn't get here if we were in single-kboard mode! */ 2467 /* We shouldn't get here if we were in single-kboard mode! */
2466 if (single_kboard) 2468 if (single_kboard)
2467 abort (); 2469 abort ();
2468 if (CONSP (link)) 2470 if (CONSP (last))
2469 { 2471 {
2470 while (CONSP (XCDR (link))) 2472 while (CONSP (XCDR (last)))
2471 link = XCDR (link); 2473 last = XCDR (last);
2472 if (!NILP (XCDR (link))) 2474 if (!NILP (XCDR (last)))
2473 abort (); 2475 abort ();
2474 } 2476 }
2475 if (!CONSP (link)) 2477 if (!CONSP (last))
2476 KVAR (kb, kbd_queue) = Fcons (c, Qnil); 2478 KVAR (kb, kbd_queue) = Fcons (c, Qnil);
2477 else 2479 else
2478 XSETCDR (link, Fcons (c, Qnil)); 2480 XSETCDR (last, Fcons (c, Qnil));
2479 kb->kbd_queue_has_data = 1; 2481 kb->kbd_queue_has_data = 1;
2480 current_kboard = kb; 2482 current_kboard = kb;
2481 /* This is going to exit from read_char 2483 /* This is going to exit from read_char
@@ -2692,7 +2694,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2692 2694
2693 if (NILP (c)) 2695 if (NILP (c))
2694 { 2696 {
2695 KBOARD *kb; 2697 KBOARD *kb IF_LINT (= NULL);
2696 2698
2697 if (end_time) 2699 if (end_time)
2698 { 2700 {
@@ -2712,18 +2714,18 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2712 2714
2713 if (! NILP (c) && (kb != current_kboard)) 2715 if (! NILP (c) && (kb != current_kboard))
2714 { 2716 {
2715 Lisp_Object link = KVAR (kb, kbd_queue); 2717 Lisp_Object last = KVAR (kb, kbd_queue);
2716 if (CONSP (link)) 2718 if (CONSP (last))
2717 { 2719 {
2718 while (CONSP (XCDR (link))) 2720 while (CONSP (XCDR (last)))
2719 link = XCDR (link); 2721 last = XCDR (last);
2720 if (!NILP (XCDR (link))) 2722 if (!NILP (XCDR (last)))
2721 abort (); 2723 abort ();
2722 } 2724 }
2723 if (!CONSP (link)) 2725 if (!CONSP (last))
2724 KVAR (kb, kbd_queue) = Fcons (c, Qnil); 2726 KVAR (kb, kbd_queue) = Fcons (c, Qnil);
2725 else 2727 else
2726 XSETCDR (link, Fcons (c, Qnil)); 2728 XSETCDR (last, Fcons (c, Qnil));
2727 kb->kbd_queue_has_data = 1; 2729 kb->kbd_queue_has_data = 1;
2728 c = Qnil; 2730 c = Qnil;
2729 if (single_kboard) 2731 if (single_kboard)
@@ -2912,7 +2914,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2912 { 2914 {
2913 Lisp_Object keys; 2915 Lisp_Object keys;
2914 int key_count, key_count_reset; 2916 int key_count, key_count_reset;
2915 struct gcpro gcpro1; 2917 struct gcpro inner_gcpro1;
2916 int count = SPECPDL_INDEX (); 2918 int count = SPECPDL_INDEX ();
2917 2919
2918 /* Save the echo status. */ 2920 /* Save the echo status. */
@@ -2940,7 +2942,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2940 keys = Fcopy_sequence (this_command_keys); 2942 keys = Fcopy_sequence (this_command_keys);
2941 else 2943 else
2942 keys = Qnil; 2944 keys = Qnil;
2943 GCPRO1 (keys); 2945 GCPRO1_VAR (keys, inner_gcpro);
2944 2946
2945 /* Clear out this_command_keys. */ 2947 /* Clear out this_command_keys. */
2946 this_command_key_count = 0; 2948 this_command_key_count = 0;
@@ -2978,7 +2980,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2978 if (saved_immediate_echo) 2980 if (saved_immediate_echo)
2979 echo_now (); 2981 echo_now ();
2980 2982
2981 UNGCPRO; 2983 UNGCPRO_VAR (inner_gcpro);
2982 2984
2983 /* The input method can return no events. */ 2985 /* The input method can return no events. */
2984 if (! CONSP (tem)) 2986 if (! CONSP (tem))
@@ -3000,16 +3002,16 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
3000 if (CONSP (c) && EQ (XCAR (c), Qhelp_echo)) 3002 if (CONSP (c) && EQ (XCAR (c), Qhelp_echo))
3001 { 3003 {
3002 /* (help-echo FRAME HELP WINDOW OBJECT POS). */ 3004 /* (help-echo FRAME HELP WINDOW OBJECT POS). */
3003 Lisp_Object help, object, position, window, tem; 3005 Lisp_Object help, object, position, window, htem;
3004 3006
3005 tem = Fcdr (XCDR (c)); 3007 htem = Fcdr (XCDR (c));
3006 help = Fcar (tem); 3008 help = Fcar (htem);
3007 tem = Fcdr (tem); 3009 htem = Fcdr (htem);
3008 window = Fcar (tem); 3010 window = Fcar (htem);
3009 tem = Fcdr (tem); 3011 htem = Fcdr (htem);
3010 object = Fcar (tem); 3012 object = Fcar (htem);
3011 tem = Fcdr (tem); 3013 htem = Fcdr (htem);
3012 position = Fcar (tem); 3014 position = Fcar (htem);
3013 3015
3014 show_help_echo (help, window, object, position, 0); 3016 show_help_echo (help, window, object, position, 0);
3015 3017
@@ -3051,7 +3053,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
3051 if (!NILP (Vhelp_form) && help_char_p (c)) 3053 if (!NILP (Vhelp_form) && help_char_p (c))
3052 { 3054 {
3053 Lisp_Object tem0; 3055 Lisp_Object tem0;
3054 count = SPECPDL_INDEX (); 3056 int count = SPECPDL_INDEX ();
3055 3057
3056 help_form_saved_window_configs 3058 help_form_saved_window_configs
3057 = Fcons (Fcurrent_window_configuration (Qnil), 3059 = Fcons (Fcurrent_window_configuration (Qnil),
@@ -4024,7 +4026,7 @@ kbd_buffer_get_event (KBOARD **kbp,
4024 Lisp_Object bar_window; 4026 Lisp_Object bar_window;
4025 enum scroll_bar_part part; 4027 enum scroll_bar_part part;
4026 Lisp_Object x, y; 4028 Lisp_Object x, y;
4027 unsigned long time; 4029 unsigned long t;
4028 4030
4029 *kbp = current_kboard; 4031 *kbp = current_kboard;
4030 /* Note that this uses F to determine which terminal to look at. 4032 /* Note that this uses F to determine which terminal to look at.
@@ -4035,7 +4037,7 @@ kbd_buffer_get_event (KBOARD **kbp,
4035 /* XXX Can f or mouse_position_hook be NULL here? */ 4037 /* XXX Can f or mouse_position_hook be NULL here? */
4036 if (f && FRAME_TERMINAL (f)->mouse_position_hook) 4038 if (f && FRAME_TERMINAL (f)->mouse_position_hook)
4037 (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window, 4039 (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window,
4038 &part, &x, &y, &time); 4040 &part, &x, &y, &t);
4039 4041
4040 obj = Qnil; 4042 obj = Qnil;
4041 4043
@@ -4059,7 +4061,7 @@ kbd_buffer_get_event (KBOARD **kbp,
4059 /* If we didn't decide to make a switch-frame event, go ahead and 4061 /* If we didn't decide to make a switch-frame event, go ahead and
4060 return a mouse-motion event. */ 4062 return a mouse-motion event. */
4061 if (!NILP (x) && NILP (obj)) 4063 if (!NILP (x) && NILP (obj))
4062 obj = make_lispy_movement (f, bar_window, part, x, y, time); 4064 obj = make_lispy_movement (f, bar_window, part, x, y, t);
4063 } 4065 }
4064#endif /* HAVE_MOUSE || HAVE GPM */ 4066#endif /* HAVE_MOUSE || HAVE GPM */
4065 else 4067 else
@@ -5037,7 +5039,7 @@ int double_click_count;
5037 5039
5038static Lisp_Object 5040static Lisp_Object
5039make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, 5041make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
5040 unsigned long time) 5042 unsigned long t)
5041{ 5043{
5042 enum window_part part; 5044 enum window_part part;
5043 Lisp_Object posn = Qnil; 5045 Lisp_Object posn = Qnil;
@@ -5218,7 +5220,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
5218 Fcons (posn, 5220 Fcons (posn,
5219 Fcons (Fcons (make_number (xret), 5221 Fcons (Fcons (make_number (xret),
5220 make_number (yret)), 5222 make_number (yret)),
5221 Fcons (make_number (time), 5223 Fcons (make_number (t),
5222 extra_info)))); 5224 extra_info))));
5223} 5225}
5224 5226
@@ -5642,19 +5644,19 @@ make_lispy_event (struct input_event *event)
5642 /* On window-system frames, use the value of 5644 /* On window-system frames, use the value of
5643 double-click-fuzz as is. On other frames, interpret it 5645 double-click-fuzz as is. On other frames, interpret it
5644 as a multiple of 1/8 characters. */ 5646 as a multiple of 1/8 characters. */
5645 struct frame *f; 5647 struct frame *fr;
5646 int fuzz; 5648 int fuzz;
5647 int symbol_num; 5649 int symbol_num;
5648 int is_double; 5650 int is_double;
5649 5651
5650 if (WINDOWP (event->frame_or_window)) 5652 if (WINDOWP (event->frame_or_window))
5651 f = XFRAME (XWINDOW (event->frame_or_window)->frame); 5653 fr = XFRAME (XWINDOW (event->frame_or_window)->frame);
5652 else if (FRAMEP (event->frame_or_window)) 5654 else if (FRAMEP (event->frame_or_window))
5653 f = XFRAME (event->frame_or_window); 5655 fr = XFRAME (event->frame_or_window);
5654 else 5656 else
5655 abort (); 5657 abort ();
5656 5658
5657 fuzz = FRAME_WINDOW_P (f) 5659 fuzz = FRAME_WINDOW_P (fr)
5658 ? double_click_fuzz : double_click_fuzz / 8; 5660 ? double_click_fuzz : double_click_fuzz / 8;
5659 5661
5660 if (event->modifiers & up_modifier) 5662 if (event->modifiers & up_modifier)
@@ -5927,7 +5929,7 @@ make_lispy_event (struct input_event *event)
5927 5929
5928static Lisp_Object 5930static Lisp_Object
5929make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_part part, 5931make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_part part,
5930 Lisp_Object x, Lisp_Object y, unsigned long time) 5932 Lisp_Object x, Lisp_Object y, unsigned long t)
5931{ 5933{
5932 /* Is it a scroll bar movement? */ 5934 /* Is it a scroll bar movement? */
5933 if (frame && ! NILP (bar_window)) 5935 if (frame && ! NILP (bar_window))
@@ -5939,7 +5941,7 @@ make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_pa
5939 Fcons (list5 (bar_window, 5941 Fcons (list5 (bar_window,
5940 Qvertical_scroll_bar, 5942 Qvertical_scroll_bar,
5941 Fcons (x, y), 5943 Fcons (x, y),
5942 make_number (time), 5944 make_number (t),
5943 part_sym), 5945 part_sym),
5944 Qnil)); 5946 Qnil));
5945 } 5947 }
@@ -5947,7 +5949,7 @@ make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_pa
5947 else 5949 else
5948 { 5950 {
5949 Lisp_Object position; 5951 Lisp_Object position;
5950 position = make_lispy_position (frame, x, y, time); 5952 position = make_lispy_position (frame, x, y, t);
5951 return list2 (Qmouse_movement, position); 5953 return list2 (Qmouse_movement, position);
5952 } 5954 }
5953} 5955}
@@ -6236,7 +6238,7 @@ DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,
6236static Lisp_Object 6238static Lisp_Object
6237apply_modifiers (int modifiers, Lisp_Object base) 6239apply_modifiers (int modifiers, Lisp_Object base)
6238{ 6240{
6239 Lisp_Object cache, index, entry, new_symbol; 6241 Lisp_Object cache, idx, entry, new_symbol;
6240 6242
6241 /* Mask out upper bits. We don't know where this value's been. */ 6243 /* Mask out upper bits. We don't know where this value's been. */
6242 modifiers &= INTMASK; 6244 modifiers &= INTMASK;
@@ -6246,8 +6248,8 @@ apply_modifiers (int modifiers, Lisp_Object base)
6246 6248
6247 /* The click modifier never figures into cache indices. */ 6249 /* The click modifier never figures into cache indices. */
6248 cache = Fget (base, Qmodifier_cache); 6250 cache = Fget (base, Qmodifier_cache);
6249 XSETFASTINT (index, (modifiers & ~click_modifier)); 6251 XSETFASTINT (idx, (modifiers & ~click_modifier));
6250 entry = assq_no_quit (index, cache); 6252 entry = assq_no_quit (idx, cache);
6251 6253
6252 if (CONSP (entry)) 6254 if (CONSP (entry))
6253 new_symbol = XCDR (entry); 6255 new_symbol = XCDR (entry);
@@ -6260,14 +6262,14 @@ apply_modifiers (int modifiers, Lisp_Object base)
6260 SBYTES (SYMBOL_NAME (base))); 6262 SBYTES (SYMBOL_NAME (base)));
6261 6263
6262 /* Add the new symbol to the base's cache. */ 6264 /* Add the new symbol to the base's cache. */
6263 entry = Fcons (index, new_symbol); 6265 entry = Fcons (idx, new_symbol);
6264 Fput (base, Qmodifier_cache, Fcons (entry, cache)); 6266 Fput (base, Qmodifier_cache, Fcons (entry, cache));
6265 6267
6266 /* We have the parsing info now for free, so we could add it to 6268 /* We have the parsing info now for free, so we could add it to
6267 the caches: 6269 the caches:
6268 XSETFASTINT (index, modifiers); 6270 XSETFASTINT (idx, modifiers);
6269 Fput (new_symbol, Qevent_symbol_element_mask, 6271 Fput (new_symbol, Qevent_symbol_element_mask,
6270 Fcons (base, Fcons (index, Qnil))); 6272 Fcons (base, Fcons (idx, Qnil)));
6271 Fput (new_symbol, Qevent_symbol_elements, 6273 Fput (new_symbol, Qevent_symbol_elements,
6272 Fcons (base, lispy_modifier_list (modifiers))); 6274 Fcons (base, lispy_modifier_list (modifiers)));
6273 Sadly, this is only correct if `base' is indeed a base event, 6275 Sadly, this is only correct if `base' is indeed a base event,
@@ -6821,16 +6823,17 @@ decode_keyboard_code (struct tty_display_info *tty,
6821 return; 6823 return;
6822 for (i = 0, p = coding->destination; i < coding->produced_char; i++) 6824 for (i = 0, p = coding->destination; i < coding->produced_char; i++)
6823 { 6825 {
6824 struct input_event buf; 6826 struct input_event event_buf;
6825 6827
6826 EVENT_INIT (buf); 6828 EVENT_INIT (event_buf);
6827 buf.code = STRING_CHAR_ADVANCE (p); 6829 event_buf.code = STRING_CHAR_ADVANCE (p);
6828 buf.kind = (ASCII_CHAR_P (buf.code) 6830 event_buf.kind =
6829 ? ASCII_KEYSTROKE_EVENT : MULTIBYTE_CHAR_KEYSTROKE_EVENT); 6831 (ASCII_CHAR_P (event_buf.code)
6832 ? ASCII_KEYSTROKE_EVENT : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
6830 /* See the comment in tty_read_avail_input. */ 6833 /* See the comment in tty_read_avail_input. */
6831 buf.frame_or_window = tty->top_frame; 6834 event_buf.frame_or_window = tty->top_frame;
6832 buf.arg = Qnil; 6835 event_buf.arg = Qnil;
6833 kbd_buffer_store_event (&buf); 6836 kbd_buffer_store_event (&event_buf);
6834 } 6837 }
6835} 6838}
6836 6839
@@ -6890,11 +6893,11 @@ tty_read_avail_input (struct terminal *terminal,
6890 if (gpm_tty == tty) 6893 if (gpm_tty == tty)
6891 { 6894 {
6892 Gpm_Event event; 6895 Gpm_Event event;
6893 struct input_event hold_quit; 6896 struct input_event gpm_hold_quit;
6894 int gpm, fd = gpm_fd; 6897 int gpm, fd = gpm_fd;
6895 6898
6896 EVENT_INIT (hold_quit); 6899 EVENT_INIT (gpm_hold_quit);
6897 hold_quit.kind = NO_EVENT; 6900 gpm_hold_quit.kind = NO_EVENT;
6898 6901
6899 /* gpm==1 if event received. 6902 /* gpm==1 if event received.
6900 gpm==0 if the GPM daemon has closed the connection, in which case 6903 gpm==0 if the GPM daemon has closed the connection, in which case
@@ -6903,13 +6906,13 @@ tty_read_avail_input (struct terminal *terminal,
6903 select masks. 6906 select masks.
6904 gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */ 6907 gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */
6905 while (gpm = Gpm_GetEvent (&event), gpm == 1) { 6908 while (gpm = Gpm_GetEvent (&event), gpm == 1) {
6906 nread += handle_one_term_event (tty, &event, &hold_quit); 6909 nread += handle_one_term_event (tty, &event, &gpm_hold_quit);
6907 } 6910 }
6908 if (gpm == 0) 6911 if (gpm == 0)
6909 /* Presumably the GPM daemon has closed the connection. */ 6912 /* Presumably the GPM daemon has closed the connection. */
6910 close_gpm (fd); 6913 close_gpm (fd);
6911 if (hold_quit.kind != NO_EVENT) 6914 if (gpm_hold_quit.kind != NO_EVENT)
6912 kbd_buffer_store_event (&hold_quit); 6915 kbd_buffer_store_event (&gpm_hold_quit);
6913 if (nread) 6916 if (nread)
6914 return nread; 6917 return nread;
6915 } 6918 }
@@ -7056,7 +7059,7 @@ tty_read_avail_input (struct terminal *terminal,
7056 return nread; 7059 return nread;
7057} 7060}
7058 7061
7059void 7062static void
7060handle_async_input (void) 7063handle_async_input (void)
7061{ 7064{
7062 interrupt_input_pending = 0; 7065 interrupt_input_pending = 0;
@@ -7329,8 +7332,6 @@ menu_bar_items (Lisp_Object old)
7329 int mapno; 7332 int mapno;
7330 Lisp_Object oquit; 7333 Lisp_Object oquit;
7331 7334
7332 int i;
7333
7334 /* In order to build the menus, we need to call the keymap 7335 /* In order to build the menus, we need to call the keymap
7335 accessors. They all call QUIT. But this function is called 7336 accessors. They all call QUIT. But this function is called
7336 during redisplay, during which a quit is fatal. So inhibit 7337 during redisplay, during which a quit is fatal. So inhibit
@@ -7432,15 +7433,18 @@ menu_bar_items (Lisp_Object old)
7432 } 7433 }
7433 7434
7434 /* Add nil, nil, nil, nil at the end. */ 7435 /* Add nil, nil, nil, nil at the end. */
7435 i = menu_bar_items_index; 7436 {
7436 if (i + 4 > XVECTOR (menu_bar_items_vector)->size) 7437 int i = menu_bar_items_index;
7437 menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, Qnil); 7438 if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
7438 /* Add this item. */ 7439 menu_bar_items_vector =
7439 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; 7440 larger_vector (menu_bar_items_vector, 2 * i, Qnil);
7440 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; 7441 /* Add this item. */
7441 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; 7442 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
7442 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; 7443 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
7443 menu_bar_items_index = i; 7444 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
7445 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
7446 menu_bar_items_index = i;
7447 }
7444 7448
7445 Vinhibit_quit = oquit; 7449 Vinhibit_quit = oquit;
7446 return menu_bar_items_vector; 7450 return menu_bar_items_vector;
@@ -8118,12 +8122,12 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8118 /* Process the rest of the properties. */ 8122 /* Process the rest of the properties. */
8119 for (; CONSP (item) && CONSP (XCDR (item)); item = XCDR (XCDR (item))) 8123 for (; CONSP (item) && CONSP (XCDR (item)); item = XCDR (XCDR (item)))
8120 { 8124 {
8121 Lisp_Object key, value; 8125 Lisp_Object ikey, value;
8122 8126
8123 key = XCAR (item); 8127 ikey = XCAR (item);
8124 value = XCAR (XCDR (item)); 8128 value = XCAR (XCDR (item));
8125 8129
8126 if (EQ (key, QCenable)) 8130 if (EQ (ikey, QCenable))
8127 { 8131 {
8128 /* `:enable FORM'. */ 8132 /* `:enable FORM'. */
8129 if (!NILP (Venable_disabled_menus_and_buttons)) 8133 if (!NILP (Venable_disabled_menus_and_buttons))
@@ -8131,20 +8135,20 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8131 else 8135 else
8132 PROP (TOOL_BAR_ITEM_ENABLED_P) = value; 8136 PROP (TOOL_BAR_ITEM_ENABLED_P) = value;
8133 } 8137 }
8134 else if (EQ (key, QCvisible)) 8138 else if (EQ (ikey, QCvisible))
8135 { 8139 {
8136 /* `:visible FORM'. If got a visible property and that 8140 /* `:visible FORM'. If got a visible property and that
8137 evaluates to nil then ignore this item. */ 8141 evaluates to nil then ignore this item. */
8138 if (NILP (menu_item_eval_property (value))) 8142 if (NILP (menu_item_eval_property (value)))
8139 return 0; 8143 return 0;
8140 } 8144 }
8141 else if (EQ (key, QChelp)) 8145 else if (EQ (ikey, QChelp))
8142 /* `:help HELP-STRING'. */ 8146 /* `:help HELP-STRING'. */
8143 PROP (TOOL_BAR_ITEM_HELP) = value; 8147 PROP (TOOL_BAR_ITEM_HELP) = value;
8144 else if (EQ (key, QCvert_only)) 8148 else if (EQ (ikey, QCvert_only))
8145 /* `:vert-only t/nil'. */ 8149 /* `:vert-only t/nil'. */
8146 PROP (TOOL_BAR_ITEM_VERT_ONLY) = value; 8150 PROP (TOOL_BAR_ITEM_VERT_ONLY) = value;
8147 else if (EQ (key, QClabel)) 8151 else if (EQ (ikey, QClabel))
8148 { 8152 {
8149 const char *bad_label = "!!?GARBLED ITEM?!!"; 8153 const char *bad_label = "!!?GARBLED ITEM?!!";
8150 /* `:label LABEL-STRING'. */ 8154 /* `:label LABEL-STRING'. */
@@ -8153,10 +8157,10 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8153 : make_string (bad_label, strlen (bad_label)); 8157 : make_string (bad_label, strlen (bad_label));
8154 have_label = 1; 8158 have_label = 1;
8155 } 8159 }
8156 else if (EQ (key, QCfilter)) 8160 else if (EQ (ikey, QCfilter))
8157 /* ':filter FORM'. */ 8161 /* ':filter FORM'. */
8158 filter = value; 8162 filter = value;
8159 else if (EQ (key, QCbutton) && CONSP (value)) 8163 else if (EQ (ikey, QCbutton) && CONSP (value))
8160 { 8164 {
8161 /* `:button (TYPE . SELECTED)'. */ 8165 /* `:button (TYPE . SELECTED)'. */
8162 Lisp_Object type, selected; 8166 Lisp_Object type, selected;
@@ -8169,13 +8173,13 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8169 PROP (TOOL_BAR_ITEM_TYPE) = type; 8173 PROP (TOOL_BAR_ITEM_TYPE) = type;
8170 } 8174 }
8171 } 8175 }
8172 else if (EQ (key, QCimage) 8176 else if (EQ (ikey, QCimage)
8173 && (CONSP (value) 8177 && (CONSP (value)
8174 || (VECTORP (value) && XVECTOR (value)->size == 4))) 8178 || (VECTORP (value) && XVECTOR (value)->size == 4)))
8175 /* Value is either a single image specification or a vector 8179 /* Value is either a single image specification or a vector
8176 of 4 such specifications for the different button states. */ 8180 of 4 such specifications for the different button states. */
8177 PROP (TOOL_BAR_ITEM_IMAGES) = value; 8181 PROP (TOOL_BAR_ITEM_IMAGES) = value;
8178 else if (EQ (key, Qrtl)) 8182 else if (EQ (ikey, Qrtl))
8179 /* ':rtl STRING' */ 8183 /* ':rtl STRING' */
8180 PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value; 8184 PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value;
8181 } 8185 }
@@ -8184,35 +8188,34 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8184 if (!have_label) 8188 if (!have_label)
8185 { 8189 {
8186 /* Try to make one from caption and key. */ 8190 /* Try to make one from caption and key. */
8187 Lisp_Object key = PROP (TOOL_BAR_ITEM_KEY); 8191 Lisp_Object tkey = PROP (TOOL_BAR_ITEM_KEY);
8188 Lisp_Object capt = PROP (TOOL_BAR_ITEM_CAPTION); 8192 Lisp_Object tcapt = PROP (TOOL_BAR_ITEM_CAPTION);
8189 const char *label = SYMBOLP (key) ? SSDATA (SYMBOL_NAME (key)) : ""; 8193 const char *label = SYMBOLP (tkey) ? SSDATA (SYMBOL_NAME (tkey)) : "";
8190 const char *caption = STRINGP (capt) ? SSDATA (capt) : ""; 8194 const char *capt = STRINGP (tcapt) ? SSDATA (tcapt) : "";
8191 EMACS_INT max_lbl = 2 * tool_bar_max_label_size; 8195 EMACS_INT max_lbl = 2 * tool_bar_max_label_size;
8192 char *buf = (char *) xmalloc (max_lbl + 1); 8196 char *buf = (char *) xmalloc (max_lbl + 1);
8193 Lisp_Object new_lbl; 8197 Lisp_Object new_lbl;
8194 size_t caption_len = strlen (caption); 8198 size_t caption_len = strlen (capt);
8195 8199
8196 if (caption_len <= max_lbl && caption[0] != '\0') 8200 if (caption_len <= max_lbl && capt[0] != '\0')
8197 { 8201 {
8198 strcpy (buf, caption); 8202 strcpy (buf, capt);
8199 while (caption_len > 0 && buf[caption_len - 1] == '.') 8203 while (caption_len > 0 && buf[caption_len - 1] == '.')
8200 caption_len--; 8204 caption_len--;
8201 buf[caption_len] = '\0'; 8205 buf[caption_len] = '\0';
8202 label = caption = buf; 8206 label = capt = buf;
8203 } 8207 }
8204 8208
8205 if (strlen (label) <= max_lbl && label[0] != '\0') 8209 if (strlen (label) <= max_lbl && label[0] != '\0')
8206 { 8210 {
8207 int i; 8211 int j;
8208 if (label != buf) 8212 if (label != buf)
8209 strcpy (buf, label); 8213 strcpy (buf, label);
8210 8214
8211 for (i = 0; buf[i] != '\0'; ++i) 8215 for (j = 0; buf[j] != '\0'; ++j)
8212 if (buf[i] == '-') 8216 if (buf[j] == '-')
8213 buf[i] = ' '; 8217 buf[j] = ' ';
8214 label = buf; 8218 label = buf;
8215
8216 } 8219 }
8217 else 8220 else
8218 label = ""; 8221 label = "";
@@ -8871,7 +8874,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
8871 8874
8872 /* The length of the echo buffer when we started reading, and 8875 /* The length of the echo buffer when we started reading, and
8873 the length of this_command_keys when we started reading. */ 8876 the length of this_command_keys when we started reading. */
8874 int echo_start; 8877 int echo_start IF_LINT (= 0);
8875 int keys_start; 8878 int keys_start;
8876 8879
8877 /* The number of keymaps we're scanning right now, and the number of 8880 /* The number of keymaps we're scanning right now, and the number of
@@ -8949,7 +8952,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
8949 Lisp_Object first_event; 8952 Lisp_Object first_event;
8950#endif 8953#endif
8951 8954
8952 Lisp_Object original_uppercase; 8955 Lisp_Object original_uppercase IF_LINT (= Qnil);
8953 int original_uppercase_position = -1; 8956 int original_uppercase_position = -1;
8954 8957
8955 /* Gets around Microsoft compiler limitations. */ 8958 /* Gets around Microsoft compiler limitations. */
@@ -8964,9 +8967,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
8964 int junk; 8967 int junk;
8965#endif 8968#endif
8966 8969
8967 struct gcpro gcpro1; 8970 struct gcpro outer_gcpro1;
8968 8971
8969 GCPRO1 (fake_prefixed_keys); 8972 GCPRO1_VAR (fake_prefixed_keys, outer_gcpro);
8970 raw_keybuf_count = 0; 8973 raw_keybuf_count = 0;
8971 8974
8972 last_nonmenu_event = Qnil; 8975 last_nonmenu_event = Qnil;
@@ -9128,7 +9131,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9128 while those allow us to restart the entire key sequence, 9131 while those allow us to restart the entire key sequence,
9129 echo_local_start and keys_local_start allow us to throw away 9132 echo_local_start and keys_local_start allow us to throw away
9130 just one key. */ 9133 just one key. */
9131 int echo_local_start, keys_local_start, local_first_binding; 9134 int echo_local_start IF_LINT (= 0);
9135 int keys_local_start, local_first_binding;
9132 9136
9133 eassert (indec.end == t || (indec.end > t && indec.end <= mock_input)); 9137 eassert (indec.end == t || (indec.end > t && indec.end <= mock_input));
9134 eassert (indec.start <= indec.end); 9138 eassert (indec.start <= indec.end);
@@ -9260,7 +9264,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9260 if (EQ (key, Qt)) 9264 if (EQ (key, Qt))
9261 { 9265 {
9262 unbind_to (count, Qnil); 9266 unbind_to (count, Qnil);
9263 UNGCPRO; 9267 UNGCPRO_VAR (outer_gcpro);
9264 return -1; 9268 return -1;
9265 } 9269 }
9266 9270
@@ -9838,7 +9842,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9838 && /* indec.start >= t && fkey.start >= t && */ keytran.start >= t 9842 && /* indec.start >= t && fkey.start >= t && */ keytran.start >= t
9839 && INTEGERP (key) 9843 && INTEGERP (key)
9840 && ((CHARACTERP (make_number (XINT (key) & ~CHAR_MODIFIER_MASK)) 9844 && ((CHARACTERP (make_number (XINT (key) & ~CHAR_MODIFIER_MASK))
9841 && UPPERCASEP (XINT (key) & ~CHAR_MODIFIER_MASK)) 9845 && uppercasep (XINT (key) & ~CHAR_MODIFIER_MASK))
9842 || (XINT (key) & shift_modifier))) 9846 || (XINT (key) & shift_modifier)))
9843 { 9847 {
9844 Lisp_Object new_key; 9848 Lisp_Object new_key;
@@ -9849,7 +9853,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9849 if (XINT (key) & shift_modifier) 9853 if (XINT (key) & shift_modifier)
9850 XSETINT (new_key, XINT (key) & ~shift_modifier); 9854 XSETINT (new_key, XINT (key) & ~shift_modifier);
9851 else 9855 else
9852 XSETINT (new_key, (DOWNCASE (XINT (key) & ~CHAR_MODIFIER_MASK) 9856 XSETINT (new_key, (downcase (XINT (key) & ~CHAR_MODIFIER_MASK)
9853 | (XINT (key) & CHAR_MODIFIER_MASK))); 9857 | (XINT (key) & CHAR_MODIFIER_MASK)));
9854 9858
9855 /* We have to do this unconditionally, regardless of whether 9859 /* We have to do this unconditionally, regardless of whether
@@ -9877,13 +9881,13 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9877 || (INTEGERP (key) 9881 || (INTEGERP (key)
9878 && (KEY_TO_CHAR (key) 9882 && (KEY_TO_CHAR (key)
9879 < XCHAR_TABLE (BVAR (current_buffer, downcase_table))->size) 9883 < XCHAR_TABLE (BVAR (current_buffer, downcase_table))->size)
9880 && UPPERCASEP (KEY_TO_CHAR (key)))) 9884 && uppercasep (KEY_TO_CHAR (key))))
9881 { 9885 {
9882 Lisp_Object new_key 9886 Lisp_Object new_key
9883 = (modifiers & shift_modifier 9887 = (modifiers & shift_modifier
9884 ? apply_modifiers (modifiers & ~shift_modifier, 9888 ? apply_modifiers (modifiers & ~shift_modifier,
9885 XCAR (breakdown)) 9889 XCAR (breakdown))
9886 : make_number (DOWNCASE (KEY_TO_CHAR (key)) | modifiers)); 9890 : make_number (downcase (KEY_TO_CHAR (key)) | modifiers));
9887 9891
9888 original_uppercase = key; 9892 original_uppercase = key;
9889 original_uppercase_position = t - 1; 9893 original_uppercase_position = t - 1;
@@ -9943,7 +9947,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9943 add_command_key (keybuf[t]); 9947 add_command_key (keybuf[t]);
9944 } 9948 }
9945 9949
9946 UNGCPRO; 9950 UNGCPRO_VAR (outer_gcpro);
9947 return t; 9951 return t;
9948} 9952}
9949 9953
@@ -9990,11 +9994,11 @@ is nil, then the event will be put off until after the current key sequence.
9990sequences, where they wouldn't conflict with ordinary bindings. See 9994sequences, where they wouldn't conflict with ordinary bindings. See
9991`function-key-map' for more details. 9995`function-key-map' for more details.
9992 9996
9993The optional fifth argument COMMAND-LOOP, if non-nil, means 9997The optional fifth argument CMD-LOOP, if non-nil, means
9994that this key sequence is being read by something that will 9998that this key sequence is being read by something that will
9995read commands one after another. It should be nil if the caller 9999read commands one after another. It should be nil if the caller
9996will read just one key sequence. */) 10000will read just one key sequence. */)
9997 (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object command_loop) 10001 (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object cmd_loop)
9998{ 10002{
9999 Lisp_Object keybuf[30]; 10003 Lisp_Object keybuf[30];
10000 register int i; 10004 register int i;
@@ -10006,9 +10010,9 @@ will read just one key sequence. */)
10006 QUIT; 10010 QUIT;
10007 10011
10008 specbind (Qinput_method_exit_on_first_char, 10012 specbind (Qinput_method_exit_on_first_char,
10009 (NILP (command_loop) ? Qt : Qnil)); 10013 (NILP (cmd_loop) ? Qt : Qnil));
10010 specbind (Qinput_method_use_echo_area, 10014 specbind (Qinput_method_use_echo_area,
10011 (NILP (command_loop) ? Qt : Qnil)); 10015 (NILP (cmd_loop) ? Qt : Qnil));
10012 10016
10013 memset (keybuf, 0, sizeof keybuf); 10017 memset (keybuf, 0, sizeof keybuf);
10014 GCPRO1 (keybuf[0]); 10018 GCPRO1 (keybuf[0]);
@@ -10051,7 +10055,7 @@ will read just one key sequence. */)
10051DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector, 10055DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
10052 Sread_key_sequence_vector, 1, 5, 0, 10056 Sread_key_sequence_vector, 1, 5, 0,
10053 doc: /* Like `read-key-sequence' but always return a vector. */) 10057 doc: /* Like `read-key-sequence' but always return a vector. */)
10054 (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object command_loop) 10058 (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object cmd_loop)
10055{ 10059{
10056 Lisp_Object keybuf[30]; 10060 Lisp_Object keybuf[30];
10057 register int i; 10061 register int i;
@@ -10063,9 +10067,9 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
10063 QUIT; 10067 QUIT;
10064 10068
10065 specbind (Qinput_method_exit_on_first_char, 10069 specbind (Qinput_method_exit_on_first_char,
10066 (NILP (command_loop) ? Qt : Qnil)); 10070 (NILP (cmd_loop) ? Qt : Qnil));
10067 specbind (Qinput_method_use_echo_area, 10071 specbind (Qinput_method_use_echo_area,
10068 (NILP (command_loop) ? Qt : Qnil)); 10072 (NILP (cmd_loop) ? Qt : Qnil));
10069 10073
10070 memset (keybuf, 0, sizeof keybuf); 10074 memset (keybuf, 0, sizeof keybuf);
10071 GCPRO1 (keybuf[0]); 10075 GCPRO1 (keybuf[0]);
diff --git a/src/keyboard.h b/src/keyboard.h
index 10bf16d5c5c..00745a09140 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -90,7 +90,7 @@ struct kboard
90 90
91 /* User-supplied table to translate input characters through. */ 91 /* User-supplied table to translate input characters through. */
92 Lisp_Object KBOARD_INTERNAL_FIELD (Vkeyboard_translate_table); 92 Lisp_Object KBOARD_INTERNAL_FIELD (Vkeyboard_translate_table);
93 93
94 /* Last command that may be repeated by `repeat'. */ 94 /* Last command that may be repeated by `repeat'. */
95 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_repeatable_command); 95 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_repeatable_command);
96 96
@@ -140,12 +140,12 @@ struct kboard
140 /* Keymap mapping keys to alternative preferred forms. 140 /* Keymap mapping keys to alternative preferred forms.
141 See the DEFVAR for more documentation. */ 141 See the DEFVAR for more documentation. */
142 Lisp_Object KBOARD_INTERNAL_FIELD (Vlocal_function_key_map); 142 Lisp_Object KBOARD_INTERNAL_FIELD (Vlocal_function_key_map);
143 143
144 /* Keymap mapping ASCII function key sequences onto their preferred 144 /* Keymap mapping ASCII function key sequences onto their preferred
145 forms. Initialized by the terminal-specific lisp files. See the 145 forms. Initialized by the terminal-specific lisp files. See the
146 DEFVAR for more documentation. */ 146 DEFVAR for more documentation. */
147 Lisp_Object KBOARD_INTERNAL_FIELD (Vinput_decode_map); 147 Lisp_Object KBOARD_INTERNAL_FIELD (Vinput_decode_map);
148 148
149 /* Minibufferless frames on this display use this frame's minibuffer. */ 149 /* Minibufferless frames on this display use this frame's minibuffer. */
150 Lisp_Object KBOARD_INTERNAL_FIELD (Vdefault_minibuffer_frame); 150 Lisp_Object KBOARD_INTERNAL_FIELD (Vdefault_minibuffer_frame);
151 151
@@ -494,6 +494,7 @@ extern int input_polling_used (void);
494extern void clear_input_pending (void); 494extern void clear_input_pending (void);
495extern int requeued_events_pending_p (void); 495extern int requeued_events_pending_p (void);
496extern void bind_polling_period (int); 496extern void bind_polling_period (int);
497extern int make_ctrl_char (int);
497extern void stuff_buffered_input (Lisp_Object); 498extern void stuff_buffered_input (Lisp_Object);
498extern void clear_waiting_for_input (void); 499extern void clear_waiting_for_input (void);
499extern void swallow_events (int); 500extern void swallow_events (int);
@@ -517,4 +518,8 @@ extern void add_user_signal (int, const char *);
517extern int tty_read_avail_input (struct terminal *, int, 518extern int tty_read_avail_input (struct terminal *, int,
518 struct input_event *); 519 struct input_event *);
519extern EMACS_TIME timer_check (int); 520extern EMACS_TIME timer_check (int);
521extern void mark_kboards (void);
520 522
523#ifdef WINDOWSNT
524extern const char *const lispy_function_keys[];
525#endif
diff --git a/src/keymap.c b/src/keymap.c
index 4459ef07d68..06968a0d944 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -34,9 +34,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
34#include "keymap.h" 34#include "keymap.h"
35#include "window.h" 35#include "window.h"
36 36
37/* The number of elements in keymap vectors. */
38#define DENSE_TABLE_SIZE (0200)
39
40/* Actually allocate storage for these variables */ 37/* Actually allocate storage for these variables */
41 38
42Lisp_Object current_global_map; /* Current global keymap */ 39Lisp_Object current_global_map; /* Current global keymap */
@@ -191,8 +188,9 @@ when reading a key-sequence to be looked-up in this keymap. */)
191 If the map needs to be autoloaded, but AUTOLOAD is zero (and ERROR 188 If the map needs to be autoloaded, but AUTOLOAD is zero (and ERROR
192 is zero as well), return Qt. 189 is zero as well), return Qt.
193 190
194 ERROR controls how we respond if OBJECT isn't a keymap. 191 ERROR_IF_NOT_KEYMAP controls how we respond if OBJECT isn't a keymap.
195 If ERROR is non-zero, signal an error; otherwise, just return Qnil. 192 If ERROR_IF_NOT_KEYMAP is non-zero, signal an error; otherwise,
193 just return Qnil.
196 194
197 Note that most of the time, we don't want to pursue autoloads. 195 Note that most of the time, we don't want to pursue autoloads.
198 Functions like Faccessible_keymaps which scan entire keymap trees 196 Functions like Faccessible_keymaps which scan entire keymap trees
@@ -204,7 +202,7 @@ when reading a key-sequence to be looked-up in this keymap. */)
204 do_autoload which can GC. */ 202 do_autoload which can GC. */
205 203
206Lisp_Object 204Lisp_Object
207get_keymap (Lisp_Object object, int error, int autoload) 205get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload)
208{ 206{
209 Lisp_Object tem; 207 Lisp_Object tem;
210 208
@@ -222,7 +220,7 @@ get_keymap (Lisp_Object object, int error, int autoload)
222 220
223 /* Should we do an autoload? Autoload forms for keymaps have 221 /* Should we do an autoload? Autoload forms for keymaps have
224 Qkeymap as their fifth element. */ 222 Qkeymap as their fifth element. */
225 if ((autoload || !error) && EQ (XCAR (tem), Qautoload) 223 if ((autoload || !error_if_not_keymap) && EQ (XCAR (tem), Qautoload)
226 && SYMBOLP (object)) 224 && SYMBOLP (object))
227 { 225 {
228 Lisp_Object tail; 226 Lisp_Object tail;
@@ -247,7 +245,7 @@ get_keymap (Lisp_Object object, int error, int autoload)
247 } 245 }
248 246
249 end: 247 end:
250 if (error) 248 if (error_if_not_keymap)
251 wrong_type_argument (Qkeymapp, object); 249 wrong_type_argument (Qkeymapp, object);
252 return Qnil; 250 return Qnil;
253} 251}
@@ -255,7 +253,7 @@ get_keymap (Lisp_Object object, int error, int autoload)
255/* Return the parent map of KEYMAP, or nil if it has none. 253/* Return the parent map of KEYMAP, or nil if it has none.
256 We assume that KEYMAP is a valid keymap. */ 254 We assume that KEYMAP is a valid keymap. */
257 255
258Lisp_Object 256static Lisp_Object
259keymap_parent (Lisp_Object keymap, int autoload) 257keymap_parent (Lisp_Object keymap, int autoload)
260{ 258{
261 Lisp_Object list; 259 Lisp_Object list;
@@ -283,7 +281,7 @@ If KEYMAP has no parent, return nil. */)
283} 281}
284 282
285/* Check whether MAP is one of MAPS parents. */ 283/* Check whether MAP is one of MAPS parents. */
286int 284static int
287keymap_memberp (Lisp_Object map, Lisp_Object maps) 285keymap_memberp (Lisp_Object map, Lisp_Object maps)
288{ 286{
289 if (NILP (map)) return 0; 287 if (NILP (map)) return 0;
@@ -468,19 +466,19 @@ access_keymap (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int au
468 /* See if there is a meta-map. If there's none, there is 466 /* See if there is a meta-map. If there's none, there is
469 no binding for IDX, unless a default binding exists in MAP. */ 467 no binding for IDX, unless a default binding exists in MAP. */
470 struct gcpro gcpro1; 468 struct gcpro gcpro1;
471 Lisp_Object meta_map; 469 Lisp_Object event_meta_map;
472 GCPRO1 (map); 470 GCPRO1 (map);
473 /* A strange value in which Meta is set would cause 471 /* A strange value in which Meta is set would cause
474 infinite recursion. Protect against that. */ 472 infinite recursion. Protect against that. */
475 if (XINT (meta_prefix_char) & CHAR_META) 473 if (XINT (meta_prefix_char) & CHAR_META)
476 meta_prefix_char = make_number (27); 474 meta_prefix_char = make_number (27);
477 meta_map = get_keymap (access_keymap (map, meta_prefix_char, 475 event_meta_map = get_keymap (access_keymap (map, meta_prefix_char,
478 t_ok, noinherit, autoload), 476 t_ok, noinherit, autoload),
479 0, autoload); 477 0, autoload);
480 UNGCPRO; 478 UNGCPRO;
481 if (CONSP (meta_map)) 479 if (CONSP (event_meta_map))
482 { 480 {
483 map = meta_map; 481 map = event_meta_map;
484 idx = make_number (XUINT (idx) & ~meta_modifier); 482 idx = make_number (XUINT (idx) & ~meta_modifier);
485 } 483 }
486 else if (t_ok) 484 else if (t_ok)
@@ -598,7 +596,7 @@ map_keymap_char_table_item (Lisp_Object args, Lisp_Object key, Lisp_Object val)
598 596
599/* Call FUN for every binding in MAP and stop at (and return) the parent. 597/* Call FUN for every binding in MAP and stop at (and return) the parent.
600 FUN is called with 4 arguments: FUN (KEY, BINDING, ARGS, DATA). */ 598 FUN is called with 4 arguments: FUN (KEY, BINDING, ARGS, DATA). */
601Lisp_Object 599static Lisp_Object
602map_keymap_internal (Lisp_Object map, 600map_keymap_internal (Lisp_Object map,
603 map_keymap_function_t fun, 601 map_keymap_function_t fun,
604 Lisp_Object args, 602 Lisp_Object args,
@@ -960,7 +958,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def)
960 958
961EXFUN (Fcopy_keymap, 1); 959EXFUN (Fcopy_keymap, 1);
962 960
963Lisp_Object 961static Lisp_Object
964copy_keymap_item (Lisp_Object elt) 962copy_keymap_item (Lisp_Object elt)
965{ 963{
966 Lisp_Object res, tem; 964 Lisp_Object res, tem;
@@ -1142,10 +1140,10 @@ binding KEY to DEF is added at the front of KEYMAP. */)
1142 int i = ASIZE (def); 1140 int i = ASIZE (def);
1143 while (--i >= 0) 1141 while (--i >= 0)
1144 { 1142 {
1145 Lisp_Object c = AREF (def, i); 1143 Lisp_Object defi = AREF (def, i);
1146 if (CONSP (c) && lucid_event_type_list_p (c)) 1144 if (CONSP (defi) && lucid_event_type_list_p (defi))
1147 c = Fevent_convert_list (c); 1145 defi = Fevent_convert_list (defi);
1148 ASET (tmp, i, c); 1146 ASET (tmp, i, defi);
1149 } 1147 }
1150 def = tmp; 1148 def = tmp;
1151 } 1149 }
@@ -1337,7 +1335,7 @@ define_as_prefix (Lisp_Object keymap, Lisp_Object c)
1337 1335
1338/* Append a key to the end of a key sequence. We always make a vector. */ 1336/* Append a key to the end of a key sequence. We always make a vector. */
1339 1337
1340Lisp_Object 1338static Lisp_Object
1341append_key (Lisp_Object key_sequence, Lisp_Object key) 1339append_key (Lisp_Object key_sequence, Lisp_Object key)
1342{ 1340{
1343 Lisp_Object args[2]; 1341 Lisp_Object args[2];
@@ -2439,7 +2437,7 @@ around function keys and event symbols. */)
2439 return Qnil; 2437 return Qnil;
2440} 2438}
2441 2439
2442char * 2440static char *
2443push_text_char_description (register unsigned int c, register char *p) 2441push_text_char_description (register unsigned int c, register char *p)
2444{ 2442{
2445 if (c >= 0200) 2443 if (c >= 0200)
@@ -2774,8 +2772,8 @@ remapped command in the returned list. */)
2774 considered remapped sequences yet, copy them over and 2772 considered remapped sequences yet, copy them over and
2775 process them. */ 2773 process them. */
2776 || (!remapped && (sequences = remapped_sequences, 2774 || (!remapped && (sequences = remapped_sequences,
2777 remapped = 1), 2775 remapped = 1,
2778 CONSP (sequences))) 2776 CONSP (sequences))))
2779 { 2777 {
2780 Lisp_Object sequence, function; 2778 Lisp_Object sequence, function;
2781 2779
@@ -2815,9 +2813,9 @@ remapped command in the returned list. */)
2815 seems to be only one menu item to report. */ 2813 seems to be only one menu item to report. */
2816 if (! NILP (sequence)) 2814 if (! NILP (sequence))
2817 { 2815 {
2818 Lisp_Object tem; 2816 Lisp_Object tem1;
2819 tem = Faref (sequence, make_number (ASIZE (sequence) - 1)); 2817 tem1 = Faref (sequence, make_number (ASIZE (sequence) - 1));
2820 if (STRINGP (tem)) 2818 if (STRINGP (tem1))
2821 Faset (sequence, make_number (ASIZE (sequence) - 1), 2819 Faset (sequence, make_number (ASIZE (sequence) - 1),
2822 build_string ("(any string)")); 2820 build_string ("(any string)"));
2823 } 2821 }
@@ -3122,13 +3120,13 @@ key binding\n\
3122 /* Delete from MAPS each element that is for the menu bar. */ 3120 /* Delete from MAPS each element that is for the menu bar. */
3123 for (list = maps; CONSP (list); list = XCDR (list)) 3121 for (list = maps; CONSP (list); list = XCDR (list))
3124 { 3122 {
3125 Lisp_Object elt, prefix, tem; 3123 Lisp_Object elt, elt_prefix, tem;
3126 3124
3127 elt = XCAR (list); 3125 elt = XCAR (list);
3128 prefix = Fcar (elt); 3126 elt_prefix = Fcar (elt);
3129 if (XVECTOR (prefix)->size >= 1) 3127 if (XVECTOR (elt_prefix)->size >= 1)
3130 { 3128 {
3131 tem = Faref (prefix, make_number (0)); 3129 tem = Faref (elt_prefix, make_number (0));
3132 if (EQ (tem, Qmenu_bar)) 3130 if (EQ (tem, Qmenu_bar))
3133 maps = Fdelq (elt, maps); 3131 maps = Fdelq (elt, maps);
3134 } 3132 }
@@ -3153,10 +3151,10 @@ key binding\n\
3153 3151
3154 for (; CONSP (maps); maps = XCDR (maps)) 3152 for (; CONSP (maps); maps = XCDR (maps))
3155 { 3153 {
3156 register Lisp_Object elt, prefix, tail; 3154 register Lisp_Object elt, elt_prefix, tail;
3157 3155
3158 elt = XCAR (maps); 3156 elt = XCAR (maps);
3159 prefix = Fcar (elt); 3157 elt_prefix = Fcar (elt);
3160 3158
3161 sub_shadows = Qnil; 3159 sub_shadows = Qnil;
3162 3160
@@ -3168,8 +3166,8 @@ key binding\n\
3168 3166
3169 /* If the sequence by which we reach this keymap is zero-length, 3167 /* If the sequence by which we reach this keymap is zero-length,
3170 then the shadow map for this keymap is just SHADOW. */ 3168 then the shadow map for this keymap is just SHADOW. */
3171 if ((STRINGP (prefix) && SCHARS (prefix) == 0) 3169 if ((STRINGP (elt_prefix) && SCHARS (elt_prefix) == 0)
3172 || (VECTORP (prefix) && XVECTOR (prefix)->size == 0)) 3170 || (VECTORP (elt_prefix) && XVECTOR (elt_prefix)->size == 0))
3173 ; 3171 ;
3174 /* If the sequence by which we reach this keymap actually has 3172 /* If the sequence by which we reach this keymap actually has
3175 some elements, then the sequence's definition in SHADOW is 3173 some elements, then the sequence's definition in SHADOW is
@@ -3195,12 +3193,12 @@ key binding\n\
3195 for (tail = orig_maps; !EQ (tail, maps); tail = XCDR (tail)) 3193 for (tail = orig_maps; !EQ (tail, maps); tail = XCDR (tail))
3196 { 3194 {
3197 Lisp_Object tem; 3195 Lisp_Object tem;
3198 tem = Fequal (Fcar (XCAR (tail)), prefix); 3196 tem = Fequal (Fcar (XCAR (tail)), elt_prefix);
3199 if (!NILP (tem)) 3197 if (!NILP (tem))
3200 sub_shadows = Fcons (XCDR (XCAR (tail)), sub_shadows); 3198 sub_shadows = Fcons (XCDR (XCAR (tail)), sub_shadows);
3201 } 3199 }
3202 3200
3203 describe_map (Fcdr (elt), prefix, 3201 describe_map (Fcdr (elt), elt_prefix,
3204 transl ? describe_translation : describe_command, 3202 transl ? describe_translation : describe_command,
3205 partial, sub_shadows, &seen, nomenu, mention_shadow); 3203 partial, sub_shadows, &seen, nomenu, mention_shadow);
3206 3204
diff --git a/src/lisp.h b/src/lisp.h
index e4788e63f5b..9cbaf24cacf 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -27,9 +27,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
27 types of run time checks for Lisp objects. */ 27 types of run time checks for Lisp objects. */
28 28
29#ifdef GC_CHECK_CONS_LIST 29#ifdef GC_CHECK_CONS_LIST
30#define CHECK_CONS_LIST() check_cons_list() 30extern void check_cons_list (void);
31#define CHECK_CONS_LIST() check_cons_list ()
31#else 32#else
32#define CHECK_CONS_LIST() ((void)0) 33#define CHECK_CONS_LIST() ((void) 0)
33#endif 34#endif
34 35
35/* These are default choices for the types to use. */ 36/* These are default choices for the types to use. */
@@ -85,7 +86,7 @@ extern void die (const char *, const char *, int) NO_RETURN;
85/* Define an Emacs version of "assert", since some system ones are 86/* Define an Emacs version of "assert", since some system ones are
86 flaky. */ 87 flaky. */
87#ifndef ENABLE_CHECKING 88#ifndef ENABLE_CHECKING
88#define eassert(X) (void) 0 89#define eassert(X) ((void) (0 && (X))) /* Check that X compiles. */
89#else /* ENABLE_CHECKING */ 90#else /* ENABLE_CHECKING */
90#if defined (__GNUC__) && __GNUC__ >= 2 && defined (__STDC__) 91#if defined (__GNUC__) && __GNUC__ >= 2 && defined (__STDC__)
91#define eassert(cond) CHECK(cond,"assertion failed: " #cond) 92#define eassert(cond) CHECK(cond,"assertion failed: " #cond)
@@ -841,6 +842,9 @@ struct Lisp_Vector
841 842
842#endif /* not __GNUC__ */ 843#endif /* not __GNUC__ */
843 844
845/* Nonzero iff C is an ASCII character. */
846#define ASCII_CHAR_P(c) ((unsigned) (c) < 0x80)
847
844/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII 848/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII
845 characters. Do not check validity of CT. */ 849 characters. Do not check validity of CT. */
846#define CHAR_TABLE_REF(CT, IDX) \ 850#define CHAR_TABLE_REF(CT, IDX) \
@@ -2046,50 +2050,6 @@ extern int pending_signals;
2046 2050
2047#define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) 2051#define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit))
2048 2052
2049/* Variables used locally in the following case handling macros. */
2050extern int case_temp1;
2051extern Lisp_Object case_temp2;
2052
2053/* Current buffer's map from characters to lower-case characters. */
2054
2055#define DOWNCASE_TABLE BVAR (current_buffer, downcase_table)
2056
2057/* Current buffer's map from characters to upper-case characters. */
2058
2059#define UPCASE_TABLE BVAR (current_buffer, upcase_table)
2060
2061/* Downcase a character, or make no change if that cannot be done. */
2062
2063#define DOWNCASE(CH) \
2064 ((case_temp1 = (CH), \
2065 case_temp2 = CHAR_TABLE_REF (DOWNCASE_TABLE, case_temp1), \
2066 NATNUMP (case_temp2)) \
2067 ? XFASTINT (case_temp2) : case_temp1)
2068
2069/* 1 if CH is upper case. */
2070
2071#define UPPERCASEP(CH) (DOWNCASE (CH) != (CH))
2072
2073/* 1 if CH is neither upper nor lower case. */
2074
2075#define NOCASEP(CH) (UPCASE1 (CH) == (CH))
2076
2077/* 1 if CH is lower case. */
2078
2079#define LOWERCASEP(CH) (!UPPERCASEP (CH) && !NOCASEP(CH))
2080
2081/* Upcase a character, or make no change if that cannot be done. */
2082
2083#define UPCASE(CH) (!UPPERCASEP (CH) ? UPCASE1 (CH) : (CH))
2084
2085/* Upcase a character known to be not upper case. */
2086
2087#define UPCASE1(CH) \
2088 ((case_temp1 = (CH), \
2089 case_temp2 = CHAR_TABLE_REF (UPCASE_TABLE, case_temp1), \
2090 NATNUMP (case_temp2)) \
2091 ? XFASTINT (case_temp2) : case_temp1)
2092
2093extern Lisp_Object Vascii_downcase_table, Vascii_upcase_table; 2053extern Lisp_Object Vascii_downcase_table, Vascii_upcase_table;
2094extern Lisp_Object Vascii_canon_table, Vascii_eqv_table; 2054extern Lisp_Object Vascii_canon_table, Vascii_eqv_table;
2095 2055
@@ -2155,126 +2115,143 @@ struct gcpro
2155 || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) 2115 || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS)
2156 2116
2157 2117
2118#define GCPRO1(var) \
2119 GCPRO1_VAR (var, gcpro)
2120#define GCPRO2(var1, var2) \
2121 GCPRO2_VAR (var1, var2, gcpro)
2122#define GCPRO3(var1, var2, var3) \
2123 GCPRO3_VAR (var1, var2, var3, gcpro)
2124#define GCPRO4(var1, var2, var3, var4) \
2125 GCPRO4_VAR (var1, var2, var3, var4, gcpro)
2126#define GCPRO5(var1, var2, var3, var4, var5) \
2127 GCPRO5_VAR (var1, var2, var3, var4, var5, gcpro)
2128#define GCPRO6(var1, var2, var3, var4, var5, var6) \
2129 GCPRO6_VAR (var1, var2, var3, var4, var5, var6, gcpro)
2130#define UNGCPRO UNGCPRO_VAR (gcpro)
2131
2158#if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS 2132#if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS
2159 2133
2160/* Do something silly with gcproN vars just so gcc shuts up. */ 2134/* Do something silly with gcproN vars just so gcc shuts up. */
2161/* You get warnings from MIPSPro... */ 2135/* You get warnings from MIPSPro... */
2162 2136
2163#define GCPRO1(varname) ((void) gcpro1) 2137#define GCPRO1_VAR(var, gcpro) ((void) gcpro##1)
2164#define GCPRO2(varname1, varname2)(((void) gcpro2, (void) gcpro1)) 2138#define GCPRO2_VAR(var1, var2, gcpro) \
2165#define GCPRO3(varname1, varname2, varname3) \ 2139 ((void) gcpro##2, (void) gcpro##1)
2166 (((void) gcpro3, (void) gcpro2, (void) gcpro1)) 2140#define GCPRO3_VAR(var1, var2, var3, gcpro) \
2167#define GCPRO4(varname1, varname2, varname3, varname4) \ 2141 ((void) gcpro##3, (void) gcpro##2, (void) gcpro##1)
2168 (((void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1)) 2142#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \
2169#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ 2143 ((void) gcpro##4, (void) gcpro##3, (void) gcpro##2, (void) gcpro##1)
2170 (((void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1)) 2144#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \
2171#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ 2145 ((void) gcpro##5, (void) gcpro##4, (void) gcpro##3, (void) gcpro##2, \
2172 (((void) gcpro6, (void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1)) 2146 (void) gcpro##1)
2173#define UNGCPRO ((void) 0) 2147#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \
2148 ((void) gcpro##6, (void) gcpro##5, (void) gcpro##4, (void) gcpro##3, \
2149 (void) gcpro##2, (void) gcpro##1)
2150#define UNGCPRO_VAR(gcpro) ((void) 0)
2174 2151
2175#else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ 2152#else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */
2176 2153
2177#ifndef DEBUG_GCPRO 2154#ifndef DEBUG_GCPRO
2178 2155
2179#define GCPRO1(varname) \ 2156#define GCPRO1_VAR(var, gcpro) \
2180 {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ 2157 {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \
2181 gcprolist = &gcpro1; } 2158 gcprolist = &gcpro##1; }
2182 2159
2183#define GCPRO2(varname1, varname2) \ 2160#define GCPRO2_VAR(var1, var2, gcpro) \
2184 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ 2161 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
2185 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ 2162 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
2186 gcprolist = &gcpro2; } 2163 gcprolist = &gcpro##2; }
2187 2164
2188#define GCPRO3(varname1, varname2, varname3) \ 2165#define GCPRO3_VAR(var1, var2, var3, gcpro) \
2189 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ 2166 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
2190 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ 2167 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
2191 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ 2168 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
2192 gcprolist = &gcpro3; } 2169 gcprolist = &gcpro##3; }
2193 2170
2194#define GCPRO4(varname1, varname2, varname3, varname4) \ 2171#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \
2195 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ 2172 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
2196 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ 2173 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
2197 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ 2174 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
2198 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ 2175 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
2199 gcprolist = &gcpro4; } 2176 gcprolist = &gcpro##4; }
2200 2177
2201#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ 2178#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \
2202 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ 2179 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
2203 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ 2180 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
2204 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ 2181 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
2205 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ 2182 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
2206 gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ 2183 gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \
2207 gcprolist = &gcpro5; } 2184 gcprolist = &gcpro##5; }
2208 2185
2209#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ 2186#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \
2210 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ 2187 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
2211 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ 2188 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
2212 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ 2189 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
2213 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ 2190 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
2214 gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ 2191 gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \
2215 gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ 2192 gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \
2216 gcprolist = &gcpro6; } 2193 gcprolist = &gcpro##6; }
2217 2194
2218#define UNGCPRO (gcprolist = gcpro1.next) 2195#define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1.next)
2219 2196
2220#else 2197#else
2221 2198
2222extern int gcpro_level; 2199extern int gcpro_level;
2223 2200
2224#define GCPRO1(varname) \ 2201#define GCPRO1_VAR(var, gcpro) \
2225 {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ 2202 {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \
2226 gcpro1.level = gcpro_level++; \ 2203 gcpro##1.level = gcpro_level++; \
2227 gcprolist = &gcpro1; } 2204 gcprolist = &gcpro##1; }
2228 2205
2229#define GCPRO2(varname1, varname2) \ 2206#define GCPRO2_VAR(var1, var2, gcpro) \
2230 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ 2207 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
2231 gcpro1.level = gcpro_level; \ 2208 gcpro##1.level = gcpro_level; \
2232 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ 2209 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
2233 gcpro2.level = gcpro_level++; \ 2210 gcpro##2.level = gcpro_level++; \
2234 gcprolist = &gcpro2; } 2211 gcprolist = &gcpro##2; }
2235 2212
2236#define GCPRO3(varname1, varname2, varname3) \ 2213#define GCPRO3_VAR(var1, var2, var3, gcpro) \
2237 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ 2214 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
2238 gcpro1.level = gcpro_level; \ 2215 gcpro##1.level = gcpro_level; \
2239 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ 2216 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
2240 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ 2217 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
2241 gcpro3.level = gcpro_level++; \ 2218 gcpro##3.level = gcpro_level++; \
2242 gcprolist = &gcpro3; } 2219 gcprolist = &gcpro##3; }
2243 2220
2244#define GCPRO4(varname1, varname2, varname3, varname4) \ 2221#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \
2245 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ 2222 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
2246 gcpro1.level = gcpro_level; \ 2223 gcpro##1.level = gcpro_level; \
2247 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ 2224 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
2248 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ 2225 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
2249 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ 2226 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
2250 gcpro4.level = gcpro_level++; \ 2227 gcpro##4.level = gcpro_level++; \
2251 gcprolist = &gcpro4; } 2228 gcprolist = &gcpro##4; }
2252 2229
2253#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ 2230#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \
2254 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ 2231 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
2255 gcpro1.level = gcpro_level; \ 2232 gcpro##1.level = gcpro_level; \
2256 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ 2233 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
2257 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ 2234 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
2258 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ 2235 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
2259 gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ 2236 gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \
2260 gcpro5.level = gcpro_level++; \ 2237 gcpro##5.level = gcpro_level++; \
2261 gcprolist = &gcpro5; } 2238 gcprolist = &gcpro##5; }
2262 2239
2263#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ 2240#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \
2264 {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ 2241 {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
2265 gcpro1.level = gcpro_level; \ 2242 gcpro##1.level = gcpro_level; \
2266 gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ 2243 gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
2267 gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ 2244 gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
2268 gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ 2245 gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
2269 gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ 2246 gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \
2270 gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ 2247 gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \
2271 gcpro6.level = gcpro_level++; \ 2248 gcpro##6.level = gcpro_level++; \
2272 gcprolist = &gcpro6; } 2249 gcprolist = &gcpro##6; }
2273 2250
2274#define UNGCPRO \ 2251#define UNGCPRO_VAR(gcpro) \
2275 ((--gcpro_level != gcpro1.level) \ 2252 ((--gcpro_level != gcpro##1.level) \
2276 ? (abort (), 0) \ 2253 ? (abort (), 0) \
2277 : ((gcprolist = gcpro1.next), 0)) 2254 : ((gcprolist = gcpro##1.next), 0))
2278 2255
2279#endif /* DEBUG_GCPRO */ 2256#endif /* DEBUG_GCPRO */
2280#endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ 2257#endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */
@@ -2542,7 +2519,10 @@ extern Lisp_Object fmod_float (Lisp_Object x, Lisp_Object y);
2542/* Defined in fringe.c */ 2519/* Defined in fringe.c */
2543extern void syms_of_fringe (void); 2520extern void syms_of_fringe (void);
2544extern void init_fringe (void); 2521extern void init_fringe (void);
2522#ifdef HAVE_WINDOW_SYSTEM
2523extern void mark_fringe_data (void);
2545extern void init_fringe_once (void); 2524extern void init_fringe_once (void);
2525#endif /* HAVE_WINDOW_SYSTEM */
2546 2526
2547/* Defined in image.c */ 2527/* Defined in image.c */
2548extern Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data; 2528extern Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data;
@@ -2606,6 +2586,7 @@ extern void syms_of_insdel (void);
2606 2586
2607/* Defined in dispnew.c */ 2587/* Defined in dispnew.c */
2608extern Lisp_Object selected_frame; 2588extern Lisp_Object selected_frame;
2589extern Lisp_Object Vwindow_system;
2609EXFUN (Fding, 1); 2590EXFUN (Fding, 1);
2610EXFUN (Fredraw_frame, 1); 2591EXFUN (Fredraw_frame, 1);
2611EXFUN (Fsleep_for, 2); 2592EXFUN (Fsleep_for, 2);
@@ -2788,6 +2769,7 @@ EXFUN (Fprint, 2);
2788EXFUN (Ferror_message_string, 1); 2769EXFUN (Ferror_message_string, 1);
2789extern Lisp_Object Qstandard_output; 2770extern Lisp_Object Qstandard_output;
2790extern Lisp_Object Qexternal_debugging_output; 2771extern Lisp_Object Qexternal_debugging_output;
2772extern void debug_output_compilation_hack (int);
2791extern void temp_output_buffer_setup (const char *); 2773extern void temp_output_buffer_setup (const char *);
2792extern int print_level; 2774extern int print_level;
2793extern Lisp_Object Qprint_escape_newlines; 2775extern Lisp_Object Qprint_escape_newlines;
@@ -2899,8 +2881,10 @@ extern Lisp_Object safe_call (int, Lisp_Object *);
2899extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); 2881extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object);
2900extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object); 2882extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object);
2901extern void init_eval (void); 2883extern void init_eval (void);
2884extern void mark_backtrace (void);
2902extern void syms_of_eval (void); 2885extern void syms_of_eval (void);
2903 2886
2887/* Defined in editfns.c */
2904extern Lisp_Object Qfield; 2888extern Lisp_Object Qfield;
2905EXFUN (Fcurrent_message, 0); 2889EXFUN (Fcurrent_message, 0);
2906EXFUN (Fgoto_char, 1); 2890EXFUN (Fgoto_char, 1);
@@ -2940,6 +2924,8 @@ extern Lisp_Object make_buffer_string (EMACS_INT, EMACS_INT, int);
2940extern Lisp_Object make_buffer_string_both (EMACS_INT, EMACS_INT, EMACS_INT, 2924extern Lisp_Object make_buffer_string_both (EMACS_INT, EMACS_INT, EMACS_INT,
2941 EMACS_INT, int); 2925 EMACS_INT, int);
2942extern void init_editfns (void); 2926extern void init_editfns (void);
2927const char *get_system_name (void);
2928const char *get_operating_system_release (void);
2943extern void syms_of_editfns (void); 2929extern void syms_of_editfns (void);
2944EXFUN (Fconstrain_to_field, 5); 2930EXFUN (Fconstrain_to_field, 5);
2945EXFUN (Ffield_end, 3); 2931EXFUN (Ffield_end, 3);
@@ -2996,12 +2982,14 @@ extern EMACS_INT marker_byte_position (Lisp_Object);
2996extern void clear_charpos_cache (struct buffer *); 2982extern void clear_charpos_cache (struct buffer *);
2997extern EMACS_INT charpos_to_bytepos (EMACS_INT); 2983extern EMACS_INT charpos_to_bytepos (EMACS_INT);
2998extern EMACS_INT buf_charpos_to_bytepos (struct buffer *, EMACS_INT); 2984extern EMACS_INT buf_charpos_to_bytepos (struct buffer *, EMACS_INT);
2985extern EMACS_INT verify_bytepos (EMACS_INT charpos);
2999extern EMACS_INT buf_bytepos_to_charpos (struct buffer *, EMACS_INT); 2986extern EMACS_INT buf_bytepos_to_charpos (struct buffer *, EMACS_INT);
3000extern void unchain_marker (struct Lisp_Marker *marker); 2987extern void unchain_marker (struct Lisp_Marker *marker);
3001extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object); 2988extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object);
3002extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT); 2989extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT);
3003extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object, 2990extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object,
3004 EMACS_INT, EMACS_INT); 2991 EMACS_INT, EMACS_INT);
2992extern int count_markers (struct buffer *);
3005extern void syms_of_marker (void); 2993extern void syms_of_marker (void);
3006 2994
3007/* Defined in fileio.c */ 2995/* Defined in fileio.c */
@@ -3010,6 +2998,7 @@ extern Lisp_Object Qfile_error;
3010extern Lisp_Object Qfile_exists_p; 2998extern Lisp_Object Qfile_exists_p;
3011extern Lisp_Object Qfile_directory_p; 2999extern Lisp_Object Qfile_directory_p;
3012extern Lisp_Object Qinsert_file_contents; 3000extern Lisp_Object Qinsert_file_contents;
3001extern Lisp_Object Qfile_name_history;
3013EXFUN (Ffind_file_name_handler, 2); 3002EXFUN (Ffind_file_name_handler, 2);
3014EXFUN (Ffile_name_as_directory, 1); 3003EXFUN (Ffile_name_as_directory, 1);
3015EXFUN (Fexpand_file_name, 2); 3004EXFUN (Fexpand_file_name, 2);
@@ -3051,6 +3040,10 @@ EXFUN (Fset_match_data, 2);
3051EXFUN (Fmatch_beginning, 1); 3040EXFUN (Fmatch_beginning, 1);
3052EXFUN (Fmatch_end, 1); 3041EXFUN (Fmatch_end, 1);
3053extern void record_unwind_save_match_data (void); 3042extern void record_unwind_save_match_data (void);
3043struct re_registers;
3044extern struct re_pattern_buffer *compile_pattern (Lisp_Object,
3045 struct re_registers *,
3046 Lisp_Object, int, int);
3054extern int fast_string_match (Lisp_Object, Lisp_Object); 3047extern int fast_string_match (Lisp_Object, Lisp_Object);
3055extern int fast_c_string_match_ignore_case (Lisp_Object, const char *); 3048extern int fast_c_string_match_ignore_case (Lisp_Object, const char *);
3056extern int fast_string_match_ignore_case (Lisp_Object, Lisp_Object); 3049extern int fast_string_match_ignore_case (Lisp_Object, Lisp_Object);
@@ -3142,6 +3135,7 @@ extern void cmd_error_internal (Lisp_Object, const char *);
3142extern Lisp_Object command_loop_1 (void); 3135extern Lisp_Object command_loop_1 (void);
3143extern Lisp_Object recursive_edit_1 (void); 3136extern Lisp_Object recursive_edit_1 (void);
3144extern void record_auto_save (void); 3137extern void record_auto_save (void);
3138extern void force_auto_save_soon (void);
3145extern void init_keyboard (void); 3139extern void init_keyboard (void);
3146extern void syms_of_keyboard (void); 3140extern void syms_of_keyboard (void);
3147extern void keys_of_keyboard (void); 3141extern void keys_of_keyboard (void);
@@ -3194,6 +3188,7 @@ extern Lisp_Object decode_env_path (const char *, const char *);
3194extern Lisp_Object empty_unibyte_string, empty_multibyte_string; 3188extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
3195extern Lisp_Object Qfile_name_handler_alist; 3189extern Lisp_Object Qfile_name_handler_alist;
3196extern void (*fatal_error_signal_hook) (void); 3190extern void (*fatal_error_signal_hook) (void);
3191extern SIGTYPE fatal_error_signal (int);
3197EXFUN (Fkill_emacs, 1) NO_RETURN; 3192EXFUN (Fkill_emacs, 1) NO_RETURN;
3198#if HAVE_SETLOCALE 3193#if HAVE_SETLOCALE
3199void fixup_locale (void); 3194void fixup_locale (void);
@@ -3341,6 +3336,8 @@ extern void child_setup_tty (int);
3341extern void setup_pty (int); 3336extern void setup_pty (int);
3342extern int set_window_size (int, int, int); 3337extern int set_window_size (int, int, int);
3343extern void create_process (Lisp_Object, char **, Lisp_Object); 3338extern void create_process (Lisp_Object, char **, Lisp_Object);
3339extern long get_random (void);
3340extern void seed_random (long);
3344extern int emacs_open (const char *, int, int); 3341extern int emacs_open (const char *, int, int);
3345extern int emacs_close (int); 3342extern int emacs_close (int);
3346extern int emacs_read (int, char *, unsigned int); 3343extern int emacs_read (int, char *, unsigned int);
@@ -3387,6 +3384,7 @@ extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object,
3387 3384
3388/* Defined in term.c */ 3385/* Defined in term.c */
3389extern int *char_ins_del_vector; 3386extern int *char_ins_del_vector;
3387extern void mark_ttys (void);
3390extern void syms_of_term (void); 3388extern void syms_of_term (void);
3391extern void fatal (const char *msgid, ...) NO_RETURN; 3389extern void fatal (const char *msgid, ...) NO_RETURN;
3392 3390
@@ -3533,6 +3531,13 @@ extern void init_system_name (void);
3533 && (circular_list_error ((list)), 1))) \ 3531 && (circular_list_error ((list)), 1))) \
3534 : 0))) 3532 : 0)))
3535 3533
3534/* Use this to suppress gcc's `...may be used before initialized' warnings. */
3535#ifdef lint
3536# define IF_LINT(Code) Code
3537#else
3538# define IF_LINT(Code) /* empty */
3539#endif
3540
3536/* The ubiquitous min and max macros. */ 3541/* The ubiquitous min and max macros. */
3537 3542
3538#ifdef max 3543#ifdef max
diff --git a/src/lread.c b/src/lread.c
index c8c07bed476..7a8d7cf9a6a 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -370,15 +370,15 @@ unreadchar (Lisp_Object readcharfun, int c)
370 else if (BUFFERP (readcharfun)) 370 else if (BUFFERP (readcharfun))
371 { 371 {
372 struct buffer *b = XBUFFER (readcharfun); 372 struct buffer *b = XBUFFER (readcharfun);
373 EMACS_INT charpos = BUF_PT (b);
373 EMACS_INT bytepos = BUF_PT_BYTE (b); 374 EMACS_INT bytepos = BUF_PT_BYTE (b);
374 375
375 BUF_PT (b)--;
376 if (! NILP (BVAR (b, enable_multibyte_characters))) 376 if (! NILP (BVAR (b, enable_multibyte_characters)))
377 BUF_DEC_POS (b, bytepos); 377 BUF_DEC_POS (b, bytepos);
378 else 378 else
379 bytepos--; 379 bytepos--;
380 380
381 BUF_PT_BYTE (b) = bytepos; 381 SET_BUF_PT_BOTH (b, charpos - 1, bytepos);
382 } 382 }
383 else if (MARKERP (readcharfun)) 383 else if (MARKERP (readcharfun))
384 { 384 {
@@ -1133,10 +1133,10 @@ Return t if the file exists and loads successfully. */)
1133 Also, just loading a file recursively is not always an error in 1133 Also, just loading a file recursively is not always an error in
1134 the general case; the second load may do something different. */ 1134 the general case; the second load may do something different. */
1135 { 1135 {
1136 int count = 0; 1136 int load_count = 0;
1137 Lisp_Object tem; 1137 Lisp_Object tem;
1138 for (tem = Vloads_in_progress; CONSP (tem); tem = XCDR (tem)) 1138 for (tem = Vloads_in_progress; CONSP (tem); tem = XCDR (tem))
1139 if (!NILP (Fequal (found, XCAR (tem))) && (++count > 3)) 1139 if (!NILP (Fequal (found, XCAR (tem))) && (++load_count > 3))
1140 { 1140 {
1141 if (fd >= 0) 1141 if (fd >= 0)
1142 emacs_close (fd); 1142 emacs_close (fd);
@@ -1787,8 +1787,8 @@ readevalloop (Lisp_Object readcharfun,
1787 to a different value when evaluated. */ 1787 to a different value when evaluated. */
1788 if (BUFFERP (readcharfun)) 1788 if (BUFFERP (readcharfun))
1789 { 1789 {
1790 struct buffer *b = XBUFFER (readcharfun); 1790 struct buffer *buf = XBUFFER (readcharfun);
1791 if (BUF_PT (b) == BUF_ZV (b)) 1791 if (BUF_PT (buf) == BUF_ZV (buf))
1792 continue_reading_p = 0; 1792 continue_reading_p = 0;
1793 } 1793 }
1794 } 1794 }
@@ -2810,7 +2810,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2810 { 2810 {
2811 char *p = read_buffer; 2811 char *p = read_buffer;
2812 char *end = read_buffer + read_buffer_size; 2812 char *end = read_buffer + read_buffer_size;
2813 register int c; 2813 register int ch;
2814 /* Nonzero if we saw an escape sequence specifying 2814 /* Nonzero if we saw an escape sequence specifying
2815 a multibyte character. */ 2815 a multibyte character. */
2816 int force_multibyte = 0; 2816 int force_multibyte = 0;
@@ -2820,8 +2820,8 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2820 int cancel = 0; 2820 int cancel = 0;
2821 int nchars = 0; 2821 int nchars = 0;
2822 2822
2823 while ((c = READCHAR) >= 0 2823 while ((ch = READCHAR) >= 0
2824 && c != '\"') 2824 && ch != '\"')
2825 { 2825 {
2826 if (end - p < MAX_MULTIBYTE_LENGTH) 2826 if (end - p < MAX_MULTIBYTE_LENGTH)
2827 { 2827 {
@@ -2832,44 +2832,44 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2832 end = read_buffer + read_buffer_size; 2832 end = read_buffer + read_buffer_size;
2833 } 2833 }
2834 2834
2835 if (c == '\\') 2835 if (ch == '\\')
2836 { 2836 {
2837 int modifiers; 2837 int modifiers;
2838 2838
2839 c = read_escape (readcharfun, 1); 2839 ch = read_escape (readcharfun, 1);
2840 2840
2841 /* C is -1 if \ newline has just been seen */ 2841 /* CH is -1 if \ newline has just been seen */
2842 if (c == -1) 2842 if (ch == -1)
2843 { 2843 {
2844 if (p == read_buffer) 2844 if (p == read_buffer)
2845 cancel = 1; 2845 cancel = 1;
2846 continue; 2846 continue;
2847 } 2847 }
2848 2848
2849 modifiers = c & CHAR_MODIFIER_MASK; 2849 modifiers = ch & CHAR_MODIFIER_MASK;
2850 c = c & ~CHAR_MODIFIER_MASK; 2850 ch = ch & ~CHAR_MODIFIER_MASK;
2851 2851
2852 if (CHAR_BYTE8_P (c)) 2852 if (CHAR_BYTE8_P (ch))
2853 force_singlebyte = 1; 2853 force_singlebyte = 1;
2854 else if (! ASCII_CHAR_P (c)) 2854 else if (! ASCII_CHAR_P (ch))
2855 force_multibyte = 1; 2855 force_multibyte = 1;
2856 else /* i.e. ASCII_CHAR_P (c) */ 2856 else /* i.e. ASCII_CHAR_P (ch) */
2857 { 2857 {
2858 /* Allow `\C- ' and `\C-?'. */ 2858 /* Allow `\C- ' and `\C-?'. */
2859 if (modifiers == CHAR_CTL) 2859 if (modifiers == CHAR_CTL)
2860 { 2860 {
2861 if (c == ' ') 2861 if (ch == ' ')
2862 c = 0, modifiers = 0; 2862 ch = 0, modifiers = 0;
2863 else if (c == '?') 2863 else if (ch == '?')
2864 c = 127, modifiers = 0; 2864 ch = 127, modifiers = 0;
2865 } 2865 }
2866 if (modifiers & CHAR_SHIFT) 2866 if (modifiers & CHAR_SHIFT)
2867 { 2867 {
2868 /* Shift modifier is valid only with [A-Za-z]. */ 2868 /* Shift modifier is valid only with [A-Za-z]. */
2869 if (c >= 'A' && c <= 'Z') 2869 if (ch >= 'A' && ch <= 'Z')
2870 modifiers &= ~CHAR_SHIFT; 2870 modifiers &= ~CHAR_SHIFT;
2871 else if (c >= 'a' && c <= 'z') 2871 else if (ch >= 'a' && ch <= 'z')
2872 c -= ('a' - 'A'), modifiers &= ~CHAR_SHIFT; 2872 ch -= ('a' - 'A'), modifiers &= ~CHAR_SHIFT;
2873 } 2873 }
2874 2874
2875 if (modifiers & CHAR_META) 2875 if (modifiers & CHAR_META)
@@ -2877,7 +2877,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2877 /* Move the meta bit to the right place for a 2877 /* Move the meta bit to the right place for a
2878 string. */ 2878 string. */
2879 modifiers &= ~CHAR_META; 2879 modifiers &= ~CHAR_META;
2880 c = BYTE8_TO_CHAR (c | 0x80); 2880 ch = BYTE8_TO_CHAR (ch | 0x80);
2881 force_singlebyte = 1; 2881 force_singlebyte = 1;
2882 } 2882 }
2883 } 2883 }
@@ -2885,20 +2885,20 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2885 /* Any modifiers remaining are invalid. */ 2885 /* Any modifiers remaining are invalid. */
2886 if (modifiers) 2886 if (modifiers)
2887 error ("Invalid modifier in string"); 2887 error ("Invalid modifier in string");
2888 p += CHAR_STRING (c, (unsigned char *) p); 2888 p += CHAR_STRING (ch, (unsigned char *) p);
2889 } 2889 }
2890 else 2890 else
2891 { 2891 {
2892 p += CHAR_STRING (c, (unsigned char *) p); 2892 p += CHAR_STRING (ch, (unsigned char *) p);
2893 if (CHAR_BYTE8_P (c)) 2893 if (CHAR_BYTE8_P (ch))
2894 force_singlebyte = 1; 2894 force_singlebyte = 1;
2895 else if (! ASCII_CHAR_P (c)) 2895 else if (! ASCII_CHAR_P (ch))
2896 force_multibyte = 1; 2896 force_multibyte = 1;
2897 } 2897 }
2898 nchars++; 2898 nchars++;
2899 } 2899 }
2900 2900
2901 if (c < 0) 2901 if (ch < 0)
2902 end_of_file_error (); 2902 end_of_file_error ();
2903 2903
2904 /* If purifying, and string starts with \ newline, 2904 /* If purifying, and string starts with \ newline,
@@ -2917,8 +2917,9 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
2917 p = read_buffer + nchars; 2917 p = read_buffer + nchars;
2918 } 2918 }
2919 else 2919 else
2920 /* Otherwise, READ_BUFFER contains only ASCII. */ 2920 {
2921 ; 2921 /* Otherwise, READ_BUFFER contains only ASCII. */
2922 }
2922 2923
2923 /* We want readchar_count to be the number of characters, not 2924 /* We want readchar_count to be the number of characters, not
2924 bytes. Hence we adjust for multibyte characters in the 2925 bytes. Hence we adjust for multibyte characters in the
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 7a702fd45bf..62c40ca1f94 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -221,7 +221,7 @@ GLOBAL_SOURCES = dosfns.c msdos.c \
221 region-cache.c sound.c atimer.c \ 221 region-cache.c sound.c atimer.c \
222 doprnt.c intervals.c textprop.c composite.c 222 doprnt.c intervals.c textprop.c composite.c
223SOME_MACHINE_OBJECTS = dosfns.o msdos.o \ 223SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
224 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o dbusbind.o 224 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o dbusbind.o
225obj = $(GLOBAL_SOURCES:.c=.o) 225obj = $(GLOBAL_SOURCES:.c=.o)
226 226
227globals.h: gl-stamp 227globals.h: gl-stamp
@@ -386,6 +386,7 @@ $(BLD)/alloc.$(O) : \
386 $(EMACS_ROOT)/nt/inc/unistd.h \ 386 $(EMACS_ROOT)/nt/inc/unistd.h \
387 $(EMACS_ROOT)/nt/inc/sys/time.h \ 387 $(EMACS_ROOT)/nt/inc/sys/time.h \
388 $(LISP_H) \ 388 $(LISP_H) \
389 $(PROCESS_H) \
389 $(SRC)/atimer.h \ 390 $(SRC)/atimer.h \
390 $(SRC)/blockinput.h \ 391 $(SRC)/blockinput.h \
391 $(SRC)/buffer.h \ 392 $(SRC)/buffer.h \
@@ -396,7 +397,6 @@ $(BLD)/alloc.$(O) : \
396 $(SRC)/frame.h \ 397 $(SRC)/frame.h \
397 $(SRC)/intervals.h \ 398 $(SRC)/intervals.h \
398 $(SRC)/keyboard.h \ 399 $(SRC)/keyboard.h \
399 $(PROCESS_H) \
400 $(SRC)/puresize.h \ 400 $(SRC)/puresize.h \
401 $(SRC)/syssignal.h \ 401 $(SRC)/syssignal.h \
402 $(SRC)/systime.h \ 402 $(SRC)/systime.h \
@@ -484,8 +484,10 @@ $(BLD)/callproc.$(O) : \
484 $(CONFIG_H) \ 484 $(CONFIG_H) \
485 $(EMACS_ROOT)/nt/inc/unistd.h \ 485 $(EMACS_ROOT)/nt/inc/unistd.h \
486 $(EMACS_ROOT)/nt/inc/sys/file.h \ 486 $(EMACS_ROOT)/nt/inc/sys/file.h \
487 $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
487 $(EMACS_ROOT)/nt/inc/sys/time.h \ 488 $(EMACS_ROOT)/nt/inc/sys/time.h \
488 $(LISP_H) \ 489 $(LISP_H) \
490 $(PROCESS_H) \
489 $(SRC)/atimer.h \ 491 $(SRC)/atimer.h \
490 $(SRC)/blockinput.h \ 492 $(SRC)/blockinput.h \
491 $(SRC)/buffer.h \ 493 $(SRC)/buffer.h \
@@ -497,7 +499,6 @@ $(BLD)/callproc.$(O) : \
497 $(SRC)/dispextern.h \ 499 $(SRC)/dispextern.h \
498 $(SRC)/epaths.h \ 500 $(SRC)/epaths.h \
499 $(SRC)/frame.h \ 501 $(SRC)/frame.h \
500 $(PROCESS_H) \
501 $(SRC)/syssignal.h \ 502 $(SRC)/syssignal.h \
502 $(SRC)/systime.h \ 503 $(SRC)/systime.h \
503 $(SRC)/systty.h \ 504 $(SRC)/systty.h \
@@ -653,6 +654,7 @@ $(BLD)/dired.$(O) : \
653 $(EMACS_ROOT)/nt/inc/unistd.h \ 654 $(EMACS_ROOT)/nt/inc/unistd.h \
654 $(EMACS_ROOT)/nt/inc/sys/dir.h \ 655 $(EMACS_ROOT)/nt/inc/sys/dir.h \
655 $(EMACS_ROOT)/nt/inc/sys/time.h \ 656 $(EMACS_ROOT)/nt/inc/sys/time.h \
657 $(EMACS_ROOT)/lib/filemode.h \
656 $(LISP_H) \ 658 $(LISP_H) \
657 $(SRC)/atimer.h \ 659 $(SRC)/atimer.h \
658 $(SRC)/blockinput.h \ 660 $(SRC)/blockinput.h \
@@ -662,7 +664,6 @@ $(BLD)/dired.$(O) : \
662 $(SRC)/coding.h \ 664 $(SRC)/coding.h \
663 $(SRC)/commands.h \ 665 $(SRC)/commands.h \
664 $(SRC)/composite.h \ 666 $(SRC)/composite.h \
665 $(EMACS_ROOT)/lib/filemode.h \
666 $(SRC)/ndir.h \ 667 $(SRC)/ndir.h \
667 $(SRC)/regex.h \ 668 $(SRC)/regex.h \
668 $(SRC)/systime.h 669 $(SRC)/systime.h
@@ -673,6 +674,7 @@ $(BLD)/dispnew.$(O) : \
673 $(EMACS_ROOT)/nt/inc/unistd.h \ 674 $(EMACS_ROOT)/nt/inc/unistd.h \
674 $(EMACS_ROOT)/nt/inc/sys/time.h \ 675 $(EMACS_ROOT)/nt/inc/sys/time.h \
675 $(LISP_H) \ 676 $(LISP_H) \
677 $(PROCESS_H) \
676 $(SRC)/atimer.h \ 678 $(SRC)/atimer.h \
677 $(SRC)/blockinput.h \ 679 $(SRC)/blockinput.h \
678 $(SRC)/buffer.h \ 680 $(SRC)/buffer.h \
@@ -687,7 +689,6 @@ $(BLD)/dispnew.$(O) : \
687 $(SRC)/indent.h \ 689 $(SRC)/indent.h \
688 $(SRC)/intervals.h \ 690 $(SRC)/intervals.h \
689 $(SRC)/keyboard.h \ 691 $(SRC)/keyboard.h \
690 $(PROCESS_H) \
691 $(SRC)/syssignal.h \ 692 $(SRC)/syssignal.h \
692 $(SRC)/systime.h \ 693 $(SRC)/systime.h \
693 $(SRC)/termchar.h \ 694 $(SRC)/termchar.h \
@@ -726,6 +727,7 @@ $(BLD)/editfns.$(O) : \
726 $(EMACS_ROOT)/nt/inc/pwd.h \ 727 $(EMACS_ROOT)/nt/inc/pwd.h \
727 $(EMACS_ROOT)/nt/inc/unistd.h \ 728 $(EMACS_ROOT)/nt/inc/unistd.h \
728 $(EMACS_ROOT)/nt/inc/sys/time.h \ 729 $(EMACS_ROOT)/nt/inc/sys/time.h \
730 $(EMACS_ROOT)/lib/intprops.h \
729 $(EMACS_ROOT)/lib/strftime.h \ 731 $(EMACS_ROOT)/lib/strftime.h \
730 $(LISP_H) \ 732 $(LISP_H) \
731 $(SRC)/atimer.h \ 733 $(SRC)/atimer.h \
@@ -746,8 +748,10 @@ $(BLD)/emacs.$(O) : \
746 $(CONFIG_H) \ 748 $(CONFIG_H) \
747 $(EMACS_ROOT)/nt/inc/unistd.h \ 749 $(EMACS_ROOT)/nt/inc/unistd.h \
748 $(EMACS_ROOT)/nt/inc/sys/file.h \ 750 $(EMACS_ROOT)/nt/inc/sys/file.h \
751 $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
749 $(EMACS_ROOT)/nt/inc/sys/time.h \ 752 $(EMACS_ROOT)/nt/inc/sys/time.h \
750 $(LISP_H) \ 753 $(LISP_H) \
754 $(PROCESS_H) \
751 $(SRC)/atimer.h \ 755 $(SRC)/atimer.h \
752 $(SRC)/blockinput.h \ 756 $(SRC)/blockinput.h \
753 $(SRC)/buffer.h \ 757 $(SRC)/buffer.h \
@@ -756,15 +760,14 @@ $(BLD)/emacs.$(O) : \
756 $(SRC)/composite.h \ 760 $(SRC)/composite.h \
757 $(SRC)/dispextern.h \ 761 $(SRC)/dispextern.h \
758 $(SRC)/frame.h \ 762 $(SRC)/frame.h \
759 $(SRC)/gnutls.h \
760 $(SRC)/intervals.h \ 763 $(SRC)/intervals.h \
761 $(SRC)/keyboard.h \ 764 $(SRC)/keyboard.h \
762 $(SRC)/keymap.h \ 765 $(SRC)/keymap.h \
763 $(PROCESS_H) \
764 $(SRC)/syssignal.h \ 766 $(SRC)/syssignal.h \
765 $(SRC)/systime.h \ 767 $(SRC)/systime.h \
766 $(SRC)/systty.h \ 768 $(SRC)/systty.h \
767 $(SRC)/termhooks.h \ 769 $(SRC)/termhooks.h \
770 $(SRC)/unexec.h \
768 $(SRC)/w32.h \ 771 $(SRC)/w32.h \
769 $(SRC)/w32gui.h \ 772 $(SRC)/w32gui.h \
770 $(SRC)/w32heap.h \ 773 $(SRC)/w32heap.h \
@@ -836,6 +839,7 @@ $(BLD)/fns.$(O) : \
836 $(CONFIG_H) \ 839 $(CONFIG_H) \
837 $(EMACS_ROOT)/nt/inc/langinfo.h \ 840 $(EMACS_ROOT)/nt/inc/langinfo.h \
838 $(EMACS_ROOT)/nt/inc/nl_types.h \ 841 $(EMACS_ROOT)/nt/inc/nl_types.h \
842 $(EMACS_ROOT)/nt/inc/stdint.h \
839 $(EMACS_ROOT)/nt/inc/unistd.h \ 843 $(EMACS_ROOT)/nt/inc/unistd.h \
840 $(EMACS_ROOT)/nt/inc/sys/time.h \ 844 $(EMACS_ROOT)/nt/inc/sys/time.h \
841 $(EMACS_ROOT)/lib/md5.h \ 845 $(EMACS_ROOT)/lib/md5.h \
@@ -1029,6 +1033,7 @@ $(BLD)/keyboard.$(O) : \
1029 $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ 1033 $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
1030 $(EMACS_ROOT)/nt/inc/sys/time.h \ 1034 $(EMACS_ROOT)/nt/inc/sys/time.h \
1031 $(LISP_H) \ 1035 $(LISP_H) \
1036 $(PROCESS_H) \
1032 $(SRC)/atimer.h \ 1037 $(SRC)/atimer.h \
1033 $(SRC)/blockinput.h \ 1038 $(SRC)/blockinput.h \
1034 $(SRC)/buffer.h \ 1039 $(SRC)/buffer.h \
@@ -1043,7 +1048,6 @@ $(BLD)/keyboard.$(O) : \
1043 $(SRC)/keyboard.h \ 1048 $(SRC)/keyboard.h \
1044 $(SRC)/keymap.h \ 1049 $(SRC)/keymap.h \
1045 $(SRC)/macros.h \ 1050 $(SRC)/macros.h \
1046 $(PROCESS_H) \
1047 $(SRC)/puresize.h \ 1051 $(SRC)/puresize.h \
1048 $(SRC)/syntax.h \ 1052 $(SRC)/syntax.h \
1049 $(SRC)/syssignal.h \ 1053 $(SRC)/syssignal.h \
@@ -1181,11 +1185,11 @@ $(BLD)/w32.$(O) : \
1181 $(EMACS_ROOT)/nt/inc/sys/socket.h \ 1185 $(EMACS_ROOT)/nt/inc/sys/socket.h \
1182 $(EMACS_ROOT)/nt/inc/sys/time.h \ 1186 $(EMACS_ROOT)/nt/inc/sys/time.h \
1183 $(LISP_H) \ 1187 $(LISP_H) \
1188 $(PROCESS_H) \
1184 $(SRC)/coding.h \ 1189 $(SRC)/coding.h \
1185 $(SRC)/composite.h \ 1190 $(SRC)/composite.h \
1186 $(SRC)/dispextern.h \ 1191 $(SRC)/dispextern.h \
1187 $(SRC)/ndir.h \ 1192 $(SRC)/ndir.h \
1188 $(PROCESS_H) \
1189 $(SRC)/systime.h \ 1193 $(SRC)/systime.h \
1190 $(SRC)/w32.h \ 1194 $(SRC)/w32.h \
1191 $(SRC)/w32gui.h \ 1195 $(SRC)/w32gui.h \
@@ -1224,11 +1228,11 @@ $(BLD)/w32proc.$(O) : \
1224 $(EMACS_ROOT)/nt/inc/sys/file.h \ 1228 $(EMACS_ROOT)/nt/inc/sys/file.h \
1225 $(EMACS_ROOT)/nt/inc/sys/time.h \ 1229 $(EMACS_ROOT)/nt/inc/sys/time.h \
1226 $(LISP_H) \ 1230 $(LISP_H) \
1231 $(PROCESS_H) \
1227 $(SRC)/character.h \ 1232 $(SRC)/character.h \
1228 $(SRC)/coding.h \ 1233 $(SRC)/coding.h \
1229 $(SRC)/composite.h \ 1234 $(SRC)/composite.h \
1230 $(SRC)/dispextern.h \ 1235 $(SRC)/dispextern.h \
1231 $(PROCESS_H) \
1232 $(SRC)/syssignal.h \ 1236 $(SRC)/syssignal.h \
1233 $(SRC)/systime.h \ 1237 $(SRC)/systime.h \
1234 $(SRC)/syswait.h \ 1238 $(SRC)/syswait.h \
@@ -1260,6 +1264,7 @@ $(BLD)/print.$(O) : \
1260 $(EMACS_ROOT)/lib/ftoastr.h \ 1264 $(EMACS_ROOT)/lib/ftoastr.h \
1261 $(EMACS_ROOT)/lib/intprops.h \ 1265 $(EMACS_ROOT)/lib/intprops.h \
1262 $(LISP_H) \ 1266 $(LISP_H) \
1267 $(PROCESS_H) \
1263 $(SRC)/atimer.h \ 1268 $(SRC)/atimer.h \
1264 $(SRC)/blockinput.h \ 1269 $(SRC)/blockinput.h \
1265 $(SRC)/buffer.h \ 1270 $(SRC)/buffer.h \
@@ -1273,7 +1278,6 @@ $(BLD)/print.$(O) : \
1273 $(SRC)/frame.h \ 1278 $(SRC)/frame.h \
1274 $(SRC)/intervals.h \ 1279 $(SRC)/intervals.h \
1275 $(SRC)/keyboard.h \ 1280 $(SRC)/keyboard.h \
1276 $(PROCESS_H) \
1277 $(SRC)/systime.h \ 1281 $(SRC)/systime.h \
1278 $(SRC)/termchar.h \ 1282 $(SRC)/termchar.h \
1279 $(SRC)/termhooks.h \ 1283 $(SRC)/termhooks.h \
@@ -1288,9 +1292,11 @@ $(BLD)/process.$(O) : \
1288 $(EMACS_ROOT)/nt/inc/arpa/inet.h \ 1292 $(EMACS_ROOT)/nt/inc/arpa/inet.h \
1289 $(EMACS_ROOT)/nt/inc/netinet/in.h \ 1293 $(EMACS_ROOT)/nt/inc/netinet/in.h \
1290 $(EMACS_ROOT)/nt/inc/sys/file.h \ 1294 $(EMACS_ROOT)/nt/inc/sys/file.h \
1295 $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
1291 $(EMACS_ROOT)/nt/inc/sys/socket.h \ 1296 $(EMACS_ROOT)/nt/inc/sys/socket.h \
1292 $(EMACS_ROOT)/nt/inc/sys/time.h \ 1297 $(EMACS_ROOT)/nt/inc/sys/time.h \
1293 $(LISP_H) \ 1298 $(LISP_H) \
1299 $(PROCESS_H) \
1294 $(SRC)/atimer.h \ 1300 $(SRC)/atimer.h \
1295 $(SRC)/blockinput.h \ 1301 $(SRC)/blockinput.h \
1296 $(SRC)/buffer.h \ 1302 $(SRC)/buffer.h \
@@ -1301,7 +1307,6 @@ $(BLD)/process.$(O) : \
1301 $(SRC)/dispextern.h \ 1307 $(SRC)/dispextern.h \
1302 $(SRC)/frame.h \ 1308 $(SRC)/frame.h \
1303 $(SRC)/keyboard.h \ 1309 $(SRC)/keyboard.h \
1304 $(PROCESS_H) \
1305 $(SRC)/sysselect.h \ 1310 $(SRC)/sysselect.h \
1306 $(SRC)/syssignal.h \ 1311 $(SRC)/syssignal.h \
1307 $(SRC)/systime.h \ 1312 $(SRC)/systime.h \
@@ -1414,10 +1419,12 @@ $(BLD)/sysdep.$(O) : \
1414 $(EMACS_ROOT)/nt/inc/pwd.h \ 1419 $(EMACS_ROOT)/nt/inc/pwd.h \
1415 $(EMACS_ROOT)/nt/inc/unistd.h \ 1420 $(EMACS_ROOT)/nt/inc/unistd.h \
1416 $(EMACS_ROOT)/nt/inc/sys/file.h \ 1421 $(EMACS_ROOT)/nt/inc/sys/file.h \
1422 $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
1417 $(EMACS_ROOT)/nt/inc/sys/socket.h \ 1423 $(EMACS_ROOT)/nt/inc/sys/socket.h \
1418 $(EMACS_ROOT)/nt/inc/sys/time.h \ 1424 $(EMACS_ROOT)/nt/inc/sys/time.h \
1419 $(EMACS_ROOT)/lib/ignore-value.h \ 1425 $(EMACS_ROOT)/lib/ignore-value.h \
1420 $(LISP_H) \ 1426 $(LISP_H) \
1427 $(PROCESS_H) \
1421 $(SRC)/atimer.h \ 1428 $(SRC)/atimer.h \
1422 $(SRC)/blockinput.h \ 1429 $(SRC)/blockinput.h \
1423 $(SRC)/cm.h \ 1430 $(SRC)/cm.h \
@@ -1426,7 +1433,6 @@ $(BLD)/sysdep.$(O) : \
1426 $(SRC)/dispextern.h \ 1433 $(SRC)/dispextern.h \
1427 $(SRC)/frame.h \ 1434 $(SRC)/frame.h \
1428 $(SRC)/keyboard.h \ 1435 $(SRC)/keyboard.h \
1429 $(PROCESS_H) \
1430 $(SRC)/sysselect.h \ 1436 $(SRC)/sysselect.h \
1431 $(SRC)/syssignal.h \ 1437 $(SRC)/syssignal.h \
1432 $(SRC)/systime.h \ 1438 $(SRC)/systime.h \
@@ -1444,6 +1450,7 @@ $(BLD)/term.$(O) : \
1444 $(CONFIG_H) \ 1450 $(CONFIG_H) \
1445 $(EMACS_ROOT)/nt/inc/unistd.h \ 1451 $(EMACS_ROOT)/nt/inc/unistd.h \
1446 $(EMACS_ROOT)/nt/inc/sys/file.h \ 1452 $(EMACS_ROOT)/nt/inc/sys/file.h \
1453 $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
1447 $(EMACS_ROOT)/nt/inc/sys/time.h \ 1454 $(EMACS_ROOT)/nt/inc/sys/time.h \
1448 $(LISP_H) \ 1455 $(LISP_H) \
1449 $(SRC)/atimer.h \ 1456 $(SRC)/atimer.h \
@@ -1466,6 +1473,7 @@ $(BLD)/term.$(O) : \
1466 $(SRC)/termchar.h \ 1473 $(SRC)/termchar.h \
1467 $(SRC)/termhooks.h \ 1474 $(SRC)/termhooks.h \
1468 $(SRC)/termopts.h \ 1475 $(SRC)/termopts.h \
1476 $(SRC)/tparam.h \
1469 $(SRC)/w32gui.h \ 1477 $(SRC)/w32gui.h \
1470 $(SRC)/window.h 1478 $(SRC)/window.h
1471 1479
@@ -1499,7 +1507,8 @@ $(BLD)/textprop.$(O) : \
1499$(BLD)/tparam.$(O) : \ 1507$(BLD)/tparam.$(O) : \
1500 $(SRC)/tparam.c \ 1508 $(SRC)/tparam.c \
1501 $(CONFIG_H) \ 1509 $(CONFIG_H) \
1502 $(LISP_H) 1510 $(LISP_H) \
1511 $(SRC)/tparam.h
1503 1512
1504$(BLD)/undo.$(O) : \ 1513$(BLD)/undo.$(O) : \
1505 $(SRC)/undo.c \ 1514 $(SRC)/undo.c \
@@ -1514,6 +1523,7 @@ $(BLD)/undo.$(O) : \
1514$(BLD)/unexw32.$(O) : \ 1523$(BLD)/unexw32.$(O) : \
1515 $(SRC)/unexw32.c \ 1524 $(SRC)/unexw32.c \
1516 $(CONFIG_H) \ 1525 $(CONFIG_H) \
1526 $(SRC)/unexec.h \
1517 $(SRC)/w32heap.h 1527 $(SRC)/w32heap.h
1518 1528
1519$(BLD)/vm-limit.$(O) : \ 1529$(BLD)/vm-limit.$(O) : \
@@ -1553,6 +1563,7 @@ $(BLD)/xdisp.$(O) : \
1553 $(EMACS_ROOT)/nt/inc/unistd.h \ 1563 $(EMACS_ROOT)/nt/inc/unistd.h \
1554 $(EMACS_ROOT)/nt/inc/sys/time.h \ 1564 $(EMACS_ROOT)/nt/inc/sys/time.h \
1555 $(LISP_H) \ 1565 $(LISP_H) \
1566 $(PROCESS_H) \
1556 $(SRC)/atimer.h \ 1567 $(SRC)/atimer.h \
1557 $(SRC)/blockinput.h \ 1568 $(SRC)/blockinput.h \
1558 $(SRC)/buffer.h \ 1569 $(SRC)/buffer.h \
@@ -1572,7 +1583,6 @@ $(BLD)/xdisp.$(O) : \
1572 $(SRC)/keyboard.h \ 1583 $(SRC)/keyboard.h \
1573 $(SRC)/keymap.h \ 1584 $(SRC)/keymap.h \
1574 $(SRC)/macros.h \ 1585 $(SRC)/macros.h \
1575 $(PROCESS_H) \
1576 $(SRC)/region-cache.h \ 1586 $(SRC)/region-cache.h \
1577 $(SRC)/systime.h \ 1587 $(SRC)/systime.h \
1578 $(SRC)/termchar.h \ 1588 $(SRC)/termchar.h \
@@ -1664,8 +1674,10 @@ $(BLD)/w32term.$(O) : \
1664 $(SRC)/w32term.c \ 1674 $(SRC)/w32term.c \
1665 $(CONFIG_H) \ 1675 $(CONFIG_H) \
1666 $(EMACS_ROOT)/nt/inc/unistd.h \ 1676 $(EMACS_ROOT)/nt/inc/unistd.h \
1677 $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
1667 $(EMACS_ROOT)/nt/inc/sys/time.h \ 1678 $(EMACS_ROOT)/nt/inc/sys/time.h \
1668 $(LISP_H) \ 1679 $(LISP_H) \
1680 $(PROCESS_H) \
1669 $(SRC)/atimer.h \ 1681 $(SRC)/atimer.h \
1670 $(SRC)/blockinput.h \ 1682 $(SRC)/blockinput.h \
1671 $(SRC)/buffer.h \ 1683 $(SRC)/buffer.h \
@@ -1682,7 +1694,6 @@ $(BLD)/w32term.$(O) : \
1682 $(SRC)/intervals.h \ 1694 $(SRC)/intervals.h \
1683 $(SRC)/keyboard.h \ 1695 $(SRC)/keyboard.h \
1684 $(SRC)/keymap.h \ 1696 $(SRC)/keymap.h \
1685 $(PROCESS_H) \
1686 $(SRC)/systime.h \ 1697 $(SRC)/systime.h \
1687 $(SRC)/systty.h \ 1698 $(SRC)/systty.h \
1688 $(SRC)/termchar.h \ 1699 $(SRC)/termchar.h \
@@ -1705,7 +1716,6 @@ $(BLD)/w32select.$(O) : \
1705 $(SRC)/charset.h \ 1716 $(SRC)/charset.h \
1706 $(SRC)/coding.h \ 1717 $(SRC)/coding.h \
1707 $(SRC)/composite.h \ 1718 $(SRC)/composite.h \
1708 $(SRC)/keyboard.h \
1709 $(SRC)/systime.h \ 1719 $(SRC)/systime.h \
1710 $(SRC)/w32gui.h \ 1720 $(SRC)/w32gui.h \
1711 $(SRC)/w32heap.h \ 1721 $(SRC)/w32heap.h \
diff --git a/src/marker.c b/src/marker.c
index 72c564f420f..7d461099140 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -257,9 +257,10 @@ verify_bytepos (EMACS_INT charpos)
257 return below_byte; 257 return below_byte;
258} 258}
259 259
260/* bytepos_to_charpos returns the char position corresponding to BYTEPOS. */ 260/* buf_bytepos_to_charpos returns the char position corresponding to
261 BYTEPOS. */
261 262
262/* This macro is a subroutine of bytepos_to_charpos. 263/* This macro is a subroutine of buf_bytepos_to_charpos.
263 It is used when BYTEPOS is actually the byte position. */ 264 It is used when BYTEPOS is actually the byte position. */
264 265
265#define CONSIDER(BYTEPOS, CHARPOS) \ 266#define CONSIDER(BYTEPOS, CHARPOS) \
@@ -303,12 +304,6 @@ verify_bytepos (EMACS_INT charpos)
303} 304}
304 305
305EMACS_INT 306EMACS_INT
306bytepos_to_charpos (EMACS_INT bytepos)
307{
308 return buf_bytepos_to_charpos (current_buffer, bytepos);
309}
310
311EMACS_INT
312buf_bytepos_to_charpos (struct buffer *b, EMACS_INT bytepos) 307buf_bytepos_to_charpos (struct buffer *b, EMACS_INT bytepos)
313{ 308{
314 struct Lisp_Marker *tail; 309 struct Lisp_Marker *tail;
@@ -896,4 +891,3 @@ syms_of_marker (void)
896 doc: /* Non-nil enables debugging checks in byte/char position conversions. */); 891 doc: /* Non-nil enables debugging checks in byte/char position conversions. */);
897 byte_debug_flag = 0; 892 byte_debug_flag = 0;
898} 893}
899
diff --git a/src/minibuf.c b/src/minibuf.c
index 75a24686d5a..986765ae6fb 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -72,6 +72,7 @@ Lisp_Object Qcompletion_ignore_case;
72Lisp_Object Qminibuffer_completion_table; 72Lisp_Object Qminibuffer_completion_table;
73Lisp_Object Qminibuffer_completion_predicate; 73Lisp_Object Qminibuffer_completion_predicate;
74Lisp_Object Qminibuffer_completion_confirm; 74Lisp_Object Qminibuffer_completion_confirm;
75Lisp_Object Qcompleting_read_default;
75Lisp_Object Quser_variable_p; 76Lisp_Object Quser_variable_p;
76 77
77Lisp_Object Qminibuffer_default; 78Lisp_Object Qminibuffer_default;
@@ -135,7 +136,7 @@ choose_minibuf_frame (void)
135 } 136 }
136} 137}
137 138
138Lisp_Object 139static Lisp_Object
139choose_minibuf_frame_1 (Lisp_Object ignore) 140choose_minibuf_frame_1 (Lisp_Object ignore)
140{ 141{
141 choose_minibuf_frame (); 142 choose_minibuf_frame ();
@@ -1213,7 +1214,7 @@ is used to further constrain the set of candidates. */)
1213 && (!SYMBOLP (XCAR (collection)) 1214 && (!SYMBOLP (XCAR (collection))
1214 || NILP (XCAR (collection))))) 1215 || NILP (XCAR (collection)))))
1215 ? list_table : function_table)); 1216 ? list_table : function_table));
1216 int index = 0, obsize = 0; 1217 int idx = 0, obsize = 0;
1217 int matchcount = 0; 1218 int matchcount = 0;
1218 int bindcount = -1; 1219 int bindcount = -1;
1219 Lisp_Object bucket, zero, end, tem; 1220 Lisp_Object bucket, zero, end, tem;
@@ -1232,7 +1233,7 @@ is used to further constrain the set of candidates. */)
1232 { 1233 {
1233 collection = check_obarray (collection); 1234 collection = check_obarray (collection);
1234 obsize = XVECTOR (collection)->size; 1235 obsize = XVECTOR (collection)->size;
1235 bucket = XVECTOR (collection)->contents[index]; 1236 bucket = XVECTOR (collection)->contents[idx];
1236 } 1237 }
1237 1238
1238 while (1) 1239 while (1)
@@ -1263,23 +1264,23 @@ is used to further constrain the set of candidates. */)
1263 else 1264 else
1264 XSETFASTINT (bucket, 0); 1265 XSETFASTINT (bucket, 0);
1265 } 1266 }
1266 else if (++index >= obsize) 1267 else if (++idx >= obsize)
1267 break; 1268 break;
1268 else 1269 else
1269 { 1270 {
1270 bucket = XVECTOR (collection)->contents[index]; 1271 bucket = XVECTOR (collection)->contents[idx];
1271 continue; 1272 continue;
1272 } 1273 }
1273 } 1274 }
1274 else /* if (type == hash_table) */ 1275 else /* if (type == hash_table) */
1275 { 1276 {
1276 while (index < HASH_TABLE_SIZE (XHASH_TABLE (collection)) 1277 while (idx < HASH_TABLE_SIZE (XHASH_TABLE (collection))
1277 && NILP (HASH_HASH (XHASH_TABLE (collection), index))) 1278 && NILP (HASH_HASH (XHASH_TABLE (collection), idx)))
1278 index++; 1279 idx++;
1279 if (index >= HASH_TABLE_SIZE (XHASH_TABLE (collection))) 1280 if (idx >= HASH_TABLE_SIZE (XHASH_TABLE (collection)))
1280 break; 1281 break;
1281 else 1282 else
1282 elt = eltstring = HASH_KEY (XHASH_TABLE (collection), index++); 1283 elt = eltstring = HASH_KEY (XHASH_TABLE (collection), idx++);
1283 } 1284 }
1284 1285
1285 /* Is this element a possible completion? */ 1286 /* Is this element a possible completion? */
@@ -1334,7 +1335,7 @@ is used to further constrain the set of candidates. */)
1334 tem = (type == hash_table 1335 tem = (type == hash_table
1335 ? call2 (predicate, elt, 1336 ? call2 (predicate, elt,
1336 HASH_VALUE (XHASH_TABLE (collection), 1337 HASH_VALUE (XHASH_TABLE (collection),
1337 index - 1)) 1338 idx - 1))
1338 : call1 (predicate, elt)); 1339 : call1 (predicate, elt));
1339 UNGCPRO; 1340 UNGCPRO;
1340 } 1341 }
@@ -1478,7 +1479,7 @@ with a space are ignored unless STRING itself starts with a space. */)
1478 : NILP (collection) || (CONSP (collection) 1479 : NILP (collection) || (CONSP (collection)
1479 && (!SYMBOLP (XCAR (collection)) 1480 && (!SYMBOLP (XCAR (collection))
1480 || NILP (XCAR (collection)))); 1481 || NILP (XCAR (collection))));
1481 int index = 0, obsize = 0; 1482 int idx = 0, obsize = 0;
1482 int bindcount = -1; 1483 int bindcount = -1;
1483 Lisp_Object bucket, tem, zero; 1484 Lisp_Object bucket, tem, zero;
1484 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 1485 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
@@ -1495,7 +1496,7 @@ with a space are ignored unless STRING itself starts with a space. */)
1495 { 1496 {
1496 collection = check_obarray (collection); 1497 collection = check_obarray (collection);
1497 obsize = XVECTOR (collection)->size; 1498 obsize = XVECTOR (collection)->size;
1498 bucket = XVECTOR (collection)->contents[index]; 1499 bucket = XVECTOR (collection)->contents[idx];
1499 } 1500 }
1500 1501
1501 while (1) 1502 while (1)
@@ -1526,23 +1527,23 @@ with a space are ignored unless STRING itself starts with a space. */)
1526 else 1527 else
1527 XSETFASTINT (bucket, 0); 1528 XSETFASTINT (bucket, 0);
1528 } 1529 }
1529 else if (++index >= obsize) 1530 else if (++idx >= obsize)
1530 break; 1531 break;
1531 else 1532 else
1532 { 1533 {
1533 bucket = XVECTOR (collection)->contents[index]; 1534 bucket = XVECTOR (collection)->contents[idx];
1534 continue; 1535 continue;
1535 } 1536 }
1536 } 1537 }
1537 else /* if (type == 3) */ 1538 else /* if (type == 3) */
1538 { 1539 {
1539 while (index < HASH_TABLE_SIZE (XHASH_TABLE (collection)) 1540 while (idx < HASH_TABLE_SIZE (XHASH_TABLE (collection))
1540 && NILP (HASH_HASH (XHASH_TABLE (collection), index))) 1541 && NILP (HASH_HASH (XHASH_TABLE (collection), idx)))
1541 index++; 1542 idx++;
1542 if (index >= HASH_TABLE_SIZE (XHASH_TABLE (collection))) 1543 if (idx >= HASH_TABLE_SIZE (XHASH_TABLE (collection)))
1543 break; 1544 break;
1544 else 1545 else
1545 elt = eltstring = HASH_KEY (XHASH_TABLE (collection), index++); 1546 elt = eltstring = HASH_KEY (XHASH_TABLE (collection), idx++);
1546 } 1547 }
1547 1548
1548 /* Is this element a possible completion? */ 1549 /* Is this element a possible completion? */
@@ -1567,8 +1568,6 @@ with a space are ignored unless STRING itself starts with a space. */)
1567 { 1568 {
1568 /* Yes. */ 1569 /* Yes. */
1569 Lisp_Object regexps; 1570 Lisp_Object regexps;
1570 Lisp_Object zero;
1571 XSETFASTINT (zero, 0);
1572 1571
1573 /* Ignore this element if it fails to match all the regexps. */ 1572 /* Ignore this element if it fails to match all the regexps. */
1574 { 1573 {
@@ -1604,7 +1603,7 @@ with a space are ignored unless STRING itself starts with a space. */)
1604 GCPRO4 (tail, eltstring, allmatches, string); 1603 GCPRO4 (tail, eltstring, allmatches, string);
1605 tem = type == 3 1604 tem = type == 3
1606 ? call2 (predicate, elt, 1605 ? call2 (predicate, elt,
1607 HASH_VALUE (XHASH_TABLE (collection), index - 1)) 1606 HASH_VALUE (XHASH_TABLE (collection), idx - 1))
1608 : call1 (predicate, elt); 1607 : call1 (predicate, elt);
1609 UNGCPRO; 1608 UNGCPRO;
1610 } 1609 }
@@ -1677,7 +1676,27 @@ If INHERIT-INPUT-METHOD is non-nil, the minibuffer inherits
1677 the current input method and the setting of `enable-multibyte-characters'. 1676 the current input method and the setting of `enable-multibyte-characters'.
1678 1677
1679Completion ignores case if the ambient value of 1678Completion ignores case if the ambient value of
1680 `completion-ignore-case' is non-nil. */) 1679 `completion-ignore-case' is non-nil.
1680
1681See also `completing-read-function'. */)
1682 (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method)
1683{
1684 Lisp_Object args[9];
1685 args[0] = Vcompleting_read_function;
1686 args[1] = prompt;
1687 args[2] = collection;
1688 args[3] = predicate;
1689 args[4] = require_match;
1690 args[5] = initial_input;
1691 args[6] = hist;
1692 args[7] = def;
1693 args[8] = inherit_input_method;
1694 return Ffuncall (9, args);
1695}
1696
1697DEFUN ("completing-read-default", Fcompleting_read_default, Scompleting_read_default, 2, 8, 0,
1698 doc: /* Default method for reading from the minibuffer with completion.
1699See `completing-read' for the meaning of the arguments. */)
1681 (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method) 1700 (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method)
1682{ 1701{
1683 Lisp_Object val, histvar, histpos, position; 1702 Lisp_Object val, histvar, histpos, position;
@@ -1975,6 +1994,9 @@ syms_of_minibuf (void)
1975 minibuf_save_list = Qnil; 1994 minibuf_save_list = Qnil;
1976 staticpro (&minibuf_save_list); 1995 staticpro (&minibuf_save_list);
1977 1996
1997 Qcompleting_read_default = intern_c_string ("completing-read-default");
1998 staticpro (&Qcompleting_read_default);
1999
1978 Qcompletion_ignore_case = intern_c_string ("completion-ignore-case"); 2000 Qcompletion_ignore_case = intern_c_string ("completion-ignore-case");
1979 staticpro (&Qcompletion_ignore_case); 2001 staticpro (&Qcompletion_ignore_case);
1980 2002
@@ -2119,6 +2141,12 @@ If the value is `confirm-after-completion', the user may exit with an
2119 doc: /* Non-nil means completing file names. */); 2141 doc: /* Non-nil means completing file names. */);
2120 Vminibuffer_completing_file_name = Qnil; 2142 Vminibuffer_completing_file_name = Qnil;
2121 2143
2144 DEFVAR_LISP ("completing-read-function",
2145 Vcompleting_read_function,
2146 doc: /* The function called by `completing-read' to do the work.
2147It should accept the same arguments as `completing-read'. */);
2148 Vcompleting_read_function = Qcompleting_read_default;
2149
2122 DEFVAR_LISP ("minibuffer-help-form", Vminibuffer_help_form, 2150 DEFVAR_LISP ("minibuffer-help-form", Vminibuffer_help_form,
2123 doc: /* Value that `help-form' takes on inside the minibuffer. */); 2151 doc: /* Value that `help-form' takes on inside the minibuffer. */);
2124 Vminibuffer_help_form = Qnil; 2152 Vminibuffer_help_form = Qnil;
@@ -2194,4 +2222,5 @@ properties. */);
2194 defsubr (&Stest_completion); 2222 defsubr (&Stest_completion);
2195 defsubr (&Sassoc_string); 2223 defsubr (&Sassoc_string);
2196 defsubr (&Scompleting_read); 2224 defsubr (&Scompleting_read);
2225 defsubr (&Scompleting_read_default);
2197} 2226}
diff --git a/src/msdos.c b/src/msdos.c
index 261a09ac859..b0bf5c4fdd9 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -844,6 +844,7 @@ IT_set_face (int face)
844 844
845extern unsigned char *encode_terminal_code (struct glyph *, int, 845extern unsigned char *encode_terminal_code (struct glyph *, int,
846 struct coding_system *); 846 struct coding_system *);
847
847static void 848static void
848IT_write_glyphs (struct frame *f, struct glyph *str, int str_len) 849IT_write_glyphs (struct frame *f, struct glyph *str, int str_len)
849{ 850{
@@ -2998,17 +2999,17 @@ XMenuCreate (Display *foo1, Window foo2, char *foo3)
2998 to do. */ 2999 to do. */
2999 3000
3000int 3001int
3001XMenuAddPane (Display *foo, XMenu *menu, char *txt, int enable) 3002XMenuAddPane (Display *foo, XMenu *menu, const char *txt, int enable)
3002{ 3003{
3003 int len; 3004 int len;
3004 char *p; 3005 const char *p;
3005 3006
3006 if (!enable) 3007 if (!enable)
3007 abort (); 3008 abort ();
3008 3009
3009 IT_menu_make_room (menu); 3010 IT_menu_make_room (menu);
3010 menu->submenu[menu->count] = IT_menu_create (); 3011 menu->submenu[menu->count] = IT_menu_create ();
3011 menu->text[menu->count] = txt; 3012 menu->text[menu->count] = (char *)txt;
3012 menu->panenumber[menu->count] = ++menu->panecount; 3013 menu->panenumber[menu->count] = ++menu->panecount;
3013 menu->help_text[menu->count] = NULL; 3014 menu->help_text[menu->count] = NULL;
3014 menu->count++; 3015 menu->count++;
diff --git a/src/msdos.h b/src/msdos.h
index 4bbe9b134de..5051f2f3837 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -105,7 +105,7 @@ typedef struct x_menu_struct
105} XMenu; 105} XMenu;
106 106
107XMenu *XMenuCreate (Display *, Window, char *); 107XMenu *XMenuCreate (Display *, Window, char *);
108int XMenuAddPane (Display *, XMenu *, char *, int); 108int XMenuAddPane (Display *, XMenu *, const char *, int);
109int XMenuAddSelection (Display *, XMenu *, int, int, char *, int, char *); 109int XMenuAddSelection (Display *, XMenu *, int, int, char *, int, char *);
110void XMenuLocate (Display *, XMenu *, int, int, int, int, 110void XMenuLocate (Display *, XMenu *, int, int, int, int,
111 int *, int *, int *, int *); 111 int *, int *, int *, int *);
diff --git a/src/nsterm.m b/src/nsterm.m
index cc2c4cf9807..c7cd411c614 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2235,7 +2235,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
2235 -------------------------------------------------------------------------- */ 2235 -------------------------------------------------------------------------- */
2236{ 2236{
2237 NSRect r, s; 2237 NSRect r, s;
2238 int fx, fy, h; 2238 int fx, fy, h, cursor_height;
2239 struct frame *f = WINDOW_XFRAME (w); 2239 struct frame *f = WINDOW_XFRAME (w);
2240 struct glyph *phys_cursor_glyph; 2240 struct glyph *phys_cursor_glyph;
2241 int overspill; 2241 int overspill;
@@ -2279,13 +2279,20 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
2279 get_phys_cursor_geometry (w, glyph_row, phys_cursor_glyph, &fx, &fy, &h); 2279 get_phys_cursor_geometry (w, glyph_row, phys_cursor_glyph, &fx, &fy, &h);
2280 2280
2281 /* The above get_phys_cursor_geometry call set w->phys_cursor_width 2281 /* The above get_phys_cursor_geometry call set w->phys_cursor_width
2282 to the glyph width; replace with CURSOR_WIDTH for bar cursors. */ 2282 to the glyph width; replace with CURSOR_WIDTH for (V)BAR cursors. */
2283 if (cursor_type == BAR_CURSOR || cursor_type == HBAR_CURSOR) 2283 if (cursor_type == BAR_CURSOR)
2284 { 2284 {
2285 if (cursor_width < 1) 2285 if (cursor_width < 1)
2286 cursor_width = max (FRAME_CURSOR_WIDTH (f), 1); 2286 cursor_width = max (FRAME_CURSOR_WIDTH (f), 1);
2287 w->phys_cursor_width = cursor_width; 2287 w->phys_cursor_width = cursor_width;
2288 } 2288 }
2289 /* If we have an HBAR, "cursor_width" MAY specify height. */
2290 else if (cursor_type == HBAR_CURSOR)
2291 {
2292 cursor_height = (cursor_width < 1) ? lrint (0.25 * h) : cursor_width;
2293 fy += h - cursor_height;
2294 h = cursor_height;
2295 }
2289 2296
2290 r.origin.x = fx, r.origin.y = fy; 2297 r.origin.x = fx, r.origin.y = fy;
2291 r.size.height = h; 2298 r.size.height = h;
@@ -2337,10 +2344,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
2337 [FRAME_CURSOR_COLOR (f) set]; 2344 [FRAME_CURSOR_COLOR (f) set];
2338 break; 2345 break;
2339 case HBAR_CURSOR: 2346 case HBAR_CURSOR:
2340 s = r; 2347 NSRectFill (r);
2341 s.origin.y += lrint (0.75 * s.size.height);
2342 s.size.height = lrint (s.size.height * 0.25);
2343 NSRectFill (s);
2344 break; 2348 break;
2345 case BAR_CURSOR: 2349 case BAR_CURSOR:
2346 s = r; 2350 s = r;
diff --git a/src/print.c b/src/print.c
index 602575b5b08..b8266422473 100644
--- a/src/print.c
+++ b/src/print.c
@@ -801,7 +801,7 @@ append to existing target file. */)
801 { 801 {
802 file = Fexpand_file_name (file, Qnil); 802 file = Fexpand_file_name (file, Qnil);
803 initial_stderr_stream = stderr; 803 initial_stderr_stream = stderr;
804 stderr = fopen (SDATA (file), NILP (append) ? "w" : "a"); 804 stderr = fopen (SSDATA (file), NILP (append) ? "w" : "a");
805 if (stderr == NULL) 805 if (stderr == NULL)
806 { 806 {
807 stderr = initial_stderr_stream; 807 stderr = initial_stderr_stream;
@@ -1120,6 +1120,16 @@ print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag)
1120 print_object (obj, printcharfun, escapeflag); 1120 print_object (obj, printcharfun, escapeflag);
1121} 1121}
1122 1122
1123#define PRINT_CIRCLE_CANDIDATE_P(obj) \
1124 (STRINGP (obj) || CONSP (obj) \
1125 || (VECTORLIKEP (obj) \
1126 && (VECTORP (obj) || COMPILEDP (obj) \
1127 || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) \
1128 || HASH_TABLE_P (obj) || FONTP (obj))) \
1129 || (! NILP (Vprint_gensym) \
1130 && SYMBOLP (obj) \
1131 && !SYMBOL_INTERNED_P (obj)))
1132
1123/* Construct Vprint_number_table according to the structure of OBJ. 1133/* Construct Vprint_number_table according to the structure of OBJ.
1124 OBJ itself and all its elements will be added to Vprint_number_table 1134 OBJ itself and all its elements will be added to Vprint_number_table
1125 recursively if it is a list, vector, compiled function, char-table, 1135 recursively if it is a list, vector, compiled function, char-table,
@@ -1154,12 +1164,7 @@ print_preprocess (Lisp_Object obj)
1154 halftail = obj; 1164 halftail = obj;
1155 1165
1156 loop: 1166 loop:
1157 if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) 1167 if (PRINT_CIRCLE_CANDIDATE_P (obj))
1158 || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj)
1159 || HASH_TABLE_P (obj)
1160 || (! NILP (Vprint_gensym)
1161 && SYMBOLP (obj)
1162 && !SYMBOL_INTERNED_P (obj)))
1163 { 1168 {
1164 if (!HASH_TABLE_P (Vprint_number_table)) 1169 if (!HASH_TABLE_P (Vprint_number_table))
1165 { 1170 {
@@ -1336,12 +1341,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
1336 error ("Apparently circular structure being printed"); 1341 error ("Apparently circular structure being printed");
1337 1342
1338 /* Detect circularities and truncate them. */ 1343 /* Detect circularities and truncate them. */
1339 if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) 1344 if (PRINT_CIRCLE_CANDIDATE_P (obj))
1340 || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj)
1341 || HASH_TABLE_P (obj)
1342 || (! NILP (Vprint_gensym)
1343 && SYMBOLP (obj)
1344 && !SYMBOL_INTERNED_P (obj)))
1345 { 1345 {
1346 if (NILP (Vprint_circle) && NILP (Vprint_gensym)) 1346 if (NILP (Vprint_circle) && NILP (Vprint_gensym))
1347 { 1347 {
diff --git a/src/process.c b/src/process.c
index 210287a85f1..c9b420ab2ae 100644
--- a/src/process.c
+++ b/src/process.c
@@ -162,12 +162,6 @@ extern Lisp_Object QCfilter;
162/* Define first descriptor number available for subprocesses. */ 162/* Define first descriptor number available for subprocesses. */
163#define FIRST_PROC_DESC 3 163#define FIRST_PROC_DESC 3
164 164
165extern const char *get_operating_system_release (void);
166
167/* From sysdep.c or w32.c */
168extern int serial_open (char *port);
169extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact);
170
171#ifndef HAVE_H_ERRNO 165#ifndef HAVE_H_ERRNO
172extern int h_errno; 166extern int h_errno;
173#endif 167#endif
@@ -499,7 +493,7 @@ status_message (struct Lisp_Process *p)
499 string = (code_convert_string_norecord 493 string = (code_convert_string_norecord
500 (string, Vlocale_coding_system, 0)); 494 (string, Vlocale_coding_system, 0));
501 c1 = STRING_CHAR (SDATA (string)); 495 c1 = STRING_CHAR (SDATA (string));
502 c2 = DOWNCASE (c1); 496 c2 = downcase (c1);
503 if (c1 != c2) 497 if (c1 != c2)
504 Faset (string, make_number (0), make_number (c2)); 498 Faset (string, make_number (0), make_number (c2));
505 } 499 }
@@ -541,17 +535,16 @@ static char pty_name[24];
541static int 535static int
542allocate_pty (void) 536allocate_pty (void)
543{ 537{
544 register int c, i;
545 int fd; 538 int fd;
546 539
547#ifdef PTY_ITERATION 540#ifdef PTY_ITERATION
548 PTY_ITERATION 541 PTY_ITERATION
549#else 542#else
543 register int c, i;
550 for (c = FIRST_PTY_LETTER; c <= 'z'; c++) 544 for (c = FIRST_PTY_LETTER; c <= 'z'; c++)
551 for (i = 0; i < 16; i++) 545 for (i = 0; i < 16; i++)
552#endif 546#endif
553 { 547 {
554 struct stat stb; /* Used in some PTY_OPEN. */
555#ifdef PTY_NAME_SPRINTF 548#ifdef PTY_NAME_SPRINTF
556 PTY_NAME_SPRINTF 549 PTY_NAME_SPRINTF
557#else 550#else
@@ -568,6 +561,7 @@ allocate_pty (void)
568 three failures in a row before deciding that we've reached the 561 three failures in a row before deciding that we've reached the
569 end of the ptys. */ 562 end of the ptys. */
570 int failed_count = 0; 563 int failed_count = 0;
564 struct stat stb;
571 565
572 if (stat (pty_name, &stb) < 0) 566 if (stat (pty_name, &stb) < 0)
573 { 567 {
@@ -2730,7 +2724,8 @@ usage: (serial-process-configure &rest ARGS) */)
2730} 2724}
2731 2725
2732/* Used by make-serial-process to recover from errors. */ 2726/* Used by make-serial-process to recover from errors. */
2733Lisp_Object make_serial_process_unwind (Lisp_Object proc) 2727static Lisp_Object
2728make_serial_process_unwind (Lisp_Object proc)
2734{ 2729{
2735 if (!PROCESSP (proc)) 2730 if (!PROCESSP (proc))
2736 abort (); 2731 abort ();
@@ -5482,7 +5477,7 @@ read_process_output (Lisp_Object proc, register int channel)
5482jmp_buf send_process_frame; 5477jmp_buf send_process_frame;
5483Lisp_Object process_sent_to; 5478Lisp_Object process_sent_to;
5484 5479
5485SIGTYPE 5480static SIGTYPE
5486send_process_trap (int ignore) 5481send_process_trap (int ignore)
5487{ 5482{
5488 SIGNAL_THREAD_CHECK (SIGPIPE); 5483 SIGNAL_THREAD_CHECK (SIGPIPE);
@@ -6391,7 +6386,7 @@ process has been transmitted to the serial port. */)
6391 indirectly; if it does, that is a bug */ 6386 indirectly; if it does, that is a bug */
6392 6387
6393#ifdef SIGCHLD 6388#ifdef SIGCHLD
6394SIGTYPE 6389static SIGTYPE
6395sigchld_handler (int signo) 6390sigchld_handler (int signo)
6396{ 6391{
6397 int old_errno = errno; 6392 int old_errno = errno;
diff --git a/src/regex.c b/src/regex.c
index 9284be95ffb..a60ff0ce35c 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -340,7 +340,7 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
340 || ((c) >= 'A' && (c) <= 'Z')) \ 340 || ((c) >= 'A' && (c) <= 'Z')) \
341 : SYNTAX (c) == Sword) 341 : SYNTAX (c) == Sword)
342 342
343# define ISLOWER(c) (LOWERCASEP (c)) 343# define ISLOWER(c) lowercasep (c)
344 344
345# define ISPUNCT(c) (IS_REAL_ASCII (c) \ 345# define ISPUNCT(c) (IS_REAL_ASCII (c) \
346 ? ((c) > ' ' && (c) < 0177 \ 346 ? ((c) > ' ' && (c) < 0177 \
@@ -351,7 +351,7 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
351 351
352# define ISSPACE(c) (SYNTAX (c) == Swhitespace) 352# define ISSPACE(c) (SYNTAX (c) == Swhitespace)
353 353
354# define ISUPPER(c) (UPPERCASEP (c)) 354# define ISUPPER(c) uppercasep (c)
355 355
356# define ISWORD(c) (SYNTAX (c) == Sword) 356# define ISWORD(c) (SYNTAX (c) == Sword)
357 357
@@ -551,8 +551,6 @@ init_syntax_once (void)
551/* (Re)Allocate N items of type T using malloc, or fail. */ 551/* (Re)Allocate N items of type T using malloc, or fail. */
552#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) 552#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t)))
553#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) 553#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
554#define RETALLOC_IF(addr, n, t) \
555 if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t)
556#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) 554#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
557 555
558#define BYTEWIDTH 8 /* In bits. */ 556#define BYTEWIDTH 8 /* In bits. */
@@ -843,11 +841,6 @@ extract_number_and_incr (destination, source)
843 ((p)[2 + CHARSET_BITMAP_SIZE (p)] \ 841 ((p)[2 + CHARSET_BITMAP_SIZE (p)] \
844 + (p)[3 + CHARSET_BITMAP_SIZE (p)] * 0x100) 842 + (p)[3 + CHARSET_BITMAP_SIZE (p)] * 0x100)
845 843
846/* Test if C is listed in the bitmap of charset P. */
847#define CHARSET_LOOKUP_BITMAP(p, c) \
848 ((c) < CHARSET_BITMAP_SIZE (p) * BYTEWIDTH \
849 && (p)[2 + (c) / BYTEWIDTH] & (1 << ((c) % BYTEWIDTH)))
850
851/* Return the address of end of RANGE_TABLE. COUNT is number of 844/* Return the address of end of RANGE_TABLE. COUNT is number of
852 ranges (which is a pair of (start, end)) in the RANGE_TABLE. `* 2' 845 ranges (which is a pair of (start, end)) in the RANGE_TABLE. `* 2'
853 is start of range and end of range. `* 3' is size of each start 846 is start of range and end of range. `* 3' is size of each start
@@ -861,14 +854,14 @@ extract_number_and_incr (destination, source)
861 do \ 854 do \
862 { \ 855 { \
863 re_wchar_t range_start, range_end; \ 856 re_wchar_t range_start, range_end; \
864 re_char *p; \ 857 re_char *rtp; \
865 re_char *range_table_end \ 858 re_char *range_table_end \
866 = CHARSET_RANGE_TABLE_END ((range_table), (count)); \ 859 = CHARSET_RANGE_TABLE_END ((range_table), (count)); \
867 \ 860 \
868 for (p = (range_table); p < range_table_end; p += 2 * 3) \ 861 for (rtp = (range_table); rtp < range_table_end; rtp += 2 * 3) \
869 { \ 862 { \
870 EXTRACT_CHARACTER (range_start, p); \ 863 EXTRACT_CHARACTER (range_start, rtp); \
871 EXTRACT_CHARACTER (range_end, p + 3); \ 864 EXTRACT_CHARACTER (range_end, rtp + 3); \
872 \ 865 \
873 if (range_start <= (c) && (c) <= range_end) \ 866 if (range_start <= (c) && (c) <= range_end) \
874 { \ 867 { \
@@ -1274,6 +1267,13 @@ print_double_string (where, string1, size1, string2, size2)
1274 1267
1275#endif /* not DEBUG */ 1268#endif /* not DEBUG */
1276 1269
1270/* Use this to suppress gcc's `...may be used before initialized' warnings. */
1271#ifdef lint
1272# define IF_LINT(Code) Code
1273#else
1274# define IF_LINT(Code) /* empty */
1275#endif
1276
1277/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can 1277/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can
1278 also be assigned to arbitrarily: each pattern buffer stores its own 1278 also be assigned to arbitrarily: each pattern buffer stores its own
1279 syntax, so it can be changed between regex compilations. */ 1279 syntax, so it can be changed between regex compilations. */
@@ -1413,7 +1413,6 @@ typedef struct
1413} fail_stack_type; 1413} fail_stack_type;
1414 1414
1415#define FAIL_STACK_EMPTY() (fail_stack.frame == 0) 1415#define FAIL_STACK_EMPTY() (fail_stack.frame == 0)
1416#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
1417 1416
1418 1417
1419/* Define macros to initialize and free the failure stack. 1418/* Define macros to initialize and free the failure stack.
@@ -1433,8 +1432,6 @@ typedef struct
1433 fail_stack.avail = 0; \ 1432 fail_stack.avail = 0; \
1434 fail_stack.frame = 0; \ 1433 fail_stack.frame = 0; \
1435 } while (0) 1434 } while (0)
1436
1437# define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack)
1438#else 1435#else
1439# define INIT_FAIL_STACK() \ 1436# define INIT_FAIL_STACK() \
1440 do { \ 1437 do { \
@@ -1442,7 +1439,8 @@ typedef struct
1442 fail_stack.frame = 0; \ 1439 fail_stack.frame = 0; \
1443 } while (0) 1440 } while (0)
1444 1441
1445# define RESET_FAIL_STACK() ((void)0) 1442# define RETALLOC_IF(addr, n, t) \
1443 if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t)
1446#endif 1444#endif
1447 1445
1448 1446
@@ -1495,17 +1493,10 @@ typedef struct
1495#define PUSH_FAILURE_INT(item) \ 1493#define PUSH_FAILURE_INT(item) \
1496 fail_stack.stack[fail_stack.avail++].integer = (item) 1494 fail_stack.stack[fail_stack.avail++].integer = (item)
1497 1495
1498/* Push a fail_stack_elt_t value onto the failure stack. 1496/* These POP... operations complement the PUSH... operations.
1499 Assumes the variable `fail_stack'. Probably should only
1500 be called from within `PUSH_FAILURE_POINT'. */
1501#define PUSH_FAILURE_ELT(item) \
1502 fail_stack.stack[fail_stack.avail++] = (item)
1503
1504/* These three POP... operations complement the three PUSH... operations.
1505 All assume that `fail_stack' is nonempty. */ 1497 All assume that `fail_stack' is nonempty. */
1506#define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer 1498#define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer
1507#define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer 1499#define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer
1508#define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail]
1509 1500
1510/* Individual items aside from the registers. */ 1501/* Individual items aside from the registers. */
1511#define NUM_NONREG_ITEMS 3 1502#define NUM_NONREG_ITEMS 3
@@ -1555,22 +1546,22 @@ do { \
1555/* Pop a saved register off the stack. */ 1546/* Pop a saved register off the stack. */
1556#define POP_FAILURE_REG_OR_COUNT() \ 1547#define POP_FAILURE_REG_OR_COUNT() \
1557do { \ 1548do { \
1558 int reg = POP_FAILURE_INT (); \ 1549 int pfreg = POP_FAILURE_INT (); \
1559 if (reg == -1) \ 1550 if (pfreg == -1) \
1560 { \ 1551 { \
1561 /* It's a counter. */ \ 1552 /* It's a counter. */ \
1562 /* Here, we discard `const', making re_match non-reentrant. */ \ 1553 /* Here, we discard `const', making re_match non-reentrant. */ \
1563 unsigned char *ptr = (unsigned char*) POP_FAILURE_POINTER (); \ 1554 unsigned char *ptr = (unsigned char*) POP_FAILURE_POINTER (); \
1564 reg = POP_FAILURE_INT (); \ 1555 pfreg = POP_FAILURE_INT (); \
1565 STORE_NUMBER (ptr, reg); \ 1556 STORE_NUMBER (ptr, pfreg); \
1566 DEBUG_PRINT3 (" Pop counter %p = %d\n", ptr, reg); \ 1557 DEBUG_PRINT3 (" Pop counter %p = %d\n", ptr, pfreg); \
1567 } \ 1558 } \
1568 else \ 1559 else \
1569 { \ 1560 { \
1570 regend[reg] = POP_FAILURE_POINTER (); \ 1561 regend[pfreg] = POP_FAILURE_POINTER (); \
1571 regstart[reg] = POP_FAILURE_POINTER (); \ 1562 regstart[pfreg] = POP_FAILURE_POINTER (); \
1572 DEBUG_PRINT4 (" Pop reg %d (spanning %p -> %p)\n", \ 1563 DEBUG_PRINT4 (" Pop reg %d (spanning %p -> %p)\n", \
1573 reg, regstart[reg], regend[reg]); \ 1564 pfreg, regstart[pfreg], regend[pfreg]); \
1574 } \ 1565 } \
1575} while (0) 1566} while (0)
1576 1567
@@ -1765,16 +1756,6 @@ static int analyse_first _RE_ARGS ((re_char *p, re_char *pend,
1765 } while (0) 1756 } while (0)
1766 1757
1767 1758
1768/* As with BUF_PUSH_2, except for three bytes. */
1769#define BUF_PUSH_3(c1, c2, c3) \
1770 do { \
1771 GET_BUFFER_SPACE (3); \
1772 *b++ = (unsigned char) (c1); \
1773 *b++ = (unsigned char) (c2); \
1774 *b++ = (unsigned char) (c3); \
1775 } while (0)
1776
1777
1778/* Store a jump with opcode OP at LOC to location TO. We store a 1759/* Store a jump with opcode OP at LOC to location TO. We store a
1779 relative address offset by the three bytes the jump itself occupies. */ 1760 relative address offset by the three bytes the jump itself occupies. */
1780#define STORE_JUMP(op, loc, to) \ 1761#define STORE_JUMP(op, loc, to) \
@@ -2524,9 +2505,6 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct
2524 /* We fetch characters from PATTERN here. */ 2505 /* We fetch characters from PATTERN here. */
2525 register re_wchar_t c, c1; 2506 register re_wchar_t c, c1;
2526 2507
2527 /* A random temporary spot in PATTERN. */
2528 re_char *p1;
2529
2530 /* Points to the end of the buffer, where we should append. */ 2508 /* Points to the end of the buffer, where we should append. */
2531 register unsigned char *b; 2509 register unsigned char *b;
2532 2510
@@ -2574,17 +2552,14 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct
2574 /* If the object matched can contain multibyte characters. */ 2552 /* If the object matched can contain multibyte characters. */
2575 const boolean multibyte = RE_MULTIBYTE_P (bufp); 2553 const boolean multibyte = RE_MULTIBYTE_P (bufp);
2576 2554
2577 /* If a target of matching can contain multibyte characters. */
2578 const boolean target_multibyte = RE_TARGET_MULTIBYTE_P (bufp);
2579
2580 /* Nonzero if we have pushed down into a subpattern. */ 2555 /* Nonzero if we have pushed down into a subpattern. */
2581 int in_subpattern = 0; 2556 int in_subpattern = 0;
2582 2557
2583 /* These hold the values of p, pattern, and pend from the main 2558 /* These hold the values of p, pattern, and pend from the main
2584 pattern when we have pushed into a subpattern. */ 2559 pattern when we have pushed into a subpattern. */
2585 re_char *main_p; 2560 re_char *main_p IF_LINT (= NULL);
2586 re_char *main_pattern; 2561 re_char *main_pattern IF_LINT (= NULL);
2587 re_char *main_pend; 2562 re_char *main_pend IF_LINT (= NULL);
2588 2563
2589#ifdef DEBUG 2564#ifdef DEBUG
2590 debug++; 2565 debug++;
@@ -2894,6 +2869,8 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct
2894 2869
2895 case '[': 2870 case '[':
2896 { 2871 {
2872 re_char *p1;
2873
2897 CLEAR_RANGE_TABLE_WORK_USED (range_table_work); 2874 CLEAR_RANGE_TABLE_WORK_USED (range_table_work);
2898 2875
2899 if (p == pend) FREE_STACK_RETURN (REG_EBRACK); 2876 if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
@@ -2929,7 +2906,7 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct
2929 { 2906 {
2930 boolean escaped_char = false; 2907 boolean escaped_char = false;
2931 const unsigned char *p2 = p; 2908 const unsigned char *p2 = p;
2932 re_wchar_t ch, c2; 2909 re_wchar_t ch;
2933 2910
2934 if (p == pend) FREE_STACK_RETURN (REG_EBRACK); 2911 if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
2935 2912
@@ -2992,10 +2969,7 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct
2992 them). */ 2969 them). */
2993 if (c == ':' && *p == ']') 2970 if (c == ':' && *p == ']')
2994 { 2971 {
2995 re_wctype_t cc; 2972 re_wctype_t cc = re_wctype (str);
2996 int limit;
2997
2998 cc = re_wctype (str);
2999 2973
3000 if (cc == 0) 2974 if (cc == 0)
3001 FREE_STACK_RETURN (REG_ECTYPE); 2975 FREE_STACK_RETURN (REG_ECTYPE);
@@ -4329,10 +4303,6 @@ WEAK_ALIAS (__re_search, re_search)
4329#define HEAD_ADDR_VSTRING(P) \ 4303#define HEAD_ADDR_VSTRING(P) \
4330 (((P) >= size1 ? string2 : string1)) 4304 (((P) >= size1 ? string2 : string1))
4331 4305
4332/* End address of virtual concatenation of string. */
4333#define STOP_ADDR_VSTRING(P) \
4334 (((P) >= size1 ? string2 + size2 : string1 + size1))
4335
4336/* Address of POS in the concatenation of virtual string. */ 4306/* Address of POS in the concatenation of virtual string. */
4337#define POS_ADDR_VSTRING(POS) \ 4307#define POS_ADDR_VSTRING(POS) \
4338 (((POS) >= size1 ? string2 - size1 : string1) + (POS)) 4308 (((POS) >= size1 ? string2 - size1 : string1) + (POS))
@@ -4559,7 +4529,6 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, int size1, const
4559 if (multibyte) 4529 if (multibyte)
4560 { 4530 {
4561 re_char *p = POS_ADDR_VSTRING (startpos); 4531 re_char *p = POS_ADDR_VSTRING (startpos);
4562 re_char *pend = STOP_ADDR_VSTRING (startpos);
4563 int len = BYTES_BY_CHAR_HEAD (*p); 4532 int len = BYTES_BY_CHAR_HEAD (*p);
4564 4533
4565 range -= len; 4534 range -= len;
@@ -4644,16 +4613,6 @@ static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2,
4644#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2) 4613#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
4645#define AT_STRINGS_END(d) ((d) == end2) 4614#define AT_STRINGS_END(d) ((d) == end2)
4646 4615
4647
4648/* Test if D points to a character which is word-constituent. We have
4649 two special cases to check for: if past the end of string1, look at
4650 the first character in string2; and if before the beginning of
4651 string2, look at the last character in string1. */
4652#define WORDCHAR_P(d) \
4653 (SYNTAX ((d) == end1 ? *string2 \
4654 : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
4655 == Sword)
4656
4657/* Disabled due to a compiler bug -- see comment at case wordbound */ 4616/* Disabled due to a compiler bug -- see comment at case wordbound */
4658 4617
4659/* The comment at case wordbound is following one, but we don't use 4618/* The comment at case wordbound is following one, but we don't use
@@ -4665,6 +4624,15 @@ static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2,
4665 macro and introducing temporary variables works around the bug. */ 4624 macro and introducing temporary variables works around the bug. */
4666 4625
4667#if 0 4626#if 0
4627/* Test if D points to a character which is word-constituent. We have
4628 two special cases to check for: if past the end of string1, look at
4629 the first character in string2; and if before the beginning of
4630 string2, look at the last character in string1. */
4631#define WORDCHAR_P(d) \
4632 (SYNTAX ((d) == end1 ? *string2 \
4633 : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
4634 == Sword)
4635
4668/* Test if the character before D and the one at D differ with respect 4636/* Test if the character before D and the one at D differ with respect
4669 to being word-constituent. */ 4637 to being word-constituent. */
4670#define AT_WORD_BOUNDARY(d) \ 4638#define AT_WORD_BOUNDARY(d) \
@@ -4674,7 +4642,14 @@ static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2,
4674 4642
4675/* Free everything we malloc. */ 4643/* Free everything we malloc. */
4676#ifdef MATCH_MAY_ALLOCATE 4644#ifdef MATCH_MAY_ALLOCATE
4677# define FREE_VAR(var) if (var) { REGEX_FREE (var); var = NULL; } else 4645# define FREE_VAR(var) \
4646 do { \
4647 if (var) \
4648 { \
4649 REGEX_FREE (var); \
4650 var = NULL; \
4651 } \
4652 } while (0)
4678# define FREE_VARIABLES() \ 4653# define FREE_VARIABLES() \
4679 do { \ 4654 do { \
4680 REGEX_FREE_STACK (fail_stack.stack); \ 4655 REGEX_FREE_STACK (fail_stack.stack); \
@@ -5024,7 +4999,6 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
5024 /* General temporaries. */ 4999 /* General temporaries. */
5025 int mcnt; 5000 int mcnt;
5026 size_t reg; 5001 size_t reg;
5027 boolean not;
5028 5002
5029 /* Just past the end of the corresponding string. */ 5003 /* Just past the end of the corresponding string. */
5030 re_char *end1, *end2; 5004 re_char *end1, *end2;
@@ -5464,7 +5438,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
5464 else 5438 else
5465 do 5439 do
5466 { 5440 {
5467 int pat_charlen, buf_charlen; 5441 int pat_charlen;
5468 int pat_ch, buf_ch; 5442 int pat_ch, buf_ch;
5469 5443
5470 PREFETCH (); 5444 PREFETCH ();
@@ -5535,7 +5509,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
5535 5509
5536 /* Start of actual range_table, or end of bitmap if there is no 5510 /* Start of actual range_table, or end of bitmap if there is no
5537 range table. */ 5511 range table. */
5538 re_char *range_table; 5512 re_char *range_table IF_LINT (= NULL);
5539 5513
5540 /* Nonzero if there is a range table. */ 5514 /* Nonzero if there is a range table. */
5541 int range_table_exists; 5515 int range_table_exists;
@@ -5622,8 +5596,8 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
5622 if (!not) goto fail; 5596 if (!not) goto fail;
5623 5597
5624 d += len; 5598 d += len;
5625 break;
5626 } 5599 }
5600 break;
5627 5601
5628 5602
5629 /* The beginning of a group is represented by start_memory. 5603 /* The beginning of a group is represented by start_memory.
@@ -6005,46 +5979,48 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
6005 5979
6006 case wordbound: 5980 case wordbound:
6007 case notwordbound: 5981 case notwordbound:
6008 not = (re_opcode_t) *(p - 1) == notwordbound; 5982 {
6009 DEBUG_PRINT2 ("EXECUTING %swordbound.\n", not?"not":""); 5983 boolean not = (re_opcode_t) *(p - 1) == notwordbound;
5984 DEBUG_PRINT2 ("EXECUTING %swordbound.\n", not?"not":"");
6010 5985
6011 /* We SUCCEED (or FAIL) in one of the following cases: */ 5986 /* We SUCCEED (or FAIL) in one of the following cases: */
6012 5987
6013 /* Case 1: D is at the beginning or the end of string. */ 5988 /* Case 1: D is at the beginning or the end of string. */
6014 if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) 5989 if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
6015 not = !not; 5990 not = !not;
6016 else 5991 else
6017 { 5992 {
6018 /* C1 is the character before D, S1 is the syntax of C1, C2 5993 /* C1 is the character before D, S1 is the syntax of C1, C2
6019 is the character at D, and S2 is the syntax of C2. */ 5994 is the character at D, and S2 is the syntax of C2. */
6020 re_wchar_t c1, c2; 5995 re_wchar_t c1, c2;
6021 int s1, s2; 5996 int s1, s2;
6022 int dummy; 5997 int dummy;
6023#ifdef emacs 5998#ifdef emacs
6024 int offset = PTR_TO_OFFSET (d - 1); 5999 int offset = PTR_TO_OFFSET (d - 1);
6025 int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset); 6000 int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset);
6026 UPDATE_SYNTAX_TABLE (charpos); 6001 UPDATE_SYNTAX_TABLE (charpos);
6027#endif 6002#endif
6028 GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); 6003 GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2);
6029 s1 = SYNTAX (c1); 6004 s1 = SYNTAX (c1);
6030#ifdef emacs 6005#ifdef emacs
6031 UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1); 6006 UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1);
6032#endif 6007#endif
6033 PREFETCH_NOLIMIT (); 6008 PREFETCH_NOLIMIT ();
6034 GET_CHAR_AFTER (c2, d, dummy); 6009 GET_CHAR_AFTER (c2, d, dummy);
6035 s2 = SYNTAX (c2); 6010 s2 = SYNTAX (c2);
6036 6011
6037 if (/* Case 2: Only one of S1 and S2 is Sword. */ 6012 if (/* Case 2: Only one of S1 and S2 is Sword. */
6038 ((s1 == Sword) != (s2 == Sword)) 6013 ((s1 == Sword) != (s2 == Sword))
6039 /* Case 3: Both of S1 and S2 are Sword, and macro 6014 /* Case 3: Both of S1 and S2 are Sword, and macro
6040 WORD_BOUNDARY_P (C1, C2) returns nonzero. */ 6015 WORD_BOUNDARY_P (C1, C2) returns nonzero. */
6041 || ((s1 == Sword) && WORD_BOUNDARY_P (c1, c2))) 6016 || ((s1 == Sword) && WORD_BOUNDARY_P (c1, c2)))
6042 not = !not; 6017 not = !not;
6043 } 6018 }
6044 if (not) 6019 if (not)
6045 break; 6020 break;
6046 else 6021 else
6047 goto fail; 6022 goto fail;
6023 }
6048 6024
6049 case wordbeg: 6025 case wordbeg:
6050 DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); 6026 DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
@@ -6224,25 +6200,27 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
6224 6200
6225 case syntaxspec: 6201 case syntaxspec:
6226 case notsyntaxspec: 6202 case notsyntaxspec:
6227 not = (re_opcode_t) *(p - 1) == notsyntaxspec;
6228 mcnt = *p++;
6229 DEBUG_PRINT3 ("EXECUTING %ssyntaxspec %d.\n", not?"not":"", mcnt);
6230 PREFETCH ();
6231#ifdef emacs
6232 { 6203 {
6233 int offset = PTR_TO_OFFSET (d); 6204 boolean not = (re_opcode_t) *(p - 1) == notsyntaxspec;
6234 int pos1 = SYNTAX_TABLE_BYTE_TO_CHAR (offset); 6205 mcnt = *p++;
6235 UPDATE_SYNTAX_TABLE (pos1); 6206 DEBUG_PRINT3 ("EXECUTING %ssyntaxspec %d.\n", not?"not":"", mcnt);
6236 } 6207 PREFETCH ();
6208#ifdef emacs
6209 {
6210 int offset = PTR_TO_OFFSET (d);
6211 int pos1 = SYNTAX_TABLE_BYTE_TO_CHAR (offset);
6212 UPDATE_SYNTAX_TABLE (pos1);
6213 }
6237#endif 6214#endif
6238 { 6215 {
6239 int len; 6216 int len;
6240 re_wchar_t c; 6217 re_wchar_t c;
6241 6218
6242 GET_CHAR_AFTER (c, d, len); 6219 GET_CHAR_AFTER (c, d, len);
6243 if ((SYNTAX (c) != (enum syntaxcode) mcnt) ^ not) 6220 if ((SYNTAX (c) != (enum syntaxcode) mcnt) ^ not)
6244 goto fail; 6221 goto fail;
6245 d += len; 6222 d += len;
6223 }
6246 } 6224 }
6247 break; 6225 break;
6248 6226
@@ -6267,18 +6245,21 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
6267 6245
6268 case categoryspec: 6246 case categoryspec:
6269 case notcategoryspec: 6247 case notcategoryspec:
6270 not = (re_opcode_t) *(p - 1) == notcategoryspec;
6271 mcnt = *p++;
6272 DEBUG_PRINT3 ("EXECUTING %scategoryspec %d.\n", not?"not":"", mcnt);
6273 PREFETCH ();
6274 { 6248 {
6275 int len; 6249 boolean not = (re_opcode_t) *(p - 1) == notcategoryspec;
6276 re_wchar_t c; 6250 mcnt = *p++;
6251 DEBUG_PRINT3 ("EXECUTING %scategoryspec %d.\n",
6252 not?"not":"", mcnt);
6253 PREFETCH ();
6277 6254
6278 GET_CHAR_AFTER (c, d, len); 6255 {
6279 if ((!CHAR_HAS_CATEGORY (c, mcnt)) ^ not) 6256 int len;
6280 goto fail; 6257 re_wchar_t c;
6281 d += len; 6258 GET_CHAR_AFTER (c, d, len);
6259 if ((!CHAR_HAS_CATEGORY (c, mcnt)) ^ not)
6260 goto fail;
6261 d += len;
6262 }
6282 } 6263 }
6283 break; 6264 break;
6284 6265
diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h
index 443fc034570..c2715fffe01 100644
--- a/src/s/aix4-2.h
+++ b/src/s/aix4-2.h
@@ -32,7 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32 32
33/* In AIX, you allocate a pty by opening /dev/ptc to get the master side. 33/* In AIX, you allocate a pty by opening /dev/ptc to get the master side.
34 To get the name of the slave side, you just ttyname() the master side. */ 34 To get the name of the slave side, you just ttyname() the master side. */
35#define PTY_ITERATION for (c = 0; !c ; c++) 35#define PTY_ITERATION int c; for (c = 0; !c ; c++)
36#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc"); 36#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc");
37#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd)); 37#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd));
38 38
diff --git a/src/s/cygwin.h b/src/s/cygwin.h
index ceebe23f1e7..af5308ff7bb 100644
--- a/src/s/cygwin.h
+++ b/src/s/cygwin.h
@@ -46,7 +46,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
46 46
47/* Define HAVE_PTYS if the system supports pty devices. */ 47/* Define HAVE_PTYS if the system supports pty devices. */
48#define HAVE_PTYS 48#define HAVE_PTYS
49#define PTY_ITERATION for (i = 0; i < 1; i++) /* ick */ 49#define PTY_ITERATION int i; for (i = 0; i < 1; i++) /* ick */
50#define PTY_NAME_SPRINTF /* none */ 50#define PTY_NAME_SPRINTF /* none */
51#define PTY_TTY_NAME_SPRINTF /* none */ 51#define PTY_TTY_NAME_SPRINTF /* none */
52#define PTY_OPEN \ 52#define PTY_OPEN \
@@ -102,4 +102,3 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
102 102
103/* Send signals to subprocesses by "typing" special chars at them. */ 103/* Send signals to subprocesses by "typing" special chars at them. */
104#define SIGNALS_VIA_CHARACTERS 104#define SIGNALS_VIA_CHARACTERS
105
diff --git a/src/s/darwin.h b/src/s/darwin.h
index 4fc2f4d1031..dd0d0c34021 100644
--- a/src/s/darwin.h
+++ b/src/s/darwin.h
@@ -68,7 +68,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
68 Note: PTYs are broken on darwin <6. Use at your own risk. */ 68 Note: PTYs are broken on darwin <6. Use at your own risk. */
69#define HAVE_PTYS 69#define HAVE_PTYS
70/* Run only once. We need a `for'-loop because the code uses `continue'. */ 70/* Run only once. We need a `for'-loop because the code uses `continue'. */
71#define PTY_ITERATION for (i = 0; i < 1; i++) 71#define PTY_ITERATION int i; for (i = 0; i < 1; i++)
72#define PTY_NAME_SPRINTF /* none */ 72#define PTY_NAME_SPRINTF /* none */
73#define PTY_TTY_NAME_SPRINTF /* none */ 73#define PTY_TTY_NAME_SPRINTF /* none */
74/* Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8. 74/* Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8.
@@ -148,4 +148,3 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
148 148
149/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */ 149/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */
150#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS 150#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
151
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h
index 84fe5b92da9..178d7082f72 100644
--- a/src/s/gnu-linux.h
+++ b/src/s/gnu-linux.h
@@ -44,7 +44,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
44#define UNIX98_PTYS 44#define UNIX98_PTYS
45 45
46/* Run only once. We need a `for'-loop because the code uses `continue'. */ 46/* Run only once. We need a `for'-loop because the code uses `continue'. */
47#define PTY_ITERATION for (i = 0; i < 1; i++) 47#define PTY_ITERATION int i; for (i = 0; i < 1; i++)
48 48
49#ifdef HAVE_GETPT 49#ifdef HAVE_GETPT
50#define PTY_NAME_SPRINTF 50#define PTY_NAME_SPRINTF
diff --git a/src/s/irix6-5.h b/src/s/irix6-5.h
index 92465ded2ef..d283571d8fb 100644
--- a/src/s/irix6-5.h
+++ b/src/s/irix6-5.h
@@ -60,6 +60,7 @@ char *_getpty();
60#define PTY_OPEN \ 60#define PTY_OPEN \
61{ \ 61{ \
62 struct sigaction ocstat, cstat; \ 62 struct sigaction ocstat, cstat; \
63 struct stat stb; \
63 char * name; \ 64 char * name; \
64 sigemptyset(&cstat.sa_mask); \ 65 sigemptyset(&cstat.sa_mask); \
65 cstat.sa_handler = SIG_DFL; \ 66 cstat.sa_handler = SIG_DFL; \
@@ -95,5 +96,3 @@ char *_getpty();
95/* Tested on Irix 6.5. SCM worked on earlier versions. */ 96/* Tested on Irix 6.5. SCM worked on earlier versions. */
96#define GC_SETJMP_WORKS 1 97#define GC_SETJMP_WORKS 1
97#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS 98#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
98
99
diff --git a/src/scroll.c b/src/scroll.c
index 1343b89c41e..33af18d2090 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -938,8 +938,8 @@ line_ins_del (FRAME_PTR frame, int ov1, int pf1, int ovn, int pfn, register int
938 938
939static void 939static void
940ins_del_costs (FRAME_PTR frame, 940ins_del_costs (FRAME_PTR frame,
941 char *one_line_string, char *multi_string, 941 const char *one_line_string, const char *multi_string,
942 char *setup_string, char *cleanup_string, 942 const char *setup_string, const char *cleanup_string,
943 int *costvec, int *ncostvec, 943 int *costvec, int *ncostvec,
944 int coefficient) 944 int coefficient)
945{ 945{
@@ -994,9 +994,12 @@ ins_del_costs (FRAME_PTR frame,
994 994
995void 995void
996do_line_insertion_deletion_costs (FRAME_PTR frame, 996do_line_insertion_deletion_costs (FRAME_PTR frame,
997 char *ins_line_string, char *multi_ins_string, 997 const char *ins_line_string,
998 char *del_line_string, char *multi_del_string, 998 const char *multi_ins_string,
999 char *setup_string, char *cleanup_string, 999 const char *del_line_string,
1000 const char *multi_del_string,
1001 const char *setup_string,
1002 const char *cleanup_string,
1000 int coefficient) 1003 int coefficient)
1001{ 1004{
1002 if (FRAME_INSERT_COST (frame) != 0) 1005 if (FRAME_INSERT_COST (frame) != 0)
diff --git a/src/search.c b/src/search.c
index 1e2036f6dc2..bf93a7fe442 100644
--- a/src/search.c
+++ b/src/search.c
@@ -114,17 +114,13 @@ matcher_overflow (void)
114 PATTERN is the pattern to compile. 114 PATTERN is the pattern to compile.
115 CP is the place to put the result. 115 CP is the place to put the result.
116 TRANSLATE is a translation table for ignoring case, or nil for none. 116 TRANSLATE is a translation table for ignoring case, or nil for none.
117 REGP is the structure that says where to store the "register"
118 values that will result from matching this pattern.
119 If it is 0, we should compile the pattern not to record any
120 subexpression bounds.
121 POSIX is nonzero if we want full backtracking (POSIX style) 117 POSIX is nonzero if we want full backtracking (POSIX style)
122 for this pattern. 0 means backtrack only enough to get a valid match. 118 for this pattern. 0 means backtrack only enough to get a valid match.
123 119
124 The behavior also depends on Vsearch_spaces_regexp. */ 120 The behavior also depends on Vsearch_spaces_regexp. */
125 121
126static void 122static void
127compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, Lisp_Object translate, struct re_registers *regp, int posix) 123compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, Lisp_Object translate, int posix)
128{ 124{
129 char *val; 125 char *val;
130 reg_syntax_t old; 126 reg_syntax_t old;
@@ -247,7 +243,7 @@ compile_pattern (Lisp_Object pattern, struct re_registers *regp, Lisp_Object tra
247 if (cp->next == 0) 243 if (cp->next == 0)
248 { 244 {
249 compile_it: 245 compile_it:
250 compile_pattern_1 (cp, pattern, translate, regp, posix); 246 compile_pattern_1 (cp, pattern, translate, posix);
251 break; 247 break;
252 } 248 }
253 } 249 }
@@ -1558,7 +1554,6 @@ simple_search (EMACS_INT n, unsigned char *pat,
1558 1554
1559 while (this_len > 0) 1555 while (this_len > 0)
1560 { 1556 {
1561 int charlen;
1562 int pat_ch, buf_ch; 1557 int pat_ch, buf_ch;
1563 1558
1564 DEC_BOTH (this_pos, this_pos_byte); 1559 DEC_BOTH (this_pos, this_pos_byte);
@@ -1730,17 +1725,17 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat,
1730 /* Setup translate_prev_byte1/2/3/4 from CHAR_BASE. Only a 1725 /* Setup translate_prev_byte1/2/3/4 from CHAR_BASE. Only a
1731 byte following them are the target of translation. */ 1726 byte following them are the target of translation. */
1732 unsigned char str[MAX_MULTIBYTE_LENGTH]; 1727 unsigned char str[MAX_MULTIBYTE_LENGTH];
1733 int len = CHAR_STRING (char_base, str); 1728 int cblen = CHAR_STRING (char_base, str);
1734 1729
1735 translate_prev_byte1 = str[len - 2]; 1730 translate_prev_byte1 = str[cblen - 2];
1736 if (len > 2) 1731 if (cblen > 2)
1737 { 1732 {
1738 translate_prev_byte2 = str[len - 3]; 1733 translate_prev_byte2 = str[cblen - 3];
1739 if (len > 3) 1734 if (cblen > 3)
1740 { 1735 {
1741 translate_prev_byte3 = str[len - 4]; 1736 translate_prev_byte3 = str[cblen - 4];
1742 if (len > 4) 1737 if (cblen > 4)
1743 translate_prev_byte4 = str[len - 5]; 1738 translate_prev_byte4 = str[cblen - 5];
1744 } 1739 }
1745 } 1740 }
1746 } 1741 }
@@ -2474,7 +2469,7 @@ since only regular expressions have distinguished subexpressions. */)
2474 else 2469 else
2475 FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, string, pos, pos_byte); 2470 FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, string, pos, pos_byte);
2476 2471
2477 if (LOWERCASEP (c)) 2472 if (lowercasep (c))
2478 { 2473 {
2479 /* Cannot be all caps if any original char is lower case */ 2474 /* Cannot be all caps if any original char is lower case */
2480 2475
@@ -2484,7 +2479,7 @@ since only regular expressions have distinguished subexpressions. */)
2484 else 2479 else
2485 some_multiletter_word = 1; 2480 some_multiletter_word = 1;
2486 } 2481 }
2487 else if (UPPERCASEP (c)) 2482 else if (uppercasep (c))
2488 { 2483 {
2489 some_uppercase = 1; 2484 some_uppercase = 1;
2490 if (SYNTAX (prevc) != Sword) 2485 if (SYNTAX (prevc) != Sword)
diff --git a/src/syntax.c b/src/syntax.c
index 707c2c19f31..c1442c396c1 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -513,7 +513,7 @@ back_comment (EMACS_INT from, EMACS_INT from_byte, EMACS_INT stop, int comnested
513 EMACS_INT comment_end = from; 513 EMACS_INT comment_end = from;
514 EMACS_INT comment_end_byte = from_byte; 514 EMACS_INT comment_end_byte = from_byte;
515 EMACS_INT comstart_pos = 0; 515 EMACS_INT comstart_pos = 0;
516 EMACS_INT comstart_byte; 516 EMACS_INT comstart_byte IF_LINT (= 0);
517 /* Place where the containing defun starts, 517 /* Place where the containing defun starts,
518 or 0 if we didn't come across it yet. */ 518 or 0 if we didn't come across it yet. */
519 EMACS_INT defun_start = 0; 519 EMACS_INT defun_start = 0;
@@ -554,7 +554,7 @@ back_comment (EMACS_INT from, EMACS_INT from_byte, EMACS_INT stop, int comnested
554 com2end = (SYNTAX_FLAGS_COMEND_FIRST (syntax) 554 com2end = (SYNTAX_FLAGS_COMEND_FIRST (syntax)
555 && SYNTAX_FLAGS_COMEND_SECOND (prev_syntax)); 555 && SYNTAX_FLAGS_COMEND_SECOND (prev_syntax));
556 comstart = (com2start || code == Scomment); 556 comstart = (com2start || code == Scomment);
557 557
558 /* Nasty cases with overlapping 2-char comment markers: 558 /* Nasty cases with overlapping 2-char comment markers:
559 - snmp-mode: -- c -- foo -- c -- 559 - snmp-mode: -- c -- foo -- c --
560 --- c -- 560 --- c --
@@ -1421,7 +1421,7 @@ skip_chars (int forwardp, Lisp_Object string, Lisp_Object lim, int handle_iso_cl
1421 register unsigned int c; 1421 register unsigned int c;
1422 unsigned char fastmap[0400]; 1422 unsigned char fastmap[0400];
1423 /* Store the ranges of non-ASCII characters. */ 1423 /* Store the ranges of non-ASCII characters. */
1424 int *char_ranges; 1424 int *char_ranges IF_LINT (= NULL);
1425 int n_char_ranges = 0; 1425 int n_char_ranges = 0;
1426 int negate = 0; 1426 int negate = 0;
1427 register EMACS_INT i, i_byte; 1427 register EMACS_INT i, i_byte;
@@ -2363,7 +2363,7 @@ between them, return t; otherwise return nil. */)
2363 if (code == Scomment_fence) 2363 if (code == Scomment_fence)
2364 { 2364 {
2365 /* Skip until first preceding unquoted comment_fence. */ 2365 /* Skip until first preceding unquoted comment_fence. */
2366 int found = 0; 2366 int fence_found = 0;
2367 EMACS_INT ini = from, ini_byte = from_byte; 2367 EMACS_INT ini = from, ini_byte = from_byte;
2368 2368
2369 while (1) 2369 while (1)
@@ -2374,13 +2374,13 @@ between them, return t; otherwise return nil. */)
2374 if (SYNTAX (c) == Scomment_fence 2374 if (SYNTAX (c) == Scomment_fence
2375 && !char_quoted (from, from_byte)) 2375 && !char_quoted (from, from_byte))
2376 { 2376 {
2377 found = 1; 2377 fence_found = 1;
2378 break; 2378 break;
2379 } 2379 }
2380 else if (from == stop) 2380 else if (from == stop)
2381 break; 2381 break;
2382 } 2382 }
2383 if (found == 0) 2383 if (fence_found == 0)
2384 { 2384 {
2385 from = ini; /* Set point to ini + 1. */ 2385 from = ini; /* Set point to ini + 1. */
2386 from_byte = ini_byte; 2386 from_byte = ini_byte;
@@ -2669,12 +2669,12 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf
2669 /* We must record the comment style encountered so that 2669 /* We must record the comment style encountered so that
2670 later, we can match only the proper comment begin 2670 later, we can match only the proper comment begin
2671 sequence of the same style. */ 2671 sequence of the same style. */
2672 int c1, other_syntax; 2672 int c2, other_syntax;
2673 DEC_BOTH (from, from_byte); 2673 DEC_BOTH (from, from_byte);
2674 UPDATE_SYNTAX_TABLE_BACKWARD (from); 2674 UPDATE_SYNTAX_TABLE_BACKWARD (from);
2675 code = Sendcomment; 2675 code = Sendcomment;
2676 c1 = FETCH_CHAR_AS_MULTIBYTE (from_byte); 2676 c2 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
2677 other_syntax = SYNTAX_WITH_FLAGS (c1); 2677 other_syntax = SYNTAX_WITH_FLAGS (c2);
2678 comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax); 2678 comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax);
2679 comnested 2679 comnested
2680 = comnested || SYNTAX_FLAGS_COMMENT_NESTED (other_syntax); 2680 = comnested || SYNTAX_FLAGS_COMMENT_NESTED (other_syntax);
@@ -3528,4 +3528,3 @@ In both cases, LIMIT bounds the search. */);
3528 defsubr (&Sbackward_prefix_chars); 3528 defsubr (&Sbackward_prefix_chars);
3529 defsubr (&Sparse_partial_sexp); 3529 defsubr (&Sparse_partial_sexp);
3530} 3530}
3531
diff --git a/src/sysdep.c b/src/sysdep.c
index 5760d0224eb..6ef3d88c5c8 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -292,10 +292,6 @@ init_baud_rate (int fd)
292int wait_debugging; /* Set nonzero to make following function work under dbx 292int wait_debugging; /* Set nonzero to make following function work under dbx
293 (at least for bsd). */ 293 (at least for bsd). */
294 294
295SIGTYPE
296wait_for_termination_signal (void)
297{}
298
299#ifndef MSDOS 295#ifndef MSDOS
300/* Wait for subprocess with process id `pid' to terminate and 296/* Wait for subprocess with process id `pid' to terminate and
301 make sure it will get eliminated (not remain forever as a zombie) */ 297 make sure it will get eliminated (not remain forever as a zombie) */
@@ -492,7 +488,7 @@ sys_subshell (void)
492 int pid; 488 int pid;
493 struct save_signal saved_handlers[5]; 489 struct save_signal saved_handlers[5];
494 Lisp_Object dir; 490 Lisp_Object dir;
495 unsigned char *str = 0; 491 unsigned char * IF_LINT (volatile) str = 0;
496 int len; 492 int len;
497 493
498 saved_handlers[0].code = SIGINT; 494 saved_handlers[0].code = SIGINT;
@@ -632,7 +628,7 @@ init_sigio (int fd)
632{ 628{
633} 629}
634 630
635void 631static void
636reset_sigio (int fd) 632reset_sigio (int fd)
637{ 633{
638} 634}
@@ -662,7 +658,7 @@ init_sigio (int fd)
662 interrupts_deferred = 0; 658 interrupts_deferred = 0;
663} 659}
664 660
665void 661static void
666reset_sigio (int fd) 662reset_sigio (int fd)
667{ 663{
668#ifdef FASYNC 664#ifdef FASYNC
@@ -1890,13 +1886,13 @@ emacs_write (int fildes, const char *buf, unsigned int nbyte)
1890 * under error conditions. 1886 * under error conditions.
1891 */ 1887 */
1892 1888
1889#ifndef HAVE_GETWD
1890
1893#ifndef MAXPATHLEN 1891#ifndef MAXPATHLEN
1894/* In 4.1, param.h fails to define this. */ 1892/* In 4.1, param.h fails to define this. */
1895#define MAXPATHLEN 1024 1893#define MAXPATHLEN 1024
1896#endif 1894#endif
1897 1895
1898#ifndef HAVE_GETWD
1899
1900char * 1896char *
1901getwd (char *pathname) 1897getwd (char *pathname)
1902{ 1898{
@@ -2671,8 +2667,8 @@ system_process_attributes (Lisp_Object pid)
2671 size_t cmdsize = 0, cmdline_size; 2667 size_t cmdsize = 0, cmdline_size;
2672 unsigned char c; 2668 unsigned char c;
2673 int proc_id, ppid, uid, gid, pgrp, sess, tty, tpgid, thcount; 2669 int proc_id, ppid, uid, gid, pgrp, sess, tty, tpgid, thcount;
2674 unsigned long long utime, stime, cutime, cstime, start; 2670 unsigned long long u_time, s_time, cutime, cstime, start;
2675 long priority, nice, rss; 2671 long priority, niceness, rss;
2676 unsigned long minflt, majflt, cminflt, cmajflt, vsize; 2672 unsigned long minflt, majflt, cminflt, cmajflt, vsize;
2677 time_t sec; 2673 time_t sec;
2678 unsigned usec; 2674 unsigned usec;
@@ -2752,8 +2748,8 @@ system_process_attributes (Lisp_Object pid)
2752 sscanf (p, "%c %d %d %d %d %d %*u %lu %lu %lu %lu %Lu %Lu %Lu %Lu %ld %ld %d %*d %Lu %lu %ld", 2748 sscanf (p, "%c %d %d %d %d %d %*u %lu %lu %lu %lu %Lu %Lu %Lu %Lu %ld %ld %d %*d %Lu %lu %ld",
2753 &c, &ppid, &pgrp, &sess, &tty, &tpgid, 2749 &c, &ppid, &pgrp, &sess, &tty, &tpgid,
2754 &minflt, &cminflt, &majflt, &cmajflt, 2750 &minflt, &cminflt, &majflt, &cmajflt,
2755 &utime, &stime, &cutime, &cstime, 2751 &u_time, &s_time, &cutime, &cstime,
2756 &priority, &nice, &thcount, &start, &vsize, &rss); 2752 &priority, &niceness, &thcount, &start, &vsize, &rss);
2757 { 2753 {
2758 char state_str[2]; 2754 char state_str[2];
2759 2755
@@ -2781,13 +2777,14 @@ system_process_attributes (Lisp_Object pid)
2781 if (clocks_per_sec < 0) 2777 if (clocks_per_sec < 0)
2782 clocks_per_sec = 100; 2778 clocks_per_sec = 100;
2783 attrs = Fcons (Fcons (Qutime, 2779 attrs = Fcons (Fcons (Qutime,
2784 ltime_from_jiffies (utime, clocks_per_sec)), 2780 ltime_from_jiffies (u_time, clocks_per_sec)),
2785 attrs); 2781 attrs);
2786 attrs = Fcons (Fcons (Qstime, 2782 attrs = Fcons (Fcons (Qstime,
2787 ltime_from_jiffies (stime, clocks_per_sec)), 2783 ltime_from_jiffies (s_time, clocks_per_sec)),
2788 attrs); 2784 attrs);
2789 attrs = Fcons (Fcons (Qtime, 2785 attrs = Fcons (Fcons (Qtime,
2790 ltime_from_jiffies (stime+utime, clocks_per_sec)), 2786 ltime_from_jiffies (s_time + u_time,
2787 clocks_per_sec)),
2791 attrs); 2788 attrs);
2792 attrs = Fcons (Fcons (Qcutime, 2789 attrs = Fcons (Fcons (Qcutime,
2793 ltime_from_jiffies (cutime, clocks_per_sec)), 2790 ltime_from_jiffies (cutime, clocks_per_sec)),
@@ -2799,7 +2796,7 @@ system_process_attributes (Lisp_Object pid)
2799 ltime_from_jiffies (cstime+cutime, clocks_per_sec)), 2796 ltime_from_jiffies (cstime+cutime, clocks_per_sec)),
2800 attrs); 2797 attrs);
2801 attrs = Fcons (Fcons (Qpri, make_number (priority)), attrs); 2798 attrs = Fcons (Fcons (Qpri, make_number (priority)), attrs);
2802 attrs = Fcons (Fcons (Qnice, make_number (nice)), attrs); 2799 attrs = Fcons (Fcons (Qnice, make_number (niceness)), attrs);
2803 attrs = Fcons (Fcons (Qthcount, make_fixnum_or_float (thcount_eint)), attrs); 2800 attrs = Fcons (Fcons (Qthcount, make_fixnum_or_float (thcount_eint)), attrs);
2804 EMACS_GET_TIME (tnow); 2801 EMACS_GET_TIME (tnow);
2805 get_up_time (&sec, &usec); 2802 get_up_time (&sec, &usec);
@@ -2829,7 +2826,7 @@ system_process_attributes (Lisp_Object pid)
2829 make_number 2826 make_number
2830 (EMACS_USECS (telapsed)))), 2827 (EMACS_USECS (telapsed)))),
2831 attrs); 2828 attrs);
2832 time_from_jiffies (utime + stime, clocks_per_sec, &sec, &usec); 2829 time_from_jiffies (u_time + s_time, clocks_per_sec, &sec, &usec);
2833 pcpu = (sec + usec / 1000000.0) / (EMACS_SECS (telapsed) + EMACS_USECS (telapsed) / 1000000.0); 2830 pcpu = (sec + usec / 1000000.0) / (EMACS_SECS (telapsed) + EMACS_USECS (telapsed) / 1000000.0);
2834 if (pcpu > 1.0) 2831 if (pcpu > 1.0)
2835 pcpu = 1.0; 2832 pcpu = 1.0;
@@ -2848,8 +2845,10 @@ system_process_attributes (Lisp_Object pid)
2848 fd = emacs_open (fn, O_RDONLY, 0); 2845 fd = emacs_open (fn, O_RDONLY, 0);
2849 if (fd >= 0) 2846 if (fd >= 0)
2850 { 2847 {
2851 for (cmdline_size = 0; emacs_read (fd, &c, 1) == 1; cmdline_size++) 2848 char ch;
2849 for (cmdline_size = 0; emacs_read (fd, &ch, 1) == 1; cmdline_size++)
2852 { 2850 {
2851 c = ch;
2853 if (isspace (c) || c == '\\') 2852 if (isspace (c) || c == '\\')
2854 cmdline_size++; /* for later quoting, see below */ 2853 cmdline_size++; /* for later quoting, see below */
2855 } 2854 }
diff --git a/src/systime.h b/src/systime.h
index eae302904fa..cb1ea230f7d 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -144,10 +144,8 @@ extern void set_waiting_for_input (EMACS_TIME *);
144 happen when this files is used outside the src directory). 144 happen when this files is used outside the src directory).
145 Use GCPRO1 to determine if lisp.h was included. */ 145 Use GCPRO1 to determine if lisp.h was included. */
146#ifdef GCPRO1 146#ifdef GCPRO1
147/* defined in dired.c */
148extern Lisp_Object make_time (time_t);
149
150/* defined in editfns.c*/ 147/* defined in editfns.c*/
148extern Lisp_Object make_time (time_t);
151extern int lisp_time_argument (Lisp_Object, time_t *, int *); 149extern int lisp_time_argument (Lisp_Object, time_t *, int *);
152#endif 150#endif
153 151
@@ -172,4 +170,3 @@ extern int lisp_time_argument (Lisp_Object, time_t *, int *);
172#define EMACS_TIME_LE(T1, T2) (EMACS_TIME_CMP (T1, T2) <= 0) 170#define EMACS_TIME_LE(T1, T2) (EMACS_TIME_CMP (T1, T2) <= 0)
173 171
174#endif /* EMACS_SYSTIME_H */ 172#endif /* EMACS_SYSTIME_H */
175
diff --git a/src/systty.h b/src/systty.h
index 2eacfdb2716..1548952e7a8 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -118,3 +118,6 @@ struct emacs_tty {
118extern int emacs_get_tty (int, struct emacs_tty *); 118extern int emacs_get_tty (int, struct emacs_tty *);
119extern int emacs_set_tty (int, struct emacs_tty *, int); 119extern int emacs_set_tty (int, struct emacs_tty *, int);
120 120
121/* From sysdep.c or w32.c */
122extern int serial_open (char *);
123extern void serial_configure (struct Lisp_Process *, Lisp_Object);
diff --git a/src/term.c b/src/term.c
index f082bb40e89..e84bbe125f8 100644
--- a/src/term.c
+++ b/src/term.c
@@ -32,6 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32#include "lisp.h" 32#include "lisp.h"
33#include "termchar.h" 33#include "termchar.h"
34#include "termopts.h" 34#include "termopts.h"
35#include "tparam.h"
35#include "buffer.h" 36#include "buffer.h"
36#include "character.h" 37#include "character.h"
37#include "charset.h" 38#include "charset.h"
@@ -53,18 +54,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
53static int been_here = -1; 54static int been_here = -1;
54#endif 55#endif
55 56
56/* For now, don't try to include termcap.h. On some systems,
57 configure finds a non-standard termcap.h that the main build
58 won't find. */
59extern void tputs (const char *, int, int (*)(int));
60extern int tgetent (char *, const char *);
61extern int tgetflag (char *id);
62extern int tgetnum (char *id);
63
64char *tparam (char *, char *, int, int, ...);
65
66extern char *tgetstr (char *, char **);
67
68#include "cm.h" 57#include "cm.h"
69#ifdef HAVE_X_WINDOWS 58#ifdef HAVE_X_WINDOWS
70#include "xterm.h" 59#include "xterm.h"
@@ -262,7 +251,7 @@ tty_set_scroll_region (struct frame *f, int start, int stop)
262 struct tty_display_info *tty = FRAME_TTY (f); 251 struct tty_display_info *tty = FRAME_TTY (f);
263 252
264 if (tty->TS_set_scroll_region) 253 if (tty->TS_set_scroll_region)
265 buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1); 254 buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1, 0, 0);
266 else if (tty->TS_set_scroll_region_1) 255 else if (tty->TS_set_scroll_region_1)
267 buf = tparam (tty->TS_set_scroll_region_1, 0, 0, 256 buf = tparam (tty->TS_set_scroll_region_1, 0, 0,
268 FRAME_LINES (f), start, 257 FRAME_LINES (f), start,
@@ -544,8 +533,8 @@ encode_terminal_code (struct glyph *src, int src_len, struct coding_system *codi
544 { 533 {
545 if (src->type == COMPOSITE_GLYPH) 534 if (src->type == COMPOSITE_GLYPH)
546 { 535 {
547 struct composition *cmp; 536 struct composition *cmp IF_LINT (= NULL);
548 Lisp_Object gstring; 537 Lisp_Object gstring IF_LINT (= Qnil);
549 int i; 538 int i;
550 539
551 nbytes = buf - encode_terminal_src; 540 nbytes = buf - encode_terminal_src;
@@ -606,7 +595,7 @@ encode_terminal_code (struct glyph *src, int src_len, struct coding_system *codi
606 else if (! CHAR_GLYPH_PADDING_P (*src)) 595 else if (! CHAR_GLYPH_PADDING_P (*src))
607 { 596 {
608 GLYPH g; 597 GLYPH g;
609 int c; 598 int c IF_LINT (= 0);
610 Lisp_Object string; 599 Lisp_Object string;
611 600
612 string = Qnil; 601 string = Qnil;
@@ -664,8 +653,6 @@ encode_terminal_code (struct glyph *src, int src_len, struct coding_system *codi
664 } 653 }
665 else 654 else
666 { 655 {
667 unsigned char *p = SDATA (string);
668
669 if (! STRING_MULTIBYTE (string)) 656 if (! STRING_MULTIBYTE (string))
670 string = string_to_multibyte (string); 657 string = string_to_multibyte (string);
671 nbytes = buf - encode_terminal_src; 658 nbytes = buf - encode_terminal_src;
@@ -861,7 +848,7 @@ tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
861 848
862 if (tty->TS_ins_multi_chars) 849 if (tty->TS_ins_multi_chars)
863 { 850 {
864 buf = tparam (tty->TS_ins_multi_chars, 0, 0, len); 851 buf = tparam (tty->TS_ins_multi_chars, 0, 0, len, 0, 0, 0);
865 OUTPUT1 (tty, buf); 852 OUTPUT1 (tty, buf);
866 xfree (buf); 853 xfree (buf);
867 if (start) 854 if (start)
@@ -957,7 +944,7 @@ tty_delete_glyphs (struct frame *f, int n)
957 944
958 if (tty->TS_del_multi_chars) 945 if (tty->TS_del_multi_chars)
959 { 946 {
960 buf = tparam (tty->TS_del_multi_chars, 0, 0, n); 947 buf = tparam (tty->TS_del_multi_chars, 0, 0, n, 0, 0, 0);
961 OUTPUT1 (tty, buf); 948 OUTPUT1 (tty, buf);
962 xfree (buf); 949 xfree (buf);
963 } 950 }
@@ -974,9 +961,10 @@ static void
974tty_ins_del_lines (struct frame *f, int vpos, int n) 961tty_ins_del_lines (struct frame *f, int vpos, int n)
975{ 962{
976 struct tty_display_info *tty = FRAME_TTY (f); 963 struct tty_display_info *tty = FRAME_TTY (f);
977 char *multi = n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines; 964 const char *multi =
978 char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line; 965 n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines;
979 char *scroll = n > 0 ? tty->TS_rev_scroll : tty->TS_fwd_scroll; 966 const char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line;
967 const char *scroll = n > 0 ? tty->TS_rev_scroll : tty->TS_fwd_scroll;
980 968
981 register int i = n > 0 ? n : -n; 969 register int i = n > 0 ? n : -n;
982 register char *buf; 970 register char *buf;
@@ -999,7 +987,7 @@ tty_ins_del_lines (struct frame *f, int vpos, int n)
999 { 987 {
1000 raw_cursor_to (f, vpos, 0); 988 raw_cursor_to (f, vpos, 0);
1001 tty_background_highlight (tty); 989 tty_background_highlight (tty);
1002 buf = tparam (multi, 0, 0, i); 990 buf = tparam (multi, 0, 0, i, 0, 0, 0);
1003 OUTPUT (tty, buf); 991 OUTPUT (tty, buf);
1004 xfree (buf); 992 xfree (buf);
1005 } 993 }
@@ -1151,9 +1139,9 @@ calculate_costs (struct frame *frame)
1151 if (FRAME_TERMCAP_P (frame)) 1139 if (FRAME_TERMCAP_P (frame))
1152 { 1140 {
1153 struct tty_display_info *tty = FRAME_TTY (frame); 1141 struct tty_display_info *tty = FRAME_TTY (frame);
1154 register char *f = (tty->TS_set_scroll_region 1142 register const char *f = (tty->TS_set_scroll_region
1155 ? tty->TS_set_scroll_region 1143 ? tty->TS_set_scroll_region
1156 : tty->TS_set_scroll_region_1); 1144 : tty->TS_set_scroll_region_1);
1157 1145
1158 FRAME_SCROLL_REGION_COST (frame) = string_cost (f); 1146 FRAME_SCROLL_REGION_COST (frame) = string_cost (f);
1159 1147
@@ -1207,7 +1195,7 @@ calculate_costs (struct frame *frame)
1207} 1195}
1208 1196
1209struct fkey_table { 1197struct fkey_table {
1210 char *cap, *name; 1198 const char *cap, *name;
1211}; 1199};
1212 1200
1213 /* Termcap capability names that correspond directly to X keysyms. 1201 /* Termcap capability names that correspond directly to X keysyms.
@@ -1365,9 +1353,9 @@ term_get_fkeys_1 (void)
1365 "k;", and if it is present, assuming that "k0" denotes F0, otherwise F10. 1353 "k;", and if it is present, assuming that "k0" denotes F0, otherwise F10.
1366 */ 1354 */
1367 { 1355 {
1368 char *k_semi = tgetstr ("k;", address); 1356 const char *k_semi = tgetstr ("k;", address);
1369 char *k0 = tgetstr ("k0", address); 1357 const char *k0 = tgetstr ("k0", address);
1370 char *k0_name = "f10"; 1358 const char *k0_name = "f10";
1371 1359
1372 if (k_semi) 1360 if (k_semi)
1373 { 1361 {
@@ -1460,7 +1448,7 @@ static void append_glyph (struct it *);
1460static void produce_stretch_glyph (struct it *); 1448static void produce_stretch_glyph (struct it *);
1461static void append_composite_glyph (struct it *); 1449static void append_composite_glyph (struct it *);
1462static void produce_composite_glyph (struct it *); 1450static void produce_composite_glyph (struct it *);
1463static void append_glyphless_glyph (struct it *, int, char *); 1451static void append_glyphless_glyph (struct it *, int, const char *);
1464static void produce_glyphless_glyph (struct it *, int, Lisp_Object); 1452static void produce_glyphless_glyph (struct it *, int, Lisp_Object);
1465 1453
1466/* Append glyphs to IT's glyph_row. Called from produce_glyphs for 1454/* Append glyphs to IT's glyph_row. Called from produce_glyphs for
@@ -1828,7 +1816,7 @@ produce_composite_glyph (struct it *it)
1828 comes from it->nglyphs bytes). */ 1816 comes from it->nglyphs bytes). */
1829 1817
1830static void 1818static void
1831append_glyphless_glyph (struct it *it, int face_id, char *str) 1819append_glyphless_glyph (struct it *it, int face_id, const char *str)
1832{ 1820{
1833 struct glyph *glyph, *end; 1821 struct glyph *glyph, *end;
1834 int i; 1822 int i;
@@ -1903,7 +1891,8 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
1903{ 1891{
1904 int face_id; 1892 int face_id;
1905 int len; 1893 int len;
1906 char buf[9], *str = " "; 1894 char buf[9];
1895 char const *str = " ";
1907 1896
1908 /* Get a face ID for the glyph by utilizing a cache (the same way as 1897 /* Get a face ID for the glyph by utilizing a cache (the same way as
1909 done for `escape-glyph' in get_next_display_element). */ 1898 done for `escape-glyph' in get_next_display_element). */
@@ -2122,12 +2111,13 @@ turn_on_face (struct frame *f, int face_id)
2122 2111
2123 if (tty->TN_max_colors > 0) 2112 if (tty->TN_max_colors > 0)
2124 { 2113 {
2125 char *ts, *p; 2114 const char *ts;
2115 char *p;
2126 2116
2127 ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground; 2117 ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground;
2128 if (fg >= 0 && ts) 2118 if (fg >= 0 && ts)
2129 { 2119 {
2130 p = tparam (ts, NULL, 0, (int) fg); 2120 p = tparam (ts, NULL, 0, (int) fg, 0, 0, 0);
2131 OUTPUT (tty, p); 2121 OUTPUT (tty, p);
2132 xfree (p); 2122 xfree (p);
2133 } 2123 }
@@ -2135,7 +2125,7 @@ turn_on_face (struct frame *f, int face_id)
2135 ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background; 2125 ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background;
2136 if (bg >= 0 && ts) 2126 if (bg >= 0 && ts)
2137 { 2127 {
2138 p = tparam (ts, NULL, 0, (int) bg); 2128 p = tparam (ts, NULL, 0, (int) bg, 0, 0, 0);
2139 OUTPUT (tty, p); 2129 OUTPUT (tty, p);
2140 xfree (p); 2130 xfree (p);
2141 } 2131 }
@@ -2698,14 +2688,14 @@ term_mouse_movement (FRAME_PTR frame, Gpm_Event *event)
2698 Set *bar_window to Qnil, and *x and *y to the column and 2688 Set *bar_window to Qnil, and *x and *y to the column and
2699 row of the character cell the mouse is over. 2689 row of the character cell the mouse is over.
2700 2690
2701 Set *time to the time the mouse was at the returned position. 2691 Set *timeptr to the time the mouse was at the returned position.
2702 2692
2703 This clears mouse_moved until the next motion 2693 This clears mouse_moved until the next motion
2704 event arrives. */ 2694 event arrives. */
2705static void 2695static void
2706term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, 2696term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
2707 enum scroll_bar_part *part, Lisp_Object *x, 2697 enum scroll_bar_part *part, Lisp_Object *x,
2708 Lisp_Object *y, unsigned long *time) 2698 Lisp_Object *y, unsigned long *timeptr)
2709{ 2699{
2710 struct timeval now; 2700 struct timeval now;
2711 2701
@@ -2718,7 +2708,7 @@ term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
2718 XSETINT (*x, last_mouse_x); 2708 XSETINT (*x, last_mouse_x);
2719 XSETINT (*y, last_mouse_y); 2709 XSETINT (*y, last_mouse_y);
2720 gettimeofday(&now, 0); 2710 gettimeofday(&now, 0);
2721 *time = (now.tv_sec * 1000) + (now.tv_usec / 1000); 2711 *timeptr = (now.tv_sec * 1000) + (now.tv_usec / 1000);
2722} 2712}
2723 2713
2724/* Prepare a mouse-event in *RESULT for placement in the input queue. 2714/* Prepare a mouse-event in *RESULT for placement in the input queue.
@@ -3532,10 +3522,10 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
3532 If it were in the termcap entry, it would confuse other programs. */ 3522 If it were in the termcap entry, it would confuse other programs. */
3533 if (!tty->TS_set_window) 3523 if (!tty->TS_set_window)
3534 { 3524 {
3535 p = tty->TS_termcap_modes; 3525 const char *m = tty->TS_termcap_modes;
3536 while (*p && strcmp (p, "\033v ")) 3526 while (*m && strcmp (m, "\033v "))
3537 p++; 3527 m++;
3538 if (*p) 3528 if (*m)
3539 tty->TS_set_window = "\033v%C %C %C %C "; 3529 tty->TS_set_window = "\033v%C %C %C %C ";
3540 } 3530 }
3541 /* Termcap entry often fails to have :in: flag */ 3531 /* Termcap entry often fails to have :in: flag */
diff --git a/src/termcap.c b/src/termcap.c
index 69ce56d93b3..27a20a67ae1 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -25,6 +25,10 @@ Boston, MA 02110-1301, USA. */
25#include <unistd.h> 25#include <unistd.h>
26 26
27#include "lisp.h" 27#include "lisp.h"
28#include "tparam.h"
29#ifdef MSDOS
30#include "msdos.h"
31#endif
28 32
29#ifndef NULL 33#ifndef NULL
30#define NULL (char *) 0 34#define NULL (char *) 0
@@ -65,7 +69,7 @@ static char *tgetst1 (char *ptr, char **area);
65 0 if not found. */ 69 0 if not found. */
66 70
67static char * 71static char *
68find_capability (register char *bp, register char *cap) 72find_capability (register char *bp, register const char *cap)
69{ 73{
70 for (; *bp; bp++) 74 for (; *bp; bp++)
71 if (bp[0] == ':' 75 if (bp[0] == ':'
@@ -76,7 +80,7 @@ find_capability (register char *bp, register char *cap)
76} 80}
77 81
78int 82int
79tgetnum (char *cap) 83tgetnum (const char *cap)
80{ 84{
81 register char *ptr = find_capability (term_entry, cap); 85 register char *ptr = find_capability (term_entry, cap);
82 if (!ptr || ptr[-1] != '#') 86 if (!ptr || ptr[-1] != '#')
@@ -85,7 +89,7 @@ tgetnum (char *cap)
85} 89}
86 90
87int 91int
88tgetflag (char *cap) 92tgetflag (const char *cap)
89{ 93{
90 register char *ptr = find_capability (term_entry, cap); 94 register char *ptr = find_capability (term_entry, cap);
91 return ptr && ptr[-1] == ':'; 95 return ptr && ptr[-1] == ':';
@@ -97,7 +101,7 @@ tgetflag (char *cap)
97 If AREA is null, space is allocated with `malloc'. */ 101 If AREA is null, space is allocated with `malloc'. */
98 102
99char * 103char *
100tgetstr (char *cap, char **area) 104tgetstr (const char *cap, char **area)
101{ 105{
102 register char *ptr = find_capability (term_entry, cap); 106 register char *ptr = find_capability (term_entry, cap);
103 if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~')) 107 if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~'))
@@ -263,7 +267,7 @@ tgetst1 (char *ptr, char **area)
263char PC; 267char PC;
264 268
265void 269void
266tputs (register char *str, int nlines, register int (*outfun) (/* ??? */)) 270tputs (register const char *str, int nlines, int (*outfun) (int))
267{ 271{
268 register int padcount = 0; 272 register int padcount = 0;
269 register int speed; 273 register int speed;
@@ -355,7 +359,7 @@ valid_filename_p (fn)
355 in it, and some other value otherwise. */ 359 in it, and some other value otherwise. */
356 360
357int 361int
358tgetent (char *bp, char *name) 362tgetent (char *bp, const char *name)
359{ 363{
360 register char *termcap_name; 364 register char *termcap_name;
361 register int fd; 365 register int fd;
@@ -442,7 +446,7 @@ tgetent (char *bp, char *name)
442 buf.size = BUFSIZE; 446 buf.size = BUFSIZE;
443 /* Add 1 to size to ensure room for terminating null. */ 447 /* Add 1 to size to ensure room for terminating null. */
444 buf.beg = (char *) xmalloc (buf.size + 1); 448 buf.beg = (char *) xmalloc (buf.size + 1);
445 term = indirect ? indirect : name; 449 term = indirect ? indirect : (char *)name;
446 450
447 if (!bp) 451 if (!bp)
448 { 452 {
diff --git a/src/termchar.h b/src/termchar.h
index 277a96932b4..035974a8ce6 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -84,58 +84,58 @@ struct tty_display_info
84 84
85 /* Strings, numbers and flags taken from the termcap entry. */ 85 /* Strings, numbers and flags taken from the termcap entry. */
86 86
87 char *TS_ins_line; /* "al" */ 87 const char *TS_ins_line; /* "al" */
88 char *TS_ins_multi_lines; /* "AL" (one parameter, # lines to insert) */ 88 const char *TS_ins_multi_lines; /* "AL" (one parameter, # lines to insert) */
89 char *TS_bell; /* "bl" */ 89 const char *TS_bell; /* "bl" */
90 char *TS_clr_to_bottom; /* "cd" */ 90 const char *TS_clr_to_bottom; /* "cd" */
91 char *TS_clr_line; /* "ce", clear to end of line */ 91 const char *TS_clr_line; /* "ce", clear to end of line */
92 char *TS_clr_frame; /* "cl" */ 92 const char *TS_clr_frame; /* "cl" */
93 char *TS_set_scroll_region; /* "cs" (2 params, first line and last line) */ 93 const char *TS_set_scroll_region; /* "cs" (2 params, first line and last line) */
94 char *TS_set_scroll_region_1; /* "cS" (4 params: total lines, 94 const char *TS_set_scroll_region_1; /* "cS" (4 params: total lines,
95 lines above scroll region, lines below it, 95 lines above scroll region, lines below it,
96 total lines again) */ 96 total lines again) */
97 char *TS_del_char; /* "dc" */ 97 const char *TS_del_char; /* "dc" */
98 char *TS_del_multi_chars; /* "DC" (one parameter, # chars to delete) */ 98 const char *TS_del_multi_chars; /* "DC" (one parameter, # chars to delete) */
99 char *TS_del_line; /* "dl" */ 99 const char *TS_del_line; /* "dl" */
100 char *TS_del_multi_lines; /* "DL" (one parameter, # lines to delete) */ 100 const char *TS_del_multi_lines; /* "DL" (one parameter, # lines to delete) */
101 char *TS_delete_mode; /* "dm", enter character-delete mode */ 101 const char *TS_delete_mode; /* "dm", enter character-delete mode */
102 char *TS_end_delete_mode; /* "ed", leave character-delete mode */ 102 const char *TS_end_delete_mode; /* "ed", leave character-delete mode */
103 char *TS_end_insert_mode; /* "ei", leave character-insert mode */ 103 const char *TS_end_insert_mode; /* "ei", leave character-insert mode */
104 char *TS_ins_char; /* "ic" */ 104 const char *TS_ins_char; /* "ic" */
105 char *TS_ins_multi_chars; /* "IC" (one parameter, # chars to insert) */ 105 const char *TS_ins_multi_chars; /* "IC" (one parameter, # chars to insert) */
106 char *TS_insert_mode; /* "im", enter character-insert mode */ 106 const char *TS_insert_mode; /* "im", enter character-insert mode */
107 char *TS_pad_inserted_char; /* "ip". Just padding, no commands. */ 107 const char *TS_pad_inserted_char; /* "ip". Just padding, no commands. */
108 char *TS_end_keypad_mode; /* "ke" */ 108 const char *TS_end_keypad_mode; /* "ke" */
109 char *TS_keypad_mode; /* "ks" */ 109 const char *TS_keypad_mode; /* "ks" */
110 char *TS_pad_char; /* "pc", char to use as padding */ 110 const char *TS_pad_char; /* "pc", char to use as padding */
111 char *TS_repeat; /* "rp" (2 params, # times to repeat 111 const char *TS_repeat; /* "rp" (2 params, # times to repeat
112 and character to be repeated) */ 112 and character to be repeated) */
113 char *TS_end_standout_mode; /* "se" */ 113 const char *TS_end_standout_mode; /* "se" */
114 char *TS_fwd_scroll; /* "sf" */ 114 const char *TS_fwd_scroll; /* "sf" */
115 char *TS_standout_mode; /* "so" */ 115 const char *TS_standout_mode; /* "so" */
116 char *TS_rev_scroll; /* "sr" */ 116 const char *TS_rev_scroll; /* "sr" */
117 char *TS_end_termcap_modes; /* "te" */ 117 const char *TS_end_termcap_modes; /* "te" */
118 char *TS_termcap_modes; /* "ti" */ 118 const char *TS_termcap_modes; /* "ti" */
119 char *TS_visible_bell; /* "vb" */ 119 const char *TS_visible_bell; /* "vb" */
120 char *TS_cursor_normal; /* "ve" */ 120 const char *TS_cursor_normal; /* "ve" */
121 char *TS_cursor_visible; /* "vs" */ 121 const char *TS_cursor_visible; /* "vs" */
122 char *TS_cursor_invisible; /* "vi" */ 122 const char *TS_cursor_invisible; /* "vi" */
123 char *TS_set_window; /* "wi" (4 params, start and end of window, 123 const char *TS_set_window; /* "wi" (4 params, start and end of window,
124 each as vpos and hpos) */ 124 each as vpos and hpos) */
125 125
126 char *TS_enter_bold_mode; /* "md" -- turn on bold (extra bright mode). */ 126 const char *TS_enter_bold_mode; /* "md" -- turn on bold (extra bright mode). */
127 char *TS_enter_dim_mode; /* "mh" -- turn on half-bright mode. */ 127 const char *TS_enter_dim_mode; /* "mh" -- turn on half-bright mode. */
128 char *TS_enter_blink_mode; /* "mb" -- enter blinking mode. */ 128 const char *TS_enter_blink_mode; /* "mb" -- enter blinking mode. */
129 char *TS_enter_reverse_mode; /* "mr" -- enter reverse video mode. */ 129 const char *TS_enter_reverse_mode; /* "mr" -- enter reverse video mode. */
130 char *TS_exit_underline_mode; /* "us" -- start underlining. */ 130 const char *TS_exit_underline_mode; /* "us" -- start underlining. */
131 char *TS_enter_underline_mode; /* "ue" -- end underlining. */ 131 const char *TS_enter_underline_mode; /* "ue" -- end underlining. */
132 132
133 /* "as"/"ae" -- start/end alternate character set. Not really 133 /* "as"/"ae" -- start/end alternate character set. Not really
134 supported, yet. */ 134 supported, yet. */
135 char *TS_enter_alt_charset_mode; 135 const char *TS_enter_alt_charset_mode;
136 char *TS_exit_alt_charset_mode; 136 const char *TS_exit_alt_charset_mode;
137 137
138 char *TS_exit_attribute_mode; /* "me" -- switch appearances off. */ 138 const char *TS_exit_attribute_mode; /* "me" -- switch appearances off. */
139 139
140 /* Value of the "NC" (no_color_video) capability, or 0 if not present. */ 140 /* Value of the "NC" (no_color_video) capability, or 0 if not present. */
141 int TN_no_color_video; 141 int TN_no_color_video;
@@ -147,12 +147,12 @@ struct tty_display_info
147 int TN_max_pairs; 147 int TN_max_pairs;
148 148
149 /* "op" -- SVr4 set default pair to its original value. */ 149 /* "op" -- SVr4 set default pair to its original value. */
150 char *TS_orig_pair; 150 const char *TS_orig_pair;
151 151
152 /* "AF"/"AB" or "Sf"/"Sb"-- set ANSI or SVr4 foreground/background color. 152 /* "AF"/"AB" or "Sf"/"Sb"-- set ANSI or SVr4 foreground/background color.
153 1 param, the color index. */ 153 1 param, the color index. */
154 char *TS_set_foreground; 154 const char *TS_set_foreground;
155 char *TS_set_background; 155 const char *TS_set_background;
156 156
157 int TF_hazeltine; /* termcap hz flag. */ 157 int TF_hazeltine; /* termcap hz flag. */
158 int TF_insmode_motion; /* termcap mi flag: can move while in insert mode. */ 158 int TF_insmode_motion; /* termcap mi flag: can move while in insert mode. */
@@ -210,4 +210,3 @@ extern struct tty_display_info *tty_list;
210 : (abort(), (struct tty_display_info *) 0)) 210 : (abort(), (struct tty_display_info *) 0))
211 211
212#define CURTTY() FRAME_TTY (SELECTED_FRAME()) 212#define CURTTY() FRAME_TTY (SELECTED_FRAME())
213
diff --git a/src/termhooks.h b/src/termhooks.h
index b147f6ed0a1..0ccd2dac9e1 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -654,6 +654,9 @@ extern void delete_terminal (struct terminal *);
654/* The initial terminal device, created by initial_term_init. */ 654/* The initial terminal device, created by initial_term_init. */
655extern struct terminal *initial_terminal; 655extern struct terminal *initial_terminal;
656 656
657extern unsigned char *encode_terminal_code (struct glyph *, int,
658 struct coding_system *);
659
657#ifdef HAVE_GPM 660#ifdef HAVE_GPM
658extern void close_gpm (int gpm_fd); 661extern void close_gpm (int gpm_fd);
659#endif 662#endif
diff --git a/src/terminal.c b/src/terminal.c
index 309cc0095e8..c5185601fb6 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -109,7 +109,7 @@ void
109raw_cursor_to (struct frame *f, int row, int col) 109raw_cursor_to (struct frame *f, int row, int col)
110{ 110{
111 if (FRAME_TERMINAL (f)->raw_cursor_to_hook) 111 if (FRAME_TERMINAL (f)->raw_cursor_to_hook)
112 (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row, col); 112 (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row, col);
113} 113}
114 114
115/* Erase operations */ 115/* Erase operations */
@@ -444,7 +444,7 @@ selected frame's terminal). */)
444/* Set the value of terminal parameter PARAMETER in terminal D to VALUE. 444/* Set the value of terminal parameter PARAMETER in terminal D to VALUE.
445 Return the previous value. */ 445 Return the previous value. */
446 446
447Lisp_Object 447static Lisp_Object
448store_terminal_param (struct terminal *t, Lisp_Object parameter, Lisp_Object value) 448store_terminal_param (struct terminal *t, Lisp_Object parameter, Lisp_Object value)
449{ 449{
450 Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist); 450 Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist);
@@ -569,4 +569,3 @@ or some time later. */);
569 569
570 Fprovide (intern_c_string ("multi-tty"), Qnil); 570 Fprovide (intern_c_string ("multi-tty"), Qnil);
571} 571}
572
diff --git a/src/tparam.c b/src/tparam.c
index fcbb63881e6..6aae0b97db9 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -21,6 +21,7 @@ Boston, MA 02110-1301, USA. */
21#include <config.h> 21#include <config.h>
22#include <setjmp.h> 22#include <setjmp.h>
23#include "lisp.h" /* for xmalloc */ 23#include "lisp.h" /* for xmalloc */
24#include "tparam.h"
24 25
25#ifndef NULL 26#ifndef NULL
26#define NULL (char *) 0 27#define NULL (char *) 0
@@ -38,11 +39,12 @@ Boston, MA 02110-1301, USA. */
38 39
39 The fourth and following args to tparam serve as the parameter values. */ 40 The fourth and following args to tparam serve as the parameter values. */
40 41
41static char *tparam1 (char *string, char *outstring, int len, char *up, char *left, register int *argp); 42static char *tparam1 (char const *string, char *outstring, int len,
43 char *up, char *left, int *argp);
42 44
43/* VARARGS 2 */
44char * 45char *
45tparam (char *string, char *outstring, int len, int arg0, int arg1, int arg2, int arg3) 46tparam (const char *string, char *outstring, int len,
47 int arg0, int arg1, int arg2, int arg3)
46{ 48{
47 int arg[4]; 49 int arg[4];
48 50
@@ -59,7 +61,7 @@ char *UP;
59static char tgoto_buf[50]; 61static char tgoto_buf[50];
60 62
61char * 63char *
62tgoto (char *cm, int hpos, int vpos) 64tgoto (const char *cm, int hpos, int vpos)
63{ 65{
64 int args[2]; 66 int args[2];
65 if (!cm) 67 if (!cm)
@@ -70,10 +72,11 @@ tgoto (char *cm, int hpos, int vpos)
70} 72}
71 73
72static char * 74static char *
73tparam1 (char *string, char *outstring, int len, char *up, char *left, register int *argp) 75tparam1 (const char *string, char *outstring, int len,
76 char *up, char *left, register int *argp)
74{ 77{
75 register int c; 78 register int c;
76 register char *p = string; 79 register const char *p = string;
77 register char *op = outstring; 80 register char *op = outstring;
78 char *outend; 81 char *outend;
79 int outlen = 0; 82 int outlen = 0;
@@ -277,4 +280,3 @@ main (argc, argv)
277} 280}
278 281
279#endif /* DEBUG */ 282#endif /* DEBUG */
280
diff --git a/src/tparam.h b/src/tparam.h
new file mode 100644
index 00000000000..3cd3e6053cc
--- /dev/null
+++ b/src/tparam.h
@@ -0,0 +1,31 @@
1/* Interface definitions for termcap entries.
2
3Copyright (C) 2011 Free Software Foundation, Inc.
4
5This file is part of GNU Emacs.
6
7GNU Emacs is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 3 of the License, or
10(at your option) any later version.
11
12GNU Emacs is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19
20
21/* Don't try to include termcap.h. On some systems, configure finds a
22 non-standard termcap.h that the main build won't find. */
23
24void tputs (const char *, int, int (*) (int));
25int tgetent (char *, const char *);
26int tgetflag (const char *);
27int tgetnum (const char *);
28char *tgetstr (const char *, char **);
29char *tgoto (const char *, int, int);
30
31char *tparam (const char *, char *, int, int, int, int, int);
diff --git a/src/unexaix.c b/src/unexaix.c
index fe9d13d3e47..df4c5b8905c 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -40,6 +40,8 @@ what you give them. Help stamp out software-hoarding! */
40 */ 40 */
41 41
42#include <config.h> 42#include <config.h>
43#include "unexec.h"
44
43#define PERROR(file) report_error (file, new) 45#define PERROR(file) report_error (file, new)
44#include <a.out.h> 46#include <a.out.h>
45/* Define getpagesize () if the system does not. 47/* Define getpagesize () if the system does not.
@@ -119,7 +121,8 @@ static void write_segment (int, char *, char *);
119 * 121 *
120 * driving logic. 122 * driving logic.
121 */ 123 */
122int unexec (const char *new_name, const char *a_name) 124void
125unexec (const char *new_name, const char *a_name)
123{ 126{
124 int new = -1, a_out = -1; 127 int new = -1, a_out = -1;
125 128
@@ -139,14 +142,13 @@ int unexec (const char *new_name, const char *a_name)
139 || unrelocate_symbols (new, a_out, a_name, new_name) < 0) 142 || unrelocate_symbols (new, a_out, a_name, new_name) < 0)
140 { 143 {
141 close (new); 144 close (new);
142 return -1; 145 return;
143 } 146 }
144 147
145 close (new); 148 close (new);
146 if (a_out >= 0) 149 if (a_out >= 0)
147 close (a_out); 150 close (a_out);
148 mark_x (new_name); 151 mark_x (new_name);
149 return 0;
150} 152}
151 153
152/* **************************************************************** 154/* ****************************************************************
@@ -637,4 +639,3 @@ start_of_text (void)
637{ 639{
638 return ((char *) 0x10000000); 640 return ((char *) 0x10000000);
639} 641}
640
diff --git a/src/unexcoff.c b/src/unexcoff.c
index 4dafabab689..ef86a400239 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -50,6 +50,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
50 */ 50 */
51 51
52#include <config.h> 52#include <config.h>
53#include "unexec.h"
54
53#define PERROR(file) report_error (file, new) 55#define PERROR(file) report_error (file, new)
54 56
55#ifndef CANNOT_DUMP /* all rest of file! */ 57#ifndef CANNOT_DUMP /* all rest of file! */
@@ -522,7 +524,7 @@ adjust_lnnoptrs (int writedesc, int readdesc, const char *new_name)
522 * 524 *
523 * driving logic. 525 * driving logic.
524 */ 526 */
525int 527void
526unexec (const char *new_name, const char *a_name) 528unexec (const char *new_name, const char *a_name)
527{ 529{
528 int new = -1, a_out = -1; 530 int new = -1, a_out = -1;
@@ -543,15 +545,13 @@ unexec (const char *new_name, const char *a_name)
543 ) 545 )
544 { 546 {
545 close (new); 547 close (new);
546 return -1; 548 return;
547 } 549 }
548 550
549 close (new); 551 close (new);
550 if (a_out >= 0) 552 if (a_out >= 0)
551 close (a_out); 553 close (a_out);
552 mark_x (new_name); 554 mark_x (new_name);
553 return 0;
554} 555}
555 556
556#endif /* not CANNOT_DUMP */ 557#endif /* not CANNOT_DUMP */
557
diff --git a/src/unexcw.c b/src/unexcw.c
index 02add901bbd..f643c196de0 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -19,6 +19,8 @@ You should have received a copy of the GNU General Public License
19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22#include "unexec.h"
23
22#include <setjmp.h> 24#include <setjmp.h>
23#include <lisp.h> 25#include <lisp.h>
24#include <stdio.h> 26#include <stdio.h>
@@ -247,7 +249,7 @@ add_exe_suffix_if_necessary (const char *name, char *modified)
247 return (modified); 249 return (modified);
248} 250}
249 251
250int 252void
251unexec (const char *outfile, const char *infile) 253unexec (const char *outfile, const char *infile)
252{ 254{
253 char infile_buffer[FILENAME_MAX]; 255 char infile_buffer[FILENAME_MAX];
@@ -261,7 +263,7 @@ unexec (const char *outfile, const char *infile)
261 { 263 {
262 /* can only dump once */ 264 /* can only dump once */
263 printf ("You can only dump Emacs once on this platform.\n"); 265 printf ("You can only dump Emacs once on this platform.\n");
264 return (1); 266 return;
265 } 267 }
266 268
267 report_sheap_usage (1); 269 report_sheap_usage (1);
@@ -296,7 +298,4 @@ unexec (const char *outfile, const char *infile)
296 298
297 ret = close (fd_out); 299 ret = close (fd_out);
298 assert (ret == 0); 300 assert (ret == 0);
299
300 return (0);
301} 301}
302
diff --git a/src/unexec.h b/src/unexec.h
new file mode 100644
index 00000000000..343eb6d8db5
--- /dev/null
+++ b/src/unexec.h
@@ -0,0 +1 @@
void unexec (const char *, const char *);
diff --git a/src/unexelf.c b/src/unexelf.c
index 1009c87066b..b58c78501b8 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -386,6 +386,8 @@ temacs:
386 Instead we read the whole file, modify it, and write it out. */ 386 Instead we read the whole file, modify it, and write it out. */
387 387
388#include <config.h> 388#include <config.h>
389#include <unexec.h>
390
389extern void fatal (const char *msgid, ...); 391extern void fatal (const char *msgid, ...);
390 392
391#include <sys/types.h> 393#include <sys/types.h>
@@ -518,10 +520,6 @@ typedef struct {
518# define ElfW(type) ElfExpandBitsW (ELFSIZE, type) 520# define ElfW(type) ElfExpandBitsW (ELFSIZE, type)
519#endif 521#endif
520 522
521#ifndef ELF_BSS_SECTION_NAME
522#define ELF_BSS_SECTION_NAME ".bss"
523#endif
524
525/* Get the address of a particular section or program header entry, 523/* Get the address of a particular section or program header entry,
526 * accounting for the size of the entries. 524 * accounting for the size of the entries.
527 */ 525 */
@@ -553,8 +551,6 @@ typedef struct {
553 (*(ElfW(Shdr) *) ((byte *) old_section_h + old_file_h->e_shentsize * (n))) 551 (*(ElfW(Shdr) *) ((byte *) old_section_h + old_file_h->e_shentsize * (n)))
554#define NEW_SECTION_H(n) \ 552#define NEW_SECTION_H(n) \
555 (*(ElfW(Shdr) *) ((byte *) new_section_h + new_file_h->e_shentsize * (n))) 553 (*(ElfW(Shdr) *) ((byte *) new_section_h + new_file_h->e_shentsize * (n)))
556#define OLD_PROGRAM_H(n) \
557 (*(ElfW(Phdr) *) ((byte *) old_program_h + old_file_h->e_phentsize * (n)))
558#define NEW_PROGRAM_H(n) \ 554#define NEW_PROGRAM_H(n) \
559 (*(ElfW(Phdr) *) ((byte *) new_program_h + new_file_h->e_phentsize * (n))) 555 (*(ElfW(Phdr) *) ((byte *) new_program_h + new_file_h->e_phentsize * (n)))
560 556
@@ -623,6 +619,10 @@ unexec (const char *new_name, const char *old_name)
623{ 619{
624 int new_file, old_file, new_file_size; 620 int new_file, old_file, new_file_size;
625 621
622#if defined (emacs) || !defined (DEBUG)
623 void *new_break;
624#endif
625
626 /* Pointers to the base of the image of the two files. */ 626 /* Pointers to the base of the image of the two files. */
627 caddr_t old_base, new_base; 627 caddr_t old_base, new_base;
628 628
@@ -753,7 +753,8 @@ unexec (const char *new_name, const char *old_name)
753 old_name, old_file_h, old_section_h, 0); 753 old_name, old_file_h, old_section_h, 0);
754 754
755#if defined (emacs) || !defined (DEBUG) 755#if defined (emacs) || !defined (DEBUG)
756 new_bss_addr = (ElfW(Addr)) sbrk (0); 756 new_break = sbrk (0);
757 new_bss_addr = (ElfW(Addr)) new_break;
757#else 758#else
758 new_bss_addr = old_bss_addr + old_bss_size + 0x1234; 759 new_bss_addr = old_bss_addr + old_bss_size + 0x1234;
759#endif 760#endif
@@ -954,13 +955,13 @@ temacs:
954 Link Info Adralgn Entsize 955 Link Info Adralgn Entsize
955 956
956[22] 1 3 0x335150 0x315150 0x4 .data.rel.local 957[22] 1 3 0x335150 0x315150 0x4 .data.rel.local
957 0 0 0x4 0 958 0 0 0x4 0
958 959
959[23] 8 3 0x335158 0x315158 0x42720 .bss 960[23] 8 3 0x335158 0x315158 0x42720 .bss
960 0 0 0x8 0 961 0 0 0x8 0
961 962
962[24] 2 0 0 0x315154 0x1c9d0 .symtab 963[24] 2 0 0 0x315154 0x1c9d0 .symtab
963 25 1709 0x4 0x10 964 25 1709 0x4 0x10
964 */ 965 */
965 966
966 if (NEW_SECTION_H (nn).sh_offset >= old_bss_offset 967 if (NEW_SECTION_H (nn).sh_offset >= old_bss_offset
@@ -1228,8 +1229,8 @@ temacs:
1228 ElfW(Shdr) section = NEW_SECTION_H (n); 1229 ElfW(Shdr) section = NEW_SECTION_H (n);
1229 1230
1230 /* Cause a compilation error if anyone uses n instead of nn below. */ 1231 /* Cause a compilation error if anyone uses n instead of nn below. */
1231 struct {int a;} n; 1232 #define n ((void) 0);
1232 (void)n.a; /* Prevent `unused variable' warnings. */ 1233 n /* Prevent 'macro "n" is not used' warnings. */
1233 1234
1234 switch (section.sh_type) 1235 switch (section.sh_type)
1235 { 1236 {
@@ -1276,6 +1277,8 @@ temacs:
1276 } 1277 }
1277 break; 1278 break;
1278 } 1279 }
1280
1281 #undef n
1279 } 1282 }
1280 1283
1281 /* Write out new_file, and free the buffers. */ 1284 /* Write out new_file, and free the buffers. */
@@ -1307,4 +1310,3 @@ temacs:
1307 if (chmod (new_name, stat_buf.st_mode) == -1) 1310 if (chmod (new_name, stat_buf.st_mode) == -1)
1308 fatal ("Can't chmod (%s): errno %d\n", new_name, errno); 1311 fatal ("Can't chmod (%s): errno %d\n", new_name, errno);
1309} 1312}
1310
diff --git a/src/unexhp9k800.c b/src/unexhp9k800.c
index c0471992a72..f27415a252c 100644
--- a/src/unexhp9k800.c
+++ b/src/unexhp9k800.c
@@ -50,6 +50,8 @@
50*/ 50*/
51 51
52#include <config.h> 52#include <config.h>
53#include "unexec.h"
54
53#include <stdio.h> 55#include <stdio.h>
54#include <fcntl.h> 56#include <fcntl.h>
55#include <errno.h> 57#include <errno.h>
@@ -74,7 +76,7 @@ run_time_remap (ignored)
74 76
75 77
76/* Create a new a.out file, same as old but with current data space */ 78/* Create a new a.out file, same as old but with current data space */
77int 79void
78unexec (const char *new_name, /* name of the new a.out file to be created */ 80unexec (const char *new_name, /* name of the new a.out file to be created */
79 const char *old_name) /* name of the old a.out file */ 81 const char *old_name) /* name of the old a.out file */
80{ 82{
@@ -131,7 +133,6 @@ unexec (const char *new_name, /* name of the new a.out file to be created *
131 /* Close the binary file */ 133 /* Close the binary file */
132 close (old); 134 close (old);
133 close (new); 135 close (new);
134 return 0;
135} 136}
136 137
137/* Save current data space in the file, update header. */ 138/* Save current data space in the file, update header. */
@@ -319,4 +320,3 @@ display_header (hdr, auxhdr)
319 hdr->unloadable_sp_location, hdr->unloadable_sp_size); 320 hdr->unloadable_sp_location, hdr->unloadable_sp_size);
320} 321}
321#endif /* DEBUG */ 322#endif /* DEBUG */
322
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 7a55498085d..04e3edf463e 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -95,6 +95,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
95#undef malloc 95#undef malloc
96#undef realloc 96#undef realloc
97#undef free 97#undef free
98
99#include "unexec.h"
100
98#include <stdio.h> 101#include <stdio.h>
99#include <fcntl.h> 102#include <fcntl.h>
100#include <stdarg.h> 103#include <stdarg.h>
@@ -828,6 +831,7 @@ copy_data_segment (struct load_command *lc)
828 } 831 }
829 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0 832 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0
830 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0 833 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0
834 || strncmp (sectp->sectname, "__got", 16) == 0
831 || strncmp (sectp->sectname, "__la_sym_ptr2", 16) == 0 835 || strncmp (sectp->sectname, "__la_sym_ptr2", 16) == 0
832 || strncmp (sectp->sectname, "__dyld", 16) == 0 836 || strncmp (sectp->sectname, "__dyld", 16) == 0
833 || strncmp (sectp->sectname, "__const", 16) == 0 837 || strncmp (sectp->sectname, "__const", 16) == 0
@@ -1223,7 +1227,7 @@ dump_it (void)
1223 from it. The file names of the output and input files are outfile 1227 from it. The file names of the output and input files are outfile
1224 and infile, respectively. The three other parameters are 1228 and infile, respectively. The three other parameters are
1225 ignored. */ 1229 ignored. */
1226int 1230void
1227unexec (const char *outfile, const char *infile) 1231unexec (const char *outfile, const char *infile)
1228{ 1232{
1229 if (in_dumped_exec) 1233 if (in_dumped_exec)
@@ -1254,7 +1258,6 @@ unexec (const char *outfile, const char *infile)
1254 dump_it (); 1258 dump_it ();
1255 1259
1256 close (outfd); 1260 close (outfd);
1257 return 0;
1258} 1261}
1259 1262
1260 1263
@@ -1379,4 +1382,3 @@ unexec_free (void *ptr)
1379 else 1382 else
1380 malloc_zone_free (emacs_zone, (unexec_malloc_header_t *) ptr - 1); 1383 malloc_zone_free (emacs_zone, (unexec_malloc_header_t *) ptr - 1);
1381} 1384}
1382
diff --git a/src/unexsol.c b/src/unexsol.c
index e1a10f7d211..ef1e34e6f0f 100644
--- a/src/unexsol.c
+++ b/src/unexsol.c
@@ -1,6 +1,8 @@
1/* Trivial unexec for Solaris. */ 1/* Trivial unexec for Solaris. */
2 2
3#include <config.h> 3#include <config.h>
4#include "unexec.h"
5
4#include <dlfcn.h> 6#include <dlfcn.h>
5#include <setjmp.h> 7#include <setjmp.h>
6 8
@@ -9,14 +11,14 @@
9#include "charset.h" 11#include "charset.h"
10#include "coding.h" 12#include "coding.h"
11 13
12int 14void
13unexec (const char *new_name, const char *old_name) 15unexec (const char *new_name, const char *old_name)
14{ 16{
15 Lisp_Object data; 17 Lisp_Object data;
16 Lisp_Object errstring; 18 Lisp_Object errstring;
17 19
18 if (! dldump (0, new_name, RTLD_MEMORY)) 20 if (! dldump (0, new_name, RTLD_MEMORY))
19 return 0; 21 return;
20 22
21 data = Fcons (build_string (new_name), Qnil); 23 data = Fcons (build_string (new_name), Qnil);
22 synchronize_system_messages_locale (); 24 synchronize_system_messages_locale ();
@@ -26,4 +28,3 @@ unexec (const char *new_name, const char *old_name)
26 xsignal (Qfile_error, 28 xsignal (Qfile_error,
27 Fcons (build_string ("Cannot unexec"), Fcons (errstring, data))); 29 Fcons (build_string ("Cannot unexec"), Fcons (errstring, data)));
28} 30}
29
diff --git a/src/unexw32.c b/src/unexw32.c
index 829c864c960..cd8211d6bee 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21*/ 21*/
22 22
23#include <config.h> 23#include <config.h>
24#include "unexec.h"
24 25
25#include <stdio.h> 26#include <stdio.h>
26#include <fcntl.h> 27#include <fcntl.h>
@@ -723,7 +724,7 @@ copy_executable_and_dump_data (file_data *p_infile,
723 724
724 725
725/* Dump out .data and .bss sections into a new executable. */ 726/* Dump out .data and .bss sections into a new executable. */
726int 727void
727unexec (const char *new_name, const char *old_name) 728unexec (const char *new_name, const char *old_name)
728{ 729{
729 file_data in_file, out_file; 730 file_data in_file, out_file;
@@ -819,9 +820,6 @@ unexec (const char *new_name, const char *old_name)
819 820
820 close_file_data (&in_file); 821 close_file_data (&in_file);
821 close_file_data (&out_file); 822 close_file_data (&out_file);
822
823 return 0;
824} 823}
825 824
826/* eof */ 825/* eof */
827
diff --git a/src/w32.c b/src/w32.c
index ae2373be46e..721cea07d20 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -147,9 +147,6 @@ typedef HRESULT (WINAPI * ShGetFolderPath_fn)
147void globals_of_w32 (void); 147void globals_of_w32 (void);
148static DWORD get_rid (PSID); 148static DWORD get_rid (PSID);
149 149
150/* Defined in process.c for its own purpose. */
151extern Lisp_Object Qlocal;
152
153 150
154/* Initialization states. 151/* Initialization states.
155 152
@@ -5666,8 +5663,6 @@ sys_write (int fd, const void * buffer, unsigned int count)
5666static void 5663static void
5667check_windows_init_file (void) 5664check_windows_init_file (void)
5668{ 5665{
5669 extern int noninteractive, inhibit_window_system;
5670
5671 /* A common indication that Emacs is not installed properly is when 5666 /* A common indication that Emacs is not installed properly is when
5672 it cannot find the Windows installation file. If this file does 5667 it cannot find the Windows installation file. If this file does
5673 not exist in the expected place, tell the user. */ 5668 not exist in the expected place, tell the user. */
diff --git a/src/w32console.c b/src/w32console.c
index 31c4a7c4e5a..3c200405cb5 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -41,12 +41,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
41/* from window.c */ 41/* from window.c */
42extern Lisp_Object Frecenter (Lisp_Object); 42extern Lisp_Object Frecenter (Lisp_Object);
43 43
44/* from keyboard.c */
45extern int detect_input_pending (void);
46
47/* from sysdep.c */
48extern int read_input_pending (void);
49
50static void w32con_move_cursor (struct frame *f, int row, int col); 44static void w32con_move_cursor (struct frame *f, int row, int col);
51static void w32con_clear_to_end (struct frame *f); 45static void w32con_clear_to_end (struct frame *f);
52static void w32con_clear_frame (struct frame *f); 46static void w32con_clear_frame (struct frame *f);
@@ -277,9 +271,6 @@ w32con_insert_glyphs (struct frame *f, register struct glyph *start,
277 } 271 }
278} 272}
279 273
280extern unsigned char *encode_terminal_code (struct glyph *, int,
281 struct coding_system *);
282
283static void 274static void
284w32con_write_glyphs (struct frame *f, register struct glyph *string, 275w32con_write_glyphs (struct frame *f, register struct glyph *string,
285 register int len) 276 register int len)
diff --git a/src/w32fns.c b/src/w32fns.c
index ec48397657a..0c899cdceff 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -60,6 +60,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
60#include <dlgs.h> 60#include <dlgs.h>
61#include <imm.h> 61#include <imm.h>
62#define FILE_NAME_TEXT_FIELD edt1 62#define FILE_NAME_TEXT_FIELD edt1
63#define FILE_NAME_COMBO_BOX cmb13
64#define FILE_NAME_LIST lst1
63 65
64#include "font.h" 66#include "font.h"
65#include "w32font.h" 67#include "w32font.h"
@@ -78,10 +80,6 @@ extern void w32_menu_display_help (HWND, HMENU, UINT, UINT);
78extern void w32_free_menu_strings (HWND); 80extern void w32_free_menu_strings (HWND);
79extern const char *map_w32_filename (const char *, const char **); 81extern const char *map_w32_filename (const char *, const char **);
80 82
81extern int quit_char;
82
83extern const char *const lispy_function_keys[];
84
85/* If non-zero, a w32 timer that, when it expires, displays an 83/* If non-zero, a w32 timer that, when it expires, displays an
86 hourglass cursor on all frames. */ 84 hourglass cursor on all frames. */
87static unsigned hourglass_timer = 0; 85static unsigned hourglass_timer = 0;
@@ -185,18 +183,10 @@ unsigned int msh_mousewheel = 0;
185#define MENU_FREE_DELAY 1000 183#define MENU_FREE_DELAY 1000
186static unsigned menu_free_timer = 0; 184static unsigned menu_free_timer = 0;
187 185
188extern Lisp_Object Qtooltip;
189
190#ifdef GLYPH_DEBUG 186#ifdef GLYPH_DEBUG
191int image_cache_refcount, dpyinfo_refcount; 187int image_cache_refcount, dpyinfo_refcount;
192#endif 188#endif
193 189
194
195extern HWND w32_system_caret_hwnd;
196
197extern int w32_system_caret_height;
198extern int w32_system_caret_x;
199extern int w32_system_caret_y;
200static HWND w32_visible_system_caret_hwnd; 190static HWND w32_visible_system_caret_hwnd;
201 191
202/* From w32menu.c */ 192/* From w32menu.c */
@@ -5849,7 +5839,6 @@ Value is t if tooltip was open, nil otherwise. */)
5849/*********************************************************************** 5839/***********************************************************************
5850 File selection dialog 5840 File selection dialog
5851 ***********************************************************************/ 5841 ***********************************************************************/
5852extern Lisp_Object Qfile_name_history;
5853 5842
5854/* Callback for altering the behavior of the Open File dialog. 5843/* Callback for altering the behavior of the Open File dialog.
5855 Makes the Filename text field contain "Current Directory" and be 5844 Makes the Filename text field contain "Current Directory" and be
@@ -5868,13 +5857,37 @@ file_dialog_callback (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
5868 { 5857 {
5869 HWND dialog = GetParent (hwnd); 5858 HWND dialog = GetParent (hwnd);
5870 HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD); 5859 HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);
5860 HWND list = GetDlgItem (dialog, FILE_NAME_LIST);
5871 5861
5872 /* Directories is in index 2. */ 5862 /* At least on Windows 7, the above attempt to get the window handle
5863 to the File Name Text Field fails. The following code does the
5864 job though. Note that this code is based on my examination of the
5865 window hierarchy using Microsoft Spy++. bk */
5866 if (edit_control == NULL)
5867 {
5868 HWND tmp = GetDlgItem (dialog, FILE_NAME_COMBO_BOX);
5869 if (tmp)
5870 {
5871 tmp = GetWindow (tmp, GW_CHILD);
5872 if (tmp)
5873 edit_control = GetWindow (tmp, GW_CHILD);
5874 }
5875 }
5876
5877 /* Directories is in index 2. */
5873 if (notify->lpOFN->nFilterIndex == 2) 5878 if (notify->lpOFN->nFilterIndex == 2)
5874 { 5879 {
5875 CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD, 5880 CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD,
5876 "Current Directory"); 5881 "Current Directory");
5877 EnableWindow (edit_control, FALSE); 5882 EnableWindow (edit_control, FALSE);
5883 /* Note that at least on Windows 7, the above call to EnableWindow
5884 disables the window that would ordinarily have focus. If we
5885 do not set focus to some other window here, focus will land in
5886 no man's land and the user will be unable to tab through the
5887 dialog box (pressing tab will only result in a beep).
5888 Avoid that problem by setting focus to the list here. */
5889 if (notify->hdr.code == CDN_INITDONE)
5890 SetFocus (list);
5878 } 5891 }
5879 else 5892 else
5880 { 5893 {
@@ -5951,6 +5964,13 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
5951 else 5964 else
5952 filename[0] = '\0'; 5965 filename[0] = '\0';
5953 5966
5967 /* The code in file_dialog_callback that attempts to set the text
5968 of the file name edit window when handling the CDN_INITDONE
5969 WM_NOTIFY message does not work. Setting filename to "Current
5970 Directory" in the only_dir_p case here does work however. */
5971 if (filename[0] == 0 && ! NILP (only_dir_p))
5972 strcpy (filename, "Current Directory");
5973
5954 { 5974 {
5955 NEWOPENFILENAME new_file_details; 5975 NEWOPENFILENAME new_file_details;
5956 BOOL file_opened = FALSE; 5976 BOOL file_opened = FALSE;
diff --git a/src/w32font.c b/src/w32font.c
index aef62f61a3a..40ff0782b88 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -54,8 +54,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
54#define JOHAB_CHARSET 130 54#define JOHAB_CHARSET 130
55#endif 55#endif
56 56
57extern struct font_driver w32font_driver;
58
59Lisp_Object Qgdi; 57Lisp_Object Qgdi;
60Lisp_Object Quniscribe; 58Lisp_Object Quniscribe;
61static Lisp_Object QCformat; 59static Lisp_Object QCformat;
@@ -64,7 +62,6 @@ static Lisp_Object Qserif, Qscript, Qdecorative;
64static Lisp_Object Qraster, Qoutline, Qunknown; 62static Lisp_Object Qraster, Qoutline, Qunknown;
65 63
66/* antialiasing */ 64/* antialiasing */
67extern Lisp_Object QCantialias, QCotf, QClang; /* defined in font.c */
68extern Lisp_Object Qnone; /* reuse from w32fns.c */ 65extern Lisp_Object Qnone; /* reuse from w32fns.c */
69static Lisp_Object Qstandard, Qsubpixel, Qnatural; 66static Lisp_Object Qstandard, Qsubpixel, Qnatural;
70 67
diff --git a/src/w32inevt.c b/src/w32inevt.c
index d0b097100fd..c4858dea908 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -40,18 +40,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
40#include "w32heap.h" 40#include "w32heap.h"
41#include "w32term.h" 41#include "w32term.h"
42 42
43/* stdin, from ntterm */ 43/* stdin, from w32console.c */
44extern HANDLE keyboard_handle; 44extern HANDLE keyboard_handle;
45 45
46/* Info for last mouse motion */ 46/* Info for last mouse motion */
47static COORD movement_pos; 47static COORD movement_pos;
48static DWORD movement_time; 48static DWORD movement_time;
49 49
50/* from keyboard.c */ 50/* from w32fns.c */
51extern void reinvoke_input_signal (void);
52
53extern unsigned int map_keypad_keys (unsigned int, unsigned int); 51extern unsigned int map_keypad_keys (unsigned int, unsigned int);
54
55extern unsigned int w32_key_to_modifier (int key); 52extern unsigned int w32_key_to_modifier (int key);
56 53
57/* Event queue */ 54/* Event queue */
@@ -261,8 +258,6 @@ w32_kbd_patch_key (KEY_EVENT_RECORD *event)
261} 258}
262 259
263 260
264extern const char *const lispy_function_keys[];
265
266static int faked_key = 0; 261static int faked_key = 0;
267 262
268/* return code -1 means that event_queue_ptr won't be incremented. 263/* return code -1 means that event_queue_ptr won't be incremented.
diff --git a/src/w32menu.c b/src/w32menu.c
index 92447eb9fae..a2e62f24f6a 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -84,14 +84,6 @@ MessageBoxW_Proc unicode_message_box = NULL;
84 84
85Lisp_Object Qdebug_on_next_call; 85Lisp_Object Qdebug_on_next_call;
86 86
87extern Lisp_Object Qmenu_bar;
88
89extern Lisp_Object QCtoggle, QCradio;
90
91extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
92
93extern Lisp_Object Qmenu_bar_update_hook;
94
95void set_frame_menubar (FRAME_PTR, int, int); 87void set_frame_menubar (FRAME_PTR, int, int);
96 88
97#ifdef HAVE_DIALOGS 89#ifdef HAVE_DIALOGS
diff --git a/src/w32proc.c b/src/w32proc.c
index bb8b428ffe4..e94d9aa3254 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -67,8 +67,6 @@ extern BOOL WINAPI IsValidLocale (LCID, DWORD);
67 + ((DWORD)(var) - (section)->VirtualAddress) \ 67 + ((DWORD)(var) - (section)->VirtualAddress) \
68 + (filedata).file_base)) 68 + (filedata).file_base))
69 69
70extern Lisp_Object Qlocal;
71
72Lisp_Object Qhigh, Qlow; 70Lisp_Object Qhigh, Qlow;
73 71
74#ifdef EMACSDEBUG 72#ifdef EMACSDEBUG
@@ -1053,7 +1051,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp)
1053 detect that we were woken up by C-g, we return -1 with errno set to 1051 detect that we were woken up by C-g, we return -1 with errno set to
1054 EINTR as on Unix. */ 1052 EINTR as on Unix. */
1055 1053
1056/* From ntterm.c */ 1054/* From w32console.c */
1057extern HANDLE keyboard_handle; 1055extern HANDLE keyboard_handle;
1058 1056
1059/* From w32xfns.c */ 1057/* From w32xfns.c */
@@ -1559,8 +1557,6 @@ sys_kill (int pid, int sig)
1559 return rc; 1557 return rc;
1560} 1558}
1561 1559
1562/* extern int report_file_error (char *, Lisp_Object); */
1563
1564/* The following two routines are used to manipulate stdin, stdout, and 1560/* The following two routines are used to manipulate stdin, stdout, and
1565 stderr of our child processes. 1561 stderr of our child processes.
1566 1562
@@ -1660,7 +1656,7 @@ set_process_dir (char * dir)
1660 dial-up users to only be connected when they actually need to use 1656 dial-up users to only be connected when they actually need to use
1661 socket services. */ 1657 socket services. */
1662 1658
1663/* From nt.c */ 1659/* From w32.c */
1664extern HANDLE winsock_lib; 1660extern HANDLE winsock_lib;
1665extern BOOL term_winsock (void); 1661extern BOOL term_winsock (void);
1666extern BOOL init_winsock (int load_now); 1662extern BOOL init_winsock (int load_now);
diff --git a/src/w32select.c b/src/w32select.c
index 23d5fb68c77..ef0cb3adc24 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -78,7 +78,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
78#include "w32term.h" /* for all of the w32 includes */ 78#include "w32term.h" /* for all of the w32 includes */
79#include "w32heap.h" /* os_subtype */ 79#include "w32heap.h" /* os_subtype */
80#include "blockinput.h" 80#include "blockinput.h"
81#include "keyboard.h" /* cmd_error_internal() */
82#include "charset.h" 81#include "charset.h"
83#include "coding.h" 82#include "coding.h"
84#include "character.h" 83#include "character.h"
@@ -391,6 +390,7 @@ run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg)
391 with global variables and calling strange looking functions. Is 390 with global variables and calling strange looking functions. Is
392 this really the right way to run Lisp callbacks? */ 391 this really the right way to run Lisp callbacks? */
393 392
393 extern int waiting_for_input; /* from keyboard.c */
394 int owfi; 394 int owfi;
395 395
396 BLOCK_INPUT; 396 BLOCK_INPUT;
diff --git a/src/w32term.c b/src/w32term.c
index 67e853f21f0..f31c4e90e77 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -88,8 +88,6 @@ extern void free_frame_menubar (struct frame *);
88extern int w32_codepage_for_font (char *fontname); 88extern int w32_codepage_for_font (char *fontname);
89extern Cursor w32_load_cursor (LPCTSTR name); 89extern Cursor w32_load_cursor (LPCTSTR name);
90 90
91extern Lisp_Object Vwindow_system;
92
93#define x_any_window_to_frame x_window_to_frame 91#define x_any_window_to_frame x_window_to_frame
94#define x_top_window_to_frame x_window_to_frame 92#define x_top_window_to_frame x_window_to_frame
95 93
@@ -138,13 +136,6 @@ BOOL (WINAPI *pfnSetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
138#define WS_EX_LAYERED 0x80000 136#define WS_EX_LAYERED 0x80000
139#endif 137#endif
140 138
141/* Frame being updated by update_frame. This is declared in term.c.
142 This is set by update_begin and looked at by all the
143 w32 functions. It is zero while not inside an update.
144 In that case, the w32 functions assume that `SELECTED_FRAME ()'
145 is the frame to apply to. */
146extern struct frame *updating_frame;
147
148/* This is a frame waiting to be autoraised, within w32_read_socket. */ 139/* This is a frame waiting to be autoraised, within w32_read_socket. */
149struct frame *pending_autoraise_frame; 140struct frame *pending_autoraise_frame;
150 141
@@ -2536,8 +2527,7 @@ x_delete_glyphs (struct frame *f, register int n)
2536} 2527}
2537 2528
2538 2529
2539/* Clear entire frame. If updating_frame is non-null, clear that 2530/* Clear entire frame. */
2540 frame. Otherwise clear the selected frame. */
2541 2531
2542static void 2532static void
2543x_clear_frame (struct frame *f) 2533x_clear_frame (struct frame *f)
@@ -6060,7 +6050,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
6060 terminal->mouse_position_hook = w32_mouse_position; 6050 terminal->mouse_position_hook = w32_mouse_position;
6061 terminal->frame_rehighlight_hook = w32_frame_rehighlight; 6051 terminal->frame_rehighlight_hook = w32_frame_rehighlight;
6062 terminal->frame_raise_lower_hook = w32_frame_raise_lower; 6052 terminal->frame_raise_lower_hook = w32_frame_raise_lower;
6063 // terminal->fullscreen_hook = XTfullscreen_hook; 6053 /* terminal->fullscreen_hook = XTfullscreen_hook; */
6064 terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar; 6054 terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
6065 terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars; 6055 terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars;
6066 terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar; 6056 terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar;
diff --git a/src/w32term.h b/src/w32term.h
index c79352a8db8..cf6751b7d63 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -547,7 +547,7 @@ do { \
547#define WM_APPCOMMAND 0x319 547#define WM_APPCOMMAND 0x319
548#define GET_APPCOMMAND_LPARAM(lParam) (HIWORD(lParam) & 0x7fff) 548#define GET_APPCOMMAND_LPARAM(lParam) (HIWORD(lParam) & 0x7fff)
549#endif 549#endif
550#ifndef WM_UNICHAR 550#ifndef WM_UNICHAR
551#define WM_UNICHAR 0x109 551#define WM_UNICHAR 0x109
552#endif 552#endif
553#ifndef UNICODE_NOCHAR 553#ifndef UNICODE_NOCHAR
@@ -697,3 +697,7 @@ typedef BOOL (WINAPI * AppendMenuW_Proc) (
697 IN UINT_PTR, 697 IN UINT_PTR,
698 IN LPCWSTR); 698 IN LPCWSTR);
699 699
700extern HWND w32_system_caret_hwnd;
701extern int w32_system_caret_height;
702extern int w32_system_caret_x;
703extern int w32_system_caret_y;
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 319f934e3bb..39d1ee5c851 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -52,10 +52,6 @@ int uniscribe_available = 0;
52extern Lisp_Object Quniscribe; 52extern Lisp_Object Quniscribe;
53extern Lisp_Object Qopentype; 53extern Lisp_Object Qopentype;
54 54
55extern int initialized;
56
57extern struct font_driver uniscribe_font_driver;
58
59/* EnumFontFamiliesEx callback. */ 55/* EnumFontFamiliesEx callback. */
60static int CALLBACK add_opentype_font_name_to_list (ENUMLOGFONTEX *, 56static int CALLBACK add_opentype_font_name_to_list (ENUMLOGFONTEX *,
61 NEWTEXTMETRICEX *, 57 NEWTEXTMETRICEX *,
diff --git a/src/w32xfns.c b/src/w32xfns.c
index df9acca5fb9..fbbf11bd65c 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -97,7 +97,7 @@ select_palette (FRAME_PTR f, HDC hdc)
97 else 97 else
98 f->output_data.w32->old_palette = NULL; 98 f->output_data.w32->old_palette = NULL;
99 99
100 if (RealizePalette (hdc)) 100 if (RealizePalette (hdc) != GDI_ERROR)
101 { 101 {
102 Lisp_Object frame, framelist; 102 Lisp_Object frame, framelist;
103 FOR_EACH_FRAME (framelist, frame) 103 FOR_EACH_FRAME (framelist, frame)
diff --git a/src/window.c b/src/window.c
index 9a0955955fa..f35815d757c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2209,13 +2209,13 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2209 case DELETE_BUFFER_WINDOWS: 2209 case DELETE_BUFFER_WINDOWS:
2210 if (EQ (w->buffer, obj)) 2210 if (EQ (w->buffer, obj))
2211 { 2211 {
2212 struct frame *f = XFRAME (WINDOW_FRAME (w)); 2212 struct frame *fr = XFRAME (WINDOW_FRAME (w));
2213 2213
2214 /* If this window is dedicated, and in a frame of its own, 2214 /* If this window is dedicated, and in a frame of its own,
2215 kill the frame. */ 2215 kill the frame. */
2216 if (EQ (window, FRAME_ROOT_WINDOW (f)) 2216 if (EQ (window, FRAME_ROOT_WINDOW (fr))
2217 && !NILP (w->dedicated) 2217 && !NILP (w->dedicated)
2218 && other_visible_frames (f)) 2218 && other_visible_frames (fr))
2219 { 2219 {
2220 /* Skip the other windows on this frame. 2220 /* Skip the other windows on this frame.
2221 There might be one, the minibuffer! */ 2221 There might be one, the minibuffer! */
@@ -2267,16 +2267,16 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2267 if (EQ (w->buffer, obj)) 2267 if (EQ (w->buffer, obj))
2268 { 2268 {
2269 Lisp_Object buffer; 2269 Lisp_Object buffer;
2270 struct frame *f = XFRAME (w->frame); 2270 struct frame *fr = XFRAME (w->frame);
2271 2271
2272 /* Find another buffer to show in this window. */ 2272 /* Find another buffer to show in this window. */
2273 buffer = Fother_buffer (obj, Qnil, w->frame); 2273 buffer = Fother_buffer (obj, Qnil, w->frame);
2274 2274
2275 /* If this window is dedicated, and in a frame of its own, 2275 /* If this window is dedicated, and in a frame of its own,
2276 kill the frame. */ 2276 kill the frame. */
2277 if (EQ (window, FRAME_ROOT_WINDOW (f)) 2277 if (EQ (window, FRAME_ROOT_WINDOW (fr))
2278 && !NILP (w->dedicated) 2278 && !NILP (w->dedicated)
2279 && other_visible_frames (f)) 2279 && other_visible_frames (fr))
2280 { 2280 {
2281 /* Skip the other windows on this frame. 2281 /* Skip the other windows on this frame.
2282 There might be one, the minibuffer! */ 2282 There might be one, the minibuffer! */
@@ -2290,11 +2290,11 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2290 } 2290 }
2291 else if (!NILP (w->dedicated) && !NILP (w->parent)) 2291 else if (!NILP (w->dedicated) && !NILP (w->parent))
2292 { 2292 {
2293 Lisp_Object window; 2293 Lisp_Object window_to_delete;
2294 XSETWINDOW (window, w); 2294 XSETWINDOW (window_to_delete, w);
2295 /* If this window is dedicated and not the only window 2295 /* If this window is dedicated and not the only window
2296 in its frame, then kill it. */ 2296 in its frame, then kill it. */
2297 Fdelete_window (window); 2297 Fdelete_window (window_to_delete);
2298 } 2298 }
2299 else 2299 else
2300 { 2300 {
@@ -3124,7 +3124,7 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs
3124 } 3124 }
3125 else if (!NILP (*forward)) 3125 else if (!NILP (*forward))
3126 { 3126 {
3127 int fixed_size, each, extra, n; 3127 int fixed_size, each IF_LINT (= 0), extra IF_LINT (= 0), n;
3128 int resize_fixed_p, nfixed; 3128 int resize_fixed_p, nfixed;
3129 int last_pos, first_pos, nchildren, total; 3129 int last_pos, first_pos, nchildren, total;
3130 int *new_sizes = NULL; 3130 int *new_sizes = NULL;
@@ -3170,11 +3170,11 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs
3170 last_pos = first_pos; 3170 last_pos = first_pos;
3171 for (n = 0, child = *forward; !NILP (child); child = c->next, ++n) 3171 for (n = 0, child = *forward; !NILP (child); child = c->next, ++n)
3172 { 3172 {
3173 int new_size, old_size; 3173 int new_child_size, old_child_size;
3174 3174
3175 c = XWINDOW (child); 3175 c = XWINDOW (child);
3176 old_size = WINDOW_TOTAL_SIZE (c, width_p); 3176 old_child_size = WINDOW_TOTAL_SIZE (c, width_p);
3177 new_size = old_size; 3177 new_child_size = old_child_size;
3178 3178
3179 /* The top or left edge position of this child equals the 3179 /* The top or left edge position of this child equals the
3180 bottom or right edge of its predecessor. */ 3180 bottom or right edge of its predecessor. */
@@ -3186,18 +3186,20 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs
3186 /* If this child can be resized, do it. */ 3186 /* If this child can be resized, do it. */
3187 if (resize_fixed_p || !window_fixed_size_p (c, width_p, 0)) 3187 if (resize_fixed_p || !window_fixed_size_p (c, width_p, 0))
3188 { 3188 {
3189 new_size = new_sizes ? new_sizes[n] : old_size + each + extra; 3189 new_child_size =
3190 new_sizes ? new_sizes[n] : old_child_size + each + extra;
3190 extra = 0; 3191 extra = 0;
3191 } 3192 }
3192 3193
3193 /* Set new size. Note that size_window also propagates 3194 /* Set new size. Note that size_window also propagates
3194 edge positions to children, so it's not a no-op if we 3195 edge positions to children, so it's not a no-op if we
3195 didn't change the child's size. */ 3196 didn't change the child's size. */
3196 size_window (child, new_size, width_p, 1, first_only, last_only); 3197 size_window (child, new_child_size, width_p, 1,
3198 first_only, last_only);
3197 3199
3198 /* Remember the bottom/right edge position of this child; it 3200 /* Remember the bottom/right edge position of this child; it
3199 will be used to set the top/left edge of the next child. */ 3201 will be used to set the top/left edge of the next child. */
3200 last_pos += new_size; 3202 last_pos += new_child_size;
3201 } 3203 }
3202 3204
3203 xfree (new_sizes); 3205 xfree (new_sizes);
@@ -3325,12 +3327,12 @@ run_window_configuration_change_hook (struct frame *f)
3325 if (!NILP (Flocal_variable_p (Qwindow_configuration_change_hook, 3327 if (!NILP (Flocal_variable_p (Qwindow_configuration_change_hook,
3326 buffer))) 3328 buffer)))
3327 { 3329 {
3328 int count = SPECPDL_INDEX (); 3330 int count1 = SPECPDL_INDEX ();
3329 record_unwind_protect (select_window_norecord, Fselected_window ()); 3331 record_unwind_protect (select_window_norecord, Fselected_window ());
3330 select_window_norecord (window); 3332 select_window_norecord (window);
3331 run_funs (Fbuffer_local_value (Qwindow_configuration_change_hook, 3333 run_funs (Fbuffer_local_value (Qwindow_configuration_change_hook,
3332 buffer)); 3334 buffer));
3333 unbind_to (count, Qnil); 3335 unbind_to (count1, Qnil);
3334 } 3336 }
3335 } 3337 }
3336 } 3338 }
@@ -3602,7 +3604,7 @@ select_frame_norecord (Lisp_Object frame)
3602 ? Fselect_frame (frame, Qt) : selected_frame; 3604 ? Fselect_frame (frame, Qt) : selected_frame;
3603} 3605}
3604 3606
3605Lisp_Object 3607static Lisp_Object
3606display_buffer (Lisp_Object buffer, Lisp_Object not_this_window_p, Lisp_Object override_frame) 3608display_buffer (Lisp_Object buffer, Lisp_Object not_this_window_p, Lisp_Object override_frame)
3607{ 3609{
3608 return call3 (Qdisplay_buffer, buffer, not_this_window_p, override_frame); 3610 return call3 (Qdisplay_buffer, buffer, not_this_window_p, override_frame);
@@ -4128,7 +4130,7 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
4128 { 4130 {
4129 /* If trying to grow this window to or beyond size of the parent, 4131 /* If trying to grow this window to or beyond size of the parent,
4130 just delete all the sibling windows. */ 4132 just delete all the sibling windows. */
4131 Lisp_Object start, tem, next; 4133 Lisp_Object start, tem;
4132 4134
4133 start = XWINDOW (parent)->vchild; 4135 start = XWINDOW (parent)->vchild;
4134 if (NILP (start)) 4136 if (NILP (start))
@@ -4138,9 +4140,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
4138 tem = XWINDOW (window)->next; 4140 tem = XWINDOW (window)->next;
4139 while (! NILP (tem)) 4141 while (! NILP (tem))
4140 { 4142 {
4141 next = XWINDOW (tem)->next; 4143 Lisp_Object next1 = XWINDOW (tem)->next;
4142 delete_window (tem); 4144 delete_window (tem);
4143 tem = next; 4145 tem = next1;
4144 } 4146 }
4145 4147
4146 /* Delete any siblings that come after WINDOW. 4148 /* Delete any siblings that come after WINDOW.
@@ -4149,9 +4151,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
4149 tem = start; 4151 tem = start;
4150 while (! EQ (tem, window)) 4152 while (! EQ (tem, window))
4151 { 4153 {
4152 next = XWINDOW (tem)->next; 4154 Lisp_Object next1 = XWINDOW (tem)->next;
4153 delete_window (tem); 4155 delete_window (tem);
4154 tem = next; 4156 tem = next1;
4155 } 4157 }
4156 } 4158 }
4157 else 4159 else
@@ -5529,7 +5531,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5529 struct buffer *obuf = current_buffer; 5531 struct buffer *obuf = current_buffer;
5530 int center_p = 0; 5532 int center_p = 0;
5531 EMACS_INT charpos, bytepos; 5533 EMACS_INT charpos, bytepos;
5532 int iarg; 5534 int iarg IF_LINT (= 0);
5533 int this_scroll_margin; 5535 int this_scroll_margin;
5534 5536
5535 /* If redisplay is suppressed due to an error, try again. */ 5537 /* If redisplay is suppressed due to an error, try again. */
@@ -7211,4 +7213,3 @@ keys_of_window (void)
7211 initial_define_key (meta_map, Ctl ('V'), "scroll-other-window"); 7213 initial_define_key (meta_map, Ctl ('V'), "scroll-other-window");
7212 initial_define_key (meta_map, 'v', "scroll-down-command"); 7214 initial_define_key (meta_map, 'v', "scroll-down-command");
7213} 7215}
7214
diff --git a/src/window.h b/src/window.h
index 9f0809e4f16..ad627aca340 100644
--- a/src/window.h
+++ b/src/window.h
@@ -778,6 +778,7 @@ extern void freeze_window_starts (struct frame *, int);
778extern void grow_mini_window (struct window *, int); 778extern void grow_mini_window (struct window *, int);
779extern void shrink_mini_window (struct window *); 779extern void shrink_mini_window (struct window *);
780extern int window_relative_x_coord (struct window *, enum window_part, int); 780extern int window_relative_x_coord (struct window *, enum window_part, int);
781extern void check_all_windows (void);
781 782
782void run_window_configuration_change_hook (struct frame *f); 783void run_window_configuration_change_hook (struct frame *f);
783 784
diff --git a/src/xdisp.c b/src/xdisp.c
index 44cb7130119..a7955f41e0c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10909,7 +10909,7 @@ hscroll_window_tree (Lisp_Object window)
10909 current_buffer = XBUFFER (w->buffer); 10909 current_buffer = XBUFFER (w->buffer);
10910 10910
10911 if (w == XWINDOW (selected_window)) 10911 if (w == XWINDOW (selected_window))
10912 pt = BUF_PT (current_buffer); 10912 pt = PT;
10913 else 10913 else
10914 { 10914 {
10915 pt = marker_position (w->pointm); 10915 pt = marker_position (w->pointm);
@@ -11347,7 +11347,7 @@ reconsider_clip_changes (struct window *w, struct buffer *b)
11347 EMACS_INT pt; 11347 EMACS_INT pt;
11348 11348
11349 if (w == XWINDOW (selected_window)) 11349 if (w == XWINDOW (selected_window))
11350 pt = BUF_PT (current_buffer); 11350 pt = PT;
11351 else 11351 else
11352 pt = marker_position (w->pointm); 11352 pt = marker_position (w->pointm);
11353 11353
@@ -13697,6 +13697,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
13697 int buffer_unchanged_p = 0; 13697 int buffer_unchanged_p = 0;
13698 int temp_scroll_step = 0; 13698 int temp_scroll_step = 0;
13699 int count = SPECPDL_INDEX (); 13699 int count = SPECPDL_INDEX ();
13700 int rc;
13700 int centering_position = -1; 13701 int centering_position = -1;
13701 int last_line_misfit = 0; 13702 int last_line_misfit = 0;
13702 EMACS_INT beg_unchanged, end_unchanged; 13703 EMACS_INT beg_unchanged, end_unchanged;
@@ -14008,15 +14009,12 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
14008 /* Handle case where text has not changed, only point, and it has 14009 /* Handle case where text has not changed, only point, and it has
14009 not moved off the frame, and we are not retrying after hscroll. 14010 not moved off the frame, and we are not retrying after hscroll.
14010 (current_matrix_up_to_date_p is nonzero when retrying.) */ 14011 (current_matrix_up_to_date_p is nonzero when retrying.) */
14011 if (current_matrix_up_to_date_p) 14012 if (current_matrix_up_to_date_p
14013 && (rc = try_cursor_movement (window, startp, &temp_scroll_step),
14014 rc != CURSOR_MOVEMENT_CANNOT_BE_USED))
14012 { 14015 {
14013 int rc = try_cursor_movement (window, startp, &temp_scroll_step);
14014
14015 switch (rc) 14016 switch (rc)
14016 { 14017 {
14017 case CURSOR_MOVEMENT_CANNOT_BE_USED:
14018 break;
14019
14020 case CURSOR_MOVEMENT_SUCCESS: 14018 case CURSOR_MOVEMENT_SUCCESS:
14021 used_current_matrix_p = 1; 14019 used_current_matrix_p = 1;
14022 goto done; 14020 goto done;
@@ -14165,11 +14163,11 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
14165 { 14163 {
14166 /* The function returns -1 if new fonts were loaded, 1 if 14164 /* The function returns -1 if new fonts were loaded, 1 if
14167 successful, 0 if not successful. */ 14165 successful, 0 if not successful. */
14168 int rc = try_scrolling (window, just_this_one_p, 14166 int ss = try_scrolling (window, just_this_one_p,
14169 scroll_conservatively, 14167 scroll_conservatively,
14170 emacs_scroll_step, 14168 emacs_scroll_step,
14171 temp_scroll_step, last_line_misfit); 14169 temp_scroll_step, last_line_misfit);
14172 switch (rc) 14170 switch (ss)
14173 { 14171 {
14174 case SCROLLING_SUCCESS: 14172 case SCROLLING_SUCCESS:
14175 goto done; 14173 goto done;
@@ -17231,14 +17229,16 @@ display_line (struct it *it)
17231 struct glyph_row *row = it->glyph_row; 17229 struct glyph_row *row = it->glyph_row;
17232 Lisp_Object overlay_arrow_string; 17230 Lisp_Object overlay_arrow_string;
17233 struct it wrap_it; 17231 struct it wrap_it;
17234 int may_wrap = 0, wrap_x; 17232 int may_wrap = 0, wrap_x IF_LINT (= 0);
17235 int wrap_row_used = -1, wrap_row_ascent, wrap_row_height; 17233 int wrap_row_used = -1;
17236 int wrap_row_phys_ascent, wrap_row_phys_height; 17234 int wrap_row_ascent IF_LINT (= 0), wrap_row_height IF_LINT (= 0);
17237 int wrap_row_extra_line_spacing; 17235 int wrap_row_phys_ascent IF_LINT (= 0), wrap_row_phys_height IF_LINT (= 0);
17238 EMACS_INT wrap_row_min_pos, wrap_row_min_bpos; 17236 int wrap_row_extra_line_spacing IF_LINT (= 0);
17239 EMACS_INT wrap_row_max_pos, wrap_row_max_bpos; 17237 EMACS_INT wrap_row_min_pos IF_LINT (= 0), wrap_row_min_bpos IF_LINT (= 0);
17238 EMACS_INT wrap_row_max_pos IF_LINT (= 0), wrap_row_max_bpos IF_LINT (= 0);
17240 int cvpos; 17239 int cvpos;
17241 EMACS_INT min_pos = ZV + 1, min_bpos, max_pos = 0, max_bpos; 17240 EMACS_INT min_pos = ZV + 1, max_pos = 0;
17241 EMACS_INT min_bpos IF_LINT (= 0), max_bpos IF_LINT (= 0);
17242 17242
17243 /* We always start displaying at hpos zero even if hscrolled. */ 17243 /* We always start displaying at hpos zero even if hscrolled. */
17244 xassert (it->hpos == 0 && it->current_x == 0); 17244 xassert (it->hpos == 0 && it->current_x == 0);
@@ -17912,16 +17912,13 @@ paragraphs, text begins at the right margin and is read from right to left.
17912See also `bidi-paragraph-direction'. */) 17912See also `bidi-paragraph-direction'. */)
17913 (Lisp_Object buffer) 17913 (Lisp_Object buffer)
17914{ 17914{
17915 struct buffer *buf; 17915 struct buffer *buf = current_buffer;
17916 struct buffer *old; 17916 struct buffer *old = buf;
17917 17917
17918 if (NILP (buffer)) 17918 if (! NILP (buffer))
17919 buf = current_buffer;
17920 else
17921 { 17919 {
17922 CHECK_BUFFER (buffer); 17920 CHECK_BUFFER (buffer);
17923 buf = XBUFFER (buffer); 17921 buf = XBUFFER (buffer);
17924 old = current_buffer;
17925 } 17922 }
17926 17923
17927 if (NILP (BVAR (buf, bidi_display_reordering))) 17924 if (NILP (BVAR (buf, bidi_display_reordering)))
@@ -17938,8 +17935,7 @@ See also `bidi-paragraph-direction'. */)
17938 EMACS_INT bytepos = BUF_PT_BYTE (buf); 17935 EMACS_INT bytepos = BUF_PT_BYTE (buf);
17939 int c; 17936 int c;
17940 17937
17941 if (buf != current_buffer) 17938 set_buffer_temp (buf);
17942 set_buffer_temp (buf);
17943 /* bidi_paragraph_init finds the base direction of the paragraph 17939 /* bidi_paragraph_init finds the base direction of the paragraph
17944 by searching forward from paragraph start. We need the base 17940 by searching forward from paragraph start. We need the base
17945 direction of the current or _previous_ paragraph, so we need 17941 direction of the current or _previous_ paragraph, so we need
@@ -17967,8 +17963,7 @@ See also `bidi-paragraph-direction'. */)
17967 itb.paragraph_dir = NEUTRAL_DIR; 17963 itb.paragraph_dir = NEUTRAL_DIR;
17968 17964
17969 bidi_paragraph_init (NEUTRAL_DIR, &itb, 1); 17965 bidi_paragraph_init (NEUTRAL_DIR, &itb, 1);
17970 if (buf != current_buffer) 17966 set_buffer_temp (old);
17971 set_buffer_temp (old);
17972 switch (itb.paragraph_dir) 17967 switch (itb.paragraph_dir)
17973 { 17968 {
17974 case L2R: 17969 case L2R:
@@ -21092,7 +21087,7 @@ compute_overhangs_and_x (struct glyph_string *s, int x, int backward_p)
21092 int cmp_id = (row)->glyphs[area][START].u.cmp.id; \ 21087 int cmp_id = (row)->glyphs[area][START].u.cmp.id; \
21093 struct composition *cmp = composition_table[cmp_id]; \ 21088 struct composition *cmp = composition_table[cmp_id]; \
21094 XChar2b *char2b; \ 21089 XChar2b *char2b; \
21095 struct glyph_string *first_s; \ 21090 struct glyph_string *first_s IF_LINT (= NULL); \
21096 int n; \ 21091 int n; \
21097 \ 21092 \
21098 char2b = (XChar2b *) alloca ((sizeof *char2b) * cmp->glyph_len); \ 21093 char2b = (XChar2b *) alloca ((sizeof *char2b) * cmp->glyph_len); \
@@ -21296,7 +21291,8 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
21296 { 21291 {
21297 struct glyph_string *h, *t; 21292 struct glyph_string *h, *t;
21298 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 21293 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
21299 int mouse_beg_col, mouse_end_col, check_mouse_face = 0; 21294 int mouse_beg_col IF_LINT (= 0), mouse_end_col IF_LINT (= 0);
21295 int check_mouse_face = 0;
21300 int dummy_x = 0; 21296 int dummy_x = 0;
21301 21297
21302 /* If mouse highlighting is on, we may need to draw adjacent 21298 /* If mouse highlighting is on, we may need to draw adjacent
@@ -22292,7 +22288,13 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
22292 if (metrics_upper.width >= metrics_lower.width) 22288 if (metrics_upper.width >= metrics_lower.width)
22293 lower_xoff = (width - metrics_lower.width) / 2; 22289 lower_xoff = (width - metrics_lower.width) / 2;
22294 else 22290 else
22295 upper_xoff = (width - metrics_upper.width) / 2; 22291 {
22292 /* FIXME: This code doesn't look right. It formerly was
22293 missing the "lower_xoff = 0;", which couldn't have
22294 been right since it left lower_xoff uninitialized. */
22295 lower_xoff = 0;
22296 upper_xoff = (width - metrics_upper.width) / 2;
22297 }
22296 } 22298 }
22297 22299
22298 /* +5 is for horizontal bars of a box plus 1-pixel spaces at 22300 /* +5 is for horizontal bars of a box plus 1-pixel spaces at
@@ -25453,7 +25455,8 @@ note_mouse_highlight (struct frame *f, int x, int y)
25453 { 25455 {
25454 /* The mouse-highlighting, if any, comes from an overlay 25456 /* The mouse-highlighting, if any, comes from an overlay
25455 or text property in the buffer. */ 25457 or text property in the buffer. */
25456 Lisp_Object buffer, cover_string; 25458 Lisp_Object buffer IF_LINT (= Qnil);
25459 Lisp_Object cover_string IF_LINT (= Qnil);
25457 25460
25458 if (STRINGP (object)) 25461 if (STRINGP (object))
25459 { 25462 {
diff --git a/src/xfaces.c b/src/xfaces.c
index 4cc47c85050..0fc5dd6f8a3 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -297,16 +297,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
297 297
298#define DIM(VECTOR) (sizeof (VECTOR) / sizeof *(VECTOR)) 298#define DIM(VECTOR) (sizeof (VECTOR) / sizeof *(VECTOR))
299 299
300/* Make a copy of string S on the stack using alloca. Value is a pointer
301 to the copy. */
302
303#define STRDUPA(S) strcpy ((char *) alloca (strlen ((S)) + 1), (S))
304
305/* Make a copy of the contents of Lisp string S on the stack using
306 alloca. Value is a pointer to the copy. */
307
308#define LSTRDUPA(S) STRDUPA (SDATA ((S)))
309
310/* Size of hash table of realized faces in face caches (should be a 300/* Size of hash table of realized faces in face caches (should be a
311 prime number). */ 301 prime number). */
312 302
@@ -847,7 +837,6 @@ clear_face_cache (int clear_fonts_p)
847{ 837{
848#ifdef HAVE_WINDOW_SYSTEM 838#ifdef HAVE_WINDOW_SYSTEM
849 Lisp_Object tail, frame; 839 Lisp_Object tail, frame;
850 struct frame *f;
851 840
852 if (clear_fonts_p 841 if (clear_fonts_p
853 || ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT) 842 || ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT)
@@ -875,7 +864,7 @@ clear_face_cache (int clear_fonts_p)
875 /* Clear GCs of realized faces. */ 864 /* Clear GCs of realized faces. */
876 FOR_EACH_FRAME (tail, frame) 865 FOR_EACH_FRAME (tail, frame)
877 { 866 {
878 f = XFRAME (frame); 867 struct frame *f = XFRAME (frame);
879 if (FRAME_WINDOW_P (f)) 868 if (FRAME_WINDOW_P (f))
880 clear_face_gcs (FRAME_FACE_CACHE (f)); 869 clear_face_gcs (FRAME_FACE_CACHE (f));
881 } 870 }
@@ -1113,7 +1102,7 @@ tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color, XColor
1113 1102
1114/* A version of defined_color for non-X frames. */ 1103/* A version of defined_color for non-X frames. */
1115 1104
1116int 1105static int
1117tty_defined_color (struct frame *f, const char *color_name, 1106tty_defined_color (struct frame *f, const char *color_name,
1118 XColor *color_def, int alloc) 1107 XColor *color_def, int alloc)
1119{ 1108{
@@ -1721,7 +1710,7 @@ the WIDTH times as wide as FACE on FRAME. */)
1721 (Lisp_Object pattern, Lisp_Object face, Lisp_Object frame, Lisp_Object maximum, Lisp_Object width) 1710 (Lisp_Object pattern, Lisp_Object face, Lisp_Object frame, Lisp_Object maximum, Lisp_Object width)
1722{ 1711{
1723 struct frame *f; 1712 struct frame *f;
1724 int size, avgwidth; 1713 int size, avgwidth IF_LINT (= 0);
1725 1714
1726 check_x (); 1715 check_x ();
1727 CHECK_STRING (pattern); 1716 CHECK_STRING (pattern);
@@ -1754,14 +1743,14 @@ the WIDTH times as wide as FACE on FRAME. */)
1754 /* This is of limited utility since it works with character 1743 /* This is of limited utility since it works with character
1755 widths. Keep it for compatibility. --gerd. */ 1744 widths. Keep it for compatibility. --gerd. */
1756 int face_id = lookup_named_face (f, face, 0); 1745 int face_id = lookup_named_face (f, face, 0);
1757 struct face *face = (face_id < 0 1746 struct face *width_face = (face_id < 0
1758 ? NULL 1747 ? NULL
1759 : FACE_FROM_ID (f, face_id)); 1748 : FACE_FROM_ID (f, face_id));
1760 1749
1761 if (face && face->font) 1750 if (width_face && width_face->font)
1762 { 1751 {
1763 size = face->font->pixel_size; 1752 size = width_face->font->pixel_size;
1764 avgwidth = face->font->average_width; 1753 avgwidth = width_face->font->average_width;
1765 } 1754 }
1766 else 1755 else
1767 { 1756 {
@@ -1838,6 +1827,7 @@ the WIDTH times as wide as FACE on FRAME. */)
1838#define LFACE_INHERIT(LFACE) AREF ((LFACE), LFACE_INHERIT_INDEX) 1827#define LFACE_INHERIT(LFACE) AREF ((LFACE), LFACE_INHERIT_INDEX)
1839#define LFACE_FONTSET(LFACE) AREF ((LFACE), LFACE_FONTSET_INDEX) 1828#define LFACE_FONTSET(LFACE) AREF ((LFACE), LFACE_FONTSET_INDEX)
1840 1829
1830#if XASSERTS
1841/* Non-zero if LFACE is a Lisp face. A Lisp face is a vector of size 1831/* Non-zero if LFACE is a Lisp face. A Lisp face is a vector of size
1842 LFACE_VECTOR_SIZE which has the symbol `face' in slot 0. */ 1832 LFACE_VECTOR_SIZE which has the symbol `face' in slot 0. */
1843 1833
@@ -1845,6 +1835,7 @@ the WIDTH times as wide as FACE on FRAME. */)
1845 (VECTORP (LFACE) \ 1835 (VECTORP (LFACE) \
1846 && XVECTOR (LFACE)->size == LFACE_VECTOR_SIZE \ 1836 && XVECTOR (LFACE)->size == LFACE_VECTOR_SIZE \
1847 && EQ (AREF (LFACE, 0), Qface)) 1837 && EQ (AREF (LFACE, 0), Qface))
1838#endif
1848 1839
1849 1840
1850#if GLYPH_DEBUG 1841#if GLYPH_DEBUG
@@ -2252,7 +2243,7 @@ set_lface_from_font (struct frame *f, Lisp_Object lface, Lisp_Object font_object
2252 `relative' heights; the returned value is always an absolute height 2243 `relative' heights; the returned value is always an absolute height
2253 unless both FROM and TO are relative. */ 2244 unless both FROM and TO are relative. */
2254 2245
2255Lisp_Object 2246static Lisp_Object
2256merge_face_heights (Lisp_Object from, Lisp_Object to, Lisp_Object invalid) 2247merge_face_heights (Lisp_Object from, Lisp_Object to, Lisp_Object invalid)
2257{ 2248{
2258 Lisp_Object result = invalid; 2249 Lisp_Object result = invalid;
@@ -3869,19 +3860,19 @@ return the font name used for CHARACTER. */)
3869 { 3860 {
3870 struct frame *f = frame_or_selected_frame (frame, 1); 3861 struct frame *f = frame_or_selected_frame (frame, 1);
3871 int face_id = lookup_named_face (f, face, 1); 3862 int face_id = lookup_named_face (f, face, 1);
3872 struct face *face = FACE_FROM_ID (f, face_id); 3863 struct face *fface = FACE_FROM_ID (f, face_id);
3873 3864
3874 if (! face) 3865 if (! fface)
3875 return Qnil; 3866 return Qnil;
3876#ifdef HAVE_WINDOW_SYSTEM 3867#ifdef HAVE_WINDOW_SYSTEM
3877 if (FRAME_WINDOW_P (f) && !NILP (character)) 3868 if (FRAME_WINDOW_P (f) && !NILP (character))
3878 { 3869 {
3879 CHECK_CHARACTER (character); 3870 CHECK_CHARACTER (character);
3880 face_id = FACE_FOR_CHAR (f, face, XINT (character), -1, Qnil); 3871 face_id = FACE_FOR_CHAR (f, fface, XINT (character), -1, Qnil);
3881 face = FACE_FROM_ID (f, face_id); 3872 fface = FACE_FROM_ID (f, face_id);
3882 } 3873 }
3883 return (face->font 3874 return (fface->font
3884 ? face->font->props[FONT_NAME_INDEX] 3875 ? fface->font->props[FONT_NAME_INDEX]
3885 : Qnil); 3876 : Qnil);
3886#else /* !HAVE_WINDOW_SYSTEM */ 3877#else /* !HAVE_WINDOW_SYSTEM */
3887 return build_string (FRAME_MSDOS_P (f) 3878 return build_string (FRAME_MSDOS_P (f)
@@ -4313,45 +4304,6 @@ free_realized_faces (struct face_cache *c)
4313} 4304}
4314 4305
4315 4306
4316/* Free all realized faces that are using FONTSET on frame F. */
4317
4318void
4319free_realized_faces_for_fontset (struct frame *f, int fontset)
4320{
4321 struct face_cache *cache = FRAME_FACE_CACHE (f);
4322 struct face *face;
4323 int i;
4324
4325 /* We must block input here because we can't process X events safely
4326 while only some faces are freed, or when the frame's current
4327 matrix still references freed faces. */
4328 BLOCK_INPUT;
4329
4330 for (i = 0; i < cache->used; i++)
4331 {
4332 face = cache->faces_by_id[i];
4333 if (face
4334 && face->fontset == fontset)
4335 {
4336 uncache_face (cache, face);
4337 free_realized_face (f, face);
4338 }
4339 }
4340
4341 /* Must do a thorough redisplay the next time. Mark current
4342 matrices as invalid because they will reference faces freed
4343 above. This function is also called when a frame is destroyed.
4344 In this case, the root window of F is nil. */
4345 if (WINDOWP (f->root_window))
4346 {
4347 clear_current_matrices (f);
4348 ++windows_or_buffers_changed;
4349 }
4350
4351 UNBLOCK_INPUT;
4352}
4353
4354
4355/* Free all realized faces on FRAME or on all frames if FRAME is nil. 4307/* Free all realized faces on FRAME or on all frames if FRAME is nil.
4356 This is done after attributes of a named face have been changed, 4308 This is done after attributes of a named face have been changed,
4357 because we can't tell which realized faces depend on that face. */ 4309 because we can't tell which realized faces depend on that face. */
@@ -5287,10 +5239,6 @@ be found. Value is ALIST. */)
5287 5239
5288#ifdef HAVE_WINDOW_SYSTEM 5240#ifdef HAVE_WINDOW_SYSTEM
5289 5241
5290/* Ignore the difference of font point size less than this value. */
5291
5292#define FONT_POINT_SIZE_QUANTUM 5
5293
5294/* Return the fontset id of the base fontset name or alias name given 5242/* Return the fontset id of the base fontset name or alias name given
5295 by the fontset attribute of ATTRS. Value is -1 if the fontset 5243 by the fontset attribute of ATTRS. Value is -1 if the fontset
5296 attribute of ATTRS doesn't name a fontset. */ 5244 attribute of ATTRS doesn't name a fontset. */
@@ -6349,7 +6297,7 @@ where R,G,B are numbers between 0 and 255 and name is an arbitrary string. */)
6349 CHECK_STRING (filename); 6297 CHECK_STRING (filename);
6350 abspath = Fexpand_file_name (filename, Qnil); 6298 abspath = Fexpand_file_name (filename, Qnil);
6351 6299
6352 fp = fopen (SDATA (filename), "rt"); 6300 fp = fopen (SDATA (abspath), "rt");
6353 if (fp) 6301 if (fp)
6354 { 6302 {
6355 char buf[512]; 6303 char buf[512];
diff --git a/src/xfns.c b/src/xfns.c
index deb0e192a54..e50d6887179 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -461,7 +461,7 @@ x_real_positions (FRAME_PTR f, int *xptr, int *yptr)
461 Window win = f->output_data.x->parent_desc; 461 Window win = f->output_data.x->parent_desc;
462 Atom actual_type; 462 Atom actual_type;
463 unsigned long actual_size, bytes_remaining; 463 unsigned long actual_size, bytes_remaining;
464 int i, rc, actual_format; 464 int rc, actual_format;
465 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 465 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
466 long max_len = 400; 466 long max_len = 400;
467 Display *dpy = FRAME_X_DISPLAY (f); 467 Display *dpy = FRAME_X_DISPLAY (f);
@@ -648,7 +648,7 @@ x_defined_color (struct frame *f, const char *color_name,
648 is a monochrome frame, return MONO_COLOR regardless of what ARG says. 648 is a monochrome frame, return MONO_COLOR regardless of what ARG says.
649 Signal an error if color can't be allocated. */ 649 Signal an error if color can't be allocated. */
650 650
651int 651static int
652x_decode_color (FRAME_PTR f, Lisp_Object color_name, int mono_color) 652x_decode_color (FRAME_PTR f, Lisp_Object color_name, int mono_color)
653{ 653{
654 XColor cdef; 654 XColor cdef;
@@ -746,7 +746,6 @@ xg_set_icon (FRAME_PTR f, Lisp_Object file)
746int 746int
747xg_set_icon_from_xpm_data (FRAME_PTR f, const char **data) 747xg_set_icon_from_xpm_data (FRAME_PTR f, const char **data)
748{ 748{
749 int result = 0;
750 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (data); 749 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (data);
751 750
752 if (!pixbuf) 751 if (!pixbuf)
@@ -1635,7 +1634,7 @@ x_set_name_internal (FRAME_PTR f, Lisp_Object name)
1635 suggesting a new name, which lisp code should override; if 1634 suggesting a new name, which lisp code should override; if
1636 F->explicit_name is set, ignore the new name; otherwise, set it. */ 1635 F->explicit_name is set, ignore the new name; otherwise, set it. */
1637 1636
1638void 1637static void
1639x_set_name (struct frame *f, Lisp_Object name, int explicit) 1638x_set_name (struct frame *f, Lisp_Object name, int explicit)
1640{ 1639{
1641 /* Make sure that requests from lisp code override requests from 1640 /* Make sure that requests from lisp code override requests from
@@ -2620,7 +2619,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
2620 2619
2621#else /* not USE_X_TOOLKIT */ 2620#else /* not USE_X_TOOLKIT */
2622#ifdef USE_GTK 2621#ifdef USE_GTK
2623void 2622static void
2624x_window (FRAME_PTR f) 2623x_window (FRAME_PTR f)
2625{ 2624{
2626 if (! xg_create_frame_widgets (f)) 2625 if (! xg_create_frame_widgets (f))
@@ -2660,7 +2659,7 @@ x_window (FRAME_PTR f)
2660#else /*! USE_GTK */ 2659#else /*! USE_GTK */
2661/* Create and set up the X window for frame F. */ 2660/* Create and set up the X window for frame F. */
2662 2661
2663void 2662static void
2664x_window (struct frame *f) 2663x_window (struct frame *f)
2665{ 2664{
2666 XClassHint class_hints; 2665 XClassHint class_hints;
@@ -3184,7 +3183,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3184 to get the color reference counts right, so initialize them! */ 3183 to get the color reference counts right, so initialize them! */
3185 { 3184 {
3186 Lisp_Object black; 3185 Lisp_Object black;
3187 struct gcpro gcpro1; 3186 struct gcpro inner_gcpro1;
3188 3187
3189 /* Function x_decode_color can signal an error. Make 3188 /* Function x_decode_color can signal an error. Make
3190 sure to initialize color slots so that we won't try 3189 sure to initialize color slots so that we won't try
@@ -3197,7 +3196,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3197 f->output_data.x->mouse_pixel = -1; 3196 f->output_data.x->mouse_pixel = -1;
3198 3197
3199 black = build_string ("black"); 3198 black = build_string ("black");
3200 GCPRO1 (black); 3199 GCPRO1_VAR (black, inner_gcpro);
3201 FRAME_FOREGROUND_PIXEL (f) 3200 FRAME_FOREGROUND_PIXEL (f)
3202 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 3201 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
3203 FRAME_BACKGROUND_PIXEL (f) 3202 FRAME_BACKGROUND_PIXEL (f)
@@ -3210,7 +3209,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3210 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 3209 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
3211 f->output_data.x->mouse_pixel 3210 f->output_data.x->mouse_pixel
3212 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 3211 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
3213 UNGCPRO; 3212 UNGCPRO_VAR (inner_gcpro);
3214 } 3213 }
3215 3214
3216 /* Specify the parent under which to make this X window. */ 3215 /* Specify the parent under which to make this X window. */
@@ -3448,8 +3447,9 @@ This function is an internal primitive--use `make-frame' instead. */)
3448 else if (! NILP (visibility)) 3447 else if (! NILP (visibility))
3449 x_make_frame_visible (f); 3448 x_make_frame_visible (f);
3450 else 3449 else
3451 /* Must have been Qnil. */ 3450 {
3452 ; 3451 /* Must have been Qnil. */
3452 }
3453 } 3453 }
3454 3454
3455 BLOCK_INPUT; 3455 BLOCK_INPUT;
@@ -4577,7 +4577,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4577 Lisp_Object text) 4577 Lisp_Object text)
4578{ 4578{
4579 struct frame *f; 4579 struct frame *f;
4580 Lisp_Object frame, tem; 4580 Lisp_Object frame;
4581 Lisp_Object name; 4581 Lisp_Object name;
4582 long window_prompting = 0; 4582 long window_prompting = 0;
4583 int width, height; 4583 int width, height;
@@ -4651,7 +4651,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4651 to get the color reference counts right, so initialize them! */ 4651 to get the color reference counts right, so initialize them! */
4652 { 4652 {
4653 Lisp_Object black; 4653 Lisp_Object black;
4654 struct gcpro gcpro1; 4654 struct gcpro inner_gcpro1;
4655 4655
4656 /* Function x_decode_color can signal an error. Make 4656 /* Function x_decode_color can signal an error. Make
4657 sure to initialize color slots so that we won't try 4657 sure to initialize color slots so that we won't try
@@ -4664,7 +4664,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4664 f->output_data.x->mouse_pixel = -1; 4664 f->output_data.x->mouse_pixel = -1;
4665 4665
4666 black = build_string ("black"); 4666 black = build_string ("black");
4667 GCPRO1 (black); 4667 GCPRO1_VAR (black, inner_gcpro);
4668 FRAME_FOREGROUND_PIXEL (f) 4668 FRAME_FOREGROUND_PIXEL (f)
4669 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 4669 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
4670 FRAME_BACKGROUND_PIXEL (f) 4670 FRAME_BACKGROUND_PIXEL (f)
@@ -4677,7 +4677,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4677 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 4677 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
4678 f->output_data.x->mouse_pixel 4678 f->output_data.x->mouse_pixel
4679 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); 4679 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
4680 UNGCPRO; 4680 UNGCPRO_VAR (inner_gcpro);
4681 } 4681 }
4682 4682
4683 /* Set the name; the functions to which we pass f expect the name to 4683 /* Set the name; the functions to which we pass f expect the name to
@@ -5035,7 +5035,7 @@ Text larger than the specified size is clipped. */)
5035 && !NILP (Fequal (last_string, string)) 5035 && !NILP (Fequal (last_string, string))
5036 && !NILP (Fequal (last_parms, parms))) 5036 && !NILP (Fequal (last_parms, parms)))
5037 { 5037 {
5038 struct frame *f = XFRAME (tip_frame); 5038 struct frame *tip_f = XFRAME (tip_frame);
5039 5039
5040 /* Only DX and DY have changed. */ 5040 /* Only DX and DY have changed. */
5041 if (!NILP (tip_timer)) 5041 if (!NILP (tip_timer))
@@ -5046,9 +5046,9 @@ Text larger than the specified size is clipped. */)
5046 } 5046 }
5047 5047
5048 BLOCK_INPUT; 5048 BLOCK_INPUT;
5049 compute_tip_xy (f, parms, dx, dy, FRAME_PIXEL_WIDTH (f), 5049 compute_tip_xy (tip_f, parms, dx, dy, FRAME_PIXEL_WIDTH (tip_f),
5050 FRAME_PIXEL_HEIGHT (f), &root_x, &root_y); 5050 FRAME_PIXEL_HEIGHT (tip_f), &root_x, &root_y);
5051 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5051 XMoveWindow (FRAME_X_DISPLAY (tip_f), FRAME_X_WINDOW (tip_f),
5052 root_x, root_y); 5052 root_x, root_y);
5053 UNBLOCK_INPUT; 5053 UNBLOCK_INPUT;
5054 goto start_timer; 5054 goto start_timer;
@@ -5565,11 +5565,11 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
5565 BLOCK_INPUT; 5565 BLOCK_INPUT;
5566 5566
5567 if (STRINGP (default_filename)) 5567 if (STRINGP (default_filename))
5568 cdef_file = SDATA (default_filename); 5568 cdef_file = SSDATA (default_filename);
5569 else 5569 else
5570 cdef_file = SDATA (dir); 5570 cdef_file = SSDATA (dir);
5571 5571
5572 fn = xg_get_file_name (f, SDATA (prompt), cdef_file, 5572 fn = xg_get_file_name (f, SSDATA (prompt), cdef_file,
5573 ! NILP (mustmatch), 5573 ! NILP (mustmatch),
5574 ! NILP (only_dir_p)); 5574 ! NILP (only_dir_p));
5575 5575
@@ -5625,12 +5625,12 @@ If FRAME is omitted or nil, it defaults to the selected frame. */)
5625 XSETFONT (font, FRAME_FONT (f)); 5625 XSETFONT (font, FRAME_FONT (f));
5626 font_param = Ffont_get (font, intern (":name")); 5626 font_param = Ffont_get (font, intern (":name"));
5627 if (STRINGP (font_param)) 5627 if (STRINGP (font_param))
5628 default_name = xstrdup (SDATA (font_param)); 5628 default_name = xstrdup (SSDATA (font_param));
5629 else 5629 else
5630 { 5630 {
5631 font_param = Fframe_parameter (frame, Qfont_param); 5631 font_param = Fframe_parameter (frame, Qfont_param);
5632 if (STRINGP (font_param)) 5632 if (STRINGP (font_param))
5633 default_name = xstrdup (SDATA (font_param)); 5633 default_name = xstrdup (SSDATA (font_param));
5634 } 5634 }
5635 5635
5636 if (default_name == NULL && x_last_font_name != NULL) 5636 if (default_name == NULL && x_last_font_name != NULL)
@@ -5694,7 +5694,7 @@ present and mapped to the usual X keysyms. */)
5694 struct frame *f = check_x_frame (frame); 5694 struct frame *f = check_x_frame (frame);
5695 Display *dpy = FRAME_X_DISPLAY (f); 5695 Display *dpy = FRAME_X_DISPLAY (f);
5696 Lisp_Object have_keys; 5696 Lisp_Object have_keys;
5697 int major, minor, op, event, error; 5697 int major, minor, op, event, error_code;
5698 5698
5699 BLOCK_INPUT; 5699 BLOCK_INPUT;
5700 5700
@@ -5710,7 +5710,7 @@ present and mapped to the usual X keysyms. */)
5710 /* Check that the server supports XKB. */ 5710 /* Check that the server supports XKB. */
5711 major = XkbMajorVersion; 5711 major = XkbMajorVersion;
5712 minor = XkbMinorVersion; 5712 minor = XkbMinorVersion;
5713 if (!XkbQueryExtension (dpy, &op, &event, &error, &major, &minor)) 5713 if (!XkbQueryExtension (dpy, &op, &event, &error_code, &major, &minor))
5714 { 5714 {
5715 UNBLOCK_INPUT; 5715 UNBLOCK_INPUT;
5716 return Qlambda; 5716 return Qlambda;
diff --git a/src/xgselect.c b/src/xgselect.c
index 359a8fbc89b..96d763ff088 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -38,7 +38,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
38 GMainContext *context = g_main_context_default (); 38 GMainContext *context = g_main_context_default ();
39 int have_wfds = wfds != NULL; 39 int have_wfds = wfds != NULL;
40 int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0; 40 int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0;
41 int prio, i, nfds, tmo_in_millisec; 41 int i, nfds, tmo_in_millisec;
42 42
43 if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); 43 if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds));
44 else FD_ZERO (&all_rfds); 44 else FD_ZERO (&all_rfds);
@@ -49,9 +49,9 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
49 g_main_context_pending (context); 49 g_main_context_pending (context);
50 50
51 do { 51 do {
52 if (n_gfds > gfds_size) 52 if (n_gfds > gfds_size)
53 { 53 {
54 while (n_gfds > gfds_size) 54 while (n_gfds > gfds_size)
55 gfds_size *= 2; 55 gfds_size *= 2;
56 xfree (gfds); 56 xfree (gfds);
57 gfds = xmalloc (sizeof (*gfds) * gfds_size); 57 gfds = xmalloc (sizeof (*gfds) * gfds_size);
@@ -64,7 +64,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
64 gfds_size); 64 gfds_size);
65 } while (n_gfds > gfds_size); 65 } while (n_gfds > gfds_size);
66 66
67 for (i = 0; i < n_gfds; ++i) 67 for (i = 0; i < n_gfds; ++i)
68 { 68 {
69 if (gfds[i].events & G_IO_IN) 69 if (gfds[i].events & G_IO_IN)
70 { 70 {
@@ -87,7 +87,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
87 else 87 else
88 { 88 {
89 EMACS_TIME difference; 89 EMACS_TIME difference;
90 90
91 EMACS_SUB_TIME (difference, tmo, *timeout); 91 EMACS_SUB_TIME (difference, tmo, *timeout);
92 if (EMACS_TIME_NEG_P (difference)) our_tmo = 1; 92 if (EMACS_TIME_NEG_P (difference)) our_tmo = 1;
93 } 93 }
@@ -100,7 +100,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
100 100
101 if (nfds < 0) 101 if (nfds < 0)
102 retval = nfds; 102 retval = nfds;
103 else if (nfds > 0) 103 else if (nfds > 0)
104 { 104 {
105 for (i = 0; i < max_fds+1; ++i) 105 for (i = 0; i < max_fds+1; ++i)
106 { 106 {
@@ -127,7 +127,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
127 127
128 if (our_fds > 0 || (nfds == 0 && our_tmo)) 128 if (our_fds > 0 || (nfds == 0 && our_tmo))
129 { 129 {
130 130
131 /* If Gtk+ is in use eventually gtk_main_iteration will be called, 131 /* If Gtk+ is in use eventually gtk_main_iteration will be called,
132 unless retval is zero. */ 132 unless retval is zero. */
133#ifdef USE_GTK 133#ifdef USE_GTK
@@ -137,7 +137,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
137 g_main_context_dispatch (context); 137 g_main_context_dispatch (context);
138 138
139 /* To not have to recalculate timeout, return like this. */ 139 /* To not have to recalculate timeout, return like this. */
140 if (retval == 0) 140 if (retval == 0)
141 { 141 {
142 retval = -1; 142 retval = -1;
143 errno = EINTR; 143 errno = EINTR;
@@ -156,4 +156,3 @@ xgselect_initialize (void)
156 gfds = xmalloc (sizeof (*gfds)*gfds_size); 156 gfds = xmalloc (sizeof (*gfds)*gfds_size);
157#endif /* defined (USE_GTK) || defined (HAVE_GCONF) */ 157#endif /* defined (USE_GTK) || defined (HAVE_GCONF) */
158} 158}
159
diff --git a/src/xmenu.c b/src/xmenu.c
index 934db0f0406..eab7bb03f20 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -124,11 +124,11 @@ static int update_frame_menubar (struct frame *);
124 Xt on behalf of one of the widget sets. */ 124 Xt on behalf of one of the widget sets. */
125static int popup_activated_flag; 125static int popup_activated_flag;
126 126
127static int next_menubar_widget_id;
128
129 127
130#ifdef USE_X_TOOLKIT 128#ifdef USE_X_TOOLKIT
131 129
130static int next_menubar_widget_id;
131
132/* Return the frame whose ->output_data.x->id equals ID, or 0 if none. */ 132/* Return the frame whose ->output_data.x->id equals ID, or 0 if none. */
133 133
134static struct frame * 134static struct frame *
@@ -723,7 +723,7 @@ show_help_event (FRAME_PTR f, xt_or_gtk_widget widget, Lisp_Object help)
723 unhighlighting. */ 723 unhighlighting. */
724 724
725#ifdef USE_GTK 725#ifdef USE_GTK
726void 726static void
727menu_highlight_callback (GtkWidget *widget, gpointer call_data) 727menu_highlight_callback (GtkWidget *widget, gpointer call_data)
728{ 728{
729 xg_menu_item_cb_data *cb_data; 729 xg_menu_item_cb_data *cb_data;
@@ -742,7 +742,7 @@ menu_highlight_callback (GtkWidget *widget, gpointer call_data)
742 show_help_event (cb_data->cl_data->f, widget, help); 742 show_help_event (cb_data->cl_data->f, widget, help);
743} 743}
744#else 744#else
745void 745static void
746menu_highlight_callback (Widget widget, LWLIB_ID id, void *call_data) 746menu_highlight_callback (Widget widget, LWLIB_ID id, void *call_data)
747{ 747{
748 struct frame *f; 748 struct frame *f;
@@ -1175,8 +1175,6 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
1175 } 1175 }
1176 else 1176 else
1177 { 1177 {
1178 GtkWidget *wvbox = f->output_data.x->vbox_widget;
1179
1180 menubar_widget 1178 menubar_widget
1181 = xg_create_widget ("menubar", "menubar", f, first_wv, 1179 = xg_create_widget ("menubar", "menubar", f, first_wv,
1182 G_CALLBACK (menubar_selection_callback), 1180 G_CALLBACK (menubar_selection_callback),
@@ -1390,7 +1388,7 @@ menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer
1390 1388
1391 /* Check if there is room for the menu. If not, adjust x/y so that 1389 /* Check if there is room for the menu. If not, adjust x/y so that
1392 the menu is fully visible. */ 1390 the menu is fully visible. */
1393 gtk_widget_size_request (GTK_WIDGET (menu), &req); 1391 gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &req);
1394 if (data->x + req.width > disp_width) 1392 if (data->x + req.width > disp_width)
1395 *x -= data->x + req.width - disp_width; 1393 *x -= data->x + req.width - disp_width;
1396 if (data->y + req.height > disp_height) 1394 if (data->y + req.height > disp_height)
@@ -1600,7 +1598,7 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv,
1600 1598
1601Lisp_Object 1599Lisp_Object
1602xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, 1600xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
1603 Lisp_Object title, const char **error, EMACS_UINT timestamp) 1601 Lisp_Object title, const char **error_name, EMACS_UINT timestamp)
1604{ 1602{
1605 int i; 1603 int i;
1606 widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0; 1604 widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
@@ -1615,11 +1613,11 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
1615 if (! FRAME_X_P (f)) 1613 if (! FRAME_X_P (f))
1616 abort (); 1614 abort ();
1617 1615
1618 *error = NULL; 1616 *error_name = NULL;
1619 1617
1620 if (menu_items_used <= MENU_ITEMS_PANE_LENGTH) 1618 if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
1621 { 1619 {
1622 *error = "Empty menu"; 1620 *error_name = "Empty menu";
1623 return Qnil; 1621 return Qnil;
1624 } 1622 }
1625 1623
@@ -1664,7 +1662,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
1664 { 1662 {
1665 /* Create a new pane. */ 1663 /* Create a new pane. */
1666 Lisp_Object pane_name, prefix; 1664 Lisp_Object pane_name, prefix;
1667 char *pane_string; 1665 const char *pane_string;
1668 1666
1669 pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); 1667 pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
1670 prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); 1668 prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
@@ -2012,7 +2010,7 @@ xdialog_show (FRAME_PTR f,
2012 representing the text label and buttons. */ 2010 representing the text label and buttons. */
2013 { 2011 {
2014 Lisp_Object pane_name, prefix; 2012 Lisp_Object pane_name, prefix;
2015 char *pane_string; 2013 const char *pane_string;
2016 pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; 2014 pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME];
2017 prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; 2015 prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX];
2018 pane_string = (NILP (pane_name) 2016 pane_string = (NILP (pane_name)
@@ -2307,7 +2305,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
2307 { 2305 {
2308 /* Create a new pane. */ 2306 /* Create a new pane. */
2309 Lisp_Object pane_name, prefix; 2307 Lisp_Object pane_name, prefix;
2310 char *pane_string; 2308 const char *pane_string;
2311 2309
2312 maxlines = max (maxlines, lines); 2310 maxlines = max (maxlines, lines);
2313 lines = 0; 2311 lines = 0;
diff --git a/src/xrdb.c b/src/xrdb.c
index 9fb3f3474fb..a79f453e5e1 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -28,6 +28,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
28#include <stdio.h> 28#include <stdio.h>
29#include <setjmp.h> 29#include <setjmp.h>
30 30
31#include "lisp.h"
32
33/* This may include sys/types.h, and that somehow loses
34 if this is not done before the other system files. */
35#include "xterm.h"
36
31#include <X11/Xlib.h> 37#include <X11/Xlib.h>
32#include <X11/Xatom.h> 38#include <X11/Xatom.h>
33#include <X11/X.h> 39#include <X11/X.h>
@@ -38,8 +44,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38#endif 44#endif
39#include <sys/stat.h> 45#include <sys/stat.h>
40 46
41#include "lisp.h"
42
43#ifdef USE_MOTIF 47#ifdef USE_MOTIF
44/* For Vdouble_click_time. */ 48/* For Vdouble_click_time. */
45#include "keyboard.h" 49#include "keyboard.h"
@@ -50,8 +54,6 @@ extern char *getenv (const char *);
50extern struct passwd *getpwuid (uid_t); 54extern struct passwd *getpwuid (uid_t);
51extern struct passwd *getpwnam (const char *); 55extern struct passwd *getpwnam (const char *);
52 56
53extern const char *get_system_name (void);
54
55char *x_get_string_resource (XrmDatabase rdb, const char *name, 57char *x_get_string_resource (XrmDatabase rdb, const char *name,
56 const char *class); 58 const char *class);
57static int file_p (const char *filename); 59static int file_p (const char *filename);
diff --git a/src/xselect.c b/src/xselect.c
index a502a74f904..5254fa96838 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -97,7 +97,6 @@ static Lisp_Object clean_local_selection_data (Lisp_Object);
97#define TRACE0(fmt) (void) 0 97#define TRACE0(fmt) (void) 0
98#define TRACE1(fmt, a0) (void) 0 98#define TRACE1(fmt, a0) (void) 0
99#define TRACE2(fmt, a0, a1) (void) 0 99#define TRACE2(fmt, a0, a1) (void) 0
100#define TRACE3(fmt, a0, a1) (void) 0
101#endif 100#endif
102 101
103 102
@@ -330,7 +329,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value)
330 struct frame *sf = SELECTED_FRAME (); 329 struct frame *sf = SELECTED_FRAME ();
331 Window selecting_window; 330 Window selecting_window;
332 Display *display; 331 Display *display;
333 Time time = last_event_timestamp; 332 Time timestamp = last_event_timestamp;
334 Atom selection_atom; 333 Atom selection_atom;
335 struct x_display_info *dpyinfo; 334 struct x_display_info *dpyinfo;
336 335
@@ -346,7 +345,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value)
346 345
347 BLOCK_INPUT; 346 BLOCK_INPUT;
348 x_catch_errors (display); 347 x_catch_errors (display);
349 XSetSelectionOwner (display, selection_atom, selecting_window, time); 348 XSetSelectionOwner (display, selection_atom, selecting_window, timestamp);
350 x_check_errors (display, "Can't set selection: %s"); 349 x_check_errors (display, "Can't set selection: %s");
351 x_uncatch_errors (); 350 x_uncatch_errors ();
352 UNBLOCK_INPUT; 351 UNBLOCK_INPUT;
@@ -357,7 +356,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value)
357 Lisp_Object selection_data; 356 Lisp_Object selection_data;
358 Lisp_Object prev_value; 357 Lisp_Object prev_value;
359 358
360 selection_time = long_to_cons ((unsigned long) time); 359 selection_time = long_to_cons ((unsigned long) timestamp);
361 selection_data = list4 (selection_name, selection_value, 360 selection_data = list4 (selection_name, selection_value,
362 selection_time, selected_frame); 361 selection_time, selected_frame);
363 prev_value = assq_no_quit (selection_name, Vselection_alist); 362 prev_value = assq_no_quit (selection_name, Vselection_alist);
@@ -2085,7 +2084,7 @@ DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
2085 Sx_disown_selection_internal, 1, 2, 0, 2084 Sx_disown_selection_internal, 1, 2, 0,
2086 doc: /* If we own the selection SELECTION, disown it. 2085 doc: /* If we own the selection SELECTION, disown it.
2087Disowning it means there is no such selection. */) 2086Disowning it means there is no such selection. */)
2088 (Lisp_Object selection, Lisp_Object time) 2087 (Lisp_Object selection, Lisp_Object time_object)
2089{ 2088{
2090 Time timestamp; 2089 Time timestamp;
2091 Atom selection_atom; 2090 Atom selection_atom;
@@ -2104,10 +2103,10 @@ Disowning it means there is no such selection. */)
2104 display = FRAME_X_DISPLAY (sf); 2103 display = FRAME_X_DISPLAY (sf);
2105 dpyinfo = FRAME_X_DISPLAY_INFO (sf); 2104 dpyinfo = FRAME_X_DISPLAY_INFO (sf);
2106 CHECK_SYMBOL (selection); 2105 CHECK_SYMBOL (selection);
2107 if (NILP (time)) 2106 if (NILP (time_object))
2108 timestamp = last_event_timestamp; 2107 timestamp = last_event_timestamp;
2109 else 2108 else
2110 timestamp = cons_to_long (time); 2109 timestamp = cons_to_long (time_object);
2111 2110
2112 if (NILP (assq_no_quit (selection, Vselection_alist))) 2111 if (NILP (assq_no_quit (selection, Vselection_alist)))
2113 return Qnil; /* Don't disown the selection when we're not the owner. */ 2112 return Qnil; /* Don't disown the selection when we're not the owner. */
@@ -2131,26 +2130,6 @@ Disowning it means there is no such selection. */)
2131 return Qt; 2130 return Qt;
2132} 2131}
2133 2132
2134/* Get rid of all the selections in buffer BUFFER.
2135 This is used when we kill a buffer. */
2136
2137void
2138x_disown_buffer_selections (Lisp_Object buffer)
2139{
2140 Lisp_Object tail;
2141 struct buffer *buf = XBUFFER (buffer);
2142
2143 for (tail = Vselection_alist; CONSP (tail); tail = XCDR (tail))
2144 {
2145 Lisp_Object elt, value;
2146 elt = XCAR (tail);
2147 value = XCDR (elt);
2148 if (CONSP (value) && MARKERP (XCAR (value))
2149 && XMARKER (XCAR (value))->buffer == buf)
2150 Fx_disown_selection_internal (XCAR (elt), Qnil);
2151 }
2152}
2153
2154DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p, 2133DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p,
2155 0, 1, 0, 2134 0, 1, 0,
2156 doc: /* Whether the current Emacs process owns the given X Selection. 2135 doc: /* Whether the current Emacs process owns the given X Selection.
@@ -2455,7 +2434,6 @@ x_handle_dnd_message (struct frame *f, XClientMessageEvent *event, struct x_disp
2455 2434
2456 if (event->format == 32 && event->format < BITS_PER_LONG) 2435 if (event->format == 32 && event->format < BITS_PER_LONG)
2457 { 2436 {
2458 int i;
2459 for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */ 2437 for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */
2460 idata[i] = (int) event->data.l[i]; 2438 idata[i] = (int) event->data.l[i];
2461 data = (unsigned char *) idata; 2439 data = (unsigned char *) idata;
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 825cec451d9..f3879dbcec0 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -41,6 +41,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
41#include "process.h" 41#include "process.h"
42#include "keyboard.h" 42#include "keyboard.h"
43 43
44#ifndef HAVE_GTK3
45#define gdk_x11_set_sm_client_id(w) gdk_set_sm_client_id (w)
46#endif
47
44/* This is the event used when SAVE_SESSION_EVENT occurs. */ 48/* This is the event used when SAVE_SESSION_EVENT occurs. */
45 49
46static struct input_event emacs_event; 50static struct input_event emacs_event;
@@ -459,7 +463,7 @@ x_session_initialize (struct x_display_info *dpyinfo)
459#ifdef USE_GTK 463#ifdef USE_GTK
460 /* GTK creats a leader window by itself, but we need to tell 464 /* GTK creats a leader window by itself, but we need to tell
461 it about our client_id. */ 465 it about our client_id. */
462 gdk_set_sm_client_id (client_id); 466 gdk_x11_set_sm_client_id (client_id);
463#else 467#else
464 create_client_leader_window (dpyinfo, client_id); 468 create_client_leader_window (dpyinfo, client_id);
465#endif 469#endif
diff --git a/src/xterm.c b/src/xterm.c
index 909b6978f5a..fd7ffd68e62 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -279,10 +279,6 @@ Lisp_Object Qx_gtk_map_stock;
279/* Some functions take this as char *, not const char *. */ 279/* Some functions take this as char *, not const char *. */
280static char emacs_class[] = EMACS_CLASS; 280static char emacs_class[] = EMACS_CLASS;
281 281
282/* XEmbed implementation. */
283
284#define XEMBED_VERSION 0
285
286enum xembed_info 282enum xembed_info
287 { 283 {
288 XEMBED_MAPPED = 1 << 0 284 XEMBED_MAPPED = 1 << 0
@@ -321,6 +317,7 @@ static void XTframe_up_to_date (struct frame *);
321static void XTset_terminal_modes (struct terminal *); 317static void XTset_terminal_modes (struct terminal *);
322static void XTreset_terminal_modes (struct terminal *); 318static void XTreset_terminal_modes (struct terminal *);
323static void x_clear_frame (struct frame *); 319static void x_clear_frame (struct frame *);
320static void x_ins_del_lines (struct frame *, int, int) NO_RETURN;
324static void frame_highlight (struct frame *); 321static void frame_highlight (struct frame *);
325static void frame_unhighlight (struct frame *); 322static void frame_unhighlight (struct frame *);
326static void x_new_focus_frame (struct x_display_info *, struct frame *); 323static void x_new_focus_frame (struct x_display_info *, struct frame *);
@@ -877,6 +874,7 @@ static void x_draw_glyph_string_foreground (struct glyph_string *);
877static void x_draw_composite_glyph_string_foreground (struct glyph_string *); 874static void x_draw_composite_glyph_string_foreground (struct glyph_string *);
878static void x_draw_glyph_string_box (struct glyph_string *); 875static void x_draw_glyph_string_box (struct glyph_string *);
879static void x_draw_glyph_string (struct glyph_string *); 876static void x_draw_glyph_string (struct glyph_string *);
877static void x_delete_glyphs (struct frame *, int) NO_RETURN;
880static void x_compute_glyph_string_overhangs (struct glyph_string *); 878static void x_compute_glyph_string_overhangs (struct glyph_string *);
881static void x_set_cursor_gc (struct glyph_string *); 879static void x_set_cursor_gc (struct glyph_string *);
882static void x_set_mode_line_face_gc (struct glyph_string *); 880static void x_set_mode_line_face_gc (struct glyph_string *);
@@ -1791,27 +1789,6 @@ x_copy_color (struct frame *f, long unsigned int pixel)
1791} 1789}
1792 1790
1793 1791
1794/* Allocate color PIXEL on display DPY. PIXEL must already be allocated.
1795 It's necessary to do this instead of just using PIXEL directly to
1796 get color reference counts right. */
1797
1798unsigned long
1799x_copy_dpy_color (Display *dpy, Colormap cmap, long unsigned int pixel)
1800{
1801 XColor color;
1802
1803 color.pixel = pixel;
1804 BLOCK_INPUT;
1805 XQueryColor (dpy, cmap, &color);
1806 XAllocColor (dpy, cmap, &color);
1807 UNBLOCK_INPUT;
1808#ifdef DEBUG_X_COLORS
1809 register_color (pixel);
1810#endif
1811 return color.pixel;
1812}
1813
1814
1815/* Brightness beyond which a color won't have its highlight brightness 1792/* Brightness beyond which a color won't have its highlight brightness
1816 boosted. 1793 boosted.
1817 1794
@@ -2260,12 +2237,12 @@ x_draw_image_foreground (struct glyph_string *s)
2260 nothing here for mouse-face. */ 2237 nothing here for mouse-face. */
2261 if (s->hl == DRAW_CURSOR) 2238 if (s->hl == DRAW_CURSOR)
2262 { 2239 {
2263 int r = s->img->relief; 2240 int relief = s->img->relief;
2264 if (r < 0) r = -r; 2241 if (relief < 0) relief = -relief;
2265 XDrawRectangle (s->display, s->window, s->gc, 2242 XDrawRectangle (s->display, s->window, s->gc,
2266 x - r, y - r, 2243 x - relief, y - relief,
2267 s->slice.width + r*2 - 1, 2244 s->slice.width + relief*2 - 1,
2268 s->slice.height + r*2 - 1); 2245 s->slice.height + relief*2 - 1);
2269 } 2246 }
2270 } 2247 }
2271 } 2248 }
@@ -2907,7 +2884,7 @@ x_draw_glyph_string (struct glyph_string *s)
2907 2884
2908/* Shift display to make room for inserted glyphs. */ 2885/* Shift display to make room for inserted glyphs. */
2909 2886
2910void 2887static void
2911x_shift_glyphs_for_insert (struct frame *f, int x, int y, int width, int height, int shift_by) 2888x_shift_glyphs_for_insert (struct frame *f, int x, int y, int width, int height, int shift_by)
2912{ 2889{
2913 XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), FRAME_X_WINDOW (f), 2890 XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), FRAME_X_WINDOW (f),
@@ -3011,7 +2988,7 @@ timeval_subtract (struct timeval *result, struct timeval x, struct timeval y)
3011 return x.tv_sec < y.tv_sec; 2988 return x.tv_sec < y.tv_sec;
3012} 2989}
3013 2990
3014void 2991static void
3015XTflash (struct frame *f) 2992XTflash (struct frame *f)
3016{ 2993{
3017 BLOCK_INPUT; 2994 BLOCK_INPUT;
@@ -3021,6 +2998,17 @@ XTflash (struct frame *f)
3021 /* Use Gdk routines to draw. This way, we won't draw over scroll bars 2998 /* Use Gdk routines to draw. This way, we won't draw over scroll bars
3022 when the scroll bars and the edit widget share the same X window. */ 2999 when the scroll bars and the edit widget share the same X window. */
3023 GdkWindow *window = gtk_widget_get_window (FRAME_GTK_WIDGET (f)); 3000 GdkWindow *window = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
3001#ifdef HAVE_GTK3
3002 cairo_t *cr = gdk_cairo_create (window);
3003 cairo_set_source_rgb (cr, 1, 1, 1);
3004 cairo_set_operator (cr, CAIRO_OPERATOR_DIFFERENCE);
3005#define XFillRectangle(d, win, gc, x, y, w, h) \
3006 do { \
3007 cairo_rectangle (cr, x, y, w, h); \
3008 cairo_fill (cr); \
3009 } \
3010 while (0)
3011#else /* ! HAVE_GTK3 */
3024 GdkGCValues vals; 3012 GdkGCValues vals;
3025 GdkGC *gc; 3013 GdkGC *gc;
3026 vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f) 3014 vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f)
@@ -3030,7 +3018,8 @@ XTflash (struct frame *f)
3030 &vals, GDK_GC_FUNCTION | GDK_GC_FOREGROUND); 3018 &vals, GDK_GC_FUNCTION | GDK_GC_FOREGROUND);
3031#define XFillRectangle(d, win, gc, x, y, w, h) \ 3019#define XFillRectangle(d, win, gc, x, y, w, h) \
3032 gdk_draw_rectangle (window, gc, TRUE, x, y, w, h) 3020 gdk_draw_rectangle (window, gc, TRUE, x, y, w, h)
3033#else 3021#endif /* ! HAVE_GTK3 */
3022#else /* ! USE_GTK */
3034 GC gc; 3023 GC gc;
3035 3024
3036 /* Create a GC that will use the GXxor function to flip foreground 3025 /* Create a GC that will use the GXxor function to flip foreground
@@ -3151,7 +3140,11 @@ XTflash (struct frame *f)
3151 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); 3140 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
3152 3141
3153#ifdef USE_GTK 3142#ifdef USE_GTK
3143#ifdef HAVE_GTK3
3144 cairo_destroy (cr);
3145#else
3154 g_object_unref (G_OBJECT (gc)); 3146 g_object_unref (G_OBJECT (gc));
3147#endif
3155#undef XFillRectangle 3148#undef XFillRectangle
3156#else 3149#else
3157 XFreeGC (FRAME_X_DISPLAY (f), gc); 3150 XFreeGC (FRAME_X_DISPLAY (f), gc);
@@ -3186,7 +3179,7 @@ XTtoggle_invisible_pointer (FRAME_PTR f, int invisible)
3186 3179
3187/* Make audible bell. */ 3180/* Make audible bell. */
3188 3181
3189void 3182static void
3190XTring_bell (struct frame *f) 3183XTring_bell (struct frame *f)
3191{ 3184{
3192 if (FRAME_X_DISPLAY (f)) 3185 if (FRAME_X_DISPLAY (f))
@@ -3800,7 +3793,7 @@ redo_mouse_highlight (void)
3800 mouse is on, *BAR_WINDOW to nil, and *X and *Y to the character cell 3793 mouse is on, *BAR_WINDOW to nil, and *X and *Y to the character cell
3801 the mouse is over. 3794 the mouse is over.
3802 3795
3803 Set *TIME to the server time-stamp for the time at which the mouse 3796 Set *TIMESTAMP to the server time-stamp for the time at which the mouse
3804 was at this position. 3797 was at this position.
3805 3798
3806 Don't store anything if we don't have a valid set of values to report. 3799 Don't store anything if we don't have a valid set of values to report.
@@ -3809,14 +3802,16 @@ redo_mouse_highlight (void)
3809 movement. */ 3802 movement. */
3810 3803
3811static void 3804static void
3812XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, long unsigned int *time) 3805XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
3806 enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y,
3807 long unsigned int *timestamp)
3813{ 3808{
3814 FRAME_PTR f1; 3809 FRAME_PTR f1;
3815 3810
3816 BLOCK_INPUT; 3811 BLOCK_INPUT;
3817 3812
3818 if (! NILP (last_mouse_scroll_bar) && insist == 0) 3813 if (! NILP (last_mouse_scroll_bar) && insist == 0)
3819 x_scroll_bar_report_motion (fp, bar_window, part, x, y, time); 3814 x_scroll_bar_report_motion (fp, bar_window, part, x, y, timestamp);
3820 else 3815 else
3821 { 3816 {
3822 Window root; 3817 Window root;
@@ -3989,7 +3984,7 @@ XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, enum scrol
3989 *fp = f1; 3984 *fp = f1;
3990 XSETINT (*x, win_x); 3985 XSETINT (*x, win_x);
3991 XSETINT (*y, win_y); 3986 XSETINT (*y, win_y);
3992 *time = last_mouse_movement_time; 3987 *timestamp = last_mouse_movement_time;
3993 } 3988 }
3994 } 3989 }
3995 } 3990 }
@@ -5541,7 +5536,9 @@ x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event)
5541 on the scroll bar. */ 5536 on the scroll bar. */
5542 5537
5543static void 5538static void
5544x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, long unsigned int *time) 5539x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window,
5540 enum scroll_bar_part *part, Lisp_Object *x,
5541 Lisp_Object *y, long unsigned int *timestamp)
5545{ 5542{
5546 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); 5543 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
5547 Window w = bar->x_window; 5544 Window w = bar->x_window;
@@ -5601,7 +5598,7 @@ x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, enum scroll_
5601 last_mouse_scroll_bar = Qnil; 5598 last_mouse_scroll_bar = Qnil;
5602 } 5599 }
5603 5600
5604 *time = last_mouse_movement_time; 5601 *timestamp = last_mouse_movement_time;
5605 5602
5606 UNBLOCK_INPUT; 5603 UNBLOCK_INPUT;
5607} 5604}
@@ -5775,7 +5772,8 @@ static void xembed_send_message (struct frame *f, Time time,
5775 We return the number of characters stored into the buffer. */ 5772 We return the number of characters stored into the buffer. */
5776 5773
5777static int 5774static int
5778handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, struct input_event *hold_quit) 5775handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
5776 int *finish, struct input_event *hold_quit)
5779{ 5777{
5780 union { 5778 union {
5781 struct input_event ie; 5779 struct input_event ie;
@@ -5786,7 +5784,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish,
5786 int nbytes = 0; 5784 int nbytes = 0;
5787 struct frame *f = NULL; 5785 struct frame *f = NULL;
5788 struct coding_system coding; 5786 struct coding_system coding;
5789 XEvent event = *eventp; 5787 XEvent event = *eventptr;
5790 Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; 5788 Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
5791 5789
5792 *finish = X_EVENT_NORMAL; 5790 *finish = X_EVENT_NORMAL;
@@ -6486,7 +6484,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish,
6486 6484
6487 { /* Raw bytes, not keysym. */ 6485 { /* Raw bytes, not keysym. */
6488 register int i; 6486 register int i;
6489 register int c;
6490 int nchars, len; 6487 int nchars, len;
6491 6488
6492 for (i = 0, nchars = 0; i < nbytes; i++) 6489 for (i = 0, nchars = 0; i < nbytes; i++)
@@ -6526,14 +6523,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish,
6526 character events. */ 6523 character events. */
6527 for (i = 0; i < nbytes; i += len) 6524 for (i = 0; i < nbytes; i += len)
6528 { 6525 {
6526 int ch;
6529 if (nchars == nbytes) 6527 if (nchars == nbytes)
6530 c = copy_bufptr[i], len = 1; 6528 ch = copy_bufptr[i], len = 1;
6531 else 6529 else
6532 c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, len); 6530 ch = STRING_CHAR_AND_LENGTH (copy_bufptr + i, len);
6533 inev.ie.kind = (SINGLE_BYTE_CHAR_P (c) 6531 inev.ie.kind = (SINGLE_BYTE_CHAR_P (ch)
6534 ? ASCII_KEYSTROKE_EVENT 6532 ? ASCII_KEYSTROKE_EVENT
6535 : MULTIBYTE_CHAR_KEYSTROKE_EVENT); 6533 : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
6536 inev.ie.code = c; 6534 inev.ie.code = ch;
6537 kbd_buffer_store_event_hold (&inev.ie, hold_quit); 6535 kbd_buffer_store_event_hold (&inev.ie, hold_quit);
6538 } 6536 }
6539 6537
@@ -6972,7 +6970,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish,
6972 count++; 6970 count++;
6973 } 6971 }
6974 6972
6975 *eventp = event; 6973 *eventptr = event;
6976 return count; 6974 return count;
6977} 6975}
6978 6976
@@ -7012,7 +7010,6 @@ static int
7012XTread_socket (struct terminal *terminal, int expected, struct input_event *hold_quit) 7010XTread_socket (struct terminal *terminal, int expected, struct input_event *hold_quit)
7013{ 7011{
7014 int count = 0; 7012 int count = 0;
7015 XEvent event;
7016 int event_found = 0; 7013 int event_found = 0;
7017 7014
7018 if (interrupt_input_blocked) 7015 if (interrupt_input_blocked)
@@ -7046,6 +7043,7 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold
7046 while (XPending (terminal->display_info.x->display)) 7043 while (XPending (terminal->display_info.x->display))
7047 { 7044 {
7048 int finish; 7045 int finish;
7046 XEvent event;
7049 7047
7050 XNextEvent (terminal->display_info.x->display, &event); 7048 XNextEvent (terminal->display_info.x->display, &event);
7051 7049
@@ -7063,6 +7061,8 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold
7063 goto out; 7061 goto out;
7064 } 7062 }
7065 7063
7064 out:;
7065
7066#else /* USE_GTK */ 7066#else /* USE_GTK */
7067 7067
7068 /* For GTK we must use the GTK event loop. But XEvents gets passed 7068 /* For GTK we must use the GTK event loop. But XEvents gets passed
@@ -7089,8 +7089,6 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold
7089 } 7089 }
7090#endif /* USE_GTK */ 7090#endif /* USE_GTK */
7091 7091
7092 out:;
7093
7094 /* On some systems, an X bug causes Emacs to get no more events 7092 /* On some systems, an X bug causes Emacs to get no more events
7095 when the window is destroyed. Detect that. (1994.) */ 7093 when the window is destroyed. Detect that. (1994.) */
7096 if (! event_found) 7094 if (! event_found)
@@ -7226,9 +7224,9 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text
7226 the bar might not be in the window. */ 7224 the bar might not be in the window. */
7227 if (cursor_glyph->type == IMAGE_GLYPH) 7225 if (cursor_glyph->type == IMAGE_GLYPH)
7228 { 7226 {
7229 struct glyph_row *row; 7227 struct glyph_row *r;
7230 row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos); 7228 r = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos);
7231 draw_phys_cursor_glyph (w, row, DRAW_CURSOR); 7229 draw_phys_cursor_glyph (w, r, DRAW_CURSOR);
7232 } 7230 }
7233 else 7231 else
7234 { 7232 {
@@ -7517,9 +7515,9 @@ static struct x_error_message_stack *x_error_message;
7517 x_catch_errors is in effect. */ 7515 x_catch_errors is in effect. */
7518 7516
7519static void 7517static void
7520x_error_catcher (Display *display, XErrorEvent *error) 7518x_error_catcher (Display *display, XErrorEvent *event)
7521{ 7519{
7522 XGetErrorText (display, error->error_code, 7520 XGetErrorText (display, event->error_code,
7523 x_error_message->string, 7521 x_error_message->string,
7524 X_ERROR_MESSAGE_SIZE); 7522 X_ERROR_MESSAGE_SIZE);
7525} 7523}
@@ -7668,17 +7666,6 @@ x_connection_signal (int signalnum) /* If we don't have an argument, */
7668 7666
7669static char *error_msg; 7667static char *error_msg;
7670 7668
7671/* Function installed as fatal_error_signal_hook in
7672 x_connection_closed. Print the X error message, and exit normally,
7673 instead of dumping core when XtCloseDisplay fails. */
7674
7675static void
7676x_fatal_error_signal (void)
7677{
7678 fprintf (stderr, "%s\n", error_msg);
7679 exit (70);
7680}
7681
7682/* Handle the loss of connection to display DPY. ERROR_MESSAGE is 7669/* Handle the loss of connection to display DPY. ERROR_MESSAGE is
7683 the text of an error message that lead to the connection loss. */ 7670 the text of an error message that lead to the connection loss. */
7684 7671
@@ -7687,7 +7674,7 @@ x_connection_closed (Display *dpy, const char *error_message)
7687{ 7674{
7688 struct x_display_info *dpyinfo = x_display_info_for_display (dpy); 7675 struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
7689 Lisp_Object frame, tail; 7676 Lisp_Object frame, tail;
7690 int index = SPECPDL_INDEX (); 7677 int idx = SPECPDL_INDEX ();
7691 7678
7692 error_msg = (char *) alloca (strlen (error_message) + 1); 7679 error_msg = (char *) alloca (strlen (error_message) + 1);
7693 strcpy (error_msg, error_message); 7680 strcpy (error_msg, error_message);
@@ -7782,8 +7769,12 @@ For details, see etc/PROBLEMS.\n",
7782 sigunblock (sigmask (SIGALRM)); 7769 sigunblock (sigmask (SIGALRM));
7783 TOTALLY_UNBLOCK_INPUT; 7770 TOTALLY_UNBLOCK_INPUT;
7784 7771
7785 unbind_to (index, Qnil); 7772 unbind_to (idx, Qnil);
7786 clear_waiting_for_input (); 7773 clear_waiting_for_input ();
7774
7775 /* Tell GCC not to suggest attribute 'noreturn' for this function. */
7776 IF_LINT (if (! terminal_list) return; )
7777
7787 /* Here, we absolutely have to use a non-local exit (e.g. signal, throw, 7778 /* Here, we absolutely have to use a non-local exit (e.g. signal, throw,
7788 longjmp), because returning from this function would get us back into 7779 longjmp), because returning from this function would get us back into
7789 Xlib's code which will directly call `exit'. */ 7780 Xlib's code which will directly call `exit'. */
@@ -7798,12 +7789,12 @@ static void x_error_quitter (Display *, XErrorEvent *);
7798 It calls x_error_quitter or x_error_catcher. */ 7789 It calls x_error_quitter or x_error_catcher. */
7799 7790
7800static int 7791static int
7801x_error_handler (Display *display, XErrorEvent *error) 7792x_error_handler (Display *display, XErrorEvent *event)
7802{ 7793{
7803 if (x_error_message) 7794 if (x_error_message)
7804 x_error_catcher (display, error); 7795 x_error_catcher (display, event);
7805 else 7796 else
7806 x_error_quitter (display, error); 7797 x_error_quitter (display, event);
7807 return 0; 7798 return 0;
7808} 7799}
7809 7800
@@ -7817,22 +7808,22 @@ x_error_handler (Display *display, XErrorEvent *error)
7817 after x_error_handler prevents inlining into the former. */ 7808 after x_error_handler prevents inlining into the former. */
7818 7809
7819static void NO_INLINE 7810static void NO_INLINE
7820x_error_quitter (Display *display, XErrorEvent *error) 7811x_error_quitter (Display *display, XErrorEvent *event)
7821{ 7812{
7822 char buf[256], buf1[356]; 7813 char buf[256], buf1[356];
7823 7814
7824 /* Ignore BadName errors. They can happen because of fonts 7815 /* Ignore BadName errors. They can happen because of fonts
7825 or colors that are not defined. */ 7816 or colors that are not defined. */
7826 7817
7827 if (error->error_code == BadName) 7818 if (event->error_code == BadName)
7828 return; 7819 return;
7829 7820
7830 /* Note that there is no real way portable across R3/R4 to get the 7821 /* Note that there is no real way portable across R3/R4 to get the
7831 original error handler. */ 7822 original error handler. */
7832 7823
7833 XGetErrorText (display, error->error_code, buf, sizeof (buf)); 7824 XGetErrorText (display, event->error_code, buf, sizeof (buf));
7834 sprintf (buf1, "X protocol error: %s on protocol request %d", 7825 sprintf (buf1, "X protocol error: %s on protocol request %d",
7835 buf, error->request_code); 7826 buf, event->request_code);
7836 x_connection_closed (display, buf1); 7827 x_connection_closed (display, buf1);
7837} 7828}
7838 7829
@@ -8119,7 +8110,7 @@ xim_close_dpy (struct x_display_info *dpyinfo)
8119/* Calculate the absolute position in frame F 8110/* Calculate the absolute position in frame F
8120 from its current recorded position values and gravity. */ 8111 from its current recorded position values and gravity. */
8121 8112
8122void 8113static void
8123x_calc_absolute_position (struct frame *f) 8114x_calc_absolute_position (struct frame *f)
8124{ 8115{
8125 int flags = f->size_hint_flags; 8116 int flags = f->size_hint_flags;
@@ -8862,31 +8853,6 @@ x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
8862 UNBLOCK_INPUT; 8853 UNBLOCK_INPUT;
8863} 8854}
8864 8855
8865/* focus shifting, raising and lowering. */
8866
8867void
8868x_focus_on_frame (struct frame *f)
8869{
8870#if 0
8871 /* I don't think that the ICCCM allows programs to do things like this
8872 without the interaction of the window manager. Whatever you end up
8873 doing with this code, do it to x_unfocus_frame too. */
8874 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
8875 RevertToPointerRoot, CurrentTime);
8876#endif /* ! 0 */
8877}
8878
8879void
8880x_unfocus_frame (struct frame *f)
8881{
8882#if 0
8883 /* Look at the remarks in x_focus_on_frame. */
8884 if (FRAME_X_DISPLAY_INFO (f)->x_focus_frame == f)
8885 XSetInputFocus (FRAME_X_DISPLAY (f), PointerRoot,
8886 RevertToPointerRoot, CurrentTime);
8887#endif /* ! 0 */
8888}
8889
8890/* Raise frame F. */ 8856/* Raise frame F. */
8891 8857
8892void 8858void
@@ -8947,6 +8913,12 @@ XTframe_raise_lower (FRAME_PTR f, int raise_flag)
8947 8913
8948/* XEmbed implementation. */ 8914/* XEmbed implementation. */
8949 8915
8916#if defined USE_X_TOOLKIT || ! defined USE_GTK
8917
8918/* XEmbed implementation. */
8919
8920#define XEMBED_VERSION 0
8921
8950static void 8922static void
8951xembed_set_info (struct frame *f, enum xembed_info flags) 8923xembed_set_info (struct frame *f, enum xembed_info flags)
8952{ 8924{
@@ -8960,9 +8932,11 @@ xembed_set_info (struct frame *f, enum xembed_info flags)
8960 dpyinfo->Xatom_XEMBED_INFO, dpyinfo->Xatom_XEMBED_INFO, 8932 dpyinfo->Xatom_XEMBED_INFO, dpyinfo->Xatom_XEMBED_INFO,
8961 32, PropModeReplace, (unsigned char *) data, 2); 8933 32, PropModeReplace, (unsigned char *) data, 2);
8962} 8934}
8935#endif /* defined USE_X_TOOLKIT || ! defined USE_GTK */
8963 8936
8964static void 8937static void
8965xembed_send_message (struct frame *f, Time time, enum xembed_message message, long int detail, long int data1, long int data2) 8938xembed_send_message (struct frame *f, Time t, enum xembed_message msg,
8939 long int detail, long int data1, long int data2)
8966{ 8940{
8967 XEvent event; 8941 XEvent event;
8968 8942
@@ -8970,8 +8944,8 @@ xembed_send_message (struct frame *f, Time time, enum xembed_message message, lo
8970 event.xclient.window = FRAME_X_OUTPUT (f)->parent_desc; 8944 event.xclient.window = FRAME_X_OUTPUT (f)->parent_desc;
8971 event.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_XEMBED; 8945 event.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_XEMBED;
8972 event.xclient.format = 32; 8946 event.xclient.format = 32;
8973 event.xclient.data.l[0] = time; 8947 event.xclient.data.l[0] = t;
8974 event.xclient.data.l[1] = message; 8948 event.xclient.data.l[1] = msg;
8975 event.xclient.data.l[2] = detail; 8949 event.xclient.data.l[2] = detail;
8976 event.xclient.data.l[3] = data1; 8950 event.xclient.data.l[3] = data1;
8977 event.xclient.data.l[4] = data2; 8951 event.xclient.data.l[4] = data2;
@@ -9212,7 +9186,9 @@ x_make_frame_invisible (struct frame *f)
9212void 9186void
9213x_iconify_frame (struct frame *f) 9187x_iconify_frame (struct frame *f)
9214{ 9188{
9189#ifdef USE_X_TOOLKIT
9215 int result; 9190 int result;
9191#endif
9216 Lisp_Object type; 9192 Lisp_Object type;
9217 9193
9218 /* Don't keep the highlight on an invisible frame. */ 9194 /* Don't keep the highlight on an invisible frame. */
@@ -9295,19 +9271,19 @@ x_iconify_frame (struct frame *f)
9295 /* X11R4: send a ClientMessage to the window manager using the 9271 /* X11R4: send a ClientMessage to the window manager using the
9296 WM_CHANGE_STATE type. */ 9272 WM_CHANGE_STATE type. */
9297 { 9273 {
9298 XEvent message; 9274 XEvent msg;
9299 9275
9300 message.xclient.window = FRAME_X_WINDOW (f); 9276 msg.xclient.window = FRAME_X_WINDOW (f);
9301 message.xclient.type = ClientMessage; 9277 msg.xclient.type = ClientMessage;
9302 message.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_change_state; 9278 msg.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_change_state;
9303 message.xclient.format = 32; 9279 msg.xclient.format = 32;
9304 message.xclient.data.l[0] = IconicState; 9280 msg.xclient.data.l[0] = IconicState;
9305 9281
9306 if (! XSendEvent (FRAME_X_DISPLAY (f), 9282 if (! XSendEvent (FRAME_X_DISPLAY (f),
9307 DefaultRootWindow (FRAME_X_DISPLAY (f)), 9283 DefaultRootWindow (FRAME_X_DISPLAY (f)),
9308 False, 9284 False,
9309 SubstructureRedirectMask | SubstructureNotifyMask, 9285 SubstructureRedirectMask | SubstructureNotifyMask,
9310 &message)) 9286 &msg))
9311 { 9287 {
9312 UNBLOCK_INPUT_RESIGNAL; 9288 UNBLOCK_INPUT_RESIGNAL;
9313 error ("Can't notify window manager of iconification"); 9289 error ("Can't notify window manager of iconification");
@@ -9339,9 +9315,11 @@ void
9339x_free_frame_resources (struct frame *f) 9315x_free_frame_resources (struct frame *f)
9340{ 9316{
9341 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9317 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
9318 Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
9319#ifdef USE_X_TOOLKIT
9342 Lisp_Object bar; 9320 Lisp_Object bar;
9343 struct scroll_bar *b; 9321 struct scroll_bar *b;
9344 Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; 9322#endif
9345 9323
9346 BLOCK_INPUT; 9324 BLOCK_INPUT;
9347 9325
@@ -9797,10 +9775,11 @@ x_display_ok (const char *display)
9797 9775
9798#ifdef USE_GTK 9776#ifdef USE_GTK
9799static void 9777static void
9800my_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) 9778my_log_handler (const gchar *log_domain, GLogLevelFlags log_level,
9779 const gchar *msg, gpointer user_data)
9801{ 9780{
9802 if (!strstr (message, "g_set_prgname")) 9781 if (!strstr (msg, "g_set_prgname"))
9803 fprintf (stderr, "%s-WARNING **: %s\n", log_domain, message); 9782 fprintf (stderr, "%s-WARNING **: %s\n", log_domain, msg);
9804} 9783}
9805#endif 9784#endif
9806 9785
@@ -9863,6 +9842,13 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
9863 9842
9864 XSetLocaleModifiers (""); 9843 XSetLocaleModifiers ("");
9865 9844
9845 /* Emacs can only handle core input events, so make sure
9846 Gtk doesn't use Xinput or Xinput2 extensions. */
9847 {
9848 static char fix_events[] = "GDK_CORE_DEVICE_EVENTS=1";
9849 putenv (fix_events);
9850 }
9851
9866 /* Work around GLib bug that outputs a faulty warning. See 9852 /* Work around GLib bug that outputs a faulty warning. See
9867 https://bugzilla.gnome.org/show_bug.cgi?id=563627. */ 9853 https://bugzilla.gnome.org/show_bug.cgi?id=563627. */
9868 id = g_log_set_handler ("GLib", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL 9854 id = g_log_set_handler ("GLib", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
@@ -9874,11 +9860,12 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
9874 fixup_locale (); 9860 fixup_locale ();
9875 xg_initialize (); 9861 xg_initialize ();
9876 9862
9877 dpy = GDK_DISPLAY (); 9863 dpy = DEFAULT_GDK_DISPLAY ();
9878 9864
9879 /* NULL window -> events for all windows go to our function */ 9865 /* NULL window -> events for all windows go to our function */
9880 gdk_window_add_filter (NULL, event_handler_gdk, NULL); 9866 gdk_window_add_filter (NULL, event_handler_gdk, NULL);
9881 9867
9868#if GTK_MAJOR_VERSION <= 2 && GTK_MINOR_VERSION <= 90
9882 /* Load our own gtkrc if it exists. */ 9869 /* Load our own gtkrc if it exists. */
9883 { 9870 {
9884 const char *file = "~/.emacs.d/gtkrc"; 9871 const char *file = "~/.emacs.d/gtkrc";
@@ -9890,6 +9877,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
9890 if (! NILP (abs_file) && !NILP (Ffile_readable_p (abs_file))) 9877 if (! NILP (abs_file) && !NILP (Ffile_readable_p (abs_file)))
9891 gtk_rc_parse (SSDATA (abs_file)); 9878 gtk_rc_parse (SSDATA (abs_file));
9892 } 9879 }
9880#endif
9893 9881
9894 XSetErrorHandler (x_error_handler); 9882 XSetErrorHandler (x_error_handler);
9895 XSetIOErrorHandler (x_io_error_quitter); 9883 XSetIOErrorHandler (x_io_error_quitter);
diff --git a/src/xterm.h b/src/xterm.h
index 48d68557796..15630e902e5 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -675,9 +675,20 @@ enum
675#define gtk_adjustment_get_upper(w) ((w)->upper) 675#define gtk_adjustment_get_upper(w) ((w)->upper)
676#endif 676#endif
677 677
678#ifdef HAVE_GTK3
679#define DEFAULT_GDK_DISPLAY() \
680 gdk_x11_display_get_xdisplay (gdk_display_get_default ())
681#else
682#undef GDK_WINDOW_XID
683#define GDK_WINDOW_XID(w) GDK_WINDOW_XWINDOW (w)
684#define DEFAULT_GDK_DISPLAY() GDK_DISPLAY ()
685#define gtk_widget_get_preferred_size(a, ign, b) \
686 gtk_widget_size_request(a, b)
687#endif
688
678#define GTK_WIDGET_TO_X_WIN(w) \ 689#define GTK_WIDGET_TO_X_WIN(w) \
679 ((w) && gtk_widget_get_window (w) \ 690 ((w) && gtk_widget_get_window (w) \
680 ? GDK_WINDOW_XWINDOW (gtk_widget_get_window (w)) : 0) 691 ? GDK_WINDOW_XID (gtk_widget_get_window (w)) : 0)
681 692
682#define FRAME_GTK_OUTER_WIDGET(f) ((f)->output_data.x->widget) 693#define FRAME_GTK_OUTER_WIDGET(f) ((f)->output_data.x->widget)
683#define FRAME_GTK_WIDGET(f) ((f)->output_data.x->edit_widget) 694#define FRAME_GTK_WIDGET(f) ((f)->output_data.x->edit_widget)
@@ -979,6 +990,7 @@ extern int x_alloc_nearest_color (struct frame *, Colormap, XColor *);
979extern void x_query_colors (struct frame *f, XColor *, int); 990extern void x_query_colors (struct frame *f, XColor *, int);
980extern void x_query_color (struct frame *f, XColor *); 991extern void x_query_color (struct frame *f, XColor *);
981extern void x_clear_area (Display *, Window, int, int, int, int, int); 992extern void x_clear_area (Display *, Window, int, int, int, int, int);
993extern void x_mouse_leave (struct x_display_info *);
982extern void set_vertical_scroll_bar (struct window *); 994extern void set_vertical_scroll_bar (struct window *);
983 995
984extern int x_dispatch_event (XEvent *, Display *); 996extern int x_dispatch_event (XEvent *, Display *);