aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/ChangeLog6
-rw-r--r--admin/FOR-RELEASE16
-rw-r--r--admin/nt/README-ftp-server40
-rwxr-xr-xadmin/nt/makedist.bat4
-rw-r--r--etc/ChangeLog5
-rw-r--r--etc/GNUS-NEWS4
-rw-r--r--etc/NEWS8
-rw-r--r--etc/NEWS.1-172
-rw-r--r--etc/NEWS.194
-rw-r--r--etc/NEWS.212
-rw-r--r--etc/NEWS.2219
-rw-r--r--etc/TODO2
-rw-r--r--lib-src/etags.c4
-rw-r--r--lisp/ChangeLog423
-rw-r--r--lisp/abbrev.el6
-rw-r--r--lisp/allout.el5
-rw-r--r--lisp/autorevert.el26
-rw-r--r--lisp/bindings.el2
-rw-r--r--lisp/calc/calc-nlfit.el817
-rw-r--r--lisp/calc/calc-units.el14
-rw-r--r--lisp/calc/calcalg3.el212
-rw-r--r--lisp/calendar/calendar.el2
-rw-r--r--lisp/complete.el77
-rw-r--r--lisp/custom.el10
-rw-r--r--lisp/diff-mode.el79
-rw-r--r--lisp/diff.el3
-rw-r--r--lisp/dired-aux.el4
-rw-r--r--lisp/dired.el4
-rw-r--r--lisp/double.el3
-rw-r--r--lisp/ediff-diff.el4
-rw-r--r--lisp/emacs-lisp/autoload.el2
-rw-r--r--lisp/emacs-lisp/backquote.el54
-rw-r--r--lisp/emacs-lisp/byte-opt.el2
-rw-r--r--lisp/emacs-lisp/checkdoc.el3
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el6
-rw-r--r--lisp/emacs-lisp/easymenu.el2
-rw-r--r--lisp/emacs-lisp/eldoc.el9
-rw-r--r--lisp/emacs-lisp/rx.el2
-rw-r--r--lisp/emacs-lisp/unsafep.el2
-rw-r--r--lisp/emulation/tpu-edt.el8
-rw-r--r--lisp/emulation/tpu-extras.el70
-rw-r--r--lisp/emulation/vi.el2
-rw-r--r--lisp/erc/ChangeLog4
-rw-r--r--lisp/erc/erc-log.el2
-rw-r--r--lisp/erc/erc.el12
-rw-r--r--lisp/files.el16
-rw-r--r--lisp/font-lock.el6
-rw-r--r--lisp/format.el35
-rw-r--r--lisp/frame.el6
-rw-r--r--lisp/gnus/ChangeLog20
-rw-r--r--lisp/gnus/gmm-utils.el2
-rw-r--r--lisp/gnus/gnus-art.el2
-rw-r--r--lisp/gnus/gnus-async.el2
-rw-r--r--lisp/gnus/gnus-ems.el2
-rw-r--r--lisp/gnus/gnus-msg.el8
-rw-r--r--lisp/gnus/gnus-score.el2
-rw-r--r--lisp/gnus/gnus-util.el2
-rw-r--r--lisp/gnus/imap.el2
-rw-r--r--lisp/gnus/mailcap.el6
-rw-r--r--lisp/gnus/nnimap.el2
-rw-r--r--lisp/gnus/nntp.el11
-rw-r--r--lisp/help-mode.el10
-rw-r--r--lisp/help.el4
-rw-r--r--lisp/hilit-chg.el2
-rw-r--r--lisp/ibuf-ext.el2
-rw-r--r--lisp/ibuffer.el4
-rw-r--r--lisp/icomplete.el5
-rw-r--r--lisp/ido.el2
-rw-r--r--lisp/image.el2
-rw-r--r--lisp/imenu.el2
-rw-r--r--lisp/info-look.el2
-rw-r--r--lisp/international/ja-dic-cnv.el4
-rw-r--r--lisp/international/latin1-disp.el4
-rw-r--r--lisp/international/mule-cmds.el10
-rw-r--r--lisp/international/quail.el31
-rw-r--r--lisp/isearch.el4
-rw-r--r--lisp/iswitchb.el6
-rw-r--r--lisp/log-edit.el2
-rw-r--r--lisp/log-view.el1
-rw-r--r--lisp/longlines.el14
-rw-r--r--lisp/mail/mailabbrev.el2
-rw-r--r--lisp/mail/mspools.el2
-rw-r--r--lisp/mail/rmail.el4
-rw-r--r--lisp/man.el146
-rw-r--r--lisp/menu-bar.el2
-rw-r--r--lisp/mh-e/ChangeLog5
-rw-r--r--lisp/mh-e/mh-folder.el2
-rw-r--r--lisp/mh-e/mh-letter.el2
-rw-r--r--lisp/mh-e/mh-show.el2
-rw-r--r--lisp/mouse-drag.el2
-rw-r--r--lisp/mouse.el38
-rw-r--r--lisp/net/ange-ftp.el7
-rw-r--r--lisp/net/telnet.el2
-rw-r--r--lisp/net/tramp-cache.el5
-rw-r--r--lisp/net/tramp.el49
-rw-r--r--lisp/obsolete/fast-lock.el2
-rw-r--r--lisp/pcvs-util.el3
-rw-r--r--lisp/pcvs.el11
-rw-r--r--lisp/printing.el24
-rw-r--r--lisp/progmodes/antlr-mode.el6
-rw-r--r--lisp/progmodes/cc-awk.el2
-rw-r--r--lisp/progmodes/cc-engine.el2
-rw-r--r--lisp/progmodes/cc-vars.el2
-rw-r--r--lisp/progmodes/compile.el21
-rw-r--r--lisp/progmodes/cperl-mode.el22
-rw-r--r--lisp/progmodes/cpp.el6
-rw-r--r--lisp/progmodes/etags.el8
-rw-r--r--lisp/progmodes/flymake.el2
-rw-r--r--lisp/progmodes/fortran.el2
-rw-r--r--lisp/progmodes/gdb-ui.el12
-rw-r--r--lisp/progmodes/gud.el6
-rw-r--r--lisp/progmodes/hideshow.el6
-rw-r--r--lisp/progmodes/octave-mod.el10
-rw-r--r--lisp/progmodes/python.el8
-rw-r--r--lisp/progmodes/sh-script.el1
-rw-r--r--lisp/progmodes/tcl.el2
-rw-r--r--lisp/progmodes/which-func.el2
-rw-r--r--lisp/progmodes/xscheme.el4
-rw-r--r--lisp/ps-print.el15
-rw-r--r--lisp/select.el2
-rw-r--r--lisp/shadowfile.el2
-rw-r--r--lisp/simple.el101
-rw-r--r--lisp/skeleton.el4
-rw-r--r--lisp/strokes.el4
-rw-r--r--lisp/subr.el19
-rw-r--r--lisp/t-mouse.el3
-rw-r--r--lisp/term.el37
-rw-r--r--lisp/term/mac-win.el19
-rw-r--r--lisp/term/sun-mouse.el2
-rw-r--r--lisp/term/tvi970.el4
-rw-r--r--lisp/textmodes/artist.el2
-rw-r--r--lisp/textmodes/flyspell.el5
-rw-r--r--lisp/textmodes/ispell.el3
-rw-r--r--lisp/textmodes/nroff-mode.el2
-rw-r--r--lisp/textmodes/refill.el2
-rw-r--r--lisp/textmodes/reftex-global.el2
-rw-r--r--lisp/textmodes/sgml-mode.el2
-rw-r--r--lisp/textmodes/tex-mode.el14
-rw-r--r--lisp/textmodes/two-column.el14
-rw-r--r--lisp/url/ChangeLog5
-rw-r--r--lisp/url/url-auth.el10
-rw-r--r--lisp/url/url-cache.el2
-rw-r--r--lisp/url/url-dav.el6
-rw-r--r--lisp/url/url-file.el2
-rw-r--r--lisp/url/vc-dav.el2
-rw-r--r--lisp/userlock.el2
-rw-r--r--lisp/vc-bzr.el235
-rw-r--r--lisp/vc-hooks.el15
-rw-r--r--lisp/vc-rcs.el8
-rw-r--r--lisp/vc.el29
-rw-r--r--lisp/view.el3
-rw-r--r--lisp/whitespace.el2
-rw-r--r--lisp/wid-edit.el6
-rw-r--r--lisp/window.el10
-rw-r--r--lisp/winner.el5
-rw-r--r--lisp/xt-mouse.el3
-rw-r--r--lispref/ChangeLog18
-rw-r--r--lispref/intro.texi2
-rw-r--r--lispref/modes.texi2
-rw-r--r--lispref/tips.texi6
-rw-r--r--lispref/windows.texi6
-rw-r--r--mac/inc/m-mac.h2
-rw-r--r--man/ChangeLog18
-rw-r--r--man/calc.texi38
-rw-r--r--man/files.texi5
-rw-r--r--man/glossary.texi3
-rw-r--r--man/gnus.texi42
-rw-r--r--man/sieve.texi4
-rw-r--r--src/ChangeLog128
-rw-r--r--src/buffer.h2
-rw-r--r--src/callproc.c2
-rw-r--r--src/casetab.c2
-rw-r--r--src/category.c2
-rw-r--r--src/ccl.c4
-rw-r--r--src/charset.c6
-rw-r--r--src/charset.h10
-rw-r--r--src/coding.h4
-rw-r--r--src/composite.h4
-rw-r--r--src/dired.c2
-rw-r--r--src/editfns.c2
-rw-r--r--src/emacs.c7
-rw-r--r--src/eval.c2
-rw-r--r--src/fileio.c167
-rw-r--r--src/fontset.c2
-rw-r--r--src/fontset.h2
-rw-r--r--src/getloadavg.c2
-rw-r--r--src/gmalloc.c115
-rw-r--r--src/gtkutil.c12
-rw-r--r--src/image.c12
-rw-r--r--src/indent.c2
-rw-r--r--src/indent.h2
-rw-r--r--src/insdel.c99
-rw-r--r--src/intervals.c2
-rw-r--r--src/keyboard.c4
-rw-r--r--src/keyboard.h2
-rw-r--r--src/keymap.c2
-rw-r--r--src/lisp.h4
-rw-r--r--src/lread.c6
-rw-r--r--src/m/7300.h2
-rw-r--r--src/m/acorn.h2
-rw-r--r--src/m/alliant-2800.h2
-rw-r--r--src/m/alliant.h2
-rw-r--r--src/m/alpha.h2
-rw-r--r--src/m/altos.h2
-rw-r--r--src/m/amdahl.h2
-rw-r--r--src/m/amdx86-64.h2
-rw-r--r--src/m/apollo.h2
-rw-r--r--src/m/arm.h2
-rw-r--r--src/m/att3b.h2
-rw-r--r--src/m/aviion.h2
-rw-r--r--src/m/celerity.h2
-rw-r--r--src/m/clipper.h2
-rw-r--r--src/m/cnvrgnt.h2
-rw-r--r--src/m/convex.h2
-rw-r--r--src/m/cydra5.h2
-rw-r--r--src/m/delta88k.h2
-rw-r--r--src/m/dpx2.h2
-rw-r--r--src/m/dual.h2
-rw-r--r--src/m/elxsi.h2
-rw-r--r--src/m/gould.h2
-rw-r--r--src/m/hp800.h2
-rw-r--r--src/m/hp9000s300.h2
-rw-r--r--src/m/i860.h2
-rw-r--r--src/m/ia64.h2
-rw-r--r--src/m/ibm370aix.h2
-rw-r--r--src/m/ibmps2-aix.h2
-rw-r--r--src/m/ibmrs6000.h2
-rw-r--r--src/m/ibmrt-aix.h2
-rw-r--r--src/m/ibmrt.h2
-rw-r--r--src/m/ibms390.h2
-rw-r--r--src/m/ibms390x.h2
-rw-r--r--src/m/intel386.h2
-rw-r--r--src/m/iris4d.h2
-rw-r--r--src/m/irist.h2
-rw-r--r--src/m/isi-ov.h2
-rw-r--r--src/m/m68k.h2
-rw-r--r--src/m/macppc.h2
-rw-r--r--src/m/masscomp.h2
-rw-r--r--src/m/mega68.h2
-rw-r--r--src/m/mg1.h2
-rw-r--r--src/m/mips-siemens.h2
-rw-r--r--src/m/mips.h2
-rw-r--r--src/m/news.h2
-rw-r--r--src/m/next.h2
-rw-r--r--src/m/ns16000.h2
-rw-r--r--src/m/ns32000.h2
-rw-r--r--src/m/nu.h2
-rw-r--r--src/m/orion.h2
-rw-r--r--src/m/orion105.h2
-rw-r--r--src/m/pfa50.h2
-rw-r--r--src/m/plexus.h2
-rw-r--r--src/m/powermac.h2
-rw-r--r--src/m/powerpcle.h2
-rw-r--r--src/m/pyramid.h2
-rw-r--r--src/m/sequent.h2
-rw-r--r--src/m/sh3el.h2
-rw-r--r--src/m/sparc.h2
-rw-r--r--src/m/sps7.h2
-rw-r--r--src/m/sr2k.h2
-rw-r--r--src/m/stride.h2
-rw-r--r--src/m/sun1.h2
-rw-r--r--src/m/sun2.h2
-rw-r--r--src/m/tad68k.h2
-rw-r--r--src/m/tahoe.h2
-rw-r--r--src/m/targon31.h2
-rw-r--r--src/m/tek4300.h2
-rw-r--r--src/m/tekxd88.h2
-rw-r--r--src/m/template.h2
-rw-r--r--src/m/tower32.h2
-rw-r--r--src/m/tower32v3.h2
-rw-r--r--src/m/ustation.h2
-rw-r--r--src/m/vax.h2
-rw-r--r--src/m/wicat.h2
-rw-r--r--src/m/windowsnt.h2
-rw-r--r--src/m/xps100.h2
-rw-r--r--src/mac.c13
-rw-r--r--src/macmenu.c21
-rw-r--r--src/macselect.c404
-rw-r--r--src/macterm.c106
-rw-r--r--src/macterm.h2
-rw-r--r--src/msdos.c2
-rw-r--r--src/print.c20
-rw-r--r--src/process.c12
-rw-r--r--src/process.h2
-rw-r--r--src/regex.c2
-rw-r--r--src/search.c2
-rw-r--r--src/systime.h4
-rw-r--r--src/systty.h2
-rw-r--r--src/termhooks.h2
-rw-r--r--src/textprop.c4
-rw-r--r--src/w32term.c2
-rw-r--r--src/w32term.h2
-rw-r--r--src/window.c10
-rw-r--r--src/window.h3
-rw-r--r--src/xdisp.c15
-rw-r--r--src/xterm.c4
-rw-r--r--src/xterm.h2
297 files changed, 3440 insertions, 1367 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 51332e21cdc..3cb98270c8b 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,7 @@
12007-08-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * FOR-RELEASE (http): Add Gtk+ tool bar and GUD focus problem.
4
12007-07-25 Glenn Morris <rgm@gnu.org> 52007-07-25 Glenn Morris <rgm@gnu.org>
2 6
3 * Relicense all FSF files to GPLv3 or later. 7 * Relicense all FSF files to GPLv3 or later.
@@ -19,7 +23,7 @@
19 * nt/makedist.bat: Change EOL format to DOS. Don't use 23 * nt/makedist.bat: Change EOL format to DOS. Don't use
20 redirection characters in REM lines. 24 redirection characters in REM lines.
21 25
222007-01-27 Jan Dj,Ad(Brv <jhd@winter.localdomain> 262007-01-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
23 27
24 * FOR-RELEASE: Removed Gtk/Xft issue. 28 * FOR-RELEASE: Removed Gtk/Xft issue.
25 29
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 9d67f20240a..6ddf0bb54dd 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -48,19 +48,23 @@ that branch. Do not make manual changes to this file on the trunk.
48http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01113.html 48http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01113.html
49 49
50** davby@ida.liu.se, 6 July: Bug in pos-visible-in-window-p 50** davby@ida.liu.se, 6 July: Bug in pos-visible-in-window-p
51
52** dak@gnu.org, 30 May: Redraw problem with overlapping frames 51** dak@gnu.org, 30 May: Redraw problem with overlapping frames
53 52
54** dksw@eircom.net, 3 Jul: Telnet mode (rsh/ssh)
55
56** bojohan+news@dd.chalmers.se, 1 Aug: n_schumacher@web.de: modification hooks called only once in 53** bojohan+news@dd.chalmers.se, 1 Aug: n_schumacher@web.de: modification hooks called only once in
57 54
58** sdl.web@gmail.com: problem with transparent PNG image display 55** ams@gnu.org, 9 July: eshell and external commands
56
57** timh@insightful.com, 25 June: undigestify-rmail-message in emacs 22.1 doesn't split a digest
58
59** andreas.roehler@online.de, 24 Jul: CVS build on Suse 10.0 failed
60
61** Gtk+ tool bar looses focus when pressing next tool bar button in GUD.
62http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-08/msg00008.html
59 63
60* FIXES FOR EMACS 22.2 64* FIXES FOR EMACS 22.2
61 65
62Here we list small fixes that arrived too late for Emacs 22.1, but 66Here we list small fixes that arrived too late for Emacs 22.2, but
63that should be installed on the release branch after 22.1 is released. 67that should be installed on the release branch after 22.2 is released.
64 68
65** Changes to six pbm icons in etc/images. 69** Changes to six pbm icons in etc/images.
66Sync change from trunk 2007-05-19. 70Sync change from trunk 2007-05-19.
diff --git a/admin/nt/README-ftp-server b/admin/nt/README-ftp-server
index 6b437eb2f1e..0d3d550f563 100644
--- a/admin/nt/README-ftp-server
+++ b/admin/nt/README-ftp-server
@@ -1,7 +1,7 @@
1 Precompiled Distributions of 1 Precompiled Distributions of
2 Emacs for Windows 2 Emacs for Windows
3 3
4 Version 22.1 4 Version 22.2
5 5
6 May 22, 2007 6 May 22, 2007
7 7
@@ -26,9 +26,9 @@
26 26
27 If you want to redistribute any of the precompiled distributions of 27 If you want to redistribute any of the precompiled distributions of
28 Emacs, be careful to check the implications of the GPL. For instance, 28 Emacs, be careful to check the implications of the GPL. For instance,
29 if you put the emacs-22.1-bin-i386.tar.gz file from this directory on 29 if you put the emacs-22.2-bin-i386.tar.gz file from this directory on
30 an Internet site, you must arrange to distribute the source files of 30 an Internet site, you must arrange to distribute the source files of
31 the SAME version (i.e. ../emacs-22.1.tar.gz). 31 the SAME version (i.e. ../emacs-22.2.tar.gz).
32 32
33 Making a link to our copy of the source is NOT sufficient, since we 33 Making a link to our copy of the source is NOT sufficient, since we
34 might upgrade to a new version while you are still distributing the 34 might upgrade to a new version while you are still distributing the
@@ -37,8 +37,8 @@
37 37
38* Files in this directory 38* Files in this directory
39 39
40 + emacs-22.1-bin-i386.zip 40 + emacs-22.2-bin-i386.zip
41 Windows binaries of Emacs-22.1, with all lisp code and documentation 41 Windows binaries of Emacs-22.2, with all lisp code and documentation
42 included. 42 included.
43 43
44 Download this file if you want a single installation package, and 44 Download this file if you want a single installation package, and
@@ -49,8 +49,8 @@
49 If you need the C source code at a later date, it will be safe to 49 If you need the C source code at a later date, it will be safe to
50 unpack the source distribution on top of this installation. 50 unpack the source distribution on top of this installation.
51 51
52 + emacs-22.1-barebin-i386.zip 52 + emacs-22.2-barebin-i386.zip
53 Windows binaries of Emacs-22.1, without lisp code or documentation. 53 Windows binaries of Emacs-22.2, without lisp code or documentation.
54 54
55 Download this file if you already have the source distribution, or 55 Download this file if you already have the source distribution, or
56 if you need to redump the emacs.exe executable. 56 if you need to redump the emacs.exe executable.
@@ -60,12 +60,22 @@
60 file, plus temacs.exe and dump.bat, which are required if you want to 60 file, plus temacs.exe and dump.bat, which are required if you want to
61 redump emacs without recompiling it. 61 redump emacs without recompiling it.
62 62
63 + libxpm-src.zip
64 Source code for libXpm-X11R7.2-3.5.6 modified to compile on Windows.
65 This corresponds to the libXpm.dll in emacs-22.2-bin-i386.zip
66 and emacs-22.2-barebin-i386.zip.
67
68
69 The following are provided for users who require older versions.
70
71 + emacs-22.1-bin-i386.zip
72 + emacs-22-1-barebin-i386.zip
73 Windows binaries of Emacs 22.1, contents as above.
74
63 + emacs-21.3-bin-i386.tar.gz 75 + emacs-21.3-bin-i386.tar.gz
64 Windows binaries of Emacs 21.3, with compiled lisp code and some 76 Windows binaries of Emacs 21.3, with compiled lisp code and some
65 documentation included. 77 documentation included.
66 78
67 This is provided for users who require the older version.
68
69 + emacs-21.3-leim.tar.gz 79 + emacs-21.3-leim.tar.gz
70 Compiled lisp input methods. This optional addition to Emacs-21.3 80 Compiled lisp input methods. This optional addition to Emacs-21.3
71 is required if you want to enter languages that are not directly 81 is required if you want to enter languages that are not directly
@@ -73,7 +83,7 @@
73 83
74* Image support 84* Image support
75 85
76 Emacs 22.1 contains support for images, however for most image formats 86 Emacs 22.2 contains support for images, however for most image formats
77 supporting libraries are required. This distribution has been tested 87 supporting libraries are required. This distribution has been tested
78 with the libraries that are distributed with GTK for Windows, and the 88 with the libraries that are distributed with GTK for Windows, and the
79 libraries found at http://gnuwin32.sourceforge.net/. The following image 89 libraries found at http://gnuwin32.sourceforge.net/. The following image
@@ -82,10 +92,10 @@
82 PBM/PGM/PPM: Supported natively by Emacs. This format is used for 92 PBM/PGM/PPM: Supported natively by Emacs. This format is used for
83 the black and white versions of the toolbar icons. 93 the black and white versions of the toolbar icons.
84 94
85 XPM: requires a Windows port of the XPM library 3.4 or later, 95 XPM: a Windows port of the XPM library corresponding to the x.org
86 which will be named xpm4.dll, libxpm-nox4.dll or 96 release of X11R7.2 is included with the binary distribution, but
87 libxpm.dll. This format is used for the color versions of the 97 can be replaced by other versions with the name xpm4.dll,
88 toolbar icons, and other images in Emacs. 98 libxpm-nox4.dll or libxpm.dll.
89 99
90 PNG: requires the PNG reference library 1.2 or later, which will 100 PNG: requires the PNG reference library 1.2 or later, which will
91 be named libpng13d.dll, libpng13.dll, libpng12d.dll, libpng12.dll 101 be named libpng13d.dll, libpng13.dll, libpng12d.dll, libpng12.dll
@@ -217,7 +227,7 @@
217 about the Windows port and related software packages. Note that as 227 about the Windows port and related software packages. Note that as
218 of writing, most of the information in that FAQ was for Emacs-21.3 228 of writing, most of the information in that FAQ was for Emacs-21.3
219 and earlier versions, so some information may not be relevant to 229 and earlier versions, so some information may not be relevant to
220 Emacs-22.1. 230 Emacs-22.2.
221 231
222 In addition to the FAQ, there is a mailing list for discussing issues 232 In addition to the FAQ, there is a mailing list for discussing issues
223 related to the Windows port of Emacs. For information about the 233 related to the Windows port of Emacs. For information about the
diff --git a/admin/nt/makedist.bat b/admin/nt/makedist.bat
index 87e151dd06a..5afef00e9b3 100755
--- a/admin/nt/makedist.bat
+++ b/admin/nt/makedist.bat
@@ -35,8 +35,8 @@ copy %3\README.W32 emacs-%1\README.W32
35rem Info-ZIP zip seems to be broken on Windows. 35rem Info-ZIP zip seems to be broken on Windows.
36rem It always writes to zip.zip and treats the zipfile argument as one 36rem It always writes to zip.zip and treats the zipfile argument as one
37rem of the files to go in it. 37rem of the files to go in it.
38rem zip -9 -r %2-bin-i386 emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim -x emacs.mdp *.pdb *.opt *~ CVS 38rem zip -9 -r %2-bin-i386 emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim -x emacs.mdp *.pdb *.opt *~ CVS
397z a -tZIP -mx=9 -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory %2-bin-i386.zip emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim emacs-%1/site-lisp 397z a -tZIP -mx=9 -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory %2-bin-i386.zip emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim emacs-%1/site-lisp
40del emacs-%1\README.W32 40del emacs-%1\README.W32
41if not (%4) == () goto end 41if not (%4) == () goto end
42 42
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 7da5459c40c..9fd1a50736c 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,8 @@
12007-08-08 Glenn Morris <rgm@gnu.org>
2
3 * TODO: `iff' item is dealt with.
4 * GNUS-NEWS, NEWS, NEWS.1-17, NEWS.19, NEWS.21: Replace `iff'.
5
12007-08-01 Glenn Morris <rgm@gnu.org> 62007-08-01 Glenn Morris <rgm@gnu.org>
2 7
3 * NEWS: Add fortran-line-length, plus some more sections. 8 * NEWS: Add fortran-line-length, plus some more sections.
diff --git a/etc/GNUS-NEWS b/etc/GNUS-NEWS
index fce326fc0d0..f09451af805 100644
--- a/etc/GNUS-NEWS
+++ b/etc/GNUS-NEWS
@@ -30,7 +30,7 @@ or remove them using `make remove-installed-shadows'.
30 30
31Use `make.bat' if you want to install Gnus under MS Windows, the first 31Use `make.bat' if you want to install Gnus under MS Windows, the first
32argument to the batch-program should be the directory where `xemacs.exe' 32argument to the batch-program should be the directory where `xemacs.exe'
33respectively `emacs.exe' is located, iff you want to install Gnus after 33respectively `emacs.exe' is located, if you want to install Gnus after
34compiling it, give `make.bat' `/copy' as the second parameter. 34compiling it, give `make.bat' `/copy' as the second parameter.
35 35
36`make.bat' has been rewritten from scratch, it now features automatic 36`make.bat' has been rewritten from scratch, it now features automatic
@@ -308,7 +308,7 @@ as external parts.
308 308
309** Gnus no longer generate the Sender: header automatically. 309** Gnus no longer generate the Sender: header automatically.
310 310
311Earlier it was generated iff the user configurable email address was 311Earlier it was generated when the user configurable email address was
312different from the Gnus guessed default user address. As the guessing 312different from the Gnus guessed default user address. As the guessing
313algorithm is rarely correct these days, and (more controversially) the 313algorithm is rarely correct these days, and (more controversially) the
314only use of the Sender: header was to check if you are entitled to 314only use of the Sender: header was to check if you are entitled to
diff --git a/etc/NEWS b/etc/NEWS
index f56a7a0bf0c..c70f968e41a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -77,8 +77,6 @@ history element containing the search string becomes the current.
77 77
78* New Modes and Packages in Emacs 23.1 78* New Modes and Packages in Emacs 23.1
79 79
80** bibtex-style-mode helps you write BibTeX's *.bst files.
81
82** minibuffer-indicate-depth-mode shows the minibuffer depth in the prompt. 80** minibuffer-indicate-depth-mode shows the minibuffer depth in the prompt.
83 81
84 82
@@ -99,8 +97,6 @@ considered for update.
99*** VC backends can provide extra menu entries to be added to the "Version Control" menu. 97*** VC backends can provide extra menu entries to be added to the "Version Control" menu.
100This can be used to add menu entries for backend specific functions. 98This can be used to add menu entries for backend specific functions.
101 99
102*** VC has some support for Bazaar (bzr).
103
104** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs. 100** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs.
105 101
106** BibTeX mode: 102** BibTeX mode:
@@ -198,10 +194,6 @@ like this:
198Use this instead of "~/.emacs.d". 194Use this instead of "~/.emacs.d".
199 195
200+++ 196+++
201** The new function `image-refresh' refreshes all images associated
202with a given image specification.
203
204+++
205** The new function `start-file-process is similar to `start-process', 197** The new function `start-file-process is similar to `start-process',
206but obeys file handlers. The file handler is chosen based on 198but obeys file handlers. The file handler is chosen based on
207`default-directory'. The functions `start-file-process-shell-command' 199`default-directory'. The functions `start-file-process-shell-command'
diff --git a/etc/NEWS.1-17 b/etc/NEWS.1-17
index 4e5243ea0c4..7bc30e5d228 100644
--- a/etc/NEWS.1-17
+++ b/etc/NEWS.1-17
@@ -1208,7 +1208,7 @@ whether and where a line has a comment.
1208 1208
1209* New function `auto-save-file-name-p' 1209* New function `auto-save-file-name-p'
1210 1210
1211Should return non-`nil' iff given a string which is the name of an 1211Should return non-`nil' if given a string which is the name of an
1212auto-save file (sans directory name). If you redefine 1212auto-save file (sans directory name). If you redefine
1213`make-auto-save-file-name', you should redefine this accordingly. By 1213`make-auto-save-file-name', you should redefine this accordingly. By
1214default, this function returns `t' for filenames beginning with 1214default, this function returns `t' for filenames beginning with
diff --git a/etc/NEWS.19 b/etc/NEWS.19
index 2f3e83fb946..08573703c04 100644
--- a/etc/NEWS.19
+++ b/etc/NEWS.19
@@ -5133,8 +5133,8 @@ using X).
5133** It is now simpler to tell Emacs to display accented characters under 5133** It is now simpler to tell Emacs to display accented characters under
5134X windows. M-x standard-display-european toggles the display of 5134X windows. M-x standard-display-european toggles the display of
5135buffer text according to the ISO Latin-1 standard. With a prefix 5135buffer text according to the ISO Latin-1 standard. With a prefix
5136argument, this command enables European character display iff the 5136argument, this command enables European character display if and only
5137argument is positive. 5137if the argument is positive.
5138 5138
5139** The `-i' command-line argument tells Emacs to use a picture of the 5139** The `-i' command-line argument tells Emacs to use a picture of the
5140GNU gnu as its icon, instead of letting the window manager choose an 5140GNU gnu as its icon, instead of letting the window manager choose an
diff --git a/etc/NEWS.21 b/etc/NEWS.21
index 91a37be8276..a4c42a6479a 100644
--- a/etc/NEWS.21
+++ b/etc/NEWS.21
@@ -2502,7 +2502,7 @@ value is returned. If no window satisfies PREDICATE, DEFAULT is
2502returned. 2502returned.
2503 2503
2504Optional second arg MINIBUF t means count the minibuffer window even 2504Optional second arg MINIBUF t means count the minibuffer window even
2505if not active. MINIBUF nil or omitted means count the minibuffer iff 2505if not active. MINIBUF nil or omitted means count the minibuffer if
2506it is active. MINIBUF neither t nor nil means not to count the 2506it is active. MINIBUF neither t nor nil means not to count the
2507minibuffer even if it is active. 2507minibuffer even if it is active.
2508 2508
diff --git a/etc/NEWS.22 b/etc/NEWS.22
index ae31b2489e1..6e227639fed 100644
--- a/etc/NEWS.22
+++ b/etc/NEWS.22
@@ -55,6 +55,8 @@ in to make it use the scrollbars from the system theme.
55 55
56* New Modes and Packages in Emacs 22.2 56* New Modes and Packages in Emacs 22.2
57 57
58** bibtex-style-mode helps you write BibTeX's *.bst files.
59
58** The new package css-mode.el provides a major mode for editing CSS files. 60** The new package css-mode.el provides a major mode for editing CSS files.
59 61
60** The new package vera-mode.el provides a major mode for editing Vera files. 62** The new package vera-mode.el provides a major mode for editing Vera files.
@@ -67,8 +69,21 @@ in to make it use the scrollbars from the system theme.
67 69
68*** VC has some support for Mercurial (hg). 70*** VC has some support for Mercurial (hg).
69 71
72*** VC has some support for Bazaar (Bzr).
73
70*** VC has some support for Git. 74*** VC has some support for Git.
71 75
76* Lisp Changes in Emacs 22.2.
77
78** New function `window-full-width-p' returns t if a window is as wide
79as its frame.
80
81** The new function `image-refresh' refreshes all images associated
82with a given image specification.
83
84** The new function `split-string-and-unquote' does (what?)
85
86** The new function `combine-and-quote-strings' does (what?)
72 87
73* Installation Changes in Emacs 22.1 88* Installation Changes in Emacs 22.1
74 89
@@ -3550,8 +3565,8 @@ that is, floats are compared by value and other elements with `eq'.
3550 3565
3551*** New functions `string-or-null-p' and `booleanp'. 3566*** New functions `string-or-null-p' and `booleanp'.
3552 3567
3553`string-or-null-p' returns non-nil iff OBJECT is a string or nil. 3568`string-or-null-p' returns non-nil if OBJECT is a string or nil.
3554`booleanp' returns non-nil iff OBJECT is t or nil. 3569`booleanp' returns non-nil if OBJECT is t or nil.
3555 3570
3556*** `makehash' is now obsolete. Use `make-hash-table' instead. 3571*** `makehash' is now obsolete. Use `make-hash-table' instead.
3557 3572
diff --git a/etc/TODO b/etc/TODO
index 19a481aabd6..9fe78690651 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -19,8 +19,6 @@ I.e. mouse-set-font should use customize-face.
19 19
20** Compute the list of active keymaps *after* reading the first event. 20** Compute the list of active keymaps *after* reading the first event.
21 21
22** Avoid using "iff" in doc strings.
23
24** mouse-autoselect-window should wait to select the window until 22** mouse-autoselect-window should wait to select the window until
25the mouse is put to rest or after a delay or both, so that moving over 23the mouse is put to rest or after a delay or both, so that moving over
26a window doesn't select it. 24a window doesn't select it.
diff --git a/lib-src/etags.c b/lib-src/etags.c
index f4322e8c0f8..0412137496f 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -2883,7 +2883,7 @@ static void make_C_tag __P((bool));
2883 * function or variable, or corresponds to a typedef, or 2883 * function or variable, or corresponds to a typedef, or
2884 * is a struct/union/enum tag, or #define, or an enum constant. 2884 * is a struct/union/enum tag, or #define, or an enum constant.
2885 * 2885 *
2886 * *IS_FUNC gets TRUE iff the token is a function or #define macro 2886 * *IS_FUNC gets TRUE if the token is a function or #define macro
2887 * with args. C_EXTP points to which language we are looking at. 2887 * with args. C_EXTP points to which language we are looking at.
2888 * 2888 *
2889 * Globals 2889 * Globals
@@ -4803,7 +4803,7 @@ Pascal_functions (inf)
4803 int save_lineno, namelen, taglen; 4803 int save_lineno, namelen, taglen;
4804 char c, *name; 4804 char c, *name;
4805 4805
4806 bool /* each of these flags is TRUE iff: */ 4806 bool /* each of these flags is TRUE if: */
4807 incomment, /* point is inside a comment */ 4807 incomment, /* point is inside a comment */
4808 inquote, /* point is inside '..' string */ 4808 inquote, /* point is inside '..' string */
4809 get_tagname, /* point is after PROCEDURE/FUNCTION 4809 get_tagname, /* point is after PROCEDURE/FUNCTION
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8d35fa06ac5..8daf2daf71f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,385 @@
12007-08-13 Nick Roberts <nickrob@snap.net.nz>
2
3 * progmodes/gdb-ui.el (gdb-send): Handle CTRL-D more carefully.
4
52007-08-12 Richard Stallman <rms@gnu.org>
6
7 * pcvs.el (cvs-reread-cvsrc, cvs-checkout, cvs-mode-checkout)
8 (cvs-execute-single-file): Use new name split-string-and-unquote.
9 (cvs-header-msg): Use new name combine-and-quote-strings.
10
11 * emulation/vi.el (vi-next-line): Ignore return value of line-move.
12
13 * progmodes/gud.el (gud-common-init): Use new name
14 split-string-and-unquote.
15
16 * progmodes/flymake.el (flymake-err-line-patterns): Fix infloop
17 in javac regexp.
18
19 * pcvs-util.el (cvs-qtypedesc-strings): Use new names
20 combine-and-quote-strings and split-string-and-unquote.
21
22 * subr.el (combine-and-quote-strings): Renamed from strings->string.
23 (split-string-and-unquote): Renamed from string->strings.
24
252007-08-10 Stefan Monnier <monnier@iro.umontreal.ca>
26
27 * log-view.el (log-view-font-lock-keywords): Use `eval' so as to adapt
28 to buffer-local settings.
29
30 * emacs-lisp/backquote.el (backquote-delay-process): New function.
31 (backquote-process): Add internal arg `level'. Use the two to
32 correctly handle nested backquotes.
33
342007-08-09 Riccardo Murri <riccardo.murri@gmail.com>
35
36 * vc-bzr.el (vc-bzr-registered): Use \0 instead of literal NULs.
37 (vc-bzr-state-words): Add "kind changed" state word.
38 (vc-bzr-status): New function. Return Bzr idea of file status,
39 which is different from VC's.
40 (vc-bzr-state): Use vc-bzr-status.
41 (vc-workfile-unchanged-p): Use vc-bzr-status.
42 (vc-bzr-revert): Use synchronous process; expect exitcode 0.
43 (vc-dired-state): Process "kind changed" state word.
44
452007-08-09 Stefan Monnier <monnier@iro.umontreal.ca>
46
47 * vc-hooks.el (vc-default-find-file-not-found-hook): Do nothing.
48
49 * vc-rcs.el (vc-rcs-find-file-not-found-hook):
50 Move from vc-default-find-file-not-found-hook.
51
522007-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
53
54 * man.el: Remove spurious * in docstrings.
55 Merge defvars and toplevel setq-defaults.
56 (Man-highlight-references0): Limit=nil rather than point-max.
57 (Man-mode-map): Move initialization into the declaration.
58 (Man-strip-page-headers, Man-unindent): Use dolist & inhibit-read-only.
59 (Man-view-header-file): Use expand-file-name rather than concat.
60 (Man-notify-when-ready, Man-bgproc-sentinel): Use with-current-buffer.
61
62 * man.el (Man-next-section): Make sure we do not move backward.
63
642007-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
65
66 * files.el (auto-mode-alist): Use the purecopied text (duh!).
67
682007-08-08 Glenn Morris <rgm@gnu.org>
69
70 * Replace `iff' in doc-strings and comments.
71
722007-08-08 Martin Rudalics <rudalics@gmx.at>
73
74 * dired.el (dired-pop-to-buffer):
75 * mouse-drag.el (mouse-drag-should-do-col-scrolling):
76 * calendar/calendar.el (generate-calendar-window):
77 * progmodes/compile.el (compilation-set-window-height):
78 * textmodes/two-column.el (2C-two-columns, 2C-merge):
79 Use window-full-width-p instead of comparing frame-width and
80 window-width.
81
82 * progmodes/compile.el (compilation-find-buffer): Remove extra
83 argument in call to compilation-buffer-internal-p.
84
852007-08-07 Tom Tromey <tromey@redhat.com>
86
87 * progmodes/tcl.el (tcl-indent-level, tcl-continued-indent-level):
88 Add safe-local-variable property.
89
902007-08-07 Chong Yidong <cyd@stupidchicken.com>
91
92 * image-mode.el (image-toggle-display): Use image-refresh.
93
942007-08-07 Riccardo Murri <riccardo.murri@gmail.com>
95
96 * vc-bzr.el: Remove comments about vc-bzr.el being a modified
97 unofficial version.
98 (vc-bzr-command): Remove redundant setting of process-connection-type.
99 (vc-bzr-admin-checkout-format-file): Add autoload.
100 (vc-bzr-root-dir): Remove in favor of vc-bzr-root.
101 (vc-bzr-root): Switch to implementation of vc-bzr-root-dir.
102 (vc-bzr-registered): Compare dirstate format tag with known good
103 value, abort parsing if match fails. Warn user in docstring.
104 (vc-bzr-workfile-version): Case for different Bzr branch formats.
105 See bzrlib/branch.py in Bzr sources.
106 (vc-bzr-diff): First argument FILES may be a string rather than a list.
107 (vc-bzr-shell-command): Remove in favor of
108 vc-bzr-command-discarding-stderr.
109 (vc-bzr-command-discarding-stderr): New function.
110
1112007-08-06 Riccardo Murri <riccardo.murri@gmail.com>
112
113 * vc-bzr.el (vc-bzr-registered): Gracefully handle missing "bzr"
114 program, and return nil
115 (vc-bzr-state): Gracefully handle missing "bzr" program, and return nil.
116 (vc-bzr-state): Look for path names relative to the repository
117 root after status keyword.
118 (vc-bzr-file-name-relative): New function.
119 (vc-bzr-admin-dirname): Reinstate, as other vc-bzr-admin-... paths
120 depend on it.
121 (vc-bzr-admin-dirname, ...-checkout-format-file)
122 (...-branch-format-file, ...-revhistory): Paths to some Bzr internal
123 files that we now parse directly for speed.
124 (vc-bzr-root-dir): Use `vc-bzr-admin-checkout-format-file' as witness.
125 (vc-bzr-registered): Only parse vc-bzr-admin-dirstate file if it exists.
126 (vc-bzr-state): "bzr status" successful only if exitcode is 0
127 (vc-bzr-root): Use `vc-bzr-shell-command'. Stderr may contain
128 Bzr warnings, so we must discard it.
129 (vc-bzr-workfile-version): Speedup counting lines from
130 `vc-bzr-admin-revhistory' file, but fallback to spawning "bzr revno"
131 if that file doesn't exist.
132 (vc-bzr-responsible-p): Use `vc-bzr-root' instead of
133 `vc-bzr-root-dir' for speed. Add `vc-bzr-admin-dirname'
134 (not ".bzr"!) to `vc-directory-exclusion-list'
135 (vc-bzr-shell-command): New function.
136
1372007-08-06 Tom Tromey <tromey@redhat.com>
138
139 * diff-mode.el (diff-unified->context, diff-reverse-direction)
140 (diff-fixup-modifs): Typo in docstring.
141
1422007-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
143
144 * emulation/tpu-edt.el (tpu-current-line): Use posn-at-point and
145 count-screen-lines.
146 (tpu-edt-off): Disable relevant pieces of advice.
147
148 * emulation/tpu-extras.el (tpu-before-save-hook): Rename from
149 tpu-write-file-hook. Activate it with add-hook on buffer-save-hook.
150 (newline, newline-and-indent, do-auto-fill): Use advice instead of
151 redefining the function.
152 (tpu-set-scroll-margins): Activate the pieces of advice.
153
1542007-08-06 Martin Rudalics <rudalics@gmx.at>
155
156 * help.el (resize-temp-buffer-window): Use window-full-width-p
157 instead of comparing frame-width and window-width.
158
1592007-08-13 Stefan Monnier <monnier@iro.umontreal.ca>
160
161 * emacs-lisp/autoload.el (autoload-print-form): Use print-quoted.
162
1632007-08-12 Richard Stallman <rms@gnu.org>
164
165 * progmodes/sh-script.el (sh): Delete group `unix'.
166
167 * progmodes/gud.el (gud): Change to group `processes'.
168
1692007-08-11 Glenn Morris <rgm@gnu.org>
170
171 * progmodes/compile.el (compilation-buffer-name): Don't check
172 compilation-arguments. It is superfluous, and the variable isn't
173 even set when this function is called.
174
1752007-08-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
176
177 * term/mac-win.el (mac-ae-reopen-application): New function.
178 (mac-apple-event-map): Bind "reopen application" Apple event to it.
179
1802007-08-10 Stefan Monnier <monnier@iro.umontreal.ca>
181
182 * textmodes/tex-mode.el (tex-font-lock-unfontify-region): Fix to
183 take tex-font-script-display into account.
184 (tex-font-script-display, tex-font-lock-suscript): Change from a cons
185 cell to a list of 2 elements to simplify the unfontify code.
186
1872007-08-09 Edward O'Connor <hober0@gmail.com> (tiny change)
188
189 * url/url-auth.el (url-basic-auth): When prompting for username
190 and password, default to the username and password in the URL.
191
1922007-08-08 Vinicius Jose Latorre <viniciusjl@ig.com.br>
193
194 * ps-print.el (ps-default-fg, ps-default-bg): Docstring fix.
195 (ps-begin-job): Use ps-default-fg and ps-default-bg only when
196 ps-print-color-p is neither nil nor black-white. Reported by Christian
197 Schlauer <cs-muelleimer-rubbish.bin@arcor.de>.
198
1992007-08-08 Andreas Schwab <schwab@suse.de>
200
201 * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook): Check for
202 self-insert-command, not self-insert.
203
2042007-08-08 Glenn Morris <rgm@gnu.org>
205
206 * emacs-lisp/eldoc.el (eldoc-get-fnsym-args-string): Make second
207 argument optional, for backwards compatibility, and only highlight
208 args when present. Fix symbol name typo (doc/args).
209
210 * help-mode.el (help-make-xrefs): Search for symbol constituents,
211 rather than just `-'.
212
2132007-08-07 Jay Belanger <jay.p.belanger@gmail.com>
214
215 * calc/calc-units.el (calc-convert-temperature):
216 Use `/' to create fractions.
217
2182007-08-07 Michael Albinus <michael.albinus@gmx.de>
219
220 * net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more
221 global matching.
222 (tramp-handle-shell-command): Handle OUTPUT-BUFFER and
223 ERROR-BUFFER more robust. Display output.
224 (tramp-file-name-handler): Add a connection property when we found
225 a foreign file name handler. This allows backends like ftp to
226 profit also from usr/host name completion based on connection
227 cache.
228 (tramp-send-command-and-read): Search for trash after the regexp
229 until eol only. In XEmacs, there is a problem with \n.
230
231 * net/tramp-cache.el (top): Read persistent connection history
232 when cache is empty.
233
2342007-08-07 Nic Ferrier <nferrier@tapsellferrier.co.uk> (tiny change)
235
236 * net/tramp.el (tramp-handle-process-file): Fix bug inserting
237 resulting output.
238
2392007-08-07 Sam Steingold <sds@gnu.org>
240
241 * progmodes/compile.el (compilation-start): Pass nil as startfile
242 to comint-exec.
243
2442007-08-07 Chong Yidong <cyd@stupidchicken.com>
245
246 * longlines.el (longlines-decoded): New variable.
247 (longlines-mode): Avoid encoding or decoding the buffer twice.
248
2492007-08-07 Martin Rudalics <rudalics@gmx.at>
250
251 * format.el (format-insert-file): Make sure that at most one undo
252 entry is recorded for the insertion. Inhibit point-motion and
253 modification hooks around call to insert-file-contents.
254
2552007-08-07 Stefan Monnier <monnier@iro.umontreal.ca>
256
257 * vc.el (vc-annotate): Select temp-buffer before running vc-exec-after.
258 Select the buffer's window before moving point.
259
2602007-08-07 Richard Stallman <rms@gnu.org>
261
262 * term.el (term): Remove parent group `unix'.
263
264 * simple.el (default-indent-new-line): New function.
265 It calls comment-line-break-function if there are comments.
266 (do-auto-fill): Use that.
267
2682007-08-07 Ivan Kanis <apple@kanis.eu>
269
270 * time.el (display-time-world-mode, display-time-world-display)
271 (display-time-world, display-time-world-list)
272 (display-time-world-time-format, display-time-world-buffer-name)
273 (display-time-world-timer-enable)
274 (display-time-world-timer-second, display-time-world-mode-map):
275 New.
276
2772007-08-07 Sean O'Rourke <sorourke@cs.ucsd.edu>
278
279 * complete.el (PC-lisp-complete-symbol): Complete symbol around point.
280 (PC-do-completion): Add "acronym completion" for symbols and
281 filenames, so e.g. "mvbl" expands to "make-variable-buffer-local".
282
2832007-08-06 Sam Steingold <sds@gnu.org>
284
285 * mouse.el (mouse-buffer-menu): Pass mode-name through
286 format-mode-line because it may be a list,
287 e.g., (sgml-xml-mode "XML" "SGML"), and not a string.
288
2892007-08-06 Vinicius Jose Latorre <viniciusig@ig.com.br>
290
291 * printing.el (pr-update-menus): Docstring fix.
292
2932007-08-06 Jason Rumney <jasonr@gnu.org>
294
295 * menu-bar.el (menu-bar-vc-filter): Use vc-call-backend.
296
297 * vc-hooks.el (vc-call): Add doc string.
298
2992007-08-06 Michael Albinus <michael.albinus@gmx.de>
300
301 * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in
302 process-filter.
303
3042007-08-06 Kenichi Handa <handa@m17n.org>
305
306 * international/quail.el: Wrap (require 'help-mode) by
307 eval-when-compile.
308 (quail-help-init): New function.
309 (quail-help): Call quail-help-init.
310 (quail-store-decode-map-key): Change it to a function.
311
3122007-08-05 Jason Rumney <jasonr@gnu.org>
313
314 * vc.el (vc-rollback): Add norevert argument back.
315 (vc-revert-buffer): Add back as obsolete alias.
316
3172007-08-05 Peter Povinec <ppovinec@yahoo.com> (tiny change)
318
319 * term.el: Honor term-default-fg-color and term-default-bg-color
320 settings when modifying term-current-face.
321 (term-default-fg-color, term-default-bg-color): Initialize from
322 default term-current-face.
323 (term-mode, term-reset-terminal): Set term-current-face with
324 term-default-fg-color and term-default-bg-color.
325 (term-handle-colors-array): term-current-face has term-default-fg-color
326 and term-default-bg-color after reset escape sequence.
327 (term-handle-colors-array): Set term-current-color with
328 term-default-fg/bg-color instead of ansi-term-color-vector when the
329 index (term-ansi-current-color or term-ansi-current-bg-color) is zero.
330
3312007-08-05 Jay Belanger <belanger@localhost.localdomain>
332
333 * calc/calc-nlfit.el (math-nlfit-curve):
334 Remove unnecessary variables.
335 (math-nlfit-givens): Let bind free variables.
336
3372007-08-05 Vinicius Jose Latorre <viniciusig@ig.com.br>
338
339 * printing.el: Require lpr and ps-print when loading printing package.
340 Reported by Glenn Morris <rgm@gnu.org>.
341
3422007-08-05 Michael Albinus <michael.albinus@gmx.de>
343
344 * files.el (set-auto-mode): Handle also remote files wrt
345 `auto-mode-alist'.
346
3472007-08-04 Jay Belanger <belanger@localhost.localdomain>
348
349 * calc/calcalg3.el (calc-curve-fit): Add support for nonlinear
350 curves and plotting.
351
352 * calc/calc-nlfit.el: New file.
353
3542007-08-04 Glenn Morris <rgm@gnu.org>
355
356 * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is
357 zero, not nil, when the library is first loaded. Check for a file
358 that has been modified on disk.
359
360 * progmodes/cperl-mode.el (cperl-compilation-error-regexp-alist):
361 Remove duplicate defvar preventing initialization.
362 (cperl-mode): Fix compilation-error-regexp-alist-alist setting.
363
3642007-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
365
366 * diff-mode.el (diff-font-lock-keywords): Fix up false positives.
367 (diff-beginning-of-file): Adjust to the fact that diff-file-header-re
368 may match up to 4 lines.
369 (diff-beginning-of-file-and-junk): Rewrite.
370
3712007-08-03 Vinicius Jose Latorre <viniciusjl@ig.com.br>
372
373 * printing.el: Evaluate require only during compilation.
374 (pr-version): New version 6.9.1.
375 (deactivate-mark): Replace (defvar VAR nil) by (defvar VAR).
376 (pr-global-menubar): Fix code.
377
3782007-08-03 Dan Nicolaescu <dann@ics.uci.edu>
379
380 * term.el (term-erase-in-display): Fix case when point is not at
381 the beginning of the line.
382
12007-08-03 Jay Belanger <jay.p.belanger@gmail.com> 3832007-08-03 Jay Belanger <jay.p.belanger@gmail.com>
2 384
3 * calc/calc-ext.el (math-get-value,math-get-sdev) 385 * calc/calc-ext.el (math-get-value,math-get-sdev)
@@ -18,7 +400,7 @@
18 * vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info) 400 * vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info)
19 (vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'. 401 (vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'.
20 402
212007-08-02 Richard Stallman <rms@gnu.org> 4032007-08-03 Richard Stallman <rms@gnu.org>
22 404
23 * mail/rmailsum.el (rmail-make-summary-line): Find end of msg number 405 * mail/rmailsum.el (rmail-make-summary-line): Find end of msg number
24 to update deleted flag. 406 to update deleted flag.
@@ -38,13 +420,13 @@
38 buffer immediately if suitable. 420 buffer immediately if suitable.
39 (compile, compilation-buffer-name, compilation-start): Doc fixes. 421 (compile, compilation-buffer-name, compilation-start): Doc fixes.
40 422
412007-07-31 Daiki Ueno <ueno@unixuser.org> 4232007-08-03 Daiki Ueno <ueno@unixuser.org>
42 424
43 * faces.el (face-normalize-spec): New function. 425 * faces.el (face-normalize-spec): New function.
44 (frame-set-background-mode): Normalize face-spec before calling 426 (frame-set-background-mode): Normalize face-spec before calling
45 face-spec-match-p. 427 face-spec-match-p.
46 428
472007-07-31 Stefan Monnier <monnier@iro.umontreal.ca> 4292007-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
48 430
49 * server.el (server-window): Add switch-to-buffer-other-frame option. 431 * server.el (server-window): Add switch-to-buffer-other-frame option.
50 432
@@ -98,16 +480,15 @@
98 (fortran-mode): Use fortran-line-length, and 480 (fortran-mode): Use fortran-line-length, and
99 fortran-font-lock-syntactic-keywords as a function. Add a 481 fortran-font-lock-syntactic-keywords as a function. Add a
100 hack-local-variables-hook function. 482 hack-local-variables-hook function.
101 (fortran-line-length, fortran-hack-local-variables): New 483 (fortran-line-length, fortran-hack-local-variables): New functions.
102 functions. 484 (fortran-window-create, fortran-strip-sequence-nos): Doc fix.
103 (fortran-window-create, fortran-strip-sequence-nos): Doc fix. Use 485 Use fortran-line-length rather than 72.
104 fortran-line-length rather than 72.
105 (fortran-window-create-momentarily): Doc fix. 486 (fortran-window-create-momentarily): Doc fix.
106 487
1072007-07-31 Drew Adams <drew.adams@oracle.com> (tiny change) 4882007-07-31 Drew Adams <drew.adams@oracle.com> (tiny change)
108 489
109 * cus-edit.el (custom-group-value-create, custom-goto-parent): Fix 490 * cus-edit.el (custom-group-value-create, custom-goto-parent):
110 parent groups link. 491 Fix parent groups link.
111 492
1122007-07-31 Paul Pogonyshev <pogonyshev@gmx.net> 4932007-07-31 Paul Pogonyshev <pogonyshev@gmx.net>
113 494
@@ -160,21 +541,21 @@
160 541
1612007-07-29 Michael Albinus <michael.albinus@gmx.de> 5422007-07-29 Michael Albinus <michael.albinus@gmx.de>
162 543
163 * tramp.el: 544 * net/tramp.el:
164 * tramp-uu.el: 545 * net/tramp-uu.el:
165 * trampver.el: Use utf-8 encoding with coding cookie. 546 * net/trampver.el: Use utf-8 encoding with coding cookie.
166 547
167 * tramp-cache.el: 548 * net/tramp-cache.el:
168 * tramp-fish.el: 549 * net/tramp-fish.el:
169 * tramp-ftp.el: 550 * net/tramp-ftp.el:
170 * tramp-gw.el: 551 * net/tramp-gw.el:
171 * tramp-smb.el: Remove coding cookie. 552 * net/tramp-smb.el: Remove coding cookie.
172 553
173 * tramp.el (tramp-handle-verify-visited-file-modtime): 554 * net/tramp.el (tramp-handle-verify-visited-file-modtime):
174 Flush buffer file-name's file property. 555 Flush buffer file-name's file property.
175 (tramp-handle-file-remote-p): The first parameter is FILENAME. 556 (tramp-handle-file-remote-p): The first parameter is FILENAME.
176 557
177 * trampver.el: Update release number. 558 * net/trampver.el: Update release number.
178 559
1792007-07-29 Juri Linkov <juri@jurta.org> 5602007-07-29 Juri Linkov <juri@jurta.org>
180 561
@@ -728,9 +1109,9 @@
728 1109
729 Sync with Tramp 2.1.10. 1110 Sync with Tramp 2.1.10.
730 1111
731 * tramp.el (tramp-get-ls-command): Fyx typo. 1112 * net/tramp.el (tramp-get-ls-command): Fyx typo.
732 1113
733 * trampver.el: Update release number. 1114 * net/trampver.el: Update release number.
734 1115
7352007-07-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 11162007-07-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
736 1117
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 1471ca7bebd..b2b03fe63bb 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -39,9 +39,9 @@ define global abbrevs instead."
39 39
40(defun abbrev-mode (&optional arg) 40(defun abbrev-mode (&optional arg)
41 "Toggle Abbrev mode in the current buffer. 41 "Toggle Abbrev mode in the current buffer.
42With argument ARG, turn abbrev mode on iff ARG is positive. 42With optional argument ARG, turn abbrev mode on if ARG is
43In Abbrev mode, inserting an abbreviation causes it to expand 43positive, otherwise turn it off. In Abbrev mode, inserting an
44and be replaced by its expansion." 44abbreviation causes it to expand and be replaced by its expansion."
45 (interactive "P") 45 (interactive "P")
46 (setq abbrev-mode 46 (setq abbrev-mode
47 (if (null arg) (not abbrev-mode) 47 (if (null arg) (not abbrev-mode)
diff --git a/lisp/allout.el b/lisp/allout.el
index f6598063e97..d243a188812 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -1658,8 +1658,9 @@ the following two lines in your Emacs init file:
1658 "Toggle minor mode for controlling exposure and editing of text outlines. 1658 "Toggle minor mode for controlling exposure and editing of text outlines.
1659\\<allout-mode-map> 1659\\<allout-mode-map>
1660 1660
1661Optional arg forces mode to re-initialize iff arg is positive num or 1661Optional prefix argument TOGGLE forces the mode to re-initialize
1662symbol. Allout outline mode always runs as a minor mode. 1662if it is positive, otherwise it turns the mode off. Allout
1663outline mode always runs as a minor mode.
1663 1664
1664Allout outline mode provides extensive outline oriented formatting and 1665Allout outline mode provides extensive outline oriented formatting and
1665manipulation. It enables structural editing of outlines, as well as 1666manipulation. It enables structural editing of outlines, as well as
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 473e8e1976b..f1e5b146058 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -276,9 +276,9 @@ the list of old buffers.")
276 "Position of last known end of file.") 276 "Position of last known end of file.")
277 277
278(add-hook 'find-file-hook 278(add-hook 'find-file-hook
279 (lambda () 279 (lambda ()
280 (set (make-local-variable 'auto-revert-tail-pos) 280 (set (make-local-variable 'auto-revert-tail-pos)
281 (nth 7 (file-attributes buffer-file-name))))) 281 (nth 7 (file-attributes buffer-file-name)))))
282 282
283;; Functions: 283;; Functions:
284 284
@@ -315,7 +315,7 @@ This function is designed to be added to hooks, for example:
315;;;###autoload 315;;;###autoload
316(define-minor-mode auto-revert-tail-mode 316(define-minor-mode auto-revert-tail-mode
317 "Toggle reverting tail of buffer when file on disk grows. 317 "Toggle reverting tail of buffer when file on disk grows.
318With arg, turn Tail mode on iff arg is positive. 318With arg, turn Tail mode on if arg is positive, otherwise turn it off.
319 319
320When Tail mode is enabled, the tail of the file is constantly 320When Tail mode is enabled, the tail of the file is constantly
321followed, as with the shell command `tail -f'. This means that 321followed, as with the shell command `tail -f'. This means that
@@ -334,9 +334,25 @@ Use `auto-revert-mode' for changes other than appends!"
334 (auto-revert-tail-mode 0) 334 (auto-revert-tail-mode 0)
335 (error "This buffer is not visiting a file")) 335 (error "This buffer is not visiting a file"))
336 (if (and (buffer-modified-p) 336 (if (and (buffer-modified-p)
337 (not auto-revert-tail-pos) ; library was loaded only after finding file 337 (zerop auto-revert-tail-pos) ; library was loaded only after finding file
338 (not (y-or-n-p "Buffer is modified, so tail offset may be wrong. Proceed? "))) 338 (not (y-or-n-p "Buffer is modified, so tail offset may be wrong. Proceed? ")))
339 (auto-revert-tail-mode 0) 339 (auto-revert-tail-mode 0)
340 ;; a-r-tail-pos stores the size of the file at the time of the
341 ;; last revert. After this package loads, it adds a
342 ;; find-file-hook to set this variable every time a file is
343 ;; loaded. If the package is loaded only _after_ visiting the
344 ;; file to be reverted, then we have no idea what the value of
345 ;; a-r-tail-pos should have been when the file was visited. If
346 ;; the file has changed on disk in the meantime, all we can do
347 ;; is offer to revert the whole thing. If you choose not to
348 ;; revert, then you might miss some output then happened
349 ;; between visiting the file and activating a-r-t-mode.
350 (and (zerop auto-revert-tail-pos)
351 (not (verify-visited-file-modtime (current-buffer)))
352 (y-or-n-p "File changed on disk, content may be missing. \
353Perform a full revert? ")
354 ;; Use this (not just revert-buffer) for point-preservation.
355 (auto-revert-handler))
340 ;; else we might reappend our own end when we save 356 ;; else we might reappend our own end when we save
341 (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t) 357 (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t)
342 (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position 358 (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 38184ae88a4..77c0423e157 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -501,7 +501,7 @@ Menu of mode operations in the mode line.")
501(defvar minor-mode-alist nil "\ 501(defvar minor-mode-alist nil "\
502Alist saying how to show minor modes in the mode line. 502Alist saying how to show minor modes in the mode line.
503Each element looks like (VARIABLE STRING); 503Each element looks like (VARIABLE STRING);
504STRING is included in the mode line iff VARIABLE's value is non-nil. 504STRING is included in the mode line if VARIABLE's value is non-nil.
505 505
506Actually, STRING need not be a string; any possible mode-line element 506Actually, STRING need not be a string; any possible mode-line element
507is okay. See `mode-line-format'.") 507is okay. See `mode-line-format'.")
diff --git a/lisp/calc/calc-nlfit.el b/lisp/calc/calc-nlfit.el
new file mode 100644
index 00000000000..489599781f6
--- /dev/null
+++ b/lisp/calc/calc-nlfit.el
@@ -0,0 +1,817 @@
1;;; calc-nlfit.el --- nonlinear curve fitting for Calc
2
3;; Copyright (C) 2007 Free Software Foundation, Inc.
4
5;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
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, or (at your option)
12;; 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; see the file COPYING. If not, write to the
21;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22;; Boston, MA 02110-1301, USA.
23
24;;; Commentary:
25
26;; This code uses the Levenberg-Marquardt method, as described in
27;; _Numerical Analysis_ by H. R. Schwarz, to fit data to
28;; nonlinear curves. Currently, the only the following curves are
29;; supported:
30;; The logistic S curve, y=a/(1+exp(b*(t-c)))
31;; Here, y is usually interpreted as the population of some
32;; quantity at time t. So we will think of the data as consisting
33;; of quantities q0, q1, ..., qn and their respective times
34;; t0, t1, ..., tn.
35
36;; The logistic bell curve, y=A*exp(B*(t-C))/(1+exp(B*(t-C)))^2
37;; Note that this is the derivative of the formula for the S curve.
38;; We get A=-a*b, B=b and C=c. Here, y is interpreted as the rate
39;; of growth of a population at time t. So we will think of the
40;; data as consisting of rates p0, p1, ..., pn and their
41;; respective times t0, t1, ..., tn.
42
43;; The Hubbert Linearization, y/x=A*(1-x/B)
44;; Here, y is thought of as the rate of growth of a population
45;; and x represents the actual population. This is essentially
46;; the differential equation describing the actual population.
47
48;; The Levenberg-Marquardt method is an iterative process: it takes
49;; an initial guess for the parameters and refines them. To get an
50;; initial guess for the parameters, we'll use a method described by
51;; Luis de Sousa in "Hubbert's Peak Mathematics". The idea is that
52;; given quantities Q and the corresponding rates P, they should
53;; satisfy P/Q= mQ+a. We can use the parameter a for an
54;; approximation for the parameter a in the S curve, and
55;; approximations for b and c are found using least squares on the
56;; linearization log((a/y)-1) = log(bb) + cc*t of
57;; y=a/(1+bb*exp(cc*t)), which is equivalent to the above s curve
58;; formula, and then tranlating it to b and c. From this, we can
59;; also get approximations for the bell curve parameters.
60
61;;; Code:
62
63(require 'calc-arith)
64
65(defun math-nlfit-least-squares (xdata ydata &optional sdata sigmas)
66 "Return the parameters A and B for the best least squares fit y=a+bx."
67 (let* ((n (length xdata))
68 (s2data (if sdata
69 (mapcar 'calcFunc-sqr sdata)
70 (make-list n 1)))
71 (S (if sdata 0 n))
72 (Sx 0)
73 (Sy 0)
74 (Sxx 0)
75 (Sxy 0)
76 D)
77 (while xdata
78 (let ((x (car xdata))
79 (y (car ydata))
80 (s (car s2data)))
81 (setq Sx (math-add Sx (if s (math-div x s) x)))
82 (setq Sy (math-add Sy (if s (math-div y s) y)))
83 (setq Sxx (math-add Sxx (if s (math-div (math-mul x x) s)
84 (math-mul x x))))
85 (setq Sxy (math-add Sxy (if s (math-div (math-mul x y) s)
86 (math-mul x y))))
87 (if sdata
88 (setq S (math-add S (math-div 1 s)))))
89 (setq xdata (cdr xdata))
90 (setq ydata (cdr ydata))
91 (setq s2data (cdr s2data)))
92 (setq D (math-sub (math-mul S Sxx) (math-mul Sx Sx)))
93 (let ((A (math-div (math-sub (math-mul Sxx Sy) (math-mul Sx Sxy)) D))
94 (B (math-div (math-sub (math-mul S Sxy) (math-mul Sx Sy)) D)))
95 (if sigmas
96 (let ((C11 (math-div Sxx D))
97 (C12 (math-neg (math-div Sx D)))
98 (C22 (math-div S D)))
99 (list (list 'sdev A (calcFunc-sqrt C11))
100 (list 'sdev B (calcFunc-sqrt C22))
101 (list 'vec
102 (list 'vec C11 C12)
103 (list 'vec C12 C22))))
104 (list A B)))))
105
106;;; The methods described by de Sousa require the cumulative data qdata
107;;; and the rates pdata. We will assume that we are given either
108;;; qdata and the corresponding times tdata, or pdata and the corresponding
109;;; tdata. The following two functions will find pdata or qdata,
110;;; given the other..
111
112;;; First, given two lists; one of values q0, q1, ..., qn and one of
113;;; corresponding times t0, t1, ..., tn; return a list
114;;; p0, p1, ..., pn of the rates of change of the qi with respect to t.
115;;; p0 is the right hand derivative (q1 - q0)/(t1 - t0).
116;;; pn is the left hand derivative (qn - q(n-1))/(tn - t(n-1)).
117;;; The other pis are the averages of the two:
118;;; (1/2)((qi - q(i-1))/(ti - t(i-1)) + (q(i+1) - qi)/(t(i+1) - ti)).
119
120(defun math-nlfit-get-rates-from-cumul (tdata qdata)
121 (let ((pdata (list
122 (math-div
123 (math-sub (nth 1 qdata)
124 (nth 0 qdata))
125 (math-sub (nth 1 tdata)
126 (nth 0 tdata))))))
127 (while (> (length qdata) 2)
128 (setq pdata
129 (cons
130 (math-mul
131 '(float 5 -1)
132 (math-add
133 (math-div
134 (math-sub (nth 2 qdata)
135 (nth 1 qdata))
136 (math-sub (nth 2 tdata)
137 (nth 1 tdata)))
138 (math-div
139 (math-sub (nth 1 qdata)
140 (nth 0 qdata))
141 (math-sub (nth 1 tdata)
142 (nth 0 tdata)))))
143 pdata))
144 (setq qdata (cdr qdata)))
145 (setq pdata
146 (cons
147 (math-div
148 (math-sub (nth 1 qdata)
149 (nth 0 qdata))
150 (math-sub (nth 1 tdata)
151 (nth 0 tdata)))
152 pdata))
153 (reverse pdata)))
154
155;;; Next, given two lists -- one of rates p0, p1, ..., pn and one of
156;;; corresponding times t0, t1, ..., tn -- and an initial values q0,
157;;; return a list q0, q1, ..., qn of the cumulative values.
158;;; q0 is the initial value given.
159;;; For i>0, qi is computed using the trapezoid rule:
160;;; qi = q(i-1) + (1/2)(pi + p(i-1))(ti - t(i-1))
161
162(defun math-nlfit-get-cumul-from-rates (tdata pdata q0)
163 (let* ((qdata (list q0)))
164 (while (cdr pdata)
165 (setq qdata
166 (cons
167 (math-add (car qdata)
168 (math-mul
169 (math-mul
170 '(float 5 -1)
171 (math-add (nth 1 pdata) (nth 0 pdata)))
172 (math-sub (nth 1 tdata)
173 (nth 0 tdata))))
174 qdata))
175 (setq pdata (cdr pdata))
176 (setq tdata (cdr tdata)))
177 (reverse qdata)))
178
179;;; Given the qdata, pdata and tdata, find the parameters
180;;; a, b and c that fit q = a/(1+b*exp(c*t)).
181;;; a is found using the method described by de Sousa.
182;;; b and c are found using least squares on the linearization
183;;; log((a/q)-1) = log(b) + c*t
184;;; In some cases (where the logistic curve may well be the wrong
185;;; model), the computed a will be less than or equal to the maximum
186;;; value of q in qdata; in which case the above linearization won't work.
187;;; In this case, a will be replaced by a number slightly above
188;;; the maximum value of q.
189
190(defun math-nlfit-find-qmax (qdata pdata tdata)
191 (let* ((ratios (mapcar* 'math-div pdata qdata))
192 (lsdata (math-nlfit-least-squares ratios tdata))
193 (qmax (math-max-list (car qdata) (cdr qdata)))
194 (a (math-neg (math-div (nth 1 lsdata) (nth 0 lsdata)))))
195 (if (math-lessp a qmax)
196 (math-add '(float 5 -1) qmax)
197 a)))
198
199(defun math-nlfit-find-logistic-parameters (qdata pdata tdata)
200 (let* ((a (math-nlfit-find-qmax qdata pdata tdata))
201 (newqdata
202 (mapcar (lambda (q) (calcFunc-ln (math-sub (math-div a q) 1)))
203 qdata))
204 (bandc (math-nlfit-least-squares tdata newqdata)))
205 (list
206 a
207 (calcFunc-exp (nth 0 bandc))
208 (nth 1 bandc))))
209
210;;; Next, given the pdata and tdata, we can find the qdata if we know q0.
211;;; We first try to find q0, using the fact that when p takes on its largest
212;;; value, q is half of its maximum value. So we'll find the maximum value
213;;; of q given various q0, and use bisection to approximate the correct q0.
214
215;;; First, given pdata and tdata, find what half of qmax would be if q0=0.
216
217(defun math-nlfit-find-qmaxhalf (pdata tdata)
218 (let ((pmax (math-max-list (car pdata) (cdr pdata)))
219 (qmh 0))
220 (while (math-lessp (car pdata) pmax)
221 (setq qmh
222 (math-add qmh
223 (math-mul
224 (math-mul
225 '(float 5 -1)
226 (math-add (nth 1 pdata) (nth 0 pdata)))
227 (math-sub (nth 1 tdata)
228 (nth 0 tdata)))))
229 (setq pdata (cdr pdata))
230 (setq tdata (cdr tdata)))
231 qmh))
232
233;;; Next, given pdata and tdata, approximate q0.
234
235(defun math-nlfit-find-q0 (pdata tdata)
236 (let* ((qhalf (math-nlfit-find-qmaxhalf pdata tdata))
237 (q0 (math-mul 2 qhalf))
238 (qdata (math-nlfit-get-cumul-from-rates tdata pdata q0)))
239 (while (math-lessp (math-nlfit-find-qmax
240 (mapcar
241 (lambda (q) (math-add q0 q))
242 qdata)
243 pdata tdata)
244 (math-mul
245 '(float 5 -1)
246 (math-add
247 q0
248 qhalf)))
249 (setq q0 (math-add q0 qhalf)))
250 (let* ((qmin (math-sub q0 qhalf))
251 (qmax q0)
252 (qt (math-nlfit-find-qmax
253 (mapcar
254 (lambda (q) (math-add q0 q))
255 qdata)
256 pdata tdata))
257 (i 0))
258 (while (< i 10)
259 (setq q0 (math-mul '(float 5 -1) (math-add qmin qmax)))
260 (if (math-lessp
261 (math-nlfit-find-qmax
262 (mapcar
263 (lambda (q) (math-add q0 q))
264 qdata)
265 pdata tdata)
266 (math-mul '(float 5 -1) (math-add qhalf q0)))
267 (setq qmin q0)
268 (setq qmax q0))
269 (setq i (1+ i)))
270 (math-mul '(float 5 -1) (math-add qmin qmax)))))
271
272;;; To improve the approximations to the parameters, we can use
273;;; Marquardt method as described in Schwarz's book.
274
275;;; Small numbers used in the Givens algorithm
276(defvar math-nlfit-delta '(float 1 -8))
277
278(defvar math-nlfit-epsilon '(float 1 -5))
279
280;;; Maximum number of iterations
281(defvar math-nlfit-max-its 100)
282
283;;; Next, we need some functions for dealing with vectors and
284;;; matrices. For convenience, we'll work with Emacs lists
285;;; as vectors, rather than Calc's vectors.
286
287(defun math-nlfit-set-elt (vec i x)
288 (setcar (nthcdr (1- i) vec) x))
289
290(defun math-nlfit-get-elt (vec i)
291 (nth (1- i) vec))
292
293(defun math-nlfit-make-matrix (i j)
294 (let ((row (make-list j 0))
295 (mat nil)
296 (k 0))
297 (while (< k i)
298 (setq mat (cons (copy-list row) mat))
299 (setq k (1+ k)))
300 mat))
301
302(defun math-nlfit-set-matx-elt (mat i j x)
303 (setcar (nthcdr (1- j) (nth (1- i) mat)) x))
304
305(defun math-nlfit-get-matx-elt (mat i j)
306 (nth (1- j) (nth (1- i) mat)))
307
308;;; For solving the linearized system.
309;;; (The Givens method, from Schwarz.)
310
311(defun math-nlfit-givens (C d)
312 (let* ((C (copy-tree C))
313 (d (copy-tree d))
314 (n (length (car C)))
315 (N (length C))
316 (j 1)
317 (r (make-list N 0))
318 (x (make-list N 0))
319 w
320 gamma
321 sigma
322 rho)
323 (while (<= j n)
324 (let ((i (1+ j)))
325 (while (<= i N)
326 (let ((cij (math-nlfit-get-matx-elt C i j))
327 (cjj (math-nlfit-get-matx-elt C j j)))
328 (when (not (math-equal 0 cij))
329 (if (math-lessp (calcFunc-abs cjj)
330 (math-mul math-nlfit-delta (calcFunc-abs cij)))
331 (setq w (math-neg cij)
332 gamma 0
333 sigma 1
334 rho 1)
335 (setq w (math-mul
336 (calcFunc-sign cjj)
337 (calcFunc-sqrt
338 (math-add
339 (math-mul cjj cjj)
340 (math-mul cij cij))))
341 gamma (math-div cjj w)
342 sigma (math-neg (math-div cij w)))
343 (if (math-lessp (calcFunc-abs sigma) gamma)
344 (setq rho sigma)
345 (setq rho (math-div (calcFunc-sign sigma) gamma))))
346 (setq cjj w
347 cij rho)
348 (math-nlfit-set-matx-elt C j j w)
349 (math-nlfit-set-matx-elt C i j rho)
350 (let ((k (1+ j)))
351 (while (<= k n)
352 (let* ((cjk (math-nlfit-get-matx-elt C j k))
353 (cik (math-nlfit-get-matx-elt C i k))
354 (h (math-sub
355 (math-mul gamma cjk) (math-mul sigma cik))))
356 (setq cik (math-add
357 (math-mul sigma cjk)
358 (math-mul gamma cik)))
359 (setq cjk h)
360 (math-nlfit-set-matx-elt C i k cik)
361 (math-nlfit-set-matx-elt C j k cjk)
362 (setq k (1+ k)))))
363 (let* ((di (math-nlfit-get-elt d i))
364 (dj (math-nlfit-get-elt d j))
365 (h (math-sub
366 (math-mul gamma dj)
367 (math-mul sigma di))))
368 (setq di (math-add
369 (math-mul sigma dj)
370 (math-mul gamma di)))
371 (setq dj h)
372 (math-nlfit-set-elt d i di)
373 (math-nlfit-set-elt d j dj))))
374 (setq i (1+ i))))
375 (setq j (1+ j)))
376 (let ((i n)
377 s)
378 (while (>= i 1)
379 (math-nlfit-set-elt r i 0)
380 (setq s (math-nlfit-get-elt d i))
381 (let ((k (1+ i)))
382 (while (<= k n)
383 (setq s (math-add s (math-mul (math-nlfit-get-matx-elt C i k)
384 (math-nlfit-get-elt x k))))
385 (setq k (1+ k))))
386 (math-nlfit-set-elt x i
387 (math-neg
388 (math-div s
389 (math-nlfit-get-matx-elt C i i))))
390 (setq i (1- i))))
391 (let ((i (1+ n)))
392 (while (<= i N)
393 (math-nlfit-set-elt r i (math-nlfit-get-elt d i))
394 (setq i (1+ i))))
395 (let ((j n))
396 (while (>= j 1)
397 (let ((i N))
398 (while (>= i (1+ j))
399 (setq rho (math-nlfit-get-matx-elt C i j))
400 (if (math-equal rho 1)
401 (setq gamma 0
402 sigma 1)
403 (if (math-lessp (calcFunc-abs rho) 1)
404 (setq sigma rho
405 gamma (calcFunc-sqrt
406 (math-sub 1 (math-mul sigma sigma))))
407 (setq gamma (math-div 1 (calcFunc-abs rho))
408 sigma (math-mul (calcFunc-sign rho)
409 (calcFunc-sqrt
410 (math-sub 1 (math-mul gamma gamma)))))))
411 (let ((ri (math-nlfit-get-elt r i))
412 (rj (math-nlfit-get-elt r j))
413 h)
414 (setq h (math-add (math-mul gamma rj)
415 (math-mul sigma ri)))
416 (setq ri (math-sub
417 (math-mul gamma ri)
418 (math-mul sigma rj)))
419 (setq rj h)
420 (math-nlfit-set-elt r i ri)
421 (math-nlfit-set-elt r j rj))
422 (setq i (1- i))))
423 (setq j (1- j))))
424
425 x))
426
427(defun math-nlfit-jacobian (grad xlist parms &optional slist)
428 (let ((j nil))
429 (while xlist
430 (let ((row (apply grad (car xlist) parms)))
431 (setq j
432 (cons
433 (if slist
434 (mapcar (lambda (x) (math-div x (car slist))) row)
435 row)
436 j)))
437 (setq slist (cdr slist))
438 (setq xlist (cdr xlist)))
439 (reverse j)))
440
441(defun math-nlfit-make-ident (l n)
442 (let ((m (math-nlfit-make-matrix n n))
443 (i 1))
444 (while (<= i n)
445 (math-nlfit-set-matx-elt m i i l)
446 (setq i (1+ i)))
447 m))
448
449(defun math-nlfit-chi-sq (xlist ylist parms fn &optional slist)
450 (let ((cs 0))
451 (while xlist
452 (let ((c
453 (math-sub
454 (apply fn (car xlist) parms)
455 (car ylist))))
456 (if slist
457 (setq c (math-div c (car slist))))
458 (setq cs
459 (math-add cs
460 (math-mul c c))))
461 (setq xlist (cdr xlist))
462 (setq ylist (cdr ylist))
463 (setq slist (cdr slist)))
464 cs))
465
466(defun math-nlfit-init-lambda (C)
467 (let ((l 0)
468 (n (length (car C)))
469 (N (length C)))
470 (while C
471 (let ((row (car C)))
472 (while row
473 (setq l (math-add l (math-mul (car row) (car row))))
474 (setq row (cdr row))))
475 (setq C (cdr C)))
476 (calcFunc-sqrt (math-div l (math-mul n N)))))
477
478(defun math-nlfit-make-Ctilda (C l)
479 (let* ((n (length (car C)))
480 (bot (math-nlfit-make-ident l n)))
481 (append C bot)))
482
483(defun math-nlfit-make-d (fn xdata ydata parms &optional sdata)
484 (let ((d nil))
485 (while xdata
486 (setq d (cons
487 (let ((dd (math-sub (apply fn (car xdata) parms)
488 (car ydata))))
489 (if sdata (math-div dd (car sdata)) dd))
490 d))
491 (setq xdata (cdr xdata))
492 (setq ydata (cdr ydata))
493 (setq sdata (cdr sdata)))
494 (reverse d)))
495
496(defun math-nlfit-make-dtilda (d n)
497 (append d (make-list n 0)))
498
499(defun math-nlfit-fit (xlist ylist parms fn grad &optional slist)
500 (let*
501 ((C (math-nlfit-jacobian grad xlist parms slist))
502 (d (math-nlfit-make-d fn xlist ylist parms slist))
503 (chisq (math-nlfit-chi-sq xlist ylist parms fn slist))
504 (lambda (math-nlfit-init-lambda C))
505 (really-done nil)
506 (iters 0))
507 (while (and
508 (not really-done)
509 (< iters math-nlfit-max-its))
510 (setq iters (1+ iters))
511 (let ((done nil))
512 (while (not done)
513 (let* ((Ctilda (math-nlfit-make-Ctilda C lambda))
514 (dtilda (math-nlfit-make-dtilda d (length (car C))))
515 (zeta (math-nlfit-givens Ctilda dtilda))
516 (newparms (mapcar* 'math-add (copy-tree parms) zeta))
517 (newchisq (math-nlfit-chi-sq xlist ylist newparms fn slist)))
518 (if (math-lessp newchisq chisq)
519 (progn
520 (if (math-lessp
521 (math-div
522 (math-sub chisq newchisq) newchisq) math-nlfit-epsilon)
523 (setq really-done t))
524 (setq lambda (math-div lambda 10))
525 (setq chisq newchisq)
526 (setq parms newparms)
527 (setq done t))
528 (setq lambda (math-mul lambda 10)))))
529 (setq C (math-nlfit-jacobian grad xlist parms slist))
530 (setq d (math-nlfit-make-d fn xlist ylist parms slist))))
531 (list chisq parms)))
532
533;;; The functions that describe our models, and their gradients.
534
535(defun math-nlfit-s-logistic-fn (x a b c)
536 (math-div a (math-add 1 (math-mul b (calcFunc-exp (math-mul c x))))))
537
538(defun math-nlfit-s-logistic-grad (x a b c)
539 (let* ((ep (calcFunc-exp (math-mul c x)))
540 (d (math-add 1 (math-mul b ep)))
541 (d2 (math-mul d d)))
542 (list
543 (math-div 1 d)
544 (math-neg (math-div (math-mul a ep) d2))
545 (math-neg (math-div (math-mul a (math-mul b (math-mul x ep))) d2)))))
546
547(defun math-nlfit-b-logistic-fn (x a c d)
548 (let ((ex (calcFunc-exp (math-mul c (math-sub x d)))))
549 (math-div
550 (math-mul a ex)
551 (math-sqr
552 (math-add
553 1 ex)))))
554
555(defun math-nlfit-b-logistic-grad (x a c d)
556 (let* ((ex (calcFunc-exp (math-mul c (math-sub x d))))
557 (ex1 (math-add 1 ex))
558 (xd (math-sub x d)))
559 (list
560 (math-div
561 ex
562 (math-sqr ex1))
563 (math-sub
564 (math-div
565 (math-mul a (math-mul xd ex))
566 (math-sqr ex1))
567 (math-div
568 (math-mul 2 (math-mul a (math-mul xd (math-sqr ex))))
569 (math-pow ex1 3)))
570 (math-sub
571 (math-div
572 (math-mul 2 (math-mul a (math-mul c (math-sqr ex))))
573 (math-pow ex1 3))
574 (math-div
575 (math-mul a (math-mul c ex))
576 (math-sqr ex1))))))
577
578;;; Functions to get the final covariance matrix and the sdevs
579
580(defun math-nlfit-find-covar (grad xlist pparms)
581 (let ((j nil))
582 (while xlist
583 (setq j (cons (cons 'vec (apply grad (car xlist) pparms)) j))
584 (setq xlist (cdr xlist)))
585 (setq j (cons 'vec (reverse j)))
586 (setq j
587 (math-mul
588 (calcFunc-trn j) j))
589 (calcFunc-inv j)))
590
591(defun math-nlfit-get-sigmas (grad xlist pparms chisq)
592 (let* ((sgs nil)
593 (covar (math-nlfit-find-covar grad xlist pparms))
594 (n (1- (length covar)))
595 (N (length xlist))
596 (i 1))
597 (when (> N n)
598 (while (<= i n)
599 (setq sgs (cons (calcFunc-sqrt (nth i (nth i covar))) sgs))
600 (setq i (1+ i)))
601 (setq sgs (reverse sgs)))
602 (list sgs covar)))
603
604;;; Now the Calc functions
605
606(defun math-nlfit-s-logistic-params (xdata ydata)
607 (let ((pdata (math-nlfit-get-rates-from-cumul xdata ydata)))
608 (math-nlfit-find-logistic-parameters ydata pdata xdata)))
609
610(defun math-nlfit-b-logistic-params (xdata ydata)
611 (let* ((q0 (math-nlfit-find-q0 ydata xdata))
612 (qdata (math-nlfit-get-cumul-from-rates xdata ydata q0))
613 (abc (math-nlfit-find-logistic-parameters qdata ydata xdata))
614 (B (nth 1 abc))
615 (C (nth 2 abc))
616 (A (math-neg
617 (math-mul
618 (nth 0 abc)
619 (math-mul B C))))
620 (D (math-neg (math-div (calcFunc-ln B) C)))
621 (A (math-div A B)))
622 (list A C D)))
623
624;;; Some functions to turn the parameter lists and variables
625;;; into the appropriate functions.
626
627(defun math-nlfit-s-logistic-solnexpr (pms var)
628 (let ((a (nth 0 pms))
629 (b (nth 1 pms))
630 (c (nth 2 pms)))
631 (list '/ a
632 (list '+
633 1
634 (list '*
635 b
636 (calcFunc-exp
637 (list '*
638 c
639 var)))))))
640
641(defun math-nlfit-b-logistic-solnexpr (pms var)
642 (let ((a (nth 0 pms))
643 (c (nth 1 pms))
644 (d (nth 2 pms)))
645 (list '/
646 (list '*
647 a
648 (calcFunc-exp
649 (list '*
650 c
651 (list '- var d))))
652 (list '^
653 (list '+
654 1
655 (calcFunc-exp
656 (list '*
657 c
658 (list '- var d))))
659 2))))
660
661(defun math-nlfit-enter-result (n prefix vals)
662 (setq calc-aborted-prefix prefix)
663 (calc-pop-push-record-list n prefix vals)
664 (calc-handle-whys))
665
666(defun math-nlfit-fit-curve (fn grad solnexpr initparms &optional sdv)
667 (calc-slow-wrapper
668 (let* ((sdevv (or (eq sdv 'calcFunc-efit) (eq sdv 'calcFunc-xfit)))
669 (calc-display-working-message nil)
670 (data (calc-top 1))
671 (xdata (cdr (car (cdr data))))
672 (ydata (cdr (car (cdr (cdr data)))))
673 (sdata (if (math-contains-sdev-p ydata)
674 (mapcar (lambda (x) (math-get-sdev x t)) ydata)
675 nil))
676 (ydata (mapcar (lambda (x) (math-get-value x)) ydata))
677 (calc-curve-varnames nil)
678 (calc-curve-coefnames nil)
679 (calc-curve-nvars 1)
680 (fitvars (calc-get-fit-variables 1 3))
681 (var (nth 1 calc-curve-varnames))
682 (parms (cdr calc-curve-coefnames))
683 (parmguess
684 (funcall initparms xdata ydata))
685 (fit (math-nlfit-fit xdata ydata parmguess fn grad sdata))
686 (finalparms (nth 1 fit))
687 (sigmacovar
688 (if sdevv
689 (math-nlfit-get-sigmas grad xdata finalparms (nth 0 fit))))
690 (sigmas
691 (if sdevv
692 (nth 0 sigmacovar)))
693 (finalparms
694 (if sigmas
695 (mapcar* (lambda (x y) (list 'sdev x y)) finalparms sigmas)
696 finalparms))
697 (soln (funcall solnexpr finalparms var)))
698 (let ((calc-fit-to-trail t)
699 (traillist nil))
700 (while parms
701 (setq traillist (cons (list 'calcFunc-eq (car parms) (car finalparms))
702 traillist))
703 (setq finalparms (cdr finalparms))
704 (setq parms (cdr parms)))
705 (setq traillist (calc-normalize (cons 'vec (nreverse traillist))))
706 (cond ((eq sdv 'calcFunc-efit)
707 (math-nlfit-enter-result 1 "efit" soln))
708 ((eq sdv 'calcFunc-xfit)
709 (let (sln)
710 (setq sln
711 (list 'vec
712 soln
713 traillist
714 (nth 1 sigmacovar)
715 '(vec)
716 (nth 0 fit)
717 (let ((n (length xdata))
718 (m (length finalparms)))
719 (if (and sdata (> n m))
720 (calcFunc-utpc (nth 0 fit)
721 (- n m))
722 '(var nan var-nan)))))
723 (math-nlfit-enter-result 1 "xfit" sln)))
724 (t
725 (math-nlfit-enter-result 1 "fit" soln)))
726 (calc-record traillist "parm")))))
727
728(defun calc-fit-s-shaped-logistic-curve (arg)
729 (interactive "P")
730 (math-nlfit-fit-curve 'math-nlfit-s-logistic-fn
731 'math-nlfit-s-logistic-grad
732 'math-nlfit-s-logistic-solnexpr
733 'math-nlfit-s-logistic-params
734 arg))
735
736(defun calc-fit-bell-shaped-logistic-curve (arg)
737 (interactive "P")
738 (math-nlfit-fit-curve 'math-nlfit-b-logistic-fn
739 'math-nlfit-b-logistic-grad
740 'math-nlfit-b-logistic-solnexpr
741 'math-nlfit-b-logistic-params
742 arg))
743
744(defun calc-fit-hubbert-linear-curve (&optional sdv)
745 (calc-slow-wrapper
746 (let* ((sdevv (or (eq sdv 'calcFunc-efit) (eq sdv 'calcFunc-xfit)))
747 (calc-display-working-message nil)
748 (data (calc-top 1))
749 (qdata (cdr (car (cdr data))))
750 (pdata (cdr (car (cdr (cdr data)))))
751 (sdata (if (math-contains-sdev-p pdata)
752 (mapcar (lambda (x) (math-get-sdev x t)) pdata)
753 nil))
754 (pdata (mapcar (lambda (x) (math-get-value x)) pdata))
755 (poverqdata (mapcar* 'math-div pdata qdata))
756 (parmvals (math-nlfit-least-squares qdata poverqdata sdata sdevv))
757 (finalparms (list (nth 0 parmvals)
758 (math-neg
759 (math-div (nth 0 parmvals)
760 (nth 1 parmvals)))))
761 (calc-curve-varnames nil)
762 (calc-curve-coefnames nil)
763 (calc-curve-nvars 1)
764 (fitvars (calc-get-fit-variables 1 2))
765 (var (nth 1 calc-curve-varnames))
766 (parms (cdr calc-curve-coefnames))
767 (soln (list '* (nth 0 finalparms)
768 (list '- 1
769 (list '/ var (nth 1 finalparms))))))
770 (let ((calc-fit-to-trail t)
771 (traillist nil))
772 (setq traillist
773 (list 'vec
774 (list 'calcFunc-eq (nth 0 parms) (nth 0 finalparms))
775 (list 'calcFunc-eq (nth 1 parms) (nth 1 finalparms))))
776 (cond ((eq sdv 'calcFunc-efit)
777 (math-nlfit-enter-result 1 "efit" soln))
778 ((eq sdv 'calcFunc-xfit)
779 (let (sln
780 (chisq
781 (math-nlfit-chi-sq
782 qdata poverqdata
783 (list (nth 1 (nth 0 finalparms))
784 (nth 1 (nth 1 finalparms)))
785 (lambda (x a b)
786 (math-mul a
787 (math-sub
788 1
789 (math-div x b))))
790 sdata)))
791 (setq sln
792 (list 'vec
793 soln
794 traillist
795 (nth 2 parmvals)
796 (list
797 'vec
798 '(calcFunc-fitdummy 1)
799 (list 'calcFunc-neg
800 (list '/
801 '(calcFunc-fitdummy 1)
802 '(calcFunc-fitdummy 2))))
803 chisq
804 (let ((n (length qdata)))
805 (if (and sdata (> n 2))
806 (calcFunc-utpc
807 chisq
808 (- n 2))
809 '(var nan var-nan)))))
810 (math-nlfit-enter-result 1 "xfit" sln)))
811 (t
812 (math-nlfit-enter-result 1 "fit" soln)))
813 (calc-record traillist "parm")))))
814
815(provide 'calc-nlfit)
816
817;; arch-tag: 6eba3cd6-f48b-4a84-8174-10c15a024928
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 82769a66b13..e823a57aef0 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -49,7 +49,7 @@
49(defvar math-standard-units 49(defvar math-standard-units
50 '( ;; Length 50 '( ;; Length
51 ( m nil "*Meter" ) 51 ( m nil "*Meter" )
52 ( in "2.54 cm" "Inch" ) 52 ( in "2.54 cm" "Inch" )
53 ( ft "12 in" "Foot" ) 53 ( ft "12 in" "Foot" )
54 ( yd "3 ft" "Yard" ) 54 ( yd "3 ft" "Yard" )
55 ( mi "5280 ft" "Mile" ) 55 ( mi "5280 ft" "Mile" )
@@ -971,17 +971,17 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).")
971 (symbol-name v))))))) 971 (symbol-name v)))))))
972 (or (eq (nth 3 uold) (nth 3 unew)) 972 (or (eq (nth 3 uold) (nth 3 unew))
973 (cond ((eq (nth 3 uold) 'K) 973 (cond ((eq (nth 3 uold) 'K)
974 (setq expr (list '- expr '(float 27315 -2))) 974 (setq expr (list '- expr '(/ 27315 100)))
975 (if (eq (nth 3 unew) 'F) 975 (if (eq (nth 3 unew) 'F)
976 (setq expr (list '+ (list '* expr '(frac 9 5)) 32)))) 976 (setq expr (list '+ (list '* expr '(/ 9 5)) 32))))
977 ((eq (nth 3 uold) 'C) 977 ((eq (nth 3 uold) 'C)
978 (if (eq (nth 3 unew) 'F) 978 (if (eq (nth 3 unew) 'F)
979 (setq expr (list '+ (list '* expr '(frac 9 5)) 32)) 979 (setq expr (list '+ (list '* expr '(/ 9 5)) 32))
980 (setq expr (list '+ expr '(float 27315 -2))))) 980 (setq expr (list '+ expr '(/ 27315 100)))))
981 (t 981 (t
982 (setq expr (list '* (list '- expr 32) '(frac 5 9))) 982 (setq expr (list '* (list '- expr 32) '(/ 5 9)))
983 (if (eq (nth 3 unew) 'K) 983 (if (eq (nth 3 unew) 'K)
984 (setq expr (list '+ expr '(float 27315 -2))))))) 984 (setq expr (list '+ expr '(/ 27315 100)))))))
985 (if pure 985 (if pure
986 expr 986 expr
987 (list '* expr new)))) 987 (list '* expr new))))
diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el
index 9f263a2281a..5aa410be19e 100644
--- a/lisp/calc/calcalg3.el
+++ b/lisp/calc/calcalg3.el
@@ -115,6 +115,8 @@
115 (if (calc-is-hyperbolic) 'calcFunc-efit 115 (if (calc-is-hyperbolic) 'calcFunc-efit
116 'calcFunc-fit))) 116 'calcFunc-fit)))
117 key (which 0) 117 key (which 0)
118 (nonlinear nil)
119 (plot nil)
118 n calc-curve-nvars temp data 120 n calc-curve-nvars temp data
119 (homog nil) 121 (homog nil)
120 (msgs '( "(Press ? for help)" 122 (msgs '( "(Press ? for help)"
@@ -125,12 +127,18 @@
125 "E = a 10^(b x), X = 10^(a + b x), L = a + b log10(x)" 127 "E = a 10^(b x), X = 10^(a + b x), L = a + b log10(x)"
126 "q = a + b (x-c)^2" 128 "q = a + b (x-c)^2"
127 "g = (a/b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)" 129 "g = (a/b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)"
130 "s = a/(1 + exp(b (x - c)))"
131 "b = a exp(b (x - c))/(1 + exp(b (x - c)))^2"
132 "o = (y/x) = a (1 - x/b)"
128 "h prefix = homogeneous model (no constant term)" 133 "h prefix = homogeneous model (no constant term)"
134 "P prefix = plot result"
129 "' = alg entry, $ = stack, u = Model1, U = Model2"))) 135 "' = alg entry, $ = stack, u = Model1, U = Model2")))
130 (while (not calc-curve-model) 136 (while (not calc-curve-model)
131 (message "Fit to model: %s:%s" 137 (message
132 (nth which msgs) 138 "Fit to model: %s:%s%s"
133 (if homog " h" "")) 139 (nth which msgs)
140 (if plot "P" " ")
141 (if homog "h" ""))
134 (setq key (read-char)) 142 (setq key (read-char))
135 (cond ((= key ?\C-g) 143 (cond ((= key ?\C-g)
136 (keyboard-quit)) 144 (keyboard-quit))
@@ -138,6 +146,16 @@
138 (setq which (% (1+ which) (length msgs)))) 146 (setq which (% (1+ which) (length msgs))))
139 ((memq key '(?h ?H)) 147 ((memq key '(?h ?H))
140 (setq homog (not homog))) 148 (setq homog (not homog)))
149 ((= key ?P)
150 (if plot
151 (setq plot nil)
152 (let ((data (calc-top 1)))
153 (if (or
154 (calc-is-hyperbolic)
155 (calc-is-inverse)
156 (not (= (length data) 3)))
157 (setq plot "Can't plot")
158 (setq plot data)))))
141 ((progn 159 ((progn
142 (if (eq key ?\$) 160 (if (eq key ?\$)
143 (setq n 1) 161 (setq n 1)
@@ -164,8 +182,9 @@
164 ((= key ?1) ; linear or multilinear 182 ((= key ?1) ; linear or multilinear
165 (calc-get-fit-variables calc-curve-nvars 183 (calc-get-fit-variables calc-curve-nvars
166 (1+ calc-curve-nvars) (and homog 0)) 184 (1+ calc-curve-nvars) (and homog 0))
167 (setq calc-curve-model (math-mul calc-curve-coefnames 185 (setq calc-curve-model
168 (cons 'vec (cons 1 (cdr calc-curve-varnames)))))) 186 (math-mul calc-curve-coefnames
187 (cons 'vec (cons 1 (cdr calc-curve-varnames))))))
169 ((and (>= key ?2) (<= key ?9)) ; polynomial 188 ((and (>= key ?2) (<= key ?9)) ; polynomial
170 (calc-get-fit-variables 1 (- key ?0 -1) (and homog 0)) 189 (calc-get-fit-variables 1 (- key ?0 -1) (and homog 0))
171 (setq calc-curve-model 190 (setq calc-curve-model
@@ -180,58 +199,88 @@
180 ((= key ?p) ; power law 199 ((= key ?p) ; power law
181 (calc-get-fit-variables calc-curve-nvars 200 (calc-get-fit-variables calc-curve-nvars
182 (1+ calc-curve-nvars) (and homog 1)) 201 (1+ calc-curve-nvars) (and homog 1))
183 (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames) 202 (setq calc-curve-model
184 (calcFunc-reduce 203 (math-mul
185 '(var mul var-mul) 204 (nth 1 calc-curve-coefnames)
186 (calcFunc-map 205 (calcFunc-reduce
187 '(var pow var-pow) 206 '(var mul var-mul)
188 calc-curve-varnames 207 (calcFunc-map
189 (cons 'vec (cdr (cdr calc-curve-coefnames)))))))) 208 '(var pow var-pow)
209 calc-curve-varnames
210 (cons 'vec (cdr (cdr calc-curve-coefnames))))))))
190 ((= key ?^) ; exponential law 211 ((= key ?^) ; exponential law
191 (calc-get-fit-variables calc-curve-nvars 212 (calc-get-fit-variables calc-curve-nvars
192 (1+ calc-curve-nvars) (and homog 1)) 213 (1+ calc-curve-nvars) (and homog 1))
193 (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames) 214 (setq calc-curve-model
194 (calcFunc-reduce 215 (math-mul (nth 1 calc-curve-coefnames)
195 '(var mul var-mul) 216 (calcFunc-reduce
196 (calcFunc-map 217 '(var mul var-mul)
197 '(var pow var-pow) 218 (calcFunc-map
198 (cons 'vec (cdr (cdr calc-curve-coefnames))) 219 '(var pow var-pow)
199 calc-curve-varnames))))) 220 (cons 'vec (cdr (cdr calc-curve-coefnames)))
221 calc-curve-varnames)))))
222 ((= key ?s)
223 (setq nonlinear t)
224 (setq calc-curve-model t)
225 (require 'calc-nlfit)
226 (calc-fit-s-shaped-logistic-curve func))
227 ((= key ?b)
228 (setq nonlinear t)
229 (setq calc-curve-model t)
230 (require 'calc-nlfit)
231 (calc-fit-bell-shaped-logistic-curve func))
232 ((= key ?o)
233 (setq nonlinear t)
234 (setq calc-curve-model t)
235 (require 'calc-nlfit)
236 (if (and plot (not (stringp plot)))
237 (setq plot
238 (list 'vec
239 (nth 1 plot)
240 (cons
241 'vec
242 (mapcar* 'calcFunc-div
243 (cdr (nth 2 plot))
244 (cdr (nth 1 plot)))))))
245 (calc-fit-hubbert-linear-curve func))
200 ((memq key '(?e ?E)) 246 ((memq key '(?e ?E))
201 (calc-get-fit-variables calc-curve-nvars 247 (calc-get-fit-variables calc-curve-nvars
202 (1+ calc-curve-nvars) (and homog 1)) 248 (1+ calc-curve-nvars) (and homog 1))
203 (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames) 249 (setq calc-curve-model
204 (calcFunc-reduce 250 (math-mul (nth 1 calc-curve-coefnames)
205 '(var mul var-mul) 251 (calcFunc-reduce
206 (calcFunc-map 252 '(var mul var-mul)
207 (if (eq key ?e) 253 (calcFunc-map
208 '(var exp var-exp) 254 (if (eq key ?e)
209 '(calcFunc-lambda 255 '(var exp var-exp)
210 (var a var-a) 256 '(calcFunc-lambda
211 (^ 10 (var a var-a)))) 257 (var a var-a)
212 (calcFunc-map 258 (^ 10 (var a var-a))))
213 '(var mul var-mul) 259 (calcFunc-map
214 (cons 'vec (cdr (cdr calc-curve-coefnames))) 260 '(var mul var-mul)
215 calc-curve-varnames)))))) 261 (cons 'vec (cdr (cdr calc-curve-coefnames)))
262 calc-curve-varnames))))))
216 ((memq key '(?x ?X)) 263 ((memq key '(?x ?X))
217 (calc-get-fit-variables calc-curve-nvars 264 (calc-get-fit-variables calc-curve-nvars
218 (1+ calc-curve-nvars) (and homog 0)) 265 (1+ calc-curve-nvars) (and homog 0))
219 (setq calc-curve-model (math-mul calc-curve-coefnames 266 (setq calc-curve-model
220 (cons 'vec (cons 1 (cdr calc-curve-varnames))))) 267 (math-mul calc-curve-coefnames
268 (cons 'vec (cons 1 (cdr calc-curve-varnames)))))
221 (setq calc-curve-model (if (eq key ?x) 269 (setq calc-curve-model (if (eq key ?x)
222 (list 'calcFunc-exp calc-curve-model) 270 (list 'calcFunc-exp calc-curve-model)
223 (list '^ 10 calc-curve-model)))) 271 (list '^ 10 calc-curve-model))))
224 ((memq key '(?l ?L)) 272 ((memq key '(?l ?L))
225 (calc-get-fit-variables calc-curve-nvars 273 (calc-get-fit-variables calc-curve-nvars
226 (1+ calc-curve-nvars) (and homog 0)) 274 (1+ calc-curve-nvars) (and homog 0))
227 (setq calc-curve-model (math-mul calc-curve-coefnames 275 (setq calc-curve-model
228 (cons 'vec 276 (math-mul calc-curve-coefnames
229 (cons 1 (cdr (calcFunc-map 277 (cons 'vec
230 (if (eq key ?l) 278 (cons 1 (cdr (calcFunc-map
231 '(var ln var-ln) 279 (if (eq key ?l)
232 '(var log10 280 '(var ln var-ln)
233 var-log10)) 281 '(var log10
234 calc-curve-varnames))))))) 282 var-log10))
283 calc-curve-varnames)))))))
235 ((= key ?q) 284 ((= key ?q)
236 (calc-get-fit-variables calc-curve-nvars 285 (calc-get-fit-variables calc-curve-nvars
237 (1+ (* 2 calc-curve-nvars)) (and homog 0)) 286 (1+ (* 2 calc-curve-nvars)) (and homog 0))
@@ -247,12 +296,14 @@
247 (list '- (car v) (nth 1 c)) 296 (list '- (car v) (nth 1 c))
248 2))))))) 297 2)))))))
249 ((= key ?g) 298 ((= key ?g)
250 (setq calc-curve-model 299 (setq
251 (math-read-expr "(AFit / BFit sqrt(2 pi)) exp(-0.5 * ((XFit - CFit) / BFit)^2)") 300 calc-curve-model
252 calc-curve-varnames '(vec (var XFit var-XFit)) 301 (math-read-expr
253 calc-curve-coefnames '(vec (var AFit var-AFit) 302 "(AFit / BFit sqrt(2 pi)) exp(-0.5 * ((XFit - CFit) / BFit)^2)")
254 (var BFit var-BFit) 303 calc-curve-varnames '(vec (var XFit var-XFit))
255 (var CFit var-CFit))) 304 calc-curve-coefnames '(vec (var AFit var-AFit)
305 (var BFit var-BFit)
306 (var CFit var-CFit)))
256 (calc-get-fit-variables 1 (1- (length calc-curve-coefnames)) 307 (calc-get-fit-variables 1 (1- (length calc-curve-coefnames))
257 (and homog 1))) 308 (and homog 1)))
258 ((memq key '(?\$ ?\' ?u ?U)) 309 ((memq key '(?\$ ?\' ?u ?U))
@@ -262,8 +313,9 @@
262 (let* ((calc-dollar-values calc-arg-values) 313 (let* ((calc-dollar-values calc-arg-values)
263 (calc-dollar-used 0) 314 (calc-dollar-used 0)
264 (calc-hashes-used 0)) 315 (calc-hashes-used 0))
265 (setq calc-curve-model (calc-do-alg-entry "" "Model formula: " 316 (setq calc-curve-model
266 nil 'calc-curve-fit-history)) 317 (calc-do-alg-entry "" "Model formula: "
318 nil 'calc-curve-fit-history))
267 (if (/= (length calc-curve-model) 1) 319 (if (/= (length calc-curve-model) 1)
268 (error "Bad format")) 320 (error "Bad format"))
269 (setq calc-curve-model (car calc-curve-model) 321 (setq calc-curve-model (car calc-curve-model)
@@ -296,11 +348,13 @@
296 (or (nth 3 calc-curve-model) 348 (or (nth 3 calc-curve-model)
297 (cons 'vec 349 (cons 'vec
298 (math-all-vars-but 350 (math-all-vars-but
299 calc-curve-model calc-curve-varnames))) 351 calc-curve-model
352 calc-curve-varnames)))
300 calc-curve-model (nth 1 calc-curve-model)) 353 calc-curve-model (nth 1 calc-curve-model))
301 (error "Incorrect model specifier"))))) 354 (error "Incorrect model specifier")))))
302 (or calc-curve-varnames 355 (or calc-curve-varnames
303 (let ((with-y (eq (car-safe calc-curve-model) 'calcFunc-eq))) 356 (let ((with-y
357 (eq (car-safe calc-curve-model) 'calcFunc-eq)))
304 (if calc-curve-coefnames 358 (if calc-curve-coefnames
305 (calc-get-fit-variables 359 (calc-get-fit-variables
306 (if with-y (1+ calc-curve-nvars) calc-curve-nvars) 360 (if with-y (1+ calc-curve-nvars) calc-curve-nvars)
@@ -310,7 +364,10 @@
310 nil with-y) 364 nil with-y)
311 (let* ((coefs (math-all-vars-but calc-curve-model nil)) 365 (let* ((coefs (math-all-vars-but calc-curve-model nil))
312 (vars nil) 366 (vars nil)
313 (n (- (length coefs) calc-curve-nvars (if with-y 2 1))) 367 (n (-
368 (length coefs)
369 calc-curve-nvars
370 (if with-y 2 1)))
314 p) 371 p)
315 (if (< n 0) 372 (if (< n 0)
316 (error "Not enough variables in model")) 373 (error "Not enough variables in model"))
@@ -326,18 +383,43 @@
326 calc-curve-varnames calc-curve-coefnames) 383 calc-curve-varnames calc-curve-coefnames)
327 "modl")))) 384 "modl"))))
328 (t (beep)))) 385 (t (beep))))
329 (let ((calc-fit-to-trail t)) 386 (unless nonlinear
330 (calc-enter-result n (substring (symbol-name func) 9) 387 (let ((calc-fit-to-trail t))
331 (list func calc-curve-model 388 (calc-enter-result n (substring (symbol-name func) 9)
332 (if (= (length calc-curve-varnames) 2) 389 (list func calc-curve-model
333 (nth 1 calc-curve-varnames) 390 (if (= (length calc-curve-varnames) 2)
334 calc-curve-varnames) 391 (nth 1 calc-curve-varnames)
335 (if (= (length calc-curve-coefnames) 2) 392 calc-curve-varnames)
336 (nth 1 calc-curve-coefnames) 393 (if (= (length calc-curve-coefnames) 2)
337 calc-curve-coefnames) 394 (nth 1 calc-curve-coefnames)
338 data)) 395 calc-curve-coefnames)
339 (if (consp calc-fit-to-trail) 396 data))
340 (calc-record (calc-normalize calc-fit-to-trail) "parm")))))) 397 (if (consp calc-fit-to-trail)
398 (calc-record (calc-normalize calc-fit-to-trail) "parm"))))
399 (when plot
400 (if (stringp plot)
401 (message plot)
402 (let ((calc-graph-no-auto-view t))
403 (calc-graph-delete t)
404 (calc-graph-add-curve
405 (calc-graph-lookup (nth 1 plot))
406 (calc-graph-lookup (nth 2 plot)))
407 (unless (math-contains-sdev-p (nth 2 data))
408 (calc-graph-set-styles nil nil)
409 (calc-graph-point-style nil))
410 (setq plot (cdr (nth 1 plot)))
411 (setq plot
412 (list 'intv
413 3
414 (math-sub
415 (math-min-list (car plot) (cdr plot))
416 '(float 5 -1))
417 (math-add
418 '(float 5 -1)
419 (math-max-list (car plot) (cdr plot)))))
420 (calc-graph-add-curve (calc-graph-lookup plot)
421 (calc-graph-lookup (calc-top-n 1)))
422 (calc-graph-plot nil)))))))
341 423
342(defun calc-invent-independent-variables (n &optional but) 424(defun calc-invent-independent-variables (n &optional but)
343 (calc-invent-variables n but '(x y z t) "x")) 425 (calc-invent-variables n but '(x y z t) "x"))
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 7611e40f8ef..ea495777f19 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -2080,7 +2080,7 @@ Or, for optional MON, YR."
2080 ;; Don't do any window-related stuff if we weren't called from a 2080 ;; Don't do any window-related stuff if we weren't called from a
2081 ;; window displaying the calendar 2081 ;; window displaying the calendar
2082 (when in-calendar-window 2082 (when in-calendar-window
2083 (if (or (one-window-p t) (/= (frame-width) (window-width))) 2083 (if (or (one-window-p t) (not (window-full-width-p)))
2084 ;; Don't mess with the window size, but ensure that the first 2084 ;; Don't mess with the window size, but ensure that the first
2085 ;; line is fully visible 2085 ;; line is fully visible
2086 (set-window-vscroll nil 0) 2086 (set-window-vscroll nil 0)
diff --git a/lisp/complete.el b/lisp/complete.el
index 9be68d833e5..75774b65db0 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -450,6 +450,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
450 env-on 450 env-on
451 regex 451 regex
452 p offset 452 p offset
453 abbreviated
453 (poss nil) 454 (poss nil)
454 helpposs 455 helpposs
455 (case-fold-search completion-ignore-case)) 456 (case-fold-search completion-ignore-case))
@@ -586,17 +587,42 @@ GOTO-END is non-nil, however, it instead replaces up to END."
586 pred nil)) 587 pred nil))
587 588
588 ;; Find an initial list of possible completions 589 ;; Find an initial list of possible completions
589 (if (not (setq p (string-match (concat PC-delim-regex 590 (unless (setq p (string-match (concat PC-delim-regex
590 (if filename "\\|\\*" "")) 591 (if filename "\\|\\*" ""))
591 str 592 str
592 (+ (length dirname) offset)))) 593 (+ (length dirname) offset)))
593 594
594 ;; Minibuffer contains no hyphens -- simple case! 595 ;; Minibuffer contains no hyphens -- simple case!
595 (setq poss (all-completions (if env-on 596 (setq poss (all-completions (if env-on basestr str)
596 basestr str)
597 table 597 table
598 pred)) 598 pred))
599 599 (unless poss
600 ;; Try completion as an abbreviation, e.g. "mvb" ->
601 ;; "m-v-b" -> "multiple-value-bind"
602 (setq origstr str
603 abbreviated t)
604 (if filename
605 (cond
606 ;; "alpha" or "/alpha" -> expand whole path.
607 ((string-match "^/?\\([A-Za-z0-9]+\\)$" str)
608 (setq
609 basestr ""
610 p nil
611 poss (PC-expand-many-files
612 (concat "/"
613 (mapconcat #'list (match-string 1 str) "*/")
614 "*"))
615 beg (1- beg)))
616 ;; Alphanumeric trailer -> expand trailing file
617 ((string-match "^\\(.+/\\)\\([A-Za-z0-9]+\\)$" str)
618 (setq regex (concat "\\`"
619 (mapconcat #'list
620 (match-string 2 str)
621 "[A-Za-z0-9]*[^A-Za-z0-9]"))
622 p (1+ (length (match-string 1 str))))))
623 (setq regex (concat "\\`" (mapconcat #'list str "[^-]*-"))
624 p 1))))
625 (when p
600 ;; Use all-completions to do an initial cull. This is a big win, 626 ;; Use all-completions to do an initial cull. This is a big win,
601 ;; since all-completions is written in C! 627 ;; since all-completions is written in C!
602 (let ((compl (all-completions (if env-on 628 (let ((compl (all-completions (if env-on
@@ -605,12 +631,24 @@ GOTO-END is non-nil, however, it instead replaces up to END."
605 table 631 table
606 pred))) 632 pred)))
607 (setq p compl) 633 (setq p compl)
634 (when (and compl abbreviated)
635 (if filename
636 (progn
637 (setq p nil)
638 (dolist (x compl)
639 (when (string-match regex x)
640 (push x p)))
641 (setq basestr (try-completion "" p)))
642 (setq basestr (mapconcat 'list str "-"))
643 (delete-region beg end)
644 (setq end (+ beg (length basestr)))
645 (insert basestr))))
608 (while p 646 (while p
609 (and (string-match regex (car p)) 647 (and (string-match regex (car p))
610 (progn 648 (progn
611 (set-text-properties 0 (length (car p)) '() (car p)) 649 (set-text-properties 0 (length (car p)) '() (car p))
612 (setq poss (cons (car p) poss)))) 650 (setq poss (cons (car p) poss))))
613 (setq p (cdr p))))) 651 (setq p (cdr p))))
614 652
615 ;; If table had duplicates, they can be here. 653 ;; If table had duplicates, they can be here.
616 (delete-dups poss) 654 (delete-dups poss)
@@ -644,6 +682,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
644 (and p (setq poss p)))) 682 (and p (setq poss p))))
645 683
646 ;; Now we have a list of possible completions 684 ;; Now we have a list of possible completions
685
647 (cond 686 (cond
648 687
649 ;; No valid completions found 688 ;; No valid completions found
@@ -653,6 +692,9 @@ GOTO-END is non-nil, however, it instead replaces up to END."
653 (let ((PC-word-failed-flag t)) 692 (let ((PC-word-failed-flag t))
654 (delete-backward-char 1) 693 (delete-backward-char 1)
655 (PC-do-completion 'word)) 694 (PC-do-completion 'word))
695 (when abbreviated
696 (delete-region beg end)
697 (insert origstr))
656 (beep) 698 (beep)
657 (PC-temp-minibuffer-message (if ambig 699 (PC-temp-minibuffer-message (if ambig
658 " [Ambiguous dir name]" 700 " [Ambiguous dir name]"
@@ -789,13 +831,18 @@ GOTO-END is non-nil, however, it instead replaces up to END."
789 (setq completion-base-size (if dirname 831 (setq completion-base-size (if dirname
790 dirlength 832 dirlength
791 (- beg prompt-end)))))) 833 (- beg prompt-end))))))
792 (PC-temp-minibuffer-message " [Next char not unique]")) 834 (PC-temp-minibuffer-message " [Next char not unique]"))))))
793 nil))))) 835 ;; Expansion of filenames is not reversible, so just keep
836 ;; the prefix.
837 (when (and abbreviated filename)
838 (delete-region (point) end))
839 nil)
794 840
795 ;; Only one possible completion 841 ;; Only one possible completion
796 (t 842 (t
797 (if (and (equal basestr (car poss)) 843 (if (and (equal basestr (car poss))
798 (not (and env-on filename))) 844 (not (and env-on filename))
845 (not abbreviated))
799 (if (null mode) 846 (if (null mode)
800 (PC-temp-minibuffer-message " [Sole completion]")) 847 (PC-temp-minibuffer-message " [Sole completion]"))
801 (delete-region beg end) 848 (delete-region beg end)
@@ -853,13 +900,11 @@ only symbols with function definitions are considered.
853Otherwise, all symbols with function definitions, values 900Otherwise, all symbols with function definitions, values
854or properties are considered." 901or properties are considered."
855 (interactive) 902 (interactive)
856 (let* ((end (point)) 903 (let* ((end
857 ;; To complete the word under point, rather than just the portion 904 (save-excursion
858 ;; before point, use this: 905 (with-syntax-table lisp-mode-syntax-table
859;;; (save-excursion 906 (skip-syntax-forward "_w")
860;;; (with-syntax-table lisp-mode-syntax-table 907 (point))))
861;;; (forward-sexp 1)
862;;; (point))))
863 (beg (save-excursion 908 (beg (save-excursion
864 (with-syntax-table lisp-mode-syntax-table 909 (with-syntax-table lisp-mode-syntax-table
865 (backward-sexp 1) 910 (backward-sexp 1)
diff --git a/lisp/custom.el b/lisp/custom.el
index a5a455c2f32..5138f800972 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -642,7 +642,7 @@ this sets the local binding in that buffer instead."
642 (funcall variable (if value 1 0)))) 642 (funcall variable (if value 1 0))))
643 643
644(defun custom-quote (sexp) 644(defun custom-quote (sexp)
645 "Quote SEXP iff it is not self quoting." 645 "Quote SEXP if it is not self quoting."
646 (if (or (memq sexp '(t nil)) 646 (if (or (memq sexp '(t nil))
647 (keywordp sexp) 647 (keywordp sexp)
648 (and (listp sexp) 648 (and (listp sexp)
@@ -665,14 +665,14 @@ default value. Otherwise, set it to nil.
665 665
666To actually save the value, call `custom-save-all'. 666To actually save the value, call `custom-save-all'.
667 667
668Return non-nil iff the `saved-value' property actually changed." 668Return non-nil if the `saved-value' property actually changed."
669 (custom-load-symbol symbol) 669 (custom-load-symbol symbol)
670 (let* ((get (or (get symbol 'custom-get) 'default-value)) 670 (let* ((get (or (get symbol 'custom-get) 'default-value))
671 (value (funcall get symbol)) 671 (value (funcall get symbol))
672 (saved (get symbol 'saved-value)) 672 (saved (get symbol 'saved-value))
673 (standard (get symbol 'standard-value)) 673 (standard (get symbol 'standard-value))
674 (comment (get symbol 'customized-variable-comment))) 674 (comment (get symbol 'customized-variable-comment)))
675 ;; Save default value iff different from standard value. 675 ;; Save default value if different from standard value.
676 (if (or (null standard) 676 (if (or (null standard)
677 (not (equal value (condition-case nil 677 (not (equal value (condition-case nil
678 (eval (car standard)) 678 (eval (car standard))
@@ -694,13 +694,13 @@ or else if it is different from the standard value, set the
694`customized-value' property to a list whose car evaluates to the 694`customized-value' property to a list whose car evaluates to the
695default value. Otherwise, set it to nil. 695default value. Otherwise, set it to nil.
696 696
697Return non-nil iff the `customized-value' property actually changed." 697Return non-nil if the `customized-value' property actually changed."
698 (custom-load-symbol symbol) 698 (custom-load-symbol symbol)
699 (let* ((get (or (get symbol 'custom-get) 'default-value)) 699 (let* ((get (or (get symbol 'custom-get) 'default-value))
700 (value (funcall get symbol)) 700 (value (funcall get symbol))
701 (customized (get symbol 'customized-value)) 701 (customized (get symbol 'customized-value))
702 (old (or (get symbol 'saved-value) (get symbol 'standard-value)))) 702 (old (or (get symbol 'saved-value) (get symbol 'standard-value))))
703 ;; Mark default value as set iff different from old value. 703 ;; Mark default value as set if different from old value.
704 (if (not (and old 704 (if (not (and old
705 (equal value (condition-case nil 705 (equal value (condition-case nil
706 (eval (car old)) 706 (eval (car old))
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index cfac6517209..be4c7e7b905 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -349,8 +349,11 @@ when editing big diffs)."
349 ("^--- .+ ----$" . diff-hunk-header-face) ;context 349 ("^--- .+ ----$" . diff-hunk-header-face) ;context
350 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ;normal 350 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ;normal
351 ("^---$" . diff-hunk-header-face) ;normal 351 ("^---$" . diff-hunk-header-face) ;normal
352 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t\n]+\\)\\(.*[^*-]\\)?\n" 352 ;; For file headers, accept files with spaces, but be careful to rule
353 (0 diff-header-face) (2 diff-file-header-face prepend)) 353 ;; out false-positives when matching hunk headers.
354 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t\n]+?\\)\\(?:\t.*\\| \\(\\*\\*\\*\\*\\|----\\)\\)?\n"
355 (0 diff-header-face)
356 (2 (if (not (match-end 3)) diff-file-header-face) prepend))
354 ("^\\([-<]\\)\\(.*\n\\)" 357 ("^\\([-<]\\)\\(.*\n\\)"
355 (1 diff-indicator-removed-face) (2 diff-removed-face)) 358 (1 diff-indicator-removed-face) (2 diff-removed-face))
356 ("^\\([+>]\\)\\(.*\n\\)" 359 ("^\\([+>]\\)\\(.*\n\\)"
@@ -425,10 +428,20 @@ but in the file header instead, in which case move forward to the first hunk."
425(defun diff-beginning-of-file () 428(defun diff-beginning-of-file ()
426 (beginning-of-line) 429 (beginning-of-line)
427 (unless (looking-at diff-file-header-re) 430 (unless (looking-at diff-file-header-re)
428 (forward-line 2) 431 (let ((start (point))
429 (condition-case () 432 res)
430 (re-search-backward diff-file-header-re) 433 ;; diff-file-header-re may need to match up to 4 lines, so in case
431 (error (error "Can't find the beginning of the file"))))) 434 ;; we're inside the header, we need to move up to 3 lines forward.
435 (forward-line 3)
436 (if (and (setq res (re-search-backward diff-file-header-re nil t))
437 ;; Maybe the 3 lines forward were too much and we matched
438 ;; a file header after our starting point :-(
439 (or (<= (point) start)
440 (setq res (re-search-backward diff-file-header-re nil t))))
441 res
442 (goto-char start)
443 (error "Can't find the beginning of the file")))))
444
432 445
433(defun diff-end-of-file () 446(defun diff-end-of-file ()
434 (re-search-forward "^[-+#!<>0-9@* \\]" nil t) 447 (re-search-forward "^[-+#!<>0-9@* \\]" nil t)
@@ -481,26 +494,34 @@ If the prefix ARG is given, restrict the view to the current file instead."
481 "Go to the beginning of file-related diff-info. 494 "Go to the beginning of file-related diff-info.
482This is like `diff-beginning-of-file' except it tries to skip back over leading 495This is like `diff-beginning-of-file' except it tries to skip back over leading
483data such as \"Index: ...\" and such." 496data such as \"Index: ...\" and such."
484 (let ((start (point)) 497 (let* ((start (point))
485 (file (condition-case err (progn (diff-beginning-of-file) (point)) 498 (prevfile (condition-case err
486 (error err))) 499 (save-excursion (diff-beginning-of-file) (point))
487 ;; prevhunk is one of the limits. 500 (error err)))
488 (prevhunk (save-excursion (ignore-errors (diff-hunk-prev) (point)))) 501 (err (if (consp prevfile) prevfile))
489 err) 502 (nextfile (ignore-errors
490 (when (consp file) 503 (save-excursion
491 ;; Presumably, we started before the file header, in the leading junk. 504 (goto-char start) (diff-file-next) (point))))
492 (setq err file) 505 ;; prevhunk is one of the limits.
493 (diff-file-next) 506 (prevhunk (save-excursion
494 (setq file (point))) 507 (ignore-errors
495 (let ((index (save-excursion 508 (if (numberp prevfile) (goto-char prevfile))
496 (re-search-backward "^Index: " prevhunk t)))) 509 (diff-hunk-prev) (point))))
497 (when index (setq file index)) 510 (previndex (save-excursion
498 (if (<= file start) 511 (re-search-backward "^Index: " prevhunk t))))
499 (goto-char file) 512 ;; If we're in the junk, we should use nextfile instead of prevfile.
500 ;; File starts *after* the starting point: we really weren't in 513 (if (and (numberp nextfile)
501 ;; a file diff but elsewhere. 514 (or (not (numberp prevfile))
502 (goto-char start) 515 (and previndex (> previndex prevfile))))
503 (signal (car err) (cdr err)))))) 516 (setq prevfile nextfile))
517 (if (and previndex (numberp prevfile) (< previndex prevfile))
518 (setq prevfile previndex))
519 (if (and (numberp prevfile) (<= prevfile start))
520 (goto-char prevfile)
521 ;; File starts *after* the starting point: we really weren't in
522 ;; a file diff but elsewhere.
523 (goto-char start)
524 (signal (car err) (cdr err)))))
504 525
505(defun diff-file-kill () 526(defun diff-file-kill ()
506 "Kill current file's hunks." 527 "Kill current file's hunks."
@@ -703,7 +724,7 @@ PREFIX is only used internally: don't use it."
703(defun diff-unified->context (start end) 724(defun diff-unified->context (start end)
704 "Convert unified diffs to context diffs. 725 "Convert unified diffs to context diffs.
705START and END are either taken from the region (if a prefix arg is given) or 726START and END are either taken from the region (if a prefix arg is given) or
706else cover the whole bufer." 727else cover the whole buffer."
707 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) 728 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
708 (list (region-beginning) (region-end)) 729 (list (region-beginning) (region-end))
709 (list (point-min) (point-max)))) 730 (list (point-min) (point-max))))
@@ -886,7 +907,7 @@ With a prefix argument, convert unified format to context format."
886(defun diff-reverse-direction (start end) 907(defun diff-reverse-direction (start end)
887 "Reverse the direction of the diffs. 908 "Reverse the direction of the diffs.
888START and END are either taken from the region (if a prefix arg is given) or 909START and END are either taken from the region (if a prefix arg is given) or
889else cover the whole bufer." 910else cover the whole buffer."
890 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) 911 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
891 (list (region-beginning) (region-end)) 912 (list (region-beginning) (region-end))
892 (list (point-min) (point-max)))) 913 (list (point-min) (point-max))))
@@ -948,7 +969,7 @@ else cover the whole bufer."
948(defun diff-fixup-modifs (start end) 969(defun diff-fixup-modifs (start end)
949 "Fixup the hunk headers (in case the buffer was modified). 970 "Fixup the hunk headers (in case the buffer was modified).
950START and END are either taken from the region (if a prefix arg is given) or 971START and END are either taken from the region (if a prefix arg is given) or
951else cover the whole bufer." 972else cover the whole buffer."
952 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) 973 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
953 (list (region-beginning) (region-end)) 974 (list (region-beginning) (region-end))
954 (list (point-min) (point-max)))) 975 (list (point-min) (point-max))))
diff --git a/lisp/diff.el b/lisp/diff.el
index 3013f0d769e..b063c07b40f 100644
--- a/lisp/diff.el
+++ b/lisp/diff.el
@@ -62,7 +62,8 @@
62 62
63(defun diff-sentinel (code) 63(defun diff-sentinel (code)
64 "Code run when the diff process exits. 64 "Code run when the diff process exits.
65CODE is the exit code of the process. It should be 0 iff no diffs were found." 65CODE is the exit code of the process. It should be 0 only if no diffs
66were found."
66 (if diff-old-temp-file (delete-file diff-old-temp-file)) 67 (if diff-old-temp-file (delete-file diff-old-temp-file))
67 (if diff-new-temp-file (delete-file diff-new-temp-file)) 68 (if diff-new-temp-file (delete-file diff-new-temp-file))
68 (save-excursion 69 (save-excursion
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 4d06acdcf6c..124c53b44c5 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1993,8 +1993,8 @@ of marked files. If KILL-ROOT is non-nil, kill DIRNAME as well."
1993 1993
1994(defun dired-tree-lessp (dir1 dir2) 1994(defun dired-tree-lessp (dir1 dir2)
1995 ;; Lexicographic order on file name components, like `ls -lR': 1995 ;; Lexicographic order on file name components, like `ls -lR':
1996 ;; DIR1 < DIR2 iff DIR1 comes *before* DIR2 in an `ls -lR' listing, 1996 ;; DIR1 < DIR2 if DIR1 comes *before* DIR2 in an `ls -lR' listing,
1997 ;; i.e., iff DIR1 is a (grand)parent dir of DIR2, 1997 ;; i.e., if DIR1 is a (grand)parent dir of DIR2,
1998 ;; or DIR1 and DIR2 are in the same parentdir and their last 1998 ;; or DIR1 and DIR2 are in the same parentdir and their last
1999 ;; components are string-lessp. 1999 ;; components are string-lessp.
2000 ;; Thus ("/usr/" "/usr/bin") and ("/usr/a/" "/usr/b/") are tree-lessp. 2000 ;; Thus ("/usr/" "/usr/bin") and ("/usr/a/" "/usr/b/") are tree-lessp.
diff --git a/lisp/dired.el b/lisp/dired.el
index 1a906093a7a..d263f0b3044 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2560,12 +2560,12 @@ non-empty directories is allowed."
2560 (cond ;; if split-height-threshold is enabled, use the largest window 2560 (cond ;; if split-height-threshold is enabled, use the largest window
2561 ((and (> (window-height (setq w2 (get-largest-window))) 2561 ((and (> (window-height (setq w2 (get-largest-window)))
2562 split-height-threshold) 2562 split-height-threshold)
2563 (= (frame-width) (window-width w2))) 2563 (window-full-width-p w2))
2564 (setq window w2)) 2564 (setq window w2))
2565 ;; if the least-recently-used window is big enough, use it 2565 ;; if the least-recently-used window is big enough, use it
2566 ((and (> (window-height (setq w2 (get-lru-window))) 2566 ((and (> (window-height (setq w2 (get-lru-window)))
2567 (* 2 window-min-height)) 2567 (* 2 window-min-height))
2568 (= (frame-width) (window-width w2))) 2568 (window-full-width-p w2))
2569 (setq window w2))) 2569 (setq window w2)))
2570 (save-excursion 2570 (save-excursion
2571 (set-buffer buf) 2571 (set-buffer buf)
diff --git a/lisp/double.el b/lisp/double.el
index 8d36d21b0fa..39a55744a05 100644
--- a/lisp/double.el
+++ b/lisp/double.el
@@ -187,7 +187,8 @@ use either \\[customize] or the function `double-mode'."
187;;;###autoload 187;;;###autoload
188(defun double-mode (arg) 188(defun double-mode (arg)
189 "Toggle Double mode. 189 "Toggle Double mode.
190With prefix arg, turn Double mode on iff arg is positive. 190With prefix argument ARG, turn Double mode on if ARG is positive, otherwise
191turn it off.
191 192
192When Double mode is on, some keys will insert different strings 193When Double mode is on, some keys will insert different strings
193when pressed twice. See variable `double-map' for details." 194when pressed twice. See variable `double-map' for details."
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el
index 48cd7c79d4e..ec153fde625 100644
--- a/lisp/ediff-diff.el
+++ b/lisp/ediff-diff.el
@@ -867,7 +867,7 @@ one optional arguments, diff-number to refine.")
867 (ediff-make-fine-diffs n 'noforce) 867 (ediff-make-fine-diffs n 'noforce)
868 (ediff-make-fine-diffs n 'skip))) 868 (ediff-make-fine-diffs n 'skip)))
869 869
870 ;; highlight iff fine diffs already exist 870 ;; highlight if fine diffs already exist
871 ((eq ediff-auto-refine 'off) 871 ((eq ediff-auto-refine 'off)
872 (ediff-make-fine-diffs n 'skip)))) 872 (ediff-make-fine-diffs n 'skip))))
873 873
@@ -1459,7 +1459,7 @@ arguments to `skip-chars-forward'."
1459 1459
1460 1460
1461(defun ediff-same-contents (d1 d2 &optional filter-re) 1461(defun ediff-same-contents (d1 d2 &optional filter-re)
1462 "Returns t iff D1 and D2 have the same content. 1462 "Return t if D1 and D2 have the same content.
1463D1 and D2 can either be both directories or both regular files. 1463D1 and D2 can either be both directories or both regular files.
1464Symlinks and the likes are not handled. 1464Symlinks and the likes are not handled.
1465If FILTER-RE is non-nil, recursive checking in directories 1465If FILTER-RE is non-nil, recursive checking in directories
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 5eb9b8ce621..14877e1b18f 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -209,6 +209,7 @@ put the output in."
209 (setcdr p nil) 209 (setcdr p nil)
210 (princ "\n(" outbuf) 210 (princ "\n(" outbuf)
211 (let ((print-escape-newlines t) 211 (let ((print-escape-newlines t)
212 (print-quoted t)
212 (print-escape-nonascii t)) 213 (print-escape-nonascii t))
213 (dolist (elt form) 214 (dolist (elt form)
214 (prin1 elt outbuf) 215 (prin1 elt outbuf)
@@ -232,6 +233,7 @@ put the output in."
232 outbuf)) 233 outbuf))
233 (terpri outbuf))) 234 (terpri outbuf)))
234 (let ((print-escape-newlines t) 235 (let ((print-escape-newlines t)
236 (print-quoted t)
235 (print-escape-nonascii t)) 237 (print-escape-nonascii t))
236 (print form outbuf))))))) 238 (print form outbuf)))))))
237 239
diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el
index 54fcfc3df8a..6daaf001433 100644
--- a/lisp/emacs-lisp/backquote.el
+++ b/lisp/emacs-lisp/backquote.el
@@ -118,10 +118,28 @@ Vectors work just like lists. Nested backquotes are permitted."
118;; constant, 1 => to be unquoted, 2 => to be spliced in. 118;; constant, 1 => to be unquoted, 2 => to be spliced in.
119;; The top-level backquote macro just discards the tag. 119;; The top-level backquote macro just discards the tag.
120 120
121(defun backquote-process (s) 121(defun backquote-delay-process (s level)
122 "Process a (un|back|splice)quote inside a backquote.
123This simply recurses through the body."
124 (let ((exp (backquote-listify (list (backquote-process (nth 1 s) level)
125 (cons 0 (list 'quote (car s))))
126 '(0))))
127 (if (eq (car-safe exp) 'quote)
128 (cons 0 (list 'quote s))
129 (cons 1 exp))))
130
131(defun backquote-process (s &optional level)
132 "Process the body of a backquote.
133S is the body. Returns a cons cell whose cdr is piece of code which
134is the macro-expansion of S, and whose car is a small integer whose value
135can either indicate that the code is constant (0), or not (1), or returns
136a list which should be spliced into its environment (2).
137LEVEL is only used internally and indicates the nesting level:
1380 (the default) is for the toplevel nested inside a single backquote."
139 (unless level (setq level 0))
122 (cond 140 (cond
123 ((vectorp s) 141 ((vectorp s)
124 (let ((n (backquote-process (append s ())))) 142 (let ((n (backquote-process (append s ()) level)))
125 (if (= (car n) 0) 143 (if (= (car n) 0)
126 (cons 0 s) 144 (cons 0 s)
127 (cons 1 (cond 145 (cons 1 (cond
@@ -138,11 +156,15 @@ Vectors work just like lists. Nested backquotes are permitted."
138 s 156 s
139 (list 'quote s)))) 157 (list 'quote s))))
140 ((eq (car s) backquote-unquote-symbol) 158 ((eq (car s) backquote-unquote-symbol)
141 (cons 1 (nth 1 s))) 159 (if (<= level 0)
160 (cons 1 (nth 1 s))
161 (backquote-delay-process s (1- level))))
142 ((eq (car s) backquote-splice-symbol) 162 ((eq (car s) backquote-splice-symbol)
143 (cons 2 (nth 1 s))) 163 (if (<= level 0)
164 (cons 2 (nth 1 s))
165 (backquote-delay-process s (1- level))))
144 ((eq (car s) backquote-backquote-symbol) 166 ((eq (car s) backquote-backquote-symbol)
145 (backquote-process (cdr (backquote-process (nth 1 s))))) 167 (backquote-delay-process s (1+ level)))
146 (t 168 (t
147 (let ((rest s) 169 (let ((rest s)
148 item firstlist list lists expression) 170 item firstlist list lists expression)
@@ -154,11 +176,13 @@ Vectors work just like lists. Nested backquotes are permitted."
154 ;; at the beginning, put them in FIRSTLIST, 176 ;; at the beginning, put them in FIRSTLIST,
155 ;; as a list of tagged values (TAG . FORM). 177 ;; as a list of tagged values (TAG . FORM).
156 ;; If there are any at the end, they go in LIST, likewise. 178 ;; If there are any at the end, they go in LIST, likewise.
157 (while (consp rest) 179 (while (and (consp rest)
158 ;; Turn . (, foo) into (,@ foo). 180 ;; Stop if the cdr is an expression inside a backquote or
159 (if (eq (car rest) backquote-unquote-symbol) 181 ;; unquote since this needs to go recursively through
160 (setq rest (list (list backquote-splice-symbol (nth 1 rest))))) 182 ;; backquote-process.
161 (setq item (backquote-process (car rest))) 183 (not (or (eq (car rest) backquote-unquote-symbol)
184 (eq (car rest) backquote-backquote-symbol))))
185 (setq item (backquote-process (car rest) level))
162 (cond 186 (cond
163 ((= (car item) 2) 187 ((= (car item) 2)
164 ;; Put the nonspliced items before the first spliced item 188 ;; Put the nonspliced items before the first spliced item
@@ -168,8 +192,8 @@ Vectors work just like lists. Nested backquotes are permitted."
168 list nil)) 192 list nil))
169 ;; Otherwise, put any preceding nonspliced items into LISTS. 193 ;; Otherwise, put any preceding nonspliced items into LISTS.
170 (if list 194 (if list
171 (setq lists (cons (backquote-listify list '(0 . nil)) lists))) 195 (push (backquote-listify list '(0 . nil)) lists))
172 (setq lists (cons (cdr item) lists)) 196 (push (cdr item) lists)
173 (setq list nil)) 197 (setq list nil))
174 (t 198 (t
175 (setq list (cons item list)))) 199 (setq list (cons item list))))
@@ -177,8 +201,8 @@ Vectors work just like lists. Nested backquotes are permitted."
177 ;; Handle nonsplicing final elements, and the tail of the list 201 ;; Handle nonsplicing final elements, and the tail of the list
178 ;; (which remains in REST). 202 ;; (which remains in REST).
179 (if (or rest list) 203 (if (or rest list)
180 (setq lists (cons (backquote-listify list (backquote-process rest)) 204 (push (backquote-listify list (backquote-process rest level))
181 lists))) 205 lists))
182 ;; Turn LISTS into a form that produces the combined list. 206 ;; Turn LISTS into a form that produces the combined list.
183 (setq expression 207 (setq expression
184 (if (or (cdr lists) 208 (if (or (cdr lists)
@@ -221,5 +245,5 @@ Vectors work just like lists. Nested backquotes are permitted."
221 tail)) 245 tail))
222 (t (cons 'list heads))))) 246 (t (cons 'list heads)))))
223 247
224;;; arch-tag: 1a26206a-6b5e-4c56-8e24-2eef0f7e0e7a 248;; arch-tag: 1a26206a-6b5e-4c56-8e24-2eef0f7e0e7a
225;;; backquote.el ends here 249;;; backquote.el ends here
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 811dc699bd0..82a5cf0a75a 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -564,7 +564,7 @@
564 (cons fn args))))))) 564 (cons fn args)))))))
565 565
566(defun byte-optimize-all-constp (list) 566(defun byte-optimize-all-constp (list)
567 "Non-nil iff all elements of LIST satisfy `byte-compile-constp'." 567 "Non-nil if all elements of LIST satisfy `byte-compile-constp'."
568 (let ((constant t)) 568 (let ((constant t))
569 (while (and list constant) 569 (while (and list constant)
570 (unless (byte-compile-constp (car list)) 570 (unless (byte-compile-constp (car list))
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 862a7efe046..e1835d75fcb 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1243,7 +1243,8 @@ generating a buffered list of errors."
1243;;;###autoload 1243;;;###autoload
1244(define-minor-mode checkdoc-minor-mode 1244(define-minor-mode checkdoc-minor-mode
1245 "Toggle Checkdoc minor mode, a mode for checking Lisp doc strings. 1245 "Toggle Checkdoc minor mode, a mode for checking Lisp doc strings.
1246With prefix ARG, turn Checkdoc minor mode on iff ARG is positive. 1246With prefix ARG, turn Checkdoc minor mode on if ARG is positive, otherwise
1247turn it off.
1247 1248
1248In Checkdoc minor mode, the usual bindings for `eval-defun' which is 1249In Checkdoc minor mode, the usual bindings for `eval-defun' which is
1249bound to \\<checkdoc-minor-mode-map>\\[checkdoc-eval-defun] and `checkdoc-eval-current-buffer' are overridden to include 1250bound to \\<checkdoc-minor-mode-map>\\[checkdoc-eval-defun] and `checkdoc-eval-current-buffer' are overridden to include
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index 1589e19cbb2..7d94faa4456 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -10,7 +10,7 @@
10;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p 10;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p
11;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively 11;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively
12;;;;;; notevery notany every some mapcon mapcan mapl maplist map 12;;;;;; notevery notany every some mapcon mapcan mapl maplist map
13;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "47c92504dda976a632c2c10bedd4b6a4") 13;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "53c2b3ede19dac62cff13a37f58cdf9c")
14;;; Generated autoloads from cl-extra.el 14;;; Generated autoloads from cl-extra.el
15 15
16(autoload (quote coerce) "cl-extra" "\ 16(autoload (quote coerce) "cl-extra" "\
@@ -283,7 +283,7 @@ Not documented
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-compile-time-init) "cl-macs" 285;;;;;; defmacro* defun* gentemp gensym cl-compile-time-init) "cl-macs"
286;;;;;; "cl-macs.el" "7ccc827d272482ca276937ca18a7895a") 286;;;;;; "cl-macs.el" "d9759da97810bc01423e77442b459468")
287;;; Generated autoloads from cl-macs.el 287;;; Generated autoloads from cl-macs.el
288 288
289(autoload (quote cl-compile-time-init) "cl-macs" "\ 289(autoload (quote cl-compile-time-init) "cl-macs" "\
@@ -745,7 +745,7 @@ Not documented
745;;;;;; find nsubstitute-if-not nsubstitute-if nsubstitute substitute-if-not 745;;;;;; find nsubstitute-if-not nsubstitute-if nsubstitute substitute-if-not
746;;;;;; substitute-if substitute delete-duplicates remove-duplicates 746;;;;;; substitute-if substitute delete-duplicates remove-duplicates
747;;;;;; delete-if-not delete-if delete* remove-if-not remove-if remove* 747;;;;;; delete-if-not delete-if delete* remove-if-not remove-if remove*
748;;;;;; replace fill reduce) "cl-seq" "cl-seq.el" "8805f76626399794931f5db36ddf855f") 748;;;;;; replace fill reduce) "cl-seq" "cl-seq.el" "c972a97c053d4e001ac1d1012c315b28")
749;;; Generated autoloads from cl-seq.el 749;;; Generated autoloads from cl-seq.el
750 750
751(autoload (quote reduce) "cl-seq" "\ 751(autoload (quote reduce) "cl-seq" "\
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 5a7dc53e917..b802d8acd43 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -546,7 +546,7 @@ earlier by `easy-menu-define' or `easy-menu-create-menu'."
546 (easy-menu-define-key map (easy-menu-intern (car item)) (cdr item) before))) 546 (easy-menu-define-key map (easy-menu-intern (car item)) (cdr item) before)))
547 547
548(defun easy-menu-item-present-p (map path name) 548(defun easy-menu-item-present-p (map path name)
549 "In submenu of MAP with path PATH, return non-nil iff item NAME is present. 549 "In submenu of MAP with path PATH, return non-nil if item NAME is present.
550MAP and PATH are defined as in `easy-menu-add-item'. 550MAP and PATH are defined as in `easy-menu-add-item'.
551NAME should be a string, the name of the element to be looked for." 551NAME should be a string, the name of the element to be looked for."
552 (easy-menu-return-item (easy-menu-get-map map path) name)) 552 (easy-menu-return-item (easy-menu-get-map map path) name))
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index c1bc6dae515..2ff273ebab3 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -267,13 +267,13 @@ Emacs Lisp mode) that support Eldoc.")
267;; Return a string containing the function parameter list, or 1-line 267;; Return a string containing the function parameter list, or 1-line
268;; docstring if function is a subr and no arglist is obtainable from the 268;; docstring if function is a subr and no arglist is obtainable from the
269;; docstring or elsewhere. 269;; docstring or elsewhere.
270(defun eldoc-get-fnsym-args-string (sym argument-index) 270(defun eldoc-get-fnsym-args-string (sym &optional argument-index)
271 (let ((args nil) 271 (let ((args nil)
272 (doc nil)) 272 (doc nil))
273 (cond ((not (and sym (symbolp sym) (fboundp sym)))) 273 (cond ((not (and sym (symbolp sym) (fboundp sym))))
274 ((and (eq sym (aref eldoc-last-data 0)) 274 ((and (eq sym (aref eldoc-last-data 0))
275 (eq 'function (aref eldoc-last-data 2))) 275 (eq 'function (aref eldoc-last-data 2)))
276 (setq args (aref eldoc-last-data 1))) 276 (setq doc (aref eldoc-last-data 1)))
277 ((setq doc (help-split-fundoc (documentation sym t) sym)) 277 ((setq doc (help-split-fundoc (documentation sym t) sym))
278 (setq args (car doc)) 278 (setq args (car doc))
279 (string-match "\\`[^ )]* ?" args) 279 (string-match "\\`[^ )]* ?" args)
@@ -281,8 +281,9 @@ Emacs Lisp mode) that support Eldoc.")
281 (eldoc-last-data-store sym args 'function)) 281 (eldoc-last-data-store sym args 'function))
282 (t 282 (t
283 (setq args (eldoc-function-argstring sym)))) 283 (setq args (eldoc-function-argstring sym))))
284 (when args 284 (and args
285 (setq doc (eldoc-highlight-function-argument sym args argument-index))) 285 argument-index
286 (setq doc (eldoc-highlight-function-argument sym args argument-index)))
286 doc)) 287 doc))
287 288
288;; Highlight argument INDEX in ARGS list for SYM. 289;; Highlight argument INDEX in ARGS list for SYM.
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 957c5b23541..ae150078785 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -554,7 +554,7 @@ appended to R will apply to all of R. For example, \"a\"
554 554
555This function may return false negatives, but it will not 555This function may return false negatives, but it will not
556return false positives. It is nevertheless useful in 556return false positives. It is nevertheless useful in
557situations where an efficiency shortcut can be taken iff a 557situations where an efficiency shortcut can be taken only if a
558regexp is atomic. The function can be improved to detect 558regexp is atomic. The function can be improved to detect
559more cases of atomic regexps. Presently, this function 559more cases of atomic regexps. Presently, this function
560detects the following categories of atomic regexp; 560detects the following categories of atomic regexp;
diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el
index bf52acef382..d7dd1f19300 100644
--- a/lisp/emacs-lisp/unsafep.el
+++ b/lisp/emacs-lisp/unsafep.el
@@ -212,7 +212,7 @@ of symbols with local bindings."
212 212
213 213
214(defun unsafep-function (fun) 214(defun unsafep-function (fun)
215 "Return nil iff FUN is a safe function. 215 "Return nil if FUN is a safe function.
216\(either a safe lambda or a symbol that names a safe function). Otherwise 216\(either a safe lambda or a symbol that names a safe function). Otherwise
217result is a reason code." 217result is a reason code."
218 (cond 218 (cond
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el
index f3792b92e42..81187112a66 100644
--- a/lisp/emulation/tpu-edt.el
+++ b/lisp/emulation/tpu-edt.el
@@ -792,10 +792,13 @@ Create the key map if necessary."
792 (use-local-map tpu-buffer-local-map))) 792 (use-local-map tpu-buffer-local-map)))
793 (local-set-key key func)) 793 (local-set-key key func))
794 794
795(defun tpu-current-line nil 795(defun tpu-current-line ()
796 "Return the vertical position of point in the selected window. 796 "Return the vertical position of point in the selected window.
797Top line is 0. Counts each text line only once, even if it wraps." 797Top line is 0. Counts each text line only once, even if it wraps."
798 (+ (count-lines (window-start) (point)) (if (= (current-column) 0) 1 0) -1)) 798 (or
799 (cdr (nth 6 (posn-at-point)))
800 (if (eq (window-start) (point)) 0
801 (1- (count-screen-lines (window-start) (point) 'count-final-newline)))))
799 802
800 803
801;;; 804;;;
@@ -2422,6 +2425,7 @@ If FILE is nil, try to load a default file. The default file names are
2422 (if (eq tpu-global-map parent) 2425 (if (eq tpu-global-map parent)
2423 (set-keymap-parent map (keymap-parent parent)) 2426 (set-keymap-parent map (keymap-parent parent))
2424 (setq map parent))))) 2427 (setq map parent)))))
2428 (ad-disable-regexp "\\`tpu-")
2425 (setq tpu-edt-mode nil)) 2429 (setq tpu-edt-mode nil))
2426 2430
2427(provide 'tpu-edt) 2431(provide 'tpu-edt)
diff --git a/lisp/emulation/tpu-extras.el b/lisp/emulation/tpu-extras.el
index 019896c0eb2..609ce2e203b 100644
--- a/lisp/emulation/tpu-extras.el
+++ b/lisp/emulation/tpu-extras.el
@@ -141,13 +141,11 @@ the previous line when starting from a line beginning."
141 141
142(add-hook 'picture-mode-hook 'tpu-set-cursor-free) 142(add-hook 'picture-mode-hook 'tpu-set-cursor-free)
143 143
144(defun tpu-write-file-hook nil 144(defun tpu-before-save-hook ()
145 "Eliminate whitespace at ends of lines, if the cursor is free." 145 "Eliminate whitespace at ends of lines, if the cursor is free."
146 (if (and (buffer-modified-p) tpu-cursor-free) (tpu-trim-line-ends))) 146 (if (and (buffer-modified-p) tpu-cursor-free) (tpu-trim-line-ends)))
147 147
148(or (memq 'tpu-write-file-hook write-file-functions) 148(add-hook 'before-save-hook 'tpu-before-save-hook)
149 (setq write-file-functions
150 (cons 'tpu-write-file-hook write-file-functions)))
151 149
152 150
153;;; Utility routines for implementing scroll margins 151;;; Utility routines for implementing scroll margins
@@ -246,7 +244,7 @@ Accepts a prefix argument for the number of lines to move."
246 (end-of-line (- 1 num)))) 244 (end-of-line (- 1 num))))
247 (tpu-top-check beg num))) 245 (tpu-top-check beg num)))
248 246
249(defun tpu-current-end-of-line nil 247(defun tpu-current-end-of-line ()
250 "Move point to end of current line." 248 "Move point to end of current line."
251 (interactive) 249 (interactive)
252 (let ((beg (point))) 250 (let ((beg (point)))
@@ -392,41 +390,24 @@ A repeat count means scroll that many sections."
392 390
393 391
394 392
395;;; Replace the newline, newline-and-indent, and do-auto-fill functions 393;; Advise the newline, newline-and-indent, and do-auto-fill functions.
396 394(defadvice newline (around tpu-respect-bottom-scroll-margin activate disable)
397(or (fboundp 'tpu-old-newline) 395 "Respect `tpu-bottom-scroll-margin'."
398 (fset 'tpu-old-newline (symbol-function 'newline))) 396 (let ((beg (tpu-current-line))
399(or (fboundp 'tpu-old-do-auto-fill) 397 (num (prefix-numeric-value (ad-get-arg 0))))
400 (fset 'tpu-old-do-auto-fill (symbol-function 'do-auto-fill))) 398 ad-do-it
401(or (fboundp 'tpu-old-newline-and-indent)
402 (fset 'tpu-old-newline-and-indent (symbol-function 'newline-and-indent)))
403
404(defun newline (&optional num)
405 "Insert a newline. With arg, insert that many newlines.
406In Auto Fill mode, can break the preceding line if no numeric arg.
407This is the TPU-edt version that respects the bottom scroll margin."
408 (interactive "p")
409 (let ((beg (tpu-current-line)))
410 (or num (setq num 1))
411 (tpu-old-newline num)
412 (tpu-bottom-check beg num))) 399 (tpu-bottom-check beg num)))
413 400
414(defun newline-and-indent nil 401(defadvice newline-and-indent (around tpu-respect-bottom-scroll-margin)
415 "Insert a newline, then indent according to major mode. 402 "Respect `tpu-bottom-scroll-margin'."
416Indentation is done using the current indent-line-function.
417In programming language modes, this is the same as TAB.
418In some text modes, where TAB inserts a tab, this indents
419to the specified left-margin column. This is the TPU-edt
420version that respects the bottom scroll margin."
421 (interactive)
422 (let ((beg (tpu-current-line))) 403 (let ((beg (tpu-current-line)))
423 (tpu-old-newline-and-indent) 404 ad-do-it
424 (tpu-bottom-check beg 1))) 405 (tpu-bottom-check beg 1)))
425 406
426(defun do-auto-fill nil 407(defadvice do-auto-fill (around tpu-respect-bottom-scroll-margin)
427 "TPU-edt version that respects the bottom scroll margin." 408 "Respect `tpu-bottom-scroll-margin'."
428 (let ((beg (tpu-current-line))) 409 (let ((beg (tpu-current-line)))
429 (tpu-old-do-auto-fill) 410 ad-do-it
430 (tpu-bottom-check beg 1))) 411 (tpu-bottom-check beg 1)))
431 412
432 413
@@ -440,18 +421,21 @@ version that respects the bottom scroll margin."
440\nsEnter bottom scroll margin (N lines or N%% or RETURN for current value): ") 421\nsEnter bottom scroll margin (N lines or N%% or RETURN for current value): ")
441 ;; set top scroll margin 422 ;; set top scroll margin
442 (or (string= top "") 423 (or (string= top "")
443 (if (string= "%" (substring top -1)) 424 (setq tpu-top-scroll-margin
444 (setq tpu-top-scroll-margin (string-to-number top)) 425 (if (string= "%" (substring top -1))
445 (setq tpu-top-scroll-margin 426 (string-to-number top)
446 (/ (1- (+ (* (string-to-number top) 100) (window-height))) 427 (/ (1- (+ (* (string-to-number top) 100) (window-height)))
447 (window-height))))) 428 (window-height)))))
448 ;; set bottom scroll margin 429 ;; set bottom scroll margin
449 (or (string= bottom "") 430 (or (string= bottom "")
450 (if (string= "%" (substring bottom -1)) 431 (setq tpu-bottom-scroll-margin
451 (setq tpu-bottom-scroll-margin (string-to-number bottom)) 432 (if (string= "%" (substring bottom -1))
452 (setq tpu-bottom-scroll-margin 433 (string-to-number bottom)
453 (/ (1- (+ (* (string-to-number bottom) 100) (window-height))) 434 (/ (1- (+ (* (string-to-number bottom) 100) (window-height)))
454 (window-height))))) 435 (window-height)))))
436 (dolist (f '(newline newline-and-indent do-auto-fill))
437 (ad-enable-advice f 'around 'tpu-respect-bottom-scroll-margin)
438 (ad-activate f))
455 ;; report scroll margin settings if running interactively 439 ;; report scroll margin settings if running interactively
456 (and (interactive-p) 440 (and (interactive-p)
457 (message "Scroll margins set. Top = %s%%, Bottom = %s%%" 441 (message "Scroll margins set. Top = %s%%, Bottom = %s%%"
@@ -461,7 +445,7 @@ version that respects the bottom scroll margin."
461;;; Functions to set cursor bound or free 445;;; Functions to set cursor bound or free
462 446
463;;;###autoload 447;;;###autoload
464(defun tpu-set-cursor-free nil 448(defun tpu-set-cursor-free ()
465 "Allow the cursor to move freely about the screen." 449 "Allow the cursor to move freely about the screen."
466 (interactive) 450 (interactive)
467 (setq tpu-cursor-free t) 451 (setq tpu-cursor-free t)
@@ -471,7 +455,7 @@ version that respects the bottom scroll margin."
471 (message "The cursor will now move freely about the screen.")) 455 (message "The cursor will now move freely about the screen."))
472 456
473;;;###autoload 457;;;###autoload
474(defun tpu-set-cursor-bound nil 458(defun tpu-set-cursor-bound ()
475 "Constrain the cursor to the flow of the text." 459 "Constrain the cursor to the flow of the text."
476 (interactive) 460 (interactive)
477 (tpu-trim-line-ends) 461 (tpu-trim-line-ends)
@@ -481,5 +465,5 @@ version that respects the bottom scroll margin."
481 GOLD-map) 465 GOLD-map)
482 (message "The cursor is now bound to the flow of your text.")) 466 (message "The cursor is now bound to the flow of your text."))
483 467
484;;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a 468;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a
485;;; tpu-extras.el ends here 469;;; tpu-extras.el ends here
diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el
index 54fb2d1e997..977a7980803 100644
--- a/lisp/emulation/vi.el
+++ b/lisp/emulation/vi.el
@@ -788,7 +788,7 @@ The given COUNT is remembered for future scrollings."
788 "Go down count lines, try to keep at the same column." 788 "Go down count lines, try to keep at the same column."
789 (interactive "p") 789 (interactive "p")
790 (setq this-command 'next-line) ; this is a needed trick 790 (setq this-command 'next-line) ; this is a needed trick
791 (if (= (point) (or (line-move count) (point))) 791 (if (= (point) (progn (line-move count) (point)))
792 (ding) ; no moving, already at end of buffer 792 (ding) ; no moving, already at end of buffer
793 (setq last-command 'next-line))) 793 (setq last-command 'next-line)))
794 794
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index a5b2a8100a8..43f4c230d14 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,7 @@
12007-08-08 Glenn Morris <rgm@gnu.org>
2
3 * erc-log.el, erc.el: Replace `iff' in doc-strings and comments.
4
12007-07-30 Michael Olson <mwolson@gnu.org> 52007-07-30 Michael Olson <mwolson@gnu.org>
2 6
3 * erc-nicklist.el: Remove from the Emacs source tree. This file 7 * erc-nicklist.el: Remove from the Emacs source tree. This file
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index 194f8ae6bf1..88132afae0c 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/erc-log.el
@@ -261,7 +261,7 @@ The current buffer is given by BUFFER."
261 261
262(defun erc-log-all-but-server-buffers (buffer) 262(defun erc-log-all-but-server-buffers (buffer)
263 "Returns t if logging should be enabled in BUFFER. 263 "Returns t if logging should be enabled in BUFFER.
264Returns nil iff `erc-server-buffer-p' returns t." 264Returns nil if `erc-server-buffer-p' returns t."
265 (save-excursion 265 (save-excursion
266 (save-window-excursion 266 (save-window-excursion
267 (set-buffer buffer) 267 (set-buffer buffer)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index d5a823ac825..c26bdf2a19f 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -3958,7 +3958,7 @@ and always returns t."
3958(defun erc-echo-notice-in-target-buffer (s parsed buffer sender) 3958(defun erc-echo-notice-in-target-buffer (s parsed buffer sender)
3959 "Echos a private notice in BUFFER, if BUFFER is non-nil. This 3959 "Echos a private notice in BUFFER, if BUFFER is non-nil. This
3960function is designed to be added to either `erc-echo-notice-hook' 3960function is designed to be added to either `erc-echo-notice-hook'
3961or `erc-echo-notice-always-hook', and returns non-nil iff BUFFER 3961or `erc-echo-notice-always-hook', and returns non-nil if BUFFER
3962is non-nil." 3962is non-nil."
3963 (if buffer 3963 (if buffer
3964 (progn (erc-display-message parsed nil buffer s) t) 3964 (progn (erc-display-message parsed nil buffer s) t)
@@ -3982,7 +3982,7 @@ designed to be added to either `erc-echo-notice-hook' or
3982 "Echos a private notice in the active buffer if the active 3982 "Echos a private notice in the active buffer if the active
3983buffer is not the server buffer. This function is designed to be 3983buffer is not the server buffer. This function is designed to be
3984added to either `erc-echo-notice-hook' or 3984added to either `erc-echo-notice-hook' or
3985`erc-echo-notice-always-hook', and returns non-nil iff the active 3985`erc-echo-notice-always-hook', and returns non-nil if the active
3986buffer is not the server buffer." 3986buffer is not the server buffer."
3987 (if (not (eq (erc-server-buffer) (erc-active-buffer))) 3987 (if (not (eq (erc-server-buffer) (erc-active-buffer)))
3988 (progn (erc-display-message parsed nil 'active s) t) 3988 (progn (erc-display-message parsed nil 'active s) t)
@@ -3999,7 +3999,7 @@ designed to be added to either `erc-echo-notice-hook' or
3999 "Echos a private notice in all of the buffers for which SENDER 3999 "Echos a private notice in all of the buffers for which SENDER
4000is a member. This function is designed to be added to either 4000is a member. This function is designed to be added to either
4001`erc-echo-notice-hook' or `erc-echo-notice-always-hook', and 4001`erc-echo-notice-hook' or `erc-echo-notice-always-hook', and
4002returns non-nil iff there is at least one buffer for which the 4002returns non-nil if there is at least one buffer for which the
4003sender is a member. 4003sender is a member.
4004 4004
4005See also: `erc-echo-notice-in-first-user-buffer', 4005See also: `erc-echo-notice-in-first-user-buffer',
@@ -4013,7 +4013,7 @@ See also: `erc-echo-notice-in-first-user-buffer',
4013 "Echos a private notice in BUFFER and in all of the buffers for 4013 "Echos a private notice in BUFFER and in all of the buffers for
4014which SENDER is a member. This function is designed to be added 4014which SENDER is a member. This function is designed to be added
4015to either `erc-echo-notice-hook' or 4015to either `erc-echo-notice-hook' or
4016`erc-echo-notice-always-hook', and returns non-nil iff there is 4016`erc-echo-notice-always-hook', and returns non-nil if there is
4017at least one buffer for which the sender is a member or the 4017at least one buffer for which the sender is a member or the
4018default target. 4018default target.
4019 4019
@@ -4029,7 +4029,7 @@ See also: `erc-echo-notice-in-user-buffers',
4029 "Echos a private notice in one of the buffers for which SENDER 4029 "Echos a private notice in one of the buffers for which SENDER
4030is a member. This function is designed to be added to either 4030is a member. This function is designed to be added to either
4031`erc-echo-notice-hook' or `erc-echo-notice-always-hook', and 4031`erc-echo-notice-hook' or `erc-echo-notice-always-hook', and
4032returns non-nil iff there is at least one buffer for which the 4032returns non-nil if there is at least one buffer for which the
4033sender is a member. 4033sender is a member.
4034 4034
4035See also: `erc-echo-notice-in-user-buffers', 4035See also: `erc-echo-notice-in-user-buffers',
@@ -4938,7 +4938,7 @@ Specifically, return the position of `erc-insert-marker'."
4938(defun erc-send-input (input) 4938(defun erc-send-input (input)
4939 "Treat INPUT as typed in by the user. It is assumed that the input 4939 "Treat INPUT as typed in by the user. It is assumed that the input
4940and the prompt is already deleted. 4940and the prompt is already deleted.
4941This returns non-nil only iff we actually send anything." 4941This returns non-nil only if we actually send anything."
4942 ;; Handle different kinds of inputs 4942 ;; Handle different kinds of inputs
4943 (cond 4943 (cond
4944 ;; Ignore empty input 4944 ;; Ignore empty input
diff --git a/lisp/files.el b/lisp/files.el
index 33e9f9eb12c..da8c1e95d6e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1937,7 +1937,7 @@ since only a single case-insensitive search through the alist is made."
1937 ;; c++-mode, java-mode and more) are added through autoload 1937 ;; c++-mode, java-mode and more) are added through autoload
1938 ;; directives in that file. That way is discouraged since it 1938 ;; directives in that file. That way is discouraged since it
1939 ;; spreads out the definition of the initial value. 1939 ;; spreads out the definition of the initial value.
1940 (mapc 1940 (mapcar
1941 (lambda (elt) 1941 (lambda (elt)
1942 (cons (purecopy (car elt)) (cdr elt))) 1942 (cons (purecopy (car elt)) (cdr elt)))
1943 `(;; do this first, so that .html.pl is Polish html, not Perl 1943 `(;; do this first, so that .html.pl is Polish html, not Perl
@@ -2310,7 +2310,12 @@ we don't actually set it to the same mode the buffer already has."
2310 ;; Next compare the filename against the entries in auto-mode-alist. 2310 ;; Next compare the filename against the entries in auto-mode-alist.
2311 (unless done 2311 (unless done
2312 (if buffer-file-name 2312 (if buffer-file-name
2313 (let ((name buffer-file-name)) 2313 (let ((name buffer-file-name)
2314 (remote-id (file-remote-p buffer-file-name)))
2315 ;; Remove remote file name identification.
2316 (when (and (stringp remote-id)
2317 (string-match (regexp-quote remote-id) name))
2318 (setq name (substring name (match-end 0))))
2314 ;; Remove backup-suffixes from file name. 2319 ;; Remove backup-suffixes from file name.
2315 (setq name (file-name-sans-versions name)) 2320 (setq name (file-name-sans-versions name))
2316 (while name 2321 (while name
@@ -3989,8 +3994,9 @@ prints a message in the minibuffer. Instead, use `set-buffer-modified-p'."
3989 3994
3990(defun toggle-read-only (&optional arg) 3995(defun toggle-read-only (&optional arg)
3991 "Change whether this buffer is visiting its file read-only. 3996 "Change whether this buffer is visiting its file read-only.
3992With arg, set read-only iff arg is positive. 3997With prefix argument ARG, make the buffer read-only if ARG is
3993If visiting file read-only and `view-read-only' is non-nil, enter view mode." 3998positive, otherwise make it writable. If visiting file read-only
3999and `view-read-only' is non-nil, enter view mode."
3994 (interactive "P") 4000 (interactive "P")
3995 (if (and arg 4001 (if (and arg
3996 (if (> (prefix-numeric-value arg) 0) buffer-read-only 4002 (if (> (prefix-numeric-value arg) 0) buffer-read-only
@@ -4633,7 +4639,7 @@ FILENAME should lack slashes. You can redefine this for customization."
4633 4639
4634(defun wildcard-to-regexp (wildcard) 4640(defun wildcard-to-regexp (wildcard)
4635 "Given a shell file name pattern WILDCARD, return an equivalent regexp. 4641 "Given a shell file name pattern WILDCARD, return an equivalent regexp.
4636The generated regexp will match a filename iff the filename 4642The generated regexp will match a filename only if the filename
4637matches that wildcard according to shell rules. Only wildcards known 4643matches that wildcard according to shell rules. Only wildcards known
4638by `sh' are supported." 4644by `sh' are supported."
4639 (let* ((i (string-match "[[.*+\\^$?]" wildcard)) 4645 (let* ((i (string-match "[[.*+\\^$?]" wildcard))
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 1cefd8bb87d..be234f607b5 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -355,7 +355,7 @@ Each element in a user-level keywords list should have one of these forms:
355 355
356where MATCHER can be either the regexp to search for, or the function name to 356where MATCHER can be either the regexp to search for, or the function name to
357call to make the search (called with one argument, the limit of the search; 357call to make the search (called with one argument, the limit of the search;
358it should return non-nil, move point, and set `match-data' appropriately iff 358it should return non-nil, move point, and set `match-data' appropriately if
359it succeeds; like `re-search-forward' would). 359it succeeds; like `re-search-forward' would).
360MATCHER regexps can be generated via the function `regexp-opt'. 360MATCHER regexps can be generated via the function `regexp-opt'.
361 361
@@ -1068,7 +1068,7 @@ that tries to find such elements and move the boundaries such that they do
1068not fall in the middle of one. 1068not fall in the middle of one.
1069Each function is called with no argument; it is expected to adjust the 1069Each function is called with no argument; it is expected to adjust the
1070dynamically bound variables `font-lock-beg' and `font-lock-end'; and return 1070dynamically bound variables `font-lock-beg' and `font-lock-end'; and return
1071non-nil iff it did make such an adjustment. 1071non-nil if it did make such an adjustment.
1072These functions are run in turn repeatedly until they all return nil. 1072These functions are run in turn repeatedly until they all return nil.
1073Put first the functions more likely to cause a change and cheaper to compute.") 1073Put first the functions more likely to cause a change and cheaper to compute.")
1074;; Mark it as a special hook which doesn't use any global setting 1074;; Mark it as a special hook which doesn't use any global setting
@@ -1746,7 +1746,7 @@ A LEVEL of nil is equal to a LEVEL of 0, a LEVEL of t is equal to
1746 "Set fontification defaults appropriately for this mode. 1746 "Set fontification defaults appropriately for this mode.
1747Sets various variables using `font-lock-defaults' (or, if nil, using 1747Sets various variables using `font-lock-defaults' (or, if nil, using
1748`font-lock-defaults-alist') and `font-lock-maximum-decoration'." 1748`font-lock-defaults-alist') and `font-lock-maximum-decoration'."
1749 ;; Set fontification defaults iff not previously set for correct major mode. 1749 ;; Set fontification defaults if not previously set for correct major mode.
1750 (unless (and font-lock-set-defaults 1750 (unless (and font-lock-set-defaults
1751 (eq font-lock-mode-major-mode major-mode)) 1751 (eq font-lock-mode-major-mode major-mode))
1752 (setq font-lock-mode-major-mode major-mode) 1752 (setq font-lock-mode-major-mode major-mode)
diff --git a/lisp/format.el b/lisp/format.el
index d029e3d4683..35e47efadbf 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -429,13 +429,34 @@ a list (ABSOLUTE-FILE-NAME SIZE)."
429 (fmt (format-read (format "Read file `%s' in format: " 429 (fmt (format-read (format "Read file `%s' in format: "
430 (file-name-nondirectory file))))) 430 (file-name-nondirectory file)))))
431 (list file fmt))) 431 (list file fmt)))
432 (let (value size) 432 (let (value size old-undo)
433 (let ((format-alist nil)) 433 ;; Record only one undo entry for the insertion. Inhibit point-motion and
434 (setq value (insert-file-contents filename nil beg end)) 434 ;; modification hooks as with `insert-file-contents'.
435 (setq size (nth 1 value))) 435 (let ((inhibit-point-motion-hooks t)
436 (if format 436 (inhibit-modification-hooks t))
437 (setq size (format-decode format size) 437 ;; Don't bind `buffer-undo-list' to t here to assert that
438 value (list (car value) size))) 438 ;; `insert-file-contents' may record whether the buffer was unmodified
439 ;; before.
440 (let ((format-alist nil))
441 (setq value (insert-file-contents filename nil beg end))
442 (setq size (nth 1 value)))
443 (when (consp buffer-undo-list)
444 (let ((head (car buffer-undo-list)))
445 (when (and (consp head)
446 (equal (car head) (point))
447 (equal (cdr head) (+ (point) size)))
448 ;; Remove first entry from `buffer-undo-list', we shall insert
449 ;; another one below.
450 (setq old-undo (cdr buffer-undo-list)))))
451 (when format
452 (let ((buffer-undo-list t))
453 (setq size (format-decode format size)
454 value (list (car value) size)))
455 (unless (eq buffer-undo-list t)
456 (setq buffer-undo-list
457 (cons (cons (point) (+ (point) size)) old-undo)))))
458 (unless inhibit-modification-hooks
459 (run-hook-with-args 'after-change-functions (point) (+ (point) size) 0))
439 value)) 460 value))
440 461
441(defun format-read (&optional prompt) 462(defun format-read (&optional prompt)
diff --git a/lisp/frame.el b/lisp/frame.el
index cbb8de0571b..6b8dba81318 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1452,9 +1452,9 @@ itself as a pre-command hook."
1452 1452
1453(define-minor-mode blink-cursor-mode 1453(define-minor-mode blink-cursor-mode
1454 "Toggle blinking cursor mode. 1454 "Toggle blinking cursor mode.
1455With a numeric argument, turn blinking cursor mode on iff ARG is positive. 1455With a numeric argument, turn blinking cursor mode on if ARG is positive,
1456When blinking cursor mode is enabled, the cursor of the selected 1456otherwise turn it off. When blinking cursor mode is enabled, the
1457window blinks. 1457cursor of the selected window blinks.
1458 1458
1459Note that this command is effective only when Emacs 1459Note that this command is effective only when Emacs
1460displays through a window system, because then Emacs does its own 1460displays through a window system, because then Emacs does its own
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 83ca62ca0de..7fd187a4aeb 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,23 @@
12007-08-10 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * nntp.el (nntp-xref-number-is-evil): New server variable.
4 (nntp-find-group-and-number): If it is non-nil, don't trust article
5 numbers in the Xref header.
6
72007-08-06 Katsumi Yamaoka <yamaoka@jpl.org>
8
9 * gnus-ems.el (gnus-x-splash): Bind inhibit-read-only to t.
10
112007-08-04 Reiner Steib <Reiner.Steib@gmx.de>
12
13 * gnus-art.el (article-hide-headers): Bind inhibit-read-only to t.
14
152007-08-08 Glenn Morris <rgm@gnu.org>
16
17 * gmm-utils.el, gnus-async.el, gnus-msg.el, gnus-score.el
18 * gnus-util.el, imap.el, mailcap.el, nnimap.el: Replace `iff' in
19 doc-strings and comments.
20
12007-07-25 Glenn Morris <rgm@gnu.org> 212007-07-25 Glenn Morris <rgm@gnu.org>
2 22
3 * Relicense all FSF files to GPLv3 or later. 23 * Relicense all FSF files to GPLv3 or later.
diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el
index d7e3c344b0e..71a0662f35a 100644
--- a/lisp/gnus/gmm-utils.el
+++ b/lisp/gnus/gmm-utils.el
@@ -79,7 +79,7 @@ ARGS are passed to `message'."
79 79
80;;;###autoload 80;;;###autoload
81(defun gmm-widget-p (symbol) 81(defun gmm-widget-p (symbol)
82 "Non-nil iff SYMBOL is a widget." 82 "Non-nil if SYMBOL is a widget."
83 (get symbol 'widget-type)) 83 (get symbol 'widget-type))
84 84
85;; Copy of the `nnmail-lazy' code from `nnmail.el': 85;; Copy of the `nnmail-lazy' code from `nnmail.el':
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 40de10187f3..6ccba3b108f 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1743,7 +1743,7 @@ Initialized from `text-mode-syntax-table.")
1743 (interactive) 1743 (interactive)
1744 ;; This function might be inhibited. 1744 ;; This function might be inhibited.
1745 (unless gnus-inhibit-hiding 1745 (unless gnus-inhibit-hiding
1746 (let ((inhibit-read-only nil) 1746 (let ((inhibit-read-only t)
1747 (case-fold-search t) 1747 (case-fold-search t)
1748 (max (1+ (length gnus-sorted-header-list))) 1748 (max (1+ (length gnus-sorted-header-list)))
1749 (inhibit-point-motion-hooks t) 1749 (inhibit-point-motion-hooks t)
diff --git a/lisp/gnus/gnus-async.el b/lisp/gnus/gnus-async.el
index 3493d51950d..a06724855c5 100644
--- a/lisp/gnus/gnus-async.el
+++ b/lisp/gnus/gnus-async.el
@@ -320,7 +320,7 @@ It should return non-nil if the article is to be prefetched."
320 (pop alist)))))) 320 (pop alist))))))
321 321
322(defun gnus-async-prefetched-article-entry (group article) 322(defun gnus-async-prefetched-article-entry (group article)
323 "Return the entry for ARTICLE in GROUP iff it has been prefetched." 323 "Return the entry for ARTICLE in GROUP if it has been prefetched."
324 (let ((entry (save-excursion 324 (let ((entry (save-excursion
325 (gnus-async-set-buffer) 325 (gnus-async-set-buffer)
326 (assq (intern (format "%s-%d" group article) 326 (assq (intern (format "%s-%d" group article)
diff --git a/lisp/gnus/gnus-ems.el b/lisp/gnus/gnus-ems.el
index bacf5581e0d..88190b8085b 100644
--- a/lisp/gnus/gnus-ems.el
+++ b/lisp/gnus/gnus-ems.el
@@ -179,7 +179,7 @@
179 (interactive-p)) 179 (interactive-p))
180 "*gnus-x-splash*" 180 "*gnus-x-splash*"
181 gnus-group-buffer))) 181 gnus-group-buffer)))
182 (let ((inhibit-read-only nil) 182 (let ((inhibit-read-only t)
183 (file (nnheader-find-etc-directory "images/gnus/x-splash" t)) 183 (file (nnheader-find-etc-directory "images/gnus/x-splash" t))
184 pixmap fcw fch width height fringes sbars left yoffset top ls) 184 pixmap fcw fch width height fringes sbars left yoffset top ls)
185 (erase-buffer) 185 (erase-buffer)
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index c9aedab7019..f8e4a7a67d0 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -260,15 +260,15 @@ See also the `mml-default-encrypt-method' variable."
260This is done because new users often reply by mistake when reading 260This is done because new users often reply by mistake when reading
261news. 261news.
262This can also be a function receiving the group name as the only 262This can also be a function receiving the group name as the only
263parameter which should return non-nil iff a confirmation is needed, or 263parameter, which should return non-nil if a confirmation is needed; or
264a regexp, in which case a confirmation is asked for iff the group name 264a regexp, in which case a confirmation is asked for if the group name
265matches the regexp." 265matches the regexp."
266 :version "22.1" 266 :version "22.1"
267 :group 'gnus-message 267 :group 'gnus-message
268 :type '(choice (const :tag "No" nil) 268 :type '(choice (const :tag "No" nil)
269 (const :tag "Yes" t) 269 (const :tag "Yes" t)
270 (regexp :tag "Iff group matches regexp") 270 (regexp :tag "If group matches regexp")
271 (function :tag "Iff function evaluates to non-nil"))) 271 (function :tag "If function evaluates to non-nil")))
272 272
273(defcustom gnus-confirm-treat-mail-like-news 273(defcustom gnus-confirm-treat-mail-like-news
274 nil 274 nil
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index e833c8ccc6a..f7ba9222937 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -381,7 +381,7 @@ If nil, the user will be asked for a match type."
381 (const :tag "ask" nil))) 381 (const :tag "ask" nil)))
382 382
383(defcustom gnus-score-default-fold nil 383(defcustom gnus-score-default-fold nil
384 "Use case folding for new score file entries iff not nil." 384 "Non-nil means use case folding for new score file entries."
385 :group 'gnus-score-default 385 :group 'gnus-score-default
386 :type 'boolean) 386 :type 'boolean)
387 387
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index d065acd75ea..74aacdd2860 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1108,7 +1108,7 @@ Return the modified alist."
1108 `(setq ,alist (delq (,fun ,key ,alist) ,alist)))) 1108 `(setq ,alist (delq (,fun ,key ,alist) ,alist))))
1109 1109
1110(defun gnus-globalify-regexp (re) 1110(defun gnus-globalify-regexp (re)
1111 "Return a regexp that matches a whole line, iff RE matches a part of it." 1111 "Return a regexp that matches a whole line, if RE matches a part of it."
1112 (concat (unless (string-match "^\\^" re) "^.*") 1112 (concat (unless (string-match "^\\^" re) "^.*")
1113 re 1113 re
1114 (unless (string-match "\\$$" re) ".*$"))) 1114 (unless (string-match "\\$$" re) ".*$")))
diff --git a/lisp/gnus/imap.el b/lisp/gnus/imap.el
index abe1c7e1c9e..f60801e9ba8 100644
--- a/lisp/gnus/imap.el
+++ b/lisp/gnus/imap.el
@@ -1581,7 +1581,7 @@ is non-nil return these properties."
1581 (imap-mailbox-get-1 'search imap-current-mailbox))))) 1581 (imap-mailbox-get-1 'search imap-current-mailbox)))))
1582 1582
1583(defun imap-message-flag-permanent-p (flag &optional mailbox buffer) 1583(defun imap-message-flag-permanent-p (flag &optional mailbox buffer)
1584 "Return t iff FLAG can be permanently (between IMAP sessions) saved on articles, in MAILBOX on server in BUFFER." 1584 "Return t if FLAG can be permanently (between IMAP sessions) saved on articles, in MAILBOX on server in BUFFER."
1585 (with-current-buffer (or buffer (current-buffer)) 1585 (with-current-buffer (or buffer (current-buffer))
1586 (or (member "\\*" (imap-mailbox-get 'permanentflags mailbox)) 1586 (or (member "\\*" (imap-mailbox-get 'permanentflags mailbox))
1587 (member flag (imap-mailbox-get 'permanentflags mailbox))))) 1587 (member flag (imap-mailbox-get 'permanentflags mailbox)))))
diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el
index 422b99d0e0f..e8b624aa546 100644
--- a/lisp/gnus/mailcap.el
+++ b/lisp/gnus/mailcap.el
@@ -538,7 +538,7 @@ MAILCAPS if set; otherwise (on Unix) use the path from RFC 1524, plus
538 results))) 538 results)))
539 539
540(defun mailcap-mailcap-entry-passes-test (info) 540(defun mailcap-mailcap-entry-passes-test (info)
541 "Return non-nil iff mailcap entry INFO passes its test clause. 541 "Return non-nil if mailcap entry INFO passes its test clause.
542Also return non-nil if no test clause is present." 542Also return non-nil if no test clause is present."
543 (let ((test (assq 'test info)) ; The test clause 543 (let ((test (assq 'test info)) ; The test clause
544 status) 544 status)
@@ -631,7 +631,7 @@ Also return non-nil if no test clause is present."
631(defvar mailcap-viewer-test-cache nil) 631(defvar mailcap-viewer-test-cache nil)
632 632
633(defun mailcap-viewer-passes-test (viewer-info type-info) 633(defun mailcap-viewer-passes-test (viewer-info type-info)
634 "Return non-nil iff viewer specified by VIEWER-INFO passes its test clause. 634 "Return non-nil if viewer specified by VIEWER-INFO passes its test clause.
635Also return non-nil if it has no test clause. TYPE-INFO is an argument 635Also return non-nil if it has no test clause. TYPE-INFO is an argument
636to supply to the test." 636to supply to the test."
637 (let* ((test-info (assq 'test viewer-info)) 637 (let* ((test-info (assq 'test viewer-info))
@@ -704,7 +704,7 @@ If TEST is not given, it defaults to t."
704;;; 704;;;
705 705
706(defun mailcap-viewer-lessp (x y) 706(defun mailcap-viewer-lessp (x y)
707 "Return t iff viewer X is more desirable than viewer Y." 707 "Return t if viewer X is more desirable than viewer Y."
708 (let ((x-wild (string-match "[*?]" (or (cdr-safe (assq 'type x)) ""))) 708 (let ((x-wild (string-match "[*?]" (or (cdr-safe (assq 'type x)) "")))
709 (y-wild (string-match "[*?]" (or (cdr-safe (assq 'type y)) ""))) 709 (y-wild (string-match "[*?]" (or (cdr-safe (assq 'type y)) "")))
710 (x-lisp (not (stringp (or (cdr-safe (assq 'viewer x)) "")))) 710 (x-lisp (not (stringp (or (cdr-safe (assq 'viewer x)) ""))))
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 235039c3ee9..ba23280658a 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -1645,7 +1645,7 @@ be used in a STORE FLAGS command."
1645 result))) 1645 result)))
1646 1646
1647(defun nnimap-mark-permanent-p (mark &optional group) 1647(defun nnimap-mark-permanent-p (mark &optional group)
1648 "Return t iff MARK can be permanently (between IMAP sessions) saved on articles, in GROUP." 1648 "Return t if MARK can be permanently (between IMAP sessions) saved on articles, in GROUP."
1649 (imap-message-flag-permanent-p (nnimap-mark-to-flag mark))) 1649 (imap-message-flag-permanent-p (nnimap-mark-to-flag mark)))
1650 1650
1651(when nnimap-debug 1651(when nnimap-debug
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 869213c9ae5..2623df58e4d 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -183,6 +183,14 @@ by one.")
183If the gap between two consecutive articles is bigger than this 183If the gap between two consecutive articles is bigger than this
184variable, split the XOVER request into two requests.") 184variable, split the XOVER request into two requests.")
185 185
186(defvoo nntp-xref-number-is-evil nil
187 "*If non-nil, Gnus never trusts article numbers in the Xref header.
188Some news servers, e.g., ones running Diablo, run multiple engines
189having the same articles but article numbers are not kept synchronized
190between them. If you connect to such a server, set this to a non-nil
191value, and Gnus never uses article numbers (that appear in the Xref
192header and vary by which engine is chosen) to refer to articles.")
193
186(defvoo nntp-prepare-server-hook nil 194(defvoo nntp-prepare-server-hook nil
187 "*Hook run before a server is opened. 195 "*Hook run before a server is opened.
188If can be used to set up a server remotely, for instance. Say you 196If can be used to set up a server remotely, for instance. Say you
@@ -1632,7 +1640,8 @@ password contained in '~/.nntp-authinfo'."
1632 (match-string 1 xref)) 1640 (match-string 1 xref))
1633 (t ""))) 1641 (t "")))
1634 (cond 1642 (cond
1635 ((and (setq xref (mail-fetch-field "xref")) 1643 ((and (not nntp-xref-number-is-evil)
1644 (setq xref (mail-fetch-field "xref"))
1636 (string-match 1645 (string-match
1637 (if group 1646 (if group
1638 (concat "\\(" (regexp-quote group) "\\):\\([0-9]+\\)") 1647 (concat "\\(" (regexp-quote group) "\\):\\([0-9]+\\)")
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 28ac693f870..1435eb019ec 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -461,9 +461,11 @@ that."
461 ;; An obvious case of a key substitution: 461 ;; An obvious case of a key substitution:
462 (save-excursion 462 (save-excursion
463 (while (re-search-forward 463 (while (re-search-forward
464 ;; Assume command name is only word characters 464 ;; Assume command name is only word and symbol
465 ;; and dashes to get things like `use M-x foo.'. 465 ;; characters to get things like `use M-x foo->bar'.
466 "\\<M-x\\s-+\\(\\sw\\(\\sw\\|-\\)+\\)" nil t) 466 ;; Command required to end with word constituent
467 ;; to avoid `.' at end of a sentence.
468 "\\<M-x\\s-+\\(\\sw\\(\\sw\\|\\s_\\)*\\sw\\)" nil t)
467 (let ((sym (intern-soft (match-string 1)))) 469 (let ((sym (intern-soft (match-string 1))))
468 (if (fboundp sym) 470 (if (fboundp sym)
469 (help-xref-button 1 'help-function sym))))) 471 (help-xref-button 1 'help-function sym)))))
@@ -489,7 +491,7 @@ that."
489 (end-of-line) 491 (end-of-line)
490 (skip-chars-backward "^ \t\n") 492 (skip-chars-backward "^ \t\n")
491 (if (and (>= (current-column) col) 493 (if (and (>= (current-column) col)
492 (looking-at "\\(\\sw\\|-\\)+$")) 494 (looking-at "\\(\\sw\\|\\s_\\)+$"))
493 (let ((sym (intern-soft (match-string 0)))) 495 (let ((sym (intern-soft (match-string 0))))
494 (if (fboundp sym) 496 (if (fboundp sym)
495 (help-xref-button 0 'help-function sym)))) 497 (help-xref-button 0 'help-function sym))))
diff --git a/lisp/help.el b/lisp/help.el
index f75e26f93e6..4a94fd35bc7 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -958,14 +958,14 @@ This applies to `help', `apropos' and `completion' buffers, and some others."
958 (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window))) 958 (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window)))
959 959
960(defun resize-temp-buffer-window () 960(defun resize-temp-buffer-window ()
961 "Resize the current window to fit its contents. 961 "Resize the selected window to fit its contents.
962Will not make it higher than `temp-buffer-max-height' nor smaller than 962Will not make it higher than `temp-buffer-max-height' nor smaller than
963`window-min-height'. Do nothing if it is the only window on its frame, if it 963`window-min-height'. Do nothing if it is the only window on its frame, if it
964is not as wide as the frame or if some of the window's contents are scrolled 964is not as wide as the frame or if some of the window's contents are scrolled
965out of view." 965out of view."
966 (unless (or (one-window-p 'nomini) 966 (unless (or (one-window-p 'nomini)
967 (not (pos-visible-in-window-p (point-min))) 967 (not (pos-visible-in-window-p (point-min)))
968 (/= (frame-width) (window-width))) 968 (not (window-full-width-p)))
969 (fit-window-to-buffer 969 (fit-window-to-buffer
970 (selected-window) 970 (selected-window)
971 (if (functionp temp-buffer-max-height) 971 (if (functionp temp-buffer-max-height)
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index b1238b66419..a167b2bc1e7 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -131,7 +131,7 @@
131;; an example, if the value is `buffer-file-name' then all buffers 131;; an example, if the value is `buffer-file-name' then all buffers
132;; who are visiting files are suitable, but others (like dired 132;; who are visiting files are suitable, but others (like dired
133;; buffers) are not; 133;; buffers) are not;
134;; * a list -- then the buffer is suitable iff its mode is in the 134;; * a list -- then the buffer is suitable if its mode is in the
135;; list, except if the first element is `not', in which case the test 135;; list, except if the first element is `not', in which case the test
136;; is reversed (i.e. it is a list of unsuitable modes). 136;; is reversed (i.e. it is a list of unsuitable modes).
137;; * Otherwise, the buffer is suitable if its name does not begin with 137;; * Otherwise, the buffer is suitable if its name does not begin with
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index b077342e5f5..7847bed6f2d 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -1331,7 +1331,7 @@ If a buffer has no filename, it is ignored.
1331With no prefix arg, use the filename sans its directory of each marked file. 1331With no prefix arg, use the filename sans its directory of each marked file.
1332With a zero prefix arg, use the complete filename of each marked file. 1332With a zero prefix arg, use the complete filename of each marked file.
1333With \\[universal-argument], use the filename of each marked file relative 1333With \\[universal-argument], use the filename of each marked file relative
1334to `ibuffer-default-directory' iff non-nil, otherwise `default-directory'. 1334to `ibuffer-default-directory' if non-nil, otherwise `default-directory'.
1335 1335
1336You can then feed the file name(s) to other commands with \\[yank]." 1336You can then feed the file name(s) to other commands with \\[yank]."
1337 (interactive "p") 1337 (interactive "p")
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index c4842b9d982..80133d227ab 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1835,7 +1835,7 @@ If point is on a group name, this function operates on that group."
1835 1835
1836(defun ibuffer-map-lines (function &optional nomodify group) 1836(defun ibuffer-map-lines (function &optional nomodify group)
1837 "Call FUNCTION for each buffer. 1837 "Call FUNCTION for each buffer.
1838Don't set the ibuffer modification flag iff NOMODIFY is non-nil. 1838Set the ibuffer modification flag unless NOMODIFY is non-nil.
1839 1839
1840If optional argument GROUP is non-nil, then only call FUNCTION on 1840If optional argument GROUP is non-nil, then only call FUNCTION on
1841buffers in filtering group GROUP. 1841buffers in filtering group GROUP.
@@ -2267,7 +2267,7 @@ If optional arg SILENT is non-nil, do not display progress messages."
2267 2267
2268(defun ibuffer-quit () 2268(defun ibuffer-quit ()
2269 "Quit this `ibuffer' session. 2269 "Quit this `ibuffer' session.
2270Try to restore the previous window configuration iff 2270Try to restore the previous window configuration if
2271`ibuffer-restore-window-config-on-quit' is non-nil." 2271`ibuffer-restore-window-config-on-quit' is non-nil."
2272 (interactive) 2272 (interactive)
2273 (if ibuffer-restore-window-config-on-quit 2273 (if ibuffer-restore-window-config-on-quit
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index d1e8f9cc3f8..44c854f2f46 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -99,7 +99,7 @@ completions - see `icomplete-delay-completions-threshold'."
99(defcustom icomplete-minibuffer-setup-hook nil 99(defcustom icomplete-minibuffer-setup-hook nil
100 "*Icomplete-specific customization of minibuffer setup. 100 "*Icomplete-specific customization of minibuffer setup.
101 101
102This hook is run during minibuffer setup iff icomplete will be active. 102This hook is run during minibuffer setup if icomplete is active.
103It is intended for use in customizing icomplete for interoperation 103It is intended for use in customizing icomplete for interoperation
104with other features and packages. For instance: 104with other features and packages. For instance:
105 105
@@ -168,7 +168,8 @@ except those on this list.")
168;;;###autoload 168;;;###autoload
169(define-minor-mode icomplete-mode 169(define-minor-mode icomplete-mode
170 "Toggle incremental minibuffer completion for this Emacs session. 170 "Toggle incremental minibuffer completion for this Emacs session.
171With a numeric argument, turn Icomplete mode on iff ARG is positive." 171With a numeric argument, turn Icomplete mode on if ARG is positive,
172otherwise turn it off."
172 :global t :group 'icomplete 173 :global t :group 'icomplete
173 (if icomplete-mode 174 (if icomplete-mode
174 ;; The following is not really necessary after first time - 175 ;; The following is not really necessary after first time -
diff --git a/lisp/ido.el b/lisp/ido.el
index e5c4b644f95..ca44e99b594 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -898,7 +898,7 @@ See documentation of `walk-windows' for useful values.")
898(defcustom ido-minibuffer-setup-hook nil 898(defcustom ido-minibuffer-setup-hook nil
899 "*Ido-specific customization of minibuffer setup. 899 "*Ido-specific customization of minibuffer setup.
900 900
901This hook is run during minibuffer setup iff `ido' will be active. 901This hook is run during minibuffer setup if `ido' is active.
902It is intended for use in customizing ido for interoperation 902It is intended for use in customizing ido for interoperation
903with other packages. For instance: 903with other packages. For instance:
904 904
diff --git a/lisp/image.el b/lisp/image.el
index 3b0dd87d1ef..6763cf151fe 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -327,7 +327,7 @@ Image types are symbols like `xbm' or `jpeg'."
327 327
328;;;###autoload 328;;;###autoload
329(defun image-type-auto-detected-p () 329(defun image-type-auto-detected-p ()
330 "Return t iff the current buffer contains an auto-detectable image. 330 "Return t if the current buffer contains an auto-detectable image.
331This function is intended to be used from `magic-fallback-mode-alist'. 331This function is intended to be used from `magic-fallback-mode-alist'.
332 332
333The buffer is considered to contain an auto-detectable image if 333The buffer is considered to contain an auto-detectable image if
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 9aa1f5ea088..6c1de967e66 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -727,7 +727,7 @@ definitions, etc. It contains a substring which is the name to
727appear in the menu. See the info section on Regexps for more 727appear in the menu. See the info section on Regexps for more
728information. REGEXP may also be a function, called without 728information. REGEXP may also be a function, called without
729arguments. It is expected to search backwards. It shall return 729arguments. It is expected to search backwards. It shall return
730true and set `match-data' iff it finds another element. 730true and set `match-data' if it finds another element.
731 731
732INDEX points to the substring in REGEXP that contains the 732INDEX points to the substring in REGEXP that contains the
733name (of the function, variable or type) that is to appear in the 733name (of the function, variable or type) that is to appear in the
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 8ace7730a12..4ed13ba08e0 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -144,7 +144,7 @@ to `symbol', and the help mode defaults to the current major mode."
144 (apply 'info-lookup-add-help* nil arg)) 144 (apply 'info-lookup-add-help* nil arg))
145 145
146(defun info-lookup-maybe-add-help (&rest arg) 146(defun info-lookup-maybe-add-help (&rest arg)
147 "Add a help specification iff none is defined. 147 "Add a help specification if none is defined.
148See the documentation of the function `info-lookup-add-help' 148See the documentation of the function `info-lookup-add-help'
149for more details." 149for more details."
150 (apply 'info-lookup-add-help* t arg)) 150 (apply 'info-lookup-add-help* t arg))
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index 5fa18221327..e7c9b633b3b 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -215,8 +215,8 @@
215;; Return t if substring of STR (between FROM and TO) can be broken up 215;; Return t if substring of STR (between FROM and TO) can be broken up
216;; to chunks all of which can be derived from another entry in SKK 216;; to chunks all of which can be derived from another entry in SKK
217;; dictionary. SKKBUF is the buffer where the original SKK dictionary 217;; dictionary. SKKBUF is the buffer where the original SKK dictionary
218;; is visited, KANA is the current entry for STR. FIRST is t iff this 218;; is visited, KANA is the current entry for STR. FIRST is t only if
219;; is called at top level. 219;; this is called at top level.
220 220
221(defun skkdic-breakup-string (skkbuf kana str from to &optional first) 221(defun skkdic-breakup-string (skkbuf kana str from to &optional first)
222 (let ((len (- to from))) 222 (let ((len (- to from)))
diff --git a/lisp/international/latin1-disp.el b/lisp/international/latin1-disp.el
index 515695bf503..ebeef71b0b7 100644
--- a/lisp/international/latin1-disp.el
+++ b/lisp/international/latin1-disp.el
@@ -777,9 +777,9 @@ use either \\[customize] or the function `latin1-display'."
777 "Set up Latin-1/ASCII display for Unicode characters. 777 "Set up Latin-1/ASCII display for Unicode characters.
778This uses the transliterations of the Lynx browser. 778This uses the transliterations of the Lynx browser.
779 779
780With argument ARG, turn such display on iff ARG is positive, otherwise 780With argument ARG, turn such display on if ARG is positive, otherwise
781turn it off and display Unicode characters literally. The display 781turn it off and display Unicode characters literally. The display
782is't changed if the display can render Unicode characters." 782isn't changed if the display can render Unicode characters."
783 (interactive "p") 783 (interactive "p")
784 (if (> arg 0) 784 (if (> arg 0)
785 (unless (char-displayable-p 785 (unless (char-displayable-p
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 5bbe53e7ea7..d61e1f31d8f 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -445,11 +445,11 @@ non-nil, it is used to sort CODINGS instead."
445 (let ((base (coding-system-base x))) 445 (let ((base (coding-system-base x)))
446 ;; We calculate the priority number 0..255 by 446 ;; We calculate the priority number 0..255 by
447 ;; using the 8 bits PMMLCEII as this: 447 ;; using the 8 bits PMMLCEII as this:
448 ;; P: 1 iff most preferred. 448 ;; P: 1 if most preferred.
449 ;; MM: greater than 0 iff mime-charset. 449 ;; MM: greater than 0 if mime-charset.
450 ;; L: 1 iff one of the current lang. env.'s codings. 450 ;; L: 1 if one of the current lang. env.'s codings.
451 ;; C: 1 iff one of codings listed in the category list. 451 ;; C: 1 if one of codings listed in the category list.
452 ;; E: 1 iff not XXX-with-esc 452 ;; E: 1 if not XXX-with-esc
453 ;; II: if iso-2022 based, 0..3, else 1. 453 ;; II: if iso-2022 based, 0..3, else 1.
454 (logior 454 (logior
455 (lsh (if (eq base most-preferred) 1 0) 7) 455 (lsh (if (eq base most-preferred) 1 0) 7)
diff --git a/lisp/international/quail.el b/lisp/international/quail.el
index 774e3c14269..cddcf9867c2 100644
--- a/lisp/international/quail.el
+++ b/lisp/international/quail.el
@@ -55,7 +55,7 @@
55 55
56;;; Code: 56;;; Code:
57 57
58(require 'help-mode) 58(eval-when-compile (require 'help-mode))
59 59
60(defgroup quail nil 60(defgroup quail nil
61 "Quail: multilingual input method." 61 "Quail: multilingual input method."
@@ -1942,7 +1942,7 @@ Remaining args are for FUNC."
1942 (overlay-put quail-overlay 'face 'highlight)))) 1942 (overlay-put quail-overlay 'face 'highlight))))
1943 1943
1944(defun quail-require-guidance-buf () 1944(defun quail-require-guidance-buf ()
1945 "Return t iff the current Quail package requires showing guidance buffer." 1945 "Return t if the current Quail package requires showing guidance buffer."
1946 (and input-method-verbose-flag 1946 (and input-method-verbose-flag
1947 (if (eq input-method-verbose-flag 'default) 1947 (if (eq input-method-verbose-flag 'default)
1948 (not (and (eq (selected-window) (minibuffer-window)) 1948 (not (and (eq (selected-window) (minibuffer-window))
@@ -2431,22 +2431,27 @@ should be made by `quail-build-decode-map' (which see)."
2431 (insert ?\n)) 2431 (insert ?\n))
2432 (insert ?\n)))) 2432 (insert ?\n))))
2433 2433
2434(define-button-type 'quail-keyboard-layout-button 2434(defun quail-help-init ()
2435 :supertype 'help-xref 2435 (unless (featurep 'help-mode)
2436 'help-function '(lambda (layout) 2436 (require 'help-mode)
2437 (help-setup-xref `(quail-keyboard-layout-button ,layout) nil) 2437 (define-button-type 'quail-keyboard-layout-button
2438 (quail-show-keyboard-layout layout)) 2438 :supertype 'help-xref
2439 'help-echo (purecopy "mouse-2, RET: show keyboard layout")) 2439 'help-function '(lambda (layout)
2440 2440 (help-setup-xref `(quail-keyboard-layout-button ,layout)
2441(define-button-type 'quail-keyboard-customize-button 2441 nil)
2442 :supertype 'help-customize-variable 2442 (quail-show-keyboard-layout layout))
2443 'help-echo (purecopy "mouse-2, RET: customize keyboard layout")) 2443 'help-echo (purecopy "mouse-2, RET: show keyboard layout"))
2444
2445 (define-button-type 'quail-keyboard-customize-button
2446 :supertype 'help-customize-variable
2447 'help-echo (purecopy "mouse-2, RET: customize keyboard layout"))))
2444 2448
2445(defun quail-help (&optional package) 2449(defun quail-help (&optional package)
2446 "Show brief description of the current Quail package. 2450 "Show brief description of the current Quail package.
2447Optional arg PACKAGE specifies the name of alternative Quail 2451Optional arg PACKAGE specifies the name of alternative Quail
2448package to describe." 2452package to describe."
2449 (interactive) 2453 (interactive)
2454 (quail-help-init)
2450 (let ((help-xref-mule-regexp help-xref-mule-regexp-template) 2455 (let ((help-xref-mule-regexp help-xref-mule-regexp-template)
2451 (default-enable-multibyte-characters enable-multibyte-characters) 2456 (default-enable-multibyte-characters enable-multibyte-characters)
2452 (package-def 2457 (package-def
@@ -2629,7 +2634,7 @@ KEY BINDINGS FOR CONVERSION
2629;; it is not yet stored. As a result, the element is a string or a 2634;; it is not yet stored. As a result, the element is a string or a
2630;; list of strings. 2635;; list of strings.
2631 2636
2632(defsubst quail-store-decode-map-key (table char key) 2637(defun quail-store-decode-map-key (table char key)
2633 (let ((elt (aref table char))) 2638 (let ((elt (aref table char)))
2634 (if elt 2639 (if elt
2635 (if (consp elt) 2640 (if (consp elt)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 93d43fcf18b..e0cba48eed9 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -825,7 +825,7 @@ NOPUSH is t and EDIT is t."
825 (run-hooks 'isearch-mode-end-hook)) 825 (run-hooks 'isearch-mode-end-hook))
826 826
827 ;; If there was movement, mark the starting position. 827 ;; If there was movement, mark the starting position.
828 ;; Maybe should test difference between and set mark iff > threshold. 828 ;; Maybe should test difference between and set mark only if > threshold.
829 (if (/= (point) isearch-opoint) 829 (if (/= (point) isearch-opoint)
830 (or (and transient-mark-mode mark-active) 830 (or (and transient-mark-mode mark-active)
831 (progn 831 (progn
@@ -2329,7 +2329,7 @@ since they have special meaning in a regexp."
2329;; - the direction of the current search is expected to be given by 2329;; - the direction of the current search is expected to be given by
2330;; `isearch-forward'; 2330;; `isearch-forward';
2331;; - the variable `isearch-error' is expected to be true 2331;; - the variable `isearch-error' is expected to be true
2332;; iff `isearch-string' is an invalid regexp. 2332;; only if `isearch-string' is an invalid regexp.
2333 2333
2334(defvar isearch-lazy-highlight-overlays nil) 2334(defvar isearch-lazy-highlight-overlays nil)
2335(defvar isearch-lazy-highlight-wrapped nil) 2335(defvar isearch-lazy-highlight-wrapped nil)
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el
index 068f5fff2cd..233997285c9 100644
--- a/lisp/iswitchb.el
+++ b/lisp/iswitchb.el
@@ -396,7 +396,7 @@ See documentation of `walk-windows' for useful values.")
396(defcustom iswitchb-minibuffer-setup-hook nil 396(defcustom iswitchb-minibuffer-setup-hook nil
397 "Iswitchb-specific customization of minibuffer setup. 397 "Iswitchb-specific customization of minibuffer setup.
398 398
399This hook is run during minibuffer setup iff `iswitchb' will be active. 399This hook is run during minibuffer setup if `iswitchb' is active.
400For instance: 400For instance:
401\(add-hook 'iswitchb-minibuffer-setup-hook 401\(add-hook 'iswitchb-minibuffer-setup-hook
402 '\(lambda () (set (make-local-variable 'max-mini-window-height) 3))) 402 '\(lambda () (set (make-local-variable 'max-mini-window-height) 3)))
@@ -1440,7 +1440,7 @@ This is an example function which can be hooked on to
1440 (iswitchb-to-end summaries))) 1440 (iswitchb-to-end summaries)))
1441 1441
1442(defun iswitchb-case () 1442(defun iswitchb-case ()
1443 "Return non-nil iff we should ignore case when matching. 1443 "Return non-nil if we should ignore case when matching.
1444See the variable `iswitchb-case' for details." 1444See the variable `iswitchb-case' for details."
1445 (if iswitchb-case 1445 (if iswitchb-case
1446 (if (featurep 'xemacs) 1446 (if (featurep 'xemacs)
@@ -1450,7 +1450,7 @@ See the variable `iswitchb-case' for details."
1450;;;###autoload 1450;;;###autoload
1451(define-minor-mode iswitchb-mode 1451(define-minor-mode iswitchb-mode
1452 "Toggle Iswitchb global minor mode. 1452 "Toggle Iswitchb global minor mode.
1453With arg, turn Iswitchb mode on if and only iff ARG is positive. 1453With arg, turn Iswitchb mode on if ARG is positive, otherwise turn it off.
1454This mode enables switching between buffers using substrings. See 1454This mode enables switching between buffers using substrings. See
1455`iswitchb' for details." 1455`iswitchb' for details."
1456 nil nil iswitchb-global-map :global t :group 'iswitchb 1456 nil nil iswitchb-global-map :global t :group 'iswitchb
diff --git a/lisp/log-edit.el b/lisp/log-edit.el
index 7b07b590a4f..5c2cf989f62 100644
--- a/lisp/log-edit.el
+++ b/lisp/log-edit.el
@@ -568,7 +568,7 @@ for more details."
568(defvar user-mail-address) 568(defvar user-mail-address)
569(defun log-edit-changelog-ours-p () 569(defun log-edit-changelog-ours-p ()
570 "See if ChangeLog entry at point is for the current user, today. 570 "See if ChangeLog entry at point is for the current user, today.
571Return non-nil iff it is." 571Return non-nil if it is."
572 ;; Code adapted from add-change-log-entry. 572 ;; Code adapted from add-change-log-entry.
573 (let ((name (or (and (boundp 'add-log-full-name) add-log-full-name) 573 (let ((name (or (and (boundp 'add-log-full-name) add-log-full-name)
574 (and (fboundp 'user-full-name) (user-full-name)) 574 (and (fboundp 'user-full-name) (user-full-name))
diff --git a/lisp/log-view.el b/lisp/log-view.el
index 7520e13a1f6..51861da2ae6 100644
--- a/lisp/log-view.el
+++ b/lisp/log-view.el
@@ -174,6 +174,7 @@ The match group number 1 should match the revision number itself.")
174 (1 (if (boundp 'cvs-filename-face) cvs-filename-face)) 174 (1 (if (boundp 'cvs-filename-face) cvs-filename-face))
175 (0 log-view-file-face append))) 175 (0 log-view-file-face append)))
176 (eval . `(,log-view-message-re . log-view-message-face)))) 176 (eval . `(,log-view-message-re . log-view-message-face))))
177
177(defconst log-view-font-lock-defaults 178(defconst log-view-font-lock-defaults
178 '(log-view-font-lock-keywords t nil nil nil)) 179 '(log-view-font-lock-keywords t nil nil nil))
179 180
diff --git a/lisp/longlines.el b/lisp/longlines.el
index fa73ef7057d..07977910a22 100644
--- a/lisp/longlines.el
+++ b/lisp/longlines.el
@@ -79,11 +79,13 @@ This is used when `longlines-show-hard-newlines' is on."
79(defvar longlines-wrap-end nil) 79(defvar longlines-wrap-end nil)
80(defvar longlines-wrap-point nil) 80(defvar longlines-wrap-point nil)
81(defvar longlines-showing nil) 81(defvar longlines-showing nil)
82(defvar longlines-decoded nil)
82 83
83(make-variable-buffer-local 'longlines-wrap-beg) 84(make-variable-buffer-local 'longlines-wrap-beg)
84(make-variable-buffer-local 'longlines-wrap-end) 85(make-variable-buffer-local 'longlines-wrap-end)
85(make-variable-buffer-local 'longlines-wrap-point) 86(make-variable-buffer-local 'longlines-wrap-point)
86(make-variable-buffer-local 'longlines-showing) 87(make-variable-buffer-local 'longlines-showing)
88(make-variable-buffer-local 'longlines-decoded)
87 89
88;; Mode 90;; Mode
89 91
@@ -128,7 +130,9 @@ are indicated with a symbol."
128 ;; longlines-wrap-lines that we'll never encounter from here 130 ;; longlines-wrap-lines that we'll never encounter from here
129 (save-restriction 131 (save-restriction
130 (widen) 132 (widen)
131 (longlines-decode-buffer) 133 (unless longlines-decoded
134 (longlines-decode-buffer)
135 (setq longlines-decoded t))
132 (longlines-wrap-region (point-min) (point-max))) 136 (longlines-wrap-region (point-min) (point-max)))
133 (set-buffer-modified-p mod)) 137 (set-buffer-modified-p mod))
134 (when (and longlines-show-hard-newlines 138 (when (and longlines-show-hard-newlines
@@ -161,9 +165,11 @@ are indicated with a symbol."
161 (let ((buffer-undo-list t) 165 (let ((buffer-undo-list t)
162 (after-change-functions nil) 166 (after-change-functions nil)
163 (inhibit-read-only t)) 167 (inhibit-read-only t))
164 (save-restriction 168 (if longlines-decoded
165 (widen) 169 (save-restriction
166 (longlines-encode-region (point-min) (point-max)))) 170 (widen)
171 (longlines-encode-region (point-min) (point-max))
172 (setq longlines-decoded nil))))
167 (remove-hook 'change-major-mode-hook 'longlines-mode-off t) 173 (remove-hook 'change-major-mode-hook 'longlines-mode-off t)
168 (remove-hook 'after-change-functions 'longlines-after-change-function t) 174 (remove-hook 'after-change-functions 'longlines-after-change-function t)
169 (remove-hook 'post-command-hook 'longlines-post-command-function t) 175 (remove-hook 'post-command-hook 'longlines-post-command-function t)
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index b3e2c051e7d..8862e6ca2d2 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -495,7 +495,7 @@ of a mail alias. The value is set up, buffer-local, when first needed.")
495 495
496 (or (and (integerp last-command-char) 496 (or (and (integerp last-command-char)
497 ;; Some commands such as M-> may want to expand first. 497 ;; Some commands such as M-> may want to expand first.
498 (equal this-command 'self-insert) 498 (equal this-command 'self-insert-command)
499 (or (eq (char-syntax last-command-char) ?_) 499 (or (eq (char-syntax last-command-char) ?_)
500 ;; Don't expand on @. 500 ;; Don't expand on @.
501 (memq last-command-char '(?@ ?. ?% ?! ?_ ?-)))) 501 (memq last-command-char '(?@ ?. ?% ?! ?_ ?-))))
diff --git a/lisp/mail/mspools.el b/lisp/mail/mspools.el
index d14be55735f..988ce2f8e02 100644
--- a/lisp/mail/mspools.el
+++ b/lisp/mail/mspools.el
@@ -398,7 +398,7 @@ nil."
398 )) 398 ))
399 399
400(defun mspools-size-folder (spool) 400(defun mspools-size-folder (spool)
401 "Return (SPOOL . SIZE ) iff SIZE of spool file is non-zero." 401 "Return (SPOOL . SIZE ), if SIZE of spool file is non-zero."
402 ;; 7th file attribute is the size of the file in bytes. 402 ;; 7th file attribute is the size of the file in bytes.
403 (let ((file (concat mspools-folder-directory spool)) 403 (let ((file (concat mspools-folder-directory spool))
404 size) 404 size)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 37a0533acc9..ee990f2fdd3 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3992,13 +3992,13 @@ specifying headers which should not be copied into the new message."
3992 (mail-position-on-field (if resending "Resent-To" "To") t)))))) 3992 (mail-position-on-field (if resending "Resent-To" "To") t))))))
3993 3993
3994(defun rmail-summary-exists () 3994(defun rmail-summary-exists ()
3995 "Non-nil iff in an RMAIL buffer and an associated summary buffer exists. 3995 "Non-nil if in an RMAIL buffer and an associated summary buffer exists.
3996In fact, the non-nil value returned is the summary buffer itself." 3996In fact, the non-nil value returned is the summary buffer itself."
3997 (and rmail-summary-buffer (buffer-name rmail-summary-buffer) 3997 (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
3998 rmail-summary-buffer)) 3998 rmail-summary-buffer))
3999 3999
4000(defun rmail-summary-displayed () 4000(defun rmail-summary-displayed ()
4001 "t iff in RMAIL buffer and an associated summary buffer is displayed." 4001 "t if in RMAIL buffer and an associated summary buffer is displayed."
4002 (and rmail-summary-buffer (get-buffer-window rmail-summary-buffer))) 4002 (and rmail-summary-buffer (get-buffer-window rmail-summary-buffer)))
4003 4003
4004(defcustom rmail-redisplay-summary nil 4004(defcustom rmail-redisplay-summary nil
diff --git a/lisp/man.el b/lisp/man.el
index 56539072439..c7593e88dda 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -37,7 +37,7 @@
37 37
38;; ========== Credits and History ========== 38;; ========== Credits and History ==========
39;; In mid 1991, several people posted some interesting improvements to 39;; In mid 1991, several people posted some interesting improvements to
40;; man.el from the standard emacs 18.57 distribution. I liked many of 40;; man.el from the standard Emacs 18.57 distribution. I liked many of
41;; these, but wanted everything in one single package, so I decided 41;; these, but wanted everything in one single package, so I decided
42;; to incorporate them into a single manual browsing mode. While 42;; to incorporate them into a single manual browsing mode. While
43;; much of the code here has been rewritten, and some features added, 43;; much of the code here has been rewritten, and some features added,
@@ -64,7 +64,7 @@
64;; ========== Features ========== 64;; ========== Features ==========
65;; + Runs "man" in the background and pipes the results through a 65;; + Runs "man" in the background and pipes the results through a
66;; series of sed and awk scripts so that all retrieving and cleaning 66;; series of sed and awk scripts so that all retrieving and cleaning
67;; is done in the background. The cleaning commands are configurable. 67;; is done in the background. The cleaning commands are configurable.
68;; + Syntax is the same as Un*x man 68;; + Syntax is the same as Un*x man
69;; + Functionality is the same as Un*x man, including "man -k" and 69;; + Functionality is the same as Un*x man, including "man -k" and
70;; "man <section>", etc. 70;; "man <section>", etc.
@@ -109,8 +109,6 @@
109 109
110 110
111(defvar Man-notify) 111(defvar Man-notify)
112(defvar Man-current-page)
113(defvar Man-page-list)
114(defcustom Man-filter-list nil 112(defcustom Man-filter-list nil
115 "*Manpage cleaning filter command phrases. 113 "*Manpage cleaning filter command phrases.
116This variable contains a list of the following form: 114This variable contains a list of the following form:
@@ -127,13 +125,8 @@ the manpage buffer."
127 (string :tag "Phrase String")))) 125 (string :tag "Phrase String"))))
128 :group 'man) 126 :group 'man)
129 127
130(defvar Man-original-frame)
131(defvar Man-arguments)
132(defvar Man-sections-alist)
133(defvar Man-refpages-alist)
134(defvar Man-uses-untabify-flag t 128(defvar Man-uses-untabify-flag t
135 "Non-nil means use `untabify' instead of `Man-untabify-command'.") 129 "Non-nil means use `untabify' instead of `Man-untabify-command'.")
136(defvar Man-page-mode-string)
137(defvar Man-sed-script nil 130(defvar Man-sed-script nil
138 "Script for sed to nuke backspaces and ANSI codes from manpages.") 131 "Script for sed to nuke backspaces and ANSI codes from manpages.")
139 132
@@ -141,28 +134,28 @@ the manpage buffer."
141;; user variables 134;; user variables
142 135
143(defcustom Man-fontify-manpage-flag t 136(defcustom Man-fontify-manpage-flag t
144 "*Non-nil means make up the manpage with fonts." 137 "Non-nil means make up the manpage with fonts."
145 :type 'boolean 138 :type 'boolean
146 :group 'man) 139 :group 'man)
147 140
148(defcustom Man-overstrike-face 'bold 141(defcustom Man-overstrike-face 'bold
149 "*Face to use when fontifying overstrike." 142 "Face to use when fontifying overstrike."
150 :type 'face 143 :type 'face
151 :group 'man) 144 :group 'man)
152 145
153(defcustom Man-underline-face 'underline 146(defcustom Man-underline-face 'underline
154 "*Face to use when fontifying underlining." 147 "Face to use when fontifying underlining."
155 :type 'face 148 :type 'face
156 :group 'man) 149 :group 'man)
157 150
158(defcustom Man-reverse-face 'highlight 151(defcustom Man-reverse-face 'highlight
159 "*Face to use when fontifying reverse video." 152 "Face to use when fontifying reverse video."
160 :type 'face 153 :type 'face
161 :group 'man) 154 :group 'man)
162 155
163;; Use the value of the obsolete user option Man-notify, if set. 156;; Use the value of the obsolete user option Man-notify, if set.
164(defcustom Man-notify-method (if (boundp 'Man-notify) Man-notify 'friendly) 157(defcustom Man-notify-method (if (boundp 'Man-notify) Man-notify 'friendly)
165 "*Selects the behavior when manpage is ready. 158 "Selects the behavior when manpage is ready.
166This variable may have one of the following values, where (sf) means 159This variable may have one of the following values, where (sf) means
167that the frames are switched, so the manpage is displayed in the frame 160that the frames are switched, so the manpage is displayed in the frame
168where the man command was called from: 161where the man command was called from:
@@ -183,7 +176,7 @@ Any other value of `Man-notify-method' is equivalent to `meek'."
183 :group 'man) 176 :group 'man)
184 177
185(defcustom Man-width nil 178(defcustom Man-width nil
186 "*Number of columns for which manual pages should be formatted. 179 "Number of columns for which manual pages should be formatted.
187If nil, the width of the window selected at the moment of man 180If nil, the width of the window selected at the moment of man
188invocation is used. If non-nil, the width of the frame selected 181invocation is used. If non-nil, the width of the frame selected
189at the moment of man invocation is used. The value also can be a 182at the moment of man invocation is used. The value also can be a
@@ -194,12 +187,12 @@ positive integer."
194 :group 'man) 187 :group 'man)
195 188
196(defcustom Man-frame-parameters nil 189(defcustom Man-frame-parameters nil
197 "*Frame parameter list for creating a new frame for a manual page." 190 "Frame parameter list for creating a new frame for a manual page."
198 :type 'sexp 191 :type 'sexp
199 :group 'man) 192 :group 'man)
200 193
201(defcustom Man-downcase-section-letters-flag t 194(defcustom Man-downcase-section-letters-flag t
202 "*Non-nil means letters in sections are converted to lower case. 195 "Non-nil means letters in sections are converted to lower case.
203Some Un*x man commands can't handle uppercase letters in sections, for 196Some Un*x man commands can't handle uppercase letters in sections, for
204example \"man 2V chmod\", but they are often displayed in the manpage 197example \"man 2V chmod\", but they are often displayed in the manpage
205with the upper case letter. When this variable is t, the section 198with the upper case letter. When this variable is t, the section
@@ -209,7 +202,7 @@ being sent to the man background process."
209 :group 'man) 202 :group 'man)
210 203
211(defcustom Man-circular-pages-flag t 204(defcustom Man-circular-pages-flag t
212 "*Non-nil means the manpage list is treated as circular for traversal." 205 "Non-nil means the manpage list is treated as circular for traversal."
213 :type 'boolean 206 :type 'boolean
214 :group 'man) 207 :group 'man)
215 208
@@ -220,7 +213,7 @@ being sent to the man background process."
220 ;; '("3X" . "3") ; Xlib man pages 213 ;; '("3X" . "3") ; Xlib man pages
221 '("3X11" . "3") 214 '("3X11" . "3")
222 '("1-UCB" . "")) 215 '("1-UCB" . ""))
223 "*Association list of bogus sections to real section numbers. 216 "Association list of bogus sections to real section numbers.
224Some manpages (e.g. the Sun C++ 2.1 manpages) have section numbers in 217Some manpages (e.g. the Sun C++ 2.1 manpages) have section numbers in
225their references which Un*x `man' does not recognize. This 218their references which Un*x `man' does not recognize. This
226association list is used to translate those sections, when found, to 219association list is used to translate those sections, when found, to
@@ -250,9 +243,6 @@ the associated section number."
250(defvar Man-awk-command "awk" 243(defvar Man-awk-command "awk"
251 "Command used for processing awk scripts.") 244 "Command used for processing awk scripts.")
252 245
253(defvar Man-mode-map nil
254 "Keymap for Man mode.")
255
256(defvar Man-mode-hook nil 246(defvar Man-mode-hook nil
257 "Hook run when Man mode is enabled.") 247 "Hook run when Man mode is enabled.")
258 248
@@ -349,20 +339,22 @@ Otherwise, the value is whatever the function
349;; end user variables 339;; end user variables
350 340
351;; other variables and keymap initializations 341;; other variables and keymap initializations
342(defvar Man-original-frame)
343(make-variable-buffer-local 'Man-original-frame)
344(defvar Man-arguments)
345(make-variable-buffer-local 'Man-arguments)
346(put 'Man-arguments 'permanent-local t)
347
348(defvar Man-sections-alist nil)
352(make-variable-buffer-local 'Man-sections-alist) 349(make-variable-buffer-local 'Man-sections-alist)
350(defvar Man-refpages-alist nil)
353(make-variable-buffer-local 'Man-refpages-alist) 351(make-variable-buffer-local 'Man-refpages-alist)
352(defvar Man-page-list nil)
354(make-variable-buffer-local 'Man-page-list) 353(make-variable-buffer-local 'Man-page-list)
354(defvar Man-current-page 0)
355(make-variable-buffer-local 'Man-current-page) 355(make-variable-buffer-local 'Man-current-page)
356(defvar Man-page-mode-string "1 of 1")
356(make-variable-buffer-local 'Man-page-mode-string) 357(make-variable-buffer-local 'Man-page-mode-string)
357(make-variable-buffer-local 'Man-original-frame)
358(make-variable-buffer-local 'Man-arguments)
359(put 'Man-arguments 'permanent-local t)
360
361(setq-default Man-sections-alist nil)
362(setq-default Man-refpages-alist nil)
363(setq-default Man-page-list nil)
364(setq-default Man-current-page 0)
365(setq-default Man-page-mode-string "1 of 1")
366 358
367(defconst Man-sysv-sed-script "\ 359(defconst Man-sysv-sed-script "\
368/\b/ { s/_\b//g 360/\b/ { s/_\b//g
@@ -398,30 +390,32 @@ Otherwise, the value is whatever the function
398 table) 390 table)
399 "Syntax table used in Man mode buffers.") 391 "Syntax table used in Man mode buffers.")
400 392
401(unless Man-mode-map 393(defvar Man-mode-map
402 (setq Man-mode-map (make-sparse-keymap)) 394 (let ((map (make-sparse-keymap)))
403 (suppress-keymap Man-mode-map) 395 (suppress-keymap map)
404 (set-keymap-parent Man-mode-map button-buffer-map) 396 (set-keymap-parent map button-buffer-map)
405 397
406 (define-key Man-mode-map " " 'scroll-up) 398 (define-key map " " 'scroll-up)
407 (define-key Man-mode-map "\177" 'scroll-down) 399 (define-key map "\177" 'scroll-down)
408 (define-key Man-mode-map "n" 'Man-next-section) 400 (define-key map "n" 'Man-next-section)
409 (define-key Man-mode-map "p" 'Man-previous-section) 401 (define-key map "p" 'Man-previous-section)
410 (define-key Man-mode-map "\en" 'Man-next-manpage) 402 (define-key map "\en" 'Man-next-manpage)
411 (define-key Man-mode-map "\ep" 'Man-previous-manpage) 403 (define-key map "\ep" 'Man-previous-manpage)
412 (define-key Man-mode-map ">" 'end-of-buffer) 404 (define-key map ">" 'end-of-buffer)
413 (define-key Man-mode-map "<" 'beginning-of-buffer) 405 (define-key map "<" 'beginning-of-buffer)
414 (define-key Man-mode-map "." 'beginning-of-buffer) 406 (define-key map "." 'beginning-of-buffer)
415 (define-key Man-mode-map "r" 'Man-follow-manual-reference) 407 (define-key map "r" 'Man-follow-manual-reference)
416 (define-key Man-mode-map "g" 'Man-goto-section) 408 (define-key map "g" 'Man-goto-section)
417 (define-key Man-mode-map "s" 'Man-goto-see-also-section) 409 (define-key map "s" 'Man-goto-see-also-section)
418 (define-key Man-mode-map "k" 'Man-kill) 410 (define-key map "k" 'Man-kill)
419 (define-key Man-mode-map "q" 'Man-quit) 411 (define-key map "q" 'Man-quit)
420 (define-key Man-mode-map "m" 'man) 412 (define-key map "m" 'man)
421 ;; Not all the man references get buttons currently. The text in the 413 ;; Not all the man references get buttons currently. The text in the
422 ;; manual page can contain references to other man pages 414 ;; manual page can contain references to other man pages
423 (define-key Man-mode-map "\r" 'man-follow) 415 (define-key map "\r" 'man-follow)
424 (define-key Man-mode-map "?" 'describe-mode)) 416 (define-key map "?" 'describe-mode)
417 map)
418 "Keymap for Man mode.")
425 419
426;; buttons 420;; buttons
427(define-button-type 'Man-abstract-xref-man-page 421(define-button-type 'Man-abstract-xref-man-page
@@ -730,8 +724,7 @@ all sections related to a subject, put something appropriate into the
730 (require 'env) 724 (require 'env)
731 (message "Invoking %s %s in the background" manual-program man-args) 725 (message "Invoking %s %s in the background" manual-program man-args)
732 (setq buffer (generate-new-buffer bufname)) 726 (setq buffer (generate-new-buffer bufname))
733 (save-excursion 727 (with-current-buffer buffer
734 (set-buffer buffer)
735 (setq buffer-undo-list t) 728 (setq buffer-undo-list t)
736 (setq Man-original-frame (selected-frame)) 729 (setq Man-original-frame (selected-frame))
737 (setq Man-arguments man-args)) 730 (setq Man-arguments man-args))
@@ -802,8 +795,7 @@ all sections related to a subject, put something appropriate into the
802(defun Man-notify-when-ready (man-buffer) 795(defun Man-notify-when-ready (man-buffer)
803 "Notify the user when MAN-BUFFER is ready. 796 "Notify the user when MAN-BUFFER is ready.
804See the variable `Man-notify-method' for the different notification behaviors." 797See the variable `Man-notify-method' for the different notification behaviors."
805 (let ((saved-frame (save-excursion 798 (let ((saved-frame (with-current-buffer man-buffer
806 (set-buffer man-buffer)
807 Man-original-frame))) 799 Man-original-frame)))
808 (cond 800 (cond
809 ((eq Man-notify-method 'newframe) 801 ((eq Man-notify-method 'newframe)
@@ -975,7 +967,7 @@ default type, `Man-xref-man-page' is used for the buttons."
975 (Man-next-section 1) 967 (Man-next-section 1)
976 (point))) 968 (point)))
977 (goto-char (point-min)) 969 (goto-char (point-min))
978 (point-max)))) 970 nil)))
979 (while (re-search-forward regexp end t) 971 (while (re-search-forward regexp end t)
980 (make-text-button 972 (make-text-button
981 (match-beginning button-pos) 973 (match-beginning button-pos)
@@ -1031,8 +1023,7 @@ manpage command."
1031 (or (stringp process) 1023 (or (stringp process)
1032 (set-process-buffer process nil)) 1024 (set-process-buffer process nil))
1033 1025
1034 (save-excursion 1026 (with-current-buffer Man-buffer
1035 (set-buffer Man-buffer)
1036 (let ((case-fold-search nil)) 1027 (let ((case-fold-search nil))
1037 (goto-char (point-min)) 1028 (goto-char (point-min))
1038 (cond ((or (looking-at "No \\(manual \\)*entry for") 1029 (cond ((or (looking-at "No \\(manual \\)*entry for")
@@ -1223,13 +1214,10 @@ The following key bindings are currently in effect in the buffer:
1223 1214
1224(defun Man-strip-page-headers () 1215(defun Man-strip-page-headers ()
1225 "Strip all the page headers but the first from the manpage." 1216 "Strip all the page headers but the first from the manpage."
1226 (let ((buffer-read-only nil) 1217 (let ((inhibit-read-only t)
1227 (case-fold-search nil) 1218 (case-fold-search nil)
1228 (page-list Man-page-list)
1229 (page ())
1230 (header "")) 1219 (header ""))
1231 (while page-list 1220 (dolist (page Man-page-list)
1232 (setq page (car page-list))
1233 (and (nth 2 page) 1221 (and (nth 2 page)
1234 (goto-char (car page)) 1222 (goto-char (car page))
1235 (re-search-forward Man-first-heading-regexp nil t) 1223 (re-search-forward Man-first-heading-regexp nil t)
@@ -1243,17 +1231,14 @@ The following key bindings are currently in effect in the buffer:
1243 ;; line. 1231 ;; line.
1244 ;; (setq header (concat "\n" header))) 1232 ;; (setq header (concat "\n" header)))
1245 (while (search-forward header (nth 1 page) t) 1233 (while (search-forward header (nth 1 page) t)
1246 (replace-match ""))) 1234 (replace-match ""))))))
1247 (setq page-list (cdr page-list)))))
1248 1235
1249(defun Man-unindent () 1236(defun Man-unindent ()
1250 "Delete the leading spaces that indent the manpage." 1237 "Delete the leading spaces that indent the manpage."
1251 (let ((buffer-read-only nil) 1238 (let ((inhibit-read-only t)
1252 (case-fold-search nil) 1239 (case-fold-search nil))
1253 (page-list Man-page-list)) 1240 (dolist (page Man-page-list)
1254 (while page-list 1241 (let ((indent "")
1255 (let ((page (car page-list))
1256 (indent "")
1257 (nindent 0)) 1242 (nindent 0))
1258 (narrow-to-region (car page) (car (cdr page))) 1243 (narrow-to-region (car page) (car (cdr page)))
1259 (if Man-uses-untabify-flag 1244 (if Man-uses-untabify-flag
@@ -1281,7 +1266,6 @@ The following key bindings are currently in effect in the buffer:
1281 (or (eolp) 1266 (or (eolp)
1282 (delete-char nindent)) 1267 (delete-char nindent))
1283 (forward-line 1))) 1268 (forward-line 1)))
1284 (setq page-list (cdr page-list))
1285 )))) 1269 ))))
1286 1270
1287 1271
@@ -1291,14 +1275,18 @@ The following key bindings are currently in effect in the buffer:
1291(defun Man-next-section (n) 1275(defun Man-next-section (n)
1292 "Move point to Nth next section (default 1)." 1276 "Move point to Nth next section (default 1)."
1293 (interactive "p") 1277 (interactive "p")
1294 (let ((case-fold-search nil)) 1278 (let ((case-fold-search nil)
1279 (start (point)))
1295 (if (looking-at Man-heading-regexp) 1280 (if (looking-at Man-heading-regexp)
1296 (forward-line 1)) 1281 (forward-line 1))
1297 (if (re-search-forward Man-heading-regexp (point-max) t n) 1282 (if (re-search-forward Man-heading-regexp (point-max) t n)
1298 (beginning-of-line) 1283 (beginning-of-line)
1299 (goto-char (point-max)) 1284 (goto-char (point-max))
1300 ;; The last line doesn't belong to any section. 1285 ;; The last line doesn't belong to any section.
1301 (forward-line -1)))) 1286 (forward-line -1))
1287 ;; But don't move back from the starting point (can happen if `start'
1288 ;; is somewhere on the last line).
1289 (if (< (point) start) (goto-char start))))
1302 1290
1303(defun Man-previous-section (n) 1291(defun Man-previous-section (n)
1304 "Move point to Nth previous section (default 1)." 1292 "Move point to Nth previous section (default 1)."
@@ -1462,7 +1450,7 @@ Specify which REFERENCE to use; default is based on word at point."
1462 (let ((path Man-header-file-path) 1450 (let ((path Man-header-file-path)
1463 complete-path) 1451 complete-path)
1464 (while path 1452 (while path
1465 (setq complete-path (concat (car path) "/" file) 1453 (setq complete-path (expand-file-name file (car path))
1466 path (cdr path)) 1454 path (cdr path))
1467 (if (file-readable-p complete-path) 1455 (if (file-readable-p complete-path)
1468 (progn (view-file complete-path) 1456 (progn (view-file complete-path)
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index aa9e6604c67..ea41cea1d0f 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1170,7 +1170,7 @@ mail status in mode line"))
1170 1170
1171(defun menu-bar-vc-filter (orig-binding) 1171(defun menu-bar-vc-filter (orig-binding)
1172 (let ((ext-binding 1172 (let ((ext-binding
1173 (if vc-mode (vc-call 'extra-menu buffer-file-name)))) 1173 (if vc-mode (vc-call-backend (vc-backend buffer-file-name) 'extra-menu))))
1174 ;; Give the VC backend a chance to add menu entries 1174 ;; Give the VC backend a chance to add menu entries
1175 ;; specific for that backend. 1175 ;; specific for that backend.
1176 (if (null ext-binding) 1176 (if (null ext-binding)
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 254b44f9a03..b7fe48ccd7c 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,8 @@
12007-08-08 Glenn Morris <rgm@gnu.org>
2
3 * mh-folder.el, mh-letter.el, mh-show.el: Replace `iff' in
4 doc-strings and comments.
5
12007-07-25 Glenn Morris <rgm@gnu.org> 62007-07-25 Glenn Morris <rgm@gnu.org>
2 7
3 * Relicense all FSF files to GPLv3 or later. 8 * Relicense all FSF files to GPLv3 or later.
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index 63d55459cf4..42abad4536a 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -1495,7 +1495,7 @@ function doesn't recenter the folder buffer."
1495 1495
1496(defun mh-update-unseen () 1496(defun mh-update-unseen ()
1497 "Synchronize the unseen sequence with MH. 1497 "Synchronize the unseen sequence with MH.
1498Return non-nil iff the MH folder was set. 1498Return non-nil if the MH folder was set.
1499The hook `mh-unseen-updated-hook' is called after the unseen sequence 1499The hook `mh-unseen-updated-hook' is called after the unseen sequence
1500is updated." 1500is updated."
1501 (if mh-seen-list 1501 (if mh-seen-list
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index c70c9d8c7e4..7b2cab77d04 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -844,7 +844,7 @@ body."
844(defun mh-position-on-field (field &optional ignored) 844(defun mh-position-on-field (field &optional ignored)
845 "Move to the end of the FIELD in the header. 845 "Move to the end of the FIELD in the header.
846Move to end of entire header if FIELD not found. 846Move to end of entire header if FIELD not found.
847Returns non-nil iff FIELD was found. 847Returns non-nil if FIELD was found.
848The optional second arg is for pre-version 4 compatibility and is 848The optional second arg is for pre-version 4 compatibility and is
849IGNORED." 849IGNORED."
850 (cond ((mh-goto-header-field field) 850 (cond ((mh-goto-header-field field)
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index d3b93ca65ab..4e1a19c3a06 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -161,7 +161,7 @@ displayed."
161(defun mh-showing-mode (&optional arg) 161(defun mh-showing-mode (&optional arg)
162 "Change whether messages should be displayed. 162 "Change whether messages should be displayed.
163 163
164With ARG, display messages iff ARG is positive." 164With ARG, display messages if ARG is positive, otherwise don't display them."
165 (setq mh-showing-mode 165 (setq mh-showing-mode
166 (if (null arg) 166 (if (null arg)
167 (not mh-showing-mode) 167 (not mh-showing-mode)
diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el
index f1d56eccc66..bfb199ab897 100644
--- a/lisp/mouse-drag.el
+++ b/lisp/mouse-drag.el
@@ -158,7 +158,7 @@ Keep the cursor on the screen as needed."
158Basically, we check for existing horizontal scrolling." 158Basically, we check for existing horizontal scrolling."
159 (or truncate-lines 159 (or truncate-lines
160 (> (window-hscroll (selected-window)) 0) 160 (> (window-hscroll (selected-window)) 0)
161 (< (window-width) (frame-width)) 161 (not (window-full-width-p))
162 (and 162 (and
163 mouse-drag-electric-col-scrolling 163 mouse-drag-electric-col-scrolling
164 (save-excursion ;; on a long line? 164 (save-excursion ;; on a long line?
diff --git a/lisp/mouse.el b/lisp/mouse.el
index cbbaf73fcbb..27c5dd901f7 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1814,27 +1814,23 @@ and selects that window."
1814 (mouse-minibuffer-check event) 1814 (mouse-minibuffer-check event)
1815 (let ((buffers (buffer-list)) alist menu split-by-major-mode sum-of-squares) 1815 (let ((buffers (buffer-list)) alist menu split-by-major-mode sum-of-squares)
1816 ;; Make an alist of elements that look like (MENU-ITEM . BUFFER). 1816 ;; Make an alist of elements that look like (MENU-ITEM . BUFFER).
1817 (let ((tail buffers)) 1817 (dolist (buf buffers)
1818 (while tail 1818 ;; Divide all buffers into buckets for various major modes.
1819 ;; Divide all buffers into buckets for various major modes. 1819 ;; Each bucket looks like (MODE NAMESTRING BUFFERS...).
1820 ;; Each bucket looks like (MODE NAMESTRING BUFFERS...). 1820 (with-current-buffer buf
1821 (with-current-buffer (car tail) 1821 (let* ((adjusted-major-mode major-mode) elt)
1822 (let* ((adjusted-major-mode major-mode) elt) 1822 (dolist (group mouse-buffer-menu-mode-groups)
1823 (let ((tail mouse-buffer-menu-mode-groups)) 1823 (when (string-match (car group) (format-mode-line mode-name))
1824 (while tail 1824 (setq adjusted-major-mode (cdr group))))
1825 (if (string-match (car (car tail)) mode-name) 1825 (setq elt (assoc adjusted-major-mode split-by-major-mode))
1826 (setq adjusted-major-mode (cdr (car tail)))) 1826 (unless elt
1827 (setq tail (cdr tail)))) 1827 (setq elt (list adjusted-major-mode
1828 (setq elt (assoc adjusted-major-mode split-by-major-mode)) 1828 (if (stringp adjusted-major-mode)
1829 (if (null elt) 1829 adjusted-major-mode
1830 (setq elt (list adjusted-major-mode 1830 mode-name))
1831 (if (stringp adjusted-major-mode) 1831 split-by-major-mode (cons elt split-by-major-mode)))
1832 adjusted-major-mode 1832 (or (memq buf (cdr (cdr elt)))
1833 mode-name)) 1833 (setcdr (cdr elt) (cons buf (cdr (cdr elt))))))))
1834 split-by-major-mode (cons elt split-by-major-mode)))
1835 (or (memq (car tail) (cdr (cdr elt)))
1836 (setcdr (cdr elt) (cons (car tail) (cdr (cdr elt)))))))
1837 (setq tail (cdr tail))))
1838 ;; Compute the sum of squares of sizes of the major-mode buckets. 1834 ;; Compute the sum of squares of sizes of the major-mode buckets.
1839 (let ((tail split-by-major-mode)) 1835 (let ((tail split-by-major-mode))
1840 (setq sum-of-squares 0) 1836 (setq sum-of-squares 0)
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index fd7f0682622..2f06344ccda 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -4285,7 +4285,12 @@ NEWNAME should be the name to give the new compressed or uncompressed file.")
4285;;;###autoload 4285;;;###autoload
4286(defun ange-ftp-hook-function (operation &rest args) 4286(defun ange-ftp-hook-function (operation &rest args)
4287 (let ((fn (get operation 'ange-ftp))) 4287 (let ((fn (get operation 'ange-ftp)))
4288 (if fn (save-match-data (apply fn args)) 4288 (if fn
4289 ;; Catch also errors in process-filter.
4290 (condition-case err
4291 (let ((debug-on-error t))
4292 (save-match-data (apply fn args)))
4293 (error (signal (car err) (cdr err))))
4289 (ange-ftp-run-real-handler operation args)))) 4294 (ange-ftp-run-real-handler operation args))))
4290 4295
4291;; The following code is commented out because Tramp now deals with 4296;; The following code is commented out because Tramp now deals with
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index 28f7d1ddb46..ef01c96ec8e 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -248,7 +248,7 @@ There is a variable ``telnet-interrupt-string'' which is the character
248sent to try to stop execution of a job on the remote host. 248sent to try to stop execution of a job on the remote host.
249Data is sent to the remote host when RET is typed." 249Data is sent to the remote host when RET is typed."
250 (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern) 250 (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern)
251 (setq comint-use-prompt-regexp t)) 251 (set (make-local-variable 'comint-use-prompt-regexp) t))
252 252
253;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)") 253;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)")
254 254
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 79b0b537837..db08fe3b6df 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -290,9 +290,8 @@ history."
290 tramp-cache-data) 290 tramp-cache-data)
291 res)) 291 res))
292 292
293;; Read persistent connection history. Applied with 293;; Read persistent connection history.
294;; `load-in-progress', because it shall be evaluated only once. 294(when (zerop (hash-table-count tramp-cache-data))
295(when load-in-progress
296 (condition-case err 295 (condition-case err
297 (with-temp-buffer 296 (with-temp-buffer
298 (insert-file-contents tramp-persistency-file-name) 297 (insert-file-contents tramp-persistency-file-name)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 5285b87313a..1070d61cba6 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1027,7 +1027,7 @@ The `sudo' program appears to insert a `^@' character into the prompt."
1027 "Login incorrect" 1027 "Login incorrect"
1028 "Login Incorrect" 1028 "Login Incorrect"
1029 "Connection refused" 1029 "Connection refused"
1030 "Connection closed by foreign host." 1030 "Connection closed"
1031 "Sorry, try again." 1031 "Sorry, try again."
1032 "Name or service not known" 1032 "Name or service not known"
1033 "Host key verification failed." 1033 "Host key verification failed."
@@ -3581,8 +3581,11 @@ beginning of local filename are not substituted."
3581 (tramp-send-command v command) 3581 (tramp-send-command v command)
3582 ;; We should show the output anyway. 3582 ;; We should show the output anyway.
3583 (when outbuf 3583 (when outbuf
3584 (with-current-buffer outbuf 3584 (let ((output-string
3585 (insert-buffer-substring (tramp-get-connection-buffer v))) 3585 (with-current-buffer (tramp-get-connection-buffer v)
3586 (buffer-substring (point-min) (point-max)))))
3587 (with-current-buffer outbuf
3588 (insert output-string)))
3586 (when display (display-buffer outbuf)))) 3589 (when display (display-buffer outbuf))))
3587 ;; When the user did interrupt, we should do it also. 3590 ;; When the user did interrupt, we should do it also.
3588 (error 3591 (error
@@ -3614,12 +3617,20 @@ beginning of local filename are not substituted."
3614 (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command)) 3617 (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
3615 (args (split-string (substring command 0 asynchronous) " ")) 3618 (args (split-string (substring command 0 asynchronous) " "))
3616 (output-buffer 3619 (output-buffer
3617 (or output-buffer 3620 (cond
3618 (if asynchronous 3621 ((bufferp output-buffer) output-buffer)
3619 "*Async Shell Command*" 3622 ((stringp output-buffer) (get-buffer-create output-buffer))
3620 "*Shell Command Output*"))) 3623 (output-buffer (current-buffer))
3624 (t (generate-new-buffer
3625 (if asynchronous
3626 "*Async Shell Command*"
3627 "*Shell Command Output*")))))
3628 (error-buffer
3629 (cond
3630 ((bufferp error-buffer) error-buffer)
3631 ((stringp error-buffer) (get-buffer-create error-buffer))))
3621 (buffer 3632 (buffer
3622 (if (and (not asynchronous) (bufferp error-buffer)) 3633 (if (and (not asynchronous) error-buffer)
3623 (with-parsed-tramp-file-name default-directory nil 3634 (with-parsed-tramp-file-name default-directory nil
3624 (list output-buffer (tramp-make-tramp-temp-file v))) 3635 (list output-buffer (tramp-make-tramp-temp-file v)))
3625 output-buffer))) 3636 output-buffer)))
@@ -3637,7 +3648,10 @@ beginning of local filename are not substituted."
3637 (when (listp buffer) 3648 (when (listp buffer)
3638 (with-current-buffer error-buffer 3649 (with-current-buffer error-buffer
3639 (insert-file-contents (cadr buffer))) 3650 (insert-file-contents (cadr buffer)))
3640 (delete-file (cadr buffer)))))) 3651 (delete-file (buffer-file-name (cadr buffer))))
3652 ;; There's some output, display it.
3653 (when (with-current-buffer output-buffer (> (point-max) (point-min)))
3654 (display-message-or-buffer output-buffer)))))
3641 3655
3642;; File Editing. 3656;; File Editing.
3643 3657
@@ -4177,8 +4191,12 @@ Falls back to normal file name handler if no tramp file name handler exists."
4177 ((and completion (zerop (length localname)) 4191 ((and completion (zerop (length localname))
4178 (memq operation '(file-name-as-directory))) 4192 (memq operation '(file-name-as-directory)))
4179 filename) 4193 filename)
4180 ;; Call the backend function. 4194 ;; Call the backend function. Set a connection property
4181 (foreign (apply foreign operation args)) 4195 ;; first, it will be reused for user/host name completion.
4196 (foreign
4197 (unless (zerop (length localname))
4198 (tramp-set-connection-property v "started" nil))
4199 (apply foreign operation args))
4182 ;; Nothing to do for us. 4200 ;; Nothing to do for us.
4183 (t (tramp-run-real-handler operation args))))))) 4201 (t (tramp-run-real-handler operation args)))))))
4184 4202
@@ -6116,7 +6134,8 @@ In case there is no valid Lisp expression, it raises an error"
6116 (condition-case nil 6134 (condition-case nil
6117 (prog1 (read (current-buffer)) 6135 (prog1 (read (current-buffer))
6118 ;; Error handling. 6136 ;; Error handling.
6119 (when (re-search-forward "\\S-" nil t) (error))) 6137 (when (re-search-forward "\\S-" (tramp-line-end-position) t)
6138 (error)))
6120 (error (tramp-error 6139 (error (tramp-error
6121 vec 'file-error 6140 vec 'file-error
6122 "`%s' does not return a valid Lisp expression: `%s'" 6141 "`%s' does not return a valid Lisp expression: `%s'"
@@ -6125,7 +6144,7 @@ In case there is no valid Lisp expression, it raises an error"
6125;; It seems that Tru64 Unix does not like it if long strings are sent 6144;; It seems that Tru64 Unix does not like it if long strings are sent
6126;; to it in one go. (This happens when sending the Perl 6145;; to it in one go. (This happens when sending the Perl
6127;; `file-attributes' implementation, for instance.) Therefore, we 6146;; `file-attributes' implementation, for instance.) Therefore, we
6128;; have this function which waits a bit at each line. 6147;; have this function which sends the string in chunks.
6129(defun tramp-send-string (vec string) 6148(defun tramp-send-string (vec string)
6130 "Send the STRING via connection VEC. 6149 "Send the STRING via connection VEC.
6131 6150
@@ -6143,7 +6162,7 @@ the remote host use line-endings as defined in the variable
6143 ;; Clean up the buffer. We cannot call `erase-buffer' because 6162 ;; Clean up the buffer. We cannot call `erase-buffer' because
6144 ;; narrowing might be in effect. 6163 ;; narrowing might be in effect.
6145 (let (buffer-read-only) (delete-region (point-min) (point-max))) 6164 (let (buffer-read-only) (delete-region (point-min) (point-max)))
6146 ;; replace "\n" by `tramp-rsh-end-of-line' 6165 ;; Replace "\n" by `tramp-rsh-end-of-line'.
6147 (setq string 6166 (setq string
6148 (mapconcat 'identity 6167 (mapconcat 'identity
6149 (split-string string "\n") 6168 (split-string string "\n")
@@ -6151,7 +6170,7 @@ the remote host use line-endings as defined in the variable
6151 (unless (or (string= string "") 6170 (unless (or (string= string "")
6152 (string-equal (substring string -1) tramp-rsh-end-of-line)) 6171 (string-equal (substring string -1) tramp-rsh-end-of-line))
6153 (setq string (concat string tramp-rsh-end-of-line))) 6172 (setq string (concat string tramp-rsh-end-of-line)))
6154 ;; send the string 6173 ;; Send the string.
6155 (if (and chunksize (not (zerop chunksize))) 6174 (if (and chunksize (not (zerop chunksize)))
6156 (let ((pos 0) 6175 (let ((pos 0)
6157 (end (length string))) 6176 (end (length string)))
diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el
index a2405b0edb2..569771143e3 100644
--- a/lisp/obsolete/fast-lock.el
+++ b/lisp/obsolete/fast-lock.el
@@ -523,7 +523,7 @@ See `fast-lock-cache-directories'."
523 ;; Just a directory. 523 ;; Just a directory.
524 directory) 524 directory)
525 (t 525 (t
526 ;; A directory iff the file name matches the regexp. 526 ;; A directory if the file name matches the regexp.
527 (let ((bufile (expand-file-name buffer-file-truename)) 527 (let ((bufile (expand-file-name buffer-file-truename))
528 (case-fold-search nil)) 528 (case-fold-search nil))
529 (when (save-match-data (string-match (car directory) bufile)) 529 (when (save-match-data (string-match (car directory) bufile))
diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el
index 6991f796526..e5ab1638c60 100644
--- a/lisp/pcvs-util.el
+++ b/lisp/pcvs-util.el
@@ -211,7 +211,8 @@ arguments. If ARGS is not a list, no argument will be passed."
211(defconst cvs-qtypedesc-string1 (cvs-qtypedesc-create 'identity 'identity t)) 211(defconst cvs-qtypedesc-string1 (cvs-qtypedesc-create 'identity 'identity t))
212(defconst cvs-qtypedesc-string (cvs-qtypedesc-create 'identity 'identity)) 212(defconst cvs-qtypedesc-string (cvs-qtypedesc-create 'identity 'identity))
213(defconst cvs-qtypedesc-strings 213(defconst cvs-qtypedesc-strings
214 (cvs-qtypedesc-create 'string->strings 'strings->string nil)) 214 (cvs-qtypedesc-create 'split-string-and-unquote
215 'combine-and-quote-strings nil))
215 216
216(defun cvs-query-read (default prompt qtypedesc &optional hist-sym) 217(defun cvs-query-read (default prompt qtypedesc &optional hist-sym)
217 (let* ((qtypedesc (or qtypedesc cvs-qtypedesc-strings)) 218 (let* ((qtypedesc (or qtypedesc cvs-qtypedesc-strings))
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 5c79f7a5fb9..21cfd5b042d 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -182,7 +182,7 @@
182 (when (re-search-forward 182 (when (re-search-forward
183 (concat "^" cmd "\\(\\s-+\\(.*\\)\\)?$") nil t) 183 (concat "^" cmd "\\(\\s-+\\(.*\\)\\)?$") nil t)
184 (let* ((sym (intern (concat "cvs-" cmd "-flags"))) 184 (let* ((sym (intern (concat "cvs-" cmd "-flags")))
185 (val (string->strings (or (match-string 2) "")))) 185 (val (split-string-and-unquote (or (match-string 2) ""))))
186 (cvs-flags-set sym 0 val)))) 186 (cvs-flags-set sym 0 val))))
187 ;; ensure that cvs doesn't have -q or -Q 187 ;; ensure that cvs doesn't have -q or -Q
188 (cvs-flags-set 'cvs-cvs-flags 0 188 (cvs-flags-set 'cvs-cvs-flags 0
@@ -612,7 +612,7 @@ If non-nil, NEW means to create a new buffer no matter what."
612 (t arg))) 612 (t arg)))
613 args))) 613 args)))
614 (concat cvs-program " " 614 (concat cvs-program " "
615 (strings->string 615 (combine-and-quote-strings
616 (append (cvs-flags-query 'cvs-cvs-flags nil 'noquery) 616 (append (cvs-flags-query 'cvs-cvs-flags nil 'noquery)
617 (if cvs-cvsroot (list "-d" cvs-cvsroot)) 617 (if cvs-cvsroot (list "-d" cvs-cvsroot))
618 args 618 args
@@ -941,7 +941,8 @@ With a prefix argument, prompt for cvs FLAGS to use."
941 (let ((root (cvs-get-cvsroot))) 941 (let ((root (cvs-get-cvsroot)))
942 (if (or (null root) current-prefix-arg) 942 (if (or (null root) current-prefix-arg)
943 (setq root (read-string "CVS Root: "))) 943 (setq root (read-string "CVS Root: ")))
944 (list (string->strings (read-string "Module(s): " (cvs-get-module))) 944 (list (split-string-and-unquote
945 (read-string "Module(s): " (cvs-get-module)))
945 (read-directory-name "CVS Checkout Directory: " 946 (read-directory-name "CVS Checkout Directory: "
946 nil default-directory nil) 947 nil default-directory nil)
947 (cvs-add-branch-prefix 948 (cvs-add-branch-prefix
@@ -964,7 +965,7 @@ The files are stored to DIR."
964 (if branch (format " (branch: %s)" branch) 965 (if branch (format " (branch: %s)" branch)
965 "")))) 966 ""))))
966 (list (read-directory-name prompt nil default-directory nil)))) 967 (list (read-directory-name prompt nil default-directory nil))))
967 (let ((modules (string->strings (cvs-get-module))) 968 (let ((modules (split-string-and-unquote (cvs-get-module)))
968 (flags (cvs-add-branch-prefix 969 (flags (cvs-add-branch-prefix
969 (cvs-flags-query 'cvs-checkout-flags "cvs checkout flags"))) 970 (cvs-flags-query 'cvs-checkout-flags "cvs checkout flags")))
970 (cvs-cvsroot (cvs-get-cvsroot))) 971 (cvs-cvsroot (cvs-get-cvsroot)))
@@ -2253,7 +2254,7 @@ With prefix argument, prompt for cvs flags."
2253 (let* ((args (append constant-args arg-list))) 2254 (let* ((args (append constant-args arg-list)))
2254 2255
2255 (insert (format "=== %s %s\n\n" 2256 (insert (format "=== %s %s\n\n"
2256 program (strings->string args))) 2257 program (split-string-and-unquote args)))
2257 2258
2258 ;; FIXME: return the exit status? 2259 ;; FIXME: return the exit status?
2259 (apply 'call-process program nil t t args) 2260 (apply 'call-process program nil t t args)
diff --git a/lisp/printing.el b/lisp/printing.el
index 7b45d166aa3..a4b4c4217ed 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -6,11 +6,11 @@
6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
7;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> 7;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
8;; Keywords: wp, print, PostScript 8;; Keywords: wp, print, PostScript
9;; Version: 6.9 9;; Version: 6.9.1
10;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre 10;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
11 11
12(defconst pr-version "6.9" 12(defconst pr-version "6.9.1"
13 "printing.el, v 6.9 <2007/02/11 vinicius> 13 "printing.el, v 6.9.1 <2007/08/02 vinicius>
14 14
15Please send all bug fixes and enhancements to 15Please send all bug fixes and enhancements to
16 Vinicius Jose Latorre <viniciusjl@ig.com.br> 16 Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -1306,7 +1306,7 @@ If SUFFIX is non-nil, add that at the end of the file name."
1306 (defalias 'pr-f-read-string 'read-string) 1306 (defalias 'pr-f-read-string 'read-string)
1307 1307
1308 ;; GNU Emacs 1308 ;; GNU Emacs
1309 (defvar deactivate-mark nil) 1309 (defvar deactivate-mark)
1310 1310
1311 ;; GNU Emacs 1311 ;; GNU Emacs
1312 (defun pr-keep-region-active () 1312 (defun pr-keep-region-active ()
@@ -1326,7 +1326,6 @@ If SUFFIX is non-nil, add that at the end of the file name."
1326 1326
1327 ;; GNU Emacs 1327 ;; GNU Emacs
1328 ;; Menu binding 1328 ;; Menu binding
1329 (require 'easymenu)
1330 ;; Replace existing "print" item by "Printing" item. 1329 ;; Replace existing "print" item by "Printing" item.
1331 ;; If you're changing this file, you'll load it a second, 1330 ;; If you're changing this file, you'll load it a second,
1332 ;; third... time, but "print" item exists only in the first load. 1331 ;; third... time, but "print" item exists only in the first load.
@@ -1335,6 +1334,7 @@ If SUFFIX is non-nil, add that at the end of the file name."
1335 ;; GNU Emacs 20 1334 ;; GNU Emacs 20
1336 ((< emacs-major-version 21) 1335 ((< emacs-major-version 21)
1337 (defun pr-global-menubar (pr-menu-spec) 1336 (defun pr-global-menubar (pr-menu-spec)
1337 (require 'easymenu)
1338 (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item) 1338 (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item)
1339 (when pr-menu-print-item 1339 (when pr-menu-print-item
1340 (easy-menu-remove-item nil '("tools") pr-menu-print-item) 1340 (easy-menu-remove-item nil '("tools") pr-menu-print-item)
@@ -1345,6 +1345,7 @@ If SUFFIX is non-nil, add that at the end of the file name."
1345 ;; GNU Emacs 21 & 22 1345 ;; GNU Emacs 21 & 22
1346 (t 1346 (t
1347 (defun pr-global-menubar (pr-menu-spec) 1347 (defun pr-global-menubar (pr-menu-spec)
1348 (require 'easymenu)
1348 (let ((menu-file (if (= emacs-major-version 21) 1349 (let ((menu-file (if (= emacs-major-version 21)
1349 '("menu-bar" "files") ; GNU Emacs 21 1350 '("menu-bar" "files") ; GNU Emacs 21
1350 '("menu-bar" "file")))) ; GNU Emacs 22 or higher 1351 '("menu-bar" "file")))) ; GNU Emacs 22 or higher
@@ -5194,9 +5195,9 @@ See `pr-visible-entry-alist'.")
5194 5195
5195If FORCE is non-nil, update menus doesn't matter if `pr-ps-printer-alist', 5196If FORCE is non-nil, update menus doesn't matter if `pr-ps-printer-alist',
5196`pr-txt-printer-alist' or `pr-ps-utility-alist' were modified or not; 5197`pr-txt-printer-alist' or `pr-ps-utility-alist' were modified or not;
5197otherwise, update PostScript printer menu iff `pr-ps-printer-menu-modified' is 5198otherwise, update PostScript printer menu if `pr-ps-printer-menu-modified' is
5198non-nil, update text printer menu iff `pr-txt-printer-menu-modified' is 5199non-nil, update text printer menu if `pr-txt-printer-menu-modified' is
5199non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is 5200non-nil, and update PostScript File menus if `pr-ps-utility-menu-modified' is
5200non-nil. 5201non-nil.
5201 5202
5202If menu binding was not done, calls `pr-menu-bind'." 5203If menu binding was not done, calls `pr-menu-bind'."
@@ -6017,9 +6018,10 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
6017;; Printing Interface (inspired on ps-print-interface.el) 6018;; Printing Interface (inspired on ps-print-interface.el)
6018 6019
6019 6020
6020(require 'widget) 6021(eval-when-compile
6021(require 'wid-edit) 6022 (require 'cus-edit)
6022(require 'cus-edit) 6023 (require 'wid-edit)
6024 (require 'widget))
6023 6025
6024 6026
6025(defvar pr-i-window-configuration nil) 6027(defvar pr-i-window-configuration nil)
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index 7fbeeab6eea..594b628ad44 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -568,7 +568,7 @@ The standard value contains the following functions as READ-FN:
568general value, or `antlr-read-boolean' with ARGs = \(PROMPT TABLE) which 568general value, or `antlr-read-boolean' with ARGs = \(PROMPT TABLE) which
569reads a boolean value or a member of TABLE. PROMPT is the prompt when 569reads a boolean value or a member of TABLE. PROMPT is the prompt when
570asking for a new value. If non-nil, TABLE is a table for completion or 570asking for a new value. If non-nil, TABLE is a table for completion or
571a function evaluating to such a table. The return value is quoted iff 571a function evaluating to such a table. The return value is quoted if
572AS-STRING is non-nil and is either t or a symbol which is a member of 572AS-STRING is non-nil and is either t or a symbol which is a member of
573`antlr-options-style'.") 573`antlr-options-style'.")
574 574
@@ -2203,8 +2203,8 @@ part SUPER in the result of `antlr-file-dependencies'. CLASSES is the
2203part \(CLASS-SPEC ...) in the result of `antlr-directory-dependencies'. 2203part \(CLASS-SPEC ...) in the result of `antlr-directory-dependencies'.
2204 2204
2205The result looks like \(OPTION WITH-UNKNOWN GLIB ...). OPTION is the 2205The result looks like \(OPTION WITH-UNKNOWN GLIB ...). OPTION is the
2206complete \"-glib\" option. WITH-UNKNOWN has value t iff there is none 2206complete \"-glib\" option. WITH-UNKNOWN is t if there is none or more
2207or more than one grammar file for at least one super grammar. 2207than one grammar file for at least one super grammar.
2208 2208
2209Each GLIB looks like \(GRAMMAR-FILE \. EVOCAB). GRAMMAR-FILE is a file 2209Each GLIB looks like \(GRAMMAR-FILE \. EVOCAB). GRAMMAR-FILE is a file
2210in which a super-grammar is defined. EVOCAB is the value of the export 2210in which a super-grammar is defined. EVOCAB is the value of the export
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el
index 997e6c44f1a..33467671170 100644
--- a/lisp/progmodes/cc-awk.el
+++ b/lisp/progmodes/cc-awk.el
@@ -478,7 +478,7 @@
478 478
479(defun c-awk-get-NL-prop-prev-line (&optional do-lim) 479(defun c-awk-get-NL-prop-prev-line (&optional do-lim)
480 ;; Get the c-awk-NL-prop text-property from the previous line, calculating 480 ;; Get the c-awk-NL-prop text-property from the previous line, calculating
481 ;; it if necessary. Return nil iff we're already at BOB. 481 ;; it if necessary. Return nil if we're at BOB.
482 ;; See c-awk-after-if-for-while-condition-p for a description of DO-LIM. 482 ;; See c-awk-after-if-for-while-condition-p for a description of DO-LIM.
483 ;; 483 ;;
484 ;; This function might do hidden buffer changes. 484 ;; This function might do hidden buffer changes.
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 44463a07f15..97dcc61460f 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -5116,7 +5116,7 @@ comment at the start of cc-engine.el for more info."
5116 ;; Foo::Foo (int b) : Base (b) {} 5116 ;; Foo::Foo (int b) : Base (b) {}
5117 ;; car ^ ^ point 5117 ;; car ^ ^ point
5118 ;; 5118 ;;
5119 ;; The cdr of the return value is non-nil iff a 5119 ;; The cdr of the return value is non-nil if a
5120 ;; `c-typedef-decl-kwds' specifier is found in the declaration, 5120 ;; `c-typedef-decl-kwds' specifier is found in the declaration,
5121 ;; i.e. the declared identifier(s) are types. 5121 ;; i.e. the declared identifier(s) are types.
5122 ;; 5122 ;;
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index a80833c0043..76b0e5a898c 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -186,7 +186,7 @@ the value set here overrides the style system (there is a variable
186 (bq-process type))))))))) 186 (bq-process type)))))))))
187 187
188(defun c-valid-offset (offset) 188(defun c-valid-offset (offset)
189 "Return non-nil iff OFFSET is a valid offset for a syntactic symbol. 189 "Return non-nil if OFFSET is a valid offset for a syntactic symbol.
190See `c-offsets-alist'." 190See `c-offsets-alist'."
191 (or (eq offset '+) 191 (or (eq offset '+)
192 (eq offset '-) 192 (eq offset '-)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index caf0e94b927..805ed3c4040 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -170,7 +170,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
170 (maven 170 (maven
171 ;; Maven is a popular build tool for Java. Maven is Free Software. 171 ;; Maven is a popular build tool for Java. Maven is Free Software.
172 "\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3) 172 "\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3)
173 173
174 (bash 174 (bash
175 "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2) 175 "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2)
176 176
@@ -979,8 +979,7 @@ Otherwise, construct a buffer name from MODE-NAME."
979 (funcall name-function mode-name)) 979 (funcall name-function mode-name))
980 (compilation-buffer-name-function 980 (compilation-buffer-name-function
981 (funcall compilation-buffer-name-function mode-name)) 981 (funcall compilation-buffer-name-function mode-name))
982 ((and (eq mode-command major-mode) 982 ((eq mode-command major-mode)
983 (eq major-mode (nth 1 compilation-arguments)))
984 (buffer-name)) 983 (buffer-name))
985 (t 984 (t
986 (concat "*" (downcase mode-name) "*")))) 985 (concat "*" (downcase mode-name) "*"))))
@@ -1032,7 +1031,7 @@ Returns the compilation buffer created."
1032 (with-current-buffer 1031 (with-current-buffer
1033 (setq outbuf 1032 (setq outbuf
1034 (get-buffer-create 1033 (get-buffer-create
1035 (compilation-buffer-name name-of-mode mode name-function))) 1034 (compilation-buffer-name name-of-mode mode name-function)))
1036 (let ((comp-proc (get-buffer-process (current-buffer)))) 1035 (let ((comp-proc (get-buffer-process (current-buffer))))
1037 (if comp-proc 1036 (if comp-proc
1038 (if (or (not (eq (process-status comp-proc) 'run)) 1037 (if (or (not (eq (process-status comp-proc) 'run))
@@ -1136,7 +1135,7 @@ Returns the compilation buffer created."
1136 (if (file-remote-p default-directory) 1135 (if (file-remote-p default-directory)
1137 "/bin/sh" 1136 "/bin/sh"
1138 shell-file-name) 1137 shell-file-name)
1139 `("-c" ,command)))) 1138 nil `("-c" ,command))))
1140 (start-file-process-shell-command (downcase mode-name) 1139 (start-file-process-shell-command (downcase mode-name)
1141 outbuf command)))) 1140 outbuf command))))
1142 ;; Make the buffer's mode line show process state. 1141 ;; Make the buffer's mode line show process state.
@@ -1164,7 +1163,7 @@ Returns the compilation buffer created."
1164 "Set the height of WINDOW according to `compilation-window-height'." 1163 "Set the height of WINDOW according to `compilation-window-height'."
1165 (let ((height (buffer-local-value 'compilation-window-height (window-buffer window)))) 1164 (let ((height (buffer-local-value 'compilation-window-height (window-buffer window))))
1166 (and height 1165 (and height
1167 (= (window-width window) (frame-width (window-frame window))) 1166 (window-full-width-p window)
1168 ;; If window is alone in its frame, aside from a minibuffer, 1167 ;; If window is alone in its frame, aside from a minibuffer,
1169 ;; don't change its height. 1168 ;; don't change its height.
1170 (not (eq window (frame-root-window (window-frame window)))) 1169 (not (eq window (frame-root-window (window-frame window))))
@@ -1624,12 +1623,10 @@ Use this command in a compilation log buffer. Sets the mark at point there."
1624 1623
1625(defun compilation-find-buffer (&optional avoid-current) 1624(defun compilation-find-buffer (&optional avoid-current)
1626 "Return a compilation buffer. 1625 "Return a compilation buffer.
1627If AVOID-CURRENT is nil, and 1626If AVOID-CURRENT is nil, and the current buffer is a compilation buffer,
1628the current buffer is a compilation buffer, return it. 1627return it. If AVOID-CURRENT is non-nil, return the current buffer only
1629If AVOID-CURRENT is non-nil, return the current buffer 1628as a last resort."
1630only as a last resort." 1629 (if (and (compilation-buffer-internal-p) (not avoid-current))
1631 (if (and (compilation-buffer-internal-p (current-buffer))
1632 (not avoid-current))
1633 (current-buffer) 1630 (current-buffer)
1634 (next-error-find-buffer avoid-current 'compilation-buffer-internal-p))) 1631 (next-error-find-buffer avoid-current 'compilation-buffer-internal-p)))
1635 1632
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index d1dc0e875c4..cd7dabb8825 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1497,9 +1497,16 @@ the last)."
1497(defvar cperl-use-major-mode 'cperl-mode) 1497(defvar cperl-use-major-mode 'cperl-mode)
1498(defvar cperl-font-lock-multiline-start nil) 1498(defvar cperl-font-lock-multiline-start nil)
1499(defvar cperl-font-lock-multiline nil) 1499(defvar cperl-font-lock-multiline nil)
1500(defvar cperl-compilation-error-regexp-alist nil)
1501(defvar cperl-font-locking nil) 1500(defvar cperl-font-locking nil)
1502 1501
1502;; NB as it stands the code in cperl-mode assumes this only has one
1503;; element. If Xemacs 19 support were dropped, this could all be simplified.
1504(defvar cperl-compilation-error-regexp-alist
1505 ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS).
1506 '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]"
1507 2 3))
1508 "Alist that specifies how to match errors in perl output.")
1509
1503;;;###autoload 1510;;;###autoload
1504(defun cperl-mode () 1511(defun cperl-mode ()
1505 "Major mode for editing Perl code. 1512 "Major mode for editing Perl code.
@@ -1786,7 +1793,7 @@ or as help on variables `cperl-tips', `cperl-problems',
1786 (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x 1793 (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x
1787 (make-local-variable 'compilation-error-regexp-alist-alist) 1794 (make-local-variable 'compilation-error-regexp-alist-alist)
1788 (set 'compilation-error-regexp-alist-alist 1795 (set 'compilation-error-regexp-alist-alist
1789 (cons (cons 'cperl cperl-compilation-error-regexp-alist) 1796 (cons (cons 'cperl (car cperl-compilation-error-regexp-alist))
1790 (symbol-value 'compilation-error-regexp-alist-alist))) 1797 (symbol-value 'compilation-error-regexp-alist-alist)))
1791 (if (fboundp 'compilation-build-compilation-error-regexp-alist) 1798 (if (fboundp 'compilation-build-compilation-error-regexp-alist)
1792 (let ((f 'compilation-build-compilation-error-regexp-alist)) 1799 (let ((f 'compilation-build-compilation-error-regexp-alist))
@@ -3551,7 +3558,7 @@ modify syntax-type text property if the situation is too hard."
3551 (modify-syntax-entry starter (if (eq starter ?\\) "\\" ".") st) 3558 (modify-syntax-entry starter (if (eq starter ?\\) "\\" ".") st)
3552 (if ender (modify-syntax-entry ender "." st)))) 3559 (if ender (modify-syntax-entry ender "." st))))
3553 ;; i: have 2 args, after end of the first arg 3560 ;; i: have 2 args, after end of the first arg
3554 ;; i2: start of the second arg, if any (before delim iff `ender'). 3561 ;; i2: start of the second arg, if any (before delim if `ender').
3555 ;; ender: the last arg bounded by parens-like chars, the second one of them 3562 ;; ender: the last arg bounded by parens-like chars, the second one of them
3556 ;; starter: the starting delimiter of the first arg 3563 ;; starter: the starting delimiter of the first arg
3557 ;; go-forward: has 2 args, and the second part is empty 3564 ;; go-forward: has 2 args, and the second part is empty
@@ -5702,13 +5709,6 @@ indentation and initial hashes. Behaves usually outside of comment."
5702 (t 5))) ; should not happen 5709 (t 5))) ; should not happen
5703 5710
5704 5711
5705(defvar cperl-compilation-error-regexp-alist
5706 ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS).
5707 '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]"
5708 2 3))
5709 "Alist that specifies how to match errors in perl output.")
5710
5711
5712(defun cperl-windowed-init () 5712(defun cperl-windowed-init ()
5713 "Initialization under windowed version." 5713 "Initialization under windowed version."
5714 (cond ((featurep 'ps-print) 5714 (cond ((featurep 'ps-print)
@@ -8090,7 +8090,7 @@ prototype \\&SUB Returns prototype of the function given a reference.
8090(defun cperl-beautify-regexp-piece (b e embed level) 8090(defun cperl-beautify-regexp-piece (b e embed level)
8091 ;; b is before the starting delimiter, e before the ending 8091 ;; b is before the starting delimiter, e before the ending
8092 ;; e should be a marker, may be changed, but remains "correct". 8092 ;; e should be a marker, may be changed, but remains "correct".
8093 ;; EMBED is nil iff we process the whole REx. 8093 ;; EMBED is nil if we process the whole REx.
8094 ;; The REx is guaranteed to have //x 8094 ;; The REx is guaranteed to have //x
8095 ;; LEVEL shows how many levels deep to go 8095 ;; LEVEL shows how many levels deep to go
8096 ;; position at enter and at leave is not defined 8096 ;; position at enter and at leave is not defined
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el
index e85c4752412..05b8b59c00f 100644
--- a/lisp/progmodes/cpp.el
+++ b/lisp/progmodes/cpp.el
@@ -623,7 +623,8 @@ You can also use the keyboard accelerators indicated like this: [K]ey."
623 623
624(defun cpp-edit-toggle-known (arg) 624(defun cpp-edit-toggle-known (arg)
625 "Toggle writable status for known conditionals. 625 "Toggle writable status for known conditionals.
626With optional argument ARG, make them writable iff ARG is positive." 626With optional argument ARG, make them writable if ARG is positive,
627otherwise make them unwritable."
627 (interactive "@P") 628 (interactive "@P")
628 (if (or (and (null arg) cpp-known-writable) 629 (if (or (and (null arg) cpp-known-writable)
629 (<= (prefix-numeric-value arg) 0)) 630 (<= (prefix-numeric-value arg) 0))
@@ -633,7 +634,8 @@ With optional argument ARG, make them writable iff ARG is positive."
633 634
634(defun cpp-edit-toggle-unknown (arg) 635(defun cpp-edit-toggle-unknown (arg)
635 "Toggle writable status for unknown conditionals. 636 "Toggle writable status for unknown conditionals.
636With optional argument ARG, make them writable iff ARG is positive." 637With optional argument ARG, make them writable if ARG is positive,
638otherwise make them unwritable."
637 (interactive "@P") 639 (interactive "@P")
638 (if (or (and (null arg) cpp-unknown-writable) 640 (if (or (and (null arg) cpp-unknown-writable)
639 (<= (prefix-numeric-value arg) 0)) 641 (<= (prefix-numeric-value arg) 0))
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 196c22b4a08..96af63849a4 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -256,10 +256,10 @@ One argument, the tag info returned by `snarf-tag-function'.")
256(defvar tags-included-tables-function nil 256(defvar tags-included-tables-function nil
257 "Function to do the work of `tags-included-tables' (which see).") 257 "Function to do the work of `tags-included-tables' (which see).")
258(defvar verify-tags-table-function nil 258(defvar verify-tags-table-function nil
259 "Function to return t iff current buffer contains valid tags file.") 259 "Function to return t if current buffer contains valid tags file.")
260 260
261;; Initialize the tags table in the current buffer. 261;; Initialize the tags table in the current buffer.
262;; Returns non-nil iff it is a valid tags table. On 262;; Returns non-nil if it is a valid tags table. On
263;; non-nil return, the tags table state variable are 263;; non-nil return, the tags table state variable are
264;; made buffer-local and initialized to nil. 264;; made buffer-local and initialized to nil.
265(defun initialize-new-tags-table () 265(defun initialize-new-tags-table ()
@@ -417,7 +417,7 @@ file the tag was in."
417(defun tags-verify-table (file) 417(defun tags-verify-table (file)
418 "Read FILE into a buffer and verify that it is a valid tags table. 418 "Read FILE into a buffer and verify that it is a valid tags table.
419Sets the current buffer to one visiting FILE (if it exists). 419Sets the current buffer to one visiting FILE (if it exists).
420Returns non-nil iff it is a valid table." 420Returns non-nil if it is a valid table."
421 (if (get-file-buffer file) 421 (if (get-file-buffer file)
422 ;; The file is already in a buffer. Check for the visited file 422 ;; The file is already in a buffer. Check for the visited file
423 ;; having changed since we last used it. 423 ;; having changed since we last used it.
@@ -1219,8 +1219,8 @@ where they were found."
1219 (verify-tags-table-function . etags-verify-tags-table) 1219 (verify-tags-table-function . etags-verify-tags-table)
1220 )))) 1220 ))))
1221 1221
1222;; Return non-nil iff the current buffer is a valid etags TAGS file.
1223(defun etags-verify-tags-table () 1222(defun etags-verify-tags-table ()
1223 "Return non-nil if the current buffer is a valid etags TAGS file."
1224 ;; Use eq instead of = in case char-after returns nil. 1224 ;; Use eq instead of = in case char-after returns nil.
1225 (eq (char-after (point-min)) ?\f)) 1225 (eq (char-after (point-min)) ?\f))
1226 1226
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index a6407a3ffa6..5538bd8984a 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -918,7 +918,7 @@ Convert it to flymake internal format."
918 ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1) 918 ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1)
919 ;; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1) 919 ;; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1)
920 ;; ant/javac 920 ;; ant/javac
921 (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" 921 (" *\\(\\[javac\\] *\\)?\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)"
922 2 4 nil 5)) 922 2 4 nil 5))
923 ;; compilation-error-regexp-alist) 923 ;; compilation-error-regexp-alist)
924 (flymake-reformat-err-line-patterns-from-compile-el compilation-error-regexp-alist-alist)) 924 (flymake-reformat-err-line-patterns-from-compile-el compilation-error-regexp-alist-alist))
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index 97f4c1c2616..bcb571f8c87 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -1831,7 +1831,7 @@ If ALL is nil, only match comments that start in column > 0."
1831;; From: ralf@up3aud1.gwdg.de (Ralf Fassel) 1831;; From: ralf@up3aud1.gwdg.de (Ralf Fassel)
1832;; Test if TAB format continuation lines work. 1832;; Test if TAB format continuation lines work.
1833(defun fortran-is-in-string-p (where) 1833(defun fortran-is-in-string-p (where)
1834 "Return non-nil iff WHERE (a buffer position) is inside a Fortran string." 1834 "Return non-nil if WHERE (a buffer position) is inside a Fortran string."
1835 (save-excursion 1835 (save-excursion
1836 (goto-char where) 1836 (goto-char where)
1837 (cond 1837 (cond
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 8f6be334465..c4d14462245 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -347,7 +347,8 @@ for `gdba'."
347 347
348(defun gdb-many-windows (arg) 348(defun gdb-many-windows (arg)
349 "Toggle the number of windows in the basic arrangement. 349 "Toggle the number of windows in the basic arrangement.
350With arg, display additional buffers iff arg is positive." 350With prefix argument ARG, display additional buffers if ARG is positive,
351otherwise use a single window."
351 (interactive "P") 352 (interactive "P")
352 (setq gdb-many-windows 353 (setq gdb-many-windows
353 (if (null arg) 354 (if (null arg)
@@ -363,7 +364,8 @@ With arg, display additional buffers iff arg is positive."
363 364
364(defun gdb-use-separate-io-buffer (arg) 365(defun gdb-use-separate-io-buffer (arg)
365 "Toggle separate IO for debugged program. 366 "Toggle separate IO for debugged program.
366With arg, use separate IO iff arg is positive." 367With prefix argument ARG, use separate IO if ARG is positive,
368otherwise do not."
367 (interactive "P") 369 (interactive "P")
368 (setq gdb-use-separate-io-buffer 370 (setq gdb-use-separate-io-buffer
369 (if (null arg) 371 (if (null arg)
@@ -664,7 +666,8 @@ line, and no execution takes place."
664 666
665(defun gdb-speedbar-auto-raise (arg) 667(defun gdb-speedbar-auto-raise (arg)
666 "Toggle automatic raising of the speedbar for watch expressions. 668 "Toggle automatic raising of the speedbar for watch expressions.
667With arg, automatically raise speedbar iff arg is positive." 669With prefix argument ARG, automatically raise speedbar if ARG is
670positive, otherwise don't automatically raise it."
668 (interactive "P") 671 (interactive "P")
669 (setq gdb-speedbar-auto-raise 672 (setq gdb-speedbar-auto-raise
670 (if (null arg) 673 (if (null arg)
@@ -1381,7 +1384,8 @@ directives."
1381 1384
1382(defun gdb-find-source-frame (arg) 1385(defun gdb-find-source-frame (arg)
1383 "Toggle trying to find a source frame further up stack. 1386 "Toggle trying to find a source frame further up stack.
1384With arg, look for a source frame further up stack iff arg is positive." 1387With prefix argument ARG, look for a source frame further up
1388stack if ARG is positive, otherwise don't look further up."
1385 (interactive "P") 1389 (interactive "P")
1386 (setq gdb-find-source-frame 1390 (setq gdb-find-source-frame
1387 (if (null arg) 1391 (if (null arg)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 2131aebe2a8..4b0dec7002e 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -59,7 +59,7 @@
59(defgroup gud nil 59(defgroup gud nil
60 "Grand Unified Debugger mode for gdb and other debuggers under Emacs. 60 "Grand Unified Debugger mode for gdb and other debuggers under Emacs.
61Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb." 61Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb."
62 :group 'unix 62 :group 'processes
63 :group 'tools) 63 :group 'tools)
64 64
65 65
@@ -2467,7 +2467,7 @@ comint mode, which see."
2467;; for local variables in the debugger buffer. 2467;; for local variables in the debugger buffer.
2468(defun gud-common-init (command-line massage-args marker-filter 2468(defun gud-common-init (command-line massage-args marker-filter
2469 &optional find-file) 2469 &optional find-file)
2470 (let* ((words (string->strings command-line)) 2470 (let* ((words (split-string-and-unquote command-line))
2471 (program (car words)) 2471 (program (car words))
2472 (dir default-directory) 2472 (dir default-directory)
2473 ;; Extract the file name from WORDS 2473 ;; Extract the file name from WORDS
@@ -3361,7 +3361,7 @@ This event can be examined by forms in GUD-TOOLTIP-DISPLAY.")
3361 3361
3362(defun gud-tooltip-dereference (&optional arg) 3362(defun gud-tooltip-dereference (&optional arg)
3363 "Toggle whether tooltips should show `* expr' or `expr'. 3363 "Toggle whether tooltips should show `* expr' or `expr'.
3364With arg, dereference expr iff arg is positive." 3364With arg, dereference expr if ARG is positive, otherwise do not derereference."
3365 (interactive "P") 3365 (interactive "P")
3366 (setq gud-tooltip-dereference 3366 (setq gud-tooltip-dereference
3367 (if (null arg) 3367 (if (null arg)
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index bb0a3c634dd..83167ba5a40 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -262,7 +262,7 @@ One of the following symbols:
262 t -- open both code and comment blocks 262 t -- open both code and comment blocks
263 nil -- open neither code nor comment blocks 263 nil -- open neither code nor comment blocks
264 264
265This has effect iff `search-invisible' is set to `open'." 265This has effect only if `search-invisible' is set to `open'."
266 :type '(choice (const :tag "open only code blocks" code) 266 :type '(choice (const :tag "open only code blocks" code)
267 (const :tag "open only comment blocks" comment) 267 (const :tag "open only comment blocks" comment)
268 (const :tag "open both code and comment blocks" t) 268 (const :tag "open both code and comment blocks" t)
@@ -515,7 +515,7 @@ Optional arg REPOS-END means reposition at end."
515 (goto-char (if repos-end end beg))) 515 (goto-char (if repos-end end beg)))
516 516
517(defun hs-hide-block-at-point (&optional end comment-reg) 517(defun hs-hide-block-at-point (&optional end comment-reg)
518 "Hide block iff on block beginning. 518 "Hide block if on block beginning.
519Optional arg END means reposition at end. 519Optional arg END means reposition at end.
520Optional arg COMMENT-REG is a list of the form (BEGIN END) and 520Optional arg COMMENT-REG is a list of the form (BEGIN END) and
521specifies the limits of the comment, or nil if the block is not 521specifies the limits of the comment, or nil if the block is not
@@ -678,7 +678,7 @@ Return point, or nil if original point was not in a block."
678 (goto-char maxp)) 678 (goto-char maxp))
679 679
680(defmacro hs-life-goes-on (&rest body) 680(defmacro hs-life-goes-on (&rest body)
681 "Evaluate BODY forms iff variable `hs-minor-mode' is non-nil. 681 "Evaluate BODY forms if variable `hs-minor-mode' is non-nil.
682In the dynamic context of this macro, `inhibit-point-motion-hooks' 682In the dynamic context of this macro, `inhibit-point-motion-hooks'
683and `case-fold-search' are both t." 683and `case-fold-search' are both t."
684 `(when hs-minor-mode 684 `(when hs-minor-mode
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el
index adc1b44edaa..3da3434cda2 100644
--- a/lisp/progmodes/octave-mod.el
+++ b/lisp/progmodes/octave-mod.el
@@ -567,24 +567,24 @@ including a reproducible test case and send the message."
567 (describe-function major-mode)) 567 (describe-function major-mode))
568 568
569(defsubst octave-in-comment-p () 569(defsubst octave-in-comment-p ()
570 "Returns t if point is inside an Octave comment, nil otherwise." 570 "Return t if point is inside an Octave comment."
571 (interactive) 571 (interactive)
572 (save-excursion 572 (save-excursion
573 (nth 4 (parse-partial-sexp (line-beginning-position) (point))))) 573 (nth 4 (parse-partial-sexp (line-beginning-position) (point)))))
574 574
575(defsubst octave-in-string-p () 575(defsubst octave-in-string-p ()
576 "Returns t if point is inside an Octave string, nil otherwise." 576 "Return t if point is inside an Octave string."
577 (interactive) 577 (interactive)
578 (save-excursion 578 (save-excursion
579 (nth 3 (parse-partial-sexp (line-beginning-position) (point))))) 579 (nth 3 (parse-partial-sexp (line-beginning-position) (point)))))
580 580
581(defsubst octave-not-in-string-or-comment-p () 581(defsubst octave-not-in-string-or-comment-p ()
582 "Returns t iff point is not inside an Octave string or comment." 582 "Return t if point is not inside an Octave string or comment."
583 (let ((pps (parse-partial-sexp (line-beginning-position) (point)))) 583 (let ((pps (parse-partial-sexp (line-beginning-position) (point))))
584 (not (or (nth 3 pps) (nth 4 pps))))) 584 (not (or (nth 3 pps) (nth 4 pps)))))
585 585
586(defun octave-in-block-p () 586(defun octave-in-block-p ()
587 "Returns t if point is inside an Octave block, nil otherwise. 587 "Return t if point is inside an Octave block.
588The block is taken to start at the first letter of the begin keyword and 588The block is taken to start at the first letter of the begin keyword and
589to end after the end keyword." 589to end after the end keyword."
590 (let ((pos (point))) 590 (let ((pos (point)))
@@ -599,7 +599,7 @@ to end after the end keyword."
599 (< pos (point))))) 599 (< pos (point)))))
600 600
601(defun octave-in-defun-p () 601(defun octave-in-defun-p ()
602 "Returns t iff point is inside an Octave function declaration. 602 "Return t if point is inside an Octave function declaration.
603The function is taken to start at the `f' of `function' and to end after 603The function is taken to start at the `f' of `function' and to end after
604the end keyword." 604the end keyword."
605 (let ((pos (point))) 605 (let ((pos (point)))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 9bef41a0878..462445f3d71 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -348,7 +348,7 @@ comments and strings, or that point is within brackets/parens."
348 (error nil)))))))) 348 (error nil))))))))
349 349
350(defun python-comment-line-p () 350(defun python-comment-line-p ()
351 "Return non-nil iff current line has only a comment." 351 "Return non-nil if current line has only a comment."
352 (save-excursion 352 (save-excursion
353 (end-of-line) 353 (end-of-line)
354 (when (eq 'comment (syntax-ppss-context (syntax-ppss))) 354 (when (eq 'comment (syntax-ppss-context (syntax-ppss)))
@@ -356,7 +356,7 @@ comments and strings, or that point is within brackets/parens."
356 (looking-at (rx (or (syntax comment-start) line-end)))))) 356 (looking-at (rx (or (syntax comment-start) line-end))))))
357 357
358(defun python-blank-line-p () 358(defun python-blank-line-p ()
359 "Return non-nil iff current line is blank." 359 "Return non-nil if current line is blank."
360 (save-excursion 360 (save-excursion
361 (beginning-of-line) 361 (beginning-of-line)
362 (looking-at "\\s-*$"))) 362 (looking-at "\\s-*$")))
@@ -850,7 +850,7 @@ multi-line bracketed expressions."
850 "Skip out of any nested brackets. 850 "Skip out of any nested brackets.
851Skip forward if FORWARD is non-nil, else backward. 851Skip forward if FORWARD is non-nil, else backward.
852If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. 852If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point.
853Return non-nil iff skipping was done." 853Return non-nil if skipping was done."
854 (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss)))) 854 (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss))))
855 (forward (if forward -1 1))) 855 (forward (if forward -1 1)))
856 (unless (zerop depth) 856 (unless (zerop depth)
@@ -1199,7 +1199,7 @@ local value.")
1199 (define-key map "\C-c\C-l" 'python-load-file) 1199 (define-key map "\C-c\C-l" 'python-load-file)
1200 (define-key map "\C-c\C-v" 'python-check) 1200 (define-key map "\C-c\C-v" 'python-check)
1201 ;; Note that we _can_ still use these commands which send to the 1201 ;; Note that we _can_ still use these commands which send to the
1202 ;; Python process even at the prompt iff we have a normal prompt, 1202 ;; Python process even at the prompt provided we have a normal prompt,
1203 ;; i.e. '>>> ' and not '... '. See the comment before 1203 ;; i.e. '>>> ' and not '... '. See the comment before
1204 ;; python-send-region. Fixme: uncomment these if we address that. 1204 ;; python-send-region. Fixme: uncomment these if we address that.
1205 1205
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index f6ef646069b..c3948280f76 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -212,7 +212,6 @@
212 212
213(defgroup sh nil 213(defgroup sh nil
214 "Shell programming utilities." 214 "Shell programming utilities."
215 :group 'unix
216 :group 'languages) 215 :group 'languages)
217 216
218(defgroup sh-script nil 217(defgroup sh-script nil
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index c7576a27114..f9fd7beffd2 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -126,11 +126,13 @@
126 "*Indentation of Tcl statements with respect to containing block." 126 "*Indentation of Tcl statements with respect to containing block."
127 :type 'integer 127 :type 'integer
128 :group 'tcl) 128 :group 'tcl)
129(put 'tcl-indent-level 'safe-local-variable 'integerp)
129 130
130(defcustom tcl-continued-indent-level 4 131(defcustom tcl-continued-indent-level 4
131 "*Indentation of continuation line relative to first line of command." 132 "*Indentation of continuation line relative to first line of command."
132 :type 'integer 133 :type 'integer
133 :group 'tcl) 134 :group 'tcl)
135(put 'tcl-continued-indent-level 'safe-local-variable 'integerp)
134 136
135(defcustom tcl-auto-newline nil 137(defcustom tcl-auto-newline nil
136 "*Non-nil means automatically newline before and after braces you insert." 138 "*Non-nil means automatically newline before and after braces you insert."
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index 2762e8dbd55..5307445dc04 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -232,7 +232,7 @@ It creates the Imenu index for the buffer, if necessary."
232When Which Function mode is enabled, the current function name is 232When Which Function mode is enabled, the current function name is
233continuously displayed in the mode line, in certain major modes. 233continuously displayed in the mode line, in certain major modes.
234 234
235With prefix ARG, turn Which Function mode on iff arg is positive, 235With prefix ARG, turn Which Function mode on if arg is positive,
236and off otherwise." 236and off otherwise."
237 :global t :group 'which-func 237 :global t :group 'which-func
238 (if which-function-mode 238 (if which-function-mode
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el
index 0beca9e985e..a820ca4cede 100644
--- a/lisp/progmodes/xscheme.el
+++ b/lisp/progmodes/xscheme.el
@@ -868,7 +868,7 @@ Control returns to the top level rep loop."
868 (sleep-for 1))) 868 (sleep-for 1)))
869 869
870(defun xscheme-process-running-p () 870(defun xscheme-process-running-p ()
871 "True iff there is a Scheme process whose status is `run'." 871 "True if there is a Scheme process whose status is `run'."
872 (let ((process (get-process xscheme-process-name))) 872 (let ((process (get-process xscheme-process-name)))
873 (and process 873 (and process
874 (eq (process-status process) 'run)))) 874 (eq (process-status process) 'run))))
@@ -882,7 +882,7 @@ Control returns to the top level rep loop."
882 (and buffer (get-buffer-window buffer)))) 882 (and buffer (get-buffer-window buffer))))
883 883
884(defun xscheme-process-buffer-current-p () 884(defun xscheme-process-buffer-current-p ()
885 "True iff the current buffer is the Scheme process buffer." 885 "True if the current buffer is the Scheme process buffer."
886 (eq (xscheme-process-buffer) (current-buffer))) 886 (eq (xscheme-process-buffer) (current-buffer)))
887 887
888;;;; Process Filter Operations 888;;;; Process Filter Operations
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 3526c170e1f..f7abe472fe5 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -3016,7 +3016,8 @@ Valid values are:
3016 3016
3017Any other value is ignored and black color will be used. 3017Any other value is ignored and black color will be used.
3018 3018
3019It's used only when `ps-print-color-p' is non-nil." 3019This variable is used only when `ps-print-color-p' (which see) is neither nil
3020nor black-white."
3020 :type '(choice :menu-tag "Default Foreground Gray/Color" 3021 :type '(choice :menu-tag "Default Foreground Gray/Color"
3021 :tag "Default Foreground Gray/Color" 3022 :tag "Default Foreground Gray/Color"
3022 (const :tag "Session Foreground" t) 3023 (const :tag "Session Foreground" t)
@@ -3059,7 +3060,8 @@ Valid values are:
3059 3060
3060Any other value is ignored and white color will be used. 3061Any other value is ignored and white color will be used.
3061 3062
3062It's used only when `ps-print-color-p' is non-nil. 3063This variable is used only when `ps-print-color-p' (which see) is neither nil
3064nor black-white.
3063 3065
3064See also `ps-use-face-background'." 3066See also `ps-use-face-background'."
3065 :type '(choice :menu-tag "Default Background Gray/Color" 3067 :type '(choice :menu-tag "Default Background Gray/Color"
@@ -5920,7 +5922,8 @@ XSTART YSTART are the relative position for the first page in a sheet.")
5920 1.0) 5922 1.0)
5921 ps-default-background (ps-rgb-color 5923 ps-default-background (ps-rgb-color
5922 (cond 5924 (cond
5923 ((or (not (eq ps-print-color-p t)) 5925 ((or (member ps-print-color-p
5926 '(nil back-white))
5924 (eq genfunc 'ps-generate-postscript)) 5927 (eq genfunc 'ps-generate-postscript))
5925 nil) 5928 nil)
5926 ((eq ps-default-bg 'frame-parameter) 5929 ((eq ps-default-bg 'frame-parameter)
@@ -5933,7 +5936,8 @@ XSTART YSTART are the relative position for the first page in a sheet.")
5933 1.0) 5936 1.0)
5934 ps-default-foreground (ps-rgb-color 5937 ps-default-foreground (ps-rgb-color
5935 (cond 5938 (cond
5936 ((or (not (eq ps-print-color-p t)) 5939 ((or (member ps-print-color-p
5940 '(nil back-white))
5937 (eq genfunc 'ps-generate-postscript)) 5941 (eq genfunc 'ps-generate-postscript))
5938 nil) 5942 nil)
5939 ((eq ps-default-fg 'frame-parameter) 5943 ((eq ps-default-fg 'frame-parameter)
@@ -5944,7 +5948,8 @@ XSTART YSTART are the relative position for the first page in a sheet.")
5944 ps-default-fg)) 5948 ps-default-fg))
5945 "unspecified-fg" 5949 "unspecified-fg"
5946 0.0) 5950 0.0)
5947 ps-default-color (and (eq ps-print-color-p t) 5951 ps-default-color (and (not (member ps-print-color-p
5952 '(nil back-white)))
5948 ps-default-foreground) 5953 ps-default-foreground)
5949 ps-current-color ps-default-color) 5954 ps-current-color ps-default-color)
5950 ;; initialize page dimensions 5955 ;; initialize page dimensions
diff --git a/lisp/select.el b/lisp/select.el
index b1fa729a664..60259142522 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -178,7 +178,7 @@ Cut buffers are considered obsolete; you should use selections instead."
178If it is valid, set the register `r0' to 1, else set it to 0.") 178If it is valid, set the register `r0' to 1, else set it to 0.")
179 179
180(defun string-utf-8-p (string) 180(defun string-utf-8-p (string)
181 "Return non-nil iff STRING is a unibyte string of valid UTF-8 sequence." 181 "Return non-nil if STRING is a unibyte string of valid UTF-8 sequence."
182 (if (or (not (stringp string)) 182 (if (or (not (stringp string))
183 (multibyte-string-p string)) 183 (multibyte-string-p string))
184 (error "Not a unibyte string: %s" string)) 184 (error "Not a unibyte string: %s" string))
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el
index ee6dcc15b7e..d1de8be3910 100644
--- a/lisp/shadowfile.el
+++ b/lisp/shadowfile.el
@@ -285,7 +285,7 @@ information defining the cluster. For interactive use, call
285 ans))) 285 ans)))
286 286
287(defun shadow-site-match (site1 site2) 287(defun shadow-site-match (site1 site2)
288 "Non-nil iff SITE1 is or includes SITE2. 288 "Non-nil if SITE1 is or includes SITE2.
289Each may be a host or cluster name; if they are clusters, regexp of SITE1 will 289Each may be a host or cluster name; if they are clusters, regexp of SITE1 will
290be matched against the primary of SITE2." 290be matched against the primary of SITE2."
291 (or (string-equal site1 site2) ; quick check 291 (or (string-equal site1 site2) ; quick check
diff --git a/lisp/simple.el b/lisp/simple.el
index 854b3713faf..82081c1679a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4321,13 +4321,6 @@ If optional arg REALLY-WORD is non-nil, it finds just a word."
4321 regexp) 4321 regexp)
4322 :group 'fill) 4322 :group 'fill)
4323 4323
4324(defvar comment-line-break-function 'comment-indent-new-line
4325 "*Mode-specific function which line breaks and continues a comment.
4326
4327This function is only called during auto-filling of a comment section.
4328The function should take a single optional argument, which is a flag
4329indicating whether it should use soft newlines.")
4330
4331;; This function is used as the auto-fill-function of a buffer 4324;; This function is used as the auto-fill-function of a buffer
4332;; when Auto-Fill mode is enabled. 4325;; when Auto-Fill mode is enabled.
4333;; It returns t if it really did any work. 4326;; It returns t if it really did any work.
@@ -4401,10 +4394,10 @@ indicating whether it should use soft newlines.")
4401 (if (save-excursion 4394 (if (save-excursion
4402 (skip-chars-backward " \t") 4395 (skip-chars-backward " \t")
4403 (= (point) fill-point)) 4396 (= (point) fill-point))
4404 (funcall comment-line-break-function t) 4397 (default-indent-new-line t)
4405 (save-excursion 4398 (save-excursion
4406 (goto-char fill-point) 4399 (goto-char fill-point)
4407 (funcall comment-line-break-function t))) 4400 (default-indent-new-line t)))
4408 ;; Now do justification, if required 4401 ;; Now do justification, if required
4409 (if (not (eq justify 'left)) 4402 (if (not (eq justify 'left))
4410 (save-excursion 4403 (save-excursion
@@ -4419,6 +4412,43 @@ indicating whether it should use soft newlines.")
4419 (justify-current-line justify t t) 4412 (justify-current-line justify t t)
4420 t))) 4413 t)))
4421 4414
4415(defvar comment-line-break-function 'comment-indent-new-line
4416 "*Mode-specific function which line breaks and continues a comment.
4417This function is called during auto-filling when a comment syntax
4418is defined.
4419The function should take a single optional argument, which is a flag
4420indicating whether it should use soft newlines.")
4421
4422(defun default-indent-new-line (&optional soft)
4423 "Break line at point and indent.
4424If a comment syntax is defined, call `comment-indent-new-line'.
4425
4426The inserted newline is marked hard if variable `use-hard-newlines' is true,
4427unless optional argument SOFT is non-nil."
4428 (interactive)
4429 (if comment-start
4430 (funcall comment-line-break-function soft)
4431 ;; Insert the newline before removing empty space so that markers
4432 ;; get preserved better.
4433 (if soft (insert-and-inherit ?\n) (newline 1))
4434 (save-excursion (forward-char -1) (delete-horizontal-space))
4435 (delete-horizontal-space)
4436
4437 (if (and fill-prefix (not adaptive-fill-mode))
4438 ;; Blindly trust a non-adaptive fill-prefix.
4439 (progn
4440 (indent-to-left-margin)
4441 (insert-before-markers-and-inherit fill-prefix))
4442
4443 (cond
4444 ;; If there's an adaptive prefix, use it unless we're inside
4445 ;; a comment and the prefix is not a comment starter.
4446 (fill-prefix
4447 (indent-to-left-margin)
4448 (insert-and-inherit fill-prefix))
4449 ;; If we're not inside a comment, just try to indent.
4450 (t (indent-according-to-mode))))))
4451
4422(defvar normal-auto-fill-function 'do-auto-fill 4452(defvar normal-auto-fill-function 'do-auto-fill
4423 "The function to use for `auto-fill-function' if Auto Fill mode is turned on. 4453 "The function to use for `auto-fill-function' if Auto Fill mode is turned on.
4424Some major modes set this.") 4454Some major modes set this.")
@@ -4497,8 +4527,9 @@ The variable `selective-display' has a separate value for each buffer."
4497 4527
4498(defun toggle-truncate-lines (&optional arg) 4528(defun toggle-truncate-lines (&optional arg)
4499 "Toggle whether to fold or truncate long lines for the current buffer. 4529 "Toggle whether to fold or truncate long lines for the current buffer.
4500With arg, truncate long lines iff arg is positive. 4530With prefix argument ARG, truncate long lines if ARG is positive,
4501Note that in side-by-side windows, truncation is always enabled." 4531otherwise don't truncate them. Note that in side-by-side
4532windows, truncation is always enabled."
4502 (interactive "P") 4533 (interactive "P")
4503 (setq truncate-lines 4534 (setq truncate-lines
4504 (if (null arg) 4535 (if (null arg)
@@ -4521,11 +4552,11 @@ Note that in side-by-side windows, truncation is always enabled."
4521 4552
4522(defun overwrite-mode (arg) 4553(defun overwrite-mode (arg)
4523 "Toggle overwrite mode. 4554 "Toggle overwrite mode.
4524With arg, turn overwrite mode on iff arg is positive. 4555With prefix argument ARG, turn overwrite mode on if ARG is positive,
4525In overwrite mode, printing characters typed in replace existing text 4556otherwise turn it off. In overwrite mode, printing characters typed
4526on a one-for-one basis, rather than pushing it to the right. At the 4557in replace existing text on a one-for-one basis, rather than pushing
4527end of a line, such characters extend the line. Before a tab, 4558it to the right. At the end of a line, such characters extend the line.
4528such characters insert until the tab is filled in. 4559Before a tab, such characters insert until the tab is filled in.
4529\\[quoted-insert] still inserts characters in overwrite mode; this 4560\\[quoted-insert] still inserts characters in overwrite mode; this
4530is supposed to make it easier to insert characters when necessary." 4561is supposed to make it easier to insert characters when necessary."
4531 (interactive "P") 4562 (interactive "P")
@@ -4537,14 +4568,13 @@ is supposed to make it easier to insert characters when necessary."
4537 4568
4538(defun binary-overwrite-mode (arg) 4569(defun binary-overwrite-mode (arg)
4539 "Toggle binary overwrite mode. 4570 "Toggle binary overwrite mode.
4540With arg, turn binary overwrite mode on iff arg is positive. 4571With prefix argument ARG, turn binary overwrite mode on if ARG is
4541In binary overwrite mode, printing characters typed in replace 4572positive, otherwise turn it off. In binary overwrite mode, printing
4542existing text. Newlines are not treated specially, so typing at the 4573characters typed in replace existing text. Newlines are not treated
4543end of a line joins the line to the next, with the typed character 4574specially, so typing at the end of a line joins the line to the next,
4544between them. Typing before a tab character simply replaces the tab 4575with the typed character between them. Typing before a tab character
4545with the character typed. 4576simply replaces the tab with the character typed. \\[quoted-insert]
4546\\[quoted-insert] replaces the text at the cursor, just as ordinary 4577replaces the text at the cursor, just as ordinary typing characters do.
4547typing characters do.
4548 4578
4549Note that binary overwrite mode is not its own minor mode; it is a 4579Note that binary overwrite mode is not its own minor mode; it is a
4550specialization of overwrite mode, entered by setting the 4580specialization of overwrite mode, entered by setting the
@@ -4559,9 +4589,9 @@ specialization of overwrite mode, entered by setting the
4559 4589
4560(define-minor-mode line-number-mode 4590(define-minor-mode line-number-mode
4561 "Toggle Line Number mode. 4591 "Toggle Line Number mode.
4562With arg, turn Line Number mode on iff arg is positive. 4592With arg, turn Line Number mode on if arg is positive, otherwise
4563When Line Number mode is enabled, the line number appears 4593turn it off. When Line Number mode is enabled, the line number
4564in the mode line. 4594appears in the mode line.
4565 4595
4566Line numbers do not appear for very large buffers and buffers 4596Line numbers do not appear for very large buffers and buffers
4567with very long lines; see variables `line-number-display-limit' 4597with very long lines; see variables `line-number-display-limit'
@@ -4570,16 +4600,16 @@ and `line-number-display-limit-width'."
4570 4600
4571(define-minor-mode column-number-mode 4601(define-minor-mode column-number-mode
4572 "Toggle Column Number mode. 4602 "Toggle Column Number mode.
4573With arg, turn Column Number mode on iff arg is positive. 4603With arg, turn Column Number mode on if arg is positive,
4574When Column Number mode is enabled, the column number appears 4604otherwise turn it off. When Column Number mode is enabled, the
4575in the mode line." 4605column number appears in the mode line."
4576 :global t :group 'mode-line) 4606 :global t :group 'mode-line)
4577 4607
4578(define-minor-mode size-indication-mode 4608(define-minor-mode size-indication-mode
4579 "Toggle Size Indication mode. 4609 "Toggle Size Indication mode.
4580With arg, turn Size Indication mode on iff arg is positive. When 4610With arg, turn Size Indication mode on if arg is positive,
4581Size Indication mode is enabled, the size of the accessible part 4611otherwise turn it off. When Size Indication mode is enabled, the
4582of the buffer appears in the mode line." 4612size of the accessible part of the buffer appears in the mode line."
4583 :global t :group 'mode-line) 4613 :global t :group 'mode-line)
4584 4614
4585(defgroup paren-blinking nil 4615(defgroup paren-blinking nil
@@ -5114,7 +5144,7 @@ With prefix argument N, move N items (negative N means move backward)."
5114These functions are called in order with four arguments: 5144These functions are called in order with four arguments:
5115CHOICE - the string to insert in the buffer, 5145CHOICE - the string to insert in the buffer,
5116BUFFER - the buffer in which the choice should be inserted, 5146BUFFER - the buffer in which the choice should be inserted,
5117MINI-P - non-nil iff BUFFER is a minibuffer, and 5147MINI-P - non-nil if BUFFER is a minibuffer, and
5118BASE-SIZE - the number of characters in BUFFER before 5148BASE-SIZE - the number of characters in BUFFER before
5119the string being completed. 5149the string being completed.
5120 5150
@@ -5743,7 +5773,8 @@ See also `normal-erase-is-backspace'."
5743 5773
5744(define-minor-mode visible-mode 5774(define-minor-mode visible-mode
5745 "Toggle Visible mode. 5775 "Toggle Visible mode.
5746With argument ARG turn Visible mode on iff ARG is positive. 5776With argument ARG turn Visible mode on if ARG is positive, otherwise
5777turn it off.
5747 5778
5748Enabling Visible mode makes all invisible text temporarily visible. 5779Enabling Visible mode makes all invisible text temporarily visible.
5749Disabling Visible mode turns off that effect. Visible mode 5780Disabling Visible mode turns off that effect. Visible mode
diff --git a/lisp/skeleton.el b/lisp/skeleton.el
index 33e223e4b2b..4425bb0389a 100644
--- a/lisp/skeleton.el
+++ b/lisp/skeleton.el
@@ -209,8 +209,8 @@ If ELEMENT is a string or a character it gets inserted (see also
209 interesting point set by _ 209 interesting point set by _
210 > indent line (or interregion if > _) according to major mode 210 > indent line (or interregion if > _) according to major mode
211 @ add position to `skeleton-positions' 211 @ add position to `skeleton-positions'
212 & do next ELEMENT iff previous moved point 212 & do next ELEMENT if previous moved point
213 | do next ELEMENT iff previous didn't move point 213 | do next ELEMENT if previous didn't move point
214 -num delete num preceding characters (see `skeleton-untabify') 214 -num delete num preceding characters (see `skeleton-untabify')
215 resume: skipped, continue here if quit is signaled 215 resume: skipped, continue here if quit is signaled
216 nil skipped 216 nil skipped
diff --git a/lisp/strokes.el b/lisp/strokes.el
index 528ea477363..de4123453f5 100644
--- a/lisp/strokes.el
+++ b/lisp/strokes.el
@@ -1370,7 +1370,7 @@ If STROKES-MAP is not given, `strokes-global-map' will be used instead."
1370 (goto-char (point-min)))) 1370 (goto-char (point-min))))
1371 1371
1372(defun strokes-alphabetic-lessp (stroke1 stroke2) 1372(defun strokes-alphabetic-lessp (stroke1 stroke2)
1373 "T iff command name for STROKE1 is less than STROKE2's in lexicographic order." 1373 "T if command name for STROKE1 is less than STROKE2's in lexicographic order."
1374 (let ((command-name-1 (symbol-name (cdr stroke1))) 1374 (let ((command-name-1 (symbol-name (cdr stroke1)))
1375 (command-name-2 (symbol-name (cdr stroke2)))) 1375 (command-name-2 (symbol-name (cdr stroke2))))
1376 (string-lessp command-name-1 command-name-2))) 1376 (string-lessp command-name-1 command-name-2)))
@@ -1520,7 +1520,7 @@ Encode/decode your strokes with \\[strokes-encode-buffer],
1520 (eq char ?*))) 1520 (eq char ?*)))
1521 1521
1522;;(defsubst strokes-xor (a b) ### Should I make this an inline function? ### 1522;;(defsubst strokes-xor (a b) ### Should I make this an inline function? ###
1523;; "T iff one and only one of A and B is non-nil; otherwise, returns nil. 1523;; "T if one and only one of A and B is non-nil; otherwise, returns nil.
1524;;NOTE: Don't use this as a numeric xor since it treats all non-nil 1524;;NOTE: Don't use this as a numeric xor since it treats all non-nil
1525;; values as t including `0' (zero)." 1525;; values as t including `0' (zero)."
1526;; (eq (null a) (not (null b)))) 1526;; (eq (null a) (not (null b))))
diff --git a/lisp/subr.el b/lisp/subr.el
index 546f7ccbd43..bce80963705 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2853,11 +2853,10 @@ Modifies the match data; use `save-match-data' if necessary."
2853 list))) 2853 list)))
2854 (nreverse list))) 2854 (nreverse list)))
2855 2855
2856;; (string->strings (strings->string X)) == X 2856(defun combine-and-quote-strings (strings &optional separator)
2857(defun strings->string (strings &optional separator)
2858 "Concatenate the STRINGS, adding the SEPARATOR (default \" \"). 2857 "Concatenate the STRINGS, adding the SEPARATOR (default \" \").
2859This tries to quote the strings to avoid ambiguity such that 2858This tries to quote the strings to avoid ambiguity such that
2860 (string->strings (strings->string strs)) == strs 2859 (split-string-and-unquote (combine-and-quote-strings strs)) == strs
2861Only some SEPARATORs will work properly." 2860Only some SEPARATORs will work properly."
2862 (let ((sep (or separator " "))) 2861 (let ((sep (or separator " ")))
2863 (mapconcat 2862 (mapconcat
@@ -2867,20 +2866,20 @@ Only some SEPARATORs will work properly."
2867 str)) 2866 str))
2868 strings sep))) 2867 strings sep)))
2869 2868
2870;; (string->strings (strings->string X)) == X 2869(defun split-string-and-unquote (string &optional separator)
2871(defun string->strings (string &optional separator)
2872 "Split the STRING into a list of strings. 2870 "Split the STRING into a list of strings.
2873It understands elisp style quoting within STRING such that 2871It understands Emacs Lisp quoting within STRING, such that
2874 (string->strings (strings->string strs)) == strs 2872 (split-string-and-unquote (combine-and-quote-strings strs)) == strs
2875The SEPARATOR regexp defaults to \"\\s-+\"." 2873The SEPARATOR regexp defaults to \"\\s-+\"."
2876 (let ((sep (or separator "\\s-+")) 2874 (let ((sep (or separator "\\s-+"))
2877 (i (string-match "[\"]" string))) 2875 (i (string-match "[\"]" string)))
2878 (if (null i) (split-string string sep t) ; no quoting: easy 2876 (if (null i)
2877 (split-string string sep t) ; no quoting: easy
2879 (append (unless (eq i 0) (split-string (substring string 0 i) sep t)) 2878 (append (unless (eq i 0) (split-string (substring string 0 i) sep t))
2880 (let ((rfs (read-from-string string i))) 2879 (let ((rfs (read-from-string string i)))
2881 (cons (car rfs) 2880 (cons (car rfs)
2882 (string->strings (substring string (cdr rfs)) 2881 (split-string-and-unquote (substring string (cdr rfs))
2883 sep))))))) 2882 sep)))))))
2884 2883
2885 2884
2886;;;; Replacement in strings. 2885;;;; Replacement in strings.
diff --git a/lisp/t-mouse.el b/lisp/t-mouse.el
index c97f5afcf9c..821bad4e819 100644
--- a/lisp/t-mouse.el
+++ b/lisp/t-mouse.el
@@ -42,7 +42,8 @@
42;;;###autoload 42;;;###autoload
43(define-minor-mode t-mouse-mode 43(define-minor-mode t-mouse-mode
44 "Toggle t-mouse mode to use the mouse in Linux consoles. 44 "Toggle t-mouse mode to use the mouse in Linux consoles.
45With prefix arg, turn t-mouse mode on iff arg is positive. 45With prefix arg, turn t-mouse mode on if arg is positive, otherwise turn it
46off.
46 47
47This allows the use of the mouse when operating on a Linux console, in the 48This allows the use of the mouse when operating on a Linux console, in the
48same way as you can use the mouse under X11. 49same way as you can use the mouse under X11.
diff --git a/lisp/term.el b/lisp/term.el
index c7b5ee249d1..523d20670e6 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -407,8 +407,7 @@
407 407
408(defgroup term nil 408(defgroup term nil
409 "General command interpreter in a window." 409 "General command interpreter in a window."
410 :group 'processes 410 :group 'processes)
411 :group 'unix)
412 411
413 412
414;;; Buffer Local Variables: 413;;; Buffer Local Variables:
@@ -470,7 +469,7 @@
470(defvar term-scroll-with-delete nil) ;; term-scroll-with-delete is t if 469(defvar term-scroll-with-delete nil) ;; term-scroll-with-delete is t if
471;; forward scrolling should be implemented by delete to 470;; forward scrolling should be implemented by delete to
472;; top-most line(s); and nil if scrolling should be implemented 471;; top-most line(s); and nil if scrolling should be implemented
473;; by moving term-home-marker. It is set to t iff there is a 472;; by moving term-home-marker. It is set to t if there is a
474;; (non-default) scroll-region OR the alternate buffer is used. 473;; (non-default) scroll-region OR the alternate buffer is used.
475(defvar term-pending-delete-marker) ;; New user input in line mode needs to 474(defvar term-pending-delete-marker) ;; New user input in line mode needs to
476;; be deleted, because it gets echoed by the inferior. 475;; be deleted, because it gets echoed by the inferior.
@@ -695,12 +694,12 @@ Buffer local variable.")
695 694
696;;; faces -mm 695;;; faces -mm
697 696
698(defcustom term-default-fg-color 'unspecified 697(defcustom term-default-fg-color (face-foreground term-current-face)
699 "Default color for foreground in `term'." 698 "Default color for foreground in `term'."
700 :group 'term 699 :group 'term
701 :type 'string) 700 :type 'string)
702 701
703(defcustom term-default-bg-color 'unspecified 702(defcustom term-default-bg-color (face-background term-current-face)
704 "Default color for background in `term'." 703 "Default color for background in `term'."
705 :group 'term 704 :group 'term
706 :type 'string) 705 :type 'string)
@@ -1098,6 +1097,8 @@ Entry to this mode runs the hooks on `term-mode-hook'."
1098 (make-local-variable 'term-pending-delete-marker) 1097 (make-local-variable 'term-pending-delete-marker)
1099 (setq term-pending-delete-marker (make-marker)) 1098 (setq term-pending-delete-marker (make-marker))
1100 (make-local-variable 'term-current-face) 1099 (make-local-variable 'term-current-face)
1100 (setq term-current-face (list :background term-default-bg-color
1101 :foreground term-default-fg-color))
1101 (make-local-variable 'term-pending-frame) 1102 (make-local-variable 'term-pending-frame)
1102 (setq term-pending-frame nil) 1103 (setq term-pending-frame nil)
1103 ;; Cua-mode's keybindings interfere with the term keybindings, disable it. 1104 ;; Cua-mode's keybindings interfere with the term keybindings, disable it.
@@ -3055,7 +3056,8 @@ See `term-prompt-regexp'."
3055 (setq term-scroll-start 0) 3056 (setq term-scroll-start 0)
3056 (setq term-scroll-end term-height) 3057 (setq term-scroll-end term-height)
3057 (setq term-insert-mode nil) 3058 (setq term-insert-mode nil)
3058 (setq term-current-face nil) 3059 (setq term-current-face (list :background term-default-bg-color
3060 :foreground term-default-fg-color))
3059 (setq term-ansi-current-underline nil) 3061 (setq term-ansi-current-underline nil)
3060 (setq term-ansi-current-bold nil) 3062 (setq term-ansi-current-bold nil)
3061 (setq term-ansi-current-reverse nil) 3063 (setq term-ansi-current-reverse nil)
@@ -3117,7 +3119,8 @@ See `term-prompt-regexp'."
3117 3119
3118;;; 0 (Reset) or unknown (reset anyway) 3120;;; 0 (Reset) or unknown (reset anyway)
3119 (t 3121 (t
3120 (setq term-current-face nil) 3122 (setq term-current-face (list :background term-default-bg-color
3123 :foreground term-default-fg-color))
3121 (setq term-ansi-current-underline nil) 3124 (setq term-ansi-current-underline nil)
3122 (setq term-ansi-current-bold nil) 3125 (setq term-ansi-current-bold nil)
3123 (setq term-ansi-current-reverse nil) 3126 (setq term-ansi-current-reverse nil)
@@ -3154,11 +3157,11 @@ See `term-prompt-regexp'."
3154 (setq term-current-face 3157 (setq term-current-face
3155 (list :background 3158 (list :background
3156 (if (= term-ansi-current-color 0) 3159 (if (= term-ansi-current-color 0)
3157 (face-foreground 'default) 3160 term-default-fg-color
3158 (elt ansi-term-color-vector term-ansi-current-color)) 3161 (elt ansi-term-color-vector term-ansi-current-color))
3159 :foreground 3162 :foreground
3160 (if (= term-ansi-current-bg-color 0) 3163 (if (= term-ansi-current-bg-color 0)
3161 (face-background 'default) 3164 term-default-bg-color
3162 (elt ansi-term-color-vector term-ansi-current-bg-color)))) 3165 (elt ansi-term-color-vector term-ansi-current-bg-color))))
3163 (when term-ansi-current-bold 3166 (when term-ansi-current-bold
3164 (setq term-current-face 3167 (setq term-current-face
@@ -3181,9 +3184,13 @@ See `term-prompt-regexp'."
3181 ) 3184 )
3182 (setq term-current-face 3185 (setq term-current-face
3183 (list :foreground 3186 (list :foreground
3184 (elt ansi-term-color-vector term-ansi-current-color) 3187 (if (= term-ansi-current-color 0)
3188 term-default-fg-color
3189 (elt ansi-term-color-vector term-ansi-current-color))
3185 :background 3190 :background
3186 (elt ansi-term-color-vector term-ansi-current-bg-color))) 3191 (if (= term-ansi-current-bg-color 0)
3192 term-default-bg-color
3193 (elt ansi-term-color-vector term-ansi-current-bg-color))))
3187 (when term-ansi-current-bold 3194 (when term-ansi-current-bold
3188 (setq term-current-face 3195 (setq term-current-face
3189 (append '(:weight bold) term-current-face))) 3196 (append '(:weight bold) term-current-face)))
@@ -3715,12 +3722,12 @@ all pending output has been dealt with."))
3715(defun term-erase-in-display (kind) 3722(defun term-erase-in-display (kind)
3716 "Erases (that is blanks out) part of the window. 3723 "Erases (that is blanks out) part of the window.
3717If KIND is 0, erase from (point) to (point-max); 3724If KIND is 0, erase from (point) to (point-max);
3718if KIND is 1, erase from home to point; else erase from home to point-max. 3725if KIND is 1, erase from home to point; else erase from home to point-max."
3719Should only be called when point is at the start of a screen line."
3720 (term-handle-deferred-scroll) 3726 (term-handle-deferred-scroll)
3721 (cond ((eq term-terminal-parameter 0) 3727 (cond ((eq term-terminal-parameter 0)
3722 (delete-region (point) (point-max)) 3728 (let ((need-unwrap (bolp)))
3723 (term-unwrap-line)) 3729 (delete-region (point) (point-max))
3730 (when need-unwrap (term-unwrap-line))))
3724 ((let ((row (term-current-row)) 3731 ((let ((row (term-current-row))
3725 (col (term-horizontal-column)) 3732 (col (term-horizontal-column))
3726 (start-region term-home-marker) 3733 (start-region term-home-marker)
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index c2dcdd9c787..f7be9fd73fd 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1713,6 +1713,19 @@ in `selection-converter-alist', which see."
1713 (setq modifiers (cons (car modifier-mask) modifiers))))) 1713 (setq modifiers (cons (car modifier-mask) modifiers)))))
1714 modifiers)) 1714 modifiers))
1715 1715
1716(defun mac-ae-reopen-application (event)
1717 "Show some frame in response to the Apple event EVENT.
1718The frame to be shown is chosen from visible or iconified frames
1719if possible. If there's no such frame, a new frame is created."
1720 (interactive "e")
1721 (unless (frame-visible-p (selected-frame))
1722 (let ((frame (or (car (visible-frame-list))
1723 (car (filtered-frame-list 'frame-visible-p)))))
1724 (if frame
1725 (select-frame frame)
1726 (switch-to-buffer-other-frame "*scratch*"))))
1727 (select-frame-set-input-focus (selected-frame)))
1728
1716(defun mac-ae-open-documents (event) 1729(defun mac-ae-open-documents (event)
1717 "Open the documents specified by the Apple event EVENT." 1730 "Open the documents specified by the Apple event EVENT."
1718 (interactive "e") 1731 (interactive "e")
@@ -1769,9 +1782,9 @@ Currently the `mailto' scheme is supported."
1769(define-key mac-apple-event-map [core-event open-application] 0) 1782(define-key mac-apple-event-map [core-event open-application] 0)
1770 1783
1771;; Received when a dock or application icon is clicked and Emacs is 1784;; Received when a dock or application icon is clicked and Emacs is
1772;; already running. Simply ignored. Another idea is to make a new 1785;; already running.
1773;; frame if all frames are invisible. 1786(define-key mac-apple-event-map [core-event reopen-application]
1774(define-key mac-apple-event-map [core-event reopen-application] 'ignore) 1787 'mac-ae-reopen-application)
1775 1788
1776(define-key mac-apple-event-map [core-event open-documents] 1789(define-key mac-apple-event-map [core-event open-documents]
1777 'mac-ae-open-documents) 1790 'mac-ae-open-documents)
diff --git a/lisp/term/sun-mouse.el b/lisp/term/sun-mouse.el
index 280bfb67081..65ebe193c71 100644
--- a/lisp/term/sun-mouse.el
+++ b/lisp/term/sun-mouse.el
@@ -230,7 +230,7 @@ Handles wrapped and horizontally scrolled lines correctly."
230 230
231 231
232(defun minibuffer-window-p (window) 232(defun minibuffer-window-p (window)
233 "True iff this WINDOW is minibuffer." 233 "True if this WINDOW is minibuffer."
234 (= (frame-height) 234 (= (frame-height)
235 (nth 3 (window-edges window)) ; The bottom edge. 235 (nth 3 (window-edges window)) ; The bottom edge.
236 )) 236 ))
diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el
index e127abc51a2..d090df55411 100644
--- a/lisp/term/tvi970.el
+++ b/lisp/term/tvi970.el
@@ -107,8 +107,8 @@
107 107
108;;; Should keypad numbers send ordinary digits or distinct escape sequences? 108;;; Should keypad numbers send ordinary digits or distinct escape sequences?
109(defvar tvi970-keypad-numeric nil 109(defvar tvi970-keypad-numeric nil
110 "The terminal should be in numeric keypad mode iff this variable is non-nil. 110 "Non-nil means the terminal should be in numeric keypad mode.
111Do not set this variable! Call the function ``tvi970-set-keypad-mode''.") 111Do not set this variable! Call the function `tvi970-set-keypad-mode'.")
112 112
113(defun tvi970-set-keypad-mode (&optional arg) 113(defun tvi970-set-keypad-mode (&optional arg)
114 "Set the current mode of the TVI 970 numeric keypad. 114 "Set the current mode of the TVI 970 numeric keypad.
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index dbb41f13ec0..274de28e6a0 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -1768,7 +1768,7 @@ info-variant-part."
1768;; Macro that won't funcall the function if it is nil. 1768;; Macro that won't funcall the function if it is nil.
1769;; 1769;;
1770(defmacro artist-funcall (fn &rest args) 1770(defmacro artist-funcall (fn &rest args)
1771 "Call function FN with ARGS iff FN is not nil." 1771 "Call function FN with ARGS, if FN is not nil."
1772 (list 'if fn (cons 'funcall (cons fn args)))) 1772 (list 'if fn (cons 'funcall (cons fn args))))
1773 1773
1774(defun artist-uniq (l) 1774(defun artist-uniq (l)
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 8b95a159477..0b5dfa4cc54 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -457,7 +457,8 @@ See also `flyspell-duplicate-distance'."
457This spawns a single Ispell process and checks each word. 457This spawns a single Ispell process and checks each word.
458The default flyspell behavior is to highlight incorrect words. 458The default flyspell behavior is to highlight incorrect words.
459With no argument, this command toggles Flyspell mode. 459With no argument, this command toggles Flyspell mode.
460With a prefix argument ARG, turn Flyspell minor mode on iff ARG is positive. 460With a prefix argument ARG, turn Flyspell minor mode on if ARG is positive,
461otherwise turn it off.
461 462
462Bindings: 463Bindings:
463\\[ispell-word]: correct words (using Ispell). 464\\[ispell-word]: correct words (using Ispell).
@@ -1621,7 +1622,7 @@ FLYSPELL-BUFFER."
1621;;* flyspell-overlay-p ... */ 1622;;* flyspell-overlay-p ... */
1622;;*---------------------------------------------------------------------*/ 1623;;*---------------------------------------------------------------------*/
1623(defun flyspell-overlay-p (o) 1624(defun flyspell-overlay-p (o)
1624 "A predicate that return true iff O is an overlay used by flyspell." 1625 "Return true if O is an overlay used by flyspell."
1625 (and (overlayp o) (overlay-get o 'flyspell-overlay))) 1626 (and (overlayp o) (overlay-get o 'flyspell-overlay)))
1626 1627
1627;;*---------------------------------------------------------------------*/ 1628;;*---------------------------------------------------------------------*/
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 047fb141331..3d6a17c5d93 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3324,7 +3324,8 @@ available on the net."
3324;;;###autoload 3324;;;###autoload
3325(defun ispell-minor-mode (&optional arg) 3325(defun ispell-minor-mode (&optional arg)
3326 "Toggle Ispell minor mode. 3326 "Toggle Ispell minor mode.
3327With prefix arg, turn Ispell minor mode on iff arg is positive. 3327With prefix argument ARG, turn Ispell minor mode on if ARG is positive,
3328otherwise turn it off.
3328 3329
3329In Ispell minor mode, pressing SPC or RET 3330In Ispell minor mode, pressing SPC or RET
3330warns you if the previous word is incorrectly spelled. 3331warns you if the previous word is incorrectly spelled.
diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el
index 45d407b2565..31ec234fddc 100644
--- a/lisp/textmodes/nroff-mode.el
+++ b/lisp/textmodes/nroff-mode.el
@@ -263,7 +263,7 @@ automatically inserts the matching closing request after point."
263`nroff-electric-newline' forces Emacs to check for an nroff request at the 263`nroff-electric-newline' forces Emacs to check for an nroff request at the
264beginning of the line, and insert the matching closing request if necessary. 264beginning of the line, and insert the matching closing request if necessary.
265This command toggles that mode (off->on, on->off), with an argument, 265This command toggles that mode (off->on, on->off), with an argument,
266turns it on iff arg is positive, otherwise off." 266turns it on if arg is positive, otherwise off."
267 :lighter " Electric" 267 :lighter " Electric"
268 (or (derived-mode-p 'nroff-mode) (error "Must be in nroff mode"))) 268 (or (derived-mode-p 'nroff-mode) (error "Must be in nroff mode")))
269 269
diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el
index a20a482a1c9..3717faa8ad2 100644
--- a/lisp/textmodes/refill.el
+++ b/lisp/textmodes/refill.el
@@ -217,7 +217,7 @@ complex processing.")
217;;;###autoload 217;;;###autoload
218(define-minor-mode refill-mode 218(define-minor-mode refill-mode
219 "Toggle Refill minor mode. 219 "Toggle Refill minor mode.
220With prefix arg, turn Refill mode on iff arg is positive. 220With prefix arg, turn Refill mode on if arg is positive, otherwise turn it off.
221 221
222When Refill mode is on, the current paragraph will be formatted when 222When Refill mode is on, the current paragraph will be formatted when
223changes are made within it. Self-inserting characters only cause 223changes are made within it. Self-inserting characters only cause
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el
index c551083240c..2a39949431c 100644
--- a/lisp/textmodes/reftex-global.el
+++ b/lisp/textmodes/reftex-global.el
@@ -431,7 +431,7 @@ the current TeX document.
431 431
432With no argument, this command toggles 432With no argument, this command toggles
433`reftex-isearch-minor-mode'. With a prefix argument ARG, turn 433`reftex-isearch-minor-mode'. With a prefix argument ARG, turn
434`reftex-isearch-minor-mode' on iff ARG is positive." 434`reftex-isearch-minor-mode' on if ARG is positive, otherwise turn it off."
435 (interactive "P") 435 (interactive "P")
436 (let ((old-reftex-isearch-minor-mode reftex-isearch-minor-mode)) 436 (let ((old-reftex-isearch-minor-mode reftex-isearch-minor-mode))
437 (setq reftex-isearch-minor-mode 437 (setq reftex-isearch-minor-mode
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 6e262ee00d2..245ffc47908 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -826,7 +826,7 @@ Return non-nil if we skipped over matched tags."
826(defun sgml-skip-tag-forward (arg) 826(defun sgml-skip-tag-forward (arg)
827 "Skip to end of tag or matching closing tag if present. 827 "Skip to end of tag or matching closing tag if present.
828With prefix argument ARG, repeat this ARG times. 828With prefix argument ARG, repeat this ARG times.
829Return t iff after a closing tag." 829Return t if after a closing tag."
830 (interactive "p") 830 (interactive "p")
831 ;; FIXME: Use sgml-get-context or something similar. 831 ;; FIXME: Use sgml-get-context or something similar.
832 ;; It currently might jump to an unrelated </P> if the <P> 832 ;; It currently might jump to an unrelated </P> if the <P>
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 240ebbcb229..44bc31d36d6 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -249,14 +249,12 @@ Normally set to either `plain-tex-mode' or `latex-mode'."
249 :group 'tex) 249 :group 'tex)
250(put 'tex-fontify-script 'safe-local-variable 'booleanp) 250(put 'tex-fontify-script 'safe-local-variable 'booleanp)
251 251
252(defcustom tex-font-script-display '(-0.2 . 0.2) 252(defcustom tex-font-script-display '(-0.2 0.2)
253 "Display specification for subscript and superscript content. 253 "Display specification for subscript and superscript content.
254The car is used for subscript, the cdr is used for superscripts." 254The first is used for subscript, the second is used for superscripts."
255 :group 'tex 255 :group 'tex
256 :type '(cons (choice (float :tag "Subscript") 256 :type '(list (float :tag "Subscript")
257 (const :tag "No lowering" nil)) 257 (float :tag "Superscript")))
258 (choice (float :tag "Superscript")
259 (const :tag "No raising" nil))))
260 258
261(defvar tex-last-temp-file nil 259(defvar tex-last-temp-file nil
262 "Latest temporary file generated by \\[tex-region] and \\[tex-buffer]. 260 "Latest temporary file generated by \\[tex-region] and \\[tex-buffer].
@@ -609,7 +607,7 @@ An alternative value is \" . \", if you use a font with a narrow period."
609 odd)) 607 odd))
610 (if (eq (char-after pos) ?_) 608 (if (eq (char-after pos) ?_)
611 `(face subscript display (raise ,(car tex-font-script-display))) 609 `(face subscript display (raise ,(car tex-font-script-display)))
612 `(face superscript display (raise ,(cdr tex-font-script-display)))))) 610 `(face superscript display (raise ,(cadr tex-font-script-display))))))
613 611
614(defun tex-font-lock-match-suscript (limit) 612(defun tex-font-lock-match-suscript (limit)
615 "Match subscript and superscript patterns up to LIMIT." 613 "Match subscript and superscript patterns up to LIMIT."
@@ -669,7 +667,7 @@ An alternative value is \" . \", if you use a font with a narrow period."
669 (let ((next (next-single-property-change beg 'display nil end)) 667 (let ((next (next-single-property-change beg 'display nil end))
670 (prop (get-text-property beg 'display))) 668 (prop (get-text-property beg 'display)))
671 (if (and (eq (car-safe prop) 'raise) 669 (if (and (eq (car-safe prop) 'raise)
672 (member (car-safe (cdr prop)) '(-0.3 +0.3)) 670 (member (car-safe (cdr prop)) tex-font-script-display)
673 (null (cddr prop))) 671 (null (cddr prop)))
674 (put-text-property beg next 'display nil)) 672 (put-text-property beg next 'display nil))
675 (setq beg next)))) 673 (setq beg next))))
diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el
index 2568b53fe36..e1f55c0dece 100644
--- a/lisp/textmodes/two-column.el
+++ b/lisp/textmodes/two-column.el
@@ -347,8 +347,8 @@ When called again, restores the screen layout with the current buffer
347first and the associated buffer to its right." 347first and the associated buffer to its right."
348 (interactive "P") 348 (interactive "P")
349 ;; first go to full width, so that we can certainly split into two windows 349 ;; first go to full width, so that we can certainly split into two windows
350 (if (< (window-width) (frame-width)) 350 (unless (window-full-width-p)
351 (enlarge-window 99999 t)) 351 (enlarge-window 99999 t))
352 (split-window-horizontally 352 (split-window-horizontally
353 (max window-min-width (min 2C-window-width 353 (max window-min-width (min 2C-window-width
354 (- (frame-width) window-min-width)))) 354 (- (frame-width) window-min-width))))
@@ -533,8 +533,8 @@ off trailing spaces with \\[delete-trailing-whitespace]."
533 (insert 2C-separator string)) 533 (insert 2C-separator string))
534 (next-line 1) ; add one if necessary 534 (next-line 1) ; add one if necessary
535 (set-buffer b2)))) 535 (set-buffer b2))))
536 (if (< (window-width) (frame-width)) 536 (unless (window-full-width-p)
537 (enlarge-window 99999 t))) 537 (enlarge-window 99999 t)))
538 538
539;;;;; utility functions ;;;;; 539;;;;; utility functions ;;;;;
540 540
@@ -561,8 +561,10 @@ off trailing spaces with \\[delete-trailing-whitespace]."
561 (newline arg)) 561 (newline arg))
562 562
563(defun 2C-toggle-autoscroll (arg) 563(defun 2C-toggle-autoscroll (arg)
564 "Toggle autoscrolling, or set it iff prefix ARG is non-nil and positive. 564 "Toggle autoscrolling.
565When autoscrolling is turned on, this also realigns the two buffers." 565With prefix argument ARG, turn on autoscrolling if ARG is
566positive, otherwise turn it off. When autoscrolling is turned
567on, this also realigns the two buffers."
566 (interactive "P") 568 (interactive "P")
567 ;(sit-for 0) 569 ;(sit-for 0)
568 (setq 2C-autoscroll-start (window-start)) 570 (setq 2C-autoscroll-start (window-start))
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 8bf3ca4aead..46a2bb62a75 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,8 @@
12007-08-08 Glenn Morris <rgm@gnu.org>
2
3 * url-auth.el, url-cache.el, url-dav.el, url-file.el, vc-dav.el:
4 Replace `iff' in doc-strings and comments.
5
12007-07-25 Glenn Morris <rgm@gnu.org> 62007-07-25 Glenn Morris <rgm@gnu.org>
2 7
3 * Relicense all FSF files to GPLv3 or later. 8 * Relicense all FSF files to GPLv3 or later.
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index c57a96cc81b..3c33fd914e5 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -68,7 +68,9 @@ instead of the pathname inheritance method."
68 (server (url-host href)) 68 (server (url-host href))
69 (port (url-port href)) 69 (port (url-port href))
70 (path (url-filename href)) 70 (path (url-filename href))
71 user pass byserv retval data) 71 (user (url-user href))
72 (pass (url-password href))
73 byserv retval data)
72 (setq server (format "%s:%d" server port) 74 (setq server (format "%s:%d" server port)
73 path (cond 75 path (cond
74 (realm realm) 76 (realm realm)
@@ -79,8 +81,8 @@ instead of the pathname inheritance method."
79 (cond 81 (cond
80 ((and prompt (not byserv)) 82 ((and prompt (not byserv))
81 (setq user (read-string (url-auth-user-prompt url realm) 83 (setq user (read-string (url-auth-user-prompt url realm)
82 (user-real-login-name)) 84 (or user (user-real-login-name)))
83 pass (read-passwd "Password: ")) 85 pass (read-passwd "Password: " nil (or pass "")))
84 (set url-basic-auth-storage 86 (set url-basic-auth-storage
85 (cons (list server 87 (cons (list server
86 (cons path 88 (cons path
@@ -310,7 +312,7 @@ RATING a rating between 1 and 10 of the strength of the authentication.
310 url-registered-auth-schemes))))) 312 url-registered-auth-schemes)))))
311 313
312(defun url-auth-registered (scheme) 314(defun url-auth-registered (scheme)
313 ;; Return non-nil iff SCHEME is registered as an auth type 315 "Return non-nil if SCHEME is registered as an auth type."
314 (assoc scheme url-registered-auth-schemes)) 316 (assoc scheme url-registered-auth-schemes))
315 317
316(provide 'url-auth) 318(provide 'url-auth)
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el
index 8fbe01d472a..6db30eacda9 100644
--- a/lisp/url/url-cache.el
+++ b/lisp/url/url-cache.el
@@ -186,7 +186,7 @@ Very fast if you have an `md5' primitive function, suitably fast otherwise."
186 186
187;;;###autoload 187;;;###autoload
188(defun url-cache-expired (url mod) 188(defun url-cache-expired (url mod)
189 "Return t iff a cached file has expired." 189 "Return t if a cached file has expired."
190 (let* ((urlobj (if (vectorp url) url (url-generic-parse-url url))) 190 (let* ((urlobj (if (vectorp url) url (url-generic-parse-url url)))
191 (type (url-type urlobj))) 191 (type (url-type urlobj)))
192 (cond 192 (cond
diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el
index afae0041b68..b58c1672865 100644
--- a/lisp/url/url-dav.el
+++ b/lisp/url/url-dav.el
@@ -562,7 +562,7 @@ FAILURE-RESULTS is a list of (URL STATUS)."
562 562
563(defun url-dav-unlock-resource (url lock-token) 563(defun url-dav-unlock-resource (url lock-token)
564 "Release the lock on URL represented by LOCK-TOKEN. 564 "Release the lock on URL represented by LOCK-TOKEN.
565Returns t iff the lock was successfully released." 565Returns t if the lock was successfully released."
566 (declare (special url-http-response-status)) 566 (declare (special url-http-response-status))
567 (let* ((url-request-extra-headers (list (cons "Lock-Token" 567 (let* ((url-request-extra-headers (list (cons "Lock-Token"
568 (concat "<" lock-token ">")))) 568 (concat "<" lock-token ">"))))
@@ -654,13 +654,13 @@ Returns t iff the lock was successfully released."
654 (or (plist-get properties 'DAV:getcontentlength) 0) 654 (or (plist-get properties 'DAV:getcontentlength) 0)
655 655
656 ;; file modes as a string like `ls -l' 656 ;; file modes as a string like `ls -l'
657 ;; 657 ;;
658 ;; Should be able to build this up from the 658 ;; Should be able to build this up from the
659 ;; DAV:supportedlock attribute pretty easily. Getting 659 ;; DAV:supportedlock attribute pretty easily. Getting
660 ;; the group info could be impossible though. 660 ;; the group info could be impossible though.
661 (url-dav-file-attributes-mode-string properties) 661 (url-dav-file-attributes-mode-string properties)
662 662
663 ;; t iff file's gid would change if it were deleted & 663 ;; t if file's gid would change if it were deleted &
664 ;; recreated. No way for us to know that thru DAV. 664 ;; recreated. No way for us to know that thru DAV.
665 nil 665 nil
666 666
diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el
index e899493f1ce..6e771c9cd69 100644
--- a/lisp/url/url-file.el
+++ b/lisp/url/url-file.el
@@ -52,7 +52,7 @@ to them."
52 found)) 52 found))
53 53
54(defun url-file-host-is-local-p (host) 54(defun url-file-host-is-local-p (host)
55 "Return t iff HOST references our local machine." 55 "Return t if HOST references our local machine."
56 (let ((case-fold-search t)) 56 (let ((case-fold-search t))
57 (or 57 (or
58 (null host) 58 (null host)
diff --git a/lisp/url/vc-dav.el b/lisp/url/vc-dav.el
index ce0d3275a5f..7e9b6606ca4 100644
--- a/lisp/url/vc-dav.el
+++ b/lisp/url/vc-dav.el
@@ -31,7 +31,7 @@
31 31
32;;; Required functions for a vc backend 32;;; Required functions for a vc backend
33(defun vc-dav-registered (url) 33(defun vc-dav-registered (url)
34 "Return t iff URL is registered with a DAV aware server." 34 "Return t if URL is registered with a DAV aware server."
35 (url-dav-vc-registered url)) 35 (url-dav-vc-registered url))
36 36
37(defun vc-dav-state (url) 37(defun vc-dav-state (url)
diff --git a/lisp/userlock.el b/lisp/userlock.el
index 17cbc0c3e55..8e4a6753a31 100644
--- a/lisp/userlock.el
+++ b/lisp/userlock.el
@@ -134,7 +134,7 @@ The buffer in question is current when this function is called."
134 (setq answer nil)) 134 (setq answer nil))
135 ((eq answer 'revert) 135 ((eq answer 'revert)
136 (revert-buffer nil (not (buffer-modified-p))) 136 (revert-buffer nil (not (buffer-modified-p)))
137 ; ask confirmation iff buffer modified 137 ; ask confirmation if buffer modified
138 (signal 'file-supersession 138 (signal 'file-supersession
139 (list "File reverted" fn))) 139 (list "File reverted" fn)))
140 ((eq answer 'yield) 140 ((eq answer 'yield)
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index b2011a7176e..20a9ca9b2fb 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -2,15 +2,10 @@
2 2
3;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. 3;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
4 4
5;; NOTE: THIS IS A MODIFIED VERSION OF Dave Love's vc-bzr.el,
6;; which you can find at: http://www.loveshack.ukfsn.org/emacs/vc-bzr.el
7;; I could not get in touch with Dave Love by email, so
8;; I am releasing my changes separately. -- Riccardo
9
10;; Author: Dave Love <fx@gnu.org>, Riccardo Murri <riccardo.murri@gmail.com> 5;; Author: Dave Love <fx@gnu.org>, Riccardo Murri <riccardo.murri@gmail.com>
11;; Keywords: tools 6;; Keywords: tools
12;; Created: Sept 2006 7;; Created: Sept 2006
13;; Version: 2007-05-24 8;; Version: 2007-08-03
14;; URL: http://launchpad.net/vc-bzr 9;; URL: http://launchpad.net/vc-bzr
15 10
16;; This file is free software; you can redistribute it and/or modify 11;; This file is free software; you can redistribute it and/or modify
@@ -31,9 +26,6 @@
31 26
32;;; Commentary: 27;;; Commentary:
33 28
34;; NOTE: THIS IS A MODIFIED VERSION OF Dave Love's vc-bzr.el,
35;; which you can find at: http://www.loveshack.ukfsn.org/emacs/vc-bzr.el
36
37;; See <URL:http://bazaar-vcs.org/> concerning bzr. 29;; See <URL:http://bazaar-vcs.org/> concerning bzr.
38 30
39;; Load this library to register bzr support in VC. It covers basic VC 31;; Load this library to register bzr support in VC. It covers basic VC
@@ -96,34 +88,73 @@ Invoke the bzr command adding `BZR_PROGRESS_BAR=none' to the environment."
96 (let ((process-environment 88 (let ((process-environment
97 (list* "BZR_PROGRESS_BAR=none" ; Suppress progress output (bzr >=0.9) 89 (list* "BZR_PROGRESS_BAR=none" ; Suppress progress output (bzr >=0.9)
98 "LC_ALL=C" ; Force English output 90 "LC_ALL=C" ; Force English output
99 process-environment)) 91 process-environment)))
100 ;; bzr may attempt some kind of user interaction if its stdin/stdout
101 ;; is connected to a PTY; therefore, ask Emacs to use a pipe to
102 ;; communicate with it.
103 ;; This is redundant because vc-do-command does it already. --Stef
104 (process-connection-type nil))
105 (apply 'vc-do-command buffer okstatus vc-bzr-program 92 (apply 'vc-do-command buffer okstatus vc-bzr-program
106 file-or-list bzr-command (append vc-bzr-program-args args)))) 93 file-or-list bzr-command (append vc-bzr-program-args args))))
107 94
108 95
109;;;###autoload 96;;;###autoload
110(defconst vc-bzr-admin-dirname ".bzr") ; FIXME: "_bzr" on w32? 97(defconst vc-bzr-admin-dirname ".bzr" ; FIXME: "_bzr" on w32?
98 "Name of the directory containing Bzr repository status files.")
99;;;###autoload
100(defconst vc-bzr-admin-checkout-format-file
101 (concat vc-bzr-admin-dirname "/checkout/format"))
102(defconst vc-bzr-admin-dirstate
103 (concat vc-bzr-admin-dirname "/checkout/dirstate"))
104(defconst vc-bzr-admin-branch-format-file
105 (concat vc-bzr-admin-dirname "/branch/format"))
106(defconst vc-bzr-admin-revhistory
107 (concat vc-bzr-admin-dirname "/branch/revision-history"))
111 108
112;;;###autoload (defun vc-bzr-registered (file) 109;;;###autoload (defun vc-bzr-registered (file)
113;;;###autoload (if (vc-find-root file vc-bzr-admin-dirname) 110;;;###autoload (if (vc-find-root file vc-bzr-admin-checkout-format-file)
114;;;###autoload (progn 111;;;###autoload (progn
115;;;###autoload (load "vc-bzr") 112;;;###autoload (load "vc-bzr")
116;;;###autoload (vc-bzr-registered file)))) 113;;;###autoload (vc-bzr-registered file))))
117 114
118(defun vc-bzr-root-dir (file) 115(defun vc-bzr-root (file)
119 "Return the root directory in the hierarchy above FILE. 116 "Return the root directory of the bzr repository containing FILE."
120Return nil if there isn't one." 117 ;; Cache technique copied from vc-arch.el.
121 (vc-find-root file vc-bzr-admin-dirname)) 118 (or (vc-file-getprop file 'bzr-root)
119 (vc-file-setprop
120 file 'bzr-root
121 (vc-find-root file vc-bzr-admin-checkout-format-file))))
122 122
123(defun vc-bzr-registered (file) 123(defun vc-bzr-registered (file)
124 "Return non-nil if FILE is registered with bzr." 124 "Return non-nil if FILE is registered with bzr.
125 (if (vc-bzr-root-dir file) ; Short cut. 125
126 (vc-bzr-state file))) ; Expensive. 126For speed, this function tries first to parse Bzr internal file
127`checkout/dirstate', but it may fail if Bzr internal file format
128has changed. As a safeguard, the `checkout/dirstate' file is
129only parsed if it contains the string `#bazaar dirstate flat
130format 3' in the first line.
131
132If the `checkout/dirstate' file cannot be parsed, fall back to
133running `vc-bzr-state'."
134 (condition-case nil
135 (lexical-let ((root (vc-bzr-root file)))
136 (and root ; Short cut.
137 ;; This looks at internal files. May break if they change
138 ;; their format.
139 (lexical-let
140 ((dirstate-file (expand-file-name vc-bzr-admin-dirstate root)))
141 (if (file-exists-p dirstate-file)
142 (with-temp-buffer
143 (insert-file-contents dirstate-file)
144 (goto-char (point-min))
145 (when (looking-at "#bazaar dirstate flat format 3")
146 (let* ((relfile (file-relative-name file root))
147 (reldir (file-name-directory relfile)))
148 (re-search-forward
149 (concat "^\0"
150 (if reldir (regexp-quote (directory-file-name reldir)))
151 "\0"
152 (regexp-quote (file-name-nondirectory relfile))
153 "\0")
154 nil t))))
155 t))
156 (vc-bzr-state file))) ; Expensive.
157 (file-error nil))) ; vc-bzr-program not found
127 158
128(defun vc-bzr-buffer-nonblank-p (&optional buffer) 159(defun vc-bzr-buffer-nonblank-p (&optional buffer)
129 "Return non-nil if BUFFER contains any non-blank characters." 160 "Return non-nil if BUFFER contains any non-blank characters."
@@ -134,15 +165,34 @@ Return nil if there isn't one."
134 (re-search-forward "[^ \t\n]" (point-max) t)))) 165 (re-search-forward "[^ \t\n]" (point-max) t))))
135 166
136(defconst vc-bzr-state-words 167(defconst vc-bzr-state-words
137 "added\\|ignored\\|modified\\|removed\\|renamed\\|unknown" 168 "added\\|ignored\\|kind changed\\|modified\\|removed\\|renamed\\|unknown"
138 "Regexp matching file status words as reported in `bzr' output.") 169 "Regexp matching file status words as reported in `bzr' output.")
139 170
171(defun vc-bzr-file-name-relative (filename)
172 "Return file name FILENAME stripped of the initial Bzr repository path."
173 (lexical-let*
174 ((filename* (expand-file-name filename))
175 (rootdir (vc-bzr-root (file-name-directory filename*))))
176 (and rootdir
177 (file-relative-name filename* rootdir))))
178
140;; FIXME: Also get this in a non-registered sub-directory. 179;; FIXME: Also get this in a non-registered sub-directory.
141(defun vc-bzr-state (file) 180;; It already works for me. -- Riccardo
181(defun vc-bzr-status (file)
182 "Return FILE status according to Bzr.
183Return value is a cons (STATUS . WARNING), where WARNING is a
184string or nil, and STATUS is one of the symbols: 'added,
185'ignored, 'kindchange, 'modified, 'removed, 'renamed, 'unknown,
186which directly correspond to `bzr status' output, or 'unchanged
187for files whose copy in the working tree is identical to the one
188in the branch repository, or nil for files that are not
189registered with Bzr.
190
191If any error occurred in running `bzr status', then return nil."
192 (condition-case nil
142 (with-temp-buffer 193 (with-temp-buffer
143 (cd (file-name-directory file)) 194 (let ((ret (vc-bzr-command "status" t 0 file))
144 (let ((ret (vc-bzr-command "status" t 255 file)) 195 (status 'unchanged))
145 (state 'up-to-date))
146 ;; the only secure status indication in `bzr status' output 196 ;; the only secure status indication in `bzr status' output
147 ;; is a couple of lines following the pattern:: 197 ;; is a couple of lines following the pattern::
148 ;; | <status>: 198 ;; | <status>:
@@ -153,45 +203,93 @@ Return nil if there isn't one."
153 (goto-char (point-min)) 203 (goto-char (point-min))
154 (when 204 (when
155 (re-search-forward 205 (re-search-forward
206 ;; bzr prints paths relative to the repository root
156 (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+" 207 (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+"
157 (file-name-nondirectory file) "[ \t\n]*$") 208 (regexp-quote (vc-bzr-file-name-relative file))
209 (if (file-directory-p file) "/?" "")
210 "[ \t\n]*$")
158 (point-max) t) 211 (point-max) t)
159 (let ((start (match-beginning 0)) 212 (let ((start (match-beginning 0))
160 (end (match-end 0))) 213 (end (match-end 0)))
161 (goto-char start) 214 (goto-char start)
162 (setq state 215 (setq status
163 (cond 216 (cond
164 ((not (equal ret 0)) nil) 217 ((not (equal ret 0)) nil)
165 ((looking-at "added\\|renamed\\|modified\\|removed") 'edited) 218 ((looking-at "added") 'added)
166 ((looking-at "unknown\\|ignored") nil))) 219 ((looking-at "kind changed") 'kindchange)
220 ((looking-at "renamed") 'renamed)
221 ((looking-at "modified") 'modified)
222 ((looking-at "removed") 'removed)
223 ((looking-at "ignored") 'ignored)
224 ((looking-at "unknown") 'unknown)))
167 ;; erase the status text that matched 225 ;; erase the status text that matched
168 (delete-region start end))) 226 (delete-region start end)))
169 (when (vc-bzr-buffer-nonblank-p) 227 (if status
170 ;; "bzr" will output some warnings and informational messages 228 (cons status
171 ;; to the user to stderr; due to Emacs' `vc-do-command' (and, 229 ;; "bzr" will output warnings and informational messages to
172 ;; it seems, `start-process' itself), we cannot catch stderr 230 ;; stderr; due to Emacs' `vc-do-command' (and, it seems,
231 ;; `start-process' itself) limitations, we cannot catch stderr
173 ;; and stdout into different buffers. So, if there's anything 232 ;; and stdout into different buffers. So, if there's anything
174 ;; left in the buffer after removing the above status 233 ;; left in the buffer after removing the above status
175 ;; keywords, let us just presume that any other message from 234 ;; keywords, let us just presume that any other message from
176 ;; "bzr" is a user warning, and display it. 235 ;; "bzr" is a user warning, and display it.
177 (message "Warnings in `bzr' output: %s" 236 (if (vc-bzr-buffer-nonblank-p)
178 (buffer-substring (point-min) (point-max)))) 237 (buffer-substring (point-min) (point-max)))))))
179 (when state 238 (file-error nil))) ; vc-bzr-program not found
180 (vc-file-setprop file 'vc-workfile-version 239
181 (vc-bzr-workfile-version file)) 240(defun vc-bzr-state (file)
182 (vc-file-setprop file 'vc-state state)) 241 (lexical-let ((result (vc-bzr-status file)))
183 state))) 242 (when (consp result)
243 (if (cdr result)
244 (message "Warnings in `bzr' output: %s" (cdr result)))
245 (cdr (assq (car result)
246 '((added . edited)
247 (kindchange . edited)
248 (renamed . edited)
249 (modified . edited)
250 (removed . edited)
251 (ignored . nil)
252 (unknown . nil)
253 (unchanged . up-to-date)))))))
184 254
185(defun vc-bzr-workfile-unchanged-p (file) 255(defun vc-bzr-workfile-unchanged-p (file)
186 (eq 'up-to-date (vc-bzr-state file))) 256 (eq 'unchanged (car (vc-bzr-status file))))
187 257
188(defun vc-bzr-workfile-version (file) 258(defun vc-bzr-workfile-version (file)
189 ;; Looks like this could be obtained via counting lines in 259 (lexical-let*
190 ;; .bzr/branch/revision-history. 260 ((rootdir (vc-bzr-root file))
261 (branch-format-file (concat rootdir "/" vc-bzr-admin-branch-format-file))
262 (revhistory-file (concat rootdir "/" vc-bzr-admin-revhistory))
263 (lastrev-file (concat rootdir "/" "branch/last-revision")))
264 ;; Count lines in .bzr/branch/revision-history to avoid forking a
265 ;; bzr process. This looks at internal files. May break if they
266 ;; change their format.
267 (if (file-exists-p branch-format-file)
191 (with-temp-buffer 268 (with-temp-buffer
192 (vc-bzr-command "revno" t 0 file) 269 (insert-file-contents branch-format-file)
193 (goto-char (point-min)) 270 (goto-char (point-min))
194 (buffer-substring (point) (line-end-position)))) 271 (cond
272 ((or
273 (looking-at "Bazaar-NG branch, format 0.0.4")
274 (looking-at "Bazaar-NG branch format 5"))
275 ;; count lines in .bzr/branch/revision-history
276 (insert-file-contents revhistory-file)
277 (number-to-string (count-lines (line-end-position) (point-max))))
278 ((looking-at "Bazaar Branch Format 6 (bzr 0.15)")
279 ;; revno is the first number in .bzr/branch/last-revision
280 (insert-file-contents lastrev-file)
281 (goto-char (line-end-position))
282 (if (re-search-forward "[0-9]+" nil t)
283 (buffer-substring (match-beginning 0) (match-end 0))))))
284 ;; fallback to calling "bzr revno"
285 (lexical-let*
286 ((result (vc-bzr-command-discarding-stderr
287 vc-bzr-program "revno" file))
288 (exitcode (car result))
289 (output (cdr result)))
290 (cond
291 ((eq exitcode 0) (substring output 0 -1))
292 (t nil))))))
195 293
196(defun vc-bzr-checkout-model (file) 294(defun vc-bzr-checkout-model (file)
197 'implicit) 295 'implicit)
@@ -209,7 +307,7 @@ COMMENT is ignored."
209 307
210;; Could run `bzr status' in the directory and see if it succeeds, but 308;; Could run `bzr status' in the directory and see if it succeeds, but
211;; that's relatively expensive. 309;; that's relatively expensive.
212(defalias 'vc-bzr-responsible-p 'vc-bzr-root-dir 310(defalias 'vc-bzr-responsible-p 'vc-bzr-root
213 "Return non-nil if FILE is (potentially) controlled by bzr. 311 "Return non-nil if FILE is (potentially) controlled by bzr.
214The criterion is that there is a `.bzr' directory in the same 312The criterion is that there is a `.bzr' directory in the same
215or a superior directory.") 313or a superior directory.")
@@ -250,7 +348,7 @@ EDITABLE is ignored."
250 348
251(defun vc-bzr-revert (file &optional contents-done) 349(defun vc-bzr-revert (file &optional contents-done)
252 (unless contents-done 350 (unless contents-done
253 (with-temp-buffer (vc-bzr-command "revert" t 'async file)))) 351 (with-temp-buffer (vc-bzr-command "revert" t 0 file))))
254 352
255(defvar log-view-message-re) 353(defvar log-view-message-re)
256(defvar log-view-file-re) 354(defvar log-view-file-re)
@@ -294,13 +392,11 @@ EDITABLE is ignored."
294 (beginning-of-line 0) 392 (beginning-of-line 0)
295 (goto-char (point-min))))) 393 (goto-char (point-min)))))
296 394
297;; Fixem: vc-bzr-wash-log
298
299(autoload 'vc-diff-switches-list "vc" nil nil t) 395(autoload 'vc-diff-switches-list "vc" nil nil t)
300 396
301(defun vc-bzr-diff (files &optional rev1 rev2 buffer) 397(defun vc-bzr-diff (files &optional rev1 rev2 buffer)
302 "VC bzr backend for diff." 398 "VC bzr backend for diff."
303 (let ((working (vc-workfile-version (car files)))) 399 (let ((working (vc-workfile-version (if (consp files) (car files) files))))
304 (if (and (equal rev1 working) (not rev2)) 400 (if (and (equal rev1 working) (not rev2))
305 (setq rev1 nil)) 401 (setq rev1 nil))
306 (if (and (not rev1) rev2) 402 (if (and (not rev1) rev2)
@@ -317,9 +413,8 @@ EDITABLE is ignored."
317 413
318(defalias 'vc-bzr-diff-tree 'vc-bzr-diff) 414(defalias 'vc-bzr-diff-tree 'vc-bzr-diff)
319 415
320;; Fixme: implement vc-bzr-dir-state, vc-bzr-dired-state-info
321 416
322;; Fixme: vc-{next,previous}-version need fixing in vc.el to deal with 417;; FIXME: vc-{next,previous}-version need fixing in vc.el to deal with
323;; straight integer versions. 418;; straight integer versions.
324 419
325(defun vc-bzr-delete-file (file) 420(defun vc-bzr-delete-file (file)
@@ -399,17 +494,16 @@ Return nil if current line isn't annotated."
399 (if next-time 494 (if next-time
400 (- (vc-annotate-convert-time (current-time)) next-time)))) 495 (- (vc-annotate-convert-time (current-time)) next-time))))
401 496
402;; FIXME: `bzr root' will return the real path to the repository root, 497(defun vc-bzr-command-discarding-stderr (command &rest args)
403;; that is, it can differ from the buffer's current directory name 498 "Execute shell command COMMAND (with ARGS); return its output and exitcode.
404;; if there are any symbolic links. 499Return value is a cons (EXITCODE . OUTPUT), where EXITCODE is
405(defun vc-bzr-root (dir) 500the (numerical) exit code of the process, and OUTPUT is a string
406 "Return the root directory of the bzr repository containing DIR." 501containing whatever the process sent to its standard output
407 ;; Cache technique copied from vc-arch.el. 502stream. Standard error output is discarded."
408 (or (vc-file-getprop dir 'bzr-root) 503 (with-temp-buffer
409 (vc-file-setprop 504 (cons
410 dir 'bzr-root 505 (apply #'call-process command nil (list (current-buffer) nil) nil args)
411 (substring 506 (buffer-substring (point-min) (point-max)))))
412 (shell-command-to-string (concat vc-bzr-program " root " dir)) 0 -1))))
413 507
414;; TODO: it would be nice to mark the conflicted files in VC Dired, 508;; TODO: it would be nice to mark the conflicted files in VC Dired,
415;; and implement a command to run ediff and `bzr resolve' once the 509;; and implement a command to run ediff and `bzr resolve' once the
@@ -453,6 +547,9 @@ Optional argument LOCALP is always ignored."
453 ((looking-at "^added") 547 ((looking-at "^added")
454 (setq current-vc-state 'edited) 548 (setq current-vc-state 'edited)
455 (setq current-bzr-state 'added)) 549 (setq current-bzr-state 'added))
550 ((looking-at "^kind changed")
551 (setq current-vc-state 'edited)
552 (setq current-bzr-state 'kindchange))
456 ((looking-at "^modified") 553 ((looking-at "^modified")
457 (setq current-vc-state 'edited) 554 (setq current-vc-state 'edited)
458 (setq current-bzr-state 'modified)) 555 (setq current-bzr-state 'modified))
@@ -499,7 +596,7 @@ Optional argument LOCALP is always ignored."
499(add-to-list 'vc-handled-backends 'Bzr) 596(add-to-list 'vc-handled-backends 'Bzr)
500 597
501(eval-after-load "vc" 598(eval-after-load "vc"
502 '(add-to-list 'vc-directory-exclusion-list ".bzr" t)) 599 '(add-to-list 'vc-directory-exclusion-list vc-bzr-admin-dirname t))
503 600
504(defconst vc-bzr-unload-hook 601(defconst vc-bzr-unload-hook
505 (lambda () 602 (lambda ()
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 09001e59691..aa121457a40 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -279,7 +279,10 @@ It is usually called via the `vc-call' macro."
279 (t (apply f args))))) 279 (t (apply f args)))))
280 280
281(defmacro vc-call (fun file &rest args) 281(defmacro vc-call (fun file &rest args)
282 ;; BEWARE!! `file' is evaluated twice!! 282 "A convenience macro for calling VC backend functions.
283Functions called by this macro must accept FILE as the first argument.
284ARGS specifies any additional arguments. FUN should be unquoted.
285BEWARE!! `file' is evaluated twice!!"
283 `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args)) 286 `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args))
284 287
285(defsubst vc-parse-buffer (pattern i) 288(defsubst vc-parse-buffer (pattern i)
@@ -873,13 +876,9 @@ Used in `find-file-not-found-functions'."
873 (if backend (vc-call-backend backend 'find-file-not-found-hook)))) 876 (if backend (vc-call-backend backend 'find-file-not-found-hook))))
874 877
875(defun vc-default-find-file-not-found-hook (backend) 878(defun vc-default-find-file-not-found-hook (backend)
876 (if (yes-or-no-p 879 ;; This used to do what vc-rcs-find-file-not-found-hook does, but it only
877 (format "File %s was lost; check out from version control? " 880 ;; really makes sense for RCS. For other backends, better not do anything.
878 (file-name-nondirectory buffer-file-name))) 881 nil)
879 (save-excursion
880 (require 'vc)
881 (setq default-directory (file-name-directory buffer-file-name))
882 (not (vc-error-occurred (vc-checkout buffer-file-name))))))
883 882
884(add-hook 'find-file-not-found-functions 'vc-file-not-found-hook) 883(add-hook 'find-file-not-found-functions 'vc-file-not-found-hook)
885 884
diff --git a/lisp/vc-rcs.el b/lisp/vc-rcs.el
index dcd3adcd8c9..1cda8849219 100644
--- a/lisp/vc-rcs.el
+++ b/lisp/vc-rcs.el
@@ -234,6 +234,14 @@ When VERSION is given, perform check for that version."
234 ;; The workfile is unchanged if rcsdiff found no differences. 234 ;; The workfile is unchanged if rcsdiff found no differences.
235 (zerop status))) 235 (zerop status)))
236 236
237(defun vc-rcs-find-file-not-found-hook ()
238 (if (yes-or-no-p
239 (format "File %s was lost; check out from version control? "
240 (file-name-nondirectory buffer-file-name)))
241 (save-excursion
242 (require 'vc)
243 (let ((default-directory (file-name-directory buffer-file-name)))
244 (not (vc-error-occurred (vc-checkout buffer-file-name)))))))
237 245
238;;; 246;;;
239;;; State-changing functions 247;;; State-changing functions
diff --git a/lisp/vc.el b/lisp/vc.el
index 78e098d874f..3fc3784fdf1 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -1145,7 +1145,7 @@ Used by `vc-restore-buffer-context' to later restore the context."
1145 ;; ;; We may want to reparse the compilation buffer after revert 1145 ;; ;; We may want to reparse the compilation buffer after revert
1146 ;; (reparse (and (boundp 'compilation-error-list) ;compile loaded 1146 ;; (reparse (and (boundp 'compilation-error-list) ;compile loaded
1147 ;; ;; Construct a list; each elt is nil or a buffer 1147 ;; ;; Construct a list; each elt is nil or a buffer
1148 ;; ;; iff that buffer is a compilation output buffer 1148 ;; ;; if that buffer is a compilation output buffer
1149 ;; ;; that contains markers into the current buffer. 1149 ;; ;; that contains markers into the current buffer.
1150 ;; (save-current-buffer 1150 ;; (save-current-buffer
1151 ;; (mapcar (lambda (buffer) 1151 ;; (mapcar (lambda (buffer)
@@ -2636,6 +2636,9 @@ changes found in the master file; use \\[universal-argument] \\[vc-next-action]
2636 (message "Reverting %s...done" file))) 2636 (message "Reverting %s...done" file)))
2637 2637
2638;;;###autoload 2638;;;###autoload
2639(define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1")
2640
2641;;;###autoload
2639(defun vc-update () 2642(defun vc-update ()
2640 "Update the current buffer's file to the latest version on its branch. 2643 "Update the current buffer's file to the latest version on its branch.
2641If the file contains no changes, and is not locked, then this simply replaces 2644If the file contains no changes, and is not locked, then this simply replaces
@@ -2718,8 +2721,9 @@ return its name; otherwise return nil."
2718 (vc-resynch-buffer file t t)) 2721 (vc-resynch-buffer file t t))
2719 2722
2720;;;###autoload 2723;;;###autoload
2721(defun vc-rollback () 2724(defun vc-rollback (&optional norevert)
2722 "Get rid of most recently checked in version of this file." 2725 "Get rid of most recently checked in version of this file.
2726A prefix argument NOREVERT means do not revert the buffer afterwards."
2723 (interactive "P") 2727 (interactive "P")
2724 (vc-ensure-vc-buffer) 2728 (vc-ensure-vc-buffer)
2725 (let* ((file buffer-file-name) 2729 (let* ((file buffer-file-name)
@@ -3268,12 +3272,19 @@ colors. `vc-annotate-background' specifies the background color."
3268 (set (make-local-variable 'vc-annotate-parent-display-mode) 3272 (set (make-local-variable 'vc-annotate-parent-display-mode)
3269 display-mode))) 3273 display-mode)))
3270 3274
3271 (vc-exec-after 3275 (with-current-buffer temp-buffer-name
3272 `(progn 3276 (vc-exec-after
3273 (when ,current-line 3277 `(progn
3274 (goto-line ,current-line ,temp-buffer-name)) 3278 ;; Ideally, we'd rather not move point if the user has already
3275 (unless (active-minibuffer-window) 3279 ;; moved it elsewhere, but really point here is not the position
3276 (message "Annotating... done")))))) 3280 ;; of the user's cursor :-(
3281 (when ,current-line ;(and (bobp))
3282 (let ((win (get-buffer-window (current-buffer) 0)))
3283 (when win
3284 (with-selected-window win
3285 (goto-line ,current-line)))))
3286 (unless (active-minibuffer-window)
3287 (message "Annotating... done")))))))
3277 3288
3278(defun vc-annotate-prev-version (prefix) 3289(defun vc-annotate-prev-version (prefix)
3279 "Visit the annotation of the version previous to this one. 3290 "Visit the annotation of the version previous to this one.
diff --git a/lisp/view.el b/lisp/view.el
index 2f541fbf360..f6722f53756 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -375,7 +375,8 @@ Use this argument instead of explicitly setting `view-exit-action'."
375 ;; bindings instead of using the \\[] construction. The reason for this 375 ;; bindings instead of using the \\[] construction. The reason for this
376 ;; is that most commands have more than one key binding. 376 ;; is that most commands have more than one key binding.
377 "Toggle View mode, a minor mode for viewing text but not editing it. 377 "Toggle View mode, a minor mode for viewing text but not editing it.
378With ARG, turn View mode on iff ARG is positive. 378With prefix argument ARG, turn View mode on if ARG is positive, otherwise
379turn it off.
379 380
380Emacs commands that do not change the buffer contents are available as usual. 381Emacs commands that do not change the buffer contents are available as usual.
381Kill commands insert text in kill buffers but do not delete. Other commands 382Kill commands insert text in kill buffers but do not delete. Other commands
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index c38b6563592..3ea8394b0b7 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -763,7 +763,7 @@ If timer is not set, then set it to scan the files in
763;;;###autoload 763;;;###autoload
764(define-minor-mode whitespace-global-mode 764(define-minor-mode whitespace-global-mode
765 "Toggle using Whitespace mode in new buffers. 765 "Toggle using Whitespace mode in new buffers.
766With ARG, turn the mode on iff ARG is positive. 766With ARG, turn the mode on if ARG is positive, otherwise turn it off.
767 767
768When this mode is active, `whitespace-buffer' is added to 768When this mode is active, `whitespace-buffer' is added to
769`find-file-hook' and `kill-buffer-hook'." 769`find-file-hook' and `kill-buffer-hook'."
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index c46c041d64d..6025244abe5 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -483,7 +483,7 @@ new value.")
483 483
484;;;###autoload 484;;;###autoload
485(defun widgetp (widget) 485(defun widgetp (widget)
486 "Return non-nil iff WIDGET is a widget." 486 "Return non-nil if WIDGET is a widget."
487 (if (symbolp widget) 487 (if (symbolp widget)
488 (get widget 'widget-type) 488 (get widget 'widget-type)
489 (and (consp widget) 489 (and (consp widget)
@@ -500,7 +500,7 @@ Otherwise, just return the value."
500 value))) 500 value)))
501 501
502(defun widget-member (widget property) 502(defun widget-member (widget property)
503 "Non-nil iff there is a definition in WIDGET for PROPERTY." 503 "Non-nil if there is a definition in WIDGET for PROPERTY."
504 (cond ((plist-member (cdr widget) property) 504 (cond ((plist-member (cdr widget) property)
505 t) 505 t)
506 ((car widget) 506 ((car widget)
@@ -1606,7 +1606,7 @@ If that does not exists, call the value of `widget-complete-field'."
1606 (widget-princ-to-string (widget-get widget :value)))) 1606 (widget-princ-to-string (widget-get widget :value))))
1607 1607
1608(defun widget-default-active (widget) 1608(defun widget-default-active (widget)
1609 "Return t iff this widget active (user modifiable)." 1609 "Return t if this widget is active (user modifiable)."
1610 (or (widget-get widget :always-active) 1610 (or (widget-get widget :always-active)
1611 (and (not (widget-get widget :inactive)) 1611 (and (not (widget-get widget :inactive))
1612 (let ((parent (widget-get widget :parent))) 1612 (let ((parent (widget-get widget :parent)))
diff --git a/lisp/window.el b/lisp/window.el
index f0a30d811ab..26d1bdc9d3f 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -120,7 +120,7 @@ bars (top, bottom, or nil)."
120PROC is called with a window as argument. 120PROC is called with a window as argument.
121 121
122Optional second arg MINIBUF t means count the minibuffer window even 122Optional second arg MINIBUF t means count the minibuffer window even
123if not active. MINIBUF nil or omitted means count the minibuffer iff 123if not active. MINIBUF nil or omitted means count the minibuffer only if
124it is active. MINIBUF neither t nor nil means not to count the 124it is active. MINIBUF neither t nor nil means not to count the
125minibuffer even if it is active. 125minibuffer even if it is active.
126 126
@@ -165,7 +165,7 @@ value is returned. If no window satisfies PREDICATE, DEFAULT is
165returned. 165returned.
166 166
167Optional second arg MINIBUF t means count the minibuffer window even 167Optional second arg MINIBUF t means count the minibuffer window even
168if not active. MINIBUF nil or omitted means count the minibuffer iff 168if not active. MINIBUF nil or omitted means count the minibuffer only if
169it is active. MINIBUF neither t nor nil means not to count the 169it is active. MINIBUF neither t nor nil means not to count the
170minibuffer even if it is active. 170minibuffer even if it is active.
171 171
@@ -927,7 +927,7 @@ means suspend autoselection."
927(defun mouse-autoselect-window-select () 927(defun mouse-autoselect-window-select ()
928 "Select window with delayed window autoselection. 928 "Select window with delayed window autoselection.
929If the mouse position has stabilized in a non-selected window, select 929If the mouse position has stabilized in a non-selected window, select
930that window. The minibuffer window is selected iff the minibuffer is 930that window. The minibuffer window is selected only if the minibuffer is
931active. This function is run by `mouse-autoselect-window-timer'." 931active. This function is run by `mouse-autoselect-window-timer'."
932 (condition-case nil 932 (condition-case nil
933 (let* ((mouse-position (mouse-position)) 933 (let* ((mouse-position (mouse-position))
@@ -952,14 +952,14 @@ active. This function is run by `mouse-autoselect-window-timer'."
952 ;; If `mouse-autoselect-window' is positive, select 952 ;; If `mouse-autoselect-window' is positive, select
953 ;; window if the window is the same as before. 953 ;; window if the window is the same as before.
954 (eq window mouse-autoselect-window-window)) 954 (eq window mouse-autoselect-window-window))
955 ;; Otherwise select window iff the mouse is at the same 955 ;; Otherwise select window if the mouse is at the same
956 ;; position as before. Observe that the first test after 956 ;; position as before. Observe that the first test after
957 ;; starting autoselection usually fails since the value of 957 ;; starting autoselection usually fails since the value of
958 ;; `mouse-autoselect-window-position' recorded there is the 958 ;; `mouse-autoselect-window-position' recorded there is the
959 ;; position where the mouse has entered the new window and 959 ;; position where the mouse has entered the new window and
960 ;; not necessarily where the mouse has stopped moving. 960 ;; not necessarily where the mouse has stopped moving.
961 (equal mouse-position mouse-autoselect-window-position)) 961 (equal mouse-position mouse-autoselect-window-position))
962 ;; The minibuffer is a candidate window iff it's active. 962 ;; The minibuffer is a candidate window if it's active.
963 (or (not (window-minibuffer-p window)) 963 (or (not (window-minibuffer-p window))
964 (eq window (active-minibuffer-window)))) 964 (eq window (active-minibuffer-window))))
965 ;; Mouse position has stabilized in non-selected window: Cancel 965 ;; Mouse position has stabilized in non-selected window: Cancel
diff --git a/lisp/winner.el b/lisp/winner.el
index bc7503b963c..ed840d37622 100644
--- a/lisp/winner.el
+++ b/lisp/winner.el
@@ -5,7 +5,6 @@
5 5
6;; Author: Ivar Rummelhoff <ivarru@math.uio.no> 6;; Author: Ivar Rummelhoff <ivarru@math.uio.no>
7;; Created: 27 Feb 1997 7;; Created: 27 Feb 1997
8;; Time-stamp: <2006-02-06 15:13:57 ttn>
9;; Keywords: convenience frames 8;; Keywords: convenience frames
10 9
11;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -286,7 +285,7 @@ You may want to include buffer names such as *Help*, *Apropos*,
286 285
287(defun winner-get-point (buf win) 286(defun winner-get-point (buf win)
288 ;; Consult (and possibly extend) `winner-point-alist'. 287 ;; Consult (and possibly extend) `winner-point-alist'.
289 ;; Returns nil iff buf no longer exists. 288 ;; Returns nil if buf no longer exists.
290 (when (buffer-name buf) 289 (when (buffer-name buf)
291 (let ((entry (assq buf winner-point-alist))) 290 (let ((entry (assq buf winner-point-alist)))
292 (cond 291 (cond
@@ -306,7 +305,7 @@ You may want to include buffer names such as *Help*, *Apropos*,
306 305
307;; Make sure point does not end up in the minibuffer and delete 306;; Make sure point does not end up in the minibuffer and delete
308;; windows displaying dead or boring buffers 307;; windows displaying dead or boring buffers
309;; (c.f. `winner-boring-buffers'). Return nil iff all the windows 308;; (c.f. `winner-boring-buffers'). Return nil if all the windows
310;; should be deleted. Preserve correct points and marks. 309;; should be deleted. Preserve correct points and marks.
311(defun winner-set (conf) 310(defun winner-set (conf)
312 ;; For the format of `conf', see `winner-conf'. 311 ;; For the format of `conf', see `winner-conf'.
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index cefce2f62e7..af7a3789df0 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -195,7 +195,8 @@
195;;;###autoload 195;;;###autoload
196(define-minor-mode xterm-mouse-mode 196(define-minor-mode xterm-mouse-mode
197 "Toggle XTerm mouse mode. 197 "Toggle XTerm mouse mode.
198With prefix arg, turn XTerm mouse mode on iff arg is positive. 198With prefix arg, turn XTerm mouse mode on if arg is positive, otherwise turn
199it off.
199 200
200Turn it on to use Emacs mouse commands, and off to use xterm mouse commands. 201Turn it on to use Emacs mouse commands, and off to use xterm mouse commands.
201This works in terminal emulators compatible with xterm. It only 202This works in terminal emulators compatible with xterm. It only
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index cf110147ad8..75d40dbd19c 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,21 @@
12007-08-08 Martin Rudalics <rudalics@gmx.at>
2
3 * modes.texi (Example Major Modes): Fix typo.
4
52007-08-08 Glenn Morris <rgm@gnu.org>
6
7 * intro.texi (nil and t): Do not use `iff' in documentation.
8
9 * tips.texi (Documentation Tips): Recommend against `iff'.
10
112007-08-07 Chong Yidong <cyd@stupidchicken.com>
12
13 * display.texi (Image Cache): Document image-refresh.
14
152007-08-06 Martin Rudalics <rudalics@gmx.at>
16
17 * windows.texi (Size of Window): Document window-full-width-p.
18
12007-07-25 Glenn Morris <rgm@gnu.org> 192007-07-25 Glenn Morris <rgm@gnu.org>
2 20
3 * gpl.texi (GPL): Replace license with GPLv3. 21 * gpl.texi (GPL): Replace license with GPLv3.
diff --git a/lispref/intro.texi b/lispref/intro.texi
index 35566603b7c..ed0fd1c0699 100644
--- a/lispref/intro.texi
+++ b/lispref/intro.texi
@@ -213,7 +213,7 @@ values results in a @code{setting-constant} error. @xref{Constant
213Variables}. 213Variables}.
214 214
215@defun booleanp object 215@defun booleanp object
216Return non-nil iff @var{object} is one of the two canonical boolean 216Return non-nil if @var{object} is one of the two canonical boolean
217values: @code{t} or @code{nil}. 217values: @code{t} or @code{nil}.
218@end defun 218@end defun
219 219
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 95fbe6a292f..3d60756a901 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -1078,7 +1078,7 @@ each calls the following function to set various variables:
1078 1078
1079 In Lisp and most programming languages, we want the paragraph 1079 In Lisp and most programming languages, we want the paragraph
1080commands to treat only blank lines as paragraph separators. And the 1080commands to treat only blank lines as paragraph separators. And the
1081modes should undestand the Lisp conventions for comments. The rest of 1081modes should understand the Lisp conventions for comments. The rest of
1082@code{lisp-mode-variables} sets this up: 1082@code{lisp-mode-variables} sets this up:
1083 1083
1084@smallexample 1084@smallexample
diff --git a/lispref/tips.texi b/lispref/tips.texi
index de590c4cf9d..f3070f4659b 100644
--- a/lispref/tips.texi
+++ b/lispref/tips.texi
@@ -845,6 +845,12 @@ Instead of, ``Cause Emacs to display text in boldface,'' write just
845``Display text in boldface.'' 845``Display text in boldface.''
846 846
847@item 847@item
848Avoid using ``iff'' (a mathematics term meaning ``if and only if''),
849since many people are unfamiliar with it and mistake it for a typo. In
850most cases, the meaning is clear with just ``if''. Otherwise, try to
851find an alternate phrasing that conveys the meaning.
852
853@item
848When a command is meaningful only in a certain mode or situation, 854When a command is meaningful only in a certain mode or situation,
849do mention that in the documentation string. For example, 855do mention that in the documentation string. For example,
850the documentation of @code{dired-find-file} is: 856the documentation of @code{dired-find-file} is:
diff --git a/lispref/windows.texi b/lispref/windows.texi
index 22bb43ecaa0..bd8f7bc2d36 100644
--- a/lispref/windows.texi
+++ b/lispref/windows.texi
@@ -1887,6 +1887,12 @@ If @var{window} is @code{nil}, the function uses the selected window.
1887@end example 1887@end example
1888@end defun 1888@end defun
1889 1889
1890@defun window-full-width-p &optional window
1891This function returns non-@code{nil} if @var{window} is as wide as
1892the frame that contains it; otherwise @code{nil}.
1893If @var{window} is @code{nil}, the function uses the selected window.
1894@end defun
1895
1890@defun window-edges &optional window 1896@defun window-edges &optional window
1891This function returns a list of the edge coordinates of @var{window}. 1897This function returns a list of the edge coordinates of @var{window}.
1892If @var{window} is @code{nil}, the selected window is used. 1898If @var{window} is @code{nil}, the selected window is used.
diff --git a/mac/inc/m-mac.h b/mac/inc/m-mac.h
index a5a26cd000c..57bb0976b69 100644
--- a/mac/inc/m-mac.h
+++ b/mac/inc/m-mac.h
@@ -25,7 +25,7 @@ Boston, MA 02110-1301, USA. */
25 operating system this machine is likely to run. 25 operating system this machine is likely to run.
26 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ 26 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
27 27
28/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 28/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
29 is the most significant byte. */ 29 is the most significant byte. */
30 30
31#define WORDS_BIG_ENDIAN 31#define WORDS_BIG_ENDIAN
diff --git a/man/ChangeLog b/man/ChangeLog
index 18cd4b72bc6..2395e82fdbb 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,8 +1,26 @@
12007-08-10 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus.texi (NNTP): Mention nntp-xref-number-is-evil.
4
52007-08-08 Glenn Morris <rgm@gnu.org>
6
7 * glossary.texi (Glossary): Deprecate `iff'.
8 * gnus.texi, sieve.texi: Replace `iff'.
9
102007-08-07 Chong Yidong <cyd@stupidchicken.com>
11
12 * files.texi (File Conveniences): Document point motion keys in Image
13 mode.
14
12007-08-03 Jay Belanger <jay.p.belanger@gmail.com> 152007-08-03 Jay Belanger <jay.p.belanger@gmail.com>
2 16
3 * calc.texi (Basic Graphics): Mention the graphing of error 17 * calc.texi (Basic Graphics): Mention the graphing of error
4 forms. 18 forms.
5 (Graphics Options): Mention how `g s' handles error forms. 19 (Graphics Options): Mention how `g s' handles error forms.
20 (Curve Fitting): Mention plotting the curves.
21 (Standard Nonlinear Models): Add additional models.
22 (Curve Fitting Details): Mention the Levenberg-Marquardt method.
23 (Linear Fits): Correct result.
6 24
72007-08-01 Alan Mackenzie <acm@muc.de> 252007-08-01 Alan Mackenzie <acm@muc.de>
8 26
diff --git a/man/calc.texi b/man/calc.texi
index 9e50629a3b2..e13dd9097d6 100644
--- a/man/calc.texi
+++ b/man/calc.texi
@@ -23962,7 +23962,13 @@ such as @expr{y = m x + b} where @expr{m} and @expr{b} are parameters
23962to be determined. For a typical set of measured data there will be 23962to be determined. For a typical set of measured data there will be
23963no single @expr{m} and @expr{b} that exactly fit the data; in this 23963no single @expr{m} and @expr{b} that exactly fit the data; in this
23964case, Calc chooses values of the parameters that provide the closest 23964case, Calc chooses values of the parameters that provide the closest
23965possible fit. 23965possible fit. The model formula can be entered in various ways after
23966the key sequence @kbd{a F} is pressed.
23967
23968If the letter @kbd{P} is pressed after @kbd{a F} but before the model
23969description is entered, the data as well as the model formula will be
23970plotted after the formula is determined. This will be indicated by a
23971``P'' in the minibuffer after the help message.
23966 23972
23967@menu 23973@menu
23968* Linear Fits:: 23974* Linear Fits::
@@ -24055,7 +24061,7 @@ $$
24055@noindent 24061@noindent
24056is on the stack and we wish to do a simple linear fit. Type 24062is on the stack and we wish to do a simple linear fit. Type
24057@kbd{a F}, then @kbd{1} for the model, then @key{RET} to use 24063@kbd{a F}, then @kbd{1} for the model, then @key{RET} to use
24058the default names. The result will be the formula @expr{3 + 2 x} 24064the default names. The result will be the formula @expr{3. + 2. x}
24059on the stack. Calc has created the model expression @kbd{a + b x}, 24065on the stack. Calc has created the model expression @kbd{a + b x},
24060then found the optimal values of @expr{a} and @expr{b} to fit the 24066then found the optimal values of @expr{a} and @expr{b} to fit the
24061data. (In this case, it was able to find an exact fit.) Calc then 24067data. (In this case, it was able to find an exact fit.) Calc then
@@ -24245,6 +24251,8 @@ case, the model might be @expr{a x + b y + c z}; and in the polynomial
24245case, the model could be @expr{a x + b x^2 + c x^3}. You can get 24251case, the model could be @expr{a x + b x^2 + c x^3}. You can get
24246a homogeneous linear or multilinear model by pressing the letter 24252a homogeneous linear or multilinear model by pressing the letter
24247@kbd{h} followed by a regular model key, like @kbd{1} or @kbd{2}. 24253@kbd{h} followed by a regular model key, like @kbd{1} or @kbd{2}.
24254This will be indicated by an ``h'' in the minibuffer after the help
24255message.
24248 24256
24249It is certainly possible to have other constrained linear models, 24257It is certainly possible to have other constrained linear models,
24250like @expr{2.3 + a x} or @expr{a - 4 x}. While there is no single 24258like @expr{2.3 + a x} or @expr{a - 4 x}. While there is no single
@@ -24454,6 +24462,18 @@ Quadratic. @mathit{a + b (x-c)^2 + d (x-e)^2}.
24454Gaussian. 24462Gaussian.
24455@texline @math{{a \over b \sqrt{2 \pi}} \exp\left( -{1 \over 2} \left( x - c \over b \right)^2 \right)}. 24463@texline @math{{a \over b \sqrt{2 \pi}} \exp\left( -{1 \over 2} \left( x - c \over b \right)^2 \right)}.
24456@infoline @mathit{(a / b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)}. 24464@infoline @mathit{(a / b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)}.
24465@item s
24466Logistic @emph{s} curve.
24467@texline @math{a/(1+e^{b(x-c)})}.
24468@infoline @mathit{a/(1 + exp(b (x - c)))}.
24469@item b
24470Logistic bell curve.
24471@texline @math{ae^{b(x-c)}/(1+e^{b(x-c)})^2}.
24472@infoline @mathit{a exp(b (x - c))/(1 + exp(b (x - c)))^2}.
24473@item o
24474Hubbert linearization.
24475@texline @math{{y \over x} = a(1-x/b)}.
24476@infoline @mathit{(y/x) = a (1 - x/b)}.
24457@end table 24477@end table
24458 24478
24459All of these models are used in the usual way; just press the appropriate 24479All of these models are used in the usual way; just press the appropriate
@@ -24462,8 +24482,9 @@ result will be a formula as shown in the above table, with the best-fit
24462values of the parameters substituted. (You may find it easier to read 24482values of the parameters substituted. (You may find it easier to read
24463the parameter values from the vector that is placed in the trail.) 24483the parameter values from the vector that is placed in the trail.)
24464 24484
24465All models except Gaussian and polynomials can generalize as shown to any 24485All models except Gaussian, logistics, Hubbert and polynomials can
24466number of independent variables. Also, all the built-in models have an 24486generalize as shown to any number of independent variables. Also, all
24487the built-in models except for the logistic and Hubbert curves have an
24467additive or multiplicative parameter shown as @expr{a} in the above table 24488additive or multiplicative parameter shown as @expr{a} in the above table
24468which can be replaced by zero or one, as appropriate, by typing @kbd{h} 24489which can be replaced by zero or one, as appropriate, by typing @kbd{h}
24469before the model key. 24490before the model key.
@@ -24603,7 +24624,7 @@ to convert the model into this form. For example, if the model
24603is @expr{a + b x + c x^2}, then @expr{f(x) = 1}, @expr{g(x) = x}, 24624is @expr{a + b x + c x^2}, then @expr{f(x) = 1}, @expr{g(x) = x},
24604and @expr{h(x) = x^2} are suitable functions. 24625and @expr{h(x) = x^2} are suitable functions.
24605 24626
24606For other models, Calc uses a variety of algebraic manipulations 24627For most other models, Calc uses a variety of algebraic manipulations
24607to try to put the problem into the form 24628to try to put the problem into the form
24608 24629
24609@smallexample 24630@smallexample
@@ -24662,7 +24683,12 @@ The Gaussian model looks quite complicated, but a closer examination
24662shows that it's actually similar to the quadratic model but with an 24683shows that it's actually similar to the quadratic model but with an
24663exponential that can be brought to the top and moved into @expr{Y}. 24684exponential that can be brought to the top and moved into @expr{Y}.
24664 24685
24665An example of a model that cannot be put into general linear 24686The logistic models cannot be put into general linear form. For these
24687models, and the Hubbert linearization, Calc computes a rough
24688approximation for the parameters, then uses the Levenberg-Marquardt
24689iterative method to refine the approximations.
24690
24691Another model that cannot be put into general linear
24666form is a Gaussian with a constant background added on, i.e., 24692form is a Gaussian with a constant background added on, i.e.,
24667@expr{d} + the regular Gaussian formula. If you have a model like 24693@expr{d} + the regular Gaussian formula. If you have a model like
24668this, your best bet is to replace enough of your parameters with 24694this, your best bet is to replace enough of your parameters with
diff --git a/man/files.texi b/man/files.texi
index 747b0dba806..7ba36916684 100644
--- a/man/files.texi
+++ b/man/files.texi
@@ -2898,7 +2898,10 @@ point. Partial Completion mode offers other features extending
2898mode allows you to toggle between displaying the file as an image in 2898mode allows you to toggle between displaying the file as an image in
2899the Emacs buffer, and displaying its underlying text representation, 2899the Emacs buffer, and displaying its underlying text representation,
2900using the command @kbd{C-c C-c} (@code{image-toggle-display}). This 2900using the command @kbd{C-c C-c} (@code{image-toggle-display}). This
2901works only when Emacs can display the specific image type. 2901works only when Emacs can display the specific image type. If the
2902displayed image is wider or taller than the frame, the usual point
2903motion keys (@kbd{C-f}, @kbd{C-p}, and so forth) cause different parts
2904of the image to be displayed.
2902 2905
2903@findex thumbs-mode 2906@findex thumbs-mode
2904@findex mode, thumbs 2907@findex mode, thumbs
diff --git a/man/glossary.texi b/man/glossary.texi
index d082e6ec077..f289c2ca1cb 100644
--- a/man/glossary.texi
+++ b/man/glossary.texi
@@ -603,7 +603,8 @@ Hyper}.
603 603
604@item Iff 604@item Iff
605``Iff'' means ``if and only if.'' This terminology comes from 605``Iff'' means ``if and only if.'' This terminology comes from
606mathematics. 606mathematics. Try to avoid using this term in documentation, since
607many are unfamiliar with it and mistake it for a typo.
607 608
608@item Inbox 609@item Inbox
609An inbox is a file in which mail is delivered by the operating system. 610An inbox is a file in which mail is delivered by the operating system.
diff --git a/man/gnus.texi b/man/gnus.texi
index fe26aa5f662..94144b65e3f 100644
--- a/man/gnus.texi
+++ b/man/gnus.texi
@@ -12945,6 +12945,34 @@ network is fast, setting this variable to a really small number means
12945that fetching will probably be slower. If this variable is @code{nil}, 12945that fetching will probably be slower. If this variable is @code{nil},
12946@code{nntp} will never split requests. The default is 5. 12946@code{nntp} will never split requests. The default is 5.
12947 12947
12948@item nntp-xref-number-is-evil
12949@vindex nntp-xref-number-is-evil
12950When Gnus refers to an article having the @code{Message-ID} that a user
12951specifies or having the @code{Message-ID} of the parent article of the
12952current one (@pxref{Finding the Parent}), Gnus sends a @code{HEAD}
12953command to the @acronym{NNTP} server to know where it is, and the server
12954returns the data containing the pairs of a group and an article number
12955in the @code{Xref} header. Gnus normally uses the article number to
12956refer to the article if the data shows that that article is in the
12957current group, while it uses the @code{Message-ID} otherwise. However,
12958some news servers, e.g., ones running Diablo, run multiple engines
12959having the same articles but article numbers are not kept synchronized
12960between them. In that case, the article number that appears in the
12961@code{Xref} header varies by which engine is chosen, so you cannot refer
12962to the parent article that is in the current group, for instance. If
12963you connect to such a server, set this variable to a non-@code{nil}
12964value, and Gnus never uses article numbers. For example:
12965
12966@lisp
12967(setq gnus-select-method
12968 '(nntp "newszilla"
12969 (nntp-address "newszilla.example.com")
12970 (nntp-xref-number-is-evil t)
12971 @dots{}))
12972@end lisp
12973
12974The default value of this server variable is @code{nil}.
12975
12948@item nntp-prepare-server-hook 12976@item nntp-prepare-server-hook
12949@vindex nntp-prepare-server-hook 12977@vindex nntp-prepare-server-hook
12950A hook run before attempting to connect to an @acronym{NNTP} server. 12978A hook run before attempting to connect to an @acronym{NNTP} server.
@@ -18595,23 +18623,23 @@ predicate to individual groups.
18595 18623
18596@table @code 18624@table @code
18597@item short 18625@item short
18598True iff the article is shorter than @code{gnus-agent-short-article} 18626True if the article is shorter than @code{gnus-agent-short-article}
18599lines; default 100. 18627lines; default 100.
18600 18628
18601@item long 18629@item long
18602True iff the article is longer than @code{gnus-agent-long-article} 18630True if the article is longer than @code{gnus-agent-long-article}
18603lines; default 200. 18631lines; default 200.
18604 18632
18605@item low 18633@item low
18606True iff the article has a download score less than 18634True if the article has a download score less than
18607@code{gnus-agent-low-score}; default 0. 18635@code{gnus-agent-low-score}; default 0.
18608 18636
18609@item high 18637@item high
18610True iff the article has a download score greater than 18638True if the article has a download score greater than
18611@code{gnus-agent-high-score}; default 0. 18639@code{gnus-agent-high-score}; default 0.
18612 18640
18613@item spam 18641@item spam
18614True iff the Gnus Agent guesses that the article is spam. The 18642True if the Gnus Agent guesses that the article is spam. The
18615heuristics may change over time, but at present it just computes a 18643heuristics may change over time, but at present it just computes a
18616checksum and sees whether articles match. 18644checksum and sees whether articles match.
18617 18645
@@ -26651,7 +26679,7 @@ New @file{make.bat} for compiling and installing Gnus under MS Windows
26651 26679
26652Use @file{make.bat} if you want to install Gnus under MS Windows, the 26680Use @file{make.bat} if you want to install Gnus under MS Windows, the
26653first argument to the batch-program should be the directory where 26681first argument to the batch-program should be the directory where
26654@file{xemacs.exe} respectively @file{emacs.exe} is located, iff you want 26682@file{xemacs.exe} respectively @file{emacs.exe} is located, if you want
26655to install Gnus after compiling it, give @file{make.bat} @code{/copy} as 26683to install Gnus after compiling it, give @file{make.bat} @code{/copy} as
26656the second parameter. 26684the second parameter.
26657 26685
@@ -27008,7 +27036,7 @@ The envelope sender address can be customized when using Sendmail.
27008@item 27036@item
27009Gnus no longer generate the Sender: header automatically. 27037Gnus no longer generate the Sender: header automatically.
27010 27038
27011Earlier it was generated iff the user configurable email address was 27039Earlier it was generated when the user configurable email address was
27012different from the Gnus guessed default user address. As the guessing 27040different from the Gnus guessed default user address. As the guessing
27013algorithm is rarely correct these days, and (more controversially) the 27041algorithm is rarely correct these days, and (more controversially) the
27014only use of the Sender: header was to check if you are entitled to 27042only use of the Sender: header was to check if you are entitled to
diff --git a/man/sieve.texi b/man/sieve.texi
index 1030babd593..4b7a95be952 100644
--- a/man/sieve.texi
+++ b/man/sieve.texi
@@ -307,7 +307,7 @@ Authenticate to the server.
307 307
308@item sieve-manage-capability 308@item sieve-manage-capability
309@findex sieve-manage-capability 309@findex sieve-manage-capability
310Return a list of capabilities the server support. 310Return a list of capabilities the server supports.
311 311
312@item sieve-manage-listscripts 312@item sieve-manage-listscripts
313@findex sieve-manage-listscripts 313@findex sieve-manage-listscripts
@@ -315,7 +315,7 @@ List scripts on the server.
315 315
316@item sieve-manage-havespace 316@item sieve-manage-havespace
317@findex sieve-manage-havespace 317@findex sieve-manage-havespace
318Returns non-@code{nil} iff server have roam for a script of given 318Return non-@code{nil} if the server has room for a script of given
319size. 319size.
320 320
321@item sieve-manage-getscript 321@item sieve-manage-getscript
diff --git a/src/ChangeLog b/src/ChangeLog
index 87376db4e7f..e3c212924b3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,131 @@
12007-08-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (update_frame_tool_bar): Use -1 as index
4 to gtk_toolbar_insert.
5
62007-08-13 Stefan Monnier <monnier@iro.umontreal.ca>
7
8 * fileio.c (Finsert_file_contents): Yet Another Int/Lisp_Object Mixup.
9
10 * insdel.c (reset_var_on_error): New fun.
11 (signal_before_change, signal_after_change):
12 Use it to reset (after|before)-change-functions to nil in case of error.
13 Bind inhibit-modification-hooks to t.
14 Don't bind (after|before)-change-functions to nil while they run.
15
162007-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17
18 * xterm.c (x_draw_image_glyph_string): Adjust stipple origin when
19 filling pixmap with stippled background.
20
212007-08-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
22
23 * macterm.c [TARGET_API_MAC_CARBON] (mac_handle_window_event):
24 Don't use invisible frame as parent window for repositioning.
25
262007-08-10 Stefan Monnier <monnier@iro.umontreal.ca>
27
28 * print.c (new_backquote_output): Rename from old_backquote_output.
29 (print): Inverse its logic (according to its name) so as to match the
30 behavior of new_backquote_flag in lread.c.
31
322007-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
33
34 * gmalloc.c (posix_memalign): New function.
35
36 * macterm.c (frame_highlight, frame_unhighlight): Don't call
37 ActivateControl/DeactivateControl here.
38 [USE_MAC_TOOLBAR] (free_frame_tool_bar): Suppress animation when
39 frame-notice-user-settings is non-nil.
40 [USE_MAC_FONT_PANEL] (mac_handle_font_event): Also record parameter
41 for kEventParamFMFontStyle.
42 [TARGET_API_MAC_CARBON] (mac_handle_keyboard_event): Don't check
43 mac_pass_command_to_system and mac_pass_control_to_system here.
44 (XTread_socket): Call ActivateControl/DeactivateControl here.
45 (XTread_socket) [TARGET_API_MAC_CARBON]:
46 Check mac_pass_command_to_system and mac_pass_control_to_system here.
47 (mac_handle_window_event) [USE_MAC_TOOLBAR]: Add further workaround
48 for window repositioning.
49
502007-08-08 Glenn Morris <rgm@gnu.org>
51
52 * Replace `iff' in doc-strings and comments.
53
542007-08-07 Chong Yidong <cyd@stupidchicken.com>
55
56 * xdisp.c (move_it_by_lines): Remove incorrect optimization.
57
582007-08-07 Martin Rudalics <rudalics@gmx.at>
59
60 * fileio.c (Finsert_file_contents): Run format-decode and
61 after_insert_file_functions on entire buffer when REPLACE is
62 non-nil and inhibit modification_hooks and point_motion_hooks.
63 For consistency, run after_insert_file_functions iff something
64 got inserted. Move signal_after_change and update_compositions
65 after code running after_insert_file_functions. Make sure that
66 undo_list doesn't record intermediate steps of the decoding
67 process.
68
692007-08-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
70
71 * emacs.c (main)
72 [HAVE_GTK_AND_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
73 Call malloc_enable_thread on interactive startup.
74
75 * gmalloc.c (_malloc_thread_enabled_p) [USE_PTHREAD]: New variable.
76 (LOCK, UNLOCK, LOCK_ALIGNED_BLOCKS, UNLOCK_ALIGNED_BLOCKS)
77 [USE_PTHREAD]: Conditionalize with it.
78 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
79 (malloc_atfork_handler_child, malloc_enable_thread) [USE_PTHREAD]:
80 New functions.
81
822007-08-06 Chong Yidong <cyd@stupidchicken.com>
83
84 * xdisp.c (redisplay_window): When restoring original buffer
85 position, make sure it is still valid.
86
87 * image.c (png_load): Ignore png-supplied background color.
88
892007-08-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
90
91 * mac.c [TARGET_API_MAC_CARBON] (cfdate_to_lisp): Obtain microsec value.
92 Use kCFAbsoluteTimeIntervalSince1970.
93
94 * macmenu.c (quit_dialog_event_loop) [TARGET_API_MAC_CARBON]:
95 New variable.
96 [TARGET_API_MAC_CARBON] (mac_handle_dialog_event): Set it if dialog
97 event loop should be quit.
98 [TARGET_API_MAC_CARBON] (create_and_show_dialog) [!MAC_OSX]:
99 Quit dialog event loop if quit_dialog_event_loop is set.
100
101 * macselect.c [!TARGET_API_MAC_CARBON]: Include Scrap.h.
102 (Selection): New typedef. Use instead of ScrapRef.
103 (mac_get_selection_from_symbol): Rename from get_scrap_from_symbol.
104 (mac_valid_selection_target_p): Rename from valid_scrap_target_type_p.
105 (mac_clear_selection): Rename from clear_scrap.
106 (get_flavor_type_from_symbol): New argument SEL and subsume function of
107 scrap_has_target_type. All uses changed.
108 (mac_get_selection_ownership_info, mac_valid_selection_value_p)
109 (mac_selection_has_target_p): New functions.
110 (mac_put_selection_value): Rename from put_scrap_string.
111 (mac_get_selection_value): Rename from get_scrap_string.
112 (mac_get_selection_target_list): Rename from get_scrap_target_type_list.
113 (put_scrap_private_timestamp, scrap_has_target_type)
114 (get_scrap_private_timestamp): Remove functions.
115 (SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP): Remove define.
116 (x_own_selection, x_get_local_selection):
117 Use mac_valid_selection_value_p.
118 (x_own_selection): Don't use put_scrap_private_timestamp.
119 Record OWNERSHIP-INFO into Vselection_alist instead.
120 (x_get_local_selection): Don't check type if request is local.
121 (Fx_selection_owner_p): Don't use get_scrap_private_timestamp.
122 Detect ownership change with OWNERSHIP-INFO in Vselection_alist instead.
123
1242007-08-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
125
126 * gtkutil.c (xg_tool_bar_callback): Generate two TOOL_BAR_EVENT:s,
127 add comment explaining why.
128
12007-08-03 Richard Stallman <rms@gnu.org> 1292007-08-03 Richard Stallman <rms@gnu.org>
2 130
3 * fileio.c (Fvisited_file_modtime): Use make_time. 131 * fileio.c (Fvisited_file_modtime): Use make_time.
diff --git a/src/buffer.h b/src/buffer.h
index 65cfef4f04f..ed99dc4ffb1 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -561,7 +561,7 @@ struct buffer
561 Lisp_Object filename; 561 Lisp_Object filename;
562 /* Dir for expanding relative file names. */ 562 /* Dir for expanding relative file names. */
563 Lisp_Object directory; 563 Lisp_Object directory;
564 /* True iff this buffer has been backed up (if you write to the 564 /* True if this buffer has been backed up (if you write to the
565 visited file and it hasn't been backed up, then a backup will 565 visited file and it hasn't been backed up, then a backup will
566 be made). */ 566 be made). */
567 /* This isn't really used by the C code, so could be deleted. */ 567 /* This isn't really used by the C code, so could be deleted. */
diff --git a/src/callproc.c b/src/callproc.c
index 65a75d685a5..5bd4cee9cfa 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -119,7 +119,7 @@ Lisp_Object Vprocess_environment;
119Lisp_Object Qbuffer_file_type; 119Lisp_Object Qbuffer_file_type;
120#endif /* DOS_NT */ 120#endif /* DOS_NT */
121 121
122/* True iff we are about to fork off a synchronous process or if we 122/* True if we are about to fork off a synchronous process or if we
123 are waiting for it. */ 123 are waiting for it. */
124int synch_process_alive; 124int synch_process_alive;
125 125
diff --git a/src/casetab.c b/src/casetab.c
index bf0e022f139..952a320dda3 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -40,7 +40,7 @@ static void set_identity ();
40static void shuffle (); 40static void shuffle ();
41 41
42DEFUN ("case-table-p", Fcase_table_p, Scase_table_p, 1, 1, 0, 42DEFUN ("case-table-p", Fcase_table_p, Scase_table_p, 1, 1, 0,
43 doc: /* Return t iff OBJECT is a case table. 43 doc: /* Return t if OBJECT is a case table.
44See `set-case-table' for more information on these data structures. */) 44See `set-case-table' for more information on these data structures. */)
45 (object) 45 (object)
46 Lisp_Object object; 46 Lisp_Object object;
diff --git a/src/category.c b/src/category.c
index 55e752045e7..7ea9b7810fa 100644
--- a/src/category.c
+++ b/src/category.c
@@ -559,7 +559,7 @@ syms_of_category ()
559 doc: /* List of pair (cons) of categories to determine word boundary. 559 doc: /* List of pair (cons) of categories to determine word boundary.
560 560
561Emacs treats a sequence of word constituent characters as a single 561Emacs treats a sequence of word constituent characters as a single
562word (i.e. finds no word boundary between them) iff they belongs to 562word (i.e. finds no word boundary between them) only if they belong to
563the same charset. But, exceptions are allowed in the following cases. 563the same charset. But, exceptions are allowed in the following cases.
564 564
565\(1) The case that characters are in different charsets is controlled 565\(1) The case that characters are in different charsets is controlled
diff --git a/src/ccl.c b/src/ccl.c
index c25e67abf57..564fd4ba4fa 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -659,13 +659,13 @@ while (0)
659 659
660#define CCL_LookupIntConstTbl 0x13 /* Lookup multibyte character by 660#define CCL_LookupIntConstTbl 0x13 /* Lookup multibyte character by
661 integer key. Afterwards R7 set 661 integer key. Afterwards R7 set
662 to 1 iff lookup succeeded. 662 to 1 if lookup succeeded.
663 1:ExtendedCOMMNDRrrRRRXXXXXXXX 663 1:ExtendedCOMMNDRrrRRRXXXXXXXX
664 2:ARGUMENT(Hash table ID) */ 664 2:ARGUMENT(Hash table ID) */
665 665
666#define CCL_LookupCharConstTbl 0x14 /* Lookup integer by multibyte 666#define CCL_LookupCharConstTbl 0x14 /* Lookup integer by multibyte
667 character key. Afterwards R7 set 667 character key. Afterwards R7 set
668 to 1 iff lookup succeeded. 668 to 1 if lookup succeeded.
669 1:ExtendedCOMMNDRrrRRRrrrXXXXX 669 1:ExtendedCOMMNDRrrRRRrrrXXXXX
670 2:ARGUMENT(Hash table ID) */ 670 2:ARGUMENT(Hash table ID) */
671 671
diff --git a/src/charset.c b/src/charset.c
index a6ec309cbb3..1a85cd39c72 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -337,7 +337,7 @@ split_string (str, len, charset, c1, c2)
337 return 0; 337 return 0;
338} 338}
339 339
340/* Return 1 iff character C has valid printable glyph. 340/* Return 1 if character C has valid printable glyph.
341 Use the macro CHAR_PRINTABLE_P instead. */ 341 Use the macro CHAR_PRINTABLE_P instead. */
342int 342int
343char_printable_p (c) 343char_printable_p (c)
@@ -1102,8 +1102,8 @@ DIMENSION, CHARS, and FINAL-CHAR. */)
1102 return CHARSET_SYMBOL (charset); 1102 return CHARSET_SYMBOL (charset);
1103} 1103}
1104 1104
1105/* If GENERICP is nonzero, return nonzero iff C is a valid normal or 1105/* If GENERICP is nonzero, return nonzero if C is a valid normal or
1106 generic character. If GENERICP is zero, return nonzero iff C is a 1106 generic character. If GENERICP is zero, return nonzero if C is a
1107 valid normal character. Do not call this function directly, 1107 valid normal character. Do not call this function directly,
1108 instead use macro CHAR_VALID_P. */ 1108 instead use macro CHAR_VALID_P. */
1109int 1109int
diff --git a/src/charset.h b/src/charset.h
index 984d466d97d..c20766f910b 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -413,8 +413,8 @@ extern int width_by_char_head[256];
413 | ((c1) <= 0 ? 0 : (((c1) & 0x7F) << 7)))))) 413 | ((c1) <= 0 ? 0 : (((c1) & 0x7F) << 7))))))
414 414
415 415
416/* If GENERICP is nonzero, return nonzero iff C is a valid normal or 416/* If GENERICP is nonzero, return nonzero if C is a valid normal or
417 generic character. If GENERICP is zero, return nonzero iff C is a 417 generic character. If GENERICP is zero, return nonzero if C is a
418 valid normal character. */ 418 valid normal character. */
419#define CHAR_VALID_P(c, genericp) \ 419#define CHAR_VALID_P(c, genericp) \
420 ((c) >= 0 \ 420 ((c) >= 0 \
@@ -450,7 +450,7 @@ extern int width_by_char_head[256];
450#define VALID_LEADING_CODE_P(code) \ 450#define VALID_LEADING_CODE_P(code) \
451 (! NILP (CHARSET_TABLE_ENTRY (code))) 451 (! NILP (CHARSET_TABLE_ENTRY (code)))
452 452
453/* Return 1 iff the byte sequence at unibyte string STR (LENGTH bytes) 453/* Return 1 if the byte sequence at unibyte string STR (LENGTH bytes)
454 is valid as a multibyte form. If valid, by a side effect, BYTES is 454 is valid as a multibyte form. If valid, by a side effect, BYTES is
455 set to the byte length of the multibyte form. */ 455 set to the byte length of the multibyte form. */
456 456
@@ -471,7 +471,7 @@ extern int width_by_char_head[256];
471 && VALID_LEADING_CODE_P (str[1])))))))) 471 && VALID_LEADING_CODE_P (str[1]))))))))
472 472
473 473
474/* Return 1 iff the byte sequence at multibyte string STR is valid as 474/* Return 1 if the byte sequence at multibyte string STR is valid as
475 a unibyte form. By a side effect, BYTES is set to the byte length 475 a unibyte form. By a side effect, BYTES is set to the byte length
476 of one character at STR. */ 476 of one character at STR. */
477 477
@@ -499,7 +499,7 @@ extern int width_by_char_head[256];
499 c1 = CHAR_FIELD3 (c), \ 499 c1 = CHAR_FIELD3 (c), \
500 c2 = -1))) 500 c2 = -1)))
501 501
502/* Return 1 iff character C has valid printable glyph. */ 502/* Return 1 if character C has valid printable glyph. */
503#define CHAR_PRINTABLE_P(c) (ASCII_BYTE_P (c) || char_printable_p (c)) 503#define CHAR_PRINTABLE_P(c) (ASCII_BYTE_P (c) || char_printable_p (c))
504 504
505/* The charset of the character at STR is stored in CHARSET, and the 505/* The charset of the character at STR is stored in CHARSET, and the
diff --git a/src/coding.h b/src/coding.h
index 39feeea96af..a53a74ec161 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -263,7 +263,7 @@ enum coding_type
263 eol-type is not consistent 263 eol-type is not consistent
264 through the file. */ 264 through the file. */
265 265
266/* 1 iff composing. */ 266/* 1 if composing. */
267#define COMPOSING_P(coding) ((int) coding->composing > (int) COMPOSITION_NO) 267#define COMPOSING_P(coding) ((int) coding->composing > (int) COMPOSITION_NO)
268 268
269#define COMPOSITION_DATA_SIZE 4080 269#define COMPOSITION_DATA_SIZE 4080
@@ -372,7 +372,7 @@ struct coding_system
372 /* The current status of composition handling. */ 372 /* The current status of composition handling. */
373 int composing; 373 int composing;
374 374
375 /* 1 iff the next character is a composition rule. */ 375 /* 1 if the next character is a composition rule. */
376 int composition_rule_follows; 376 int composition_rule_follows;
377 377
378 /* Information of compositions are stored here on decoding and set 378 /* Information of compositions are stored here on decoding and set
diff --git a/src/composite.h b/src/composite.h
index 5dc8dde62e2..ba8f8c84104 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -56,7 +56,7 @@ enum composition_method {
56/* Temporary variable used only in the following macros. */ 56/* Temporary variable used only in the following macros. */
57extern Lisp_Object composition_temp; 57extern Lisp_Object composition_temp;
58 58
59/* Return 1 iff the composition is already registered. */ 59/* Return 1 if the composition is already registered. */
60#define COMPOSITION_REGISTERD_P(prop) INTEGERP (XCAR (prop)) 60#define COMPOSITION_REGISTERD_P(prop) INTEGERP (XCAR (prop))
61 61
62/* Return ID number of the already registered composition. */ 62/* Return ID number of the already registered composition. */
@@ -91,7 +91,7 @@ extern Lisp_Object composition_temp;
91 ? COMPOSITION_WITH_ALTCHARS \ 91 ? COMPOSITION_WITH_ALTCHARS \
92 : COMPOSITION_WITH_RULE_ALTCHARS)))) 92 : COMPOSITION_WITH_RULE_ALTCHARS))))
93 93
94/* Return 1 iff the composition is valid. It is valid if length of 94/* Return 1 if the composition is valid. It is valid if length of
95 the composition equals to (END - START). */ 95 the composition equals to (END - START). */
96#define COMPOSITION_VALID_P(start, end, prop) \ 96#define COMPOSITION_VALID_P(start, end, prop) \
97 (CONSP (prop) \ 97 (CONSP (prop) \
diff --git a/src/dired.c b/src/dired.c
index 22283b66ea0..1fb5387268a 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -916,7 +916,7 @@ Elements of the attribute list are:
916 7. Size in bytes. 916 7. Size in bytes.
917 This is a floating point number if the size is too large for an integer. 917 This is a floating point number if the size is too large for an integer.
918 8. File modes, as a string of ten letters or dashes as in ls -l. 918 8. File modes, as a string of ten letters or dashes as in ls -l.
919 9. t iff file's gid would change if file were deleted and recreated. 919 9. t if file's gid would change if file were deleted and recreated.
92010. inode number. If inode number is larger than the Emacs integer, 92010. inode number. If inode number is larger than the Emacs integer,
921 this is a cons cell containing two integers: first the high part, 921 this is a cons cell containing two integers: first the high part,
922 then the low 16 bits. 922 then the low 16 bits.
diff --git a/src/editfns.c b/src/editfns.c
index 7bb74958c2c..dac7eb83af2 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3514,7 +3514,7 @@ usage: (format STRING &rest OBJECTS) */)
3514 precision ::= '.' [0-9]* 3514 precision ::= '.' [0-9]*
3515 3515
3516 If a field-width is specified, it specifies to which width 3516 If a field-width is specified, it specifies to which width
3517 the output should be padded with blanks, iff the output 3517 the output should be padded with blanks, if the output
3518 string is shorter than field-width. 3518 string is shorter than field-width.
3519 3519
3520 If precision is specified, it specifies the number of 3520 If precision is specified, it specifies the number of
diff --git a/src/emacs.c b/src/emacs.c
index 373eab33e11..e23f8083a31 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1165,6 +1165,13 @@ main (argc, argv
1165 setpgrp (); 1165 setpgrp ();
1166#endif 1166#endif
1167#endif 1167#endif
1168#if defined (HAVE_GTK_AND_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
1169 {
1170 extern void malloc_enable_thread P_ ((void));
1171
1172 malloc_enable_thread ();
1173 }
1174#endif
1168 } 1175 }
1169 1176
1170 init_signals (); 1177 init_signals ();
diff --git a/src/eval.c b/src/eval.c
index 9a03e5fac83..13ea0ba7ebf 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1793,7 +1793,7 @@ signal_error (s, arg)
1793} 1793}
1794 1794
1795 1795
1796/* Return nonzero iff LIST is a non-nil atom or 1796/* Return nonzero if LIST is a non-nil atom or
1797 a list containing one of CONDITIONS. */ 1797 a list containing one of CONDITIONS. */
1798 1798
1799static int 1799static int
diff --git a/src/fileio.c b/src/fileio.c
index 6e47670f09c..37a694da01d 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3692,27 +3692,25 @@ DEFUN ("insert-file-contents", Finsert_file_contents, Sinsert_file_contents,
3692 1, 5, 0, 3692 1, 5, 0,
3693 doc: /* Insert contents of file FILENAME after point. 3693 doc: /* Insert contents of file FILENAME after point.
3694Returns list of absolute file name and number of characters inserted. 3694Returns list of absolute file name and number of characters inserted.
3695If second argument VISIT is non-nil, the buffer's visited filename 3695If second argument VISIT is non-nil, the buffer's visited filename and
3696and last save file modtime are set, and it is marked unmodified. 3696last save file modtime are set, and it is marked unmodified. If
3697If visiting and the file does not exist, visiting is completed 3697visiting and the file does not exist, visiting is completed before the
3698before the error is signaled. 3698error is signaled.
3699The optional third and fourth arguments BEG and END 3699
3700specify what portion of the file to insert. 3700The optional third and fourth arguments BEG and END specify what portion
3701These arguments count bytes in the file, not characters in the buffer. 3701of the file to insert. These arguments count bytes in the file, not
3702If VISIT is non-nil, BEG and END must be nil. 3702characters in the buffer. If VISIT is non-nil, BEG and END must be nil.
3703 3703
3704If optional fifth argument REPLACE is non-nil, 3704If optional fifth argument REPLACE is non-nil, replace the current
3705it means replace the current buffer contents (in the accessible portion) 3705buffer contents (in the accessible portion) with the file contents.
3706with the file contents. This is better than simply deleting and inserting 3706This is better than simply deleting and inserting the whole thing
3707the whole thing because (1) it preserves some marker positions 3707because (1) it preserves some marker positions and (2) it puts less data
3708and (2) it puts less data in the undo list. 3708in the undo list. When REPLACE is non-nil, the second return value is
3709When REPLACE is non-nil, the value is the number of characters actually read, 3709the number of characters that replace previous buffer contents.
3710which is often less than the number of characters to be read. 3710
3711 3711This function does code conversion according to the value of
3712This does code conversion according to the value of 3712`coding-system-for-read' or `file-coding-system-alist', and sets the
3713`coding-system-for-read' or `file-coding-system-alist', 3713variable `last-coding-system-used' to the coding system actually used. */)
3714and sets the variable `last-coding-system-used' to the coding system
3715actually used. */)
3716 (filename, visit, beg, end, replace) 3714 (filename, visit, beg, end, replace)
3717 Lisp_Object filename, visit, beg, end, replace; 3715 Lisp_Object filename, visit, beg, end, replace;
3718{ 3716{
@@ -3722,8 +3720,8 @@ actually used. */)
3722 register int how_much; 3720 register int how_much;
3723 register int unprocessed; 3721 register int unprocessed;
3724 int count = SPECPDL_INDEX (); 3722 int count = SPECPDL_INDEX ();
3725 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 3723 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
3726 Lisp_Object handler, val, insval, orig_filename; 3724 Lisp_Object handler, val, insval, orig_filename, old_undo;
3727 Lisp_Object p; 3725 Lisp_Object p;
3728 int total = 0; 3726 int total = 0;
3729 int not_regular = 0; 3727 int not_regular = 0;
@@ -3746,8 +3744,9 @@ actually used. */)
3746 val = Qnil; 3744 val = Qnil;
3747 p = Qnil; 3745 p = Qnil;
3748 orig_filename = Qnil; 3746 orig_filename = Qnil;
3747 old_undo = Qnil;
3749 3748
3750 GCPRO4 (filename, val, p, orig_filename); 3749 GCPRO5 (filename, val, p, orig_filename, old_undo);
3751 3750
3752 CHECK_STRING (filename); 3751 CHECK_STRING (filename);
3753 filename = Fexpand_file_name (filename, Qnil); 3752 filename = Fexpand_file_name (filename, Qnil);
@@ -4706,24 +4705,103 @@ actually used. */)
4706 /* Decode file format */ 4705 /* Decode file format */
4707 if (inserted > 0) 4706 if (inserted > 0)
4708 { 4707 {
4709 int empty_undo_list_p = 0; 4708 /* Don't run point motion or modification hooks when decoding. */
4709 int count = SPECPDL_INDEX ();
4710 specbind (Qinhibit_point_motion_hooks, Qt);
4711 specbind (Qinhibit_modification_hooks, Qt);
4712
4713 /* Save old undo list and don't record undo for decoding. */
4714 old_undo = current_buffer->undo_list;
4715 current_buffer->undo_list = Qt;
4710 4716
4711 /* If we're anyway going to discard undo information, don't 4717 if (NILP (replace))
4712 record it in the first place. The buffer's undo list at this
4713 point is either nil or t when visiting a file. */
4714 if (!NILP (visit))
4715 { 4718 {
4716 empty_undo_list_p = NILP (current_buffer->undo_list); 4719 insval = call3 (Qformat_decode,
4717 current_buffer->undo_list = Qt; 4720 Qnil, make_number (inserted), visit);
4721 CHECK_NUMBER (insval);
4722 inserted = XFASTINT (insval);
4723 }
4724 else
4725 {
4726 /* If REPLACE is non-nil and we succeeded in not replacing the
4727 beginning or end of the buffer text with the file's contents,
4728 call format-decode with `point' positioned at the beginning of
4729 the buffer and `inserted' equalling the number of characters
4730 in the buffer. Otherwise, format-decode might fail to
4731 correctly analyze the beginning or end of the buffer. Hence
4732 we temporarily save `point' and `inserted' here and restore
4733 `point' iff format-decode did not insert or delete any text.
4734 Otherwise we leave `point' at point-min. */
4735 int opoint = PT;
4736 int opoint_byte = PT_BYTE;
4737 int oinserted = ZV - BEGV;
4738
4739 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
4740 insval = call3 (Qformat_decode,
4741 Qnil, make_number (oinserted), visit);
4742 CHECK_NUMBER (insval);
4743 if (XINT (insval) == oinserted)
4744 SET_PT_BOTH (opoint, opoint_byte);
4745 inserted = XFASTINT (insval);
4718 } 4746 }
4719 4747
4720 insval = call3 (Qformat_decode, 4748 /* For consistency with format-decode call these now iff inserted > 0
4721 Qnil, make_number (inserted), visit); 4749 (martin 2007-06-28) */
4722 CHECK_NUMBER (insval); 4750 p = Vafter_insert_file_functions;
4723 inserted = XFASTINT (insval); 4751 while (CONSP (p))
4752 {
4753 if (NILP (replace))
4754 {
4755 insval = call1 (XCAR (p), make_number (inserted));
4756 if (!NILP (insval))
4757 {
4758 CHECK_NUMBER (insval);
4759 inserted = XFASTINT (insval);
4760 }
4761 }
4762 else
4763 {
4764 /* For the rationale of this see the comment on format-decode above. */
4765 int opoint = PT;
4766 int opoint_byte = PT_BYTE;
4767 int oinserted = ZV - BEGV;
4768
4769 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
4770 insval = call1 (XCAR (p), make_number (oinserted));
4771 if (!NILP (insval))
4772 {
4773 CHECK_NUMBER (insval);
4774 if (XINT (insval) == oinserted)
4775 SET_PT_BOTH (opoint, opoint_byte);
4776 inserted = XFASTINT (insval);
4777 }
4778 }
4779
4780 QUIT;
4781 p = XCDR (p);
4782 }
4783
4784 if (NILP (visit))
4785 {
4786 Lisp_Object lbeg, lend;
4787 XSETINT (lbeg, PT);
4788 XSETINT (lend, PT + inserted);
4789 if (CONSP (old_undo))
4790 {
4791 Lisp_Object tem = XCAR (old_undo);
4792 if (CONSP (tem) && INTEGERP (XCAR (tem)) &&
4793 INTEGERP (XCDR (tem)) && EQ (XCAR (tem), lbeg))
4794 /* In the non-visiting case record only the final insertion. */
4795 current_buffer->undo_list =
4796 Fcons (Fcons (lbeg, lend), Fcdr (old_undo));
4797 }
4798 }
4799 else
4800 /* If undo_list was Qt before, keep it that way.
4801 Otherwise start with an empty undo_list. */
4802 current_buffer->undo_list = EQ (old_undo, Qt) ? Qt : Qnil;
4724 4803
4725 if (!NILP (visit)) 4804 unbind_to (count, Qnil);
4726 current_buffer->undo_list = empty_undo_list_p ? Qnil : Qt;
4727 } 4805 }
4728 4806
4729 /* Call after-change hooks for the inserted text, aside from the case 4807 /* Call after-change hooks for the inserted text, aside from the case
@@ -4736,19 +4814,6 @@ actually used. */)
4736 update_compositions (PT, PT, CHECK_BORDER); 4814 update_compositions (PT, PT, CHECK_BORDER);
4737 } 4815 }
4738 4816
4739 p = Vafter_insert_file_functions;
4740 while (CONSP (p))
4741 {
4742 insval = call1 (XCAR (p), make_number (inserted));
4743 if (!NILP (insval))
4744 {
4745 CHECK_NUMBER (insval);
4746 inserted = XFASTINT (insval);
4747 }
4748 QUIT;
4749 p = XCDR (p);
4750 }
4751
4752 if (!NILP (visit) 4817 if (!NILP (visit)
4753 && current_buffer->modtime == -1) 4818 && current_buffer->modtime == -1)
4754 { 4819 {
@@ -5193,7 +5258,7 @@ This does code conversion according to the value of
5193 * if we do writes that don't end with a carriage return. Furthermore 5258 * if we do writes that don't end with a carriage return. Furthermore
5194 * it cannot handle writes of more then 16K. The modified 5259 * it cannot handle writes of more then 16K. The modified
5195 * version of "sys_write" in SYSDEP.C (see comment there) copes with 5260 * version of "sys_write" in SYSDEP.C (see comment there) copes with
5196 * this EXCEPT for the last record (iff it doesn't end with a carriage 5261 * this EXCEPT for the last record (if it doesn't end with a carriage
5197 * return). This implies that if your buffer doesn't end with a carriage 5262 * return). This implies that if your buffer doesn't end with a carriage
5198 * return, you get one free... tough. However it also means that if 5263 * return, you get one free... tough. However it also means that if
5199 * we make two calls to sys_write (a la the following code) you can 5264 * we make two calls to sys_write (a la the following code) you can
diff --git a/src/fontset.c b/src/fontset.c
index d76ed658de6..1d6e73517b6 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -501,7 +501,7 @@ free_face_fontset (f, face)
501} 501}
502 502
503 503
504/* Return 1 iff FACE is suitable for displaying character C. 504/* Return 1 if FACE is suitable for displaying character C.
505 Otherwise return 0. Called from the macro FACE_SUITABLE_FOR_CHAR_P 505 Otherwise return 0. Called from the macro FACE_SUITABLE_FOR_CHAR_P
506 when C is not a single byte character.. */ 506 when C is not a single byte character.. */
507 507
diff --git a/src/fontset.h b/src/fontset.h
index 5b5c5cbcfaa..c8bd1e36eab 100644
--- a/src/fontset.h
+++ b/src/fontset.h
@@ -66,7 +66,7 @@ struct font_info
66 /* Average width of glyphs in the font. */ 66 /* Average width of glyphs in the font. */
67 int average_width; 67 int average_width;
68 68
69 /* 1 iff `vertical-centering-font-regexp' matches this font name. 69 /* 1 if `vertical-centering-font-regexp' matches this font name.
70 In this case, we render characters at vartical center positions 70 In this case, we render characters at vartical center positions
71 of lines. */ 71 of lines. */
72 int vertical_centering; 72 int vertical_centering;
diff --git a/src/getloadavg.c b/src/getloadavg.c
index f40149a8c47..6d66cbfd8a1 100644
--- a/src/getloadavg.c
+++ b/src/getloadavg.c
@@ -484,7 +484,7 @@ static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */
484#if !defined(HAVE_LIBKSTAT) && defined(LOAD_AVE_TYPE) 484#if !defined(HAVE_LIBKSTAT) && defined(LOAD_AVE_TYPE)
485/* File descriptor open to /dev/kmem or VMS load ave driver. */ 485/* File descriptor open to /dev/kmem or VMS load ave driver. */
486static int channel; 486static int channel;
487/* Nonzero iff channel is valid. */ 487/* Nonzero if channel is valid. */
488static int getloadavg_initialized; 488static int getloadavg_initialized;
489/* Offset in kmem to seek to read load average, or 0 means invalid. */ 489/* Offset in kmem to seek to read load average, or 0 means invalid. */
490static long offset; 490static long offset;
diff --git a/src/gmalloc.c b/src/gmalloc.c
index cf79b9159f2..ccc08e1ff68 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -129,6 +129,8 @@ extern FREE_RETURN_TYPE free PP ((__ptr_t __ptr));
129#if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */ 129#if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */
130extern __ptr_t memalign PP ((__malloc_size_t __alignment, 130extern __ptr_t memalign PP ((__malloc_size_t __alignment,
131 __malloc_size_t __size)); 131 __malloc_size_t __size));
132extern int posix_memalign PP ((__ptr_t *, __malloc_size_t,
133 __malloc_size_t size));
132#endif 134#endif
133 135
134/* Allocate SIZE bytes on a page boundary. */ 136/* Allocate SIZE bytes on a page boundary. */
@@ -136,6 +138,10 @@ extern __ptr_t memalign PP ((__malloc_size_t __alignment,
136extern __ptr_t valloc PP ((__malloc_size_t __size)); 138extern __ptr_t valloc PP ((__malloc_size_t __size));
137#endif 139#endif
138 140
141#ifdef USE_PTHREAD
142/* Set up mutexes and make malloc etc. thread-safe. */
143extern void malloc_enable_thread PP ((void));
144#endif
139 145
140#ifdef _MALLOC_INTERNAL 146#ifdef _MALLOC_INTERNAL
141 147
@@ -242,10 +248,27 @@ extern void _free_internal_nolock PP ((__ptr_t __ptr));
242 248
243#ifdef USE_PTHREAD 249#ifdef USE_PTHREAD
244extern pthread_mutex_t _malloc_mutex, _aligned_blocks_mutex; 250extern pthread_mutex_t _malloc_mutex, _aligned_blocks_mutex;
245#define LOCK() pthread_mutex_lock (&_malloc_mutex) 251extern int _malloc_thread_enabled_p;
246#define UNLOCK() pthread_mutex_unlock (&_malloc_mutex) 252#define LOCK() \
247#define LOCK_ALIGNED_BLOCKS() pthread_mutex_lock (&_aligned_blocks_mutex) 253 do { \
248#define UNLOCK_ALIGNED_BLOCKS() pthread_mutex_unlock (&_aligned_blocks_mutex) 254 if (_malloc_thread_enabled_p) \
255 pthread_mutex_lock (&_malloc_mutex); \
256 } while (0)
257#define UNLOCK() \
258 do { \
259 if (_malloc_thread_enabled_p) \
260 pthread_mutex_unlock (&_malloc_mutex); \
261 } while (0)
262#define LOCK_ALIGNED_BLOCKS() \
263 do { \
264 if (_malloc_thread_enabled_p) \
265 pthread_mutex_lock (&_aligned_blocks_mutex); \
266 } while (0)
267#define UNLOCK_ALIGNED_BLOCKS() \
268 do { \
269 if (_malloc_thread_enabled_p) \
270 pthread_mutex_unlock (&_aligned_blocks_mutex); \
271 } while (0)
249#else 272#else
250#define LOCK() 273#define LOCK()
251#define UNLOCK() 274#define UNLOCK()
@@ -563,6 +586,47 @@ register_heapinfo ()
563#ifdef USE_PTHREAD 586#ifdef USE_PTHREAD
564pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER; 587pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER;
565pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER; 588pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER;
589int _malloc_thread_enabled_p;
590
591static void
592malloc_atfork_handler_prepare ()
593{
594 LOCK ();
595 LOCK_ALIGNED_BLOCKS ();
596}
597
598static void
599malloc_atfork_handler_parent ()
600{
601 UNLOCK_ALIGNED_BLOCKS ();
602 UNLOCK ();
603}
604
605static void
606malloc_atfork_handler_child ()
607{
608 UNLOCK_ALIGNED_BLOCKS ();
609 UNLOCK ();
610}
611
612/* Set up mutexes and make malloc etc. thread-safe. */
613void
614malloc_enable_thread ()
615{
616 if (_malloc_thread_enabled_p)
617 return;
618
619 /* Some pthread implementations call malloc for statically
620 initialized mutexes when they are used first. To avoid such a
621 situation, we initialize mutexes here while their use is
622 disabled in malloc etc. */
623 pthread_mutex_init (&_malloc_mutex, NULL);
624 pthread_mutex_init (&_aligned_blocks_mutex, NULL);
625 pthread_atfork (malloc_atfork_handler_prepare,
626 malloc_atfork_handler_parent,
627 malloc_atfork_handler_child);
628 _malloc_thread_enabled_p = 1;
629}
566#endif 630#endif
567 631
568static void 632static void
@@ -575,19 +639,6 @@ malloc_initialize_1 ()
575 if (__malloc_initialize_hook) 639 if (__malloc_initialize_hook)
576 (*__malloc_initialize_hook) (); 640 (*__malloc_initialize_hook) ();
577 641
578 /* We don't use recursive mutex because pthread_mutexattr_init may
579 call malloc internally. */
580#if 0 /* defined (USE_PTHREAD) */
581 {
582 pthread_mutexattr_t attr;
583
584 pthread_mutexattr_init (&attr);
585 pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
586 pthread_mutex_init (&_malloc_mutex, &attr);
587 pthread_mutexattr_destroy (&attr);
588 }
589#endif
590
591 heapsize = HEAP / BLOCKSIZE; 642 heapsize = HEAP / BLOCKSIZE;
592 _heapinfo = (malloc_info *) align (heapsize * sizeof (malloc_info)); 643 _heapinfo = (malloc_info *) align (heapsize * sizeof (malloc_info));
593 if (_heapinfo == NULL) 644 if (_heapinfo == NULL)
@@ -1808,6 +1859,36 @@ memalign (alignment, size)
1808 return result; 1859 return result;
1809} 1860}
1810 1861
1862#ifndef ENOMEM
1863#define ENOMEM 12
1864#endif
1865
1866#ifndef EINVAL
1867#define EINVAL 22
1868#endif
1869
1870int
1871posix_memalign (memptr, alignment, size)
1872 __ptr_t *memptr;
1873 __malloc_size_t alignment;
1874 __malloc_size_t size;
1875{
1876 __ptr_t mem;
1877
1878 if (alignment == 0
1879 || alignment % sizeof (__ptr_t) != 0
1880 || (alignment & (alignment - 1)) != 0)
1881 return EINVAL;
1882
1883 mem = memalign (alignment, size);
1884 if (mem == NULL)
1885 return ENOMEM;
1886
1887 *memptr = mem;
1888
1889 return 0;
1890}
1891
1811#endif /* Not DJGPP v1 */ 1892#endif /* Not DJGPP v1 */
1812/* Allocate memory on a page boundary. 1893/* Allocate memory on a page boundary.
1813 Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc. 1894 Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc.
diff --git a/src/gtkutil.c b/src/gtkutil.c
index a4c0522c49b..0f95acaa2c7 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3372,8 +3372,16 @@ xg_tool_bar_callback (w, client_data)
3372 3372
3373 key = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_KEY); 3373 key = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_KEY);
3374 XSETFRAME (frame, f); 3374 XSETFRAME (frame, f);
3375
3376 /* We generate two events here. The first one is to set the prefix
3377 to `(tool_bar)', see keyboard.c. */
3375 event.kind = TOOL_BAR_EVENT; 3378 event.kind = TOOL_BAR_EVENT;
3376 event.frame_or_window = frame; 3379 event.frame_or_window = frame;
3380 event.arg = frame;
3381 kbd_buffer_store_event (&event);
3382
3383 event.kind = TOOL_BAR_EVENT;
3384 event.frame_or_window = frame;
3377 event.arg = key; 3385 event.arg = key;
3378 /* Convert between the modifier bits GDK uses and the modifier bits 3386 /* Convert between the modifier bits GDK uses and the modifier bits
3379 Emacs uses. This assumes GDK an X masks are the same, which they are when 3387 Emacs uses. This assumes GDK an X masks are the same, which they are when
@@ -3794,7 +3802,7 @@ update_frame_tool_bar (f)
3794 gtk_container_add (GTK_CONTAINER (weventbox), wbutton); 3802 gtk_container_add (GTK_CONTAINER (weventbox), wbutton);
3795 ti = gtk_tool_item_new (); 3803 ti = gtk_tool_item_new ();
3796 gtk_container_add (GTK_CONTAINER (ti), weventbox); 3804 gtk_container_add (GTK_CONTAINER (ti), weventbox);
3797 gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i); 3805 gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, -1);
3798 } 3806 }
3799 continue; 3807 continue;
3800 } 3808 }
@@ -3811,7 +3819,7 @@ update_frame_tool_bar (f)
3811 gtk_container_add (GTK_CONTAINER (weventbox), wbutton); 3819 gtk_container_add (GTK_CONTAINER (weventbox), wbutton);
3812 ti = gtk_tool_item_new (); 3820 ti = gtk_tool_item_new ();
3813 gtk_container_add (GTK_CONTAINER (ti), weventbox); 3821 gtk_container_add (GTK_CONTAINER (ti), weventbox);
3814 gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i); 3822 gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, -1);
3815 3823
3816 3824
3817 /* The EMACS_INT cast avoids a warning. */ 3825 /* The EMACS_INT cast avoids a warning. */
diff --git a/src/image.c b/src/image.c
index d38ca04e083..96335558afa 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1644,6 +1644,8 @@ search_image_cache (f, spec, hash)
1644 struct image_cache *c = FRAME_X_IMAGE_CACHE (f); 1644 struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
1645 int i = hash % IMAGE_CACHE_BUCKETS_SIZE; 1645 int i = hash % IMAGE_CACHE_BUCKETS_SIZE;
1646 1646
1647 if (!c) return NULL;
1648
1647 /* If the image spec does not specify a background color, the cached 1649 /* If the image spec does not specify a background color, the cached
1648 image must have the same background color as the current frame. 1650 image must have the same background color as the current frame.
1649 The foreground color must also match, for the sake of monochrome 1651 The foreground color must also match, for the sake of monochrome
@@ -1655,13 +1657,10 @@ search_image_cache (f, spec, hash)
1655 for formats that don't use transparency (such as jpeg), or if the 1657 for formats that don't use transparency (such as jpeg), or if the
1656 image spec specifies :background. However, the extra memory 1658 image spec specifies :background. However, the extra memory
1657 usage is probably negligible in practice, so we don't bother. */ 1659 usage is probably negligible in practice, so we don't bother. */
1658 if (!c) return NULL;
1659 1660
1660 for (img = c->buckets[i]; img; img = img->next) 1661 for (img = c->buckets[i]; img; img = img->next)
1661 if (img->hash == hash 1662 if (img->hash == hash
1662 && !NILP (Fequal (img->spec, spec)) 1663 && !NILP (Fequal (img->spec, spec))
1663 /* If the image spec specifies a background, it doesn't matter
1664 what the frame background is. */
1665 && img->frame_foreground == FRAME_FOREGROUND_PIXEL (f) 1664 && img->frame_foreground == FRAME_FOREGROUND_PIXEL (f)
1666 && img->frame_background == FRAME_BACKGROUND_PIXEL (f)) 1665 && img->frame_background == FRAME_BACKGROUND_PIXEL (f))
1667 break; 1666 break;
@@ -6362,11 +6361,14 @@ png_load (f, img)
6362 PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); 6361 PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
6363 } 6362 }
6364 } 6363 }
6364 /* The commented-out code checked if the png specifies a default
6365 background color, and uses that. Since we use the current
6366 frame background, it is OK for us to ignore this.
6367
6365 else if (fn_png_get_bKGD (png_ptr, info_ptr, &image_bg)) 6368 else if (fn_png_get_bKGD (png_ptr, info_ptr, &image_bg))
6366 /* Image contains a background color with which to
6367 combine the image. */
6368 fn_png_set_background (png_ptr, image_bg, 6369 fn_png_set_background (png_ptr, image_bg,
6369 PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); 6370 PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
6371 */
6370 else 6372 else
6371 { 6373 {
6372 /* Image does not contain a background color with which 6374 /* Image does not contain a background color with which
diff --git a/src/indent.c b/src/indent.c
index c4ed2b94854..88856814279 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -118,7 +118,7 @@ character_width (c, dp)
118 return 0; 118 return 0;
119} 119}
120 120
121/* Return true iff the display table DISPTAB specifies the same widths 121/* Return true if the display table DISPTAB specifies the same widths
122 for characters as WIDTHTAB. We use this to decide when to 122 for characters as WIDTHTAB. We use this to decide when to
123 invalidate the buffer's width_run_cache. */ 123 invalidate the buffer's width_run_cache. */
124 124
diff --git a/src/indent.h b/src/indent.h
index 2d3c158b069..2e873769603 100644
--- a/src/indent.h
+++ b/src/indent.h
@@ -61,7 +61,7 @@ extern int last_known_column_point;
61 61
62/* Functions for dealing with the column cache. */ 62/* Functions for dealing with the column cache. */
63 63
64/* Return true iff the display table DISPTAB specifies the same widths 64/* Return true if the display table DISPTAB specifies the same widths
65 for characters as WIDTHTAB. We use this to decide when to 65 for characters as WIDTHTAB. We use this to decide when to
66 invalidate the buffer's column_cache. */ 66 invalidate the buffer's column_cache. */
67int disptab_matches_widthtab P_ ((struct Lisp_Char_Table *disptab, 67int disptab_matches_widthtab P_ ((struct Lisp_Char_Table *disptab,
diff --git a/src/insdel.c b/src/insdel.c
index 14e7478e69a..19823623091 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -2137,6 +2137,20 @@ prepare_to_modify_buffer (start, end, preserve_ptr)
2137#define FETCH_END \ 2137#define FETCH_END \
2138 (! NILP (end_marker) ? Fmarker_position (end_marker) : end) 2138 (! NILP (end_marker) ? Fmarker_position (end_marker) : end)
2139 2139
2140/* Set a variable to nil if an error occurred.
2141 VAL is a cons-cell whose car is the variable name, and whose cdr is
2142 either nil (to mean that there was indeed an error), or non-nil to mean
2143 that the was no error (which thus causes this function to do
2144 nothing). */
2145Lisp_Object
2146reset_var_on_error (val)
2147 Lisp_Object val;
2148{
2149 if (NILP (XCDR (val)))
2150 Fset (XCAR (val), Qnil);
2151 return Qnil;
2152}
2153
2140/* Signal a change to the buffer immediately before it happens. 2154/* Signal a change to the buffer immediately before it happens.
2141 START_INT and END_INT are the bounds of the text to be changed. 2155 START_INT and END_INT are the bounds of the text to be changed.
2142 2156
@@ -2152,6 +2166,7 @@ signal_before_change (start_int, end_int, preserve_ptr)
2152 Lisp_Object start_marker, end_marker; 2166 Lisp_Object start_marker, end_marker;
2153 Lisp_Object preserve_marker; 2167 Lisp_Object preserve_marker;
2154 struct gcpro gcpro1, gcpro2, gcpro3; 2168 struct gcpro gcpro1, gcpro2, gcpro3;
2169 int count = SPECPDL_INDEX ();
2155 2170
2156 if (inhibit_modification_hooks) 2171 if (inhibit_modification_hooks)
2157 return; 2172 return;
@@ -2163,6 +2178,8 @@ signal_before_change (start_int, end_int, preserve_ptr)
2163 end_marker = Qnil; 2178 end_marker = Qnil;
2164 GCPRO3 (preserve_marker, start_marker, end_marker); 2179 GCPRO3 (preserve_marker, start_marker, end_marker);
2165 2180
2181 specbind (Qinhibit_modification_hooks, Qt);
2182
2166 /* If buffer is unmodified, run a special hook for that case. */ 2183 /* If buffer is unmodified, run a special hook for that case. */
2167 if (SAVE_MODIFF >= MODIFF 2184 if (SAVE_MODIFF >= MODIFF
2168 && !NILP (Vfirst_change_hook) 2185 && !NILP (Vfirst_change_hook)
@@ -2177,46 +2194,22 @@ signal_before_change (start_int, end_int, preserve_ptr)
2177 if (!NILP (Vbefore_change_functions)) 2194 if (!NILP (Vbefore_change_functions))
2178 { 2195 {
2179 Lisp_Object args[3]; 2196 Lisp_Object args[3];
2180 Lisp_Object before_change_functions; 2197 Lisp_Object rvoe_arg = Fcons (Qbefore_change_functions, Qnil);
2181 Lisp_Object after_change_functions;
2182 struct gcpro gcpro1, gcpro2;
2183 struct buffer *old = current_buffer;
2184 struct buffer *new;
2185 2198
2186 PRESERVE_VALUE; 2199 PRESERVE_VALUE;
2187 PRESERVE_START_END; 2200 PRESERVE_START_END;
2188 2201
2189 /* "Bind" before-change-functions and after-change-functions 2202 /* Mark before-change-functions to be reset to nil in case of error. */
2190 to nil--but in a way that errors don't know about. 2203 record_unwind_protect (reset_var_on_error, rvoe_arg);
2191 That way, if there's an error in them, they will stay nil. */
2192 before_change_functions = Vbefore_change_functions;
2193 after_change_functions = Vafter_change_functions;
2194 Vbefore_change_functions = Qnil;
2195 Vafter_change_functions = Qnil;
2196 GCPRO2 (before_change_functions, after_change_functions);
2197 2204
2198 /* Actually run the hook functions. */ 2205 /* Actually run the hook functions. */
2199 args[0] = Qbefore_change_functions; 2206 args[0] = Qbefore_change_functions;
2200 args[1] = FETCH_START; 2207 args[1] = FETCH_START;
2201 args[2] = FETCH_END; 2208 args[2] = FETCH_END;
2202 run_hook_list_with_args (before_change_functions, 3, args); 2209 Frun_hook_with_args (3, args);
2203 2210
2204 /* "Unbind" the variables we "bound" to nil. Beware a 2211 /* There was no error: unarm the reset_on_error. */
2205 buffer-local hook which changes the buffer when run (e.g. W3). */ 2212 XSETCDR (rvoe_arg, Qt);
2206 if (old != current_buffer)
2207 {
2208 new = current_buffer;
2209 set_buffer_internal (old);
2210 Vbefore_change_functions = before_change_functions;
2211 Vafter_change_functions = after_change_functions;
2212 set_buffer_internal (new);
2213 }
2214 else
2215 {
2216 Vbefore_change_functions = before_change_functions;
2217 Vafter_change_functions = after_change_functions;
2218 }
2219 UNGCPRO;
2220 } 2213 }
2221 2214
2222 if (current_buffer->overlays_before || current_buffer->overlays_after) 2215 if (current_buffer->overlays_before || current_buffer->overlays_after)
@@ -2232,6 +2225,8 @@ signal_before_change (start_int, end_int, preserve_ptr)
2232 free_marker (end_marker); 2225 free_marker (end_marker);
2233 RESTORE_VALUE; 2226 RESTORE_VALUE;
2234 UNGCPRO; 2227 UNGCPRO;
2228
2229 unbind_to (count, Qnil);
2235} 2230}
2236 2231
2237/* Signal a change immediately after it happens. 2232/* Signal a change immediately after it happens.
@@ -2245,6 +2240,7 @@ void
2245signal_after_change (charpos, lendel, lenins) 2240signal_after_change (charpos, lendel, lenins)
2246 int charpos, lendel, lenins; 2241 int charpos, lendel, lenins;
2247{ 2242{
2243 int count = SPECPDL_INDEX ();
2248 if (inhibit_modification_hooks) 2244 if (inhibit_modification_hooks)
2249 return; 2245 return;
2250 2246
@@ -2275,48 +2271,25 @@ signal_after_change (charpos, lendel, lenins)
2275 if (!NILP (combine_after_change_list)) 2271 if (!NILP (combine_after_change_list))
2276 Fcombine_after_change_execute (); 2272 Fcombine_after_change_execute ();
2277 2273
2274 specbind (Qinhibit_modification_hooks, Qt);
2275
2278 if (!NILP (Vafter_change_functions)) 2276 if (!NILP (Vafter_change_functions))
2279 { 2277 {
2280 Lisp_Object args[4]; 2278 Lisp_Object args[4];
2281 Lisp_Object before_change_functions; 2279 Lisp_Object rvoe_arg = Fcons (Qafter_change_functions, Qnil);
2282 Lisp_Object after_change_functions; 2280
2283 struct buffer *old = current_buffer; 2281 /* Mark after-change-functions to be reset to nil in case of error. */
2284 struct buffer *new; 2282 record_unwind_protect (reset_var_on_error, rvoe_arg);
2285 struct gcpro gcpro1, gcpro2;
2286
2287 /* "Bind" before-change-functions and after-change-functions
2288 to nil--but in a way that errors don't know about.
2289 That way, if there's an error in them, they will stay nil. */
2290 before_change_functions = Vbefore_change_functions;
2291 after_change_functions = Vafter_change_functions;
2292 Vbefore_change_functions = Qnil;
2293 Vafter_change_functions = Qnil;
2294 GCPRO2 (before_change_functions, after_change_functions);
2295 2283
2296 /* Actually run the hook functions. */ 2284 /* Actually run the hook functions. */
2297 args[0] = Qafter_change_functions; 2285 args[0] = Qafter_change_functions;
2298 XSETFASTINT (args[1], charpos); 2286 XSETFASTINT (args[1], charpos);
2299 XSETFASTINT (args[2], charpos + lenins); 2287 XSETFASTINT (args[2], charpos + lenins);
2300 XSETFASTINT (args[3], lendel); 2288 XSETFASTINT (args[3], lendel);
2301 run_hook_list_with_args (after_change_functions, 2289 Frun_hook_with_args (4, args);
2302 4, args);
2303 2290
2304 /* "Unbind" the variables we "bound" to nil. Beware a 2291 /* There was no error: unarm the reset_on_error. */
2305 buffer-local hook which changes the buffer when run (e.g. W3). */ 2292 XSETCDR (rvoe_arg, Qt);
2306 if (old != current_buffer)
2307 {
2308 new = current_buffer;
2309 set_buffer_internal (old);
2310 Vbefore_change_functions = before_change_functions;
2311 Vafter_change_functions = after_change_functions;
2312 set_buffer_internal (new);
2313 }
2314 else
2315 {
2316 Vbefore_change_functions = before_change_functions;
2317 Vafter_change_functions = after_change_functions;
2318 }
2319 UNGCPRO;
2320 } 2293 }
2321 2294
2322 if (current_buffer->overlays_before || current_buffer->overlays_after) 2295 if (current_buffer->overlays_before || current_buffer->overlays_after)
@@ -2332,6 +2305,8 @@ signal_after_change (charpos, lendel, lenins)
2332 if (lendel == 0) 2305 if (lendel == 0)
2333 report_interval_modification (make_number (charpos), 2306 report_interval_modification (make_number (charpos),
2334 make_number (charpos + lenins)); 2307 make_number (charpos + lenins));
2308
2309 unbind_to (count, Qnil);
2335} 2310}
2336 2311
2337Lisp_Object 2312Lisp_Object
diff --git a/src/intervals.c b/src/intervals.c
index 89f99a052b9..a695976b8b7 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -2200,7 +2200,7 @@ set_point_both (buffer, charpos, bytepos)
2200 2200
2201 temp_set_point_both (buffer, charpos, bytepos); 2201 temp_set_point_both (buffer, charpos, bytepos);
2202 2202
2203 /* We run point-left and point-entered hooks here, iff the 2203 /* We run point-left and point-entered hooks here, if the
2204 two intervals are not equivalent. These hooks take 2204 two intervals are not equivalent. These hooks take
2205 (old_point, new_point) as arguments. */ 2205 (old_point, new_point) as arguments. */
2206 if (NILP (Vinhibit_point_motion_hooks) 2206 if (NILP (Vinhibit_point_motion_hooks)
diff --git a/src/keyboard.c b/src/keyboard.c
index 8999dd05759..626748b6c12 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -487,7 +487,7 @@ static struct input_event * volatile kbd_store_ptr;
487/* The above pair of variables forms a "queue empty" flag. When we 487/* The above pair of variables forms a "queue empty" flag. When we
488 enqueue a non-hook event, we increment kbd_store_ptr. When we 488 enqueue a non-hook event, we increment kbd_store_ptr. When we
489 dequeue a non-hook event, we increment kbd_fetch_ptr. We say that 489 dequeue a non-hook event, we increment kbd_fetch_ptr. We say that
490 there is input available iff the two pointers are not equal. 490 there is input available if the two pointers are not equal.
491 491
492 Why not just have a flag set and cleared by the enqueuing and 492 Why not just have a flag set and cleared by the enqueuing and
493 dequeuing functions? Such a flag could be screwed up by interrupts 493 dequeuing functions? Such a flag could be screwed up by interrupts
@@ -3703,7 +3703,7 @@ restore_getcjmp (temp)
3703 kbd_buffer_store_event places events in kbd_buffer, and 3703 kbd_buffer_store_event places events in kbd_buffer, and
3704 kbd_buffer_get_event retrieves them. */ 3704 kbd_buffer_get_event retrieves them. */
3705 3705
3706/* Return true iff there are any events in the queue that read-char 3706/* Return true if there are any events in the queue that read-char
3707 would return. If this returns false, a read-char would block. */ 3707 would return. If this returns false, a read-char would block. */
3708static int 3708static int
3709readable_events (flags) 3709readable_events (flags)
diff --git a/src/keyboard.h b/src/keyboard.h
index 869449f4000..a65bf8cfa02 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -248,7 +248,7 @@ extern Lisp_Object item_properties;
248 248
249/* Macros for dealing with lispy events. */ 249/* Macros for dealing with lispy events. */
250 250
251/* True iff EVENT has data fields describing it (i.e. a mouse click). */ 251/* True if EVENT has data fields describing it (i.e. a mouse click). */
252#define EVENT_HAS_PARAMETERS(event) (CONSP (event)) 252#define EVENT_HAS_PARAMETERS(event) (CONSP (event))
253 253
254/* Extract the head from an event. 254/* Extract the head from an event.
diff --git a/src/keymap.c b/src/keymap.c
index b4f74885e91..181d43a4f48 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -4067,7 +4067,7 @@ don't alter it yourself. */);
4067 DEFVAR_LISP ("minor-mode-map-alist", &Vminor_mode_map_alist, 4067 DEFVAR_LISP ("minor-mode-map-alist", &Vminor_mode_map_alist,
4068 doc: /* Alist of keymaps to use for minor modes. 4068 doc: /* Alist of keymaps to use for minor modes.
4069Each element looks like (VARIABLE . KEYMAP); KEYMAP is used to read 4069Each element looks like (VARIABLE . KEYMAP); KEYMAP is used to read
4070key sequences and look up bindings iff VARIABLE's value is non-nil. 4070key sequences and look up bindings if VARIABLE's value is non-nil.
4071If two active keymaps bind the same key, the keymap appearing earlier 4071If two active keymaps bind the same key, the keymap appearing earlier
4072in the list takes precedence. */); 4072in the list takes precedence. */);
4073 Vminor_mode_map_alist = Qnil; 4073 Vminor_mode_map_alist = Qnil;
diff --git a/src/lisp.h b/src/lisp.h
index 6dee6e0a7d4..2273015d643 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1444,7 +1444,7 @@ typedef unsigned char UCHAR;
1444#define GLYPH_CHAR(f, g) (FAST_GLYPH_CHAR (g)) 1444#define GLYPH_CHAR(f, g) (FAST_GLYPH_CHAR (g))
1445#define GLYPH_FACE(f, g) (FAST_GLYPH_FACE (g)) 1445#define GLYPH_FACE(f, g) (FAST_GLYPH_FACE (g))
1446 1446
1447/* Return 1 iff GLYPH contains valid character code. */ 1447/* Return 1 if GLYPH contains valid character code. */
1448#define GLYPH_CHAR_VALID_P(glyph) CHAR_VALID_P (FAST_GLYPH_CHAR (glyph), 1) 1448#define GLYPH_CHAR_VALID_P(glyph) CHAR_VALID_P (FAST_GLYPH_CHAR (glyph), 1)
1449 1449
1450/* The ID of the mode line highlighting face. */ 1450/* The ID of the mode line highlighting face. */
@@ -1591,7 +1591,7 @@ typedef unsigned char UCHAR;
1591 "dead", which is what we want; this is an argument-checking macro, and 1591 "dead", which is what we want; this is an argument-checking macro, and
1592 the user should never get access to interior windows. 1592 the user should never get access to interior windows.
1593 1593
1594 A window of any sort, leaf or interior, is dead iff the buffer, 1594 A window of any sort, leaf or interior, is dead if the buffer,
1595 vchild, and hchild members are all nil. */ 1595 vchild, and hchild members are all nil. */
1596 1596
1597#define CHECK_LIVE_WINDOW(x) \ 1597#define CHECK_LIVE_WINDOW(x) \
diff --git a/src/lread.c b/src/lread.c
index 78e8b2730fe..bc667fc9270 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -95,7 +95,7 @@ Lisp_Object Qfile_truename, Qdo_after_load_evaluation; /* ACM 2006/5/16 */
95extern Lisp_Object Qevent_symbol_element_mask; 95extern Lisp_Object Qevent_symbol_element_mask;
96extern Lisp_Object Qfile_exists_p; 96extern Lisp_Object Qfile_exists_p;
97 97
98/* non-zero iff inside `load' */ 98/* non-zero if inside `load' */
99int load_in_progress; 99int load_in_progress;
100 100
101/* Directory in which the sources were found. */ 101/* Directory in which the sources were found. */
@@ -1128,7 +1128,7 @@ in which case file-name-handlers are ignored. */)
1128 On success, returns a file descriptor. On failure, returns -1. 1128 On success, returns a file descriptor. On failure, returns -1.
1129 1129
1130 SUFFIXES is a list of strings containing possible suffixes. 1130 SUFFIXES is a list of strings containing possible suffixes.
1131 The empty suffix is automatically added iff the list is empty. 1131 The empty suffix is automatically added if the list is empty.
1132 1132
1133 PREDICATE non-nil means don't open the files, 1133 PREDICATE non-nil means don't open the files,
1134 just look for one that satisfies the predicate. In this case, 1134 just look for one that satisfies the predicate. In this case,
@@ -4079,7 +4079,7 @@ customize `jka-compr-load-suffixes' rather than the present variable. */);
4079 Vload_file_rep_suffixes = Fcons (empty_unibyte_string, Qnil); 4079 Vload_file_rep_suffixes = Fcons (empty_unibyte_string, Qnil);
4080 4080
4081 DEFVAR_BOOL ("load-in-progress", &load_in_progress, 4081 DEFVAR_BOOL ("load-in-progress", &load_in_progress,
4082 doc: /* Non-nil iff inside of `load'. */); 4082 doc: /* Non-nil if inside of `load'. */);
4083 4083
4084 DEFVAR_LISP ("after-load-alist", &Vafter_load_alist, 4084 DEFVAR_LISP ("after-load-alist", &Vafter_load_alist,
4085 doc: /* An alist of expressions to be evalled when particular files are loaded. 4085 doc: /* An alist of expressions to be evalled when particular files are loaded.
diff --git a/src/m/7300.h b/src/m/7300.h
index b590593abc8..6e439a829cc 100644
--- a/src/m/7300.h
+++ b/src/m/7300.h
@@ -30,7 +30,7 @@ Boston, MA 02110-1301, USA. */
30/* # define SHORTNAMES */ 30/* # define SHORTNAMES */
31 31
32 32
33/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 33/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
34 is the most significant byte. */ 34 is the most significant byte. */
35 35
36#define WORDS_BIG_ENDIAN 36#define WORDS_BIG_ENDIAN
diff --git a/src/m/acorn.h b/src/m/acorn.h
index 7fa5991e28b..148d46454ab 100644
--- a/src/m/acorn.h
+++ b/src/m/acorn.h
@@ -21,7 +21,7 @@ Boston, MA 02110-1301, USA. */
21 21
22 22
23 23
24/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 24/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
25 is the most significant byte. */ 25 is the most significant byte. */
26 26
27#undef WORDS_BIG_ENDIAN 27#undef WORDS_BIG_ENDIAN
diff --git a/src/m/alliant-2800.h b/src/m/alliant-2800.h
index 3d65f9d1f12..405267afb2b 100644
--- a/src/m/alliant-2800.h
+++ b/src/m/alliant-2800.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="bsd4-3" */ 25 USUAL-OPSYS="bsd4-3" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#undef WORDS_BIG_ENDIAN 30#undef WORDS_BIG_ENDIAN
diff --git a/src/m/alliant.h b/src/m/alliant.h
index b871d4a2385..7cad4bfb0c1 100644
--- a/src/m/alliant.h
+++ b/src/m/alliant.h
@@ -26,7 +26,7 @@ Boston, MA 02110-1301, USA. */
26 operating system this machine is likely to run. 26 operating system this machine is likely to run.
27 USUAL-OPSYS="bsd4-2" */ 27 USUAL-OPSYS="bsd4-2" */
28 28
29/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 29/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
30 is the most significant byte. */ 30 is the most significant byte. */
31 31
32#define WORDS_BIG_ENDIAN 32#define WORDS_BIG_ENDIAN
diff --git a/src/m/alpha.h b/src/m/alpha.h
index 84e74d581d1..5e46a05ab68 100644
--- a/src/m/alpha.h
+++ b/src/m/alpha.h
@@ -35,7 +35,7 @@ NOTE-END
35 on OSF 4/5 -- fx. */ 35 on OSF 4/5 -- fx. */
36#endif 36#endif
37 37
38/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 38/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
39 is the most significant byte. */ 39 is the most significant byte. */
40 40
41#undef WORDS_BIG_ENDIAN 41#undef WORDS_BIG_ENDIAN
diff --git a/src/m/altos.h b/src/m/altos.h
index 8a1cb138345..0f4bb9b810f 100644
--- a/src/m/altos.h
+++ b/src/m/altos.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-2" */ 25 USUAL-OPSYS="usg5-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/amdahl.h b/src/m/amdahl.h
index 3d9ee17e91f..486e2925a55 100644
--- a/src/m/amdahl.h
+++ b/src/m/amdahl.h
@@ -31,7 +31,7 @@ This file works with the Amdahl uts native C compiler. The 5.2u370
31compiler is so brain damaged that it is not even worth trying to use it. 31compiler is so brain damaged that it is not even worth trying to use it.
32*/ 32*/
33 33
34/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 34/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
35 is the most significant byte. */ 35 is the most significant byte. */
36 36
37#define WORDS_BIG_ENDIAN 37#define WORDS_BIG_ENDIAN
diff --git a/src/m/amdx86-64.h b/src/m/amdx86-64.h
index fbd53a955a2..681be8b0647 100644
--- a/src/m/amdx86-64.h
+++ b/src/m/amdx86-64.h
@@ -26,7 +26,7 @@ Boston, MA 02110-1301, USA. */
26#define BITS_PER_LONG 64 26#define BITS_PER_LONG 64
27#define BITS_PER_EMACS_INT 64 27#define BITS_PER_EMACS_INT 64
28 28
29/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 29/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
30 is the most significant byte. */ 30 is the most significant byte. */
31 31
32#undef WORDS_BIG_ENDIAN 32#undef WORDS_BIG_ENDIAN
diff --git a/src/m/apollo.h b/src/m/apollo.h
index b769c24c294..2eac3098db9 100644
--- a/src/m/apollo.h
+++ b/src/m/apollo.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="bsd4-3" */ 25 USUAL-OPSYS="bsd4-3" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/arm.h b/src/m/arm.h
index b1df83f9b70..697179723f7 100644
--- a/src/m/arm.h
+++ b/src/m/arm.h
@@ -21,7 +21,7 @@ Boston, MA 02110-1301, USA. */
21 21
22 22
23 23
24/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 24/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
25 is the most significant byte. */ 25 is the most significant byte. */
26 26
27#undef WORDS_BIG_ENDIAN 27#undef WORDS_BIG_ENDIAN
diff --git a/src/m/att3b.h b/src/m/att3b.h
index 3344aabc2a9..8e9a589bcd2 100644
--- a/src/m/att3b.h
+++ b/src/m/att3b.h
@@ -26,7 +26,7 @@ Boston, MA 02110-1301, USA. */
26 operating system this machine is likely to run. 26 operating system this machine is likely to run.
27 USUAL-OPSYS="usg5-2-2" */ 27 USUAL-OPSYS="usg5-2-2" */
28 28
29/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 29/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
30 is the most significant byte. */ 30 is the most significant byte. */
31 31
32#define WORDS_BIG_ENDIAN 32#define WORDS_BIG_ENDIAN
diff --git a/src/m/aviion.h b/src/m/aviion.h
index 7f3f7f253d5..832feb79a00 100644
--- a/src/m/aviion.h
+++ b/src/m/aviion.h
@@ -20,7 +20,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20Boston, MA 02110-1301, USA. */ 20Boston, MA 02110-1301, USA. */
21 21
22 22
23/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 23/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
24 is the most significant byte. */ 24 is the most significant byte. */
25 25
26#define WORDS_BIG_ENDIAN 26#define WORDS_BIG_ENDIAN
diff --git a/src/m/celerity.h b/src/m/celerity.h
index 76f1e1729b3..556c2765883 100644
--- a/src/m/celerity.h
+++ b/src/m/celerity.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="bsd4-2" */ 25 USUAL-OPSYS="bsd4-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/clipper.h b/src/m/clipper.h
index de99ba97eb5..c0006f48eab 100644
--- a/src/m/clipper.h
+++ b/src/m/clipper.h
@@ -20,7 +20,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20Boston, MA 02110-1301, USA. */ 20Boston, MA 02110-1301, USA. */
21 21
22 22
23/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 23/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
24 is the most significant byte. */ 24 is the most significant byte. */
25 25
26#undef WORDS_BIG_ENDIAN 26#undef WORDS_BIG_ENDIAN
diff --git a/src/m/cnvrgnt.h b/src/m/cnvrgnt.h
index f64fc86b08b..22478a273b6 100644
--- a/src/m/cnvrgnt.h
+++ b/src/m/cnvrgnt.h
@@ -20,7 +20,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20Boston, MA 02110-1301, USA. */ 20Boston, MA 02110-1301, USA. */
21 21
22 22
23/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 23/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
24 is the most significant byte. */ 24 is the most significant byte. */
25 25
26#define WORDS_BIG_ENDIAN 26#define WORDS_BIG_ENDIAN
diff --git a/src/m/convex.h b/src/m/convex.h
index 7f90d22117c..c8f447cf2fa 100644
--- a/src/m/convex.h
+++ b/src/m/convex.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="bsd4-3" */ 25 USUAL-OPSYS="bsd4-3" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/cydra5.h b/src/m/cydra5.h
index 2361fb4b589..4c95f226371 100644
--- a/src/m/cydra5.h
+++ b/src/m/cydra5.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-3" */ 25 USUAL-OPSYS="usg5-3" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/delta88k.h b/src/m/delta88k.h
index c767e1db1ca..b5d0c8f190b 100644
--- a/src/m/delta88k.h
+++ b/src/m/delta88k.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-3" */ 25 USUAL-OPSYS="usg5-3" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/dpx2.h b/src/m/dpx2.h
index 1c1d146a08a..b39ef93ee34 100644
--- a/src/m/dpx2.h
+++ b/src/m/dpx2.h
@@ -32,7 +32,7 @@ Boston, MA 02110-1301, USA. */
32/* #define ncl_el /* DPX/2 210,220 etc */ 32/* #define ncl_el /* DPX/2 210,220 etc */
33/* #define ncl_mr 1 /* DPX/2 320,340 (and 360,380 ?) */ 33/* #define ncl_mr 1 /* DPX/2 320,340 (and 360,380 ?) */
34 34
35/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 35/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
36 is the most significant byte. */ 36 is the most significant byte. */
37 37
38#define WORDS_BIG_ENDIAN 38#define WORDS_BIG_ENDIAN
diff --git a/src/m/dual.h b/src/m/dual.h
index 4fda7a8a96c..d287f9502d2 100644
--- a/src/m/dual.h
+++ b/src/m/dual.h
@@ -35,7 +35,7 @@ Dual running Uniplus (-machine=dual -opsystem=unipl5-2)
35NOTE-END */ 35NOTE-END */
36 36
37 37
38/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 38/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
39 is the most significant byte. */ 39 is the most significant byte. */
40 40
41#define WORDS_BIG_ENDIAN 41#define WORDS_BIG_ENDIAN
diff --git a/src/m/elxsi.h b/src/m/elxsi.h
index 81689e66e52..07a00bbf714 100644
--- a/src/m/elxsi.h
+++ b/src/m/elxsi.h
@@ -27,7 +27,7 @@ Boston, MA 02110-1301, USA. */
27/* This file was modified by Matt Crawford <matt@tank.uchicago.edu> 27/* This file was modified by Matt Crawford <matt@tank.uchicago.edu>
28 to work under Elxsi's 12.0 release of BSD unix. */ 28 to work under Elxsi's 12.0 release of BSD unix. */
29 29
30/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 30/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
31 is the most significant byte. */ 31 is the most significant byte. */
32 32
33#undef WORDS_BIG_ENDIAN 33#undef WORDS_BIG_ENDIAN
diff --git a/src/m/gould.h b/src/m/gould.h
index c31f50249e7..cd16e09b785 100644
--- a/src/m/gould.h
+++ b/src/m/gould.h
@@ -49,7 +49,7 @@ Gould Power Node (-machine=gould -opsystem=bsd4-2 or bsd4-3)
49 A site running a pre-release of 2.1 should #define RELEASE2_1 in config.h. 49 A site running a pre-release of 2.1 should #define RELEASE2_1 in config.h.
50NOTE-END */ 50NOTE-END */
51 51
52/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 52/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
53 is the most significant byte. */ 53 is the most significant byte. */
54 54
55#define WORDS_BIG_ENDIAN 55#define WORDS_BIG_ENDIAN
diff --git a/src/m/hp800.h b/src/m/hp800.h
index d54690104b5..83465052478 100644
--- a/src/m/hp800.h
+++ b/src/m/hp800.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="hpux" */ 25 USUAL-OPSYS="hpux" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/hp9000s300.h b/src/m/hp9000s300.h
index 3718bb3f3ae..9a27065f866 100644
--- a/src/m/hp9000s300.h
+++ b/src/m/hp9000s300.h
@@ -59,7 +59,7 @@ NOTE-END */
59 59
60/* #define HPUX_5 */ 60/* #define HPUX_5 */
61 61
62/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 62/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
63 is the most significant byte. */ 63 is the most significant byte. */
64 64
65#define WORDS_BIG_ENDIAN 65#define WORDS_BIG_ENDIAN
diff --git a/src/m/i860.h b/src/m/i860.h
index 1255f2f1576..6d79c5c8d38 100644
--- a/src/m/i860.h
+++ b/src/m/i860.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ 25 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#undef WORDS_BIG_ENDIAN 30#undef WORDS_BIG_ENDIAN
diff --git a/src/m/ia64.h b/src/m/ia64.h
index b6fea6b8fd7..8f7fed8d69e 100644
--- a/src/m/ia64.h
+++ b/src/m/ia64.h
@@ -23,7 +23,7 @@ Boston, MA 02110-1301, USA. */
23#define BITS_PER_LONG 64 23#define BITS_PER_LONG 64
24#define BITS_PER_EMACS_INT 64 24#define BITS_PER_EMACS_INT 64
25 25
26/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 26/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
27 is the most significant byte. */ 27 is the most significant byte. */
28 28
29#undef WORDS_BIG_ENDIAN 29#undef WORDS_BIG_ENDIAN
diff --git a/src/m/ibm370aix.h b/src/m/ibm370aix.h
index f632a30780b..0195ec141ab 100644
--- a/src/m/ibm370aix.h
+++ b/src/m/ibm370aix.h
@@ -30,7 +30,7 @@ Boston, MA 02110-1301, USA. */
30#undef INTEL386 30#undef INTEL386
31#undef aix386 31#undef aix386
32 32
33/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 33/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
34 is the most significant byte. */ 34 is the most significant byte. */
35 35
36#define WORDS_BIG_ENDIAN 36#define WORDS_BIG_ENDIAN
diff --git a/src/m/ibmps2-aix.h b/src/m/ibmps2-aix.h
index 8882052b006..8c975b81bb9 100644
--- a/src/m/ibmps2-aix.h
+++ b/src/m/ibmps2-aix.h
@@ -30,7 +30,7 @@ NOTE-START
30 work with certain new X window managers, and may be suboptimal. 30 work with certain new X window managers, and may be suboptimal.
31NOTE-END */ 31NOTE-END */
32 32
33/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 33/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
34 is the most significant byte. */ 34 is the most significant byte. */
35 35
36#undef WORDS_BIG_ENDIAN 36#undef WORDS_BIG_ENDIAN
diff --git a/src/m/ibmrs6000.h b/src/m/ibmrs6000.h
index 2a298e7f760..d542c07ad0a 100644
--- a/src/m/ibmrs6000.h
+++ b/src/m/ibmrs6000.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="aix3-1" */ 25 USUAL-OPSYS="aix3-1" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#ifdef USG5_4 30#ifdef USG5_4
diff --git a/src/m/ibmrt-aix.h b/src/m/ibmrt-aix.h
index d24e99fe6d6..57a9dbc4df1 100644
--- a/src/m/ibmrt-aix.h
+++ b/src/m/ibmrt-aix.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-2-2" */ 25 USUAL-OPSYS="usg5-2-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/ibmrt.h b/src/m/ibmrt.h
index 55cbfd88371..ca32db94518 100644
--- a/src/m/ibmrt.h
+++ b/src/m/ibmrt.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="bsd4-2" */ 25 USUAL-OPSYS="bsd4-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/ibms390.h b/src/m/ibms390.h
index aece0f7599e..1c7165e04c0 100644
--- a/src/m/ibms390.h
+++ b/src/m/ibms390.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ 25 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/ibms390x.h b/src/m/ibms390x.h
index fb1f210c634..64ede365d0c 100644
--- a/src/m/ibms390x.h
+++ b/src/m/ibms390x.h
@@ -36,7 +36,7 @@ NOTE-END */
36#define BITS_PER_LONG 64 36#define BITS_PER_LONG 64
37#define BITS_PER_EMACS_INT 64 37#define BITS_PER_EMACS_INT 64
38 38
39/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 39/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
40 is the most significant byte. */ 40 is the most significant byte. */
41 41
42#define WORDS_BIG_ENDIAN 42#define WORDS_BIG_ENDIAN
diff --git a/src/m/intel386.h b/src/m/intel386.h
index 7c6c2106d17..22205ed762c 100644
--- a/src/m/intel386.h
+++ b/src/m/intel386.h
@@ -50,7 +50,7 @@ Prime EXL (-machine=intel386 -opsystem=usg5-3)
50 Minor changes merged in 19.1. 50 Minor changes merged in 19.1.
51NOTE-END */ 51NOTE-END */
52 52
53/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 53/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
54 is the most significant byte. */ 54 is the most significant byte. */
55 55
56#undef WORDS_BIG_ENDIAN 56#undef WORDS_BIG_ENDIAN
diff --git a/src/m/iris4d.h b/src/m/iris4d.h
index d918c25aede..4c15131e595 100644
--- a/src/m/iris4d.h
+++ b/src/m/iris4d.h
@@ -20,7 +20,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20Boston, MA 02110-1301, USA. */ 20Boston, MA 02110-1301, USA. */
21 21
22 22
23/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 23/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
24 is the most significant byte. */ 24 is the most significant byte. */
25 25
26#define WORDS_BIG_ENDIAN 26#define WORDS_BIG_ENDIAN
diff --git a/src/m/irist.h b/src/m/irist.h
index 0b33bd964aa..c0d55f96d0f 100644
--- a/src/m/irist.h
+++ b/src/m/irist.h
@@ -58,7 +58,7 @@ NOTE-END */
58 (copy-file), it would say that it is non-critical... 58 (copy-file), it would say that it is non-critical...
59#endif /* 0 */ 59#endif /* 0 */
60 60
61/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 61/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
62 is the most significant byte. */ 62 is the most significant byte. */
63 63
64#define WORDS_BIG_ENDIAN 64#define WORDS_BIG_ENDIAN
diff --git a/src/m/isi-ov.h b/src/m/isi-ov.h
index 7e25ed9d277..6706ee9981b 100644
--- a/src/m/isi-ov.h
+++ b/src/m/isi-ov.h
@@ -30,7 +30,7 @@ NOTE-END */
30 30
31#define ISI68K 31#define ISI68K
32 32
33/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 33/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
34 is the most significant byte. */ 34 is the most significant byte. */
35 35
36#define WORDS_BIG_ENDIAN 36#define WORDS_BIG_ENDIAN
diff --git a/src/m/m68k.h b/src/m/m68k.h
index c771e863711..4c600a44d8c 100644
--- a/src/m/m68k.h
+++ b/src/m/m68k.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 the size of various data types. */ 24 the size of various data types. */
25 25
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/macppc.h b/src/m/macppc.h
index cc4afe31519..d4561c0289f 100644
--- a/src/m/macppc.h
+++ b/src/m/macppc.h
@@ -19,7 +19,7 @@ along with GNU Emacs; see the file COPYING. If not, write to
19the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20Boston, MA 02110-1301, USA. */ 20Boston, MA 02110-1301, USA. */
21 21
22/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 22/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
23 is the most significant byte. */ 23 is the most significant byte. */
24 24
25#define WORDS_BIG_ENDIAN 25#define WORDS_BIG_ENDIAN
diff --git a/src/m/masscomp.h b/src/m/masscomp.h
index ac753de1537..4e95c268860 100644
--- a/src/m/masscomp.h
+++ b/src/m/masscomp.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="rtu" */ 25 USUAL-OPSYS="rtu" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/mega68.h b/src/m/mega68.h
index 6d991ba06a2..0d22b572fc5 100644
--- a/src/m/mega68.h
+++ b/src/m/mega68.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="bsd4-2" */ 25 USUAL-OPSYS="bsd4-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/mg1.h b/src/m/mg1.h
index 647544e21e4..515e9e23a96 100644
--- a/src/m/mg1.h
+++ b/src/m/mg1.h
@@ -34,7 +34,7 @@ own configuration files, please let the Free Software Foundation in on
34your work; we'd like to distribute this information. 34your work; we'd like to distribute this information.
35NOTE-END */ 35NOTE-END */
36 36
37/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 37/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
38 is the most significant byte. */ 38 is the most significant byte. */
39 39
40#undef WORDS_BIG_ENDIAN 40#undef WORDS_BIG_ENDIAN
diff --git a/src/m/mips-siemens.h b/src/m/mips-siemens.h
index d90a651d361..53366a1332e 100644
--- a/src/m/mips-siemens.h
+++ b/src/m/mips-siemens.h
@@ -36,7 +36,7 @@ This is the m- file for SNI RM*00 machines. Use s- sinix5-4.h file!
36With this the file mips-siemens.h is obsolete. 36With this the file mips-siemens.h is obsolete.
37NOTE-END */ 37NOTE-END */
38 38
39/* Define BIG_ENDIAN iff lowest-numbered byte in a word 39/* Define BIG_ENDIAN if lowest-numbered byte in a word
40 is the most significant byte. */ 40 is the most significant byte. */
41 41
42#define BIG_ENDIAN 42#define BIG_ENDIAN
diff --git a/src/m/mips.h b/src/m/mips.h
index b18324fb8b7..6c039c5e14c 100644
--- a/src/m/mips.h
+++ b/src/m/mips.h
@@ -29,7 +29,7 @@ Use mips4.h for RISCOS version 4; use s-bsd4-3.h with the BSD world.
29Note that the proper m file for the Decstation is pmax.h. 29Note that the proper m file for the Decstation is pmax.h.
30NOTE-END */ 30NOTE-END */
31 31
32/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 32/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
33 is the most significant byte. */ 33 is the most significant byte. */
34 34
35#if ! (defined (__MIPSEL__) || defined (MIPSEL) || defined (_MIPSEL)) 35#if ! (defined (__MIPSEL__) || defined (MIPSEL) || defined (_MIPSEL))
diff --git a/src/m/news.h b/src/m/news.h
index 419015dd150..084c5abb92c 100644
--- a/src/m/news.h
+++ b/src/m/news.h
@@ -34,7 +34,7 @@ NOTE-END */
34#define m68000 34#define m68000
35#endif 35#endif
36 36
37/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 37/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
38 is the most significant byte. */ 38 is the most significant byte. */
39 39
40#define WORDS_BIG_ENDIAN 40#define WORDS_BIG_ENDIAN
diff --git a/src/m/next.h b/src/m/next.h
index ef92607d957..bca8ac39d47 100644
--- a/src/m/next.h
+++ b/src/m/next.h
@@ -26,7 +26,7 @@ Boston, MA 02110-1301, USA. */
26#define NeXT 26#define NeXT
27#endif 27#endif
28 28
29/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 29/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
30 is the most significant byte. */ 30 is the most significant byte. */
31 31
32/* Let the compiler tell us. */ 32/* Let the compiler tell us. */
diff --git a/src/m/ns16000.h b/src/m/ns16000.h
index c64bfa32482..6feddd97610 100644
--- a/src/m/ns16000.h
+++ b/src/m/ns16000.h
@@ -30,7 +30,7 @@ For a Tektronix 16000 box (a 6130, perhaps?), use `-opsystem=bsd4-2'.
30Use `-machine=ns16000' for both. 30Use `-machine=ns16000' for both.
31NOTE-END */ 31NOTE-END */
32 32
33/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 33/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
34 is the most significant byte. */ 34 is the most significant byte. */
35 35
36#undef WORDS_BIG_ENDIAN 36#undef WORDS_BIG_ENDIAN
diff --git a/src/m/ns32000.h b/src/m/ns32000.h
index 0b776115ca8..b6484b4b219 100644
--- a/src/m/ns32000.h
+++ b/src/m/ns32000.h
@@ -25,7 +25,7 @@ Boston, MA 02110-1301, USA. */
25 operating system this machine is likely to run. 25 operating system this machine is likely to run.
26 USUAL-OPSYS="usg5-2" */ 26 USUAL-OPSYS="usg5-2" */
27 27
28/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 28/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
29 is the most significant byte. */ 29 is the most significant byte. */
30 30
31#undef WORDS_BIG_ENDIAN 31#undef WORDS_BIG_ENDIAN
diff --git a/src/m/nu.h b/src/m/nu.h
index 347606a6c01..279d14ff915 100644
--- a/src/m/nu.h
+++ b/src/m/nu.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-2" */ 25 USUAL-OPSYS="usg5-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/orion.h b/src/m/orion.h
index 36a74b3cc3b..cc3a7e395fc 100644
--- a/src/m/orion.h
+++ b/src/m/orion.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="bsd4-2" */ 25 USUAL-OPSYS="bsd4-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#undef WORDS_BIG_ENDIAN 30#undef WORDS_BIG_ENDIAN
diff --git a/src/m/orion105.h b/src/m/orion105.h
index 73408ed1b2f..fabcf67e2a9 100644
--- a/src/m/orion105.h
+++ b/src/m/orion105.h
@@ -25,7 +25,7 @@ Boston, MA 02110-1301, USA. */
25 operating system this machine is likely to run. 25 operating system this machine is likely to run.
26 USUAL-OPSYS="bsd4-2" */ 26 USUAL-OPSYS="bsd4-2" */
27 27
28/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 28/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
29 is the most significant byte. */ 29 is the most significant byte. */
30 30
31#undef WORDS_BIG_ENDIAN 31#undef WORDS_BIG_ENDIAN
diff --git a/src/m/pfa50.h b/src/m/pfa50.h
index 8f1f146000e..5f98dc993c7 100644
--- a/src/m/pfa50.h
+++ b/src/m/pfa50.h
@@ -20,7 +20,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20Boston, MA 02110-1301, USA. */ 20Boston, MA 02110-1301, USA. */
21 21
22 22
23/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 23/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
24 is the most significant byte. */ 24 is the most significant byte. */
25 25
26#define WORDS_BIG_ENDIAN 26#define WORDS_BIG_ENDIAN
diff --git a/src/m/plexus.h b/src/m/plexus.h
index 4a4e6a32f7f..51961977904 100644
--- a/src/m/plexus.h
+++ b/src/m/plexus.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-2" */ 25 USUAL-OPSYS="usg5-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/powermac.h b/src/m/powermac.h
index 729bbb0358b..2dde47bd6cf 100644
--- a/src/m/powermac.h
+++ b/src/m/powermac.h
@@ -23,7 +23,7 @@ Boston, MA 02110-1301, USA. */
23 operating system this machine is likely to run. 23 operating system this machine is likely to run.
24 USUAL-OPSYS="darwin" */ 24 USUAL-OPSYS="darwin" */
25 25
26/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 26/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
27 is the most significant byte. */ 27 is the most significant byte. */
28 28
29#define WORDS_BIG_ENDIAN 29#define WORDS_BIG_ENDIAN
diff --git a/src/m/powerpcle.h b/src/m/powerpcle.h
index 403d6986bf8..5be26e93b17 100644
--- a/src/m/powerpcle.h
+++ b/src/m/powerpcle.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 USUAL-OPSYS="Solaris2.5.1 Windows/NT AIX 4.1.2" 24 USUAL-OPSYS="Solaris2.5.1 Windows/NT AIX 4.1.2"
25*/ 25*/
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#undef WORDS_BIG_ENDIAN 30#undef WORDS_BIG_ENDIAN
diff --git a/src/m/pyramid.h b/src/m/pyramid.h
index 9ee3fefe387..1b834c60ba0 100644
--- a/src/m/pyramid.h
+++ b/src/m/pyramid.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="bsd4-2" */ 25 USUAL-OPSYS="bsd4-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/sequent.h b/src/m/sequent.h
index be5d3f19bd1..3c06d854b41 100644
--- a/src/m/sequent.h
+++ b/src/m/sequent.h
@@ -31,7 +31,7 @@ NOTE-END */
31/* NOTE: this file works for DYNIX release 2.0 31/* NOTE: this file works for DYNIX release 2.0
32 (not tested on 1.3) on NS32000's */ 32 (not tested on 1.3) on NS32000's */
33 33
34/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 34/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
35 is the most significant byte. */ 35 is the most significant byte. */
36 36
37#undef WORDS_BIG_ENDIAN 37#undef WORDS_BIG_ENDIAN
diff --git a/src/m/sh3el.h b/src/m/sh3el.h
index 5851ade1523..eefcccea6de 100644
--- a/src/m/sh3el.h
+++ b/src/m/sh3el.h
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. */
23 operating system this machine is likely to run. 23 operating system this machine is likely to run.
24 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ 24 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
25 25
26/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 26/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
27 is the most significant byte. */ 27 is the most significant byte. */
28 28
29#undef WORDS_BIG_ENDIAN 29#undef WORDS_BIG_ENDIAN
diff --git a/src/m/sparc.h b/src/m/sparc.h
index f59c2c2b969..8df81ee91aa 100644
--- a/src/m/sparc.h
+++ b/src/m/sparc.h
@@ -28,7 +28,7 @@ Use -opsystem=sunos4 for operating system version 4, and
28-opsystem=bsd4-2 for earlier versions. 28-opsystem=bsd4-2 for earlier versions.
29NOTE-END */ 29NOTE-END */
30 30
31/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 31/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
32 is the most significant byte. */ 32 is the most significant byte. */
33 33
34#define WORDS_BIG_ENDIAN 34#define WORDS_BIG_ENDIAN
diff --git a/src/m/sps7.h b/src/m/sps7.h
index 68acf2c6c52..67fc60c1b6a 100644
--- a/src/m/sps7.h
+++ b/src/m/sps7.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-2" */ 25 USUAL-OPSYS="usg5-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/sr2k.h b/src/m/sr2k.h
index ba4a9a905ab..6c17795e058 100644
--- a/src/m/sr2k.h
+++ b/src/m/sr2k.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="hpux" */ 25 USUAL-OPSYS="hpux" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/stride.h b/src/m/stride.h
index cb0380024a1..d846a6c9843 100644
--- a/src/m/stride.h
+++ b/src/m/stride.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-2" */ 25 USUAL-OPSYS="usg5-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/sun1.h b/src/m/sun1.h
index fda451a9310..03cb4e803ff 100644
--- a/src/m/sun1.h
+++ b/src/m/sun1.h
@@ -40,7 +40,7 @@ Sun 1, 2 and 3 (-machine=sun1, -machine=sun2, -machine=sun3;
40 problems caused by bugs in the "export" version of SunOS 4. 40 problems caused by bugs in the "export" version of SunOS 4.
41NOTE-END */ 41NOTE-END */
42 42
43/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 43/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
44 is the most significant byte. */ 44 is the most significant byte. */
45 45
46#define WORDS_BIG_ENDIAN 46#define WORDS_BIG_ENDIAN
diff --git a/src/m/sun2.h b/src/m/sun2.h
index 00b7ae97c4d..e764ded3ce7 100644
--- a/src/m/sun2.h
+++ b/src/m/sun2.h
@@ -42,7 +42,7 @@ Sun 1, 2 and 3 (-machine=sun1, -machine=sun2, -machine=sun3;
42 problems caused by bugs in the "export" version of SunOS 4. 42 problems caused by bugs in the "export" version of SunOS 4.
43NOTE-END */ 43NOTE-END */
44 44
45/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 45/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
46 is the most significant byte. */ 46 is the most significant byte. */
47 47
48#define WORDS_BIG_ENDIAN 48#define WORDS_BIG_ENDIAN
diff --git a/src/m/tad68k.h b/src/m/tad68k.h
index 5e982a314ab..c8be8763fb5 100644
--- a/src/m/tad68k.h
+++ b/src/m/tad68k.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-3" */ 25 USUAL-OPSYS="usg5-3" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/tahoe.h b/src/m/tahoe.h
index 8fe41cd4109..9b9271577fc 100644
--- a/src/m/tahoe.h
+++ b/src/m/tahoe.h
@@ -29,7 +29,7 @@ Use -opsystem=bsd4-2 or -opsystem=bsd4-3, depending on the version of
29Berkeley you are running. 29Berkeley you are running.
30NOTE-END */ 30NOTE-END */
31 31
32/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 32/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
33 is the most significant byte. */ 33 is the most significant byte. */
34 34
35#define WORDS_BIG_ENDIAN 35#define WORDS_BIG_ENDIAN
diff --git a/src/m/targon31.h b/src/m/targon31.h
index 0c657e0ea5d..39e995b076d 100644
--- a/src/m/targon31.h
+++ b/src/m/targon31.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-2-2" */ 25 USUAL-OPSYS="usg5-2-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/tek4300.h b/src/m/tek4300.h
index be43210212a..6498238461d 100644
--- a/src/m/tek4300.h
+++ b/src/m/tek4300.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="bsd4-3" */ 25 USUAL-OPSYS="bsd4-3" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/tekxd88.h b/src/m/tekxd88.h
index 1d46bb9bb55..f351229292f 100644
--- a/src/m/tekxd88.h
+++ b/src/m/tekxd88.h
@@ -22,7 +22,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22Boston, MA 02110-1301, USA. */ 22Boston, MA 02110-1301, USA. */
23 23
24 24
25/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 25/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
26 is the most significant byte. */ 26 is the most significant byte. */
27 27
28#define WORDS_BIG_ENDIAN 28#define WORDS_BIG_ENDIAN
diff --git a/src/m/template.h b/src/m/template.h
index fccc5b0901c..b893ba23df2 100644
--- a/src/m/template.h
+++ b/src/m/template.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ 25 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/tower32.h b/src/m/tower32.h
index 0ce623b7f37..01daada2423 100644
--- a/src/m/tower32.h
+++ b/src/m/tower32.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-2-2" */ 25 USUAL-OPSYS="usg5-2-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/tower32v3.h b/src/m/tower32v3.h
index 226c0e2640a..ff209edab41 100644
--- a/src/m/tower32v3.h
+++ b/src/m/tower32v3.h
@@ -25,7 +25,7 @@ Boston, MA 02110-1301, USA. */
25 operating system this machine is likely to run. 25 operating system this machine is likely to run.
26 USUAL-OPSYS="usg5-3" */ 26 USUAL-OPSYS="usg5-3" */
27 27
28/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 28/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
29 is the most significant byte. */ 29 is the most significant byte. */
30 30
31#define WORDS_BIG_ENDIAN 31#define WORDS_BIG_ENDIAN
diff --git a/src/m/ustation.h b/src/m/ustation.h
index f88cdc5ee63..0ac833c28da 100644
--- a/src/m/ustation.h
+++ b/src/m/ustation.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-3" */ 25 USUAL-OPSYS="usg5-3" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/vax.h b/src/m/vax.h
index 80844ba3ba6..82695074424 100644
--- a/src/m/vax.h
+++ b/src/m/vax.h
@@ -52,7 +52,7 @@ Vax running VMS (-opsystem=vms)
52 52
53NOTE-END */ 53NOTE-END */
54 54
55/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 55/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
56 is the most significant byte. */ 56 is the most significant byte. */
57 57
58#undef WORDS_BIG_ENDIAN 58#undef WORDS_BIG_ENDIAN
diff --git a/src/m/wicat.h b/src/m/wicat.h
index 67409844666..3ac7b530739 100644
--- a/src/m/wicat.h
+++ b/src/m/wicat.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="usg5-2" */ 25 USUAL-OPSYS="usg5-2" */
26 26
27/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30#define WORDS_BIG_ENDIAN 30#define WORDS_BIG_ENDIAN
diff --git a/src/m/windowsnt.h b/src/m/windowsnt.h
index f1efe64a4f5..ddad551c772 100644
--- a/src/m/windowsnt.h
+++ b/src/m/windowsnt.h
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
24 operating system this machine is likely to run. 24 operating system this machine is likely to run.
25 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ 25 USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
26 26
27/* Define BIG_ENDIAN iff lowest-numbered byte in a word 27/* Define BIG_ENDIAN if lowest-numbered byte in a word
28 is the most significant byte. */ 28 is the most significant byte. */
29 29
30/* #define BIG_ENDIAN */ 30/* #define BIG_ENDIAN */
diff --git a/src/m/xps100.h b/src/m/xps100.h
index 691f5fedbd6..3b378319ceb 100644
--- a/src/m/xps100.h
+++ b/src/m/xps100.h
@@ -26,7 +26,7 @@ Boston, MA 02110-1301, USA. */
26 operating system this machine is likely to run. 26 operating system this machine is likely to run.
27 USUAL-OPSYS="usg5-2" */ 27 USUAL-OPSYS="usg5-2" */
28 28
29/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 29/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
30 is the most significant byte. */ 30 is the most significant byte. */
31 31
32#define WORDS_BIG_ENDIAN 32#define WORDS_BIG_ENDIAN
diff --git a/src/mac.c b/src/mac.c
index e81db1479b9..64af2407ab1 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -1127,18 +1127,15 @@ Lisp_Object
1127cfdate_to_lisp (date) 1127cfdate_to_lisp (date)
1128 CFDateRef date; 1128 CFDateRef date;
1129{ 1129{
1130 static const CFGregorianDate epoch_gdate = {1970, 1, 1, 0, 0, 0.0}; 1130 CFTimeInterval sec;
1131 static CFAbsoluteTime epoch = 0.0, sec; 1131 int high, low, microsec;
1132 int high, low;
1133 1132
1134 if (epoch == 0.0) 1133 sec = CFDateGetAbsoluteTime (date) + kCFAbsoluteTimeIntervalSince1970;
1135 epoch = CFGregorianDateGetAbsoluteTime (epoch_gdate, NULL);
1136
1137 sec = CFDateGetAbsoluteTime (date) - epoch;
1138 high = sec / 65536.0; 1134 high = sec / 65536.0;
1139 low = sec - high * 65536.0; 1135 low = sec - high * 65536.0;
1136 microsec = (sec - floor (sec)) * 1000000.0;
1140 1137
1141 return list3 (make_number (high), make_number (low), make_number (0)); 1138 return list3 (make_number (high), make_number (low), make_number (microsec));
1142} 1139}
1143 1140
1144 1141
diff --git a/src/macmenu.c b/src/macmenu.c
index 71b384c0762..8305c89ee68 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -2331,6 +2331,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
2331 ((value) + DIALOG_BUTTON_COMMAND_ID_OFFSET) 2331 ((value) + DIALOG_BUTTON_COMMAND_ID_OFFSET)
2332 2332
2333extern EMACS_TIME timer_check P_ ((int)); 2333extern EMACS_TIME timer_check P_ ((int));
2334static int quit_dialog_event_loop;
2334 2335
2335static pascal OSStatus 2336static pascal OSStatus
2336mac_handle_dialog_event (next_handler, event, data) 2337mac_handle_dialog_event (next_handler, event, data)
@@ -2340,7 +2341,6 @@ mac_handle_dialog_event (next_handler, event, data)
2340{ 2341{
2341 OSStatus err, result = eventNotHandledErr; 2342 OSStatus err, result = eventNotHandledErr;
2342 WindowRef window = (WindowRef) data; 2343 WindowRef window = (WindowRef) data;
2343 int quit_event_loop_p = 0;
2344 2344
2345 switch (GetEventClass (event)) 2345 switch (GetEventClass (event))
2346 { 2346 {
@@ -2355,7 +2355,7 @@ mac_handle_dialog_event (next_handler, event, data)
2355 if (DIALOG_BUTTON_COMMAND_ID_P (command.commandID)) 2355 if (DIALOG_BUTTON_COMMAND_ID_P (command.commandID))
2356 { 2356 {
2357 SetWRefCon (window, command.commandID); 2357 SetWRefCon (window, command.commandID);
2358 quit_event_loop_p = 1; 2358 quit_dialog_event_loop = 1;
2359 break; 2359 break;
2360 } 2360 }
2361 2361
@@ -2379,7 +2379,7 @@ mac_handle_dialog_event (next_handler, event, data)
2379 switch (char_code) 2379 switch (char_code)
2380 { 2380 {
2381 case kEscapeCharCode: 2381 case kEscapeCharCode:
2382 quit_event_loop_p = 1; 2382 quit_dialog_event_loop = 1;
2383 break; 2383 break;
2384 2384
2385 default: 2385 default:
@@ -2395,7 +2395,7 @@ mac_handle_dialog_event (next_handler, event, data)
2395 NULL, &key_code); 2395 NULL, &key_code);
2396 if (err == noErr) 2396 if (err == noErr)
2397 if (mac_quit_char_key_p (modifiers, key_code)) 2397 if (mac_quit_char_key_p (modifiers, key_code))
2398 quit_event_loop_p = 1; 2398 quit_dialog_event_loop = 1;
2399 } 2399 }
2400 break; 2400 break;
2401 } 2401 }
@@ -2406,7 +2406,7 @@ mac_handle_dialog_event (next_handler, event, data)
2406 abort (); 2406 abort ();
2407 } 2407 }
2408 2408
2409 if (quit_event_loop_p) 2409 if (quit_dialog_event_loop)
2410 { 2410 {
2411 err = QuitEventLoop (GetCurrentEventLoop ()); 2411 err = QuitEventLoop (GetCurrentEventLoop ());
2412 if (err == noErr) 2412 if (err == noErr)
@@ -2733,6 +2733,7 @@ create_and_show_dialog (f, first_wv)
2733 { 2733 {
2734 EventTargetRef toolbox_dispatcher = GetEventDispatcherTarget (); 2734 EventTargetRef toolbox_dispatcher = GetEventDispatcherTarget ();
2735 2735
2736 quit_dialog_event_loop = 0;
2736 while (1) 2737 while (1)
2737 { 2738 {
2738 EMACS_TIME next_time = timer_check (1); 2739 EMACS_TIME next_time = timer_check (1);
@@ -2758,12 +2759,22 @@ create_and_show_dialog (f, first_wv)
2758 SendEventToEventTarget (event, toolbox_dispatcher); 2759 SendEventToEventTarget (event, toolbox_dispatcher);
2759 ReleaseEvent (event); 2760 ReleaseEvent (event);
2760 } 2761 }
2762#ifdef MAC_OSX
2761 else if (err != eventLoopTimedOutErr) 2763 else if (err != eventLoopTimedOutErr)
2762 { 2764 {
2763 if (err == eventLoopQuitErr) 2765 if (err == eventLoopQuitErr)
2764 err = noErr; 2766 err = noErr;
2765 break; 2767 break;
2766 } 2768 }
2769#else
2770 /* The return value of ReceiveNextEvent seems to be
2771 unreliable. Use our own global variable instead. */
2772 if (quit_dialog_event_loop)
2773 {
2774 err = noErr;
2775 break;
2776 }
2777#endif
2767 } 2778 }
2768 } 2779 }
2769 if (err == noErr) 2780 if (err == noErr)
diff --git a/src/macselect.c b/src/macselect.c
index 04034c499b7..9515a5774ec 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -25,22 +25,27 @@ Boston, MA 02110-1301, USA. */
25#include "blockinput.h" 25#include "blockinput.h"
26#include "keymap.h" 26#include "keymap.h"
27 27
28#if !TARGET_API_MAC_CARBON 28#if TARGET_API_MAC_CARBON
29typedef ScrapRef Selection;
30#else /* !TARGET_API_MAC_CARBON */
31#include <Scrap.h>
29#include <Endian.h> 32#include <Endian.h>
30typedef int ScrapRef; 33typedef int Selection;
31typedef ResType ScrapFlavorType;
32#endif /* !TARGET_API_MAC_CARBON */ 34#endif /* !TARGET_API_MAC_CARBON */
33 35
34static OSStatus get_scrap_from_symbol P_ ((Lisp_Object, int, ScrapRef *)); 36static OSStatus mac_get_selection_from_symbol P_ ((Lisp_Object, int,
35static ScrapFlavorType get_flavor_type_from_symbol P_ ((Lisp_Object)); 37 Selection *));
36static int valid_scrap_target_type_p P_ ((Lisp_Object)); 38static ScrapFlavorType get_flavor_type_from_symbol P_ ((Lisp_Object,
37static OSStatus clear_scrap P_ ((ScrapRef *)); 39 Selection));
38static OSStatus put_scrap_string P_ ((ScrapRef, Lisp_Object, Lisp_Object)); 40static int mac_valid_selection_target_p P_ ((Lisp_Object));
39static OSStatus put_scrap_private_timestamp P_ ((ScrapRef, unsigned long)); 41static OSStatus mac_clear_selection P_ ((Selection *));
40static ScrapFlavorType scrap_has_target_type P_ ((ScrapRef, Lisp_Object)); 42static Lisp_Object mac_get_selection_ownership_info P_ ((Selection));
41static Lisp_Object get_scrap_string P_ ((ScrapRef, Lisp_Object)); 43static int mac_valid_selection_value_p P_ ((Lisp_Object, Lisp_Object));
42static OSStatus get_scrap_private_timestamp P_ ((ScrapRef, unsigned long *)); 44static OSStatus mac_put_selection_value P_ ((Selection, Lisp_Object,
43static Lisp_Object get_scrap_target_type_list P_ ((ScrapRef)); 45 Lisp_Object));
46static int mac_selection_has_target_p P_ ((Selection, Lisp_Object));
47static Lisp_Object mac_get_selection_value P_ ((Selection, Lisp_Object));
48static Lisp_Object mac_get_selection_target_list P_ ((Selection));
44static void x_own_selection P_ ((Lisp_Object, Lisp_Object)); 49static void x_own_selection P_ ((Lisp_Object, Lisp_Object));
45static Lisp_Object x_get_local_selection P_ ((Lisp_Object, Lisp_Object, int)); 50static Lisp_Object x_get_local_selection P_ ((Lisp_Object, Lisp_Object, int));
46static Lisp_Object x_get_foreign_selection P_ ((Lisp_Object, 51static Lisp_Object x_get_foreign_selection P_ ((Lisp_Object,
@@ -56,7 +61,7 @@ void init_service_handler P_ ((void));
56Lisp_Object QPRIMARY, QSECONDARY, QTIMESTAMP, QTARGETS; 61Lisp_Object QPRIMARY, QSECONDARY, QTIMESTAMP, QTARGETS;
57 62
58static Lisp_Object Vx_lost_selection_functions; 63static Lisp_Object Vx_lost_selection_functions;
59/* Coding system for communicating with other programs via scrap. */ 64/* Coding system for communicating with other programs via selections. */
60static Lisp_Object Vselection_coding_system; 65static Lisp_Object Vselection_coding_system;
61 66
62/* Coding system for the next communicating with other programs. */ 67/* Coding system for the next communicating with other programs. */
@@ -70,23 +75,24 @@ static Lisp_Object Qforeign_selection;
70extern unsigned long last_event_timestamp; 75extern unsigned long last_event_timestamp;
71 76
72/* This is an association list whose elements are of the form 77/* This is an association list whose elements are of the form
73 ( SELECTION-NAME SELECTION-VALUE SELECTION-TIMESTAMP FRAME) 78 ( SELECTION-NAME SELECTION-VALUE SELECTION-TIMESTAMP FRAME OWNERSHIP-INFO)
74 SELECTION-NAME is a lisp symbol. 79 SELECTION-NAME is a lisp symbol.
75 SELECTION-VALUE is the value that emacs owns for that selection. 80 SELECTION-VALUE is the value that emacs owns for that selection.
76 It may be any kind of Lisp object. 81 It may be any kind of Lisp object.
77 SELECTION-TIMESTAMP is the time at which emacs began owning this selection, 82 SELECTION-TIMESTAMP is the time at which emacs began owning this selection,
78 as a cons of two 16-bit numbers (making a 32 bit time.) 83 as a cons of two 16-bit numbers (making a 32 bit time.)
79 FRAME is the frame for which we made the selection. 84 FRAME is the frame for which we made the selection.
80 If there is an entry in this alist, and the data for the flavor 85 OWNERSHIP-INFO is a value saved when emacs owns for that selection.
81 type SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP in the corresponding scrap 86 If another application takes the ownership of that selection
82 (if exists) coincides with SELECTION-TIMESTAMP, then it can be 87 later, then newly examined ownership info value should be
83 assumed that Emacs owns that selection. 88 different from the saved one.
89 If there is an entry in this alist, the current ownership info for
90 the selection coincides with OWNERSHIP-INFO, then it can be
91 assumed that Emacs owns that selection.
84 The only (eq) parts of this list that are visible from Lisp are the 92 The only (eq) parts of this list that are visible from Lisp are the
85 selection-values. */ 93 selection-values. */
86static Lisp_Object Vselection_alist; 94static Lisp_Object Vselection_alist;
87 95
88#define SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP 'Etsp'
89
90/* This is an alist whose CARs are selection-types and whose CDRs are 96/* This is an alist whose CARs are selection-types and whose CDRs are
91 the names of Lisp functions to call to convert the given Emacs 97 the names of Lisp functions to call to convert the given Emacs
92 selection value to a string representing the given selection type. 98 selection value to a string representing the given selection type.
@@ -104,21 +110,22 @@ static Lisp_Object Qmac_scrap_name, Qmac_ostype;
104static Lisp_Object Vmac_service_selection; 110static Lisp_Object Vmac_service_selection;
105#endif 111#endif
106 112
107/* Get a reference to the scrap corresponding to the symbol SYM. The 113/* Get a reference to the selection corresponding to the symbol SYM.
108 reference is set to *SCRAP, and it becomes NULL if there's no 114 The reference is set to *SEL, and it becomes NULL if there's no
109 corresponding scrap. Clear the scrap if CLEAR_P is non-zero. */ 115 corresponding selection. Clear the selection if CLEAR_P is
116 non-zero. */
110 117
111static OSStatus 118static OSStatus
112get_scrap_from_symbol (sym, clear_p, scrap) 119mac_get_selection_from_symbol (sym, clear_p, sel)
113 Lisp_Object sym; 120 Lisp_Object sym;
114 int clear_p; 121 int clear_p;
115 ScrapRef *scrap; 122 Selection *sel;
116{ 123{
117 OSStatus err = noErr; 124 OSStatus err = noErr;
118 Lisp_Object str = Fget (sym, Qmac_scrap_name); 125 Lisp_Object str = Fget (sym, Qmac_scrap_name);
119 126
120 if (!STRINGP (str)) 127 if (!STRINGP (str))
121 *scrap = NULL; 128 *sel = NULL;
122 else 129 else
123 { 130 {
124#if TARGET_API_MAC_CARBON 131#if TARGET_API_MAC_CARBON
@@ -127,19 +134,19 @@ get_scrap_from_symbol (sym, clear_p, scrap)
127 OptionBits options = (clear_p ? kScrapClearNamedScrap 134 OptionBits options = (clear_p ? kScrapClearNamedScrap
128 : kScrapGetNamedScrap); 135 : kScrapGetNamedScrap);
129 136
130 err = GetScrapByName (scrap_name, options, scrap); 137 err = GetScrapByName (scrap_name, options, sel);
131 CFRelease (scrap_name); 138 CFRelease (scrap_name);
132#else /* !MAC_OSX */ 139#else /* !MAC_OSX */
133 if (clear_p) 140 if (clear_p)
134 err = ClearCurrentScrap (); 141 err = ClearCurrentScrap ();
135 if (err == noErr) 142 if (err == noErr)
136 err = GetCurrentScrap (scrap); 143 err = GetCurrentScrap (sel);
137#endif /* !MAC_OSX */ 144#endif /* !MAC_OSX */
138#else /* !TARGET_API_MAC_CARBON */ 145#else /* !TARGET_API_MAC_CARBON */
139 if (clear_p) 146 if (clear_p)
140 err = ZeroScrap (); 147 err = ZeroScrap ();
141 if (err == noErr) 148 if (err == noErr)
142 *scrap = 1; 149 *sel = 1;
143#endif /* !TARGET_API_MAC_CARBON */ 150#endif /* !TARGET_API_MAC_CARBON */
144 } 151 }
145 152
@@ -147,138 +154,154 @@ get_scrap_from_symbol (sym, clear_p, scrap)
147} 154}
148 155
149/* Get a scrap flavor type from the symbol SYM. Return 0 if no 156/* Get a scrap flavor type from the symbol SYM. Return 0 if no
150 corresponding flavor type. */ 157 corresponding flavor type. If SEL is non-zero, the return value is
158 non-zero only when the SEL has the flavor type. */
151 159
152static ScrapFlavorType 160static ScrapFlavorType
153get_flavor_type_from_symbol (sym) 161get_flavor_type_from_symbol (sym, sel)
154 Lisp_Object sym; 162 Lisp_Object sym;
163 Selection sel;
155{ 164{
156 Lisp_Object str = Fget (sym, Qmac_ostype); 165 Lisp_Object str = Fget (sym, Qmac_ostype);
166 ScrapFlavorType flavor_type;
157 167
158 if (STRINGP (str) && SBYTES (str) == 4) 168 if (STRINGP (str) && SBYTES (str) == 4)
159 return EndianU32_BtoN (*((UInt32 *) SDATA (str))); 169 flavor_type = EndianU32_BtoN (*((UInt32 *) SDATA (str)));
170 else
171 flavor_type = 0;
172
173 if (flavor_type && sel)
174 {
175#if TARGET_API_MAC_CARBON
176 OSStatus err;
177 ScrapFlavorFlags flags;
160 178
161 return 0; 179 err = GetScrapFlavorFlags (sel, flavor_type, &flags);
180 if (err != noErr)
181 flavor_type = 0;
182#else /* !TARGET_API_MAC_CARBON */
183 SInt32 size, offset;
184
185 size = GetScrap (NULL, flavor_type, &offset);
186 if (size < 0)
187 flavor_type = 0;
188#endif /* !TARGET_API_MAC_CARBON */
189 }
190
191 return flavor_type;
162} 192}
163 193
164/* Check if the symbol SYM has a corresponding scrap flavor type. */ 194/* Check if the symbol SYM has a corresponding selection target type. */
165 195
166static int 196static int
167valid_scrap_target_type_p (sym) 197mac_valid_selection_target_p (sym)
168 Lisp_Object sym; 198 Lisp_Object sym;
169{ 199{
170 return get_flavor_type_from_symbol (sym) != 0; 200 return get_flavor_type_from_symbol (sym, 0) != 0;
171} 201}
172 202
173/* Clear the scrap whose reference is *SCRAP. */ 203/* Clear the selection whose reference is *SEL. */
174 204
175static INLINE OSStatus 205static OSStatus
176clear_scrap (scrap) 206mac_clear_selection (sel)
177 ScrapRef *scrap; 207 Selection *sel;
178{ 208{
179#if TARGET_API_MAC_CARBON 209#if TARGET_API_MAC_CARBON
180#ifdef MAC_OSX 210#ifdef MAC_OSX
181 return ClearScrap (scrap); 211 return ClearScrap (sel);
182#else 212#else
183 return ClearCurrentScrap (); 213 OSStatus err;
214
215 err = ClearCurrentScrap ();
216 if (err == noErr)
217 err = GetCurrentScrap (sel);
218 return err;
184#endif 219#endif
185#else /* !TARGET_API_MAC_CARBON */ 220#else /* !TARGET_API_MAC_CARBON */
186 return ZeroScrap (); 221 return ZeroScrap ();
187#endif /* !TARGET_API_MAC_CARBON */ 222#endif /* !TARGET_API_MAC_CARBON */
188} 223}
189 224
190/* Put Lisp String STR to the scrap SCRAP. The target type is 225/* Get ownership information for SEL. Emacs can detect a change of
191 specified by TYPE. */ 226 the ownership by comparing saved and current values of the
227 ownership information. */
192 228
193static OSStatus 229static Lisp_Object
194put_scrap_string (scrap, type, str) 230mac_get_selection_ownership_info (sel)
195 ScrapRef scrap; 231 Selection sel;
196 Lisp_Object type, str;
197{ 232{
198 ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type);
199
200 if (flavor_type == 0)
201 return noTypeErr;
202
203#if TARGET_API_MAC_CARBON 233#if TARGET_API_MAC_CARBON
204 return PutScrapFlavor (scrap, flavor_type, kScrapFlavorMaskNone, 234 return long_to_cons ((unsigned long) sel);
205 SBYTES (str), SDATA (str));
206#else /* !TARGET_API_MAC_CARBON */ 235#else /* !TARGET_API_MAC_CARBON */
207 return PutScrap (SBYTES (str), flavor_type, SDATA (str)); 236 ScrapStuffPtr scrap_info = InfoScrap ();
237
238 return make_number (scrap_info->scrapCount);
208#endif /* !TARGET_API_MAC_CARBON */ 239#endif /* !TARGET_API_MAC_CARBON */
209} 240}
210 241
211/* Put TIMESTAMP to the scrap SCRAP. The timestamp is used for 242/* Return non-zero if VALUE is a valid selection value for TARGET. */
212 checking if the scrap is owned by the process. */
213 243
214static INLINE OSStatus 244static int
215put_scrap_private_timestamp (scrap, timestamp) 245mac_valid_selection_value_p (value, target)
216 ScrapRef scrap; 246 Lisp_Object value, target;
217 unsigned long timestamp;
218{ 247{
219#if TARGET_API_MAC_CARBON 248 return STRINGP (value);
220 return PutScrapFlavor (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
221 kScrapFlavorMaskSenderOnly,
222 sizeof (timestamp), &timestamp);
223#else /* !TARGET_API_MAC_CARBON */
224 return PutScrap (sizeof (timestamp), SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
225 &timestamp);
226#endif /* !TARGET_API_MAC_CARBON */
227} 249}
228 250
229/* Check if data for the target type TYPE is available in SCRAP. */ 251/* Put Lisp Object VALUE to the selection SEL. The target type is
252 specified by TARGET. */
230 253
231static ScrapFlavorType 254static OSStatus
232scrap_has_target_type (scrap, type) 255mac_put_selection_value (sel, target, value)
233 ScrapRef scrap; 256 Selection sel;
234 Lisp_Object type; 257 Lisp_Object target, value;
235{ 258{
236 OSStatus err; 259 ScrapFlavorType flavor_type = get_flavor_type_from_symbol (target, 0);
237 ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type);
238 260
239 if (flavor_type) 261 if (flavor_type == 0 || !STRINGP (value))
240 { 262 return noTypeErr;
241#if TARGET_API_MAC_CARBON
242 ScrapFlavorFlags flags;
243 263
244 err = GetScrapFlavorFlags (scrap, flavor_type, &flags); 264#if TARGET_API_MAC_CARBON
245 if (err != noErr) 265 return PutScrapFlavor (sel, flavor_type, kScrapFlavorMaskNone,
246 flavor_type = 0; 266 SBYTES (value), SDATA (value));
247#else /* !TARGET_API_MAC_CARBON */ 267#else /* !TARGET_API_MAC_CARBON */
248 SInt32 size, offset; 268 return PutScrap (SBYTES (value), flavor_type, SDATA (value));
249
250 size = GetScrap (NULL, flavor_type, &offset);
251 if (size < 0)
252 flavor_type = 0;
253#endif /* !TARGET_API_MAC_CARBON */ 269#endif /* !TARGET_API_MAC_CARBON */
254 } 270}
255 271
256 return flavor_type; 272/* Check if data for the target type TARGET is available in SEL. */
273
274static int
275mac_selection_has_target_p (sel, target)
276 Selection sel;
277 Lisp_Object target;
278{
279 return get_flavor_type_from_symbol (target, sel) != 0;
257} 280}
258 281
259/* Get data for the target type TYPE from SCRAP and create a Lisp 282/* Get data for the target type TARGET from SEL and create a Lisp
260 string. Return nil if failed to get data. */ 283 string. Return nil if failed to get data. */
261 284
262static Lisp_Object 285static Lisp_Object
263get_scrap_string (scrap, type) 286mac_get_selection_value (sel, target)
264 ScrapRef scrap; 287 Selection sel;
265 Lisp_Object type; 288 Lisp_Object target;
266{ 289{
267 OSStatus err; 290 OSStatus err;
268 Lisp_Object result = Qnil; 291 Lisp_Object result = Qnil;
269 ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type); 292 ScrapFlavorType flavor_type = get_flavor_type_from_symbol (target, sel);
270#if TARGET_API_MAC_CARBON 293#if TARGET_API_MAC_CARBON
271 Size size; 294 Size size;
272 295
273 if (flavor_type) 296 if (flavor_type)
274 { 297 {
275 err = GetScrapFlavorSize (scrap, flavor_type, &size); 298 err = GetScrapFlavorSize (sel, flavor_type, &size);
276 if (err == noErr) 299 if (err == noErr)
277 { 300 {
278 do 301 do
279 { 302 {
280 result = make_uninit_string (size); 303 result = make_uninit_string (size);
281 err = GetScrapFlavorData (scrap, flavor_type, 304 err = GetScrapFlavorData (sel, flavor_type,
282 &size, SDATA (result)); 305 &size, SDATA (result));
283 if (err != noErr) 306 if (err != noErr)
284 result = Qnil; 307 result = Qnil;
@@ -308,72 +331,25 @@ get_scrap_string (scrap, type)
308 return result; 331 return result;
309} 332}
310 333
311/* Get timestamp from the scrap SCRAP and set to *TIMPSTAMP. */ 334/* Get the list of target types in SEL. The return value is a list of
312 335 target type symbols possibly followed by scrap flavor type
313static OSStatus
314get_scrap_private_timestamp (scrap, timestamp)
315 ScrapRef scrap;
316 unsigned long *timestamp;
317{
318 OSStatus err = noErr;
319#if TARGET_API_MAC_CARBON
320 ScrapFlavorFlags flags;
321
322 err = GetScrapFlavorFlags (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &flags);
323 if (err == noErr)
324 {
325 if (!(flags & kScrapFlavorMaskSenderOnly))
326 err = noTypeErr;
327 else
328 {
329 Size size = sizeof (*timestamp);
330
331 err = GetScrapFlavorData (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
332 &size, timestamp);
333 if (err == noErr && size != sizeof (*timestamp))
334 err = noTypeErr;
335 }
336 }
337#else /* !TARGET_API_MAC_CARBON */
338 Handle handle;
339 SInt32 size, offset;
340
341 size = GetScrap (NULL, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &offset);
342 if (size == sizeof (*timestamp))
343 {
344 handle = NewHandle (size);
345 HLock (handle);
346 size = GetScrap (handle, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &offset);
347 if (size == sizeof (*timestamp))
348 *timestamp = *((unsigned long *) *handle);
349 DisposeHandle (handle);
350 }
351 if (size != sizeof (*timestamp))
352 err = noTypeErr;
353#endif /* !TARGET_API_MAC_CARBON */
354
355 return err;
356}
357
358/* Get the list of target types in SCRAP. The return value is a list
359 of target type symbols possibly followed by scrap flavor type
360 strings. */ 336 strings. */
361 337
362static Lisp_Object 338static Lisp_Object
363get_scrap_target_type_list (scrap) 339mac_get_selection_target_list (sel)
364 ScrapRef scrap; 340 Selection sel;
365{ 341{
366 Lisp_Object result = Qnil, rest, target_type; 342 Lisp_Object result = Qnil, rest, target;
367#if TARGET_API_MAC_CARBON 343#if TARGET_API_MAC_CARBON
368 OSStatus err; 344 OSStatus err;
369 UInt32 count, i, type; 345 UInt32 count, i, type;
370 ScrapFlavorInfo *flavor_info = NULL; 346 ScrapFlavorInfo *flavor_info = NULL;
371 Lisp_Object strings = Qnil; 347 Lisp_Object strings = Qnil;
372 348
373 err = GetScrapFlavorCount (scrap, &count); 349 err = GetScrapFlavorCount (sel, &count);
374 if (err == noErr) 350 if (err == noErr)
375 flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count); 351 flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
376 err = GetScrapFlavorInfoList (scrap, &count, flavor_info); 352 err = GetScrapFlavorInfoList (sel, &count, flavor_info);
377 if (err != noErr) 353 if (err != noErr)
378 { 354 {
379 xfree (flavor_info); 355 xfree (flavor_info);
@@ -387,11 +363,11 @@ get_scrap_target_type_list (scrap)
387 ScrapFlavorType flavor_type = 0; 363 ScrapFlavorType flavor_type = 0;
388 364
389 if (CONSP (XCAR (rest)) 365 if (CONSP (XCAR (rest))
390 && (target_type = XCAR (XCAR (rest)), 366 && (target = XCAR (XCAR (rest)),
391 SYMBOLP (target_type)) 367 SYMBOLP (target))
392 && (flavor_type = scrap_has_target_type (scrap, target_type))) 368 && (flavor_type = get_flavor_type_from_symbol (target, sel)))
393 { 369 {
394 result = Fcons (target_type, result); 370 result = Fcons (target, result);
395#if TARGET_API_MAC_CARBON 371#if TARGET_API_MAC_CARBON
396 for (i = 0; i < count; i++) 372 for (i = 0; i < count; i++)
397 if (flavor_info[i].flavorType == flavor_type) 373 if (flavor_info[i].flavorType == flavor_type)
@@ -428,9 +404,9 @@ x_own_selection (selection_name, selection_value)
428 Lisp_Object selection_name, selection_value; 404 Lisp_Object selection_name, selection_value;
429{ 405{
430 OSStatus err; 406 OSStatus err;
431 ScrapRef scrap; 407 Selection sel;
432 struct gcpro gcpro1, gcpro2; 408 struct gcpro gcpro1, gcpro2;
433 Lisp_Object rest, handler_fn, value, type; 409 Lisp_Object rest, handler_fn, value, target_type;
434 int count; 410 int count;
435 411
436 CHECK_SYMBOL (selection_name); 412 CHECK_SYMBOL (selection_name);
@@ -439,8 +415,8 @@ x_own_selection (selection_name, selection_value)
439 415
440 BLOCK_INPUT; 416 BLOCK_INPUT;
441 417
442 err = get_scrap_from_symbol (selection_name, 1, &scrap); 418 err = mac_get_selection_from_symbol (selection_name, 1, &sel);
443 if (err == noErr && scrap) 419 if (err == noErr && sel)
444 { 420 {
445 /* Don't allow a quit within the converter. 421 /* Don't allow a quit within the converter.
446 When the user types C-g, he would be surprised 422 When the user types C-g, he would be surprised
@@ -451,49 +427,56 @@ x_own_selection (selection_name, selection_value)
451 for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest)) 427 for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest))
452 { 428 {
453 if (!(CONSP (XCAR (rest)) 429 if (!(CONSP (XCAR (rest))
454 && (type = XCAR (XCAR (rest)), 430 && (target_type = XCAR (XCAR (rest)),
455 SYMBOLP (type)) 431 SYMBOLP (target_type))
456 && valid_scrap_target_type_p (type) 432 && mac_valid_selection_target_p (target_type)
457 && (handler_fn = XCDR (XCAR (rest)), 433 && (handler_fn = XCDR (XCAR (rest)),
458 SYMBOLP (handler_fn)))) 434 SYMBOLP (handler_fn))))
459 continue; 435 continue;
460 436
461 if (!NILP (handler_fn)) 437 if (!NILP (handler_fn))
462 value = call3 (handler_fn, selection_name, 438 value = call3 (handler_fn, selection_name,
463 type, selection_value); 439 target_type, selection_value);
440
441 if (NILP (value))
442 continue;
464 443
465 if (STRINGP (value)) 444 if (mac_valid_selection_value_p (value, target_type))
466 err = put_scrap_string (scrap, type, value); 445 err = mac_put_selection_value (sel, target_type, value);
467 else if (CONSP (value) 446 else if (CONSP (value)
468 && EQ (XCAR (value), type) 447 && EQ (XCAR (value), target_type)
469 && STRINGP (XCDR (value))) 448 && mac_valid_selection_value_p (XCDR (value), target_type))
470 err = put_scrap_string (scrap, type, XCDR (value)); 449 err = mac_put_selection_value (sel, target_type, XCDR (value));
471 } 450 }
472 451
473 unbind_to (count, Qnil); 452 unbind_to (count, Qnil);
474
475 if (err == noErr)
476 err = put_scrap_private_timestamp (scrap, last_event_timestamp);
477 } 453 }
478 454
479 UNBLOCK_INPUT; 455 UNBLOCK_INPUT;
480 456
481 UNGCPRO; 457 UNGCPRO;
482 458
483 if (scrap && err != noErr) 459 if (sel && err != noErr)
484 error ("Can't set selection"); 460 error ("Can't set selection");
485 461
486 /* Now update the local cache */ 462 /* Now update the local cache */
487 { 463 {
488 Lisp_Object selection_time; 464 Lisp_Object selection_time;
489 Lisp_Object selection_data; 465 Lisp_Object selection_data;
466 Lisp_Object ownership_info;
490 Lisp_Object prev_value; 467 Lisp_Object prev_value;
491 468
492 selection_time = long_to_cons (last_event_timestamp); 469 selection_time = long_to_cons (last_event_timestamp);
470 if (sel)
471 ownership_info = mac_get_selection_ownership_info (sel);
472 else
473 ownership_info = Qnil; /* dummy value for local-only selection */
493 selection_data = Fcons (selection_name, 474 selection_data = Fcons (selection_name,
494 Fcons (selection_value, 475 Fcons (selection_value,
495 Fcons (selection_time, 476 Fcons (selection_time,
496 Fcons (selected_frame, Qnil)))); 477 Fcons (selected_frame,
478 Fcons (ownership_info,
479 Qnil)))));
497 prev_value = assq_no_quit (selection_name, Vselection_alist); 480 prev_value = assq_no_quit (selection_name, Vselection_alist);
498 481
499 Vselection_alist = Fcons (selection_data, Vselection_alist); 482 Vselection_alist = Fcons (selection_data, Vselection_alist);
@@ -574,29 +557,20 @@ x_get_local_selection (selection_symbol, target_type, local_request)
574 unbind_to (count, Qnil); 557 unbind_to (count, Qnil);
575 } 558 }
576 559
560 if (local_request)
561 return value;
562
577 /* Make sure this value is of a type that we could transmit 563 /* Make sure this value is of a type that we could transmit
578 to another X client. */ 564 to another application. */
579 565
566 type = target_type;
580 check = value; 567 check = value;
581 if (CONSP (value) 568 if (CONSP (value)
582 && SYMBOLP (XCAR (value))) 569 && SYMBOLP (XCAR (value)))
583 type = XCAR (value), 570 type = XCAR (value),
584 check = XCDR (value); 571 check = XCDR (value);
585 572
586 if (STRINGP (check) 573 if (NILP (value) || mac_valid_selection_value_p (check, type))
587 || VECTORP (check)
588 || SYMBOLP (check)
589 || INTEGERP (check)
590 || NILP (value))
591 return value;
592 /* Check for a value that cons_to_long could handle. */
593 else if (CONSP (check)
594 && INTEGERP (XCAR (check))
595 && (INTEGERP (XCDR (check))
596 ||
597 (CONSP (XCDR (check))
598 && INTEGERP (XCAR (XCDR (check)))
599 && NILP (XCDR (XCDR (check))))))
600 return value; 574 return value;
601 575
602 signal_error ("Invalid data returned by selection-conversion function", 576 signal_error ("Invalid data returned by selection-conversion function",
@@ -676,22 +650,22 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp)
676 Lisp_Object selection_symbol, target_type, time_stamp; 650 Lisp_Object selection_symbol, target_type, time_stamp;
677{ 651{
678 OSStatus err; 652 OSStatus err;
679 ScrapRef scrap; 653 Selection sel;
680 Lisp_Object result = Qnil; 654 Lisp_Object result = Qnil;
681 655
682 BLOCK_INPUT; 656 BLOCK_INPUT;
683 657
684 err = get_scrap_from_symbol (selection_symbol, 0, &scrap); 658 err = mac_get_selection_from_symbol (selection_symbol, 0, &sel);
685 if (err == noErr && scrap) 659 if (err == noErr && sel)
686 { 660 {
687 if (EQ (target_type, QTARGETS)) 661 if (EQ (target_type, QTARGETS))
688 { 662 {
689 result = get_scrap_target_type_list (scrap); 663 result = mac_get_selection_target_list (sel);
690 result = Fvconcat (1, &result); 664 result = Fvconcat (1, &result);
691 } 665 }
692 else 666 else
693 { 667 {
694 result = get_scrap_string (scrap, target_type); 668 result = mac_get_selection_value (sel, target_type);
695 if (STRINGP (result)) 669 if (STRINGP (result))
696 Fput_text_property (make_number (0), make_number (SBYTES (result)), 670 Fput_text_property (make_number (0), make_number (SBYTES (result)),
697 Qforeign_selection, target_type, result); 671 Qforeign_selection, target_type, result);
@@ -770,7 +744,7 @@ Disowning it means there is no such selection. */)
770 Lisp_Object time; 744 Lisp_Object time;
771{ 745{
772 OSStatus err; 746 OSStatus err;
773 ScrapRef scrap; 747 Selection sel;
774 Lisp_Object local_selection_data; 748 Lisp_Object local_selection_data;
775 749
776 check_mac (); 750 check_mac ();
@@ -812,9 +786,9 @@ Disowning it means there is no such selection. */)
812 786
813 BLOCK_INPUT; 787 BLOCK_INPUT;
814 788
815 err = get_scrap_from_symbol (selection, 0, &scrap); 789 err = mac_get_selection_from_symbol (selection, 0, &sel);
816 if (err == noErr && scrap) 790 if (err == noErr && sel)
817 clear_scrap (&scrap); 791 mac_clear_selection (&sel);
818 792
819 UNBLOCK_INPUT; 793 UNBLOCK_INPUT;
820 794
@@ -833,7 +807,7 @@ and t is the same as `SECONDARY'. */)
833 Lisp_Object selection; 807 Lisp_Object selection;
834{ 808{
835 OSStatus err; 809 OSStatus err;
836 ScrapRef scrap; 810 Selection sel;
837 Lisp_Object result = Qnil, local_selection_data; 811 Lisp_Object result = Qnil, local_selection_data;
838 812
839 check_mac (); 813 check_mac ();
@@ -848,15 +822,14 @@ and t is the same as `SECONDARY'. */)
848 822
849 BLOCK_INPUT; 823 BLOCK_INPUT;
850 824
851 err = get_scrap_from_symbol (selection, 0, &scrap); 825 err = mac_get_selection_from_symbol (selection, 0, &sel);
852 if (err == noErr && scrap) 826 if (err == noErr && sel)
853 { 827 {
854 unsigned long timestamp; 828 Lisp_Object ownership_info;
855 829
856 err = get_scrap_private_timestamp (scrap, &timestamp); 830 ownership_info = XCAR (XCDR (XCDR (XCDR (XCDR (local_selection_data)))));
857 if (err == noErr 831 if (!NILP (Fequal (ownership_info,
858 && (timestamp 832 mac_get_selection_ownership_info (sel))))
859 == cons_to_long (XCAR (XCDR (XCDR (local_selection_data))))))
860 result = Qt; 833 result = Qt;
861 } 834 }
862 else 835 else
@@ -878,7 +851,7 @@ and t is the same as `SECONDARY'. */)
878 Lisp_Object selection; 851 Lisp_Object selection;
879{ 852{
880 OSStatus err; 853 OSStatus err;
881 ScrapRef scrap; 854 Selection sel;
882 Lisp_Object result = Qnil, rest; 855 Lisp_Object result = Qnil, rest;
883 856
884 /* It should be safe to call this before we have an Mac frame. */ 857 /* It should be safe to call this before we have an Mac frame. */
@@ -893,12 +866,12 @@ and t is the same as `SECONDARY'. */)
893 866
894 BLOCK_INPUT; 867 BLOCK_INPUT;
895 868
896 err = get_scrap_from_symbol (selection, 0, &scrap); 869 err = mac_get_selection_from_symbol (selection, 0, &sel);
897 if (err == noErr && scrap) 870 if (err == noErr && sel)
898 for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest)) 871 for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest))
899 { 872 {
900 if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest))) 873 if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))
901 && scrap_has_target_type (scrap, XCAR (XCAR (rest)))) 874 && mac_selection_has_target_p (sel, XCAR (XCAR (rest))))
902 { 875 {
903 result = Qt; 876 result = Qt;
904 break; 877 break;
@@ -1700,7 +1673,7 @@ mac_handle_service_event (call_ref, event, data)
1700 if (!SYMBOLP (Vmac_service_selection)) 1673 if (!SYMBOLP (Vmac_service_selection))
1701 err = eventNotHandledErr; 1674 err = eventNotHandledErr;
1702 else 1675 else
1703 err = get_scrap_from_symbol (Vmac_service_selection, 0, &cur_scrap); 1676 err = mac_get_selection_from_symbol (Vmac_service_selection, 0, &cur_scrap);
1704 if (!(err == noErr && cur_scrap)) 1677 if (!(err == noErr && cur_scrap))
1705 return eventNotHandledErr; 1678 return eventNotHandledErr;
1706 1679
@@ -1719,7 +1692,7 @@ mac_handle_service_event (call_ref, event, data)
1719 rest = XCDR (rest)) 1692 rest = XCDR (rest))
1720 if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest))) 1693 if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))
1721 && (flavor_type = 1694 && (flavor_type =
1722 get_flavor_type_from_symbol (XCAR (XCAR (rest))))) 1695 get_flavor_type_from_symbol (XCAR (XCAR (rest)), 0)))
1723 { 1696 {
1724 type = CreateTypeStringWithOSType (flavor_type); 1697 type = CreateTypeStringWithOSType (flavor_type);
1725 if (type) 1698 if (type)
@@ -1804,14 +1777,15 @@ mac_handle_service_event (call_ref, event, data)
1804 NULL, sizeof (ScrapRef), NULL, 1777 NULL, sizeof (ScrapRef), NULL,
1805 &specific_scrap); 1778 &specific_scrap);
1806 if (err == noErr) 1779 if (err == noErr)
1807 err = clear_scrap (&cur_scrap); 1780 err = mac_clear_selection (&cur_scrap);
1808 if (err == noErr) 1781 if (err == noErr)
1809 for (rest = Vselection_converter_alist; CONSP (rest); 1782 for (rest = Vselection_converter_alist; CONSP (rest);
1810 rest = XCDR (rest)) 1783 rest = XCDR (rest))
1811 { 1784 {
1812 if (! (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest))))) 1785 if (! (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))))
1813 continue; 1786 continue;
1814 flavor_type = get_flavor_type_from_symbol (XCAR (XCAR (rest))); 1787 flavor_type = get_flavor_type_from_symbol (XCAR (XCAR (rest)),
1788 specific_scrap);
1815 if (flavor_type == 0) 1789 if (flavor_type == 0)
1816 continue; 1790 continue;
1817 err = copy_scrap_flavor_data (specific_scrap, cur_scrap, 1791 err = copy_scrap_flavor_data (specific_scrap, cur_scrap,
diff --git a/src/macterm.c b/src/macterm.c
index 5643372845b..31f3cfbdcd7 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -4329,14 +4329,6 @@ static void
4329frame_highlight (f) 4329frame_highlight (f)
4330 struct frame *f; 4330 struct frame *f;
4331{ 4331{
4332 OSErr err;
4333 ControlRef root_control;
4334
4335 BLOCK_INPUT;
4336 err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
4337 if (err == noErr)
4338 ActivateControl (root_control);
4339 UNBLOCK_INPUT;
4340 x_update_cursor (f, 1); 4332 x_update_cursor (f, 1);
4341} 4333}
4342 4334
@@ -4344,14 +4336,6 @@ static void
4344frame_unhighlight (f) 4336frame_unhighlight (f)
4345 struct frame *f; 4337 struct frame *f;
4346{ 4338{
4347 OSErr err;
4348 ControlRef root_control;
4349
4350 BLOCK_INPUT;
4351 err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
4352 if (err == noErr)
4353 DeactivateControl (root_control);
4354 UNBLOCK_INPUT;
4355 x_update_cursor (f, 1); 4339 x_update_cursor (f, 1);
4356} 4340}
4357 4341
@@ -6109,7 +6093,9 @@ free_frame_tool_bar (f)
6109 6093
6110 BLOCK_INPUT; 6094 BLOCK_INPUT;
6111 ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), false, 6095 ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), false,
6112 f == mac_focus_frame (dpyinfo)); 6096 (NILP (Fsymbol_value
6097 (intern ("frame-notice-user-settings")))
6098 && f == mac_focus_frame (dpyinfo)));
6113 /* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events 6099 /* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events
6114 on toolbar visibility change. */ 6100 on toolbar visibility change. */
6115 mac_handle_origin_change (f); 6101 mac_handle_origin_change (f);
@@ -9386,11 +9372,13 @@ mac_handle_font_event (next_handler, event, data)
9386 static const EventParamName names_sel[] = {kEventParamATSUFontID, 9372 static const EventParamName names_sel[] = {kEventParamATSUFontID,
9387 kEventParamATSUFontSize, 9373 kEventParamATSUFontSize,
9388 kEventParamFMFontFamily, 9374 kEventParamFMFontFamily,
9375 kEventParamFMFontStyle,
9389 kEventParamFMFontSize, 9376 kEventParamFMFontSize,
9390 kEventParamFontColor}; 9377 kEventParamFontColor};
9391 static const EventParamType types_sel[] = {typeATSUFontID, 9378 static const EventParamType types_sel[] = {typeATSUFontID,
9392 typeATSUSize, 9379 typeATSUSize,
9393 typeFMFontFamily, 9380 typeFMFontFamily,
9381 typeFMFontStyle,
9394 typeFMFontSize, 9382 typeFMFontSize,
9395 typeFontColor}; 9383 typeFontColor};
9396 9384
@@ -10711,7 +10699,7 @@ mac_handle_window_event (next_handler, event, data)
10711 { 10699 {
10712 struct frame *sf = SELECTED_FRAME (); 10700 struct frame *sf = SELECTED_FRAME ();
10713 10701
10714 if (!(FRAME_MAC_P (sf))) 10702 if (!(FRAME_MAC_P (sf) && sf->async_visible))
10715 RepositionWindow (wp, NULL, kWindowCenterOnMainScreen); 10703 RepositionWindow (wp, NULL, kWindowCenterOnMainScreen);
10716 else 10704 else
10717 { 10705 {
@@ -10726,8 +10714,11 @@ mac_handle_window_event (next_handler, event, data)
10726 /* This is a workaround. RepositionWindow fails to put 10714 /* This is a workaround. RepositionWindow fails to put
10727 a window at the cascading position when its parent 10715 a window at the cascading position when its parent
10728 window has a Carbon HIToolbar. */ 10716 window has a Carbon HIToolbar. */
10729 if (f->top_pos == sf->top_pos && f->left_pos == sf->left_pos) 10717 if ((f->left_pos == sf->left_pos
10730 MoveWindowStructure (wp, f->left_pos + 10, f->top_pos + 32); 10718 && f->top_pos == sf->top_pos)
10719 || (f->left_pos == sf->left_pos + 10 * 2
10720 && f->top_pos == sf->top_pos + 32 * 2))
10721 MoveWindowStructure (wp, sf->left_pos + 10, sf->top_pos + 32);
10731#endif 10722#endif
10732 } 10723 }
10733 result = noErr; 10724 result = noErr;
@@ -10952,7 +10943,7 @@ mac_handle_keyboard_event (next_handler, event, data)
10952 void *data; 10943 void *data;
10953{ 10944{
10954 OSStatus err, result = eventNotHandledErr; 10945 OSStatus err, result = eventNotHandledErr;
10955 UInt32 event_kind, key_code, modifiers, mapped_modifiers; 10946 UInt32 event_kind, key_code, modifiers;
10956 unsigned char char_code; 10947 unsigned char char_code;
10957 10948
10958 event_kind = GetEventKind (event); 10949 event_kind = GetEventKind (event);
@@ -10961,32 +10952,16 @@ mac_handle_keyboard_event (next_handler, event, data)
10961 case kEventRawKeyDown: 10952 case kEventRawKeyDown:
10962 case kEventRawKeyRepeat: 10953 case kEventRawKeyRepeat:
10963 case kEventRawKeyUp: 10954 case kEventRawKeyUp:
10964 if (read_socket_inev == NULL)
10965 {
10966 result = CallNextEventHandler (next_handler, event);
10967 break;
10968 }
10969
10970 err = GetEventParameter (event, kEventParamKeyModifiers,
10971 typeUInt32, NULL,
10972 sizeof (UInt32), NULL, &modifiers);
10973 if (err != noErr)
10974 break;
10975
10976 mapped_modifiers = mac_mapped_modifiers (modifiers);
10977
10978 /* When using Carbon Events, we need to pass raw keyboard events 10955 /* When using Carbon Events, we need to pass raw keyboard events
10979 to the TSM ourselves. If TSM handles it, it will pass back 10956 to the TSM ourselves. If TSM handles it, it will pass back
10980 noErr, otherwise it will pass back "eventNotHandledErr" and 10957 noErr, otherwise it will pass back "eventNotHandledErr" and
10981 we can process it normally. */ 10958 we can process it normally. */
10982 if (!(mapped_modifiers 10959 result = CallNextEventHandler (next_handler, event);
10983 & ~(mac_pass_command_to_system ? cmdKey : 0) 10960 if (result != eventNotHandledErr)
10984 & ~(mac_pass_control_to_system ? controlKey : 0))) 10961 break;
10985 { 10962
10986 result = CallNextEventHandler (next_handler, event); 10963 if (read_socket_inev == NULL)
10987 if (result != eventNotHandledErr) 10964 break;
10988 break;
10989 }
10990 10965
10991#if USE_MAC_TSM 10966#if USE_MAC_TSM
10992 if (read_socket_inev->kind != NO_EVENT) 10967 if (read_socket_inev->kind != NO_EVENT)
@@ -11011,6 +10986,12 @@ mac_handle_keyboard_event (next_handler, event, data)
11011 if (err != noErr) 10986 if (err != noErr)
11012 break; 10987 break;
11013 10988
10989 err = GetEventParameter (event, kEventParamKeyModifiers,
10990 typeUInt32, NULL,
10991 sizeof (UInt32), NULL, &modifiers);
10992 if (err != noErr)
10993 break;
10994
11014 do_keystroke ((event_kind == kEventRawKeyDown ? keyDown : autoKey), 10995 do_keystroke ((event_kind == kEventRawKeyDown ? keyDown : autoKey),
11015 char_code, key_code, modifiers, 10996 char_code, key_code, modifiers,
11016 ((unsigned long) 10997 ((unsigned long)
@@ -12157,7 +12138,7 @@ XTread_socket (sd, expected, hold_quit)
12157 /* Window will be selected only when it is 12138 /* Window will be selected only when it is
12158 not selected now and last mouse movement 12139 not selected now and last mouse movement
12159 event was not in it. Minibuffer window 12140 event was not in it. Minibuffer window
12160 will be selected iff it is active. */ 12141 will be selected only when it is active. */
12161 if (WINDOWP (window) 12142 if (WINDOWP (window)
12162 && !EQ (window, last_window) 12143 && !EQ (window, last_window)
12163 && !EQ (window, selected_window)) 12144 && !EQ (window, selected_window))
@@ -12192,6 +12173,8 @@ XTread_socket (sd, expected, hold_quit)
12192 case activateEvt: 12173 case activateEvt:
12193 { 12174 {
12194 WindowRef window_ptr = (WindowRef) er.message; 12175 WindowRef window_ptr = (WindowRef) er.message;
12176 OSErr err;
12177 ControlRef root_control;
12195 12178
12196 if (window_ptr == tip_window) 12179 if (window_ptr == tip_window)
12197 { 12180 {
@@ -12209,6 +12192,10 @@ XTread_socket (sd, expected, hold_quit)
12209 /* A window has been activated */ 12192 /* A window has been activated */
12210 Point mouse_loc; 12193 Point mouse_loc;
12211 12194
12195 err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
12196 if (err == noErr)
12197 ActivateControl (root_control);
12198
12212 x_detect_focus_change (dpyinfo, &er, &inev); 12199 x_detect_focus_change (dpyinfo, &er, &inev);
12213 12200
12214 mouse_loc.h = (er.where.h 12201 mouse_loc.h = (er.where.h
@@ -12224,6 +12211,10 @@ XTread_socket (sd, expected, hold_quit)
12224 else 12211 else
12225 { 12212 {
12226 /* A window has been deactivated */ 12213 /* A window has been deactivated */
12214 err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
12215 if (err == noErr)
12216 DeactivateControl (root_control);
12217
12227#ifdef USE_TOOLKIT_SCROLL_BARS 12218#ifdef USE_TOOLKIT_SCROLL_BARS
12228 if (dpyinfo->grabbed && tracked_scroll_bar) 12219 if (dpyinfo->grabbed && tracked_scroll_bar)
12229 { 12220 {
@@ -12279,13 +12270,29 @@ XTread_socket (sd, expected, hold_quit)
12279 clear_mouse_face (dpyinfo); 12270 clear_mouse_face (dpyinfo);
12280 dpyinfo->mouse_face_hidden = 1; 12271 dpyinfo->mouse_face_hidden = 1;
12281 } 12272 }
12273
12274 {
12275 UInt32 modifiers = er.modifiers, mapped_modifiers;
12276
12277#ifdef MAC_OSX
12278 GetEventParameter (eventRef, kEventParamKeyModifiers,
12279 typeUInt32, NULL,
12280 sizeof (UInt32), NULL, &modifiers);
12281#endif
12282 mapped_modifiers = mac_mapped_modifiers (modifiers);
12283
12282#if TARGET_API_MAC_CARBON 12284#if TARGET_API_MAC_CARBON
12283 goto OTHER; 12285 if (!(mapped_modifiers
12284#else 12286 & ~(mac_pass_command_to_system ? cmdKey : 0)
12285 do_keystroke (er.what, er.message & charCodeMask, 12287 & ~(mac_pass_control_to_system ? controlKey : 0)))
12286 (er.message & keyCodeMask) >> 8, 12288 goto OTHER;
12287 er.modifiers, timestamp, &inev); 12289 else
12288#endif 12290#endif
12291 if (er.what != keyUp)
12292 do_keystroke (er.what, er.message & charCodeMask,
12293 (er.message & keyCodeMask) >> 8,
12294 modifiers, timestamp, &inev);
12295 }
12289 break; 12296 break;
12290 12297
12291 case kHighLevelEvent: 12298 case kHighLevelEvent:
@@ -12339,7 +12346,6 @@ XTread_socket (sd, expected, hold_quit)
12339 } 12346 }
12340 count++; 12347 count++;
12341 } 12348 }
12342
12343 } 12349 }
12344 12350
12345 /* If the focus was just given to an autoraising frame, 12351 /* If the focus was just given to an autoraising frame,
diff --git a/src/macterm.h b/src/macterm.h
index d0d5d58e65e..9df9b1abcdb 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -153,7 +153,7 @@ struct mac_display_info
153 char *mac_id_name; 153 char *mac_id_name;
154 154
155 /* The number of fonts actually stored in the font table. 155 /* The number of fonts actually stored in the font table.
156 font_table[n] is used and valid iff 0 <= n < n_fonts. 0 <= 156 font_table[n] is used and valid if 0 <= n < n_fonts. 0 <=
157 n_fonts <= font_table_size and font_table[i].name != 0. */ 157 n_fonts <= font_table_size and font_table[i].name != 0. */
158 int n_fonts; 158 int n_fonts;
159 159
diff --git a/src/msdos.c b/src/msdos.c
index fd4f211b2f6..fc14be2705c 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -3231,7 +3231,7 @@ dos_rawgetc ()
3231 `dos_get_modifiers', they might have already released the 3231 `dos_get_modifiers', they might have already released the
3232 Alt key, and Emacs gets just `x', which is BAD. 3232 Alt key, and Emacs gets just `x', which is BAD.
3233 However, for keys with the `Map' property set, the ASCII 3233 However, for keys with the `Map' property set, the ASCII
3234 code returns zero iff Alt is pressed. So, when we DON'T 3234 code returns zero only if Alt is pressed. So, when we DON'T
3235 have to support international_keyboard, we don't have to 3235 have to support international_keyboard, we don't have to
3236 distinguish between the left and right Alt keys, and we 3236 distinguish between the left and right Alt keys, and we
3237 can set the META modifier for any keys with the `Map' 3237 can set the META modifier for any keys with the `Map'
diff --git a/src/print.c b/src/print.c
index 8b3aaaa1ee9..cd3d6438bff 100644
--- a/src/print.c
+++ b/src/print.c
@@ -93,8 +93,8 @@ Lisp_Object Vfloat_output_format, Qfloat_output_format;
93/* Avoid actual stack overflow in print. */ 93/* Avoid actual stack overflow in print. */
94int print_depth; 94int print_depth;
95 95
96/* Nonzero if inside outputting backquote in old style. */ 96/* Level of nesting inside outputting backquote in new style. */
97int old_backquote_output; 97int new_backquote_output;
98 98
99/* Detect most circularities to print finite output. */ 99/* Detect most circularities to print finite output. */
100#define PRINT_CIRCLE 200 100#define PRINT_CIRCLE 200
@@ -1291,7 +1291,7 @@ print (obj, printcharfun, escapeflag)
1291 register Lisp_Object printcharfun; 1291 register Lisp_Object printcharfun;
1292 int escapeflag; 1292 int escapeflag;
1293{ 1293{
1294 old_backquote_output = 0; 1294 new_backquote_output = 0;
1295 1295
1296 /* Reset print_number_index and Vprint_number_table only when 1296 /* Reset print_number_index and Vprint_number_table only when
1297 the variable Vprint_continuous_numbering is nil. Otherwise, 1297 the variable Vprint_continuous_numbering is nil. Otherwise,
@@ -1756,14 +1756,24 @@ print_object (obj, printcharfun, escapeflag)
1756 print_object (XCAR (XCDR (obj)), printcharfun, escapeflag); 1756 print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
1757 } 1757 }
1758 else if (print_quoted && CONSP (XCDR (obj)) && NILP (XCDR (XCDR (obj))) 1758 else if (print_quoted && CONSP (XCDR (obj)) && NILP (XCDR (XCDR (obj)))
1759 && ! old_backquote_output 1759 && ((EQ (XCAR (obj), Qbackquote))))
1760 {
1761 print_object (XCAR (obj), printcharfun, 0);
1762 new_backquote_output++;
1763 print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
1764 new_backquote_output--;
1765 }
1766 else if (print_quoted && CONSP (XCDR (obj)) && NILP (XCDR (XCDR (obj)))
1767 && new_backquote_output
1760 && ((EQ (XCAR (obj), Qbackquote) 1768 && ((EQ (XCAR (obj), Qbackquote)
1761 || EQ (XCAR (obj), Qcomma) 1769 || EQ (XCAR (obj), Qcomma)
1762 || EQ (XCAR (obj), Qcomma_at) 1770 || EQ (XCAR (obj), Qcomma_at)
1763 || EQ (XCAR (obj), Qcomma_dot)))) 1771 || EQ (XCAR (obj), Qcomma_dot))))
1764 { 1772 {
1765 print_object (XCAR (obj), printcharfun, 0); 1773 print_object (XCAR (obj), printcharfun, 0);
1774 new_backquote_output--;
1766 print_object (XCAR (XCDR (obj)), printcharfun, escapeflag); 1775 print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
1776 new_backquote_output++;
1767 } 1777 }
1768 else 1778 else
1769 { 1779 {
@@ -1783,9 +1793,7 @@ print_object (obj, printcharfun, escapeflag)
1783 print_object (Qbackquote, printcharfun, 0); 1793 print_object (Qbackquote, printcharfun, 0);
1784 PRINTCHAR (' '); 1794 PRINTCHAR (' ');
1785 1795
1786 ++old_backquote_output;
1787 print_object (XCAR (XCDR (tem)), printcharfun, 0); 1796 print_object (XCAR (XCDR (tem)), printcharfun, 0);
1788 --old_backquote_output;
1789 PRINTCHAR (')'); 1797 PRINTCHAR (')');
1790 1798
1791 obj = XCDR (obj); 1799 obj = XCDR (obj);
diff --git a/src/process.c b/src/process.c
index 43609266112..dfb97b8d615 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2780,7 +2780,7 @@ The stopped state is cleared by `continue-process' and set by
2780 2780
2781:filter-multibyte BOOL -- If BOOL is non-nil, strings given to the 2781:filter-multibyte BOOL -- If BOOL is non-nil, strings given to the
2782process filter are multibyte, otherwise they are unibyte. 2782process filter are multibyte, otherwise they are unibyte.
2783If this keyword is not specified, the strings are multibyte iff 2783If this keyword is not specified, the strings are multibyte if
2784`default-enable-multibyte-characters' is non-nil. 2784`default-enable-multibyte-characters' is non-nil.
2785 2785
2786:sentinel SENTINEL -- Install SENTINEL as the process sentinel. 2786:sentinel SENTINEL -- Install SENTINEL as the process sentinel.
@@ -3922,7 +3922,7 @@ it specifies a fractional number of seconds to wait.
3922If optional fourth arg JUST-THIS-ONE is non-nil, only accept output 3922If optional fourth arg JUST-THIS-ONE is non-nil, only accept output
3923from PROCESS, suspending reading output from other processes. 3923from PROCESS, suspending reading output from other processes.
3924If JUST-THIS-ONE is an integer, don't run any timers either. 3924If JUST-THIS-ONE is an integer, don't run any timers either.
3925Return non-nil iff we received any output before the timeout expired. */) 3925Return non-nil if we received any output before the timeout expired. */)
3926 (process, seconds, millisec, just_this_one) 3926 (process, seconds, millisec, just_this_one)
3927 register Lisp_Object process, seconds, millisec, just_this_one; 3927 register Lisp_Object process, seconds, millisec, just_this_one;
3928{ 3928{
@@ -4254,16 +4254,16 @@ select_wrapper (n, rfd, wfd, xfd, tmo)
4254 (and gobble terminal input into the buffer if any arrives). 4254 (and gobble terminal input into the buffer if any arrives).
4255 4255
4256 If WAIT_PROC is specified, wait until something arrives from that 4256 If WAIT_PROC is specified, wait until something arrives from that
4257 process. The return value is true iff we read some input from 4257 process. The return value is true if we read some input from
4258 that process. 4258 that process.
4259 4259
4260 If JUST_WAIT_PROC is non-nil, handle only output from WAIT_PROC 4260 If JUST_WAIT_PROC is non-nil, handle only output from WAIT_PROC
4261 (suspending output from other processes). A negative value 4261 (suspending output from other processes). A negative value
4262 means don't run any timers either. 4262 means don't run any timers either.
4263 4263
4264 If WAIT_PROC is specified, then the function returns true iff we 4264 If WAIT_PROC is specified, then the function returns true if we
4265 received input from that process before the timeout elapsed. 4265 received input from that process before the timeout elapsed.
4266 Otherwise, return true iff we received input from any process. */ 4266 Otherwise, return true if we received input from any process. */
4267 4267
4268int 4268int
4269wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, 4269wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
@@ -7358,7 +7358,7 @@ Lisp_Object QCtype;
7358 do_display != 0 means redisplay should be done to show subprocess 7358 do_display != 0 means redisplay should be done to show subprocess
7359 output that arrives. 7359 output that arrives.
7360 7360
7361 Return true iff we received input from any process. */ 7361 Return true if we received input from any process. */
7362 7362
7363int 7363int
7364wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, 7364wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
diff --git a/src/process.h b/src/process.h
index 79875564766..eaed95fe4b7 100644
--- a/src/process.h
+++ b/src/process.h
@@ -138,7 +138,7 @@ extern Lisp_Object chan_process[];
138/* Alist of elements (NAME . PROCESS). */ 138/* Alist of elements (NAME . PROCESS). */
139extern Lisp_Object Vprocess_alist; 139extern Lisp_Object Vprocess_alist;
140 140
141/* True iff we are about to fork off a synchronous process or if we 141/* True if we are about to fork off a synchronous process or if we
142 are waiting for it. */ 142 are waiting for it. */
143extern int synch_process_alive; 143extern int synch_process_alive;
144 144
diff --git a/src/regex.c b/src/regex.c
index 64bfef15c4e..66b84c9dfc2 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2048,7 +2048,7 @@ re_wctype (str)
2048 else return 0; 2048 else return 0;
2049} 2049}
2050 2050
2051/* True iff CH is in the char class CC. */ 2051/* True if CH is in the char class CC. */
2052boolean 2052boolean
2053re_iswctype (ch, cc) 2053re_iswctype (ch, cc)
2054 int ch; 2054 int ch;
diff --git a/src/search.c b/src/search.c
index 4ae3a68b304..d91110f4b0e 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1662,7 +1662,7 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
1662 have nontrivial translation are the same aside from the last byte. 1662 have nontrivial translation are the same aside from the last byte.
1663 This makes it possible to translate just the last byte of a 1663 This makes it possible to translate just the last byte of a
1664 character, and do so after just a simple test of the context. 1664 character, and do so after just a simple test of the context.
1665 CHARSET_BASE is nonzero iff there is such a non-ASCII character. 1665 CHARSET_BASE is nonzero if there is such a non-ASCII character.
1666 1666
1667 If that criterion is not satisfied, do not call this function. */ 1667 If that criterion is not satisfied, do not call this function. */
1668 1668
diff --git a/src/systime.h b/src/systime.h
index 85c2799f083..8b1b7f56ad6 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -67,7 +67,7 @@ extern time_t timezone;
67 EMACS_SECS (TIME) is an rvalue for the seconds component of TIME. 67 EMACS_SECS (TIME) is an rvalue for the seconds component of TIME.
68 EMACS_SET_SECS (TIME, SECONDS) sets that to SECONDS. 68 EMACS_SET_SECS (TIME, SECONDS) sets that to SECONDS.
69 69
70 EMACS_HAS_USECS is defined iff EMACS_TIME has a usecs component. 70 EMACS_HAS_USECS is defined if EMACS_TIME has a usecs component.
71 EMACS_USECS (TIME) is an rvalue for the microseconds component of TIME. 71 EMACS_USECS (TIME) is an rvalue for the microseconds component of TIME.
72 This returns zero if EMACS_TIME doesn't have a microseconds component. 72 This returns zero if EMACS_TIME doesn't have a microseconds component.
73 EMACS_SET_USECS (TIME, MICROSECONDS) sets that to MICROSECONDS. 73 EMACS_SET_USECS (TIME, MICROSECONDS) sets that to MICROSECONDS.
@@ -83,7 +83,7 @@ extern time_t timezone;
83 83
84 EMACS_SUB_TIME (DEST, SRC1, SRC2) subtracts SRC2 from SRC1 and 84 EMACS_SUB_TIME (DEST, SRC1, SRC2) subtracts SRC2 from SRC1 and
85 stores the result in DEST. SRC should not be negative. 85 stores the result in DEST. SRC should not be negative.
86 EMACS_TIME_NEG_P (TIME) is true iff TIME is negative. 86 EMACS_TIME_NEG_P (TIME) is true if TIME is negative.
87 87
88*/ 88*/
89 89
diff --git a/src/systty.h b/src/systty.h
index 15dd7a4e26c..c89edfc8d93 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -297,7 +297,7 @@ static struct sensemode {
297 written before making the change. 297 written before making the change.
298 Return 0 if all went well, and -1 if anything failed. 298 Return 0 if all went well, and -1 if anything failed.
299 299
300 EMACS_TTY_TABS_OK (struct emacs_tty *P) is false iff the kernel 300 EMACS_TTY_TABS_OK (struct emacs_tty *P) is false if the kernel
301 expands tabs to spaces upon output; in that case, there is no 301 expands tabs to spaces upon output; in that case, there is no
302 advantage to using tabs over spaces. */ 302 advantage to using tabs over spaces. */
303 303
diff --git a/src/termhooks.h b/src/termhooks.h
index 740c9135866..4124e37586b 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -52,7 +52,7 @@ extern void (*fullscreen_hook) P_ ((struct frame *f));
52/* Input queue declarations and hooks. */ 52/* Input queue declarations and hooks. */
53 53
54/* Expedient hack: only provide the below definitions to files that 54/* Expedient hack: only provide the below definitions to files that
55 are prepared to handle lispy things. CONSP is defined iff lisp.h 55 are prepared to handle lispy things. CONSP is defined if lisp.h
56 has been included before this file. */ 56 has been included before this file. */
57#ifdef CONSP 57#ifdef CONSP
58 58
diff --git a/src/textprop.c b/src/textprop.c
index 711ee571af6..8ce5656e5a2 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1633,8 +1633,8 @@ Return t if any property was actually removed, nil otherwise. */)
1633 The flag `modified' records if changes have been made. 1633 The flag `modified' records if changes have been made.
1634 When object is a buffer, we must call modify_region before changes are 1634 When object is a buffer, we must call modify_region before changes are
1635 made and signal_after_change when we are done. 1635 made and signal_after_change when we are done.
1636 We call modify_region before calling remove_properties iff modified == 0, 1636 We call modify_region before calling remove_properties if modified == 0,
1637 and we call signal_after_change before returning iff modified != 0. */ 1637 and we call signal_after_change before returning if modified != 0. */
1638 for (;;) 1638 for (;;)
1639 { 1639 {
1640 if (i == 0) 1640 if (i == 0)
diff --git a/src/w32term.c b/src/w32term.c
index fb312010728..100af4ebc21 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -4378,7 +4378,7 @@ w32_read_socket (sd, expected, hold_quit)
4378 /* Window will be selected only when it is not 4378 /* Window will be selected only when it is not
4379 selected now and last mouse movement event was 4379 selected now and last mouse movement event was
4380 not in it. Minibuffer window will be selected 4380 not in it. Minibuffer window will be selected
4381 iff it is active. */ 4381 only when it is active. */
4382 if (WINDOWP(window) 4382 if (WINDOWP(window)
4383 && !EQ (window, last_window) 4383 && !EQ (window, last_window)
4384 && !EQ (window, selected_window)) 4384 && !EQ (window, selected_window))
diff --git a/src/w32term.h b/src/w32term.h
index bd1a5ab2aad..3e7f3a3a6a9 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -201,7 +201,7 @@ struct w32_display_info
201 char *w32_id_name; 201 char *w32_id_name;
202 202
203 /* The number of fonts actually stored in w32_font_table. 203 /* The number of fonts actually stored in w32_font_table.
204 font_table[n] is used and valid iff 0 <= n < n_fonts. 0 <= 204 font_table[n] is used and valid if 0 <= n < n_fonts. 0 <=
205 n_fonts <= font_table_size. and font_table[i].name != 0. */ 205 n_fonts <= font_table_size. and font_table[i].name != 0. */
206 int n_fonts; 206 int n_fonts;
207 207
diff --git a/src/window.c b/src/window.c
index cda5eccf082..3db1802a861 100644
--- a/src/window.c
+++ b/src/window.c
@@ -559,6 +559,15 @@ use (let ((edges (window-edges))) (- (nth 2 edges) (nth 0 edges))). */)
559 return make_number (window_box_text_cols (decode_any_window (window))); 559 return make_number (window_box_text_cols (decode_any_window (window)));
560} 560}
561 561
562DEFUN ("window-full-width-p", Fwindow_full_width_p, Swindow_full_width_p, 0, 1, 0,
563 doc: /* Return t if WINDOW is as wide as its frame.
564WINDOW defaults to the selected window. */)
565 (window)
566 Lisp_Object window;
567{
568 return WINDOW_FULL_WIDTH_P (decode_any_window (window)) ? Qt : Qnil;
569}
570
562DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, 571DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0,
563 doc: /* Return the number of columns by which WINDOW is scrolled from left margin. 572 doc: /* Return the number of columns by which WINDOW is scrolled from left margin.
564WINDOW defaults to the selected window. */) 573WINDOW defaults to the selected window. */)
@@ -7517,6 +7526,7 @@ The selected frame is the one whose configuration has changed. */);
7517 defsubr (&Swindow_buffer); 7526 defsubr (&Swindow_buffer);
7518 defsubr (&Swindow_height); 7527 defsubr (&Swindow_height);
7519 defsubr (&Swindow_width); 7528 defsubr (&Swindow_width);
7529 defsubr (&Swindow_full_width_p);
7520 defsubr (&Swindow_hscroll); 7530 defsubr (&Swindow_hscroll);
7521 defsubr (&Sset_window_hscroll); 7531 defsubr (&Sset_window_hscroll);
7522 defsubr (&Swindow_redisplay_end_trigger); 7532 defsubr (&Swindow_redisplay_end_trigger);
diff --git a/src/window.h b/src/window.h
index d459d9e305d..c9ef865c4f0 100644
--- a/src/window.h
+++ b/src/window.h
@@ -777,6 +777,7 @@ extern Lisp_Object window_from_coordinates P_ ((struct frame *, int, int,
777EXFUN (Fwindow_dedicated_p, 1); 777EXFUN (Fwindow_dedicated_p, 1);
778extern int window_height P_ ((Lisp_Object)); 778extern int window_height P_ ((Lisp_Object));
779extern int window_width P_ ((Lisp_Object)); 779extern int window_width P_ ((Lisp_Object));
780EXFUN (Fwindow_full_width_p, 1);
780extern void set_window_height P_ ((Lisp_Object, int, int)); 781extern void set_window_height P_ ((Lisp_Object, int, int));
781extern void set_window_width P_ ((Lisp_Object, int, int)); 782extern void set_window_width P_ ((Lisp_Object, int, int));
782extern void change_window_heights P_ ((Lisp_Object, int)); 783extern void change_window_heights P_ ((Lisp_Object, int));
@@ -818,7 +819,7 @@ extern int command_loop_level;
818 819
819extern int minibuf_level; 820extern int minibuf_level;
820 821
821/* true iff we should redraw the mode lines on the next redisplay. */ 822/* true if we should redraw the mode lines on the next redisplay. */
822 823
823extern int update_mode_lines; 824extern int update_mode_lines;
824 825
diff --git a/src/xdisp.c b/src/xdisp.c
index 674e07a2ed7..9d786f286cb 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7074,18 +7074,22 @@ move_it_by_lines (it, dvpos, need_y_p)
7074{ 7074{
7075 struct position pos; 7075 struct position pos;
7076 7076
7077 if (!FRAME_WINDOW_P (it->f)) 7077 /* The commented-out optimization uses vmotion on terminals. This
7078 gives bad results, because elements like it->what, on which
7079 callers such as pos_visible_p rely, aren't updated. */
7080 /* if (!FRAME_WINDOW_P (it->f))
7078 { 7081 {
7079 struct text_pos textpos; 7082 struct text_pos textpos;
7080 7083
7081 /* We can use vmotion on frames without proportional fonts. */
7082 pos = *vmotion (IT_CHARPOS (*it), dvpos, it->w); 7084 pos = *vmotion (IT_CHARPOS (*it), dvpos, it->w);
7083 SET_TEXT_POS (textpos, pos.bufpos, pos.bytepos); 7085 SET_TEXT_POS (textpos, pos.bufpos, pos.bytepos);
7084 reseat (it, textpos, 1); 7086 reseat (it, textpos, 1);
7085 it->vpos += pos.vpos; 7087 it->vpos += pos.vpos;
7086 it->current_y += pos.vpos; 7088 it->current_y += pos.vpos;
7087 } 7089 }
7088 else if (dvpos == 0) 7090 else */
7091
7092 if (dvpos == 0)
7089 { 7093 {
7090 /* DVPOS == 0 means move to the start of the screen line. */ 7094 /* DVPOS == 0 means move to the start of the screen line. */
7091 move_it_vertically_backward (it, 0); 7095 move_it_vertically_backward (it, 0);
@@ -13532,7 +13536,10 @@ redisplay_window (window, just_this_one_p)
13532 /* Restore current_buffer and value of point in it. */ 13536 /* Restore current_buffer and value of point in it. */
13533 TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint)); 13537 TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint));
13534 set_buffer_internal_1 (old); 13538 set_buffer_internal_1 (old);
13535 TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); 13539 /* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become
13540 shorter. This can be caused by log truncation in *Messages*. */
13541 if (CHARPOS (lpoint) <= ZV)
13542 TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));
13536 13543
13537 unbind_to (count, Qnil); 13544 unbind_to (count, Qnil);
13538} 13545}
diff --git a/src/xterm.c b/src/xterm.c
index 6183ffade0d..1ced63932e5 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2537,9 +2537,11 @@ x_draw_image_glyph_string (s)
2537 { 2537 {
2538 /* Fill background with a stipple pattern. */ 2538 /* Fill background with a stipple pattern. */
2539 XSetFillStyle (s->display, s->gc, FillOpaqueStippled); 2539 XSetFillStyle (s->display, s->gc, FillOpaqueStippled);
2540 XSetTSOrigin (s->display, s->gc, - s->x, - s->y);
2540 XFillRectangle (s->display, pixmap, s->gc, 2541 XFillRectangle (s->display, pixmap, s->gc,
2541 0, 0, s->background_width, s->height); 2542 0, 0, s->background_width, s->height);
2542 XSetFillStyle (s->display, s->gc, FillSolid); 2543 XSetFillStyle (s->display, s->gc, FillSolid);
2544 XSetTSOrigin (s->display, s->gc, 0, 0);
2543 } 2545 }
2544 else 2546 else
2545 { 2547 {
@@ -6711,7 +6713,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6711 6713
6712 /* Window will be selected only when it is not selected now and 6714 /* Window will be selected only when it is not selected now and
6713 last mouse movement event was not in it. Minibuffer window 6715 last mouse movement event was not in it. Minibuffer window
6714 will be selected iff it is active. */ 6716 will be selected only when it is active. */
6715 if (WINDOWP (window) 6717 if (WINDOWP (window)
6716 && !EQ (window, last_window) 6718 && !EQ (window, last_window)
6717 && !EQ (window, selected_window)) 6719 && !EQ (window, selected_window))
diff --git a/src/xterm.h b/src/xterm.h
index c5a266c45fb..c8b768f6187 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -256,7 +256,7 @@ struct x_display_info
256 char *x_id_name; 256 char *x_id_name;
257 257
258 /* The number of fonts actually stored in x_font_table. 258 /* The number of fonts actually stored in x_font_table.
259 font_table[n] is used and valid iff 0 <= n < n_fonts. 0 <= 259 font_table[n] is used and valid if 0 <= n < n_fonts. 0 <=
260 n_fonts <= font_table_size and font_table[i].name != 0. */ 260 n_fonts <= font_table_size and font_table[i].name != 0. */
261 int n_fonts; 261 int n_fonts;
262 262