summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-08-13 13:51:08 +0000
committerMiles Bader <miles@gnu.org>2007-08-13 13:51:08 +0000
commite8ffd486dbb18f8e1e091bcd6b86bf3964cc4cba (patch)
treec65d3c3f6f61b82b8f9917c057b2af8236aae6f2
parent9bba0f5a0113698fe737e567f527ac723125f728 (diff)
parent1b533623e21dd20ec8fb05285cdc47398a5619a1 (diff)
downloademacs-e8ffd486dbb18f8e1e091bcd6b86bf3964cc4cba.tar.gz
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 846-851) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 88-92) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 242-244) - Update from CVS Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-31
-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 @@
+2007-08-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * FOR-RELEASE (http): Add Gtk+ tool bar and GUD focus problem.
+
2007-07-25 Glenn Morris <rgm@gnu.org>
* Relicense all FSF files to GPLv3 or later.
@@ -19,7 +23,7 @@
* nt/makedist.bat: Change EOL format to DOS. Don't use
redirection characters in REM lines.
-2007-01-27 Jan Dj,Ad(Brv <jhd@winter.localdomain>
+2007-01-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* FOR-RELEASE: Removed Gtk/Xft issue.
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.
http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01113.html
** davby@ida.liu.se, 6 July: Bug in pos-visible-in-window-p
-
** dak@gnu.org, 30 May: Redraw problem with overlapping frames
-** dksw@eircom.net, 3 Jul: Telnet mode (rsh/ssh)
-
** bojohan+news@dd.chalmers.se, 1 Aug: n_schumacher@web.de: modification hooks called only once in
-** sdl.web@gmail.com: problem with transparent PNG image display
+** ams@gnu.org, 9 July: eshell and external commands
+
+** timh@insightful.com, 25 June: undigestify-rmail-message in emacs 22.1 doesn't split a digest
+
+** andreas.roehler@online.de, 24 Jul: CVS build on Suse 10.0 failed
+
+** Gtk+ tool bar looses focus when pressing next tool bar button in GUD.
+http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-08/msg00008.html
* FIXES FOR EMACS 22.2
-Here we list small fixes that arrived too late for Emacs 22.1, but
-that should be installed on the release branch after 22.1 is released.
+Here we list small fixes that arrived too late for Emacs 22.2, but
+that should be installed on the release branch after 22.2 is released.
** Changes to six pbm icons in etc/images.
Sync 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 @@
Precompiled Distributions of
Emacs for Windows
- Version 22.1
+ Version 22.2
May 22, 2007
@@ -26,9 +26,9 @@
If you want to redistribute any of the precompiled distributions of
Emacs, be careful to check the implications of the GPL. For instance,
- if you put the emacs-22.1-bin-i386.tar.gz file from this directory on
+ if you put the emacs-22.2-bin-i386.tar.gz file from this directory on
an Internet site, you must arrange to distribute the source files of
- the SAME version (i.e. ../emacs-22.1.tar.gz).
+ the SAME version (i.e. ../emacs-22.2.tar.gz).
Making a link to our copy of the source is NOT sufficient, since we
might upgrade to a new version while you are still distributing the
@@ -37,8 +37,8 @@
* Files in this directory
- + emacs-22.1-bin-i386.zip
- Windows binaries of Emacs-22.1, with all lisp code and documentation
+ + emacs-22.2-bin-i386.zip
+ Windows binaries of Emacs-22.2, with all lisp code and documentation
included.
Download this file if you want a single installation package, and
@@ -49,8 +49,8 @@
If you need the C source code at a later date, it will be safe to
unpack the source distribution on top of this installation.
- + emacs-22.1-barebin-i386.zip
- Windows binaries of Emacs-22.1, without lisp code or documentation.
+ + emacs-22.2-barebin-i386.zip
+ Windows binaries of Emacs-22.2, without lisp code or documentation.
Download this file if you already have the source distribution, or
if you need to redump the emacs.exe executable.
@@ -60,12 +60,22 @@
file, plus temacs.exe and dump.bat, which are required if you want to
redump emacs without recompiling it.
+ + libxpm-src.zip
+ Source code for libXpm-X11R7.2-3.5.6 modified to compile on Windows.
+ This corresponds to the libXpm.dll in emacs-22.2-bin-i386.zip
+ and emacs-22.2-barebin-i386.zip.
+
+
+ The following are provided for users who require older versions.
+
+ + emacs-22.1-bin-i386.zip
+ + emacs-22-1-barebin-i386.zip
+ Windows binaries of Emacs 22.1, contents as above.
+
+ emacs-21.3-bin-i386.tar.gz
Windows binaries of Emacs 21.3, with compiled lisp code and some
documentation included.
- This is provided for users who require the older version.
-
+ emacs-21.3-leim.tar.gz
Compiled lisp input methods. This optional addition to Emacs-21.3
is required if you want to enter languages that are not directly
@@ -73,7 +83,7 @@
* Image support
- Emacs 22.1 contains support for images, however for most image formats
+ Emacs 22.2 contains support for images, however for most image formats
supporting libraries are required. This distribution has been tested
with the libraries that are distributed with GTK for Windows, and the
libraries found at http://gnuwin32.sourceforge.net/. The following image
@@ -82,10 +92,10 @@
PBM/PGM/PPM: Supported natively by Emacs. This format is used for
the black and white versions of the toolbar icons.
- XPM: requires a Windows port of the XPM library 3.4 or later,
- which will be named xpm4.dll, libxpm-nox4.dll or
- libxpm.dll. This format is used for the color versions of the
- toolbar icons, and other images in Emacs.
+ XPM: a Windows port of the XPM library corresponding to the x.org
+ release of X11R7.2 is included with the binary distribution, but
+ can be replaced by other versions with the name xpm4.dll,
+ libxpm-nox4.dll or libxpm.dll.
PNG: requires the PNG reference library 1.2 or later, which will
be named libpng13d.dll, libpng13.dll, libpng12d.dll, libpng12.dll
@@ -217,7 +227,7 @@
about the Windows port and related software packages. Note that as
of writing, most of the information in that FAQ was for Emacs-21.3
and earlier versions, so some information may not be relevant to
- Emacs-22.1.
+ Emacs-22.2.
In addition to the FAQ, there is a mailing list for discussing issues
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
rem Info-ZIP zip seems to be broken on Windows.
rem It always writes to zip.zip and treats the zipfile argument as one
rem of the files to go in it.
-rem 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
-7z 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
+rem 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
+7z 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
del emacs-%1\README.W32
if not (%4) == () goto end
diff --git a/etc/ChangeLog b/etc/ChangeLog
index dda264e8f1e..5d6b9e615ac 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-08 Glenn Morris <rgm@gnu.org>
+
+ * TODO: `iff' item is dealt with.
+ * GNUS-NEWS, NEWS, NEWS.1-17, NEWS.19, NEWS.21: Replace `iff'.
+
2007-08-01 Glenn Morris <rgm@gnu.org>
* 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'.
Use `make.bat' if you want to install Gnus under MS Windows, the first
argument to the batch-program should be the directory where `xemacs.exe'
-respectively `emacs.exe' is located, iff you want to install Gnus after
+respectively `emacs.exe' is located, if you want to install Gnus after
compiling it, give `make.bat' `/copy' as the second parameter.
`make.bat' has been rewritten from scratch, it now features automatic
@@ -308,7 +308,7 @@ as external parts.
** Gnus no longer generate the Sender: header automatically.
-Earlier it was generated iff the user configurable email address was
+Earlier it was generated when the user configurable email address was
different from the Gnus guessed default user address. As the guessing
algorithm is rarely correct these days, and (more controversially) the
only 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.
* New Modes and Packages in Emacs 23.1
-** bibtex-style-mode helps you write BibTeX's *.bst files.
-
** minibuffer-indicate-depth-mode shows the minibuffer depth in the prompt.
@@ -99,8 +97,6 @@ considered for update.
*** VC backends can provide extra menu entries to be added to the "Version Control" menu.
This can be used to add menu entries for backend specific functions.
-*** VC has some support for Bazaar (bzr).
-
** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs.
** BibTeX mode:
@@ -198,10 +194,6 @@ like this:
Use this instead of "~/.emacs.d".
+++
-** The new function `image-refresh' refreshes all images associated
-with a given image specification.
-
-+++
** The new function `start-file-process is similar to `start-process',
but obeys file handlers. The file handler is chosen based on
`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.
* New function `auto-save-file-name-p'
-Should return non-`nil' iff given a string which is the name of an
+Should return non-`nil' if given a string which is the name of an
auto-save file (sans directory name). If you redefine
`make-auto-save-file-name', you should redefine this accordingly. By
default, 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).
** It is now simpler to tell Emacs to display accented characters under
X windows. M-x standard-display-european toggles the display of
buffer text according to the ISO Latin-1 standard. With a prefix
-argument, this command enables European character display iff the
-argument is positive.
+argument, this command enables European character display if and only
+if the argument is positive.
** The `-i' command-line argument tells Emacs to use a picture of the
GNU 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
returned.
Optional second arg MINIBUF t means count the minibuffer window even
-if not active. MINIBUF nil or omitted means count the minibuffer iff
+if not active. MINIBUF nil or omitted means count the minibuffer if
it is active. MINIBUF neither t nor nil means not to count the
minibuffer even if it is active.
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.
* New Modes and Packages in Emacs 22.2
+** bibtex-style-mode helps you write BibTeX's *.bst files.
+
** The new package css-mode.el provides a major mode for editing CSS files.
** 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.
*** VC has some support for Mercurial (hg).
+*** VC has some support for Bazaar (Bzr).
+
*** VC has some support for Git.
+* Lisp Changes in Emacs 22.2.
+
+** New function `window-full-width-p' returns t if a window is as wide
+as its frame.
+
+** The new function `image-refresh' refreshes all images associated
+with a given image specification.
+
+** The new function `split-string-and-unquote' does (what?)
+
+** The new function `combine-and-quote-strings' does (what?)
* Installation Changes in Emacs 22.1
@@ -3550,8 +3565,8 @@ that is, floats are compared by value and other elements with `eq'.
*** New functions `string-or-null-p' and `booleanp'.
-`string-or-null-p' returns non-nil iff OBJECT is a string or nil.
-`booleanp' returns non-nil iff OBJECT is t or nil.
+`string-or-null-p' returns non-nil if OBJECT is a string or nil.
+`booleanp' returns non-nil if OBJECT is t or nil.
*** `makehash' is now obsolete. Use `make-hash-table' instead.
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.
** Compute the list of active keymaps *after* reading the first event.
-** Avoid using "iff" in doc strings.
-
** mouse-autoselect-window should wait to select the window until
the mouse is put to rest or after a delay or both, so that moving over
a 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));
* function or variable, or corresponds to a typedef, or
* is a struct/union/enum tag, or #define, or an enum constant.
*
- * *IS_FUNC gets TRUE iff the token is a function or #define macro
+ * *IS_FUNC gets TRUE if the token is a function or #define macro
* with args. C_EXTP points to which language we are looking at.
*
* Globals
@@ -4803,7 +4803,7 @@ Pascal_functions (inf)
int save_lineno, namelen, taglen;
char c, *name;
- bool /* each of these flags is TRUE iff: */
+ bool /* each of these flags is TRUE if: */
incomment, /* point is inside a comment */
inquote, /* point is inside '..' string */
get_tagname, /* point is after PROCEDURE/FUNCTION
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5d830248269..4b0064a09ed 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,385 @@
+2007-08-13 Nick Roberts <nickrob@snap.net.nz>
+
+ * progmodes/gdb-ui.el (gdb-send): Handle CTRL-D more carefully.
+
+2007-08-12 Richard Stallman <rms@gnu.org>
+
+ * pcvs.el (cvs-reread-cvsrc, cvs-checkout, cvs-mode-checkout)
+ (cvs-execute-single-file): Use new name split-string-and-unquote.
+ (cvs-header-msg): Use new name combine-and-quote-strings.
+
+ * emulation/vi.el (vi-next-line): Ignore return value of line-move.
+
+ * progmodes/gud.el (gud-common-init): Use new name
+ split-string-and-unquote.
+
+ * progmodes/flymake.el (flymake-err-line-patterns): Fix infloop
+ in javac regexp.
+
+ * pcvs-util.el (cvs-qtypedesc-strings): Use new names
+ combine-and-quote-strings and split-string-and-unquote.
+
+ * subr.el (combine-and-quote-strings): Renamed from strings->string.
+ (split-string-and-unquote): Renamed from string->strings.
+
+2007-08-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * log-view.el (log-view-font-lock-keywords): Use `eval' so as to adapt
+ to buffer-local settings.
+
+ * emacs-lisp/backquote.el (backquote-delay-process): New function.
+ (backquote-process): Add internal arg `level'. Use the two to
+ correctly handle nested backquotes.
+
+2007-08-09 Riccardo Murri <riccardo.murri@gmail.com>
+
+ * vc-bzr.el (vc-bzr-registered): Use \0 instead of literal NULs.
+ (vc-bzr-state-words): Add "kind changed" state word.
+ (vc-bzr-status): New function. Return Bzr idea of file status,
+ which is different from VC's.
+ (vc-bzr-state): Use vc-bzr-status.
+ (vc-workfile-unchanged-p): Use vc-bzr-status.
+ (vc-bzr-revert): Use synchronous process; expect exitcode 0.
+ (vc-dired-state): Process "kind changed" state word.
+
+2007-08-09 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc-hooks.el (vc-default-find-file-not-found-hook): Do nothing.
+
+ * vc-rcs.el (vc-rcs-find-file-not-found-hook):
+ Move from vc-default-find-file-not-found-hook.
+
+2007-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * man.el: Remove spurious * in docstrings.
+ Merge defvars and toplevel setq-defaults.
+ (Man-highlight-references0): Limit=nil rather than point-max.
+ (Man-mode-map): Move initialization into the declaration.
+ (Man-strip-page-headers, Man-unindent): Use dolist & inhibit-read-only.
+ (Man-view-header-file): Use expand-file-name rather than concat.
+ (Man-notify-when-ready, Man-bgproc-sentinel): Use with-current-buffer.
+
+ * man.el (Man-next-section): Make sure we do not move backward.
+
+2007-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * files.el (auto-mode-alist): Use the purecopied text (duh!).
+
+2007-08-08 Glenn Morris <rgm@gnu.org>
+
+ * Replace `iff' in doc-strings and comments.
+
+2007-08-08 Martin Rudalics <rudalics@gmx.at>
+
+ * dired.el (dired-pop-to-buffer):
+ * mouse-drag.el (mouse-drag-should-do-col-scrolling):
+ * calendar/calendar.el (generate-calendar-window):
+ * progmodes/compile.el (compilation-set-window-height):
+ * textmodes/two-column.el (2C-two-columns, 2C-merge):
+ Use window-full-width-p instead of comparing frame-width and
+ window-width.
+
+ * progmodes/compile.el (compilation-find-buffer): Remove extra
+ argument in call to compilation-buffer-internal-p.
+
+2007-08-07 Tom Tromey <tromey@redhat.com>
+
+ * progmodes/tcl.el (tcl-indent-level, tcl-continued-indent-level):
+ Add safe-local-variable property.
+
+2007-08-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * image-mode.el (image-toggle-display): Use image-refresh.
+
+2007-08-07 Riccardo Murri <riccardo.murri@gmail.com>
+
+ * vc-bzr.el: Remove comments about vc-bzr.el being a modified
+ unofficial version.
+ (vc-bzr-command): Remove redundant setting of process-connection-type.
+ (vc-bzr-admin-checkout-format-file): Add autoload.
+ (vc-bzr-root-dir): Remove in favor of vc-bzr-root.
+ (vc-bzr-root): Switch to implementation of vc-bzr-root-dir.
+ (vc-bzr-registered): Compare dirstate format tag with known good
+ value, abort parsing if match fails. Warn user in docstring.
+ (vc-bzr-workfile-version): Case for different Bzr branch formats.
+ See bzrlib/branch.py in Bzr sources.
+ (vc-bzr-diff): First argument FILES may be a string rather than a list.
+ (vc-bzr-shell-command): Remove in favor of
+ vc-bzr-command-discarding-stderr.
+ (vc-bzr-command-discarding-stderr): New function.
+
+2007-08-06 Riccardo Murri <riccardo.murri@gmail.com>
+
+ * vc-bzr.el (vc-bzr-registered): Gracefully handle missing "bzr"
+ program, and return nil
+ (vc-bzr-state): Gracefully handle missing "bzr" program, and return nil.
+ (vc-bzr-state): Look for path names relative to the repository
+ root after status keyword.
+ (vc-bzr-file-name-relative): New function.
+ (vc-bzr-admin-dirname): Reinstate, as other vc-bzr-admin-... paths
+ depend on it.
+ (vc-bzr-admin-dirname, ...-checkout-format-file)
+ (...-branch-format-file, ...-revhistory): Paths to some Bzr internal
+ files that we now parse directly for speed.
+ (vc-bzr-root-dir): Use `vc-bzr-admin-checkout-format-file' as witness.
+ (vc-bzr-registered): Only parse vc-bzr-admin-dirstate file if it exists.
+ (vc-bzr-state): "bzr status" successful only if exitcode is 0
+ (vc-bzr-root): Use `vc-bzr-shell-command'. Stderr may contain
+ Bzr warnings, so we must discard it.
+ (vc-bzr-workfile-version): Speedup counting lines from
+ `vc-bzr-admin-revhistory' file, but fallback to spawning "bzr revno"
+ if that file doesn't exist.
+ (vc-bzr-responsible-p): Use `vc-bzr-root' instead of
+ `vc-bzr-root-dir' for speed. Add `vc-bzr-admin-dirname'
+ (not ".bzr"!) to `vc-directory-exclusion-list'
+ (vc-bzr-shell-command): New function.
+
+2007-08-06 Tom Tromey <tromey@redhat.com>
+
+ * diff-mode.el (diff-unified->context, diff-reverse-direction)
+ (diff-fixup-modifs): Typo in docstring.
+
+2007-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emulation/tpu-edt.el (tpu-current-line): Use posn-at-point and
+ count-screen-lines.
+ (tpu-edt-off): Disable relevant pieces of advice.
+
+ * emulation/tpu-extras.el (tpu-before-save-hook): Rename from
+ tpu-write-file-hook. Activate it with add-hook on buffer-save-hook.
+ (newline, newline-and-indent, do-auto-fill): Use advice instead of
+ redefining the function.
+ (tpu-set-scroll-margins): Activate the pieces of advice.
+
+2007-08-06 Martin Rudalics <rudalics@gmx.at>
+
+ * help.el (resize-temp-buffer-window): Use window-full-width-p
+ instead of comparing frame-width and window-width.
+
+2007-08-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/autoload.el (autoload-print-form): Use print-quoted.
+
+2007-08-12 Richard Stallman <rms@gnu.org>
+
+ * progmodes/sh-script.el (sh): Delete group `unix'.
+
+ * progmodes/gud.el (gud): Change to group `processes'.
+
+2007-08-11 Glenn Morris <rgm@gnu.org>
+
+ * progmodes/compile.el (compilation-buffer-name): Don't check
+ compilation-arguments. It is superfluous, and the variable isn't
+ even set when this function is called.
+
+2007-08-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * term/mac-win.el (mac-ae-reopen-application): New function.
+ (mac-apple-event-map): Bind "reopen application" Apple event to it.
+
+2007-08-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * textmodes/tex-mode.el (tex-font-lock-unfontify-region): Fix to
+ take tex-font-script-display into account.
+ (tex-font-script-display, tex-font-lock-suscript): Change from a cons
+ cell to a list of 2 elements to simplify the unfontify code.
+
+2007-08-09 Edward O'Connor <hober0@gmail.com> (tiny change)
+
+ * url/url-auth.el (url-basic-auth): When prompting for username
+ and password, default to the username and password in the URL.
+
+2007-08-08 Vinicius Jose Latorre <viniciusjl@ig.com.br>
+
+ * ps-print.el (ps-default-fg, ps-default-bg): Docstring fix.
+ (ps-begin-job): Use ps-default-fg and ps-default-bg only when
+ ps-print-color-p is neither nil nor black-white. Reported by Christian
+ Schlauer <cs-muelleimer-rubbish.bin@arcor.de>.
+
+2007-08-08 Andreas Schwab <schwab@suse.de>
+
+ * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook): Check for
+ self-insert-command, not self-insert.
+
+2007-08-08 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/eldoc.el (eldoc-get-fnsym-args-string): Make second
+ argument optional, for backwards compatibility, and only highlight
+ args when present. Fix symbol name typo (doc/args).
+
+ * help-mode.el (help-make-xrefs): Search for symbol constituents,
+ rather than just `-'.
+
+2007-08-07 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-units.el (calc-convert-temperature):
+ Use `/' to create fractions.
+
+2007-08-07 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more
+ global matching.
+ (tramp-handle-shell-command): Handle OUTPUT-BUFFER and
+ ERROR-BUFFER more robust. Display output.
+ (tramp-file-name-handler): Add a connection property when we found
+ a foreign file name handler. This allows backends like ftp to
+ profit also from usr/host name completion based on connection
+ cache.
+ (tramp-send-command-and-read): Search for trash after the regexp
+ until eol only. In XEmacs, there is a problem with \n.
+
+ * net/tramp-cache.el (top): Read persistent connection history
+ when cache is empty.
+
+2007-08-07 Nic Ferrier <nferrier@tapsellferrier.co.uk> (tiny change)
+
+ * net/tramp.el (tramp-handle-process-file): Fix bug inserting
+ resulting output.
+
+2007-08-07 Sam Steingold <sds@gnu.org>
+
+ * progmodes/compile.el (compilation-start): Pass nil as startfile
+ to comint-exec.
+
+2007-08-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * longlines.el (longlines-decoded): New variable.
+ (longlines-mode): Avoid encoding or decoding the buffer twice.
+
+2007-08-07 Martin Rudalics <rudalics@gmx.at>
+
+ * format.el (format-insert-file): Make sure that at most one undo
+ entry is recorded for the insertion. Inhibit point-motion and
+ modification hooks around call to insert-file-contents.
+
+2007-08-07 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc.el (vc-annotate): Select temp-buffer before running vc-exec-after.
+ Select the buffer's window before moving point.
+
+2007-08-07 Richard Stallman <rms@gnu.org>
+
+ * term.el (term): Remove parent group `unix'.
+
+ * simple.el (default-indent-new-line): New function.
+ It calls comment-line-break-function if there are comments.
+ (do-auto-fill): Use that.
+
+2007-08-07 Ivan Kanis <apple@kanis.eu>
+
+ * time.el (display-time-world-mode, display-time-world-display)
+ (display-time-world, display-time-world-list)
+ (display-time-world-time-format, display-time-world-buffer-name)
+ (display-time-world-timer-enable)
+ (display-time-world-timer-second, display-time-world-mode-map):
+ New.
+
+2007-08-07 Sean O'Rourke <sorourke@cs.ucsd.edu>
+
+ * complete.el (PC-lisp-complete-symbol): Complete symbol around point.
+ (PC-do-completion): Add "acronym completion" for symbols and
+ filenames, so e.g. "mvbl" expands to "make-variable-buffer-local".
+
+2007-08-06 Sam Steingold <sds@gnu.org>
+
+ * mouse.el (mouse-buffer-menu): Pass mode-name through
+ format-mode-line because it may be a list,
+ e.g., (sgml-xml-mode "XML" "SGML"), and not a string.
+
+2007-08-06 Vinicius Jose Latorre <viniciusig@ig.com.br>
+
+ * printing.el (pr-update-menus): Docstring fix.
+
+2007-08-06 Jason Rumney <jasonr@gnu.org>
+
+ * menu-bar.el (menu-bar-vc-filter): Use vc-call-backend.
+
+ * vc-hooks.el (vc-call): Add doc string.
+
+2007-08-06 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in
+ process-filter.
+
+2007-08-06 Kenichi Handa <handa@m17n.org>
+
+ * international/quail.el: Wrap (require 'help-mode) by
+ eval-when-compile.
+ (quail-help-init): New function.
+ (quail-help): Call quail-help-init.
+ (quail-store-decode-map-key): Change it to a function.
+
+2007-08-05 Jason Rumney <jasonr@gnu.org>
+
+ * vc.el (vc-rollback): Add norevert argument back.
+ (vc-revert-buffer): Add back as obsolete alias.
+
+2007-08-05 Peter Povinec <ppovinec@yahoo.com> (tiny change)
+
+ * term.el: Honor term-default-fg-color and term-default-bg-color
+ settings when modifying term-current-face.
+ (term-default-fg-color, term-default-bg-color): Initialize from
+ default term-current-face.
+ (term-mode, term-reset-terminal): Set term-current-face with
+ term-default-fg-color and term-default-bg-color.
+ (term-handle-colors-array): term-current-face has term-default-fg-color
+ and term-default-bg-color after reset escape sequence.
+ (term-handle-colors-array): Set term-current-color with
+ term-default-fg/bg-color instead of ansi-term-color-vector when the
+ index (term-ansi-current-color or term-ansi-current-bg-color) is zero.
+
+2007-08-05 Jay Belanger <belanger@localhost.localdomain>
+
+ * calc/calc-nlfit.el (math-nlfit-curve):
+ Remove unnecessary variables.
+ (math-nlfit-givens): Let bind free variables.
+
+2007-08-05 Vinicius Jose Latorre <viniciusig@ig.com.br>
+
+ * printing.el: Require lpr and ps-print when loading printing package.
+ Reported by Glenn Morris <rgm@gnu.org>.
+
+2007-08-05 Michael Albinus <michael.albinus@gmx.de>
+
+ * files.el (set-auto-mode): Handle also remote files wrt
+ `auto-mode-alist'.
+
+2007-08-04 Jay Belanger <belanger@localhost.localdomain>
+
+ * calc/calcalg3.el (calc-curve-fit): Add support for nonlinear
+ curves and plotting.
+
+ * calc/calc-nlfit.el: New file.
+
+2007-08-04 Glenn Morris <rgm@gnu.org>
+
+ * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is
+ zero, not nil, when the library is first loaded. Check for a file
+ that has been modified on disk.
+
+ * progmodes/cperl-mode.el (cperl-compilation-error-regexp-alist):
+ Remove duplicate defvar preventing initialization.
+ (cperl-mode): Fix compilation-error-regexp-alist-alist setting.
+
+2007-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * diff-mode.el (diff-font-lock-keywords): Fix up false positives.
+ (diff-beginning-of-file): Adjust to the fact that diff-file-header-re
+ may match up to 4 lines.
+ (diff-beginning-of-file-and-junk): Rewrite.
+
+2007-08-03 Vinicius Jose Latorre <viniciusjl@ig.com.br>
+
+ * printing.el: Evaluate require only during compilation.
+ (pr-version): New version 6.9.1.
+ (deactivate-mark): Replace (defvar VAR nil) by (defvar VAR).
+ (pr-global-menubar): Fix code.
+
+2007-08-03 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * term.el (term-erase-in-display): Fix case when point is not at
+ the beginning of the line.
+
2007-08-03 Jay Belanger <jay.p.belanger@gmail.com>
* calc/calc-ext.el (math-get-value,math-get-sdev)
@@ -18,7 +400,7 @@
* vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info)
(vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'.
-2007-08-02 Richard Stallman <rms@gnu.org>
+2007-08-03 Richard Stallman <rms@gnu.org>
* mail/rmailsum.el (rmail-make-summary-line): Find end of msg number
to update deleted flag.
@@ -38,13 +420,13 @@
buffer immediately if suitable.
(compile, compilation-buffer-name, compilation-start): Doc fixes.
-2007-07-31 Daiki Ueno <ueno@unixuser.org>
+2007-08-03 Daiki Ueno <ueno@unixuser.org>
* faces.el (face-normalize-spec): New function.
(frame-set-background-mode): Normalize face-spec before calling
face-spec-match-p.
-2007-07-31 Stefan Monnier <monnier@iro.umontreal.ca>
+2007-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
* server.el (server-window): Add switch-to-buffer-other-frame option.
@@ -98,16 +480,15 @@
(fortran-mode): Use fortran-line-length, and
fortran-font-lock-syntactic-keywords as a function. Add a
hack-local-variables-hook function.
- (fortran-line-length, fortran-hack-local-variables): New
- functions.
- (fortran-window-create, fortran-strip-sequence-nos): Doc fix. Use
- fortran-line-length rather than 72.
+ (fortran-line-length, fortran-hack-local-variables): New functions.
+ (fortran-window-create, fortran-strip-sequence-nos): Doc fix.
+ Use fortran-line-length rather than 72.
(fortran-window-create-momentarily): Doc fix.
2007-07-31 Drew Adams <drew.adams@oracle.com> (tiny change)
- * cus-edit.el (custom-group-value-create, custom-goto-parent): Fix
- parent groups link.
+ * cus-edit.el (custom-group-value-create, custom-goto-parent):
+ Fix parent groups link.
2007-07-31 Paul Pogonyshev <pogonyshev@gmx.net>
@@ -160,21 +541,21 @@
2007-07-29 Michael Albinus <michael.albinus@gmx.de>
- * tramp.el:
- * tramp-uu.el:
- * trampver.el: Use utf-8 encoding with coding cookie.
+ * net/tramp.el:
+ * net/tramp-uu.el:
+ * net/trampver.el: Use utf-8 encoding with coding cookie.
- * tramp-cache.el:
- * tramp-fish.el:
- * tramp-ftp.el:
- * tramp-gw.el:
- * tramp-smb.el: Remove coding cookie.
+ * net/tramp-cache.el:
+ * net/tramp-fish.el:
+ * net/tramp-ftp.el:
+ * net/tramp-gw.el:
+ * net/tramp-smb.el: Remove coding cookie.
- * tramp.el (tramp-handle-verify-visited-file-modtime):
+ * net/tramp.el (tramp-handle-verify-visited-file-modtime):
Flush buffer file-name's file property.
(tramp-handle-file-remote-p): The first parameter is FILENAME.
- * trampver.el: Update release number.
+ * net/trampver.el: Update release number.
2007-07-29 Juri Linkov <juri@jurta.org>
@@ -728,9 +1109,9 @@
Sync with Tramp 2.1.10.
- * tramp.el (tramp-get-ls-command): Fyx typo.
+ * net/tramp.el (tramp-get-ls-command): Fyx typo.
- * trampver.el: Update release number.
+ * net/trampver.el: Update release number.
2007-07-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
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."
(defun abbrev-mode (&optional arg)
"Toggle Abbrev mode in the current buffer.
-With argument ARG, turn abbrev mode on iff ARG is positive.
-In Abbrev mode, inserting an abbreviation causes it to expand
-and be replaced by its expansion."
+With optional argument ARG, turn abbrev mode on if ARG is
+positive, otherwise turn it off. In Abbrev mode, inserting an
+abbreviation causes it to expand and be replaced by its expansion."
(interactive "P")
(setq abbrev-mode
(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:
"Toggle minor mode for controlling exposure and editing of text outlines.
\\<allout-mode-map>
-Optional arg forces mode to re-initialize iff arg is positive num or
-symbol. Allout outline mode always runs as a minor mode.
+Optional prefix argument TOGGLE forces the mode to re-initialize
+if it is positive, otherwise it turns the mode off. Allout
+outline mode always runs as a minor mode.
Allout outline mode provides extensive outline oriented formatting and
manipulation. 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.")
"Position of last known end of file.")
(add-hook 'find-file-hook
- (lambda ()
- (set (make-local-variable 'auto-revert-tail-pos)
- (nth 7 (file-attributes buffer-file-name)))))
+ (lambda ()
+ (set (make-local-variable 'auto-revert-tail-pos)
+ (nth 7 (file-attributes buffer-file-name)))))
;; Functions:
@@ -315,7 +315,7 @@ This function is designed to be added to hooks, for example:
;;;###autoload
(define-minor-mode auto-revert-tail-mode
"Toggle reverting tail of buffer when file on disk grows.
-With arg, turn Tail mode on iff arg is positive.
+With arg, turn Tail mode on if arg is positive, otherwise turn it off.
When Tail mode is enabled, the tail of the file is constantly
followed, as with the shell command `tail -f'. This means that
@@ -334,9 +334,25 @@ Use `auto-revert-mode' for changes other than appends!"
(auto-revert-tail-mode 0)
(error "This buffer is not visiting a file"))
(if (and (buffer-modified-p)
- (not auto-revert-tail-pos) ; library was loaded only after finding file
+ (zerop auto-revert-tail-pos) ; library was loaded only after finding file
(not (y-or-n-p "Buffer is modified, so tail offset may be wrong. Proceed? ")))
(auto-revert-tail-mode 0)
+ ;; a-r-tail-pos stores the size of the file at the time of the
+ ;; last revert. After this package loads, it adds a
+ ;; find-file-hook to set this variable every time a file is
+ ;; loaded. If the package is loaded only _after_ visiting the
+ ;; file to be reverted, then we have no idea what the value of
+ ;; a-r-tail-pos should have been when the file was visited. If
+ ;; the file has changed on disk in the meantime, all we can do
+ ;; is offer to revert the whole thing. If you choose not to
+ ;; revert, then you might miss some output then happened
+ ;; between visiting the file and activating a-r-t-mode.
+ (and (zerop auto-revert-tail-pos)
+ (not (verify-visited-file-modtime (current-buffer)))
+ (y-or-n-p "File changed on disk, content may be missing. \
+Perform a full revert? ")
+ ;; Use this (not just revert-buffer) for point-preservation.
+ (auto-revert-handler))
;; else we might reappend our own end when we save
(add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t)
(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.")
(defvar minor-mode-alist nil "\
Alist saying how to show minor modes in the mode line.
Each element looks like (VARIABLE STRING);
-STRING is included in the mode line iff VARIABLE's value is non-nil.
+STRING is included in the mode line if VARIABLE's value is non-nil.
Actually, STRING need not be a string; any possible mode-line element
is 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 @@
+;;; calc-nlfit.el --- nonlinear curve fitting for Calc
+
+;; Copyright (C) 2007 Free Software Foundation, Inc.
+
+;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This code uses the Levenberg-Marquardt method, as described in
+;; _Numerical Analysis_ by H. R. Schwarz, to fit data to
+;; nonlinear curves. Currently, the only the following curves are
+;; supported:
+;; The logistic S curve, y=a/(1+exp(b*(t-c)))
+;; Here, y is usually interpreted as the population of some
+;; quantity at time t. So we will think of the data as consisting
+;; of quantities q0, q1, ..., qn and their respective times
+;; t0, t1, ..., tn.
+
+;; The logistic bell curve, y=A*exp(B*(t-C))/(1+exp(B*(t-C)))^2
+;; Note that this is the derivative of the formula for the S curve.
+;; We get A=-a*b, B=b and C=c. Here, y is interpreted as the rate
+;; of growth of a population at time t. So we will think of the
+;; data as consisting of rates p0, p1, ..., pn and their
+;; respective times t0, t1, ..., tn.
+
+;; The Hubbert Linearization, y/x=A*(1-x/B)
+;; Here, y is thought of as the rate of growth of a population
+;; and x represents the actual population. This is essentially
+;; the differential equation describing the actual population.
+
+;; The Levenberg-Marquardt method is an iterative process: it takes
+;; an initial guess for the parameters and refines them. To get an
+;; initial guess for the parameters, we'll use a method described by
+;; Luis de Sousa in "Hubbert's Peak Mathematics". The idea is that
+;; given quantities Q and the corresponding rates P, they should
+;; satisfy P/Q= mQ+a. We can use the parameter a for an
+;; approximation for the parameter a in the S curve, and
+;; approximations for b and c are found using least squares on the
+;; linearization log((a/y)-1) = log(bb) + cc*t of
+;; y=a/(1+bb*exp(cc*t)), which is equivalent to the above s curve
+;; formula, and then tranlating it to b and c. From this, we can
+;; also get approximations for the bell curve parameters.
+
+;;; Code:
+
+(require 'calc-arith)
+
+(defun math-nlfit-least-squares (xdata ydata &optional sdata sigmas)
+ "Return the parameters A and B for the best least squares fit y=a+bx."
+ (let* ((n (length xdata))
+ (s2data (if sdata
+ (mapcar 'calcFunc-sqr sdata)
+ (make-list n 1)))
+ (S (if sdata 0 n))
+ (Sx 0)
+ (Sy 0)
+ (Sxx 0)
+ (Sxy 0)
+ D)
+ (while xdata
+ (let ((x (car xdata))
+ (y (car ydata))
+ (s (car s2data)))
+ (setq Sx (math-add Sx (if s (math-div x s) x)))
+ (setq Sy (math-add Sy (if s (math-div y s) y)))
+ (setq Sxx (math-add Sxx (if s (math-div (math-mul x x) s)
+ (math-mul x x))))
+ (setq Sxy (math-add Sxy (if s (math-div (math-mul x y) s)
+ (math-mul x y))))
+ (if sdata
+ (setq S (math-add S (math-div 1 s)))))
+ (setq xdata (cdr xdata))
+ (setq ydata (cdr ydata))
+ (setq s2data (cdr s2data)))
+ (setq D (math-sub (math-mul S Sxx) (math-mul Sx Sx)))
+ (let ((A (math-div (math-sub (math-mul Sxx Sy) (math-mul Sx Sxy)) D))
+ (B (math-div (math-sub (math-mul S Sxy) (math-mul Sx Sy)) D)))
+ (if sigmas
+ (let ((C11 (math-div Sxx D))
+ (C12 (math-neg (math-div Sx D)))
+ (C22 (math-div S D)))
+ (list (list 'sdev A (calcFunc-sqrt C11))
+ (list 'sdev B (calcFunc-sqrt C22))
+ (list 'vec
+ (list 'vec C11 C12)
+ (list 'vec C12 C22))))
+ (list A B)))))
+
+;;; The methods described by de Sousa require the cumulative data qdata
+;;; and the rates pdata. We will assume that we are given either
+;;; qdata and the corresponding times tdata, or pdata and the corresponding
+;;; tdata. The following two functions will find pdata or qdata,
+;;; given the other..
+
+;;; First, given two lists; one of values q0, q1, ..., qn and one of
+;;; corresponding times t0, t1, ..., tn; return a list
+;;; p0, p1, ..., pn of the rates of change of the qi with respect to t.
+;;; p0 is the right hand derivative (q1 - q0)/(t1 - t0).
+;;; pn is the left hand derivative (qn - q(n-1))/(tn - t(n-1)).
+;;; The other pis are the averages of the two:
+;;; (1/2)((qi - q(i-1))/(ti - t(i-1)) + (q(i+1) - qi)/(t(i+1) - ti)).
+
+(defun math-nlfit-get-rates-from-cumul (tdata qdata)
+ (let ((pdata (list
+ (math-div
+ (math-sub (nth 1 qdata)
+ (nth 0 qdata))
+ (math-sub (nth 1 tdata)
+ (nth 0 tdata))))))
+ (while (> (length qdata) 2)
+ (setq pdata
+ (cons
+ (math-mul
+ '(float 5 -1)
+ (math-add
+ (math-div
+ (math-sub (nth 2 qdata)
+ (nth 1 qdata))
+ (math-sub (nth 2 tdata)
+ (nth 1 tdata)))
+ (math-div
+ (math-sub (nth 1 qdata)
+ (nth 0 qdata))
+ (math-sub (nth 1 tdata)
+ (nth 0 tdata)))))
+ pdata))
+ (setq qdata (cdr qdata)))
+ (setq pdata
+ (cons
+ (math-div
+ (math-sub (nth 1 qdata)
+ (nth 0 qdata))
+ (math-sub (nth 1 tdata)
+ (nth 0 tdata)))
+ pdata))
+ (reverse pdata)))
+
+;;; Next, given two lists -- one of rates p0, p1, ..., pn and one of
+;;; corresponding times t0, t1, ..., tn -- and an initial values q0,
+;;; return a list q0, q1, ..., qn of the cumulative values.
+;;; q0 is the initial value given.
+;;; For i>0, qi is computed using the trapezoid rule:
+;;; qi = q(i-1) + (1/2)(pi + p(i-1))(ti - t(i-1))
+
+(defun math-nlfit-get-cumul-from-rates (tdata pdata q0)
+ (let* ((qdata (list q0)))
+ (while (cdr pdata)
+ (setq qdata
+ (cons
+ (math-add (car qdata)
+ (math-mul
+ (math-mul
+ '(float 5 -1)
+ (math-add (nth 1 pdata) (nth 0 pdata)))
+ (math-sub (nth 1 tdata)
+ (nth 0 tdata))))
+ qdata))
+ (setq pdata (cdr pdata))
+ (setq tdata (cdr tdata)))
+ (reverse qdata)))
+
+;;; Given the qdata, pdata and tdata, find the parameters
+;;; a, b and c that fit q = a/(1+b*exp(c*t)).
+;;; a is found using the method described by de Sousa.
+;;; b and c are found using least squares on the linearization
+;;; log((a/q)-1) = log(b) + c*t
+;;; In some cases (where the logistic curve may well be the wrong
+;;; model), the computed a will be less than or equal to the maximum
+;;; value of q in qdata; in which case the above linearization won't work.
+;;; In this case, a will be replaced by a number slightly above
+;;; the maximum value of q.
+
+(defun math-nlfit-find-qmax (qdata pdata tdata)
+ (let* ((ratios (mapcar* 'math-div pdata qdata))
+ (lsdata (math-nlfit-least-squares ratios tdata))
+ (qmax (math-max-list (car qdata) (cdr qdata)))
+ (a (math-neg (math-div (nth 1 lsdata) (nth 0 lsdata)))))
+ (if (math-lessp a qmax)
+ (math-add '(float 5 -1) qmax)
+ a)))
+
+(defun math-nlfit-find-logistic-parameters (qdata pdata tdata)
+ (let* ((a (math-nlfit-find-qmax qdata pdata tdata))
+ (newqdata
+ (mapcar (lambda (q) (calcFunc-ln (math-sub (math-div a q) 1)))
+ qdata))
+ (bandc (math-nlfit-least-squares tdata newqdata)))
+ (list
+ a
+ (calcFunc-exp (nth 0 bandc))
+ (nth 1 bandc))))
+
+;;; Next, given the pdata and tdata, we can find the qdata if we know q0.
+;;; We first try to find q0, using the fact that when p takes on its largest
+;;; value, q is half of its maximum value. So we'll find the maximum value
+;;; of q given various q0, and use bisection to approximate the correct q0.
+
+;;; First, given pdata and tdata, find what half of qmax would be if q0=0.
+
+(defun math-nlfit-find-qmaxhalf (pdata tdata)
+ (let ((pmax (math-max-list (car pdata) (cdr pdata)))
+ (qmh 0))
+ (while (math-lessp (car pdata) pmax)
+ (setq qmh
+ (math-add qmh
+ (math-mul
+ (math-mul
+ '(float 5 -1)
+ (math-add (nth 1 pdata) (nth 0 pdata)))
+ (math-sub (nth 1 tdata)
+ (nth 0 tdata)))))
+ (setq pdata (cdr pdata))
+ (setq tdata (cdr tdata)))
+ qmh))
+
+;;; Next, given pdata and tdata, approximate q0.
+
+(defun math-nlfit-find-q0 (pdata tdata)
+ (let* ((qhalf (math-nlfit-find-qmaxhalf pdata tdata))
+ (q0 (math-mul 2 qhalf))
+ (qdata (math-nlfit-get-cumul-from-rates tdata pdata q0)))
+ (while (math-lessp (math-nlfit-find-qmax
+ (mapcar
+ (lambda (q) (math-add q0 q))
+ qdata)
+ pdata tdata)
+ (math-mul
+ '(float 5 -1)
+ (math-add
+ q0
+ qhalf)))
+ (setq q0 (math-add q0 qhalf)))
+ (let* ((qmin (math-sub q0 qhalf))
+ (qmax q0)
+ (qt (math-nlfit-find-qmax
+ (mapcar
+ (lambda (q) (math-add q0 q))
+ qdata)
+ pdata tdata))
+ (i 0))
+ (while (< i 10)
+ (setq q0 (math-mul '(float 5 -1) (math-add qmin qmax)))
+ (if (math-lessp
+ (math-nlfit-find-qmax
+ (mapcar
+ (lambda (q) (math-add q0 q))
+ qdata)
+ pdata tdata)
+ (math-mul '(float 5 -1) (math-add qhalf q0)))
+ (setq qmin q0)
+ (setq qmax q0))
+ (setq i (1+ i)))
+ (math-mul '(float 5 -1) (math-add qmin qmax)))))
+
+;;; To improve the approximations to the parameters, we can use
+;;; Marquardt method as described in Schwarz's book.
+
+;;; Small numbers used in the Givens algorithm
+(defvar math-nlfit-delta '(float 1 -8))
+
+(defvar math-nlfit-epsilon '(float 1 -5))
+
+;;; Maximum number of iterations
+(defvar math-nlfit-max-its 100)
+
+;;; Next, we need some functions for dealing with vectors and
+;;; matrices. For convenience, we'll work with Emacs lists
+;;; as vectors, rather than Calc's vectors.
+
+(defun math-nlfit-set-elt (vec i x)
+ (setcar (nthcdr (1- i) vec) x))
+
+(defun math-nlfit-get-elt (vec i)
+ (nth (1- i) vec))
+
+(defun math-nlfit-make-matrix (i j)
+ (let ((row (make-list j 0))
+ (mat nil)
+ (k 0))
+ (while (< k i)
+ (setq mat (cons (copy-list row) mat))
+ (setq k (1+ k)))
+ mat))
+
+(defun math-nlfit-set-matx-elt (mat i j x)
+ (setcar (nthcdr (1- j) (nth (1- i) mat)) x))
+
+(defun math-nlfit-get-matx-elt (mat i j)
+ (nth (1- j) (nth (1- i) mat)))
+
+;;; For solving the linearized system.
+;;; (The Givens method, from Schwarz.)
+
+(defun math-nlfit-givens (C d)
+ (let* ((C (copy-tree C))
+ (d (copy-tree d))
+ (n (length (car C)))
+ (N (length C))
+ (j 1)
+ (r (make-list N 0))
+ (x (make-list N 0))
+ w
+ gamma
+ sigma
+ rho)
+ (while (<= j n)
+ (let ((i (1+ j)))
+ (while (<= i N)
+ (let ((cij (math-nlfit-get-matx-elt C i j))
+ (cjj (math-nlfit-get-matx-elt C j j)))
+ (when (not (math-equal 0 cij))
+ (if (math-lessp (calcFunc-abs cjj)
+ (math-mul math-nlfit-delta (calcFunc-abs cij)))
+ (setq w (math-neg cij)
+ gamma 0
+ sigma 1
+ rho 1)
+ (setq w (math-mul
+ (calcFunc-sign cjj)
+ (calcFunc-sqrt
+ (math-add
+ (math-mul cjj cjj)
+ (math-mul cij cij))))
+ gamma (math-div cjj w)
+ sigma (math-neg (math-div cij w)))
+ (if (math-lessp (calcFunc-abs sigma) gamma)
+ (setq rho sigma)
+ (setq rho (math-div (calcFunc-sign sigma) gamma))))
+ (setq cjj w
+ cij rho)
+ (math-nlfit-set-matx-elt C j j w)
+ (math-nlfit-set-matx-elt C i j rho)
+ (let ((k (1+ j)))
+ (while (<= k n)
+ (let* ((cjk (math-nlfit-get-matx-elt C j k))
+ (cik (math-nlfit-get-matx-elt C i k))
+ (h (math-sub
+ (math-mul gamma cjk) (math-mul sigma cik))))
+ (setq cik (math-add
+ (math-mul sigma cjk)
+ (math-mul gamma cik)))
+ (setq cjk h)
+ (math-nlfit-set-matx-elt C i k cik)
+ (math-nlfit-set-matx-elt C j k cjk)
+ (setq k (1+ k)))))
+ (let* ((di (math-nlfit-get-elt d i))
+ (dj (math-nlfit-get-elt d j))
+ (h (math-sub
+ (math-mul gamma dj)
+ (math-mul sigma di))))
+ (setq di (math-add
+ (math-mul sigma dj)
+ (math-mul gamma di)))
+ (setq dj h)
+ (math-nlfit-set-elt d i di)
+ (math-nlfit-set-elt d j dj))))
+ (setq i (1+ i))))
+ (setq j (1+ j)))
+ (let ((i n)
+ s)
+ (while (>= i 1)
+ (math-nlfit-set-elt r i 0)
+ (setq s (math-nlfit-get-elt d i))
+ (let ((k (1+ i)))
+ (while (<= k n)
+ (setq s (math-add s (math-mul (math-nlfit-get-matx-elt C i k)
+ (math-nlfit-get-elt x k))))
+ (setq k (1+ k))))
+ (math-nlfit-set-elt x i
+ (math-neg
+ (math-div s
+ (math-nlfit-get-matx-elt C i i))))
+ (setq i (1- i))))
+ (let ((i (1+ n)))
+ (while (<= i N)
+ (math-nlfit-set-elt r i (math-nlfit-get-elt d i))
+ (setq i (1+ i))))
+ (let ((j n))
+ (while (>= j 1)
+ (let ((i N))
+ (while (>= i (1+ j))
+ (setq rho (math-nlfit-get-matx-elt C i j))
+ (if (math-equal rho 1)
+ (setq gamma 0
+ sigma 1)
+ (if (math-lessp (calcFunc-abs rho) 1)
+ (setq sigma rho
+ gamma (calcFunc-sqrt
+ (math-sub 1 (math-mul sigma sigma))))
+ (setq gamma (math-div 1 (calcFunc-abs rho))
+ sigma (math-mul (calcFunc-sign rho)
+ (calcFunc-sqrt
+ (math-sub 1 (math-mul gamma gamma)))))))
+ (let ((ri (math-nlfit-get-elt r i))
+ (rj (math-nlfit-get-elt r j))
+ h)
+ (setq h (math-add (math-mul gamma rj)
+ (math-mul sigma ri)))
+ (setq ri (math-sub
+ (math-mul gamma ri)
+ (math-mul sigma rj)))
+ (setq rj h)
+ (math-nlfit-set-elt r i ri)
+ (math-nlfit-set-elt r j rj))
+ (setq i (1- i))))
+ (setq j (1- j))))
+
+ x))
+
+(defun math-nlfit-jacobian (grad xlist parms &optional slist)
+ (let ((j nil))
+ (while xlist
+ (let ((row (apply grad (car xlist) parms)))
+ (setq j
+ (cons
+ (if slist
+ (mapcar (lambda (x) (math-div x (car slist))) row)
+ row)
+ j)))
+ (setq slist (cdr slist))
+ (setq xlist (cdr xlist)))
+ (reverse j)))
+
+(defun math-nlfit-make-ident (l n)
+ (let ((m (math-nlfit-make-matrix n n))
+ (i 1))
+ (while (<= i n)
+ (math-nlfit-set-matx-elt m i i l)
+ (setq i (1+ i)))
+ m))
+
+(defun math-nlfit-chi-sq (xlist ylist parms fn &optional slist)
+ (let ((cs 0))
+ (while xlist
+ (let ((c
+ (math-sub
+ (apply fn (car xlist) parms)
+ (car ylist))))
+ (if slist
+ (setq c (math-div c (car slist))))
+ (setq cs
+ (math-add cs
+ (math-mul c c))))
+ (setq xlist (cdr xlist))
+ (setq ylist (cdr ylist))
+ (setq slist (cdr slist)))
+ cs))
+
+(defun math-nlfit-init-lambda (C)
+ (let ((l 0)
+ (n (length (car C)))
+ (N (length C)))
+ (while C
+ (let ((row (car C)))
+ (while row
+ (setq l (math-add l (math-mul (car row) (car row))))
+ (setq row (cdr row))))
+ (setq C (cdr C)))
+ (calcFunc-sqrt (math-div l (math-mul n N)))))
+
+(defun math-nlfit-make-Ctilda (C l)
+ (let* ((n (length (car C)))
+ (bot (math-nlfit-make-ident l n)))
+ (append C bot)))
+
+(defun math-nlfit-make-d (fn xdata ydata parms &optional sdata)
+ (let ((d nil))
+ (while xdata
+ (setq d (cons
+ (let ((dd (math-sub (apply fn (car xdata) parms)
+ (car ydata))))
+ (if sdata (math-div dd (car sdata)) dd))
+ d))
+ (setq xdata (cdr xdata))
+ (setq ydata (cdr ydata))
+ (setq sdata (cdr sdata)))
+ (reverse d)))
+
+(defun math-nlfit-make-dtilda (d n)
+ (append d (make-list n 0)))
+
+(defun math-nlfit-fit (xlist ylist parms fn grad &optional slist)
+ (let*
+ ((C (math-nlfit-jacobian grad xlist parms slist))
+ (d (math-nlfit-make-d fn xlist ylist parms slist))
+ (chisq (math-nlfit-chi-sq xlist ylist parms fn slist))
+ (lambda (math-nlfit-init-lambda C))
+ (really-done nil)
+ (iters 0))
+ (while (and
+ (not really-done)
+ (< iters math-nlfit-max-its))
+ (setq iters (1+ iters))
+ (let ((done nil))
+ (while (not done)
+ (let* ((Ctilda (math-nlfit-make-Ctilda C lambda))
+ (dtilda (math-nlfit-make-dtilda d (length (car C))))
+ (zeta (math-nlfit-givens Ctilda dtilda))
+ (newparms (mapcar* 'math-add (copy-tree parms) zeta))
+ (newchisq (math-nlfit-chi-sq xlist ylist newparms fn slist)))
+ (if (math-lessp newchisq chisq)
+ (progn
+ (if (math-lessp
+ (math-div
+ (math-sub chisq newchisq) newchisq) math-nlfit-epsilon)
+ (setq really-done t))
+ (setq lambda (math-div lambda 10))
+ (setq chisq newchisq)
+ (setq parms newparms)
+ (setq done t))
+ (setq lambda (math-mul lambda 10)))))
+ (setq C (math-nlfit-jacobian grad xlist parms slist))
+ (setq d (math-nlfit-make-d fn xlist ylist parms slist))))
+ (list chisq parms)))
+
+;;; The functions that describe our models, and their gradients.
+
+(defun math-nlfit-s-logistic-fn (x a b c)
+ (math-div a (math-add 1 (math-mul b (calcFunc-exp (math-mul c x))))))
+
+(defun math-nlfit-s-logistic-grad (x a b c)
+ (let* ((ep (calcFunc-exp (math-mul c x)))
+ (d (math-add 1 (math-mul b ep)))
+ (d2 (math-mul d d)))
+ (list
+ (math-div 1 d)
+ (math-neg (math-div (math-mul a ep) d2))
+ (math-neg (math-div (math-mul a (math-mul b (math-mul x ep))) d2)))))
+
+(defun math-nlfit-b-logistic-fn (x a c d)
+ (let ((ex (calcFunc-exp (math-mul c (math-sub x d)))))
+ (math-div
+ (math-mul a ex)
+ (math-sqr
+ (math-add
+ 1 ex)))))
+
+(defun math-nlfit-b-logistic-grad (x a c d)
+ (let* ((ex (calcFunc-exp (math-mul c (math-sub x d))))
+ (ex1 (math-add 1 ex))
+ (xd (math-sub x d)))
+ (list
+ (math-div
+ ex
+ (math-sqr ex1))
+ (math-sub
+ (math-div
+ (math-mul a (math-mul xd ex))
+ (math-sqr ex1))
+ (math-div
+ (math-mul 2 (math-mul a (math-mul xd (math-sqr ex))))
+ (math-pow ex1 3)))
+ (math-sub
+ (math-div
+ (math-mul 2 (math-mul a (math-mul c (math-sqr ex))))
+ (math-pow ex1 3))
+ (math-div
+ (math-mul a (math-mul c ex))
+ (math-sqr ex1))))))
+
+;;; Functions to get the final covariance matrix and the sdevs
+
+(defun math-nlfit-find-covar (grad xlist pparms)
+ (let ((j nil))
+ (while xlist
+ (setq j (cons (cons 'vec (apply grad (car xlist) pparms)) j))
+ (setq xlist (cdr xlist)))
+ (setq j (cons 'vec (reverse j)))
+ (setq j
+ (math-mul
+ (calcFunc-trn j) j))
+ (calcFunc-inv j)))
+
+(defun math-nlfit-get-sigmas (grad xlist pparms chisq)
+ (let* ((sgs nil)
+ (covar (math-nlfit-find-covar grad xlist pparms))
+ (n (1- (length covar)))
+ (N (length xlist))
+ (i 1))
+ (when (> N n)
+ (while (<= i n)
+ (setq sgs (cons (calcFunc-sqrt (nth i (nth i covar))) sgs))
+ (setq i (1+ i)))
+ (setq sgs (reverse sgs)))
+ (list sgs covar)))
+
+;;; Now the Calc functions
+
+(defun math-nlfit-s-logistic-params (xdata ydata)
+ (let ((pdata (math-nlfit-get-rates-from-cumul xdata ydata)))
+ (math-nlfit-find-logistic-parameters ydata pdata xdata)))
+
+(defun math-nlfit-b-logistic-params (xdata ydata)
+ (let* ((q0 (math-nlfit-find-q0 ydata xdata))
+ (qdata (math-nlfit-get-cumul-from-rates xdata ydata q0))
+ (abc (math-nlfit-find-logistic-parameters qdata ydata xdata))
+ (B (nth 1 abc))
+ (C (nth 2 abc))
+ (A (math-neg
+ (math-mul
+ (nth 0 abc)
+ (math-mul B C))))
+ (D (math-neg (math-div (calcFunc-ln B) C)))
+ (A (math-div A B)))
+ (list A C D)))
+
+;;; Some functions to turn the parameter lists and variables
+;;; into the appropriate functions.
+
+(defun math-nlfit-s-logistic-solnexpr (pms var)
+ (let ((a (nth 0 pms))
+ (b (nth 1 pms))
+ (c (nth 2 pms)))
+ (list '/ a
+ (list '+
+ 1
+ (list '*
+ b
+ (calcFunc-exp
+ (list '*
+ c
+ var)))))))
+
+(defun math-nlfit-b-logistic-solnexpr (pms var)
+ (let ((a (nth 0 pms))
+ (c (nth 1 pms))
+ (d (nth 2 pms)))
+ (list '/
+ (list '*
+ a
+ (calcFunc-exp
+ (list '*
+ c
+ (list '- var d))))
+ (list '^
+ (list '+
+ 1
+ (calcFunc-exp
+ (list '*
+ c
+ (list '- var d))))
+ 2))))
+
+(defun math-nlfit-enter-result (n prefix vals)
+ (setq calc-aborted-prefix prefix)
+ (calc-pop-push-record-list n prefix vals)
+ (calc-handle-whys))
+
+(defun math-nlfit-fit-curve (fn grad solnexpr initparms &optional sdv)
+ (calc-slow-wrapper
+ (let* ((sdevv (or (eq sdv 'calcFunc-efit) (eq sdv 'calcFunc-xfit)))
+ (calc-display-working-message nil)
+ (data (calc-top 1))
+ (xdata (cdr (car (cdr data))))
+ (ydata (cdr (car (cdr (cdr data)))))
+ (sdata (if (math-contains-sdev-p ydata)
+ (mapcar (lambda (x) (math-get-sdev x t)) ydata)
+ nil))
+ (ydata (mapcar (lambda (x) (math-get-value x)) ydata))
+ (calc-curve-varnames nil)
+ (calc-curve-coefnames nil)
+ (calc-curve-nvars 1)
+ (fitvars (calc-get-fit-variables 1 3))
+ (var (nth 1 calc-curve-varnames))
+ (parms (cdr calc-curve-coefnames))
+ (parmguess
+ (funcall initparms xdata ydata))
+ (fit (math-nlfit-fit xdata ydata parmguess fn grad sdata))
+ (finalparms (nth 1 fit))
+ (sigmacovar
+ (if sdevv
+ (math-nlfit-get-sigmas grad xdata finalparms (nth 0 fit))))
+ (sigmas
+ (if sdevv
+ (nth 0 sigmacovar)))
+ (finalparms
+ (if sigmas
+ (mapcar* (lambda (x y) (list 'sdev x y)) finalparms sigmas)
+ finalparms))
+ (soln (funcall solnexpr finalparms var)))
+ (let ((calc-fit-to-trail t)
+ (traillist nil))
+ (while parms
+ (setq traillist (cons (list 'calcFunc-eq (car parms) (car finalparms))
+ traillist))
+ (setq finalparms (cdr finalparms))
+ (setq parms (cdr parms)))
+ (setq traillist (calc-normalize (cons 'vec (nreverse traillist))))
+ (cond ((eq sdv 'calcFunc-efit)
+ (math-nlfit-enter-result 1 "efit" soln))
+ ((eq sdv 'calcFunc-xfit)
+ (let (sln)
+ (setq sln
+ (list 'vec
+ soln
+ traillist
+ (nth 1 sigmacovar)
+ '(vec)
+ (nth 0 fit)
+ (let ((n (length xdata))
+ (m (length finalparms)))
+ (if (and sdata (> n m))
+ (calcFunc-utpc (nth 0 fit)
+ (- n m))
+ '(var nan var-nan)))))
+ (math-nlfit-enter-result 1 "xfit" sln)))
+ (t
+ (math-nlfit-enter-result 1 "fit" soln)))
+ (calc-record traillist "parm")))))
+
+(defun calc-fit-s-shaped-logistic-curve (arg)
+ (interactive "P")
+ (math-nlfit-fit-curve 'math-nlfit-s-logistic-fn
+ 'math-nlfit-s-logistic-grad
+ 'math-nlfit-s-logistic-solnexpr
+ 'math-nlfit-s-logistic-params
+ arg))
+
+(defun calc-fit-bell-shaped-logistic-curve (arg)
+ (interactive "P")
+ (math-nlfit-fit-curve 'math-nlfit-b-logistic-fn
+ 'math-nlfit-b-logistic-grad
+ 'math-nlfit-b-logistic-solnexpr
+ 'math-nlfit-b-logistic-params
+ arg))
+
+(defun calc-fit-hubbert-linear-curve (&optional sdv)
+ (calc-slow-wrapper
+ (let* ((sdevv (or (eq sdv 'calcFunc-efit) (eq sdv 'calcFunc-xfit)))
+ (calc-display-working-message nil)
+ (data (calc-top 1))
+ (qdata (cdr (car (cdr data))))
+ (pdata (cdr (car (cdr (cdr data)))))
+ (sdata (if (math-contains-sdev-p pdata)
+ (mapcar (lambda (x) (math-get-sdev x t)) pdata)
+ nil))
+ (pdata (mapcar (lambda (x) (math-get-value x)) pdata))
+ (poverqdata (mapcar* 'math-div pdata qdata))
+ (parmvals (math-nlfit-least-squares qdata poverqdata sdata sdevv))
+ (finalparms (list (nth 0 parmvals)
+ (math-neg
+ (math-div (nth 0 parmvals)
+ (nth 1 parmvals)))))
+ (calc-curve-varnames nil)
+ (calc-curve-coefnames nil)
+ (calc-curve-nvars 1)
+ (fitvars (calc-get-fit-variables 1 2))
+ (var (nth 1 calc-curve-varnames))
+ (parms (cdr calc-curve-coefnames))
+ (soln (list '* (nth 0 finalparms)
+ (list '- 1
+ (list '/ var (nth 1 finalparms))))))
+ (let ((calc-fit-to-trail t)
+ (traillist nil))
+ (setq traillist
+ (list 'vec
+ (list 'calcFunc-eq (nth 0 parms) (nth 0 finalparms))
+ (list 'calcFunc-eq (nth 1 parms) (nth 1 finalparms))))
+ (cond ((eq sdv 'calcFunc-efit)
+ (math-nlfit-enter-result 1 "efit" soln))
+ ((eq sdv 'calcFunc-xfit)
+ (let (sln
+ (chisq
+ (math-nlfit-chi-sq
+ qdata poverqdata
+ (list (nth 1 (nth 0 finalparms))
+ (nth 1 (nth 1 finalparms)))
+ (lambda (x a b)
+ (math-mul a
+ (math-sub
+ 1
+ (math-div x b))))
+ sdata)))
+ (setq sln
+ (list 'vec
+ soln
+ traillist
+ (nth 2 parmvals)
+ (list
+ 'vec
+ '(calcFunc-fitdummy 1)
+ (list 'calcFunc-neg
+ (list '/
+ '(calcFunc-fitdummy 1)
+ '(calcFunc-fitdummy 2))))
+ chisq
+ (let ((n (length qdata)))
+ (if (and sdata (> n 2))
+ (calcFunc-utpc
+ chisq
+ (- n 2))
+ '(var nan var-nan)))))
+ (math-nlfit-enter-result 1 "xfit" sln)))
+ (t
+ (math-nlfit-enter-result 1 "fit" soln)))
+ (calc-record traillist "parm")))))
+
+(provide 'calc-nlfit)
+
+;; 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 @@
(defvar math-standard-units
'( ;; Length
( m nil "*Meter" )
- ( in "2.54 cm" "Inch" )
+ ( in "2.54 cm" "Inch" )
( ft "12 in" "Foot" )
( yd "3 ft" "Yard" )
( mi "5280 ft" "Mile" )
@@ -971,17 +971,17 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).")
(symbol-name v)))))))
(or (eq (nth 3 uold) (nth 3 unew))
(cond ((eq (nth 3 uold) 'K)
- (setq expr (list '- expr '(float 27315 -2)))
+ (setq expr (list '- expr '(/ 27315 100)))
(if (eq (nth 3 unew) 'F)
- (setq expr (list '+ (list '* expr '(frac 9 5)) 32))))
+ (setq expr (list '+ (list '* expr '(/ 9 5)) 32))))
((eq (nth 3 uold) 'C)
(if (eq (nth 3 unew) 'F)
- (setq expr (list '+ (list '* expr '(frac 9 5)) 32))
- (setq expr (list '+ expr '(float 27315 -2)))))
+ (setq expr (list '+ (list '* expr '(/ 9 5)) 32))
+ (setq expr (list '+ expr '(/ 27315 100)))))
(t
- (setq expr (list '* (list '- expr 32) '(frac 5 9)))
+ (setq expr (list '* (list '- expr 32) '(/ 5 9)))
(if (eq (nth 3 unew) 'K)
- (setq expr (list '+ expr '(float 27315 -2)))))))
+ (setq expr (list '+ expr '(/ 27315 100)))))))
(if pure
expr
(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 @@
(if (calc-is-hyperbolic) 'calcFunc-efit
'calcFunc-fit)))
key (which 0)
+ (nonlinear nil)
+ (plot nil)
n calc-curve-nvars temp data
(homog nil)
(msgs '( "(Press ? for help)"
@@ -125,12 +127,18 @@
"E = a 10^(b x), X = 10^(a + b x), L = a + b log10(x)"
"q = a + b (x-c)^2"
"g = (a/b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)"
+ "s = a/(1 + exp(b (x - c)))"
+ "b = a exp(b (x - c))/(1 + exp(b (x - c)))^2"
+ "o = (y/x) = a (1 - x/b)"
"h prefix = homogeneous model (no constant term)"
+ "P prefix = plot result"
"' = alg entry, $ = stack, u = Model1, U = Model2")))
(while (not calc-curve-model)
- (message "Fit to model: %s:%s"
- (nth which msgs)
- (if homog " h" ""))
+ (message
+ "Fit to model: %s:%s%s"
+ (nth which msgs)
+ (if plot "P" " ")
+ (if homog "h" ""))
(setq key (read-char))
(cond ((= key ?\C-g)
(keyboard-quit))
@@ -138,6 +146,16 @@
(setq which (% (1+ which) (length msgs))))
((memq key '(?h ?H))
(setq homog (not homog)))
+ ((= key ?P)
+ (if plot
+ (setq plot nil)
+ (let ((data (calc-top 1)))
+ (if (or
+ (calc-is-hyperbolic)
+ (calc-is-inverse)
+ (not (= (length data) 3)))
+ (setq plot "Can't plot")
+ (setq plot data)))))
((progn
(if (eq key ?\$)
(setq n 1)
@@ -164,8 +182,9 @@
((= key ?1) ; linear or multilinear
(calc-get-fit-variables calc-curve-nvars
(1+ calc-curve-nvars) (and homog 0))
- (setq calc-curve-model (math-mul calc-curve-coefnames
- (cons 'vec (cons 1 (cdr calc-curve-varnames))))))
+ (setq calc-curve-model
+ (math-mul calc-curve-coefnames
+ (cons 'vec (cons 1 (cdr calc-curve-varnames))))))
((and (>= key ?2) (<= key ?9)) ; polynomial
(calc-get-fit-variables 1 (- key ?0 -1) (and homog 0))
(setq calc-curve-model
@@ -180,58 +199,88 @@
((= key ?p) ; power law
(calc-get-fit-variables calc-curve-nvars
(1+ calc-curve-nvars) (and homog 1))
- (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames)
- (calcFunc-reduce
- '(var mul var-mul)
- (calcFunc-map
- '(var pow var-pow)
- calc-curve-varnames
- (cons 'vec (cdr (cdr calc-curve-coefnames))))))))
+ (setq calc-curve-model
+ (math-mul
+ (nth 1 calc-curve-coefnames)
+ (calcFunc-reduce
+ '(var mul var-mul)
+ (calcFunc-map
+ '(var pow var-pow)
+ calc-curve-varnames
+ (cons 'vec (cdr (cdr calc-curve-coefnames))))))))
((= key ?^) ; exponential law
(calc-get-fit-variables calc-curve-nvars
(1+ calc-curve-nvars) (and homog 1))
- (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames)
- (calcFunc-reduce
- '(var mul var-mul)
- (calcFunc-map
- '(var pow var-pow)
- (cons 'vec (cdr (cdr calc-curve-coefnames)))
- calc-curve-varnames)))))
+ (setq calc-curve-model
+ (math-mul (nth 1 calc-curve-coefnames)
+ (calcFunc-reduce
+ '(var mul var-mul)
+ (calcFunc-map
+ '(var pow var-pow)
+ (cons 'vec (cdr (cdr calc-curve-coefnames)))
+ calc-curve-varnames)))))
+ ((= key ?s)
+ (setq nonlinear t)
+ (setq calc-curve-model t)
+ (require 'calc-nlfit)
+ (calc-fit-s-shaped-logistic-curve func))
+ ((= key ?b)
+ (setq nonlinear t)
+ (setq calc-curve-model t)
+ (require 'calc-nlfit)
+ (calc-fit-bell-shaped-logistic-curve func))
+ ((= key ?o)
+ (setq nonlinear t)
+ (setq calc-curve-model t)
+ (require 'calc-nlfit)
+ (if (and plot (not (stringp plot)))
+ (setq plot
+ (list 'vec
+ (nth 1 plot)
+ (cons
+ 'vec
+ (mapcar* 'calcFunc-div
+ (cdr (nth 2 plot))
+ (cdr (nth 1 plot)))))))
+ (calc-fit-hubbert-linear-curve func))
((memq key '(?e ?E))
(calc-get-fit-variables calc-curve-nvars
(1+ calc-curve-nvars) (and homog 1))
- (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames)
- (calcFunc-reduce
- '(var mul var-mul)
- (calcFunc-map
- (if (eq key ?e)
- '(var exp var-exp)
- '(calcFunc-lambda
- (var a var-a)
- (^ 10 (var a var-a))))
- (calcFunc-map
- '(var mul var-mul)
- (cons 'vec (cdr (cdr calc-curve-coefnames)))
- calc-curve-varnames))))))
+ (setq calc-curve-model
+ (math-mul (nth 1 calc-curve-coefnames)
+ (calcFunc-reduce
+ '(var mul var-mul)
+ (calcFunc-map
+ (if (eq key ?e)
+ '(var exp var-exp)
+ '(calcFunc-lambda
+ (var a var-a)
+ (^ 10 (var a var-a))))
+ (calcFunc-map
+ '(var mul var-mul)
+ (cons 'vec (cdr (cdr calc-curve-coefnames)))
+ calc-curve-varnames))))))
((memq key '(?x ?X))
(calc-get-fit-variables calc-curve-nvars
(1+ calc-curve-nvars) (and homog 0))
- (setq calc-curve-model (math-mul calc-curve-coefnames
- (cons 'vec (cons 1 (cdr calc-curve-varnames)))))
+ (setq calc-curve-model
+ (math-mul calc-curve-coefnames
+ (cons 'vec (cons 1 (cdr calc-curve-varnames)))))
(setq calc-curve-model (if (eq key ?x)
(list 'calcFunc-exp calc-curve-model)
(list '^ 10 calc-curve-model))))
((memq key '(?l ?L))
(calc-get-fit-variables calc-curve-nvars
(1+ calc-curve-nvars) (and homog 0))
- (setq calc-curve-model (math-mul calc-curve-coefnames
- (cons 'vec
- (cons 1 (cdr (calcFunc-map
- (if (eq key ?l)
- '(var ln var-ln)
- '(var log10
- var-log10))
- calc-curve-varnames)))))))
+ (setq calc-curve-model
+ (math-mul calc-curve-coefnames
+ (cons 'vec
+ (cons 1 (cdr (calcFunc-map
+ (if (eq key ?l)
+ '(var ln var-ln)
+ '(var log10
+ var-log10))
+ calc-curve-varnames)))))))
((= key ?q)
(calc-get-fit-variables calc-curve-nvars
(1+ (* 2 calc-curve-nvars)) (and homog 0))
@@ -247,12 +296,14 @@
(list '- (car v) (nth 1 c))
2)))))))
((= key ?g)
- (setq calc-curve-model
- (math-read-expr "(AFit / BFit sqrt(2 pi)) exp(-0.5 * ((XFit - CFit) / BFit)^2)")
- calc-curve-varnames '(vec (var XFit var-XFit))
- calc-curve-coefnames '(vec (var AFit var-AFit)
- (var BFit var-BFit)
- (var CFit var-CFit)))
+ (setq
+ calc-curve-model
+ (math-read-expr
+ "(AFit / BFit sqrt(2 pi)) exp(-0.5 * ((XFit - CFit) / BFit)^2)")
+ calc-curve-varnames '(vec (var XFit var-XFit))
+ calc-curve-coefnames '(vec (var AFit var-AFit)
+ (var BFit var-BFit)
+ (var CFit var-CFit)))
(calc-get-fit-variables 1 (1- (length calc-curve-coefnames))
(and homog 1)))
((memq key '(?\$ ?\' ?u ?U))
@@ -262,8 +313,9 @@
(let* ((calc-dollar-values calc-arg-values)
(calc-dollar-used 0)
(calc-hashes-used 0))
- (setq calc-curve-model (calc-do-alg-entry "" "Model formula: "
- nil 'calc-curve-fit-history))
+ (setq calc-curve-model
+ (calc-do-alg-entry "" "Model formula: "
+ nil 'calc-curve-fit-history))
(if (/= (length calc-curve-model) 1)
(error "Bad format"))
(setq calc-curve-model (car calc-curve-model)
@@ -296,11 +348,13 @@
(or (nth 3 calc-curve-model)
(cons 'vec
(math-all-vars-but
- calc-curve-model calc-curve-varnames)))
+ calc-curve-model
+ calc-curve-varnames)))
calc-curve-model (nth 1 calc-curve-model))
(error "Incorrect model specifier")))))
(or calc-curve-varnames
- (let ((with-y (eq (car-safe calc-curve-model) 'calcFunc-eq)))
+ (let ((with-y
+ (eq (car-safe calc-curve-model) 'calcFunc-eq)))
(if calc-curve-coefnames
(calc-get-fit-variables
(if with-y (1+ calc-curve-nvars) calc-curve-nvars)
@@ -310,7 +364,10 @@
nil with-y)
(let* ((coefs (math-all-vars-but calc-curve-model nil))
(vars nil)
- (n (- (length coefs) calc-curve-nvars (if with-y 2 1)))
+ (n (-
+ (length coefs)
+ calc-curve-nvars
+ (if with-y 2 1)))
p)
(if (< n 0)
(error "Not enough variables in model"))
@@ -326,18 +383,43 @@
calc-curve-varnames calc-curve-coefnames)
"modl"))))
(t (beep))))
- (let ((calc-fit-to-trail t))
- (calc-enter-result n (substring (symbol-name func) 9)
- (list func calc-curve-model
- (if (= (length calc-curve-varnames) 2)
- (nth 1 calc-curve-varnames)
- calc-curve-varnames)
- (if (= (length calc-curve-coefnames) 2)
- (nth 1 calc-curve-coefnames)
- calc-curve-coefnames)
- data))
- (if (consp calc-fit-to-trail)
- (calc-record (calc-normalize calc-fit-to-trail) "parm"))))))
+ (unless nonlinear
+ (let ((calc-fit-to-trail t))
+ (calc-enter-result n (substring (symbol-name func) 9)
+ (list func calc-curve-model
+ (if (= (length calc-curve-varnames) 2)
+ (nth 1 calc-curve-varnames)
+ calc-curve-varnames)
+ (if (= (length calc-curve-coefnames) 2)
+ (nth 1 calc-curve-coefnames)
+ calc-curve-coefnames)
+ data))
+ (if (consp calc-fit-to-trail)
+ (calc-record (calc-normalize calc-fit-to-trail) "parm"))))
+ (when plot
+ (if (stringp plot)
+ (message plot)
+ (let ((calc-graph-no-auto-view t))
+ (calc-graph-delete t)
+ (calc-graph-add-curve
+ (calc-graph-lookup (nth 1 plot))
+ (calc-graph-lookup (nth 2 plot)))
+ (unless (math-contains-sdev-p (nth 2 data))
+ (calc-graph-set-styles nil nil)
+ (calc-graph-point-style nil))
+ (setq plot (cdr (nth 1 plot)))
+ (setq plot
+ (list 'intv
+ 3
+ (math-sub
+ (math-min-list (car plot) (cdr plot))
+ '(float 5 -1))
+ (math-add
+ '(float 5 -1)
+ (math-max-list (car plot) (cdr plot)))))
+ (calc-graph-add-curve (calc-graph-lookup plot)
+ (calc-graph-lookup (calc-top-n 1)))
+ (calc-graph-plot nil)))))))
(defun calc-invent-independent-variables (n &optional but)
(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."
;; Don't do any window-related stuff if we weren't called from a
;; window displaying the calendar
(when in-calendar-window
- (if (or (one-window-p t) (/= (frame-width) (window-width)))
+ (if (or (one-window-p t) (not (window-full-width-p)))
;; Don't mess with the window size, but ensure that the first
;; line is fully visible
(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."
env-on
regex
p offset
+ abbreviated
(poss nil)
helpposs
(case-fold-search completion-ignore-case))
@@ -586,17 +587,42 @@ GOTO-END is non-nil, however, it instead replaces up to END."
pred nil))
;; Find an initial list of possible completions
- (if (not (setq p (string-match (concat PC-delim-regex
+ (unless (setq p (string-match (concat PC-delim-regex
(if filename "\\|\\*" ""))
str
- (+ (length dirname) offset))))
+ (+ (length dirname) offset)))
;; Minibuffer contains no hyphens -- simple case!
- (setq poss (all-completions (if env-on
- basestr str)
+ (setq poss (all-completions (if env-on basestr str)
table
pred))
-
+ (unless poss
+ ;; Try completion as an abbreviation, e.g. "mvb" ->
+ ;; "m-v-b" -> "multiple-value-bind"
+ (setq origstr str
+ abbreviated t)
+ (if filename
+ (cond
+ ;; "alpha" or "/alpha" -> expand whole path.
+ ((string-match "^/?\\([A-Za-z0-9]+\\)$" str)
+ (setq
+ basestr ""
+ p nil
+ poss (PC-expand-many-files
+ (concat "/"
+ (mapconcat #'list (match-string 1 str) "*/")
+ "*"))
+ beg (1- beg)))
+ ;; Alphanumeric trailer -> expand trailing file
+ ((string-match "^\\(.+/\\)\\([A-Za-z0-9]+\\)$" str)
+ (setq regex (concat "\\`"
+ (mapconcat #'list
+ (match-string 2 str)
+ "[A-Za-z0-9]*[^A-Za-z0-9]"))
+ p (1+ (length (match-string 1 str))))))
+ (setq regex (concat "\\`" (mapconcat #'list str "[^-]*-"))
+ p 1))))
+ (when p
;; Use all-completions to do an initial cull. This is a big win,
;; since all-completions is written in C!
(let ((compl (all-completions (if env-on
@@ -605,12 +631,24 @@ GOTO-END is non-nil, however, it instead replaces up to END."
table
pred)))
(setq p compl)
+ (when (and compl abbreviated)
+ (if filename
+ (progn
+ (setq p nil)
+ (dolist (x compl)
+ (when (string-match regex x)
+ (push x p)))
+ (setq basestr (try-completion "" p)))
+ (setq basestr (mapconcat 'list str "-"))
+ (delete-region beg end)
+ (setq end (+ beg (length basestr)))
+ (insert basestr))))
(while p
(and (string-match regex (car p))
(progn
(set-text-properties 0 (length (car p)) '() (car p))
(setq poss (cons (car p) poss))))
- (setq p (cdr p)))))
+ (setq p (cdr p))))
;; If table had duplicates, they can be here.
(delete-dups poss)
@@ -644,6 +682,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
(and p (setq poss p))))
;; Now we have a list of possible completions
+
(cond
;; No valid completions found
@@ -653,6 +692,9 @@ GOTO-END is non-nil, however, it instead replaces up to END."
(let ((PC-word-failed-flag t))
(delete-backward-char 1)
(PC-do-completion 'word))
+ (when abbreviated
+ (delete-region beg end)
+ (insert origstr))
(beep)
(PC-temp-minibuffer-message (if ambig
" [Ambiguous dir name]"
@@ -789,13 +831,18 @@ GOTO-END is non-nil, however, it instead replaces up to END."
(setq completion-base-size (if dirname
dirlength
(- beg prompt-end))))))
- (PC-temp-minibuffer-message " [Next char not unique]"))
- nil)))))
+ (PC-temp-minibuffer-message " [Next char not unique]"))))))
+ ;; Expansion of filenames is not reversible, so just keep
+ ;; the prefix.
+ (when (and abbreviated filename)
+ (delete-region (point) end))
+ nil)
;; Only one possible completion
(t
(if (and (equal basestr (car poss))
- (not (and env-on filename)))
+ (not (and env-on filename))
+ (not abbreviated))
(if (null mode)
(PC-temp-minibuffer-message " [Sole completion]"))
(delete-region beg end)
@@ -853,13 +900,11 @@ only symbols with function definitions are considered.
Otherwise, all symbols with function definitions, values
or properties are considered."
(interactive)
- (let* ((end (point))
- ;; To complete the word under point, rather than just the portion
- ;; before point, use this:
-;;; (save-excursion
-;;; (with-syntax-table lisp-mode-syntax-table
-;;; (forward-sexp 1)
-;;; (point))))
+ (let* ((end
+ (save-excursion
+ (with-syntax-table lisp-mode-syntax-table
+ (skip-syntax-forward "_w")
+ (point))))
(beg (save-excursion
(with-syntax-table lisp-mode-syntax-table
(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."
(funcall variable (if value 1 0))))
(defun custom-quote (sexp)
- "Quote SEXP iff it is not self quoting."
+ "Quote SEXP if it is not self quoting."
(if (or (memq sexp '(t nil))
(keywordp sexp)
(and (listp sexp)
@@ -665,14 +665,14 @@ default value. Otherwise, set it to nil.
To actually save the value, call `custom-save-all'.
-Return non-nil iff the `saved-value' property actually changed."
+Return non-nil if the `saved-value' property actually changed."
(custom-load-symbol symbol)
(let* ((get (or (get symbol 'custom-get) 'default-value))
(value (funcall get symbol))
(saved (get symbol 'saved-value))
(standard (get symbol 'standard-value))
(comment (get symbol 'customized-variable-comment)))
- ;; Save default value iff different from standard value.
+ ;; Save default value if different from standard value.
(if (or (null standard)
(not (equal value (condition-case nil
(eval (car standard))
@@ -694,13 +694,13 @@ or else if it is different from the standard value, set the
`customized-value' property to a list whose car evaluates to the
default value. Otherwise, set it to nil.
-Return non-nil iff the `customized-value' property actually changed."
+Return non-nil if the `customized-value' property actually changed."
(custom-load-symbol symbol)
(let* ((get (or (get symbol 'custom-get) 'default-value))
(value (funcall get symbol))
(customized (get symbol 'customized-value))
(old (or (get symbol 'saved-value) (get symbol 'standard-value))))
- ;; Mark default value as set iff different from old value.
+ ;; Mark default value as set if different from old value.
(if (not (and old
(equal value (condition-case nil
(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)."
("^--- .+ ----$" . diff-hunk-header-face) ;context
("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ;normal
("^---$" . diff-hunk-header-face) ;normal
- ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t\n]+\\)\\(.*[^*-]\\)?\n"
- (0 diff-header-face) (2 diff-file-header-face prepend))
+ ;; For file headers, accept files with spaces, but be careful to rule
+ ;; out false-positives when matching hunk headers.
+ ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t\n]+?\\)\\(?:\t.*\\| \\(\\*\\*\\*\\*\\|----\\)\\)?\n"
+ (0 diff-header-face)
+ (2 (if (not (match-end 3)) diff-file-header-face) prepend))
("^\\([-<]\\)\\(.*\n\\)"
(1 diff-indicator-removed-face) (2 diff-removed-face))
("^\\([+>]\\)\\(.*\n\\)"
@@ -425,10 +428,20 @@ but in the file header instead, in which case move forward to the first hunk."
(defun diff-beginning-of-file ()
(beginning-of-line)
(unless (looking-at diff-file-header-re)
- (forward-line 2)
- (condition-case ()
- (re-search-backward diff-file-header-re)
- (error (error "Can't find the beginning of the file")))))
+ (let ((start (point))
+ res)
+ ;; diff-file-header-re may need to match up to 4 lines, so in case
+ ;; we're inside the header, we need to move up to 3 lines forward.
+ (forward-line 3)
+ (if (and (setq res (re-search-backward diff-file-header-re nil t))
+ ;; Maybe the 3 lines forward were too much and we matched
+ ;; a file header after our starting point :-(
+ (or (<= (point) start)
+ (setq res (re-search-backward diff-file-header-re nil t))))
+ res
+ (goto-char start)
+ (error "Can't find the beginning of the file")))))
+
(defun diff-end-of-file ()
(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."
"Go to the beginning of file-related diff-info.
This is like `diff-beginning-of-file' except it tries to skip back over leading
data such as \"Index: ...\" and such."
- (let ((start (point))
- (file (condition-case err (progn (diff-beginning-of-file) (point))
- (error err)))
- ;; prevhunk is one of the limits.
- (prevhunk (save-excursion (ignore-errors (diff-hunk-prev) (point))))
- err)
- (when (consp file)
- ;; Presumably, we started before the file header, in the leading junk.
- (setq err file)
- (diff-file-next)
- (setq file (point)))
- (let ((index (save-excursion
- (re-search-backward "^Index: " prevhunk t))))
- (when index (setq file index))
- (if (<= file start)
- (goto-char file)
- ;; File starts *after* the starting point: we really weren't in
- ;; a file diff but elsewhere.
- (goto-char start)
- (signal (car err) (cdr err))))))
+ (let* ((start (point))
+ (prevfile (condition-case err
+ (save-excursion (diff-beginning-of-file) (point))
+ (error err)))
+ (err (if (consp prevfile) prevfile))
+ (nextfile (ignore-errors
+ (save-excursion
+ (goto-char start) (diff-file-next) (point))))
+ ;; prevhunk is one of the limits.
+ (prevhunk (save-excursion
+ (ignore-errors
+ (if (numberp prevfile) (goto-char prevfile))
+ (diff-hunk-prev) (point))))
+ (previndex (save-excursion
+ (re-search-backward "^Index: " prevhunk t))))
+ ;; If we're in the junk, we should use nextfile instead of prevfile.
+ (if (and (numberp nextfile)
+ (or (not (numberp prevfile))
+ (and previndex (> previndex prevfile))))
+ (setq prevfile nextfile))
+ (if (and previndex (numberp prevfile) (< previndex prevfile))
+ (setq prevfile previndex))
+ (if (and (numberp prevfile) (<= prevfile start))
+ (goto-char prevfile)
+ ;; File starts *after* the starting point: we really weren't in
+ ;; a file diff but elsewhere.
+ (goto-char start)
+ (signal (car err) (cdr err)))))
(defun diff-file-kill ()
"Kill current file's hunks."
@@ -703,7 +724,7 @@ PREFIX is only used internally: don't use it."
(defun diff-unified->context (start end)
"Convert unified diffs to context diffs.
START and END are either taken from the region (if a prefix arg is given) or
-else cover the whole bufer."
+else cover the whole buffer."
(interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
(list (region-beginning) (region-end))
(list (point-min) (point-max))))
@@ -886,7 +907,7 @@ With a prefix argument, convert unified format to context format."
(defun diff-reverse-direction (start end)
"Reverse the direction of the diffs.
START and END are either taken from the region (if a prefix arg is given) or
-else cover the whole bufer."
+else cover the whole buffer."
(interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
(list (region-beginning) (region-end))
(list (point-min) (point-max))))
@@ -948,7 +969,7 @@ else cover the whole bufer."
(defun diff-fixup-modifs (start end)
"Fixup the hunk headers (in case the buffer was modified).
START and END are either taken from the region (if a prefix arg is given) or
-else cover the whole bufer."
+else cover the whole buffer."
(interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
(list (region-beginning) (region-end))
(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 @@
(defun diff-sentinel (code)
"Code run when the diff process exits.
-CODE is the exit code of the process. It should be 0 iff no diffs were found."
+CODE is the exit code of the process. It should be 0 only if no diffs
+were found."
(if diff-old-temp-file (delete-file diff-old-temp-file))
(if diff-new-temp-file (delete-file diff-new-temp-file))
(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."
(defun dired-tree-lessp (dir1 dir2)
;; Lexicographic order on file name components, like `ls -lR':
- ;; DIR1 < DIR2 iff DIR1 comes *before* DIR2 in an `ls -lR' listing,
- ;; i.e., iff DIR1 is a (grand)parent dir of DIR2,
+ ;; DIR1 < DIR2 if DIR1 comes *before* DIR2 in an `ls -lR' listing,
+ ;; i.e., if DIR1 is a (grand)parent dir of DIR2,
;; or DIR1 and DIR2 are in the same parentdir and their last
;; components are string-lessp.
;; 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."
(cond ;; if split-height-threshold is enabled, use the largest window
((and (> (window-height (setq w2 (get-largest-window)))
split-height-threshold)
- (= (frame-width) (window-width w2)))
+ (window-full-width-p w2))
(setq window w2))
;; if the least-recently-used window is big enough, use it
((and (> (window-height (setq w2 (get-lru-window)))
(* 2 window-min-height))
- (= (frame-width) (window-width w2)))
+ (window-full-width-p w2))
(setq window w2)))
(save-excursion
(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'."
;;;###autoload
(defun double-mode (arg)
"Toggle Double mode.
-With prefix arg, turn Double mode on iff arg is positive.
+With prefix argument ARG, turn Double mode on if ARG is positive, otherwise
+turn it off.
When Double mode is on, some keys will insert different strings
when 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.")
(ediff-make-fine-diffs n 'noforce)
(ediff-make-fine-diffs n 'skip)))
- ;; highlight iff fine diffs already exist
+ ;; highlight if fine diffs already exist
((eq ediff-auto-refine 'off)
(ediff-make-fine-diffs n 'skip))))
@@ -1459,7 +1459,7 @@ arguments to `skip-chars-forward'."
(defun ediff-same-contents (d1 d2 &optional filter-re)
- "Returns t iff D1 and D2 have the same content.
+ "Return t if D1 and D2 have the same content.
D1 and D2 can either be both directories or both regular files.
Symlinks and the likes are not handled.
If 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."
(setcdr p nil)
(princ "\n(" outbuf)
(let ((print-escape-newlines t)
+ (print-quoted t)
(print-escape-nonascii t))
(dolist (elt form)
(prin1 elt outbuf)
@@ -232,6 +233,7 @@ put the output in."
outbuf))
(terpri outbuf)))
(let ((print-escape-newlines t)
+ (print-quoted t)
(print-escape-nonascii t))
(print form outbuf)))))))
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."
;; constant, 1 => to be unquoted, 2 => to be spliced in.
;; The top-level backquote macro just discards the tag.
-(defun backquote-process (s)
+(defun backquote-delay-process (s level)
+ "Process a (un|back|splice)quote inside a backquote.
+This simply recurses through the body."
+ (let ((exp (backquote-listify (list (backquote-process (nth 1 s) level)
+ (cons 0 (list 'quote (car s))))
+ '(0))))
+ (if (eq (car-safe exp) 'quote)
+ (cons 0 (list 'quote s))
+ (cons 1 exp))))
+
+(defun backquote-process (s &optional level)
+ "Process the body of a backquote.
+S is the body. Returns a cons cell whose cdr is piece of code which
+is the macro-expansion of S, and whose car is a small integer whose value
+can either indicate that the code is constant (0), or not (1), or returns
+a list which should be spliced into its environment (2).
+LEVEL is only used internally and indicates the nesting level:
+0 (the default) is for the toplevel nested inside a single backquote."
+ (unless level (setq level 0))
(cond
((vectorp s)
- (let ((n (backquote-process (append s ()))))
+ (let ((n (backquote-process (append s ()) level)))
(if (= (car n) 0)
(cons 0 s)
(cons 1 (cond
@@ -138,11 +156,15 @@ Vectors work just like lists. Nested backquotes are permitted."
s
(list 'quote s))))
((eq (car s) backquote-unquote-symbol)
- (cons 1 (nth 1 s)))
+ (if (<= level 0)
+ (cons 1 (nth 1 s))
+ (backquote-delay-process s (1- level))))
((eq (car s) backquote-splice-symbol)
- (cons 2 (nth 1 s)))
+ (if (<= level 0)
+ (cons 2 (nth 1 s))
+ (backquote-delay-process s (1- level))))
((eq (car s) backquote-backquote-symbol)
- (backquote-process (cdr (backquote-process (nth 1 s)))))
+ (backquote-delay-process s (1+ level)))
(t
(let ((rest s)
item firstlist list lists expression)
@@ -154,11 +176,13 @@ Vectors work just like lists. Nested backquotes are permitted."
;; at the beginning, put them in FIRSTLIST,
;; as a list of tagged values (TAG . FORM).
;; If there are any at the end, they go in LIST, likewise.
- (while (consp rest)
- ;; Turn . (, foo) into (,@ foo).
- (if (eq (car rest) backquote-unquote-symbol)
- (setq rest (list (list backquote-splice-symbol (nth 1 rest)))))
- (setq item (backquote-process (car rest)))
+ (while (and (consp rest)
+ ;; Stop if the cdr is an expression inside a backquote or
+ ;; unquote since this needs to go recursively through
+ ;; backquote-process.
+ (not (or (eq (car rest) backquote-unquote-symbol)
+ (eq (car rest) backquote-backquote-symbol))))
+ (setq item (backquote-process (car rest) level))
(cond
((= (car item) 2)
;; Put the nonspliced items before the first spliced item
@@ -168,8 +192,8 @@ Vectors work just like lists. Nested backquotes are permitted."
list nil))
;; Otherwise, put any preceding nonspliced items into LISTS.
(if list
- (setq lists (cons (backquote-listify list '(0 . nil)) lists)))
- (setq lists (cons (cdr item) lists))
+ (push (backquote-listify list '(0 . nil)) lists))
+ (push (cdr item) lists)
(setq list nil))
(t
(setq list (cons item list))))
@@ -177,8 +201,8 @@ Vectors work just like lists. Nested backquotes are permitted."
;; Handle nonsplicing final elements, and the tail of the list
;; (which remains in REST).
(if (or rest list)
- (setq lists (cons (backquote-listify list (backquote-process rest))
- lists)))
+ (push (backquote-listify list (backquote-process rest level))
+ lists))
;; Turn LISTS into a form that produces the combined list.
(setq expression
(if (or (cdr lists)
@@ -221,5 +245,5 @@ Vectors work just like lists. Nested backquotes are permitted."
tail))
(t (cons 'list heads)))))
-;;; arch-tag: 1a26206a-6b5e-4c56-8e24-2eef0f7e0e7a
+;; arch-tag: 1a26206a-6b5e-4c56-8e24-2eef0f7e0e7a
;;; 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 @@
(cons fn args)))))))
(defun byte-optimize-all-constp (list)
- "Non-nil iff all elements of LIST satisfy `byte-compile-constp'."
+ "Non-nil if all elements of LIST satisfy `byte-compile-constp'."
(let ((constant t))
(while (and list constant)
(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."
;;;###autoload
(define-minor-mode checkdoc-minor-mode
"Toggle Checkdoc minor mode, a mode for checking Lisp doc strings.
-With prefix ARG, turn Checkdoc minor mode on iff ARG is positive.
+With prefix ARG, turn Checkdoc minor mode on if ARG is positive, otherwise
+turn it off.
In Checkdoc minor mode, the usual bindings for `eval-defun' which is
bound 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 @@
;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p
;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively
;;;;;; notevery notany every some mapcon mapcan mapl maplist map
-;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "47c92504dda976a632c2c10bedd4b6a4")
+;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "53c2b3ede19dac62cff13a37f58cdf9c")
;;; Generated autoloads from cl-extra.el
(autoload (quote coerce) "cl-extra" "\
@@ -283,7 +283,7 @@ Not documented
;;;;;; do* do loop return-from return block etypecase typecase ecase
;;;;;; case load-time-value eval-when destructuring-bind function*
;;;;;; defmacro* defun* gentemp gensym cl-compile-time-init) "cl-macs"
-;;;;;; "cl-macs.el" "7ccc827d272482ca276937ca18a7895a")
+;;;;;; "cl-macs.el" "d9759da97810bc01423e77442b459468")
;;; Generated autoloads from cl-macs.el
(autoload (quote cl-compile-time-init) "cl-macs" "\
@@ -745,7 +745,7 @@ Not documented
;;;;;; find nsubstitute-if-not nsubstitute-if nsubstitute substitute-if-not
;;;;;; substitute-if substitute delete-duplicates remove-duplicates
;;;;;; delete-if-not delete-if delete* remove-if-not remove-if remove*
-;;;;;; replace fill reduce) "cl-seq" "cl-seq.el" "8805f76626399794931f5db36ddf855f")
+;;;;;; replace fill reduce) "cl-seq" "cl-seq.el" "c972a97c053d4e001ac1d1012c315b28")
;;; Generated autoloads from cl-seq.el
(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'."
(easy-menu-define-key map (easy-menu-intern (car item)) (cdr item) before)))
(defun easy-menu-item-present-p (map path name)
- "In submenu of MAP with path PATH, return non-nil iff item NAME is present.
+ "In submenu of MAP with path PATH, return non-nil if item NAME is present.
MAP and PATH are defined as in `easy-menu-add-item'.
NAME should be a string, the name of the element to be looked for."
(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.")
;; Return a string containing the function parameter list, or 1-line
;; docstring if function is a subr and no arglist is obtainable from the
;; docstring or elsewhere.
-(defun eldoc-get-fnsym-args-string (sym argument-index)
+(defun eldoc-get-fnsym-args-string (sym &optional argument-index)
(let ((args nil)
(doc nil))
(cond ((not (and sym (symbolp sym) (fboundp sym))))
((and (eq sym (aref eldoc-last-data 0))
(eq 'function (aref eldoc-last-data 2)))
- (setq args (aref eldoc-last-data 1)))
+ (setq doc (aref eldoc-last-data 1)))
((setq doc (help-split-fundoc (documentation sym t) sym))
(setq args (car doc))
(string-match "\\`[^ )]* ?" args)
@@ -281,8 +281,9 @@ Emacs Lisp mode) that support Eldoc.")
(eldoc-last-data-store sym args 'function))
(t
(setq args (eldoc-function-argstring sym))))
- (when args
- (setq doc (eldoc-highlight-function-argument sym args argument-index)))
+ (and args
+ argument-index
+ (setq doc (eldoc-highlight-function-argument sym args argument-index)))
doc))
;; 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\"
This function may return false negatives, but it will not
return false positives. It is nevertheless useful in
-situations where an efficiency shortcut can be taken iff a
+situations where an efficiency shortcut can be taken only if a
regexp is atomic. The function can be improved to detect
more cases of atomic regexps. Presently, this function
detects 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."
(defun unsafep-function (fun)
- "Return nil iff FUN is a safe function.
+ "Return nil if FUN is a safe function.
\(either a safe lambda or a symbol that names a safe function). Otherwise
result is a reason code."
(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."
(use-local-map tpu-buffer-local-map)))
(local-set-key key func))
-(defun tpu-current-line nil
+(defun tpu-current-line ()
"Return the vertical position of point in the selected window.
Top line is 0. Counts each text line only once, even if it wraps."
- (+ (count-lines (window-start) (point)) (if (= (current-column) 0) 1 0) -1))
+ (or
+ (cdr (nth 6 (posn-at-point)))
+ (if (eq (window-start) (point)) 0
+ (1- (count-screen-lines (window-start) (point) 'count-final-newline)))))
;;;
@@ -2422,6 +2425,7 @@ If FILE is nil, try to load a default file. The default file names are
(if (eq tpu-global-map parent)
(set-keymap-parent map (keymap-parent parent))
(setq map parent)))))
+ (ad-disable-regexp "\\`tpu-")
(setq tpu-edt-mode nil))
(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."
(add-hook 'picture-mode-hook 'tpu-set-cursor-free)
-(defun tpu-write-file-hook nil
+(defun tpu-before-save-hook ()
"Eliminate whitespace at ends of lines, if the cursor is free."
(if (and (buffer-modified-p) tpu-cursor-free) (tpu-trim-line-ends)))
-(or (memq 'tpu-write-file-hook write-file-functions)
- (setq write-file-functions
- (cons 'tpu-write-file-hook write-file-functions)))
+(add-hook 'before-save-hook 'tpu-before-save-hook)
;;; Utility routines for implementing scroll margins
@@ -246,7 +244,7 @@ Accepts a prefix argument for the number of lines to move."
(end-of-line (- 1 num))))
(tpu-top-check beg num)))
-(defun tpu-current-end-of-line nil
+(defun tpu-current-end-of-line ()
"Move point to end of current line."
(interactive)
(let ((beg (point)))
@@ -392,41 +390,24 @@ A repeat count means scroll that many sections."
-;;; Replace the newline, newline-and-indent, and do-auto-fill functions
-
-(or (fboundp 'tpu-old-newline)
- (fset 'tpu-old-newline (symbol-function 'newline)))
-(or (fboundp 'tpu-old-do-auto-fill)
- (fset 'tpu-old-do-auto-fill (symbol-function 'do-auto-fill)))
-(or (fboundp 'tpu-old-newline-and-indent)
- (fset 'tpu-old-newline-and-indent (symbol-function 'newline-and-indent)))
-
-(defun newline (&optional num)
- "Insert a newline. With arg, insert that many newlines.
-In Auto Fill mode, can break the preceding line if no numeric arg.
-This is the TPU-edt version that respects the bottom scroll margin."
- (interactive "p")
- (let ((beg (tpu-current-line)))
- (or num (setq num 1))
- (tpu-old-newline num)
+;; Advise the newline, newline-and-indent, and do-auto-fill functions.
+(defadvice newline (around tpu-respect-bottom-scroll-margin activate disable)
+ "Respect `tpu-bottom-scroll-margin'."
+ (let ((beg (tpu-current-line))
+ (num (prefix-numeric-value (ad-get-arg 0))))
+ ad-do-it
(tpu-bottom-check beg num)))
-(defun newline-and-indent nil
- "Insert a newline, then indent according to major mode.
-Indentation is done using the current indent-line-function.
-In programming language modes, this is the same as TAB.
-In some text modes, where TAB inserts a tab, this indents
-to the specified left-margin column. This is the TPU-edt
-version that respects the bottom scroll margin."
- (interactive)
+(defadvice newline-and-indent (around tpu-respect-bottom-scroll-margin)
+ "Respect `tpu-bottom-scroll-margin'."
(let ((beg (tpu-current-line)))
- (tpu-old-newline-and-indent)
+ ad-do-it
(tpu-bottom-check beg 1)))
-(defun do-auto-fill nil
- "TPU-edt version that respects the bottom scroll margin."
+(defadvice do-auto-fill (around tpu-respect-bottom-scroll-margin)
+ "Respect `tpu-bottom-scroll-margin'."
(let ((beg (tpu-current-line)))
- (tpu-old-do-auto-fill)
+ ad-do-it
(tpu-bottom-check beg 1)))
@@ -440,18 +421,21 @@ version that respects the bottom scroll margin."
\nsEnter bottom scroll margin (N lines or N%% or RETURN for current value): ")
;; set top scroll margin
(or (string= top "")
- (if (string= "%" (substring top -1))
- (setq tpu-top-scroll-margin (string-to-number top))
- (setq tpu-top-scroll-margin
+ (setq tpu-top-scroll-margin
+ (if (string= "%" (substring top -1))
+ (string-to-number top)
(/ (1- (+ (* (string-to-number top) 100) (window-height)))
(window-height)))))
;; set bottom scroll margin
(or (string= bottom "")
- (if (string= "%" (substring bottom -1))
- (setq tpu-bottom-scroll-margin (string-to-number bottom))
- (setq tpu-bottom-scroll-margin
+ (setq tpu-bottom-scroll-margin
+ (if (string= "%" (substring bottom -1))
+ (string-to-number bottom)
(/ (1- (+ (* (string-to-number bottom) 100) (window-height)))
(window-height)))))
+ (dolist (f '(newline newline-and-indent do-auto-fill))
+ (ad-enable-advice f 'around 'tpu-respect-bottom-scroll-margin)
+ (ad-activate f))
;; report scroll margin settings if running interactively
(and (interactive-p)
(message "Scroll margins set. Top = %s%%, Bottom = %s%%"
@@ -461,7 +445,7 @@ version that respects the bottom scroll margin."
;;; Functions to set cursor bound or free
;;;###autoload
-(defun tpu-set-cursor-free nil
+(defun tpu-set-cursor-free ()
"Allow the cursor to move freely about the screen."
(interactive)
(setq tpu-cursor-free t)
@@ -471,7 +455,7 @@ version that respects the bottom scroll margin."
(message "The cursor will now move freely about the screen."))
;;;###autoload
-(defun tpu-set-cursor-bound nil
+(defun tpu-set-cursor-bound ()
"Constrain the cursor to the flow of the text."
(interactive)
(tpu-trim-line-ends)
@@ -481,5 +465,5 @@ version that respects the bottom scroll margin."
GOLD-map)
(message "The cursor is now bound to the flow of your text."))
-;;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a
+;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a
;;; 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."
"Go down count lines, try to keep at the same column."
(interactive "p")
(setq this-command 'next-line) ; this is a needed trick
- (if (= (point) (or (line-move count) (point)))
+ (if (= (point) (progn (line-move count) (point)))
(ding) ; no moving, already at end of buffer
(setq last-command 'next-line)))
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 @@
+2007-08-08 Glenn Morris <rgm@gnu.org>
+
+ * erc-log.el, erc.el: Replace `iff' in doc-strings and comments.
+
2007-07-30 Michael Olson <mwolson@gnu.org>
* 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."
(defun erc-log-all-but-server-buffers (buffer)
"Returns t if logging should be enabled in BUFFER.
-Returns nil iff `erc-server-buffer-p' returns t."
+Returns nil if `erc-server-buffer-p' returns t."
(save-excursion
(save-window-excursion
(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."
(defun erc-echo-notice-in-target-buffer (s parsed buffer sender)
"Echos a private notice in BUFFER, if BUFFER is non-nil. This
function is designed to be added to either `erc-echo-notice-hook'
-or `erc-echo-notice-always-hook', and returns non-nil iff BUFFER
+or `erc-echo-notice-always-hook', and returns non-nil if BUFFER
is non-nil."
(if buffer
(progn (erc-display-message parsed nil buffer s) t)
@@ -3982,7 +3982,7 @@ designed to be added to either `erc-echo-notice-hook' or
"Echos a private notice in the active buffer if the active
buffer is not the server buffer. This function is designed to be
added to either `erc-echo-notice-hook' or
-`erc-echo-notice-always-hook', and returns non-nil iff the active
+`erc-echo-notice-always-hook', and returns non-nil if the active
buffer is not the server buffer."
(if (not (eq (erc-server-buffer) (erc-active-buffer)))
(progn (erc-display-message parsed nil 'active s) t)
@@ -3999,7 +3999,7 @@ designed to be added to either `erc-echo-notice-hook' or
"Echos a private notice in all of the buffers for which SENDER
is a member. This function is designed to be added to either
`erc-echo-notice-hook' or `erc-echo-notice-always-hook', and
-returns non-nil iff there is at least one buffer for which the
+returns non-nil if there is at least one buffer for which the
sender is a member.
See also: `erc-echo-notice-in-first-user-buffer',
@@ -4013,7 +4013,7 @@ See also: `erc-echo-notice-in-first-user-buffer',
"Echos a private notice in BUFFER and in all of the buffers for
which SENDER is a member. This function is designed to be added
to either `erc-echo-notice-hook' or
-`erc-echo-notice-always-hook', and returns non-nil iff there is
+`erc-echo-notice-always-hook', and returns non-nil if there is
at least one buffer for which the sender is a member or the
default target.
@@ -4029,7 +4029,7 @@ See also: `erc-echo-notice-in-user-buffers',
"Echos a private notice in one of the buffers for which SENDER
is a member. This function is designed to be added to either
`erc-echo-notice-hook' or `erc-echo-notice-always-hook', and
-returns non-nil iff there is at least one buffer for which the
+returns non-nil if there is at least one buffer for which the
sender is a member.
See also: `erc-echo-notice-in-user-buffers',
@@ -4938,7 +4938,7 @@ Specifically, return the position of `erc-insert-marker'."
(defun erc-send-input (input)
"Treat INPUT as typed in by the user. It is assumed that the input
and the prompt is already deleted.
-This returns non-nil only iff we actually send anything."
+This returns non-nil only if we actually send anything."
;; Handle different kinds of inputs
(cond
;; 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."
;; c++-mode, java-mode and more) are added through autoload
;; directives in that file. That way is discouraged since it
;; spreads out the definition of the initial value.
- (mapc
+ (mapcar
(lambda (elt)
(cons (purecopy (car elt)) (cdr elt)))
`(;; 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."
;; Next compare the filename against the entries in auto-mode-alist.
(unless done
(if buffer-file-name
- (let ((name buffer-file-name))
+ (let ((name buffer-file-name)
+ (remote-id (file-remote-p buffer-file-name)))
+ ;; Remove remote file name identification.
+ (when (and (stringp remote-id)
+ (string-match (regexp-quote remote-id) name))
+ (setq name (substring name (match-end 0))))
;; Remove backup-suffixes from file name.
(setq name (file-name-sans-versions name))
(while name
@@ -3989,8 +3994,9 @@ prints a message in the minibuffer. Instead, use `set-buffer-modified-p'."
(defun toggle-read-only (&optional arg)
"Change whether this buffer is visiting its file read-only.
-With arg, set read-only iff arg is positive.
-If visiting file read-only and `view-read-only' is non-nil, enter view mode."
+With prefix argument ARG, make the buffer read-only if ARG is
+positive, otherwise make it writable. If visiting file read-only
+and `view-read-only' is non-nil, enter view mode."
(interactive "P")
(if (and arg
(if (> (prefix-numeric-value arg) 0) buffer-read-only
@@ -4633,7 +4639,7 @@ FILENAME should lack slashes. You can redefine this for customization."
(defun wildcard-to-regexp (wildcard)
"Given a shell file name pattern WILDCARD, return an equivalent regexp.
-The generated regexp will match a filename iff the filename
+The generated regexp will match a filename only if the filename
matches that wildcard according to shell rules. Only wildcards known
by `sh' are supported."
(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:
where MATCHER can be either the regexp to search for, or the function name to
call to make the search (called with one argument, the limit of the search;
-it should return non-nil, move point, and set `match-data' appropriately iff
+it should return non-nil, move point, and set `match-data' appropriately if
it succeeds; like `re-search-forward' would).
MATCHER regexps can be generated via the function `regexp-opt'.
@@ -1068,7 +1068,7 @@ that tries to find such elements and move the boundaries such that they do
not fall in the middle of one.
Each function is called with no argument; it is expected to adjust the
dynamically bound variables `font-lock-beg' and `font-lock-end'; and return
-non-nil iff it did make such an adjustment.
+non-nil if it did make such an adjustment.
These functions are run in turn repeatedly until they all return nil.
Put first the functions more likely to cause a change and cheaper to compute.")
;; 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
"Set fontification defaults appropriately for this mode.
Sets various variables using `font-lock-defaults' (or, if nil, using
`font-lock-defaults-alist') and `font-lock-maximum-decoration'."
- ;; Set fontification defaults iff not previously set for correct major mode.
+ ;; Set fontification defaults if not previously set for correct major mode.
(unless (and font-lock-set-defaults
(eq font-lock-mode-major-mode major-mode))
(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)."
(fmt (format-read (format "Read file `%s' in format: "
(file-name-nondirectory file)))))
(list file fmt)))
- (let (value size)
- (let ((format-alist nil))
- (setq value (insert-file-contents filename nil beg end))
- (setq size (nth 1 value)))
- (if format
- (setq size (format-decode format size)
- value (list (car value) size)))
+ (let (value size old-undo)
+ ;; Record only one undo entry for the insertion. Inhibit point-motion and
+ ;; modification hooks as with `insert-file-contents'.
+ (let ((inhibit-point-motion-hooks t)
+ (inhibit-modification-hooks t))
+ ;; Don't bind `buffer-undo-list' to t here to assert that
+ ;; `insert-file-contents' may record whether the buffer was unmodified
+ ;; before.
+ (let ((format-alist nil))
+ (setq value (insert-file-contents filename nil beg end))
+ (setq size (nth 1 value)))
+ (when (consp buffer-undo-list)
+ (let ((head (car buffer-undo-list)))
+ (when (and (consp head)
+ (equal (car head) (point))
+ (equal (cdr head) (+ (point) size)))
+ ;; Remove first entry from `buffer-undo-list', we shall insert
+ ;; another one below.
+ (setq old-undo (cdr buffer-undo-list)))))
+ (when format
+ (let ((buffer-undo-list t))
+ (setq size (format-decode format size)
+ value (list (car value) size)))
+ (unless (eq buffer-undo-list t)
+ (setq buffer-undo-list
+ (cons (cons (point) (+ (point) size)) old-undo)))))
+ (unless inhibit-modification-hooks
+ (run-hook-with-args 'after-change-functions (point) (+ (point) size) 0))
value))
(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."
(define-minor-mode blink-cursor-mode
"Toggle blinking cursor mode.
-With a numeric argument, turn blinking cursor mode on iff ARG is positive.
-When blinking cursor mode is enabled, the cursor of the selected
-window blinks.
+With a numeric argument, turn blinking cursor mode on if ARG is positive,
+otherwise turn it off. When blinking cursor mode is enabled, the
+cursor of the selected window blinks.
Note that this command is effective only when Emacs
displays 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 @@
+2007-08-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * nntp.el (nntp-xref-number-is-evil): New server variable.
+ (nntp-find-group-and-number): If it is non-nil, don't trust article
+ numbers in the Xref header.
+
+2007-08-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-ems.el (gnus-x-splash): Bind inhibit-read-only to t.
+
+2007-08-04 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus-art.el (article-hide-headers): Bind inhibit-read-only to t.
+
+2007-08-08 Glenn Morris <rgm@gnu.org>
+
+ * gmm-utils.el, gnus-async.el, gnus-msg.el, gnus-score.el
+ * gnus-util.el, imap.el, mailcap.el, nnimap.el: Replace `iff' in
+ doc-strings and comments.
+
2007-07-25 Glenn Morris <rgm@gnu.org>
* 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'."
;;;###autoload
(defun gmm-widget-p (symbol)
- "Non-nil iff SYMBOL is a widget."
+ "Non-nil if SYMBOL is a widget."
(get symbol 'widget-type))
;; 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.")
(interactive)
;; This function might be inhibited.
(unless gnus-inhibit-hiding
- (let ((inhibit-read-only nil)
+ (let ((inhibit-read-only t)
(case-fold-search t)
(max (1+ (length gnus-sorted-header-list)))
(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."
(pop alist))))))
(defun gnus-async-prefetched-article-entry (group article)
- "Return the entry for ARTICLE in GROUP iff it has been prefetched."
+ "Return the entry for ARTICLE in GROUP if it has been prefetched."
(let ((entry (save-excursion
(gnus-async-set-buffer)
(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 @@
(interactive-p))
"*gnus-x-splash*"
gnus-group-buffer)))
- (let ((inhibit-read-only nil)
+ (let ((inhibit-read-only t)
(file (nnheader-find-etc-directory "images/gnus/x-splash" t))
pixmap fcw fch width height fringes sbars left yoffset top ls)
(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."
This is done because new users often reply by mistake when reading
news.
This can also be a function receiving the group name as the only
-parameter which should return non-nil iff a confirmation is needed, or
-a regexp, in which case a confirmation is asked for iff the group name
+parameter, which should return non-nil if a confirmation is needed; or
+a regexp, in which case a confirmation is asked for if the group name
matches the regexp."
:version "22.1"
:group 'gnus-message
:type '(choice (const :tag "No" nil)
(const :tag "Yes" t)
- (regexp :tag "Iff group matches regexp")
- (function :tag "Iff function evaluates to non-nil")))
+ (regexp :tag "If group matches regexp")
+ (function :tag "If function evaluates to non-nil")))
(defcustom gnus-confirm-treat-mail-like-news
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."
(const :tag "ask" nil)))
(defcustom gnus-score-default-fold nil
- "Use case folding for new score file entries iff not nil."
+ "Non-nil means use case folding for new score file entries."
:group 'gnus-score-default
:type 'boolean)
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."
`(setq ,alist (delq (,fun ,key ,alist) ,alist))))
(defun gnus-globalify-regexp (re)
- "Return a regexp that matches a whole line, iff RE matches a part of it."
+ "Return a regexp that matches a whole line, if RE matches a part of it."
(concat (unless (string-match "^\\^" re) "^.*")
re
(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."
(imap-mailbox-get-1 'search imap-current-mailbox)))))
(defun imap-message-flag-permanent-p (flag &optional mailbox buffer)
- "Return t iff FLAG can be permanently (between IMAP sessions) saved on articles, in MAILBOX on server in BUFFER."
+ "Return t if FLAG can be permanently (between IMAP sessions) saved on articles, in MAILBOX on server in BUFFER."
(with-current-buffer (or buffer (current-buffer))
(or (member "\\*" (imap-mailbox-get 'permanentflags mailbox))
(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
results)))
(defun mailcap-mailcap-entry-passes-test (info)
- "Return non-nil iff mailcap entry INFO passes its test clause.
+ "Return non-nil if mailcap entry INFO passes its test clause.
Also return non-nil if no test clause is present."
(let ((test (assq 'test info)) ; The test clause
status)
@@ -631,7 +631,7 @@ Also return non-nil if no test clause is present."
(defvar mailcap-viewer-test-cache nil)
(defun mailcap-viewer-passes-test (viewer-info type-info)
- "Return non-nil iff viewer specified by VIEWER-INFO passes its test clause.
+ "Return non-nil if viewer specified by VIEWER-INFO passes its test clause.
Also return non-nil if it has no test clause. TYPE-INFO is an argument
to supply to the test."
(let* ((test-info (assq 'test viewer-info))
@@ -704,7 +704,7 @@ If TEST is not given, it defaults to t."
;;;
(defun mailcap-viewer-lessp (x y)
- "Return t iff viewer X is more desirable than viewer Y."
+ "Return t if viewer X is more desirable than viewer Y."
(let ((x-wild (string-match "[*?]" (or (cdr-safe (assq 'type x)) "")))
(y-wild (string-match "[*?]" (or (cdr-safe (assq 'type y)) "")))
(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."
result)))
(defun nnimap-mark-permanent-p (mark &optional group)
- "Return t iff MARK can be permanently (between IMAP sessions) saved on articles, in GROUP."
+ "Return t if MARK can be permanently (between IMAP sessions) saved on articles, in GROUP."
(imap-message-flag-permanent-p (nnimap-mark-to-flag mark)))
(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.")
If the gap between two consecutive articles is bigger than this
variable, split the XOVER request into two requests.")
+(defvoo nntp-xref-number-is-evil nil
+ "*If non-nil, Gnus never trusts article numbers in the Xref header.
+Some news servers, e.g., ones running Diablo, run multiple engines
+having the same articles but article numbers are not kept synchronized
+between them. If you connect to such a server, set this to a non-nil
+value, and Gnus never uses article numbers (that appear in the Xref
+header and vary by which engine is chosen) to refer to articles.")
+
(defvoo nntp-prepare-server-hook nil
"*Hook run before a server is opened.
If can be used to set up a server remotely, for instance. Say you
@@ -1632,7 +1640,8 @@ password contained in '~/.nntp-authinfo'."
(match-string 1 xref))
(t "")))
(cond
- ((and (setq xref (mail-fetch-field "xref"))
+ ((and (not nntp-xref-number-is-evil)
+ (setq xref (mail-fetch-field "xref"))
(string-match
(if group
(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."
;; An obvious case of a key substitution:
(save-excursion
(while (re-search-forward
- ;; Assume command name is only word characters
- ;; and dashes to get things like `use M-x foo.'.
- "\\<M-x\\s-+\\(\\sw\\(\\sw\\|-\\)+\\)" nil t)
+ ;; Assume command name is only word and symbol
+ ;; characters to get things like `use M-x foo->bar'.
+ ;; Command required to end with word constituent
+ ;; to avoid `.' at end of a sentence.
+ "\\<M-x\\s-+\\(\\sw\\(\\sw\\|\\s_\\)*\\sw\\)" nil t)
(let ((sym (intern-soft (match-string 1))))
(if (fboundp sym)
(help-xref-button 1 'help-function sym)))))
@@ -489,7 +491,7 @@ that."
(end-of-line)
(skip-chars-backward "^ \t\n")
(if (and (>= (current-column) col)
- (looking-at "\\(\\sw\\|-\\)+$"))
+ (looking-at "\\(\\sw\\|\\s_\\)+$"))
(let ((sym (intern-soft (match-string 0))))
(if (fboundp sym)
(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."
(remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window)))
(defun resize-temp-buffer-window ()
- "Resize the current window to fit its contents.
+ "Resize the selected window to fit its contents.
Will not make it higher than `temp-buffer-max-height' nor smaller than
`window-min-height'. Do nothing if it is the only window on its frame, if it
is not as wide as the frame or if some of the window's contents are scrolled
out of view."
(unless (or (one-window-p 'nomini)
(not (pos-visible-in-window-p (point-min)))
- (/= (frame-width) (window-width)))
+ (not (window-full-width-p)))
(fit-window-to-buffer
(selected-window)
(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 @@
;; an example, if the value is `buffer-file-name' then all buffers
;; who are visiting files are suitable, but others (like dired
;; buffers) are not;
-;; * a list -- then the buffer is suitable iff its mode is in the
+;; * a list -- then the buffer is suitable if its mode is in the
;; list, except if the first element is `not', in which case the test
;; is reversed (i.e. it is a list of unsuitable modes).
;; * 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.
With no prefix arg, use the filename sans its directory of each marked file.
With a zero prefix arg, use the complete filename of each marked file.
With \\[universal-argument], use the filename of each marked file relative
-to `ibuffer-default-directory' iff non-nil, otherwise `default-directory'.
+to `ibuffer-default-directory' if non-nil, otherwise `default-directory'.
You can then feed the file name(s) to other commands with \\[yank]."
(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."
(defun ibuffer-map-lines (function &optional nomodify group)
"Call FUNCTION for each buffer.
-Don't set the ibuffer modification flag iff NOMODIFY is non-nil.
+Set the ibuffer modification flag unless NOMODIFY is non-nil.
If optional argument GROUP is non-nil, then only call FUNCTION on
buffers in filtering group GROUP.
@@ -2267,7 +2267,7 @@ If optional arg SILENT is non-nil, do not display progress messages."
(defun ibuffer-quit ()
"Quit this `ibuffer' session.
-Try to restore the previous window configuration iff
+Try to restore the previous window configuration if
`ibuffer-restore-window-config-on-quit' is non-nil."
(interactive)
(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'."
(defcustom icomplete-minibuffer-setup-hook nil
"*Icomplete-specific customization of minibuffer setup.
-This hook is run during minibuffer setup iff icomplete will be active.
+This hook is run during minibuffer setup if icomplete is active.
It is intended for use in customizing icomplete for interoperation
with other features and packages. For instance:
@@ -168,7 +168,8 @@ except those on this list.")
;;;###autoload
(define-minor-mode icomplete-mode
"Toggle incremental minibuffer completion for this Emacs session.
-With a numeric argument, turn Icomplete mode on iff ARG is positive."
+With a numeric argument, turn Icomplete mode on if ARG is positive,
+otherwise turn it off."
:global t :group 'icomplete
(if icomplete-mode
;; 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.")
(defcustom ido-minibuffer-setup-hook nil
"*Ido-specific customization of minibuffer setup.
-This hook is run during minibuffer setup iff `ido' will be active.
+This hook is run during minibuffer setup if `ido' is active.
It is intended for use in customizing ido for interoperation
with other packages. For instance:
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'."
;;;###autoload
(defun image-type-auto-detected-p ()
- "Return t iff the current buffer contains an auto-detectable image.
+ "Return t if the current buffer contains an auto-detectable image.
This function is intended to be used from `magic-fallback-mode-alist'.
The 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
appear in the menu. See the info section on Regexps for more
information. REGEXP may also be a function, called without
arguments. It is expected to search backwards. It shall return
-true and set `match-data' iff it finds another element.
+true and set `match-data' if it finds another element.
INDEX points to the substring in REGEXP that contains the
name (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."
(apply 'info-lookup-add-help* nil arg))
(defun info-lookup-maybe-add-help (&rest arg)
- "Add a help specification iff none is defined.
+ "Add a help specification if none is defined.
See the documentation of the function `info-lookup-add-help'
for more details."
(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 @@
;; Return t if substring of STR (between FROM and TO) can be broken up
;; to chunks all of which can be derived from another entry in SKK
;; dictionary. SKKBUF is the buffer where the original SKK dictionary
-;; is visited, KANA is the current entry for STR. FIRST is t iff this
-;; is called at top level.
+;; is visited, KANA is the current entry for STR. FIRST is t only if
+;; this is called at top level.
(defun skkdic-breakup-string (skkbuf kana str from to &optional first)
(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'."
"Set up Latin-1/ASCII display for Unicode characters.
This uses the transliterations of the Lynx browser.
-With argument ARG, turn such display on iff ARG is positive, otherwise
+With argument ARG, turn such display on if ARG is positive, otherwise
turn it off and display Unicode characters literally. The display
-is't changed if the display can render Unicode characters."
+isn't changed if the display can render Unicode characters."
(interactive "p")
(if (> arg 0)
(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."
(let ((base (coding-system-base x)))
;; We calculate the priority number 0..255 by
;; using the 8 bits PMMLCEII as this:
- ;; P: 1 iff most preferred.
- ;; MM: greater than 0 iff mime-charset.
- ;; L: 1 iff one of the current lang. env.'s codings.
- ;; C: 1 iff one of codings listed in the category list.
- ;; E: 1 iff not XXX-with-esc
+ ;; P: 1 if most preferred.
+ ;; MM: greater than 0 if mime-charset.
+ ;; L: 1 if one of the current lang. env.'s codings.
+ ;; C: 1 if one of codings listed in the category list.
+ ;; E: 1 if not XXX-with-esc
;; II: if iso-2022 based, 0..3, else 1.
(logior
(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 @@
;;; Code:
-(require 'help-mode)
+(eval-when-compile (require 'help-mode))
(defgroup quail nil
"Quail: multilingual input method."
@@ -1942,7 +1942,7 @@ Remaining args are for FUNC."
(overlay-put quail-overlay 'face 'highlight))))
(defun quail-require-guidance-buf ()
- "Return t iff the current Quail package requires showing guidance buffer."
+ "Return t if the current Quail package requires showing guidance buffer."
(and input-method-verbose-flag
(if (eq input-method-verbose-flag 'default)
(not (and (eq (selected-window) (minibuffer-window))
@@ -2431,22 +2431,27 @@ should be made by `quail-build-decode-map' (which see)."
(insert ?\n))
(insert ?\n))))
-(define-button-type 'quail-keyboard-layout-button
- :supertype 'help-xref
- 'help-function '(lambda (layout)
- (help-setup-xref `(quail-keyboard-layout-button ,layout) nil)
- (quail-show-keyboard-layout layout))
- 'help-echo (purecopy "mouse-2, RET: show keyboard layout"))
-
-(define-button-type 'quail-keyboard-customize-button
- :supertype 'help-customize-variable
- 'help-echo (purecopy "mouse-2, RET: customize keyboard layout"))
+(defun quail-help-init ()
+ (unless (featurep 'help-mode)
+ (require 'help-mode)
+ (define-button-type 'quail-keyboard-layout-button
+ :supertype 'help-xref
+ 'help-function '(lambda (layout)
+ (help-setup-xref `(quail-keyboard-layout-button ,layout)
+ nil)
+ (quail-show-keyboard-layout layout))
+ 'help-echo (purecopy "mouse-2, RET: show keyboard layout"))
+
+ (define-button-type 'quail-keyboard-customize-button
+ :supertype 'help-customize-variable
+ 'help-echo (purecopy "mouse-2, RET: customize keyboard layout"))))
(defun quail-help (&optional package)
"Show brief description of the current Quail package.
Optional arg PACKAGE specifies the name of alternative Quail
package to describe."
(interactive)
+ (quail-help-init)
(let ((help-xref-mule-regexp help-xref-mule-regexp-template)
(default-enable-multibyte-characters enable-multibyte-characters)
(package-def
@@ -2629,7 +2634,7 @@ KEY BINDINGS FOR CONVERSION
;; it is not yet stored. As a result, the element is a string or a
;; list of strings.
-(defsubst quail-store-decode-map-key (table char key)
+(defun quail-store-decode-map-key (table char key)
(let ((elt (aref table char)))
(if elt
(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."
(run-hooks 'isearch-mode-end-hook))
;; If there was movement, mark the starting position.
- ;; Maybe should test difference between and set mark iff > threshold.
+ ;; Maybe should test difference between and set mark only if > threshold.
(if (/= (point) isearch-opoint)
(or (and transient-mark-mode mark-active)
(progn
@@ -2329,7 +2329,7 @@ since they have special meaning in a regexp."
;; - the direction of the current search is expected to be given by
;; `isearch-forward';
;; - the variable `isearch-error' is expected to be true
-;; iff `isearch-string' is an invalid regexp.
+;; only if `isearch-string' is an invalid regexp.
(defvar isearch-lazy-highlight-overlays nil)
(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.")
(defcustom iswitchb-minibuffer-setup-hook nil
"Iswitchb-specific customization of minibuffer setup.
-This hook is run during minibuffer setup iff `iswitchb' will be active.
+This hook is run during minibuffer setup if `iswitchb' is active.
For instance:
\(add-hook 'iswitchb-minibuffer-setup-hook
'\(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
(iswitchb-to-end summaries)))
(defun iswitchb-case ()
- "Return non-nil iff we should ignore case when matching.
+ "Return non-nil if we should ignore case when matching.
See the variable `iswitchb-case' for details."
(if iswitchb-case
(if (featurep 'xemacs)
@@ -1450,7 +1450,7 @@ See the variable `iswitchb-case' for details."
;;;###autoload
(define-minor-mode iswitchb-mode
"Toggle Iswitchb global minor mode.
-With arg, turn Iswitchb mode on if and only iff ARG is positive.
+With arg, turn Iswitchb mode on if ARG is positive, otherwise turn it off.
This mode enables switching between buffers using substrings. See
`iswitchb' for details."
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."
(defvar user-mail-address)
(defun log-edit-changelog-ours-p ()
"See if ChangeLog entry at point is for the current user, today.
-Return non-nil iff it is."
+Return non-nil if it is."
;; Code adapted from add-change-log-entry.
(let ((name (or (and (boundp 'add-log-full-name) add-log-full-name)
(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.")
(1 (if (boundp 'cvs-filename-face) cvs-filename-face))
(0 log-view-file-face append)))
(eval . `(,log-view-message-re . log-view-message-face))))
+
(defconst log-view-font-lock-defaults
'(log-view-font-lock-keywords t nil nil nil))
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."
(defvar longlines-wrap-end nil)
(defvar longlines-wrap-point nil)
(defvar longlines-showing nil)
+(defvar longlines-decoded nil)
(make-variable-buffer-local 'longlines-wrap-beg)
(make-variable-buffer-local 'longlines-wrap-end)
(make-variable-buffer-local 'longlines-wrap-point)
(make-variable-buffer-local 'longlines-showing)
+(make-variable-buffer-local 'longlines-decoded)
;; Mode
@@ -128,7 +130,9 @@ are indicated with a symbol."
;; longlines-wrap-lines that we'll never encounter from here
(save-restriction
(widen)
- (longlines-decode-buffer)
+ (unless longlines-decoded
+ (longlines-decode-buffer)
+ (setq longlines-decoded t))
(longlines-wrap-region (point-min) (point-max)))
(set-buffer-modified-p mod))
(when (and longlines-show-hard-newlines
@@ -161,9 +165,11 @@ are indicated with a symbol."
(let ((buffer-undo-list t)
(after-change-functions nil)
(inhibit-read-only t))
- (save-restriction
- (widen)
- (longlines-encode-region (point-min) (point-max))))
+ (if longlines-decoded
+ (save-restriction
+ (widen)
+ (longlines-encode-region (point-min) (point-max))
+ (setq longlines-decoded nil))))
(remove-hook 'change-major-mode-hook 'longlines-mode-off t)
(remove-hook 'after-change-functions 'longlines-after-change-function t)
(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.")
(or (and (integerp last-command-char)
;; Some commands such as M-> may want to expand first.
- (equal this-command 'self-insert)
+ (equal this-command 'self-insert-command)
(or (eq (char-syntax last-command-char) ?_)
;; Don't expand on @.
(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."
))
(defun mspools-size-folder (spool)
- "Return (SPOOL . SIZE ) iff SIZE of spool file is non-zero."
+ "Return (SPOOL . SIZE ), if SIZE of spool file is non-zero."
;; 7th file attribute is the size of the file in bytes.
(let ((file (concat mspools-folder-directory spool))
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."
(mail-position-on-field (if resending "Resent-To" "To") t))))))
(defun rmail-summary-exists ()
- "Non-nil iff in an RMAIL buffer and an associated summary buffer exists.
+ "Non-nil if in an RMAIL buffer and an associated summary buffer exists.
In fact, the non-nil value returned is the summary buffer itself."
(and rmail-summary-buffer (buffer-name rmail-summary-buffer)
rmail-summary-buffer))
(defun rmail-summary-displayed ()
- "t iff in RMAIL buffer and an associated summary buffer is displayed."
+ "t if in RMAIL buffer and an associated summary buffer is displayed."
(and rmail-summary-buffer (get-buffer-window rmail-summary-buffer)))
(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 @@
;; ========== Credits and History ==========
;; In mid 1991, several people posted some interesting improvements to
-;; man.el from the standard emacs 18.57 distribution. I liked many of
+;; man.el from the standard Emacs 18.57 distribution. I liked many of
;; these, but wanted everything in one single package, so I decided
;; to incorporate them into a single manual browsing mode. While
;; much of the code here has been rewritten, and some features added,
@@ -64,7 +64,7 @@
;; ========== Features ==========
;; + Runs "man" in the background and pipes the results through a
;; series of sed and awk scripts so that all retrieving and cleaning
-;; is done in the background. The cleaning commands are configurable.
+;; is done in the background. The cleaning commands are configurable.
;; + Syntax is the same as Un*x man
;; + Functionality is the same as Un*x man, including "man -k" and
;; "man <section>", etc.
@@ -109,8 +109,6 @@
(defvar Man-notify)
-(defvar Man-current-page)
-(defvar Man-page-list)
(defcustom Man-filter-list nil
"*Manpage cleaning filter command phrases.
This variable contains a list of the following form:
@@ -127,13 +125,8 @@ the manpage buffer."
(string :tag "Phrase String"))))
:group 'man)
-(defvar Man-original-frame)
-(defvar Man-arguments)
-(defvar Man-sections-alist)
-(defvar Man-refpages-alist)
(defvar Man-uses-untabify-flag t
"Non-nil means use `untabify' instead of `Man-untabify-command'.")
-(defvar Man-page-mode-string)
(defvar Man-sed-script nil
"Script for sed to nuke backspaces and ANSI codes from manpages.")
@@ -141,28 +134,28 @@ the manpage buffer."
;; user variables
(defcustom Man-fontify-manpage-flag t
- "*Non-nil means make up the manpage with fonts."
+ "Non-nil means make up the manpage with fonts."
:type 'boolean
:group 'man)
(defcustom Man-overstrike-face 'bold
- "*Face to use when fontifying overstrike."
+ "Face to use when fontifying overstrike."
:type 'face
:group 'man)
(defcustom Man-underline-face 'underline
- "*Face to use when fontifying underlining."
+ "Face to use when fontifying underlining."
:type 'face
:group 'man)
(defcustom Man-reverse-face 'highlight
- "*Face to use when fontifying reverse video."
+ "Face to use when fontifying reverse video."
:type 'face
:group 'man)
;; Use the value of the obsolete user option Man-notify, if set.
(defcustom Man-notify-method (if (boundp 'Man-notify) Man-notify 'friendly)
- "*Selects the behavior when manpage is ready.
+ "Selects the behavior when manpage is ready.
This variable may have one of the following values, where (sf) means
that the frames are switched, so the manpage is displayed in the frame
where the man command was called from:
@@ -183,7 +176,7 @@ Any other value of `Man-notify-method' is equivalent to `meek'."
:group 'man)
(defcustom Man-width nil
- "*Number of columns for which manual pages should be formatted.
+ "Number of columns for which manual pages should be formatted.
If nil, the width of the window selected at the moment of man
invocation is used. If non-nil, the width of the frame selected
at the moment of man invocation is used. The value also can be a
@@ -194,12 +187,12 @@ positive integer."
:group 'man)
(defcustom Man-frame-parameters nil
- "*Frame parameter list for creating a new frame for a manual page."
+ "Frame parameter list for creating a new frame for a manual page."
:type 'sexp
:group 'man)
(defcustom Man-downcase-section-letters-flag t
- "*Non-nil means letters in sections are converted to lower case.
+ "Non-nil means letters in sections are converted to lower case.
Some Un*x man commands can't handle uppercase letters in sections, for
example \"man 2V chmod\", but they are often displayed in the manpage
with the upper case letter. When this variable is t, the section
@@ -209,7 +202,7 @@ being sent to the man background process."
:group 'man)
(defcustom Man-circular-pages-flag t
- "*Non-nil means the manpage list is treated as circular for traversal."
+ "Non-nil means the manpage list is treated as circular for traversal."
:type 'boolean
:group 'man)
@@ -220,7 +213,7 @@ being sent to the man background process."
;; '("3X" . "3") ; Xlib man pages
'("3X11" . "3")
'("1-UCB" . ""))
- "*Association list of bogus sections to real section numbers.
+ "Association list of bogus sections to real section numbers.
Some manpages (e.g. the Sun C++ 2.1 manpages) have section numbers in
their references which Un*x `man' does not recognize. This
association list is used to translate those sections, when found, to
@@ -250,9 +243,6 @@ the associated section number."
(defvar Man-awk-command "awk"
"Command used for processing awk scripts.")
-(defvar Man-mode-map nil
- "Keymap for Man mode.")
-
(defvar Man-mode-hook nil
"Hook run when Man mode is enabled.")
@@ -349,20 +339,22 @@ Otherwise, the value is whatever the function
;; end user variables
;; other variables and keymap initializations
+(defvar Man-original-frame)
+(make-variable-buffer-local 'Man-original-frame)
+(defvar Man-arguments)
+(make-variable-buffer-local 'Man-arguments)
+(put 'Man-arguments 'permanent-local t)
+
+(defvar Man-sections-alist nil)
(make-variable-buffer-local 'Man-sections-alist)
+(defvar Man-refpages-alist nil)
(make-variable-buffer-local 'Man-refpages-alist)
+(defvar Man-page-list nil)
(make-variable-buffer-local 'Man-page-list)
+(defvar Man-current-page 0)
(make-variable-buffer-local 'Man-current-page)
+(defvar Man-page-mode-string "1 of 1")
(make-variable-buffer-local 'Man-page-mode-string)
-(make-variable-buffer-local 'Man-original-frame)
-(make-variable-buffer-local 'Man-arguments)
-(put 'Man-arguments 'permanent-local t)
-
-(setq-default Man-sections-alist nil)
-(setq-default Man-refpages-alist nil)
-(setq-default Man-page-list nil)
-(setq-default Man-current-page 0)
-(setq-default Man-page-mode-string "1 of 1")
(defconst Man-sysv-sed-script "\
/\b/ { s/_\b//g
@@ -398,30 +390,32 @@ Otherwise, the value is whatever the function
table)
"Syntax table used in Man mode buffers.")
-(unless Man-mode-map
- (setq Man-mode-map (make-sparse-keymap))
- (suppress-keymap Man-mode-map)
- (set-keymap-parent Man-mode-map button-buffer-map)
-
- (define-key Man-mode-map " " 'scroll-up)
- (define-key Man-mode-map "\177" 'scroll-down)
- (define-key Man-mode-map "n" 'Man-next-section)
- (define-key Man-mode-map "p" 'Man-previous-section)
- (define-key Man-mode-map "\en" 'Man-next-manpage)
- (define-key Man-mode-map "\ep" 'Man-previous-manpage)
- (define-key Man-mode-map ">" 'end-of-buffer)
- (define-key Man-mode-map "<" 'beginning-of-buffer)
- (define-key Man-mode-map "." 'beginning-of-buffer)
- (define-key Man-mode-map "r" 'Man-follow-manual-reference)
- (define-key Man-mode-map "g" 'Man-goto-section)
- (define-key Man-mode-map "s" 'Man-goto-see-also-section)
- (define-key Man-mode-map "k" 'Man-kill)
- (define-key Man-mode-map "q" 'Man-quit)
- (define-key Man-mode-map "m" 'man)
- ;; Not all the man references get buttons currently. The text in the
- ;; manual page can contain references to other man pages
- (define-key Man-mode-map "\r" 'man-follow)
- (define-key Man-mode-map "?" 'describe-mode))
+(defvar Man-mode-map
+ (let ((map (make-sparse-keymap)))
+ (suppress-keymap map)
+ (set-keymap-parent map button-buffer-map)
+
+ (define-key map " " 'scroll-up)
+ (define-key map "\177" 'scroll-down)
+ (define-key map "n" 'Man-next-section)
+ (define-key map "p" 'Man-previous-section)
+ (define-key map "\en" 'Man-next-manpage)
+ (define-key map "\ep" 'Man-previous-manpage)
+ (define-key map ">" 'end-of-buffer)
+ (define-key map "<" 'beginning-of-buffer)
+ (define-key map "." 'beginning-of-buffer)
+ (define-key map "r" 'Man-follow-manual-reference)
+ (define-key map "g" 'Man-goto-section)
+ (define-key map "s" 'Man-goto-see-also-section)
+ (define-key map "k" 'Man-kill)
+ (define-key map "q" 'Man-quit)
+ (define-key map "m" 'man)
+ ;; Not all the man references get buttons currently. The text in the
+ ;; manual page can contain references to other man pages
+ (define-key map "\r" 'man-follow)
+ (define-key map "?" 'describe-mode)
+ map)
+ "Keymap for Man mode.")
;; buttons
(define-button-type 'Man-abstract-xref-man-page
@@ -730,8 +724,7 @@ all sections related to a subject, put something appropriate into the
(require 'env)
(message "Invoking %s %s in the background" manual-program man-args)
(setq buffer (generate-new-buffer bufname))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(setq buffer-undo-list t)
(setq Man-original-frame (selected-frame))
(setq Man-arguments man-args))
@@ -802,8 +795,7 @@ all sections related to a subject, put something appropriate into the
(defun Man-notify-when-ready (man-buffer)
"Notify the user when MAN-BUFFER is ready.
See the variable `Man-notify-method' for the different notification behaviors."
- (let ((saved-frame (save-excursion
- (set-buffer man-buffer)
+ (let ((saved-frame (with-current-buffer man-buffer
Man-original-frame)))
(cond
((eq Man-notify-method 'newframe)
@@ -975,7 +967,7 @@ default type, `Man-xref-man-page' is used for the buttons."
(Man-next-section 1)
(point)))
(goto-char (point-min))
- (point-max))))
+ nil)))
(while (re-search-forward regexp end t)
(make-text-button
(match-beginning button-pos)
@@ -1031,8 +1023,7 @@ manpage command."
(or (stringp process)
(set-process-buffer process nil))
- (save-excursion
- (set-buffer Man-buffer)
+ (with-current-buffer Man-buffer
(let ((case-fold-search nil))
(goto-char (point-min))
(cond ((or (looking-at "No \\(manual \\)*entry for")
@@ -1223,13 +1214,10 @@ The following key bindings are currently in effect in the buffer:
(defun Man-strip-page-headers ()
"Strip all the page headers but the first from the manpage."
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(case-fold-search nil)
- (page-list Man-page-list)
- (page ())
(header ""))
- (while page-list
- (setq page (car page-list))
+ (dolist (page Man-page-list)
(and (nth 2 page)
(goto-char (car page))
(re-search-forward Man-first-heading-regexp nil t)
@@ -1243,17 +1231,14 @@ The following key bindings are currently in effect in the buffer:
;; line.
;; (setq header (concat "\n" header)))
(while (search-forward header (nth 1 page) t)
- (replace-match "")))
- (setq page-list (cdr page-list)))))
+ (replace-match ""))))))
(defun Man-unindent ()
"Delete the leading spaces that indent the manpage."
- (let ((buffer-read-only nil)
- (case-fold-search nil)
- (page-list Man-page-list))
- (while page-list
- (let ((page (car page-list))
- (indent "")
+ (let ((inhibit-read-only t)
+ (case-fold-search nil))
+ (dolist (page Man-page-list)
+ (let ((indent "")
(nindent 0))
(narrow-to-region (car page) (car (cdr page)))
(if Man-uses-untabify-flag
@@ -1281,7 +1266,6 @@ The following key bindings are currently in effect in the buffer:
(or (eolp)
(delete-char nindent))
(forward-line 1)))
- (setq page-list (cdr page-list))
))))
@@ -1291,14 +1275,18 @@ The following key bindings are currently in effect in the buffer:
(defun Man-next-section (n)
"Move point to Nth next section (default 1)."
(interactive "p")
- (let ((case-fold-search nil))
+ (let ((case-fold-search nil)
+ (start (point)))
(if (looking-at Man-heading-regexp)
(forward-line 1))
(if (re-search-forward Man-heading-regexp (point-max) t n)
(beginning-of-line)
(goto-char (point-max))
;; The last line doesn't belong to any section.
- (forward-line -1))))
+ (forward-line -1))
+ ;; But don't move back from the starting point (can happen if `start'
+ ;; is somewhere on the last line).
+ (if (< (point) start) (goto-char start))))
(defun Man-previous-section (n)
"Move point to Nth previous section (default 1)."
@@ -1462,7 +1450,7 @@ Specify which REFERENCE to use; default is based on word at point."
(let ((path Man-header-file-path)
complete-path)
(while path
- (setq complete-path (concat (car path) "/" file)
+ (setq complete-path (expand-file-name file (car path))
path (cdr path))
(if (file-readable-p complete-path)
(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"))
(defun menu-bar-vc-filter (orig-binding)
(let ((ext-binding
- (if vc-mode (vc-call 'extra-menu buffer-file-name))))
+ (if vc-mode (vc-call-backend (vc-backend buffer-file-name) 'extra-menu))))
;; Give the VC backend a chance to add menu entries
;; specific for that backend.
(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 @@
+2007-08-08 Glenn Morris <rgm@gnu.org>
+
+ * mh-folder.el, mh-letter.el, mh-show.el: Replace `iff' in
+ doc-strings and comments.
+
2007-07-25 Glenn Morris <rgm@gnu.org>
* 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."
(defun mh-update-unseen ()
"Synchronize the unseen sequence with MH.
-Return non-nil iff the MH folder was set.
+Return non-nil if the MH folder was set.
The hook `mh-unseen-updated-hook' is called after the unseen sequence
is updated."
(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."
(defun mh-position-on-field (field &optional ignored)
"Move to the end of the FIELD in the header.
Move to end of entire header if FIELD not found.
-Returns non-nil iff FIELD was found.
+Returns non-nil if FIELD was found.
The optional second arg is for pre-version 4 compatibility and is
IGNORED."
(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."
(defun mh-showing-mode (&optional arg)
"Change whether messages should be displayed.
-With ARG, display messages iff ARG is positive."
+With ARG, display messages if ARG is positive, otherwise don't display them."
(setq mh-showing-mode
(if (null arg)
(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."
Basically, we check for existing horizontal scrolling."
(or truncate-lines
(> (window-hscroll (selected-window)) 0)
- (< (window-width) (frame-width))
+ (not (window-full-width-p))
(and
mouse-drag-electric-col-scrolling
(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."
(mouse-minibuffer-check event)
(let ((buffers (buffer-list)) alist menu split-by-major-mode sum-of-squares)
;; Make an alist of elements that look like (MENU-ITEM . BUFFER).
- (let ((tail buffers))
- (while tail
- ;; Divide all buffers into buckets for various major modes.
- ;; Each bucket looks like (MODE NAMESTRING BUFFERS...).
- (with-current-buffer (car tail)
- (let* ((adjusted-major-mode major-mode) elt)
- (let ((tail mouse-buffer-menu-mode-groups))
- (while tail
- (if (string-match (car (car tail)) mode-name)
- (setq adjusted-major-mode (cdr (car tail))))
- (setq tail (cdr tail))))
- (setq elt (assoc adjusted-major-mode split-by-major-mode))
- (if (null elt)
- (setq elt (list adjusted-major-mode
- (if (stringp adjusted-major-mode)
- adjusted-major-mode
- mode-name))
- split-by-major-mode (cons elt split-by-major-mode)))
- (or (memq (car tail) (cdr (cdr elt)))
- (setcdr (cdr elt) (cons (car tail) (cdr (cdr elt)))))))
- (setq tail (cdr tail))))
+ (dolist (buf buffers)
+ ;; Divide all buffers into buckets for various major modes.
+ ;; Each bucket looks like (MODE NAMESTRING BUFFERS...).
+ (with-current-buffer buf
+ (let* ((adjusted-major-mode major-mode) elt)
+ (dolist (group mouse-buffer-menu-mode-groups)
+ (when (string-match (car group) (format-mode-line mode-name))
+ (setq adjusted-major-mode (cdr group))))
+ (setq elt (assoc adjusted-major-mode split-by-major-mode))
+ (unless elt
+ (setq elt (list adjusted-major-mode
+ (if (stringp adjusted-major-mode)
+ adjusted-major-mode
+ mode-name))
+ split-by-major-mode (cons elt split-by-major-mode)))
+ (or (memq buf (cdr (cdr elt)))
+ (setcdr (cdr elt) (cons buf (cdr (cdr elt))))))))
;; Compute the sum of squares of sizes of the major-mode buckets.
(let ((tail split-by-major-mode))
(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.")
;;;###autoload
(defun ange-ftp-hook-function (operation &rest args)
(let ((fn (get operation 'ange-ftp)))
- (if fn (save-match-data (apply fn args))
+ (if fn
+ ;; Catch also errors in process-filter.
+ (condition-case err
+ (let ((debug-on-error t))
+ (save-match-data (apply fn args)))
+ (error (signal (car err) (cdr err))))
(ange-ftp-run-real-handler operation args))))
;; 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
sent to try to stop execution of a job on the remote host.
Data is sent to the remote host when RET is typed."
(set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern)
- (setq comint-use-prompt-regexp t))
+ (set (make-local-variable 'comint-use-prompt-regexp) t))
;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)")
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."
tramp-cache-data)
res))
-;; Read persistent connection history. Applied with
-;; `load-in-progress', because it shall be evaluated only once.
-(when load-in-progress
+;; Read persistent connection history.
+(when (zerop (hash-table-count tramp-cache-data))
(condition-case err
(with-temp-buffer
(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."
"Login incorrect"
"Login Incorrect"
"Connection refused"
- "Connection closed by foreign host."
+ "Connection closed"
"Sorry, try again."
"Name or service not known"
"Host key verification failed."
@@ -3581,8 +3581,11 @@ beginning of local filename are not substituted."
(tramp-send-command v command)
;; We should show the output anyway.
(when outbuf
- (with-current-buffer outbuf
- (insert-buffer-substring (tramp-get-connection-buffer v)))
+ (let ((output-string
+ (with-current-buffer (tramp-get-connection-buffer v)
+ (buffer-substring (point-min) (point-max)))))
+ (with-current-buffer outbuf
+ (insert output-string)))
(when display (display-buffer outbuf))))
;; When the user did interrupt, we should do it also.
(error
@@ -3614,12 +3617,20 @@ beginning of local filename are not substituted."
(let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
(args (split-string (substring command 0 asynchronous) " "))
(output-buffer
- (or output-buffer
- (if asynchronous
- "*Async Shell Command*"
- "*Shell Command Output*")))
+ (cond
+ ((bufferp output-buffer) output-buffer)
+ ((stringp output-buffer) (get-buffer-create output-buffer))
+ (output-buffer (current-buffer))
+ (t (generate-new-buffer
+ (if asynchronous
+ "*Async Shell Command*"
+ "*Shell Command Output*")))))
+ (error-buffer
+ (cond
+ ((bufferp error-buffer) error-buffer)
+ ((stringp error-buffer) (get-buffer-create error-buffer))))
(buffer
- (if (and (not asynchronous) (bufferp error-buffer))
+ (if (and (not asynchronous) error-buffer)
(with-parsed-tramp-file-name default-directory nil
(list output-buffer (tramp-make-tramp-temp-file v)))
output-buffer)))
@@ -3637,7 +3648,10 @@ beginning of local filename are not substituted."
(when (listp buffer)
(with-current-buffer error-buffer
(insert-file-contents (cadr buffer)))
- (delete-file (cadr buffer))))))
+ (delete-file (buffer-file-name (cadr buffer))))
+ ;; There's some output, display it.
+ (when (with-current-buffer output-buffer (> (point-max) (point-min)))
+ (display-message-or-buffer output-buffer)))))
;; File Editing.
@@ -4177,8 +4191,12 @@ Falls back to normal file name handler if no tramp file name handler exists."
((and completion (zerop (length localname))
(memq operation '(file-name-as-directory)))
filename)
- ;; Call the backend function.
- (foreign (apply foreign operation args))
+ ;; Call the backend function. Set a connection property
+ ;; first, it will be reused for user/host name completion.
+ (foreign
+ (unless (zerop (length localname))
+ (tramp-set-connection-property v "started" nil))
+ (apply foreign operation args))
;; Nothing to do for us.
(t (tramp-run-real-handler operation args)))))))
@@ -6116,7 +6134,8 @@ In case there is no valid Lisp expression, it raises an error"
(condition-case nil
(prog1 (read (current-buffer))
;; Error handling.
- (when (re-search-forward "\\S-" nil t) (error)))
+ (when (re-search-forward "\\S-" (tramp-line-end-position) t)
+ (error)))
(error (tramp-error
vec 'file-error
"`%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"
;; It seems that Tru64 Unix does not like it if long strings are sent
;; to it in one go. (This happens when sending the Perl
;; `file-attributes' implementation, for instance.) Therefore, we
-;; have this function which waits a bit at each line.
+;; have this function which sends the string in chunks.
(defun tramp-send-string (vec string)
"Send the STRING via connection VEC.
@@ -6143,7 +6162,7 @@ the remote host use line-endings as defined in the variable
;; Clean up the buffer. We cannot call `erase-buffer' because
;; narrowing might be in effect.
(let (buffer-read-only) (delete-region (point-min) (point-max)))
- ;; replace "\n" by `tramp-rsh-end-of-line'
+ ;; Replace "\n" by `tramp-rsh-end-of-line'.
(setq string
(mapconcat 'identity
(split-string string "\n")
@@ -6151,7 +6170,7 @@ the remote host use line-endings as defined in the variable
(unless (or (string= string "")
(string-equal (substring string -1) tramp-rsh-end-of-line))
(setq string (concat string tramp-rsh-end-of-line)))
- ;; send the string
+ ;; Send the string.
(if (and chunksize (not (zerop chunksize)))
(let ((pos 0)
(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'."
;; Just a directory.
directory)
(t
- ;; A directory iff the file name matches the regexp.
+ ;; A directory if the file name matches the regexp.
(let ((bufile (expand-file-name buffer-file-truename))
(case-fold-search nil))
(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."
(defconst cvs-qtypedesc-string1 (cvs-qtypedesc-create 'identity 'identity t))
(defconst cvs-qtypedesc-string (cvs-qtypedesc-create 'identity 'identity))
(defconst cvs-qtypedesc-strings
- (cvs-qtypedesc-create 'string->strings 'strings->string nil))
+ (cvs-qtypedesc-create 'split-string-and-unquote
+ 'combine-and-quote-strings nil))
(defun cvs-query-read (default prompt qtypedesc &optional hist-sym)
(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 @@
(when (re-search-forward
(concat "^" cmd "\\(\\s-+\\(.*\\)\\)?$") nil t)
(let* ((sym (intern (concat "cvs-" cmd "-flags")))
- (val (string->strings (or (match-string 2) ""))))
+ (val (split-string-and-unquote (or (match-string 2) ""))))
(cvs-flags-set sym 0 val))))
;; ensure that cvs doesn't have -q or -Q
(cvs-flags-set 'cvs-cvs-flags 0
@@ -612,7 +612,7 @@ If non-nil, NEW means to create a new buffer no matter what."
(t arg)))
args)))
(concat cvs-program " "
- (strings->string
+ (combine-and-quote-strings
(append (cvs-flags-query 'cvs-cvs-flags nil 'noquery)
(if cvs-cvsroot (list "-d" cvs-cvsroot))
args
@@ -941,7 +941,8 @@ With a prefix argument, prompt for cvs FLAGS to use."
(let ((root (cvs-get-cvsroot)))
(if (or (null root) current-prefix-arg)
(setq root (read-string "CVS Root: ")))
- (list (string->strings (read-string "Module(s): " (cvs-get-module)))
+ (list (split-string-and-unquote
+ (read-string "Module(s): " (cvs-get-module)))
(read-directory-name "CVS Checkout Directory: "
nil default-directory nil)
(cvs-add-branch-prefix
@@ -964,7 +965,7 @@ The files are stored to DIR."
(if branch (format " (branch: %s)" branch)
""))))
(list (read-directory-name prompt nil default-directory nil))))
- (let ((modules (string->strings (cvs-get-module)))
+ (let ((modules (split-string-and-unquote (cvs-get-module)))
(flags (cvs-add-branch-prefix
(cvs-flags-query 'cvs-checkout-flags "cvs checkout flags")))
(cvs-cvsroot (cvs-get-cvsroot)))
@@ -2253,7 +2254,7 @@ With prefix argument, prompt for cvs flags."
(let* ((args (append constant-args arg-list)))
(insert (format "=== %s %s\n\n"
- program (strings->string args)))
+ program (split-string-and-unquote args)))
;; FIXME: return the exit status?
(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 @@
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Keywords: wp, print, PostScript
-;; Version: 6.9
+;; Version: 6.9.1
;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
-(defconst pr-version "6.9"
- "printing.el, v 6.9 <2007/02/11 vinicius>
+(defconst pr-version "6.9.1"
+ "printing.el, v 6.9.1 <2007/08/02 vinicius>
Please send all bug fixes and enhancements to
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."
(defalias 'pr-f-read-string 'read-string)
;; GNU Emacs
- (defvar deactivate-mark nil)
+ (defvar deactivate-mark)
;; GNU Emacs
(defun pr-keep-region-active ()
@@ -1326,7 +1326,6 @@ If SUFFIX is non-nil, add that at the end of the file name."
;; GNU Emacs
;; Menu binding
- (require 'easymenu)
;; Replace existing "print" item by "Printing" item.
;; If you're changing this file, you'll load it a second,
;; 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."
;; GNU Emacs 20
((< emacs-major-version 21)
(defun pr-global-menubar (pr-menu-spec)
+ (require 'easymenu)
(easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item)
(when pr-menu-print-item
(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."
;; GNU Emacs 21 & 22
(t
(defun pr-global-menubar (pr-menu-spec)
+ (require 'easymenu)
(let ((menu-file (if (= emacs-major-version 21)
'("menu-bar" "files") ; GNU Emacs 21
'("menu-bar" "file")))) ; GNU Emacs 22 or higher
@@ -5194,9 +5195,9 @@ See `pr-visible-entry-alist'.")
If FORCE is non-nil, update menus doesn't matter if `pr-ps-printer-alist',
`pr-txt-printer-alist' or `pr-ps-utility-alist' were modified or not;
-otherwise, update PostScript printer menu iff `pr-ps-printer-menu-modified' is
-non-nil, update text printer menu iff `pr-txt-printer-menu-modified' is
-non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is
+otherwise, update PostScript printer menu if `pr-ps-printer-menu-modified' is
+non-nil, update text printer menu if `pr-txt-printer-menu-modified' is
+non-nil, and update PostScript File menus if `pr-ps-utility-menu-modified' is
non-nil.
If menu binding was not done, calls `pr-menu-bind'."
@@ -6017,9 +6018,10 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
;; Printing Interface (inspired on ps-print-interface.el)
-(require 'widget)
-(require 'wid-edit)
-(require 'cus-edit)
+(eval-when-compile
+ (require 'cus-edit)
+ (require 'wid-edit)
+ (require 'widget))
(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:
general value, or `antlr-read-boolean' with ARGs = \(PROMPT TABLE) which
reads a boolean value or a member of TABLE. PROMPT is the prompt when
asking for a new value. If non-nil, TABLE is a table for completion or
-a function evaluating to such a table. The return value is quoted iff
+a function evaluating to such a table. The return value is quoted if
AS-STRING is non-nil and is either t or a symbol which is a member of
`antlr-options-style'.")
@@ -2203,8 +2203,8 @@ part SUPER in the result of `antlr-file-dependencies'. CLASSES is the
part \(CLASS-SPEC ...) in the result of `antlr-directory-dependencies'.
The result looks like \(OPTION WITH-UNKNOWN GLIB ...). OPTION is the
-complete \"-glib\" option. WITH-UNKNOWN has value t iff there is none
-or more than one grammar file for at least one super grammar.
+complete \"-glib\" option. WITH-UNKNOWN is t if there is none or more
+than one grammar file for at least one super grammar.
Each GLIB looks like \(GRAMMAR-FILE \. EVOCAB). GRAMMAR-FILE is a file
in 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 @@
(defun c-awk-get-NL-prop-prev-line (&optional do-lim)
;; Get the c-awk-NL-prop text-property from the previous line, calculating
- ;; it if necessary. Return nil iff we're already at BOB.
+ ;; it if necessary. Return nil if we're at BOB.
;; See c-awk-after-if-for-while-condition-p for a description of DO-LIM.
;;
;; 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."
;; Foo::Foo (int b) : Base (b) {}
;; car ^ ^ point
;;
- ;; The cdr of the return value is non-nil iff a
+ ;; The cdr of the return value is non-nil if a
;; `c-typedef-decl-kwds' specifier is found in the declaration,
;; i.e. the declared identifier(s) are types.
;;
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
(bq-process type)))))))))
(defun c-valid-offset (offset)
- "Return non-nil iff OFFSET is a valid offset for a syntactic symbol.
+ "Return non-nil if OFFSET is a valid offset for a syntactic symbol.
See `c-offsets-alist'."
(or (eq offset '+)
(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))
(maven
;; Maven is a popular build tool for Java. Maven is Free Software.
"\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3)
-
+
(bash
"^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2)
@@ -979,8 +979,7 @@ Otherwise, construct a buffer name from MODE-NAME."
(funcall name-function mode-name))
(compilation-buffer-name-function
(funcall compilation-buffer-name-function mode-name))
- ((and (eq mode-command major-mode)
- (eq major-mode (nth 1 compilation-arguments)))
+ ((eq mode-command major-mode)
(buffer-name))
(t
(concat "*" (downcase mode-name) "*"))))
@@ -1032,7 +1031,7 @@ Returns the compilation buffer created."
(with-current-buffer
(setq outbuf
(get-buffer-create
- (compilation-buffer-name name-of-mode mode name-function)))
+ (compilation-buffer-name name-of-mode mode name-function)))
(let ((comp-proc (get-buffer-process (current-buffer))))
(if comp-proc
(if (or (not (eq (process-status comp-proc) 'run))
@@ -1136,7 +1135,7 @@ Returns the compilation buffer created."
(if (file-remote-p default-directory)
"/bin/sh"
shell-file-name)
- `("-c" ,command))))
+ nil `("-c" ,command))))
(start-file-process-shell-command (downcase mode-name)
outbuf command))))
;; Make the buffer's mode line show process state.
@@ -1164,7 +1163,7 @@ Returns the compilation buffer created."
"Set the height of WINDOW according to `compilation-window-height'."
(let ((height (buffer-local-value 'compilation-window-height (window-buffer window))))
(and height
- (= (window-width window) (frame-width (window-frame window)))
+ (window-full-width-p window)
;; If window is alone in its frame, aside from a minibuffer,
;; don't change its height.
(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."
(defun compilation-find-buffer (&optional avoid-current)
"Return a compilation buffer.
-If AVOID-CURRENT is nil, and
-the current buffer is a compilation buffer, return it.
-If AVOID-CURRENT is non-nil, return the current buffer
-only as a last resort."
- (if (and (compilation-buffer-internal-p (current-buffer))
- (not avoid-current))
+If AVOID-CURRENT is nil, and the current buffer is a compilation buffer,
+return it. If AVOID-CURRENT is non-nil, return the current buffer only
+as a last resort."
+ (if (and (compilation-buffer-internal-p) (not avoid-current))
(current-buffer)
(next-error-find-buffer avoid-current 'compilation-buffer-internal-p)))
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)."
(defvar cperl-use-major-mode 'cperl-mode)
(defvar cperl-font-lock-multiline-start nil)
(defvar cperl-font-lock-multiline nil)
-(defvar cperl-compilation-error-regexp-alist nil)
(defvar cperl-font-locking nil)
+;; NB as it stands the code in cperl-mode assumes this only has one
+;; element. If Xemacs 19 support were dropped, this could all be simplified.
+(defvar cperl-compilation-error-regexp-alist
+ ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS).
+ '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]"
+ 2 3))
+ "Alist that specifies how to match errors in perl output.")
+
;;;###autoload
(defun cperl-mode ()
"Major mode for editing Perl code.
@@ -1786,7 +1793,7 @@ or as help on variables `cperl-tips', `cperl-problems',
(cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x
(make-local-variable 'compilation-error-regexp-alist-alist)
(set 'compilation-error-regexp-alist-alist
- (cons (cons 'cperl cperl-compilation-error-regexp-alist)
+ (cons (cons 'cperl (car cperl-compilation-error-regexp-alist))
(symbol-value 'compilation-error-regexp-alist-alist)))
(if (fboundp 'compilation-build-compilation-error-regexp-alist)
(let ((f 'compilation-build-compilation-error-regexp-alist))
@@ -3551,7 +3558,7 @@ modify syntax-type text property if the situation is too hard."
(modify-syntax-entry starter (if (eq starter ?\\) "\\" ".") st)
(if ender (modify-syntax-entry ender "." st))))
;; i: have 2 args, after end of the first arg
- ;; i2: start of the second arg, if any (before delim iff `ender').
+ ;; i2: start of the second arg, if any (before delim if `ender').
;; ender: the last arg bounded by parens-like chars, the second one of them
;; starter: the starting delimiter of the first arg
;; go-forward: has 2 args, and the second part is empty
@@ -5702,13 +5709,6 @@ indentation and initial hashes. Behaves usually outside of comment."
(t 5))) ; should not happen
-(defvar cperl-compilation-error-regexp-alist
- ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS).
- '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]"
- 2 3))
- "Alist that specifies how to match errors in perl output.")
-
-
(defun cperl-windowed-init ()
"Initialization under windowed version."
(cond ((featurep 'ps-print)
@@ -8090,7 +8090,7 @@ prototype \\&SUB Returns prototype of the function given a reference.
(defun cperl-beautify-regexp-piece (b e embed level)
;; b is before the starting delimiter, e before the ending
;; e should be a marker, may be changed, but remains "correct".
- ;; EMBED is nil iff we process the whole REx.
+ ;; EMBED is nil if we process the whole REx.
;; The REx is guaranteed to have //x
;; LEVEL shows how many levels deep to go
;; 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."
(defun cpp-edit-toggle-known (arg)
"Toggle writable status for known conditionals.
-With optional argument ARG, make them writable iff ARG is positive."
+With optional argument ARG, make them writable if ARG is positive,
+otherwise make them unwritable."
(interactive "@P")
(if (or (and (null arg) cpp-known-writable)
(<= (prefix-numeric-value arg) 0))
@@ -633,7 +634,8 @@ With optional argument ARG, make them writable iff ARG is positive."
(defun cpp-edit-toggle-unknown (arg)
"Toggle writable status for unknown conditionals.
-With optional argument ARG, make them writable iff ARG is positive."
+With optional argument ARG, make them writable if ARG is positive,
+otherwise make them unwritable."
(interactive "@P")
(if (or (and (null arg) cpp-unknown-writable)
(<= (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'.")
(defvar tags-included-tables-function nil
"Function to do the work of `tags-included-tables' (which see).")
(defvar verify-tags-table-function nil
- "Function to return t iff current buffer contains valid tags file.")
+ "Function to return t if current buffer contains valid tags file.")
;; Initialize the tags table in the current buffer.
-;; Returns non-nil iff it is a valid tags table. On
+;; Returns non-nil if it is a valid tags table. On
;; non-nil return, the tags table state variable are
;; made buffer-local and initialized to nil.
(defun initialize-new-tags-table ()
@@ -417,7 +417,7 @@ file the tag was in."
(defun tags-verify-table (file)
"Read FILE into a buffer and verify that it is a valid tags table.
Sets the current buffer to one visiting FILE (if it exists).
-Returns non-nil iff it is a valid table."
+Returns non-nil if it is a valid table."
(if (get-file-buffer file)
;; The file is already in a buffer. Check for the visited file
;; having changed since we last used it.
@@ -1219,8 +1219,8 @@ where they were found."
(verify-tags-table-function . etags-verify-tags-table)
))))
-;; Return non-nil iff the current buffer is a valid etags TAGS file.
(defun etags-verify-tags-table ()
+ "Return non-nil if the current buffer is a valid etags TAGS file."
;; Use eq instead of = in case char-after returns nil.
(eq (char-after (point-min)) ?\f))
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."
("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1)
;; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1)
;; ant/javac
- (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)"
+ (" *\\(\\[javac\\] *\\)?\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)"
2 4 nil 5))
;; compilation-error-regexp-alist)
(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."
;; From: ralf@up3aud1.gwdg.de (Ralf Fassel)
;; Test if TAB format continuation lines work.
(defun fortran-is-in-string-p (where)
- "Return non-nil iff WHERE (a buffer position) is inside a Fortran string."
+ "Return non-nil if WHERE (a buffer position) is inside a Fortran string."
(save-excursion
(goto-char where)
(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'."
(defun gdb-many-windows (arg)
"Toggle the number of windows in the basic arrangement.
-With arg, display additional buffers iff arg is positive."
+With prefix argument ARG, display additional buffers if ARG is positive,
+otherwise use a single window."
(interactive "P")
(setq gdb-many-windows
(if (null arg)
@@ -363,7 +364,8 @@ With arg, display additional buffers iff arg is positive."
(defun gdb-use-separate-io-buffer (arg)
"Toggle separate IO for debugged program.
-With arg, use separate IO iff arg is positive."
+With prefix argument ARG, use separate IO if ARG is positive,
+otherwise do not."
(interactive "P")
(setq gdb-use-separate-io-buffer
(if (null arg)
@@ -664,7 +666,8 @@ line, and no execution takes place."
(defun gdb-speedbar-auto-raise (arg)
"Toggle automatic raising of the speedbar for watch expressions.
-With arg, automatically raise speedbar iff arg is positive."
+With prefix argument ARG, automatically raise speedbar if ARG is
+positive, otherwise don't automatically raise it."
(interactive "P")
(setq gdb-speedbar-auto-raise
(if (null arg)
@@ -1381,7 +1384,8 @@ directives."
(defun gdb-find-source-frame (arg)
"Toggle trying to find a source frame further up stack.
-With arg, look for a source frame further up stack iff arg is positive."
+With prefix argument ARG, look for a source frame further up
+stack if ARG is positive, otherwise don't look further up."
(interactive "P")
(setq gdb-find-source-frame
(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 @@
(defgroup gud nil
"Grand Unified Debugger mode for gdb and other debuggers under Emacs.
Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb."
- :group 'unix
+ :group 'processes
:group 'tools)
@@ -2467,7 +2467,7 @@ comint mode, which see."
;; for local variables in the debugger buffer.
(defun gud-common-init (command-line massage-args marker-filter
&optional find-file)
- (let* ((words (string->strings command-line))
+ (let* ((words (split-string-and-unquote command-line))
(program (car words))
(dir default-directory)
;; Extract the file name from WORDS
@@ -3361,7 +3361,7 @@ This event can be examined by forms in GUD-TOOLTIP-DISPLAY.")
(defun gud-tooltip-dereference (&optional arg)
"Toggle whether tooltips should show `* expr' or `expr'.
-With arg, dereference expr iff arg is positive."
+With arg, dereference expr if ARG is positive, otherwise do not derereference."
(interactive "P")
(setq gud-tooltip-dereference
(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:
t -- open both code and comment blocks
nil -- open neither code nor comment blocks
-This has effect iff `search-invisible' is set to `open'."
+This has effect only if `search-invisible' is set to `open'."
:type '(choice (const :tag "open only code blocks" code)
(const :tag "open only comment blocks" comment)
(const :tag "open both code and comment blocks" t)
@@ -515,7 +515,7 @@ Optional arg REPOS-END means reposition at end."
(goto-char (if repos-end end beg)))
(defun hs-hide-block-at-point (&optional end comment-reg)
- "Hide block iff on block beginning.
+ "Hide block if on block beginning.
Optional arg END means reposition at end.
Optional arg COMMENT-REG is a list of the form (BEGIN END) and
specifies 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."
(goto-char maxp))
(defmacro hs-life-goes-on (&rest body)
- "Evaluate BODY forms iff variable `hs-minor-mode' is non-nil.
+ "Evaluate BODY forms if variable `hs-minor-mode' is non-nil.
In the dynamic context of this macro, `inhibit-point-motion-hooks'
and `case-fold-search' are both t."
`(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."
(describe-function major-mode))
(defsubst octave-in-comment-p ()
- "Returns t if point is inside an Octave comment, nil otherwise."
+ "Return t if point is inside an Octave comment."
(interactive)
(save-excursion
(nth 4 (parse-partial-sexp (line-beginning-position) (point)))))
(defsubst octave-in-string-p ()
- "Returns t if point is inside an Octave string, nil otherwise."
+ "Return t if point is inside an Octave string."
(interactive)
(save-excursion
(nth 3 (parse-partial-sexp (line-beginning-position) (point)))))
(defsubst octave-not-in-string-or-comment-p ()
- "Returns t iff point is not inside an Octave string or comment."
+ "Return t if point is not inside an Octave string or comment."
(let ((pps (parse-partial-sexp (line-beginning-position) (point))))
(not (or (nth 3 pps) (nth 4 pps)))))
(defun octave-in-block-p ()
- "Returns t if point is inside an Octave block, nil otherwise.
+ "Return t if point is inside an Octave block.
The block is taken to start at the first letter of the begin keyword and
to end after the end keyword."
(let ((pos (point)))
@@ -599,7 +599,7 @@ to end after the end keyword."
(< pos (point)))))
(defun octave-in-defun-p ()
- "Returns t iff point is inside an Octave function declaration.
+ "Return t if point is inside an Octave function declaration.
The function is taken to start at the `f' of `function' and to end after
the end keyword."
(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."
(error nil))))))))
(defun python-comment-line-p ()
- "Return non-nil iff current line has only a comment."
+ "Return non-nil if current line has only a comment."
(save-excursion
(end-of-line)
(when (eq 'comment (syntax-ppss-context (syntax-ppss)))
@@ -356,7 +356,7 @@ comments and strings, or that point is within brackets/parens."
(looking-at (rx (or (syntax comment-start) line-end))))))
(defun python-blank-line-p ()
- "Return non-nil iff current line is blank."
+ "Return non-nil if current line is blank."
(save-excursion
(beginning-of-line)
(looking-at "\\s-*$")))
@@ -850,7 +850,7 @@ multi-line bracketed expressions."
"Skip out of any nested brackets.
Skip forward if FORWARD is non-nil, else backward.
If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point.
-Return non-nil iff skipping was done."
+Return non-nil if skipping was done."
(let ((depth (syntax-ppss-depth (or syntax (syntax-ppss))))
(forward (if forward -1 1)))
(unless (zerop depth)
@@ -1199,7 +1199,7 @@ local value.")
(define-key map "\C-c\C-l" 'python-load-file)
(define-key map "\C-c\C-v" 'python-check)
;; Note that we _can_ still use these commands which send to the
- ;; Python process even at the prompt iff we have a normal prompt,
+ ;; Python process even at the prompt provided we have a normal prompt,
;; i.e. '>>> ' and not '... '. See the comment before
;; python-send-region. Fixme: uncomment these if we address that.
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 @@
(defgroup sh nil
"Shell programming utilities."
- :group 'unix
:group 'languages)
(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 @@
"*Indentation of Tcl statements with respect to containing block."
:type 'integer
:group 'tcl)
+(put 'tcl-indent-level 'safe-local-variable 'integerp)
(defcustom tcl-continued-indent-level 4
"*Indentation of continuation line relative to first line of command."
:type 'integer
:group 'tcl)
+(put 'tcl-continued-indent-level 'safe-local-variable 'integerp)
(defcustom tcl-auto-newline nil
"*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."
When Which Function mode is enabled, the current function name is
continuously displayed in the mode line, in certain major modes.
-With prefix ARG, turn Which Function mode on iff arg is positive,
+With prefix ARG, turn Which Function mode on if arg is positive,
and off otherwise."
:global t :group 'which-func
(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."
(sleep-for 1)))
(defun xscheme-process-running-p ()
- "True iff there is a Scheme process whose status is `run'."
+ "True if there is a Scheme process whose status is `run'."
(let ((process (get-process xscheme-process-name)))
(and process
(eq (process-status process) 'run))))
@@ -882,7 +882,7 @@ Control returns to the top level rep loop."
(and buffer (get-buffer-window buffer))))
(defun xscheme-process-buffer-current-p ()
- "True iff the current buffer is the Scheme process buffer."
+ "True if the current buffer is the Scheme process buffer."
(eq (xscheme-process-buffer) (current-buffer)))
;;;; 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:
Any other value is ignored and black color will be used.
-It's used only when `ps-print-color-p' is non-nil."
+This variable is used only when `ps-print-color-p' (which see) is neither nil
+nor black-white."
:type '(choice :menu-tag "Default Foreground Gray/Color"
:tag "Default Foreground Gray/Color"
(const :tag "Session Foreground" t)
@@ -3059,7 +3060,8 @@ Valid values are:
Any other value is ignored and white color will be used.
-It's used only when `ps-print-color-p' is non-nil.
+This variable is used only when `ps-print-color-p' (which see) is neither nil
+nor black-white.
See also `ps-use-face-background'."
: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.")
1.0)
ps-default-background (ps-rgb-color
(cond
- ((or (not (eq ps-print-color-p t))
+ ((or (member ps-print-color-p
+ '(nil back-white))
(eq genfunc 'ps-generate-postscript))
nil)
((eq ps-default-bg 'frame-parameter)
@@ -5933,7 +5936,8 @@ XSTART YSTART are the relative position for the first page in a sheet.")
1.0)
ps-default-foreground (ps-rgb-color
(cond
- ((or (not (eq ps-print-color-p t))
+ ((or (member ps-print-color-p
+ '(nil back-white))
(eq genfunc 'ps-generate-postscript))
nil)
((eq ps-default-fg 'frame-parameter)
@@ -5944,7 +5948,8 @@ XSTART YSTART are the relative position for the first page in a sheet.")
ps-default-fg))
"unspecified-fg"
0.0)
- ps-default-color (and (eq ps-print-color-p t)
+ ps-default-color (and (not (member ps-print-color-p
+ '(nil back-white)))
ps-default-foreground)
ps-current-color ps-default-color)
;; 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."
If it is valid, set the register `r0' to 1, else set it to 0.")
(defun string-utf-8-p (string)
- "Return non-nil iff STRING is a unibyte string of valid UTF-8 sequence."
+ "Return non-nil if STRING is a unibyte string of valid UTF-8 sequence."
(if (or (not (stringp string))
(multibyte-string-p string))
(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
ans)))
(defun shadow-site-match (site1 site2)
- "Non-nil iff SITE1 is or includes SITE2.
+ "Non-nil if SITE1 is or includes SITE2.
Each may be a host or cluster name; if they are clusters, regexp of SITE1 will
be matched against the primary of SITE2."
(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."
regexp)
:group 'fill)
-(defvar comment-line-break-function 'comment-indent-new-line
- "*Mode-specific function which line breaks and continues a comment.
-
-This function is only called during auto-filling of a comment section.
-The function should take a single optional argument, which is a flag
-indicating whether it should use soft newlines.")
-
;; This function is used as the auto-fill-function of a buffer
;; when Auto-Fill mode is enabled.
;; It returns t if it really did any work.
@@ -4401,10 +4394,10 @@ indicating whether it should use soft newlines.")
(if (save-excursion
(skip-chars-backward " \t")
(= (point) fill-point))
- (funcall comment-line-break-function t)
+ (default-indent-new-line t)
(save-excursion
(goto-char fill-point)
- (funcall comment-line-break-function t)))
+ (default-indent-new-line t)))
;; Now do justification, if required
(if (not (eq justify 'left))
(save-excursion
@@ -4419,6 +4412,43 @@ indicating whether it should use soft newlines.")
(justify-current-line justify t t)
t)))
+(defvar comment-line-break-function 'comment-indent-new-line
+ "*Mode-specific function which line breaks and continues a comment.
+This function is called during auto-filling when a comment syntax
+is defined.
+The function should take a single optional argument, which is a flag
+indicating whether it should use soft newlines.")
+
+(defun default-indent-new-line (&optional soft)
+ "Break line at point and indent.
+If a comment syntax is defined, call `comment-indent-new-line'.
+
+The inserted newline is marked hard if variable `use-hard-newlines' is true,
+unless optional argument SOFT is non-nil."
+ (interactive)
+ (if comment-start
+ (funcall comment-line-break-function soft)
+ ;; Insert the newline before removing empty space so that markers
+ ;; get preserved better.
+ (if soft (insert-and-inherit ?\n) (newline 1))
+ (save-excursion (forward-char -1) (delete-horizontal-space))
+ (delete-horizontal-space)
+
+ (if (and fill-prefix (not adaptive-fill-mode))
+ ;; Blindly trust a non-adaptive fill-prefix.
+ (progn
+ (indent-to-left-margin)
+ (insert-before-markers-and-inherit fill-prefix))
+
+ (cond
+ ;; If there's an adaptive prefix, use it unless we're inside
+ ;; a comment and the prefix is not a comment starter.
+ (fill-prefix
+ (indent-to-left-margin)
+ (insert-and-inherit fill-prefix))
+ ;; If we're not inside a comment, just try to indent.
+ (t (indent-according-to-mode))))))
+
(defvar normal-auto-fill-function 'do-auto-fill
"The function to use for `auto-fill-function' if Auto Fill mode is turned on.
Some major modes set this.")
@@ -4497,8 +4527,9 @@ The variable `selective-display' has a separate value for each buffer."
(defun toggle-truncate-lines (&optional arg)
"Toggle whether to fold or truncate long lines for the current buffer.
-With arg, truncate long lines iff arg is positive.
-Note that in side-by-side windows, truncation is always enabled."
+With prefix argument ARG, truncate long lines if ARG is positive,
+otherwise don't truncate them. Note that in side-by-side
+windows, truncation is always enabled."
(interactive "P")
(setq truncate-lines
(if (null arg)
@@ -4521,11 +4552,11 @@ Note that in side-by-side windows, truncation is always enabled."
(defun overwrite-mode (arg)
"Toggle overwrite mode.
-With arg, turn overwrite mode on iff arg is positive.
-In overwrite mode, printing characters typed in replace existing text
-on a one-for-one basis, rather than pushing it to the right. At the
-end of a line, such characters extend the line. Before a tab,
-such characters insert until the tab is filled in.
+With prefix argument ARG, turn overwrite mode on if ARG is positive,
+otherwise turn it off. In overwrite mode, printing characters typed
+in replace existing text on a one-for-one basis, rather than pushing
+it to the right. At the end of a line, such characters extend the line.
+Before a tab, such characters insert until the tab is filled in.
\\[quoted-insert] still inserts characters in overwrite mode; this
is supposed to make it easier to insert characters when necessary."
(interactive "P")
@@ -4537,14 +4568,13 @@ is supposed to make it easier to insert characters when necessary."
(defun binary-overwrite-mode (arg)
"Toggle binary overwrite mode.
-With arg, turn binary overwrite mode on iff arg is positive.
-In binary overwrite mode, printing characters typed in replace
-existing text. Newlines are not treated specially, so typing at the
-end of a line joins the line to the next, with the typed character
-between them. Typing before a tab character simply replaces the tab
-with the character typed.
-\\[quoted-insert] replaces the text at the cursor, just as ordinary
-typing characters do.
+With prefix argument ARG, turn binary overwrite mode on if ARG is
+positive, otherwise turn it off. In binary overwrite mode, printing
+characters typed in replace existing text. Newlines are not treated
+specially, so typing at the end of a line joins the line to the next,
+with the typed character between them. Typing before a tab character
+simply replaces the tab with the character typed. \\[quoted-insert]
+replaces the text at the cursor, just as ordinary typing characters do.
Note that binary overwrite mode is not its own minor mode; it is a
specialization of overwrite mode, entered by setting the
@@ -4559,9 +4589,9 @@ specialization of overwrite mode, entered by setting the
(define-minor-mode line-number-mode
"Toggle Line Number mode.
-With arg, turn Line Number mode on iff arg is positive.
-When Line Number mode is enabled, the line number appears
-in the mode line.
+With arg, turn Line Number mode on if arg is positive, otherwise
+turn it off. When Line Number mode is enabled, the line number
+appears in the mode line.
Line numbers do not appear for very large buffers and buffers
with very long lines; see variables `line-number-display-limit'
@@ -4570,16 +4600,16 @@ and `line-number-display-limit-width'."
(define-minor-mode column-number-mode
"Toggle Column Number mode.
-With arg, turn Column Number mode on iff arg is positive.
-When Column Number mode is enabled, the column number appears
-in the mode line."
+With arg, turn Column Number mode on if arg is positive,
+otherwise turn it off. When Column Number mode is enabled, the
+column number appears in the mode line."
:global t :group 'mode-line)
(define-minor-mode size-indication-mode
"Toggle Size Indication mode.
-With arg, turn Size Indication mode on iff arg is positive. When
-Size Indication mode is enabled, the size of the accessible part
-of the buffer appears in the mode line."
+With arg, turn Size Indication mode on if arg is positive,
+otherwise turn it off. When Size Indication mode is enabled, the
+size of the accessible part of the buffer appears in the mode line."
:global t :group 'mode-line)
(defgroup paren-blinking nil
@@ -5114,7 +5144,7 @@ With prefix argument N, move N items (negative N means move backward)."
These functions are called in order with four arguments:
CHOICE - the string to insert in the buffer,
BUFFER - the buffer in which the choice should be inserted,
-MINI-P - non-nil iff BUFFER is a minibuffer, and
+MINI-P - non-nil if BUFFER is a minibuffer, and
BASE-SIZE - the number of characters in BUFFER before
the string being completed.
@@ -5743,7 +5773,8 @@ See also `normal-erase-is-backspace'."
(define-minor-mode visible-mode
"Toggle Visible mode.
-With argument ARG turn Visible mode on iff ARG is positive.
+With argument ARG turn Visible mode on if ARG is positive, otherwise
+turn it off.
Enabling Visible mode makes all invisible text temporarily visible.
Disabling 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
interesting point set by _
> indent line (or interregion if > _) according to major mode
@ add position to `skeleton-positions'
- & do next ELEMENT iff previous moved point
- | do next ELEMENT iff previous didn't move point
+ & do next ELEMENT if previous moved point
+ | do next ELEMENT if previous didn't move point
-num delete num preceding characters (see `skeleton-untabify')
resume: skipped, continue here if quit is signaled
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."
(goto-char (point-min))))
(defun strokes-alphabetic-lessp (stroke1 stroke2)
- "T iff command name for STROKE1 is less than STROKE2's in lexicographic order."
+ "T if command name for STROKE1 is less than STROKE2's in lexicographic order."
(let ((command-name-1 (symbol-name (cdr stroke1)))
(command-name-2 (symbol-name (cdr stroke2))))
(string-lessp command-name-1 command-name-2)))
@@ -1520,7 +1520,7 @@ Encode/decode your strokes with \\[strokes-encode-buffer],
(eq char ?*)))
;;(defsubst strokes-xor (a b) ### Should I make this an inline function? ###
-;; "T iff one and only one of A and B is non-nil; otherwise, returns nil.
+;; "T if one and only one of A and B is non-nil; otherwise, returns nil.
;;NOTE: Don't use this as a numeric xor since it treats all non-nil
;; values as t including `0' (zero)."
;; (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."
list)))
(nreverse list)))
-;; (string->strings (strings->string X)) == X
-(defun strings->string (strings &optional separator)
+(defun combine-and-quote-strings (strings &optional separator)
"Concatenate the STRINGS, adding the SEPARATOR (default \" \").
This tries to quote the strings to avoid ambiguity such that
- (string->strings (strings->string strs)) == strs
+ (split-string-and-unquote (combine-and-quote-strings strs)) == strs
Only some SEPARATORs will work properly."
(let ((sep (or separator " ")))
(mapconcat
@@ -2867,20 +2866,20 @@ Only some SEPARATORs will work properly."
str))
strings sep)))
-;; (string->strings (strings->string X)) == X
-(defun string->strings (string &optional separator)
+(defun split-string-and-unquote (string &optional separator)
"Split the STRING into a list of strings.
-It understands elisp style quoting within STRING such that
- (string->strings (strings->string strs)) == strs
+It understands Emacs Lisp quoting within STRING, such that
+ (split-string-and-unquote (combine-and-quote-strings strs)) == strs
The SEPARATOR regexp defaults to \"\\s-+\"."
(let ((sep (or separator "\\s-+"))
(i (string-match "[\"]" string)))
- (if (null i) (split-string string sep t) ; no quoting: easy
+ (if (null i)
+ (split-string string sep t) ; no quoting: easy
(append (unless (eq i 0) (split-string (substring string 0 i) sep t))
(let ((rfs (read-from-string string i)))
(cons (car rfs)
- (string->strings (substring string (cdr rfs))
- sep)))))))
+ (split-string-and-unquote (substring string (cdr rfs))
+ sep)))))))
;;;; 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 @@
;;;###autoload
(define-minor-mode t-mouse-mode
"Toggle t-mouse mode to use the mouse in Linux consoles.
-With prefix arg, turn t-mouse mode on iff arg is positive.
+With prefix arg, turn t-mouse mode on if arg is positive, otherwise turn it
+off.
This allows the use of the mouse when operating on a Linux console, in the
same 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 @@
(defgroup term nil
"General command interpreter in a window."
- :group 'processes
- :group 'unix)
+ :group 'processes)
;;; Buffer Local Variables:
@@ -470,7 +469,7 @@
(defvar term-scroll-with-delete nil) ;; term-scroll-with-delete is t if
;; forward scrolling should be implemented by delete to
;; top-most line(s); and nil if scrolling should be implemented
-;; by moving term-home-marker. It is set to t iff there is a
+;; by moving term-home-marker. It is set to t if there is a
;; (non-default) scroll-region OR the alternate buffer is used.
(defvar term-pending-delete-marker) ;; New user input in line mode needs to
;; be deleted, because it gets echoed by the inferior.
@@ -695,12 +694,12 @@ Buffer local variable.")
;;; faces -mm
-(defcustom term-default-fg-color 'unspecified
+(defcustom term-default-fg-color (face-foreground term-current-face)
"Default color for foreground in `term'."
:group 'term
:type 'string)
-(defcustom term-default-bg-color 'unspecified
+(defcustom term-default-bg-color (face-background term-current-face)
"Default color for background in `term'."
:group 'term
:type 'string)
@@ -1098,6 +1097,8 @@ Entry to this mode runs the hooks on `term-mode-hook'."
(make-local-variable 'term-pending-delete-marker)
(setq term-pending-delete-marker (make-marker))
(make-local-variable 'term-current-face)
+ (setq term-current-face (list :background term-default-bg-color
+ :foreground term-default-fg-color))
(make-local-variable 'term-pending-frame)
(setq term-pending-frame nil)
;; Cua-mode's keybindings interfere with the term keybindings, disable it.
@@ -3055,7 +3056,8 @@ See `term-prompt-regexp'."
(setq term-scroll-start 0)
(setq term-scroll-end term-height)
(setq term-insert-mode nil)
- (setq term-current-face nil)
+ (setq term-current-face (list :background term-default-bg-color
+ :foreground term-default-fg-color))
(setq term-ansi-current-underline nil)
(setq term-ansi-current-bold nil)
(setq term-ansi-current-reverse nil)
@@ -3117,7 +3119,8 @@ See `term-prompt-regexp'."
;;; 0 (Reset) or unknown (reset anyway)
(t
- (setq term-current-face nil)
+ (setq term-current-face (list :background term-default-bg-color
+ :foreground term-default-fg-color))
(setq term-ansi-current-underline nil)
(setq term-ansi-current-bold nil)
(setq term-ansi-current-reverse nil)
@@ -3154,11 +3157,11 @@ See `term-prompt-regexp'."
(setq term-current-face
(list :background
(if (= term-ansi-current-color 0)
- (face-foreground 'default)
+ term-default-fg-color
(elt ansi-term-color-vector term-ansi-current-color))
:foreground
(if (= term-ansi-current-bg-color 0)
- (face-background 'default)
+ term-default-bg-color
(elt ansi-term-color-vector term-ansi-current-bg-color))))
(when term-ansi-current-bold
(setq term-current-face
@@ -3181,9 +3184,13 @@ See `term-prompt-regexp'."
)
(setq term-current-face
(list :foreground
- (elt ansi-term-color-vector term-ansi-current-color)
+ (if (= term-ansi-current-color 0)
+ term-default-fg-color
+ (elt ansi-term-color-vector term-ansi-current-color))
:background
- (elt ansi-term-color-vector term-ansi-current-bg-color)))
+ (if (= term-ansi-current-bg-color 0)
+ term-default-bg-color
+ (elt ansi-term-color-vector term-ansi-current-bg-color))))
(when term-ansi-current-bold
(setq term-current-face
(append '(:weight bold) term-current-face)))
@@ -3715,12 +3722,12 @@ all pending output has been dealt with."))
(defun term-erase-in-display (kind)
"Erases (that is blanks out) part of the window.
If KIND is 0, erase from (point) to (point-max);
-if KIND is 1, erase from home to point; else erase from home to point-max.
-Should only be called when point is at the start of a screen line."
+if KIND is 1, erase from home to point; else erase from home to point-max."
(term-handle-deferred-scroll)
(cond ((eq term-terminal-parameter 0)
- (delete-region (point) (point-max))
- (term-unwrap-line))
+ (let ((need-unwrap (bolp)))
+ (delete-region (point) (point-max))
+ (when need-unwrap (term-unwrap-line))))
((let ((row (term-current-row))
(col (term-horizontal-column))
(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."
(setq modifiers (cons (car modifier-mask) modifiers)))))
modifiers))
+(defun mac-ae-reopen-application (event)
+ "Show some frame in response to the Apple event EVENT.
+The frame to be shown is chosen from visible or iconified frames
+if possible. If there's no such frame, a new frame is created."
+ (interactive "e")
+ (unless (frame-visible-p (selected-frame))
+ (let ((frame (or (car (visible-frame-list))
+ (car (filtered-frame-list 'frame-visible-p)))))
+ (if frame
+ (select-frame frame)
+ (switch-to-buffer-other-frame "*scratch*"))))
+ (select-frame-set-input-focus (selected-frame)))
+
(defun mac-ae-open-documents (event)
"Open the documents specified by the Apple event EVENT."
(interactive "e")
@@ -1769,9 +1782,9 @@ Currently the `mailto' scheme is supported."
(define-key mac-apple-event-map [core-event open-application] 0)
;; Received when a dock or application icon is clicked and Emacs is
-;; already running. Simply ignored. Another idea is to make a new
-;; frame if all frames are invisible.
-(define-key mac-apple-event-map [core-event reopen-application] 'ignore)
+;; already running.
+(define-key mac-apple-event-map [core-event reopen-application]
+ 'mac-ae-reopen-application)
(define-key mac-apple-event-map [core-event open-documents]
'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."
(defun minibuffer-window-p (window)
- "True iff this WINDOW is minibuffer."
+ "True if this WINDOW is minibuffer."
(= (frame-height)
(nth 3 (window-edges window)) ; The bottom edge.
))
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 @@
;;; Should keypad numbers send ordinary digits or distinct escape sequences?
(defvar tvi970-keypad-numeric nil
- "The terminal should be in numeric keypad mode iff this variable is non-nil.
-Do not set this variable! Call the function ``tvi970-set-keypad-mode''.")
+ "Non-nil means the terminal should be in numeric keypad mode.
+Do not set this variable! Call the function `tvi970-set-keypad-mode'.")
(defun tvi970-set-keypad-mode (&optional arg)
"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."
;; Macro that won't funcall the function if it is nil.
;;
(defmacro artist-funcall (fn &rest args)
- "Call function FN with ARGS iff FN is not nil."
+ "Call function FN with ARGS, if FN is not nil."
(list 'if fn (cons 'funcall (cons fn args))))
(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'."
This spawns a single Ispell process and checks each word.
The default flyspell behavior is to highlight incorrect words.
With no argument, this command toggles Flyspell mode.
-With a prefix argument ARG, turn Flyspell minor mode on iff ARG is positive.
+With a prefix argument ARG, turn Flyspell minor mode on if ARG is positive,
+otherwise turn it off.
Bindings:
\\[ispell-word]: correct words (using Ispell).
@@ -1621,7 +1622,7 @@ FLYSPELL-BUFFER."
;;* flyspell-overlay-p ... */
;;*---------------------------------------------------------------------*/
(defun flyspell-overlay-p (o)
- "A predicate that return true iff O is an overlay used by flyspell."
+ "Return true if O is an overlay used by flyspell."
(and (overlayp o) (overlay-get o 'flyspell-overlay)))
;;*---------------------------------------------------------------------*/
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."
;;;###autoload
(defun ispell-minor-mode (&optional arg)
"Toggle Ispell minor mode.
-With prefix arg, turn Ispell minor mode on iff arg is positive.
+With prefix argument ARG, turn Ispell minor mode on if ARG is positive,
+otherwise turn it off.
In Ispell minor mode, pressing SPC or RET
warns 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."
`nroff-electric-newline' forces Emacs to check for an nroff request at the
beginning of the line, and insert the matching closing request if necessary.
This command toggles that mode (off->on, on->off), with an argument,
-turns it on iff arg is positive, otherwise off."
+turns it on if arg is positive, otherwise off."
:lighter " Electric"
(or (derived-mode-p 'nroff-mode) (error "Must be in nroff mode")))
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.")
;;;###autoload
(define-minor-mode refill-mode
"Toggle Refill minor mode.
-With prefix arg, turn Refill mode on iff arg is positive.
+With prefix arg, turn Refill mode on if arg is positive, otherwise turn it off.
When Refill mode is on, the current paragraph will be formatted when
changes 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.
With no argument, this command toggles
`reftex-isearch-minor-mode'. With a prefix argument ARG, turn
-`reftex-isearch-minor-mode' on iff ARG is positive."
+`reftex-isearch-minor-mode' on if ARG is positive, otherwise turn it off."
(interactive "P")
(let ((old-reftex-isearch-minor-mode reftex-isearch-minor-mode))
(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."
(defun sgml-skip-tag-forward (arg)
"Skip to end of tag or matching closing tag if present.
With prefix argument ARG, repeat this ARG times.
-Return t iff after a closing tag."
+Return t if after a closing tag."
(interactive "p")
;; FIXME: Use sgml-get-context or something similar.
;; 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'."
:group 'tex)
(put 'tex-fontify-script 'safe-local-variable 'booleanp)
-(defcustom tex-font-script-display '(-0.2 . 0.2)
+(defcustom tex-font-script-display '(-0.2 0.2)
"Display specification for subscript and superscript content.
-The car is used for subscript, the cdr is used for superscripts."
+The first is used for subscript, the second is used for superscripts."
:group 'tex
- :type '(cons (choice (float :tag "Subscript")
- (const :tag "No lowering" nil))
- (choice (float :tag "Superscript")
- (const :tag "No raising" nil))))
+ :type '(list (float :tag "Subscript")
+ (float :tag "Superscript")))
(defvar tex-last-temp-file nil
"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."
odd))
(if (eq (char-after pos) ?_)
`(face subscript display (raise ,(car tex-font-script-display)))
- `(face superscript display (raise ,(cdr tex-font-script-display))))))
+ `(face superscript display (raise ,(cadr tex-font-script-display))))))
(defun tex-font-lock-match-suscript (limit)
"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."
(let ((next (next-single-property-change beg 'display nil end))
(prop (get-text-property beg 'display)))
(if (and (eq (car-safe prop) 'raise)
- (member (car-safe (cdr prop)) '(-0.3 +0.3))
+ (member (car-safe (cdr prop)) tex-font-script-display)
(null (cddr prop)))
(put-text-property beg next 'display nil))
(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
first and the associated buffer to its right."
(interactive "P")
;; first go to full width, so that we can certainly split into two windows
- (if (< (window-width) (frame-width))
- (enlarge-window 99999 t))
+ (unless (window-full-width-p)
+ (enlarge-window 99999 t))
(split-window-horizontally
(max window-min-width (min 2C-window-width
(- (frame-width) window-min-width))))
@@ -533,8 +533,8 @@ off trailing spaces with \\[delete-trailing-whitespace]."
(insert 2C-separator string))
(next-line 1) ; add one if necessary
(set-buffer b2))))
- (if (< (window-width) (frame-width))
- (enlarge-window 99999 t)))
+ (unless (window-full-width-p)
+ (enlarge-window 99999 t)))
;;;;; utility functions ;;;;;
@@ -561,8 +561,10 @@ off trailing spaces with \\[delete-trailing-whitespace]."
(newline arg))
(defun 2C-toggle-autoscroll (arg)
- "Toggle autoscrolling, or set it iff prefix ARG is non-nil and positive.
-When autoscrolling is turned on, this also realigns the two buffers."
+ "Toggle autoscrolling.
+With prefix argument ARG, turn on autoscrolling if ARG is
+positive, otherwise turn it off. When autoscrolling is turned
+on, this also realigns the two buffers."
(interactive "P")
;(sit-for 0)
(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 @@
+2007-08-08 Glenn Morris <rgm@gnu.org>
+
+ * url-auth.el, url-cache.el, url-dav.el, url-file.el, vc-dav.el:
+ Replace `iff' in doc-strings and comments.
+
2007-07-25 Glenn Morris <rgm@gnu.org>
* 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."
(server (url-host href))
(port (url-port href))
(path (url-filename href))
- user pass byserv retval data)
+ (user (url-user href))
+ (pass (url-password href))
+ byserv retval data)
(setq server (format "%s:%d" server port)
path (cond
(realm realm)
@@ -79,8 +81,8 @@ instead of the pathname inheritance method."
(cond
((and prompt (not byserv))
(setq user (read-string (url-auth-user-prompt url realm)
- (user-real-login-name))
- pass (read-passwd "Password: "))
+ (or user (user-real-login-name)))
+ pass (read-passwd "Password: " nil (or pass "")))
(set url-basic-auth-storage
(cons (list server
(cons path
@@ -310,7 +312,7 @@ RATING a rating between 1 and 10 of the strength of the authentication.
url-registered-auth-schemes)))))
(defun url-auth-registered (scheme)
- ;; Return non-nil iff SCHEME is registered as an auth type
+ "Return non-nil if SCHEME is registered as an auth type."
(assoc scheme url-registered-auth-schemes))
(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."
;;;###autoload
(defun url-cache-expired (url mod)
- "Return t iff a cached file has expired."
+ "Return t if a cached file has expired."
(let* ((urlobj (if (vectorp url) url (url-generic-parse-url url)))
(type (url-type urlobj)))
(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)."
(defun url-dav-unlock-resource (url lock-token)
"Release the lock on URL represented by LOCK-TOKEN.
-Returns t iff the lock was successfully released."
+Returns t if the lock was successfully released."
(declare (special url-http-response-status))
(let* ((url-request-extra-headers (list (cons "Lock-Token"
(concat "<" lock-token ">"))))
@@ -654,13 +654,13 @@ Returns t iff the lock was successfully released."
(or (plist-get properties 'DAV:getcontentlength) 0)
;; file modes as a string like `ls -l'
- ;;
+ ;;
;; Should be able to build this up from the
;; DAV:supportedlock attribute pretty easily. Getting
;; the group info could be impossible though.
(url-dav-file-attributes-mode-string properties)
- ;; t iff file's gid would change if it were deleted &
+ ;; t if file's gid would change if it were deleted &
;; recreated. No way for us to know that thru DAV.
nil
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."
found))
(defun url-file-host-is-local-p (host)
- "Return t iff HOST references our local machine."
+ "Return t if HOST references our local machine."
(let ((case-fold-search t))
(or
(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 @@
;;; Required functions for a vc backend
(defun vc-dav-registered (url)
- "Return t iff URL is registered with a DAV aware server."
+ "Return t if URL is registered with a DAV aware server."
(url-dav-vc-registered url))
(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."
(setq answer nil))
((eq answer 'revert)
(revert-buffer nil (not (buffer-modified-p)))
- ; ask confirmation iff buffer modified
+ ; ask confirmation if buffer modified
(signal 'file-supersession
(list "File reverted" fn)))
((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 @@
;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
-;; NOTE: THIS IS A MODIFIED VERSION OF Dave Love's vc-bzr.el,
-;; which you can find at: http://www.loveshack.ukfsn.org/emacs/vc-bzr.el
-;; I could not get in touch with Dave Love by email, so
-;; I am releasing my changes separately. -- Riccardo
-
;; Author: Dave Love <fx@gnu.org>, Riccardo Murri <riccardo.murri@gmail.com>
;; Keywords: tools
;; Created: Sept 2006
-;; Version: 2007-05-24
+;; Version: 2007-08-03
;; URL: http://launchpad.net/vc-bzr
;; This file is free software; you can redistribute it and/or modify
@@ -31,9 +26,6 @@
;;; Commentary:
-;; NOTE: THIS IS A MODIFIED VERSION OF Dave Love's vc-bzr.el,
-;; which you can find at: http://www.loveshack.ukfsn.org/emacs/vc-bzr.el
-
;; See <URL:http://bazaar-vcs.org/> concerning bzr.
;; 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."
(let ((process-environment
(list* "BZR_PROGRESS_BAR=none" ; Suppress progress output (bzr >=0.9)
"LC_ALL=C" ; Force English output
- process-environment))
- ;; bzr may attempt some kind of user interaction if its stdin/stdout
- ;; is connected to a PTY; therefore, ask Emacs to use a pipe to
- ;; communicate with it.
- ;; This is redundant because vc-do-command does it already. --Stef
- (process-connection-type nil))
+ process-environment)))
(apply 'vc-do-command buffer okstatus vc-bzr-program
file-or-list bzr-command (append vc-bzr-program-args args))))
;;;###autoload
-(defconst vc-bzr-admin-dirname ".bzr") ; FIXME: "_bzr" on w32?
+(defconst vc-bzr-admin-dirname ".bzr" ; FIXME: "_bzr" on w32?
+ "Name of the directory containing Bzr repository status files.")
+;;;###autoload
+(defconst vc-bzr-admin-checkout-format-file
+ (concat vc-bzr-admin-dirname "/checkout/format"))
+(defconst vc-bzr-admin-dirstate
+ (concat vc-bzr-admin-dirname "/checkout/dirstate"))
+(defconst vc-bzr-admin-branch-format-file
+ (concat vc-bzr-admin-dirname "/branch/format"))
+(defconst vc-bzr-admin-revhistory
+ (concat vc-bzr-admin-dirname "/branch/revision-history"))
;;;###autoload (defun vc-bzr-registered (file)
-;;;###autoload (if (vc-find-root file vc-bzr-admin-dirname)
+;;;###autoload (if (vc-find-root file vc-bzr-admin-checkout-format-file)
;;;###autoload (progn
;;;###autoload (load "vc-bzr")
;;;###autoload (vc-bzr-registered file))))
-(defun vc-bzr-root-dir (file)
- "Return the root directory in the hierarchy above FILE.
-Return nil if there isn't one."
- (vc-find-root file vc-bzr-admin-dirname))
+(defun vc-bzr-root (file)
+ "Return the root directory of the bzr repository containing FILE."
+ ;; Cache technique copied from vc-arch.el.
+ (or (vc-file-getprop file 'bzr-root)
+ (vc-file-setprop
+ file 'bzr-root
+ (vc-find-root file vc-bzr-admin-checkout-format-file))))
(defun vc-bzr-registered (file)
- "Return non-nil if FILE is registered with bzr."
- (if (vc-bzr-root-dir file) ; Short cut.
- (vc-bzr-state file))) ; Expensive.
+ "Return non-nil if FILE is registered with bzr.
+
+For speed, this function tries first to parse Bzr internal file
+`checkout/dirstate', but it may fail if Bzr internal file format
+has changed. As a safeguard, the `checkout/dirstate' file is
+only parsed if it contains the string `#bazaar dirstate flat
+format 3' in the first line.
+
+If the `checkout/dirstate' file cannot be parsed, fall back to
+running `vc-bzr-state'."
+ (condition-case nil
+ (lexical-let ((root (vc-bzr-root file)))
+ (and root ; Short cut.
+ ;; This looks at internal files. May break if they change
+ ;; their format.
+ (lexical-let
+ ((dirstate-file (expand-file-name vc-bzr-admin-dirstate root)))
+ (if (file-exists-p dirstate-file)
+ (with-temp-buffer
+ (insert-file-contents dirstate-file)
+ (goto-char (point-min))
+ (when (looking-at "#bazaar dirstate flat format 3")
+ (let* ((relfile (file-relative-name file root))
+ (reldir (file-name-directory relfile)))
+ (re-search-forward
+ (concat "^\0"
+ (if reldir (regexp-quote (directory-file-name reldir)))
+ "\0"
+ (regexp-quote (file-name-nondirectory relfile))
+ "\0")
+ nil t))))
+ t))
+ (vc-bzr-state file))) ; Expensive.
+ (file-error nil))) ; vc-bzr-program not found
(defun vc-bzr-buffer-nonblank-p (&optional buffer)
"Return non-nil if BUFFER contains any non-blank characters."
@@ -134,15 +165,34 @@ Return nil if there isn't one."
(re-search-forward "[^ \t\n]" (point-max) t))))
(defconst vc-bzr-state-words
- "added\\|ignored\\|modified\\|removed\\|renamed\\|unknown"
+ "added\\|ignored\\|kind changed\\|modified\\|removed\\|renamed\\|unknown"
"Regexp matching file status words as reported in `bzr' output.")
+(defun vc-bzr-file-name-relative (filename)
+ "Return file name FILENAME stripped of the initial Bzr repository path."
+ (lexical-let*
+ ((filename* (expand-file-name filename))
+ (rootdir (vc-bzr-root (file-name-directory filename*))))
+ (and rootdir
+ (file-relative-name filename* rootdir))))
+
;; FIXME: Also get this in a non-registered sub-directory.
-(defun vc-bzr-state (file)
+;; It already works for me. -- Riccardo
+(defun vc-bzr-status (file)
+ "Return FILE status according to Bzr.
+Return value is a cons (STATUS . WARNING), where WARNING is a
+string or nil, and STATUS is one of the symbols: 'added,
+'ignored, 'kindchange, 'modified, 'removed, 'renamed, 'unknown,
+which directly correspond to `bzr status' output, or 'unchanged
+for files whose copy in the working tree is identical to the one
+in the branch repository, or nil for files that are not
+registered with Bzr.
+
+If any error occurred in running `bzr status', then return nil."
+ (condition-case nil
(with-temp-buffer
- (cd (file-name-directory file))
- (let ((ret (vc-bzr-command "status" t 255 file))
- (state 'up-to-date))
+ (let ((ret (vc-bzr-command "status" t 0 file))
+ (status 'unchanged))
;; the only secure status indication in `bzr status' output
;; is a couple of lines following the pattern::
;; | <status>:
@@ -153,45 +203,93 @@ Return nil if there isn't one."
(goto-char (point-min))
(when
(re-search-forward
+ ;; bzr prints paths relative to the repository root
(concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+"
- (file-name-nondirectory file) "[ \t\n]*$")
+ (regexp-quote (vc-bzr-file-name-relative file))
+ (if (file-directory-p file) "/?" "")
+ "[ \t\n]*$")
(point-max) t)
(let ((start (match-beginning 0))
(end (match-end 0)))
(goto-char start)
- (setq state
+ (setq status
(cond
((not (equal ret 0)) nil)
- ((looking-at "added\\|renamed\\|modified\\|removed") 'edited)
- ((looking-at "unknown\\|ignored") nil)))
+ ((looking-at "added") 'added)
+ ((looking-at "kind changed") 'kindchange)
+ ((looking-at "renamed") 'renamed)
+ ((looking-at "modified") 'modified)
+ ((looking-at "removed") 'removed)
+ ((looking-at "ignored") 'ignored)
+ ((looking-at "unknown") 'unknown)))
;; erase the status text that matched
(delete-region start end)))
- (when (vc-bzr-buffer-nonblank-p)
- ;; "bzr" will output some warnings and informational messages
- ;; to the user to stderr; due to Emacs' `vc-do-command' (and,
- ;; it seems, `start-process' itself), we cannot catch stderr
+ (if status
+ (cons status
+ ;; "bzr" will output warnings and informational messages to
+ ;; stderr; due to Emacs' `vc-do-command' (and, it seems,
+ ;; `start-process' itself) limitations, we cannot catch stderr
;; and stdout into different buffers. So, if there's anything
;; left in the buffer after removing the above status
;; keywords, let us just presume that any other message from
;; "bzr" is a user warning, and display it.
- (message "Warnings in `bzr' output: %s"
- (buffer-substring (point-min) (point-max))))
- (when state
- (vc-file-setprop file 'vc-workfile-version
- (vc-bzr-workfile-version file))
- (vc-file-setprop file 'vc-state state))
- state)))
+ (if (vc-bzr-buffer-nonblank-p)
+ (buffer-substring (point-min) (point-max)))))))
+ (file-error nil))) ; vc-bzr-program not found
+
+(defun vc-bzr-state (file)
+ (lexical-let ((result (vc-bzr-status file)))
+ (when (consp result)
+ (if (cdr result)
+ (message "Warnings in `bzr' output: %s" (cdr result)))
+ (cdr (assq (car result)
+ '((added . edited)
+ (kindchange . edited)
+ (renamed . edited)
+ (modified . edited)
+ (removed . edited)
+ (ignored . nil)
+ (unknown . nil)
+ (unchanged . up-to-date)))))))
(defun vc-bzr-workfile-unchanged-p (file)
- (eq 'up-to-date (vc-bzr-state file)))
+ (eq 'unchanged (car (vc-bzr-status file))))
(defun vc-bzr-workfile-version (file)
- ;; Looks like this could be obtained via counting lines in
- ;; .bzr/branch/revision-history.
+ (lexical-let*
+ ((rootdir (vc-bzr-root file))
+ (branch-format-file (concat rootdir "/" vc-bzr-admin-branch-format-file))
+ (revhistory-file (concat rootdir "/" vc-bzr-admin-revhistory))
+ (lastrev-file (concat rootdir "/" "branch/last-revision")))
+ ;; Count lines in .bzr/branch/revision-history to avoid forking a
+ ;; bzr process. This looks at internal files. May break if they
+ ;; change their format.
+ (if (file-exists-p branch-format-file)
(with-temp-buffer
- (vc-bzr-command "revno" t 0 file)
- (goto-char (point-min))
- (buffer-substring (point) (line-end-position))))
+ (insert-file-contents branch-format-file)
+ (goto-char (point-min))
+ (cond
+ ((or
+ (looking-at "Bazaar-NG branch, format 0.0.4")
+ (looking-at "Bazaar-NG branch format 5"))
+ ;; count lines in .bzr/branch/revision-history
+ (insert-file-contents revhistory-file)
+ (number-to-string (count-lines (line-end-position) (point-max))))
+ ((looking-at "Bazaar Branch Format 6 (bzr 0.15)")
+ ;; revno is the first number in .bzr/branch/last-revision
+ (insert-file-contents lastrev-file)
+ (goto-char (line-end-position))
+ (if (re-search-forward "[0-9]+" nil t)
+ (buffer-substring (match-beginning 0) (match-end 0))))))
+ ;; fallback to calling "bzr revno"
+ (lexical-let*
+ ((result (vc-bzr-command-discarding-stderr
+ vc-bzr-program "revno" file))
+ (exitcode (car result))
+ (output (cdr result)))
+ (cond
+ ((eq exitcode 0) (substring output 0 -1))
+ (t nil))))))
(defun vc-bzr-checkout-model (file)
'implicit)
@@ -209,7 +307,7 @@ COMMENT is ignored."
;; Could run `bzr status' in the directory and see if it succeeds, but
;; that's relatively expensive.
-(defalias 'vc-bzr-responsible-p 'vc-bzr-root-dir
+(defalias 'vc-bzr-responsible-p 'vc-bzr-root
"Return non-nil if FILE is (potentially) controlled by bzr.
The criterion is that there is a `.bzr' directory in the same
or a superior directory.")
@@ -250,7 +348,7 @@ EDITABLE is ignored."
(defun vc-bzr-revert (file &optional contents-done)
(unless contents-done
- (with-temp-buffer (vc-bzr-command "revert" t 'async file))))
+ (with-temp-buffer (vc-bzr-command "revert" t 0 file))))
(defvar log-view-message-re)
(defvar log-view-file-re)
@@ -294,13 +392,11 @@ EDITABLE is ignored."
(beginning-of-line 0)
(goto-char (point-min)))))
-;; Fixem: vc-bzr-wash-log
-
(autoload 'vc-diff-switches-list "vc" nil nil t)
(defun vc-bzr-diff (files &optional rev1 rev2 buffer)
"VC bzr backend for diff."
- (let ((working (vc-workfile-version (car files))))
+ (let ((working (vc-workfile-version (if (consp files) (car files) files))))
(if (and (equal rev1 working) (not rev2))
(setq rev1 nil))
(if (and (not rev1) rev2)
@@ -317,9 +413,8 @@ EDITABLE is ignored."
(defalias 'vc-bzr-diff-tree 'vc-bzr-diff)
-;; Fixme: implement vc-bzr-dir-state, vc-bzr-dired-state-info
-;; Fixme: vc-{next,previous}-version need fixing in vc.el to deal with
+;; FIXME: vc-{next,previous}-version need fixing in vc.el to deal with
;; straight integer versions.
(defun vc-bzr-delete-file (file)
@@ -399,17 +494,16 @@ Return nil if current line isn't annotated."
(if next-time
(- (vc-annotate-convert-time (current-time)) next-time))))
-;; FIXME: `bzr root' will return the real path to the repository root,
-;; that is, it can differ from the buffer's current directory name
-;; if there are any symbolic links.
-(defun vc-bzr-root (dir)
- "Return the root directory of the bzr repository containing DIR."
- ;; Cache technique copied from vc-arch.el.
- (or (vc-file-getprop dir 'bzr-root)
- (vc-file-setprop
- dir 'bzr-root
- (substring
- (shell-command-to-string (concat vc-bzr-program " root " dir)) 0 -1))))
+(defun vc-bzr-command-discarding-stderr (command &rest args)
+ "Execute shell command COMMAND (with ARGS); return its output and exitcode.
+Return value is a cons (EXITCODE . OUTPUT), where EXITCODE is
+the (numerical) exit code of the process, and OUTPUT is a string
+containing whatever the process sent to its standard output
+stream. Standard error output is discarded."
+ (with-temp-buffer
+ (cons
+ (apply #'call-process command nil (list (current-buffer) nil) nil args)
+ (buffer-substring (point-min) (point-max)))))
;; TODO: it would be nice to mark the conflicted files in VC Dired,
;; and implement a command to run ediff and `bzr resolve' once the
@@ -453,6 +547,9 @@ Optional argument LOCALP is always ignored."
((looking-at "^added")
(setq current-vc-state 'edited)
(setq current-bzr-state 'added))
+ ((looking-at "^kind changed")
+ (setq current-vc-state 'edited)
+ (setq current-bzr-state 'kindchange))
((looking-at "^modified")
(setq current-vc-state 'edited)
(setq current-bzr-state 'modified))
@@ -499,7 +596,7 @@ Optional argument LOCALP is always ignored."
(add-to-list 'vc-handled-backends 'Bzr)
(eval-after-load "vc"
- '(add-to-list 'vc-directory-exclusion-list ".bzr" t))
+ '(add-to-list 'vc-directory-exclusion-list vc-bzr-admin-dirname t))
(defconst vc-bzr-unload-hook
(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."
(t (apply f args)))))
(defmacro vc-call (fun file &rest args)
- ;; BEWARE!! `file' is evaluated twice!!
+ "A convenience macro for calling VC backend functions.
+Functions called by this macro must accept FILE as the first argument.
+ARGS specifies any additional arguments. FUN should be unquoted.
+BEWARE!! `file' is evaluated twice!!"
`(vc-call-backend (vc-backend ,file) ',fun ,file ,@args))
(defsubst vc-parse-buffer (pattern i)
@@ -873,13 +876,9 @@ Used in `find-file-not-found-functions'."
(if backend (vc-call-backend backend 'find-file-not-found-hook))))
(defun vc-default-find-file-not-found-hook (backend)
- (if (yes-or-no-p
- (format "File %s was lost; check out from version control? "
- (file-name-nondirectory buffer-file-name)))
- (save-excursion
- (require 'vc)
- (setq default-directory (file-name-directory buffer-file-name))
- (not (vc-error-occurred (vc-checkout buffer-file-name))))))
+ ;; This used to do what vc-rcs-find-file-not-found-hook does, but it only
+ ;; really makes sense for RCS. For other backends, better not do anything.
+ nil)
(add-hook 'find-file-not-found-functions 'vc-file-not-found-hook)
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."
;; The workfile is unchanged if rcsdiff found no differences.
(zerop status)))
+(defun vc-rcs-find-file-not-found-hook ()
+ (if (yes-or-no-p
+ (format "File %s was lost; check out from version control? "
+ (file-name-nondirectory buffer-file-name)))
+ (save-excursion
+ (require 'vc)
+ (let ((default-directory (file-name-directory buffer-file-name)))
+ (not (vc-error-occurred (vc-checkout buffer-file-name)))))))
;;;
;;; 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."
;; ;; We may want to reparse the compilation buffer after revert
;; (reparse (and (boundp 'compilation-error-list) ;compile loaded
;; ;; Construct a list; each elt is nil or a buffer
- ;; ;; iff that buffer is a compilation output buffer
+ ;; ;; if that buffer is a compilation output buffer
;; ;; that contains markers into the current buffer.
;; (save-current-buffer
;; (mapcar (lambda (buffer)
@@ -2636,6 +2636,9 @@ changes found in the master file; use \\[universal-argument] \\[vc-next-action]
(message "Reverting %s...done" file)))
;;;###autoload
+(define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1")
+
+;;;###autoload
(defun vc-update ()
"Update the current buffer's file to the latest version on its branch.
If the file contains no changes, and is not locked, then this simply replaces
@@ -2718,8 +2721,9 @@ return its name; otherwise return nil."
(vc-resynch-buffer file t t))
;;;###autoload
-(defun vc-rollback ()
- "Get rid of most recently checked in version of this file."
+(defun vc-rollback (&optional norevert)
+ "Get rid of most recently checked in version of this file.
+A prefix argument NOREVERT means do not revert the buffer afterwards."
(interactive "P")
(vc-ensure-vc-buffer)
(let* ((file buffer-file-name)
@@ -3268,12 +3272,19 @@ colors. `vc-annotate-background' specifies the background color."
(set (make-local-variable 'vc-annotate-parent-display-mode)
display-mode)))
- (vc-exec-after
- `(progn
- (when ,current-line
- (goto-line ,current-line ,temp-buffer-name))
- (unless (active-minibuffer-window)
- (message "Annotating... done"))))))
+ (with-current-buffer temp-buffer-name
+ (vc-exec-after
+ `(progn
+ ;; Ideally, we'd rather not move point if the user has already
+ ;; moved it elsewhere, but really point here is not the position
+ ;; of the user's cursor :-(
+ (when ,current-line ;(and (bobp))
+ (let ((win (get-buffer-window (current-buffer) 0)))
+ (when win
+ (with-selected-window win
+ (goto-line ,current-line)))))
+ (unless (active-minibuffer-window)
+ (message "Annotating... done")))))))
(defun vc-annotate-prev-version (prefix)
"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'."
;; bindings instead of using the \\[] construction. The reason for this
;; is that most commands have more than one key binding.
"Toggle View mode, a minor mode for viewing text but not editing it.
-With ARG, turn View mode on iff ARG is positive.
+With prefix argument ARG, turn View mode on if ARG is positive, otherwise
+turn it off.
Emacs commands that do not change the buffer contents are available as usual.
Kill 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
;;;###autoload
(define-minor-mode whitespace-global-mode
"Toggle using Whitespace mode in new buffers.
-With ARG, turn the mode on iff ARG is positive.
+With ARG, turn the mode on if ARG is positive, otherwise turn it off.
When this mode is active, `whitespace-buffer' is added to
`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.")
;;;###autoload
(defun widgetp (widget)
- "Return non-nil iff WIDGET is a widget."
+ "Return non-nil if WIDGET is a widget."
(if (symbolp widget)
(get widget 'widget-type)
(and (consp widget)
@@ -500,7 +500,7 @@ Otherwise, just return the value."
value)))
(defun widget-member (widget property)
- "Non-nil iff there is a definition in WIDGET for PROPERTY."
+ "Non-nil if there is a definition in WIDGET for PROPERTY."
(cond ((plist-member (cdr widget) property)
t)
((car widget)
@@ -1606,7 +1606,7 @@ If that does not exists, call the value of `widget-complete-field'."
(widget-princ-to-string (widget-get widget :value))))
(defun widget-default-active (widget)
- "Return t iff this widget active (user modifiable)."
+ "Return t if this widget is active (user modifiable)."
(or (widget-get widget :always-active)
(and (not (widget-get widget :inactive))
(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)."
PROC is called with a window as argument.
Optional second arg MINIBUF t means count the minibuffer window even
-if not active. MINIBUF nil or omitted means count the minibuffer iff
+if not active. MINIBUF nil or omitted means count the minibuffer only if
it is active. MINIBUF neither t nor nil means not to count the
minibuffer even if it is active.
@@ -165,7 +165,7 @@ value is returned. If no window satisfies PREDICATE, DEFAULT is
returned.
Optional second arg MINIBUF t means count the minibuffer window even
-if not active. MINIBUF nil or omitted means count the minibuffer iff
+if not active. MINIBUF nil or omitted means count the minibuffer only if
it is active. MINIBUF neither t nor nil means not to count the
minibuffer even if it is active.
@@ -927,7 +927,7 @@ means suspend autoselection."
(defun mouse-autoselect-window-select ()
"Select window with delayed window autoselection.
If the mouse position has stabilized in a non-selected window, select
-that window. The minibuffer window is selected iff the minibuffer is
+that window. The minibuffer window is selected only if the minibuffer is
active. This function is run by `mouse-autoselect-window-timer'."
(condition-case nil
(let* ((mouse-position (mouse-position))
@@ -952,14 +952,14 @@ active. This function is run by `mouse-autoselect-window-timer'."
;; If `mouse-autoselect-window' is positive, select
;; window if the window is the same as before.
(eq window mouse-autoselect-window-window))
- ;; Otherwise select window iff the mouse is at the same
+ ;; Otherwise select window if the mouse is at the same
;; position as before. Observe that the first test after
;; starting autoselection usually fails since the value of
;; `mouse-autoselect-window-position' recorded there is the
;; position where the mouse has entered the new window and
;; not necessarily where the mouse has stopped moving.
(equal mouse-position mouse-autoselect-window-position))
- ;; The minibuffer is a candidate window iff it's active.
+ ;; The minibuffer is a candidate window if it's active.
(or (not (window-minibuffer-p window))
(eq window (active-minibuffer-window))))
;; 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 @@
;; Author: Ivar Rummelhoff <ivarru@math.uio.no>
;; Created: 27 Feb 1997
-;; Time-stamp: <2006-02-06 15:13:57 ttn>
;; Keywords: convenience frames
;; This file is part of GNU Emacs.
@@ -286,7 +285,7 @@ You may want to include buffer names such as *Help*, *Apropos*,
(defun winner-get-point (buf win)
;; Consult (and possibly extend) `winner-point-alist'.
- ;; Returns nil iff buf no longer exists.
+ ;; Returns nil if buf no longer exists.
(when (buffer-name buf)
(let ((entry (assq buf winner-point-alist)))
(cond
@@ -306,7 +305,7 @@ You may want to include buffer names such as *Help*, *Apropos*,
;; Make sure point does not end up in the minibuffer and delete
;; windows displaying dead or boring buffers
-;; (c.f. `winner-boring-buffers'). Return nil iff all the windows
+;; (c.f. `winner-boring-buffers'). Return nil if all the windows
;; should be deleted. Preserve correct points and marks.
(defun winner-set (conf)
;; 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 @@
;;;###autoload
(define-minor-mode xterm-mouse-mode
"Toggle XTerm mouse mode.
-With prefix arg, turn XTerm mouse mode on iff arg is positive.
+With prefix arg, turn XTerm mouse mode on if arg is positive, otherwise turn
+it off.
Turn it on to use Emacs mouse commands, and off to use xterm mouse commands.
This 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 @@
+2007-08-08 Martin Rudalics <rudalics@gmx.at>
+
+ * modes.texi (Example Major Modes): Fix typo.
+
+2007-08-08 Glenn Morris <rgm@gnu.org>
+
+ * intro.texi (nil and t): Do not use `iff' in documentation.
+
+ * tips.texi (Documentation Tips): Recommend against `iff'.
+
+2007-08-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * display.texi (Image Cache): Document image-refresh.
+
+2007-08-06 Martin Rudalics <rudalics@gmx.at>
+
+ * windows.texi (Size of Window): Document window-full-width-p.
+
2007-07-25 Glenn Morris <rgm@gnu.org>
* 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
Variables}.
@defun booleanp object
-Return non-nil iff @var{object} is one of the two canonical boolean
+Return non-nil if @var{object} is one of the two canonical boolean
values: @code{t} or @code{nil}.
@end defun
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:
In Lisp and most programming languages, we want the paragraph
commands to treat only blank lines as paragraph separators. And the
-modes should undestand the Lisp conventions for comments. The rest of
+modes should understand the Lisp conventions for comments. The rest of
@code{lisp-mode-variables} sets this up:
@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
``Display text in boldface.''
@item
+Avoid using ``iff'' (a mathematics term meaning ``if and only if''),
+since many people are unfamiliar with it and mistake it for a typo. In
+most cases, the meaning is clear with just ``if''. Otherwise, try to
+find an alternate phrasing that conveys the meaning.
+
+@item
When a command is meaningful only in a certain mode or situation,
do mention that in the documentation string. For example,
the 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.
@end example
@end defun
+@defun window-full-width-p &optional window
+This function returns non-@code{nil} if @var{window} is as wide as
+the frame that contains it; otherwise @code{nil}.
+If @var{window} is @code{nil}, the function uses the selected window.
+@end defun
+
@defun window-edges &optional window
This function returns a list of the edge coordinates of @var{window}.
If @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. */
operating system this machine is likely to run.
USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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 @@
+2007-08-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus.texi (NNTP): Mention nntp-xref-number-is-evil.
+
+2007-08-08 Glenn Morris <rgm@gnu.org>
+
+ * glossary.texi (Glossary): Deprecate `iff'.
+ * gnus.texi, sieve.texi: Replace `iff'.
+
+2007-08-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * files.texi (File Conveniences): Document point motion keys in Image
+ mode.
+
2007-08-03 Jay Belanger <jay.p.belanger@gmail.com>
* calc.texi (Basic Graphics): Mention the graphing of error
forms.
(Graphics Options): Mention how `g s' handles error forms.
+ (Curve Fitting): Mention plotting the curves.
+ (Standard Nonlinear Models): Add additional models.
+ (Curve Fitting Details): Mention the Levenberg-Marquardt method.
+ (Linear Fits): Correct result.
2007-08-01 Alan Mackenzie <acm@muc.de>
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
to be determined. For a typical set of measured data there will be
no single @expr{m} and @expr{b} that exactly fit the data; in this
case, Calc chooses values of the parameters that provide the closest
-possible fit.
+possible fit. The model formula can be entered in various ways after
+the key sequence @kbd{a F} is pressed.
+
+If the letter @kbd{P} is pressed after @kbd{a F} but before the model
+description is entered, the data as well as the model formula will be
+plotted after the formula is determined. This will be indicated by a
+``P'' in the minibuffer after the help message.
@menu
* Linear Fits::
@@ -24055,7 +24061,7 @@ $$
@noindent
is on the stack and we wish to do a simple linear fit. Type
@kbd{a F}, then @kbd{1} for the model, then @key{RET} to use
-the default names. The result will be the formula @expr{3 + 2 x}
+the default names. The result will be the formula @expr{3. + 2. x}
on the stack. Calc has created the model expression @kbd{a + b x},
then found the optimal values of @expr{a} and @expr{b} to fit the
data. (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
case, the model could be @expr{a x + b x^2 + c x^3}. You can get
a homogeneous linear or multilinear model by pressing the letter
@kbd{h} followed by a regular model key, like @kbd{1} or @kbd{2}.
+This will be indicated by an ``h'' in the minibuffer after the help
+message.
It is certainly possible to have other constrained linear models,
like @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}.
Gaussian.
@texline @math{{a \over b \sqrt{2 \pi}} \exp\left( -{1 \over 2} \left( x - c \over b \right)^2 \right)}.
@infoline @mathit{(a / b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)}.
+@item s
+Logistic @emph{s} curve.
+@texline @math{a/(1+e^{b(x-c)})}.
+@infoline @mathit{a/(1 + exp(b (x - c)))}.
+@item b
+Logistic bell curve.
+@texline @math{ae^{b(x-c)}/(1+e^{b(x-c)})^2}.
+@infoline @mathit{a exp(b (x - c))/(1 + exp(b (x - c)))^2}.
+@item o
+Hubbert linearization.
+@texline @math{{y \over x} = a(1-x/b)}.
+@infoline @mathit{(y/x) = a (1 - x/b)}.
@end table
All 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
values of the parameters substituted. (You may find it easier to read
the parameter values from the vector that is placed in the trail.)
-All models except Gaussian and polynomials can generalize as shown to any
-number of independent variables. Also, all the built-in models have an
+All models except Gaussian, logistics, Hubbert and polynomials can
+generalize as shown to any number of independent variables. Also, all
+the built-in models except for the logistic and Hubbert curves have an
additive or multiplicative parameter shown as @expr{a} in the above table
which can be replaced by zero or one, as appropriate, by typing @kbd{h}
before the model key.
@@ -24603,7 +24624,7 @@ to convert the model into this form. For example, if the model
is @expr{a + b x + c x^2}, then @expr{f(x) = 1}, @expr{g(x) = x},
and @expr{h(x) = x^2} are suitable functions.
-For other models, Calc uses a variety of algebraic manipulations
+For most other models, Calc uses a variety of algebraic manipulations
to try to put the problem into the form
@smallexample
@@ -24662,7 +24683,12 @@ The Gaussian model looks quite complicated, but a closer examination
shows that it's actually similar to the quadratic model but with an
exponential that can be brought to the top and moved into @expr{Y}.
-An example of a model that cannot be put into general linear
+The logistic models cannot be put into general linear form. For these
+models, and the Hubbert linearization, Calc computes a rough
+approximation for the parameters, then uses the Levenberg-Marquardt
+iterative method to refine the approximations.
+
+Another model that cannot be put into general linear
form is a Gaussian with a constant background added on, i.e.,
@expr{d} + the regular Gaussian formula. If you have a model like
this, 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
mode allows you to toggle between displaying the file as an image in
the Emacs buffer, and displaying its underlying text representation,
using the command @kbd{C-c C-c} (@code{image-toggle-display}). This
-works only when Emacs can display the specific image type.
+works only when Emacs can display the specific image type. If the
+displayed image is wider or taller than the frame, the usual point
+motion keys (@kbd{C-f}, @kbd{C-p}, and so forth) cause different parts
+of the image to be displayed.
@findex thumbs-mode
@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}.
@item Iff
``Iff'' means ``if and only if.'' This terminology comes from
-mathematics.
+mathematics. Try to avoid using this term in documentation, since
+many are unfamiliar with it and mistake it for a typo.
@item Inbox
An 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
that fetching will probably be slower. If this variable is @code{nil},
@code{nntp} will never split requests. The default is 5.
+@item nntp-xref-number-is-evil
+@vindex nntp-xref-number-is-evil
+When Gnus refers to an article having the @code{Message-ID} that a user
+specifies or having the @code{Message-ID} of the parent article of the
+current one (@pxref{Finding the Parent}), Gnus sends a @code{HEAD}
+command to the @acronym{NNTP} server to know where it is, and the server
+returns the data containing the pairs of a group and an article number
+in the @code{Xref} header. Gnus normally uses the article number to
+refer to the article if the data shows that that article is in the
+current group, while it uses the @code{Message-ID} otherwise. However,
+some news servers, e.g., ones running Diablo, run multiple engines
+having the same articles but article numbers are not kept synchronized
+between them. In that case, the article number that appears in the
+@code{Xref} header varies by which engine is chosen, so you cannot refer
+to the parent article that is in the current group, for instance. If
+you connect to such a server, set this variable to a non-@code{nil}
+value, and Gnus never uses article numbers. For example:
+
+@lisp
+(setq gnus-select-method
+ '(nntp "newszilla"
+ (nntp-address "newszilla.example.com")
+ (nntp-xref-number-is-evil t)
+ @dots{}))
+@end lisp
+
+The default value of this server variable is @code{nil}.
+
@item nntp-prepare-server-hook
@vindex nntp-prepare-server-hook
A hook run before attempting to connect to an @acronym{NNTP} server.
@@ -18595,23 +18623,23 @@ predicate to individual groups.
@table @code
@item short
-True iff the article is shorter than @code{gnus-agent-short-article}
+True if the article is shorter than @code{gnus-agent-short-article}
lines; default 100.
@item long
-True iff the article is longer than @code{gnus-agent-long-article}
+True if the article is longer than @code{gnus-agent-long-article}
lines; default 200.
@item low
-True iff the article has a download score less than
+True if the article has a download score less than
@code{gnus-agent-low-score}; default 0.
@item high
-True iff the article has a download score greater than
+True if the article has a download score greater than
@code{gnus-agent-high-score}; default 0.
@item spam
-True iff the Gnus Agent guesses that the article is spam. The
+True if the Gnus Agent guesses that the article is spam. The
heuristics may change over time, but at present it just computes a
checksum and sees whether articles match.
@@ -26651,7 +26679,7 @@ New @file{make.bat} for compiling and installing Gnus under MS Windows
Use @file{make.bat} if you want to install Gnus under MS Windows, the
first argument to the batch-program should be the directory where
-@file{xemacs.exe} respectively @file{emacs.exe} is located, iff you want
+@file{xemacs.exe} respectively @file{emacs.exe} is located, if you want
to install Gnus after compiling it, give @file{make.bat} @code{/copy} as
the second parameter.
@@ -27008,7 +27036,7 @@ The envelope sender address can be customized when using Sendmail.
@item
Gnus no longer generate the Sender: header automatically.
-Earlier it was generated iff the user configurable email address was
+Earlier it was generated when the user configurable email address was
different from the Gnus guessed default user address. As the guessing
algorithm is rarely correct these days, and (more controversially) the
only 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.
@item sieve-manage-capability
@findex sieve-manage-capability
-Return a list of capabilities the server support.
+Return a list of capabilities the server supports.
@item sieve-manage-listscripts
@findex sieve-manage-listscripts
@@ -315,7 +315,7 @@ List scripts on the server.
@item sieve-manage-havespace
@findex sieve-manage-havespace
-Returns non-@code{nil} iff server have roam for a script of given
+Return non-@code{nil} if the server has room for a script of given
size.
@item sieve-manage-getscript
diff --git a/src/ChangeLog b/src/ChangeLog
index b17ca2bcbcf..935db3c8a80 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,131 @@
+2007-08-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (update_frame_tool_bar): Use -1 as index
+ to gtk_toolbar_insert.
+
+2007-08-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * fileio.c (Finsert_file_contents): Yet Another Int/Lisp_Object Mixup.
+
+ * insdel.c (reset_var_on_error): New fun.
+ (signal_before_change, signal_after_change):
+ Use it to reset (after|before)-change-functions to nil in case of error.
+ Bind inhibit-modification-hooks to t.
+ Don't bind (after|before)-change-functions to nil while they run.
+
+2007-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * xterm.c (x_draw_image_glyph_string): Adjust stipple origin when
+ filling pixmap with stippled background.
+
+2007-08-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * macterm.c [TARGET_API_MAC_CARBON] (mac_handle_window_event):
+ Don't use invisible frame as parent window for repositioning.
+
+2007-08-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * print.c (new_backquote_output): Rename from old_backquote_output.
+ (print): Inverse its logic (according to its name) so as to match the
+ behavior of new_backquote_flag in lread.c.
+
+2007-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * gmalloc.c (posix_memalign): New function.
+
+ * macterm.c (frame_highlight, frame_unhighlight): Don't call
+ ActivateControl/DeactivateControl here.
+ [USE_MAC_TOOLBAR] (free_frame_tool_bar): Suppress animation when
+ frame-notice-user-settings is non-nil.
+ [USE_MAC_FONT_PANEL] (mac_handle_font_event): Also record parameter
+ for kEventParamFMFontStyle.
+ [TARGET_API_MAC_CARBON] (mac_handle_keyboard_event): Don't check
+ mac_pass_command_to_system and mac_pass_control_to_system here.
+ (XTread_socket): Call ActivateControl/DeactivateControl here.
+ (XTread_socket) [TARGET_API_MAC_CARBON]:
+ Check mac_pass_command_to_system and mac_pass_control_to_system here.
+ (mac_handle_window_event) [USE_MAC_TOOLBAR]: Add further workaround
+ for window repositioning.
+
+2007-08-08 Glenn Morris <rgm@gnu.org>
+
+ * Replace `iff' in doc-strings and comments.
+
+2007-08-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * xdisp.c (move_it_by_lines): Remove incorrect optimization.
+
+2007-08-07 Martin Rudalics <rudalics@gmx.at>
+
+ * fileio.c (Finsert_file_contents): Run format-decode and
+ after_insert_file_functions on entire buffer when REPLACE is
+ non-nil and inhibit modification_hooks and point_motion_hooks.
+ For consistency, run after_insert_file_functions iff something
+ got inserted. Move signal_after_change and update_compositions
+ after code running after_insert_file_functions. Make sure that
+ undo_list doesn't record intermediate steps of the decoding
+ process.
+
+2007-08-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * emacs.c (main)
+ [HAVE_GTK_AND_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
+ Call malloc_enable_thread on interactive startup.
+
+ * gmalloc.c (_malloc_thread_enabled_p) [USE_PTHREAD]: New variable.
+ (LOCK, UNLOCK, LOCK_ALIGNED_BLOCKS, UNLOCK_ALIGNED_BLOCKS)
+ [USE_PTHREAD]: Conditionalize with it.
+ (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
+ (malloc_atfork_handler_child, malloc_enable_thread) [USE_PTHREAD]:
+ New functions.
+
+2007-08-06 Chong Yidong <cyd@stupidchicken.com>
+
+ * xdisp.c (redisplay_window): When restoring original buffer
+ position, make sure it is still valid.
+
+ * image.c (png_load): Ignore png-supplied background color.
+
+2007-08-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * mac.c [TARGET_API_MAC_CARBON] (cfdate_to_lisp): Obtain microsec value.
+ Use kCFAbsoluteTimeIntervalSince1970.
+
+ * macmenu.c (quit_dialog_event_loop) [TARGET_API_MAC_CARBON]:
+ New variable.
+ [TARGET_API_MAC_CARBON] (mac_handle_dialog_event): Set it if dialog
+ event loop should be quit.
+ [TARGET_API_MAC_CARBON] (create_and_show_dialog) [!MAC_OSX]:
+ Quit dialog event loop if quit_dialog_event_loop is set.
+
+ * macselect.c [!TARGET_API_MAC_CARBON]: Include Scrap.h.
+ (Selection): New typedef. Use instead of ScrapRef.
+ (mac_get_selection_from_symbol): Rename from get_scrap_from_symbol.
+ (mac_valid_selection_target_p): Rename from valid_scrap_target_type_p.
+ (mac_clear_selection): Rename from clear_scrap.
+ (get_flavor_type_from_symbol): New argument SEL and subsume function of
+ scrap_has_target_type. All uses changed.
+ (mac_get_selection_ownership_info, mac_valid_selection_value_p)
+ (mac_selection_has_target_p): New functions.
+ (mac_put_selection_value): Rename from put_scrap_string.
+ (mac_get_selection_value): Rename from get_scrap_string.
+ (mac_get_selection_target_list): Rename from get_scrap_target_type_list.
+ (put_scrap_private_timestamp, scrap_has_target_type)
+ (get_scrap_private_timestamp): Remove functions.
+ (SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP): Remove define.
+ (x_own_selection, x_get_local_selection):
+ Use mac_valid_selection_value_p.
+ (x_own_selection): Don't use put_scrap_private_timestamp.
+ Record OWNERSHIP-INFO into Vselection_alist instead.
+ (x_get_local_selection): Don't check type if request is local.
+ (Fx_selection_owner_p): Don't use get_scrap_private_timestamp.
+ Detect ownership change with OWNERSHIP-INFO in Vselection_alist instead.
+
+2007-08-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (xg_tool_bar_callback): Generate two TOOL_BAR_EVENT:s,
+ add comment explaining why.
+
2007-08-03 Richard Stallman <rms@gnu.org>
* 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
Lisp_Object filename;
/* Dir for expanding relative file names. */
Lisp_Object directory;
- /* True iff this buffer has been backed up (if you write to the
+ /* True if this buffer has been backed up (if you write to the
visited file and it hasn't been backed up, then a backup will
be made). */
/* 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;
Lisp_Object Qbuffer_file_type;
#endif /* DOS_NT */
-/* True iff we are about to fork off a synchronous process or if we
+/* True if we are about to fork off a synchronous process or if we
are waiting for it. */
int synch_process_alive;
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 ();
static void shuffle ();
DEFUN ("case-table-p", Fcase_table_p, Scase_table_p, 1, 1, 0,
- doc: /* Return t iff OBJECT is a case table.
+ doc: /* Return t if OBJECT is a case table.
See `set-case-table' for more information on these data structures. */)
(object)
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 ()
doc: /* List of pair (cons) of categories to determine word boundary.
Emacs treats a sequence of word constituent characters as a single
-word (i.e. finds no word boundary between them) iff they belongs to
+word (i.e. finds no word boundary between them) only if they belong to
the same charset. But, exceptions are allowed in the following cases.
\(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)
#define CCL_LookupIntConstTbl 0x13 /* Lookup multibyte character by
integer key. Afterwards R7 set
- to 1 iff lookup succeeded.
+ to 1 if lookup succeeded.
1:ExtendedCOMMNDRrrRRRXXXXXXXX
2:ARGUMENT(Hash table ID) */
#define CCL_LookupCharConstTbl 0x14 /* Lookup integer by multibyte
character key. Afterwards R7 set
- to 1 iff lookup succeeded.
+ to 1 if lookup succeeded.
1:ExtendedCOMMNDRrrRRRrrrXXXXX
2:ARGUMENT(Hash table ID) */
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)
return 0;
}
-/* Return 1 iff character C has valid printable glyph.
+/* Return 1 if character C has valid printable glyph.
Use the macro CHAR_PRINTABLE_P instead. */
int
char_printable_p (c)
@@ -1102,8 +1102,8 @@ DIMENSION, CHARS, and FINAL-CHAR. */)
return CHARSET_SYMBOL (charset);
}
-/* If GENERICP is nonzero, return nonzero iff C is a valid normal or
- generic character. If GENERICP is zero, return nonzero iff C is a
+/* If GENERICP is nonzero, return nonzero if C is a valid normal or
+ generic character. If GENERICP is zero, return nonzero if C is a
valid normal character. Do not call this function directly,
instead use macro CHAR_VALID_P. */
int
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];
| ((c1) <= 0 ? 0 : (((c1) & 0x7F) << 7))))))
-/* If GENERICP is nonzero, return nonzero iff C is a valid normal or
- generic character. If GENERICP is zero, return nonzero iff C is a
+/* If GENERICP is nonzero, return nonzero if C is a valid normal or
+ generic character. If GENERICP is zero, return nonzero if C is a
valid normal character. */
#define CHAR_VALID_P(c, genericp) \
((c) >= 0 \
@@ -450,7 +450,7 @@ extern int width_by_char_head[256];
#define VALID_LEADING_CODE_P(code) \
(! NILP (CHARSET_TABLE_ENTRY (code)))
-/* Return 1 iff the byte sequence at unibyte string STR (LENGTH bytes)
+/* Return 1 if the byte sequence at unibyte string STR (LENGTH bytes)
is valid as a multibyte form. If valid, by a side effect, BYTES is
set to the byte length of the multibyte form. */
@@ -471,7 +471,7 @@ extern int width_by_char_head[256];
&& VALID_LEADING_CODE_P (str[1]))))))))
-/* Return 1 iff the byte sequence at multibyte string STR is valid as
+/* Return 1 if the byte sequence at multibyte string STR is valid as
a unibyte form. By a side effect, BYTES is set to the byte length
of one character at STR. */
@@ -499,7 +499,7 @@ extern int width_by_char_head[256];
c1 = CHAR_FIELD3 (c), \
c2 = -1)))
-/* Return 1 iff character C has valid printable glyph. */
+/* Return 1 if character C has valid printable glyph. */
#define CHAR_PRINTABLE_P(c) (ASCII_BYTE_P (c) || char_printable_p (c))
/* 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
eol-type is not consistent
through the file. */
-/* 1 iff composing. */
+/* 1 if composing. */
#define COMPOSING_P(coding) ((int) coding->composing > (int) COMPOSITION_NO)
#define COMPOSITION_DATA_SIZE 4080
@@ -372,7 +372,7 @@ struct coding_system
/* The current status of composition handling. */
int composing;
- /* 1 iff the next character is a composition rule. */
+ /* 1 if the next character is a composition rule. */
int composition_rule_follows;
/* 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 {
/* Temporary variable used only in the following macros. */
extern Lisp_Object composition_temp;
-/* Return 1 iff the composition is already registered. */
+/* Return 1 if the composition is already registered. */
#define COMPOSITION_REGISTERD_P(prop) INTEGERP (XCAR (prop))
/* Return ID number of the already registered composition. */
@@ -91,7 +91,7 @@ extern Lisp_Object composition_temp;
? COMPOSITION_WITH_ALTCHARS \
: COMPOSITION_WITH_RULE_ALTCHARS))))
-/* Return 1 iff the composition is valid. It is valid if length of
+/* Return 1 if the composition is valid. It is valid if length of
the composition equals to (END - START). */
#define COMPOSITION_VALID_P(start, end, prop) \
(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:
7. Size in bytes.
This is a floating point number if the size is too large for an integer.
8. File modes, as a string of ten letters or dashes as in ls -l.
- 9. t iff file's gid would change if file were deleted and recreated.
+ 9. t if file's gid would change if file were deleted and recreated.
10. inode number. If inode number is larger than the Emacs integer,
this is a cons cell containing two integers: first the high part,
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) */)
precision ::= '.' [0-9]*
If a field-width is specified, it specifies to which width
- the output should be padded with blanks, iff the output
+ the output should be padded with blanks, if the output
string is shorter than field-width.
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
setpgrp ();
#endif
#endif
+#if defined (HAVE_GTK_AND_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
+ {
+ extern void malloc_enable_thread P_ ((void));
+
+ malloc_enable_thread ();
+ }
+#endif
}
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)
}
-/* Return nonzero iff LIST is a non-nil atom or
+/* Return nonzero if LIST is a non-nil atom or
a list containing one of CONDITIONS. */
static 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,
1, 5, 0,
doc: /* Insert contents of file FILENAME after point.
Returns list of absolute file name and number of characters inserted.
-If second argument VISIT is non-nil, the buffer's visited filename
-and last save file modtime are set, and it is marked unmodified.
-If visiting and the file does not exist, visiting is completed
-before the error is signaled.
-The optional third and fourth arguments BEG and END
-specify what portion of the file to insert.
-These arguments count bytes in the file, not characters in the buffer.
-If VISIT is non-nil, BEG and END must be nil.
-
-If optional fifth argument REPLACE is non-nil,
-it means replace the current buffer contents (in the accessible portion)
-with the file contents. This is better than simply deleting and inserting
-the whole thing because (1) it preserves some marker positions
-and (2) it puts less data in the undo list.
-When REPLACE is non-nil, the value is the number of characters actually read,
-which is often less than the number of characters to be read.
-
-This does code conversion according to the value of
-`coding-system-for-read' or `file-coding-system-alist',
-and sets the variable `last-coding-system-used' to the coding system
-actually used. */)
+If second argument VISIT is non-nil, the buffer's visited filename and
+last save file modtime are set, and it is marked unmodified. If
+visiting and the file does not exist, visiting is completed before the
+error is signaled.
+
+The optional third and fourth arguments BEG and END specify what portion
+of the file to insert. These arguments count bytes in the file, not
+characters in the buffer. If VISIT is non-nil, BEG and END must be nil.
+
+If optional fifth argument REPLACE is non-nil, replace the current
+buffer contents (in the accessible portion) with the file contents.
+This is better than simply deleting and inserting the whole thing
+because (1) it preserves some marker positions and (2) it puts less data
+in the undo list. When REPLACE is non-nil, the second return value is
+the number of characters that replace previous buffer contents.
+
+This function does code conversion according to the value of
+`coding-system-for-read' or `file-coding-system-alist', and sets the
+variable `last-coding-system-used' to the coding system actually used. */)
(filename, visit, beg, end, replace)
Lisp_Object filename, visit, beg, end, replace;
{
@@ -3722,8 +3720,8 @@ actually used. */)
register int how_much;
register int unprocessed;
int count = SPECPDL_INDEX ();
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
- Lisp_Object handler, val, insval, orig_filename;
+ struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
+ Lisp_Object handler, val, insval, orig_filename, old_undo;
Lisp_Object p;
int total = 0;
int not_regular = 0;
@@ -3746,8 +3744,9 @@ actually used. */)
val = Qnil;
p = Qnil;
orig_filename = Qnil;
+ old_undo = Qnil;
- GCPRO4 (filename, val, p, orig_filename);
+ GCPRO5 (filename, val, p, orig_filename, old_undo);
CHECK_STRING (filename);
filename = Fexpand_file_name (filename, Qnil);
@@ -4706,24 +4705,103 @@ actually used. */)
/* Decode file format */
if (inserted > 0)
{
- int empty_undo_list_p = 0;
+ /* Don't run point motion or modification hooks when decoding. */
+ int count = SPECPDL_INDEX ();
+ specbind (Qinhibit_point_motion_hooks, Qt);
+ specbind (Qinhibit_modification_hooks, Qt);
+
+ /* Save old undo list and don't record undo for decoding. */
+ old_undo = current_buffer->undo_list;
+ current_buffer->undo_list = Qt;
- /* If we're anyway going to discard undo information, don't
- record it in the first place. The buffer's undo list at this
- point is either nil or t when visiting a file. */
- if (!NILP (visit))
+ if (NILP (replace))
{
- empty_undo_list_p = NILP (current_buffer->undo_list);
- current_buffer->undo_list = Qt;
+ insval = call3 (Qformat_decode,
+ Qnil, make_number (inserted), visit);
+ CHECK_NUMBER (insval);
+ inserted = XFASTINT (insval);
+ }
+ else
+ {
+ /* If REPLACE is non-nil and we succeeded in not replacing the
+ beginning or end of the buffer text with the file's contents,
+ call format-decode with `point' positioned at the beginning of
+ the buffer and `inserted' equalling the number of characters
+ in the buffer. Otherwise, format-decode might fail to
+ correctly analyze the beginning or end of the buffer. Hence
+ we temporarily save `point' and `inserted' here and restore
+ `point' iff format-decode did not insert or delete any text.
+ Otherwise we leave `point' at point-min. */
+ int opoint = PT;
+ int opoint_byte = PT_BYTE;
+ int oinserted = ZV - BEGV;
+
+ TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
+ insval = call3 (Qformat_decode,
+ Qnil, make_number (oinserted), visit);
+ CHECK_NUMBER (insval);
+ if (XINT (insval) == oinserted)
+ SET_PT_BOTH (opoint, opoint_byte);
+ inserted = XFASTINT (insval);
}
- insval = call3 (Qformat_decode,
- Qnil, make_number (inserted), visit);
- CHECK_NUMBER (insval);
- inserted = XFASTINT (insval);
+ /* For consistency with format-decode call these now iff inserted > 0
+ (martin 2007-06-28) */
+ p = Vafter_insert_file_functions;
+ while (CONSP (p))
+ {
+ if (NILP (replace))
+ {
+ insval = call1 (XCAR (p), make_number (inserted));
+ if (!NILP (insval))
+ {
+ CHECK_NUMBER (insval);
+ inserted = XFASTINT (insval);
+ }
+ }
+ else
+ {
+ /* For the rationale of this see the comment on format-decode above. */
+ int opoint = PT;
+ int opoint_byte = PT_BYTE;
+ int oinserted = ZV - BEGV;
+
+ TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
+ insval = call1 (XCAR (p), make_number (oinserted));
+ if (!NILP (insval))
+ {
+ CHECK_NUMBER (insval);
+ if (XINT (insval) == oinserted)
+ SET_PT_BOTH (opoint, opoint_byte);
+ inserted = XFASTINT (insval);
+ }
+ }
+
+ QUIT;
+ p = XCDR (p);
+ }
+
+ if (NILP (visit))
+ {
+ Lisp_Object lbeg, lend;
+ XSETINT (lbeg, PT);
+ XSETINT (lend, PT + inserted);
+ if (CONSP (old_undo))
+ {
+ Lisp_Object tem = XCAR (old_undo);
+ if (CONSP (tem) && INTEGERP (XCAR (tem)) &&
+ INTEGERP (XCDR (tem)) && EQ (XCAR (tem), lbeg))
+ /* In the non-visiting case record only the final insertion. */
+ current_buffer->undo_list =
+ Fcons (Fcons (lbeg, lend), Fcdr (old_undo));
+ }
+ }
+ else
+ /* If undo_list was Qt before, keep it that way.
+ Otherwise start with an empty undo_list. */
+ current_buffer->undo_list = EQ (old_undo, Qt) ? Qt : Qnil;
- if (!NILP (visit))
- current_buffer->undo_list = empty_undo_list_p ? Qnil : Qt;
+ unbind_to (count, Qnil);
}
/* Call after-change hooks for the inserted text, aside from the case
@@ -4736,19 +4814,6 @@ actually used. */)
update_compositions (PT, PT, CHECK_BORDER);
}
- p = Vafter_insert_file_functions;
- while (CONSP (p))
- {
- insval = call1 (XCAR (p), make_number (inserted));
- if (!NILP (insval))
- {
- CHECK_NUMBER (insval);
- inserted = XFASTINT (insval);
- }
- QUIT;
- p = XCDR (p);
- }
-
if (!NILP (visit)
&& current_buffer->modtime == -1)
{
@@ -5193,7 +5258,7 @@ This does code conversion according to the value of
* if we do writes that don't end with a carriage return. Furthermore
* it cannot handle writes of more then 16K. The modified
* version of "sys_write" in SYSDEP.C (see comment there) copes with
- * this EXCEPT for the last record (iff it doesn't end with a carriage
+ * this EXCEPT for the last record (if it doesn't end with a carriage
* return). This implies that if your buffer doesn't end with a carriage
* return, you get one free... tough. However it also means that if
* 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)
}
-/* Return 1 iff FACE is suitable for displaying character C.
+/* Return 1 if FACE is suitable for displaying character C.
Otherwise return 0. Called from the macro FACE_SUITABLE_FOR_CHAR_P
when C is not a single byte character.. */
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
/* Average width of glyphs in the font. */
int average_width;
- /* 1 iff `vertical-centering-font-regexp' matches this font name.
+ /* 1 if `vertical-centering-font-regexp' matches this font name.
In this case, we render characters at vartical center positions
of lines. */
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! */
#if !defined(HAVE_LIBKSTAT) && defined(LOAD_AVE_TYPE)
/* File descriptor open to /dev/kmem or VMS load ave driver. */
static int channel;
-/* Nonzero iff channel is valid. */
+/* Nonzero if channel is valid. */
static int getloadavg_initialized;
/* Offset in kmem to seek to read load average, or 0 means invalid. */
static 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));
#if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */
extern __ptr_t memalign PP ((__malloc_size_t __alignment,
__malloc_size_t __size));
+extern int posix_memalign PP ((__ptr_t *, __malloc_size_t,
+ __malloc_size_t size));
#endif
/* Allocate SIZE bytes on a page boundary. */
@@ -136,6 +138,10 @@ extern __ptr_t memalign PP ((__malloc_size_t __alignment,
extern __ptr_t valloc PP ((__malloc_size_t __size));
#endif
+#ifdef USE_PTHREAD
+/* Set up mutexes and make malloc etc. thread-safe. */
+extern void malloc_enable_thread PP ((void));
+#endif
#ifdef _MALLOC_INTERNAL
@@ -242,10 +248,27 @@ extern void _free_internal_nolock PP ((__ptr_t __ptr));
#ifdef USE_PTHREAD
extern pthread_mutex_t _malloc_mutex, _aligned_blocks_mutex;
-#define LOCK() pthread_mutex_lock (&_malloc_mutex)
-#define UNLOCK() pthread_mutex_unlock (&_malloc_mutex)
-#define LOCK_ALIGNED_BLOCKS() pthread_mutex_lock (&_aligned_blocks_mutex)
-#define UNLOCK_ALIGNED_BLOCKS() pthread_mutex_unlock (&_aligned_blocks_mutex)
+extern int _malloc_thread_enabled_p;
+#define LOCK() \
+ do { \
+ if (_malloc_thread_enabled_p) \
+ pthread_mutex_lock (&_malloc_mutex); \
+ } while (0)
+#define UNLOCK() \
+ do { \
+ if (_malloc_thread_enabled_p) \
+ pthread_mutex_unlock (&_malloc_mutex); \
+ } while (0)
+#define LOCK_ALIGNED_BLOCKS() \
+ do { \
+ if (_malloc_thread_enabled_p) \
+ pthread_mutex_lock (&_aligned_blocks_mutex); \
+ } while (0)
+#define UNLOCK_ALIGNED_BLOCKS() \
+ do { \
+ if (_malloc_thread_enabled_p) \
+ pthread_mutex_unlock (&_aligned_blocks_mutex); \
+ } while (0)
#else
#define LOCK()
#define UNLOCK()
@@ -563,6 +586,47 @@ register_heapinfo ()
#ifdef USE_PTHREAD
pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER;
+int _malloc_thread_enabled_p;
+
+static void
+malloc_atfork_handler_prepare ()
+{
+ LOCK ();
+ LOCK_ALIGNED_BLOCKS ();
+}
+
+static void
+malloc_atfork_handler_parent ()
+{
+ UNLOCK_ALIGNED_BLOCKS ();
+ UNLOCK ();
+}
+
+static void
+malloc_atfork_handler_child ()
+{
+ UNLOCK_ALIGNED_BLOCKS ();
+ UNLOCK ();
+}
+
+/* Set up mutexes and make malloc etc. thread-safe. */
+void
+malloc_enable_thread ()
+{
+ if (_malloc_thread_enabled_p)
+ return;
+
+ /* Some pthread implementations call malloc for statically
+ initialized mutexes when they are used first. To avoid such a
+ situation, we initialize mutexes here while their use is
+ disabled in malloc etc. */
+ pthread_mutex_init (&_malloc_mutex, NULL);
+ pthread_mutex_init (&_aligned_blocks_mutex, NULL);
+ pthread_atfork (malloc_atfork_handler_prepare,
+ malloc_atfork_handler_parent,
+ malloc_atfork_handler_child);
+ _malloc_thread_enabled_p = 1;
+}
#endif
static void
@@ -575,19 +639,6 @@ malloc_initialize_1 ()
if (__malloc_initialize_hook)
(*__malloc_initialize_hook) ();
- /* We don't use recursive mutex because pthread_mutexattr_init may
- call malloc internally. */
-#if 0 /* defined (USE_PTHREAD) */
- {
- pthread_mutexattr_t attr;
-
- pthread_mutexattr_init (&attr);
- pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init (&_malloc_mutex, &attr);
- pthread_mutexattr_destroy (&attr);
- }
-#endif
-
heapsize = HEAP / BLOCKSIZE;
_heapinfo = (malloc_info *) align (heapsize * sizeof (malloc_info));
if (_heapinfo == NULL)
@@ -1808,6 +1859,36 @@ memalign (alignment, size)
return result;
}
+#ifndef ENOMEM
+#define ENOMEM 12
+#endif
+
+#ifndef EINVAL
+#define EINVAL 22
+#endif
+
+int
+posix_memalign (memptr, alignment, size)
+ __ptr_t *memptr;
+ __malloc_size_t alignment;
+ __malloc_size_t size;
+{
+ __ptr_t mem;
+
+ if (alignment == 0
+ || alignment % sizeof (__ptr_t) != 0
+ || (alignment & (alignment - 1)) != 0)
+ return EINVAL;
+
+ mem = memalign (alignment, size);
+ if (mem == NULL)
+ return ENOMEM;
+
+ *memptr = mem;
+
+ return 0;
+}
+
#endif /* Not DJGPP v1 */
/* Allocate memory on a page boundary.
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)
key = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_KEY);
XSETFRAME (frame, f);
+
+ /* We generate two events here. The first one is to set the prefix
+ to `(tool_bar)', see keyboard.c. */
event.kind = TOOL_BAR_EVENT;
event.frame_or_window = frame;
+ event.arg = frame;
+ kbd_buffer_store_event (&event);
+
+ event.kind = TOOL_BAR_EVENT;
+ event.frame_or_window = frame;
event.arg = key;
/* Convert between the modifier bits GDK uses and the modifier bits
Emacs uses. This assumes GDK an X masks are the same, which they are when
@@ -3794,7 +3802,7 @@ update_frame_tool_bar (f)
gtk_container_add (GTK_CONTAINER (weventbox), wbutton);
ti = gtk_tool_item_new ();
gtk_container_add (GTK_CONTAINER (ti), weventbox);
- gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i);
+ gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, -1);
}
continue;
}
@@ -3811,7 +3819,7 @@ update_frame_tool_bar (f)
gtk_container_add (GTK_CONTAINER (weventbox), wbutton);
ti = gtk_tool_item_new ();
gtk_container_add (GTK_CONTAINER (ti), weventbox);
- gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i);
+ gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, -1);
/* 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)
struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
int i = hash % IMAGE_CACHE_BUCKETS_SIZE;
+ if (!c) return NULL;
+
/* If the image spec does not specify a background color, the cached
image must have the same background color as the current frame.
The foreground color must also match, for the sake of monochrome
@@ -1655,13 +1657,10 @@ search_image_cache (f, spec, hash)
for formats that don't use transparency (such as jpeg), or if the
image spec specifies :background. However, the extra memory
usage is probably negligible in practice, so we don't bother. */
- if (!c) return NULL;
for (img = c->buckets[i]; img; img = img->next)
if (img->hash == hash
&& !NILP (Fequal (img->spec, spec))
- /* If the image spec specifies a background, it doesn't matter
- what the frame background is. */
&& img->frame_foreground == FRAME_FOREGROUND_PIXEL (f)
&& img->frame_background == FRAME_BACKGROUND_PIXEL (f))
break;
@@ -6362,11 +6361,14 @@ png_load (f, img)
PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
}
}
+ /* The commented-out code checked if the png specifies a default
+ background color, and uses that. Since we use the current
+ frame background, it is OK for us to ignore this.
+
else if (fn_png_get_bKGD (png_ptr, info_ptr, &image_bg))
- /* Image contains a background color with which to
- combine the image. */
fn_png_set_background (png_ptr, image_bg,
PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
+ */
else
{
/* 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)
return 0;
}
-/* Return true iff the display table DISPTAB specifies the same widths
+/* Return true if the display table DISPTAB specifies the same widths
for characters as WIDTHTAB. We use this to decide when to
invalidate the buffer's width_run_cache. */
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;
/* Functions for dealing with the column cache. */
-/* Return true iff the display table DISPTAB specifies the same widths
+/* Return true if the display table DISPTAB specifies the same widths
for characters as WIDTHTAB. We use this to decide when to
invalidate the buffer's column_cache. */
int 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)
#define FETCH_END \
(! NILP (end_marker) ? Fmarker_position (end_marker) : end)
+/* Set a variable to nil if an error occurred.
+ VAL is a cons-cell whose car is the variable name, and whose cdr is
+ either nil (to mean that there was indeed an error), or non-nil to mean
+ that the was no error (which thus causes this function to do
+ nothing). */
+Lisp_Object
+reset_var_on_error (val)
+ Lisp_Object val;
+{
+ if (NILP (XCDR (val)))
+ Fset (XCAR (val), Qnil);
+ return Qnil;
+}
+
/* Signal a change to the buffer immediately before it happens.
START_INT and END_INT are the bounds of the text to be changed.
@@ -2152,6 +2166,7 @@ signal_before_change (start_int, end_int, preserve_ptr)
Lisp_Object start_marker, end_marker;
Lisp_Object preserve_marker;
struct gcpro gcpro1, gcpro2, gcpro3;
+ int count = SPECPDL_INDEX ();
if (inhibit_modification_hooks)
return;
@@ -2163,6 +2178,8 @@ signal_before_change (start_int, end_int, preserve_ptr)
end_marker = Qnil;
GCPRO3 (preserve_marker, start_marker, end_marker);
+ specbind (Qinhibit_modification_hooks, Qt);
+
/* If buffer is unmodified, run a special hook for that case. */
if (SAVE_MODIFF >= MODIFF
&& !NILP (Vfirst_change_hook)
@@ -2177,46 +2194,22 @@ signal_before_change (start_int, end_int, preserve_ptr)
if (!NILP (Vbefore_change_functions))
{
Lisp_Object args[3];
- Lisp_Object before_change_functions;
- Lisp_Object after_change_functions;
- struct gcpro gcpro1, gcpro2;
- struct buffer *old = current_buffer;
- struct buffer *new;
+ Lisp_Object rvoe_arg = Fcons (Qbefore_change_functions, Qnil);
PRESERVE_VALUE;
PRESERVE_START_END;
- /* "Bind" before-change-functions and after-change-functions
- to nil--but in a way that errors don't know about.
- That way, if there's an error in them, they will stay nil. */
- before_change_functions = Vbefore_change_functions;
- after_change_functions = Vafter_change_functions;
- Vbefore_change_functions = Qnil;
- Vafter_change_functions = Qnil;
- GCPRO2 (before_change_functions, after_change_functions);
+ /* Mark before-change-functions to be reset to nil in case of error. */
+ record_unwind_protect (reset_var_on_error, rvoe_arg);
/* Actually run the hook functions. */
args[0] = Qbefore_change_functions;
args[1] = FETCH_START;
args[2] = FETCH_END;
- run_hook_list_with_args (before_change_functions, 3, args);
+ Frun_hook_with_args (3, args);
- /* "Unbind" the variables we "bound" to nil. Beware a
- buffer-local hook which changes the buffer when run (e.g. W3). */
- if (old != current_buffer)
- {
- new = current_buffer;
- set_buffer_internal (old);
- Vbefore_change_functions = before_change_functions;
- Vafter_change_functions = after_change_functions;
- set_buffer_internal (new);
- }
- else
- {
- Vbefore_change_functions = before_change_functions;
- Vafter_change_functions = after_change_functions;
- }
- UNGCPRO;
+ /* There was no error: unarm the reset_on_error. */
+ XSETCDR (rvoe_arg, Qt);
}
if (current_buffer->overlays_before || current_buffer->overlays_after)
@@ -2232,6 +2225,8 @@ signal_before_change (start_int, end_int, preserve_ptr)
free_marker (end_marker);
RESTORE_VALUE;
UNGCPRO;
+
+ unbind_to (count, Qnil);
}
/* Signal a change immediately after it happens.
@@ -2245,6 +2240,7 @@ void
signal_after_change (charpos, lendel, lenins)
int charpos, lendel, lenins;
{
+ int count = SPECPDL_INDEX ();
if (inhibit_modification_hooks)
return;
@@ -2275,48 +2271,25 @@ signal_after_change (charpos, lendel, lenins)
if (!NILP (combine_after_change_list))
Fcombine_after_change_execute ();
+ specbind (Qinhibit_modification_hooks, Qt);
+
if (!NILP (Vafter_change_functions))
{
Lisp_Object args[4];
- Lisp_Object before_change_functions;
- Lisp_Object after_change_functions;
- struct buffer *old = current_buffer;
- struct buffer *new;
- struct gcpro gcpro1, gcpro2;
-
- /* "Bind" before-change-functions and after-change-functions
- to nil--but in a way that errors don't know about.
- That way, if there's an error in them, they will stay nil. */
- before_change_functions = Vbefore_change_functions;
- after_change_functions = Vafter_change_functions;
- Vbefore_change_functions = Qnil;
- Vafter_change_functions = Qnil;
- GCPRO2 (before_change_functions, after_change_functions);
+ Lisp_Object rvoe_arg = Fcons (Qafter_change_functions, Qnil);
+
+ /* Mark after-change-functions to be reset to nil in case of error. */
+ record_unwind_protect (reset_var_on_error, rvoe_arg);
/* Actually run the hook functions. */
args[0] = Qafter_change_functions;
XSETFASTINT (args[1], charpos);
XSETFASTINT (args[2], charpos + lenins);
XSETFASTINT (args[3], lendel);
- run_hook_list_with_args (after_change_functions,
- 4, args);
+ Frun_hook_with_args (4, args);
- /* "Unbind" the variables we "bound" to nil. Beware a
- buffer-local hook which changes the buffer when run (e.g. W3). */
- if (old != current_buffer)
- {
- new = current_buffer;
- set_buffer_internal (old);
- Vbefore_change_functions = before_change_functions;
- Vafter_change_functions = after_change_functions;
- set_buffer_internal (new);
- }
- else
- {
- Vbefore_change_functions = before_change_functions;
- Vafter_change_functions = after_change_functions;
- }
- UNGCPRO;
+ /* There was no error: unarm the reset_on_error. */
+ XSETCDR (rvoe_arg, Qt);
}
if (current_buffer->overlays_before || current_buffer->overlays_after)
@@ -2332,6 +2305,8 @@ signal_after_change (charpos, lendel, lenins)
if (lendel == 0)
report_interval_modification (make_number (charpos),
make_number (charpos + lenins));
+
+ unbind_to (count, Qnil);
}
Lisp_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)
temp_set_point_both (buffer, charpos, bytepos);
- /* We run point-left and point-entered hooks here, iff the
+ /* We run point-left and point-entered hooks here, if the
two intervals are not equivalent. These hooks take
(old_point, new_point) as arguments. */
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;
/* The above pair of variables forms a "queue empty" flag. When we
enqueue a non-hook event, we increment kbd_store_ptr. When we
dequeue a non-hook event, we increment kbd_fetch_ptr. We say that
- there is input available iff the two pointers are not equal.
+ there is input available if the two pointers are not equal.
Why not just have a flag set and cleared by the enqueuing and
dequeuing functions? Such a flag could be screwed up by interrupts
@@ -3703,7 +3703,7 @@ restore_getcjmp (temp)
kbd_buffer_store_event places events in kbd_buffer, and
kbd_buffer_get_event retrieves them. */
-/* Return true iff there are any events in the queue that read-char
+/* Return true if there are any events in the queue that read-char
would return. If this returns false, a read-char would block. */
static int
readable_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;
/* Macros for dealing with lispy events. */
-/* True iff EVENT has data fields describing it (i.e. a mouse click). */
+/* True if EVENT has data fields describing it (i.e. a mouse click). */
#define EVENT_HAS_PARAMETERS(event) (CONSP (event))
/* 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. */);
DEFVAR_LISP ("minor-mode-map-alist", &Vminor_mode_map_alist,
doc: /* Alist of keymaps to use for minor modes.
Each element looks like (VARIABLE . KEYMAP); KEYMAP is used to read
-key sequences and look up bindings iff VARIABLE's value is non-nil.
+key sequences and look up bindings if VARIABLE's value is non-nil.
If two active keymaps bind the same key, the keymap appearing earlier
in the list takes precedence. */);
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;
#define GLYPH_CHAR(f, g) (FAST_GLYPH_CHAR (g))
#define GLYPH_FACE(f, g) (FAST_GLYPH_FACE (g))
-/* Return 1 iff GLYPH contains valid character code. */
+/* Return 1 if GLYPH contains valid character code. */
#define GLYPH_CHAR_VALID_P(glyph) CHAR_VALID_P (FAST_GLYPH_CHAR (glyph), 1)
/* The ID of the mode line highlighting face. */
@@ -1591,7 +1591,7 @@ typedef unsigned char UCHAR;
"dead", which is what we want; this is an argument-checking macro, and
the user should never get access to interior windows.
- A window of any sort, leaf or interior, is dead iff the buffer,
+ A window of any sort, leaf or interior, is dead if the buffer,
vchild, and hchild members are all nil. */
#define CHECK_LIVE_WINDOW(x) \
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 */
extern Lisp_Object Qevent_symbol_element_mask;
extern Lisp_Object Qfile_exists_p;
-/* non-zero iff inside `load' */
+/* non-zero if inside `load' */
int load_in_progress;
/* Directory in which the sources were found. */
@@ -1128,7 +1128,7 @@ in which case file-name-handlers are ignored. */)
On success, returns a file descriptor. On failure, returns -1.
SUFFIXES is a list of strings containing possible suffixes.
- The empty suffix is automatically added iff the list is empty.
+ The empty suffix is automatically added if the list is empty.
PREDICATE non-nil means don't open the files,
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. */);
Vload_file_rep_suffixes = Fcons (empty_unibyte_string, Qnil);
DEFVAR_BOOL ("load-in-progress", &load_in_progress,
- doc: /* Non-nil iff inside of `load'. */);
+ doc: /* Non-nil if inside of `load'. */);
DEFVAR_LISP ("after-load-alist", &Vafter_load_alist,
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. */
/* # define SHORTNAMES */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="bsd4-3" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="bsd4-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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
on OSF 4/5 -- fx. */
#endif
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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
compiler is so brain damaged that it is not even worth trying to use it.
*/
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
#define BITS_PER_LONG 64
#define BITS_PER_EMACS_INT 64
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="bsd4-3" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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,
Boston, MA 02110-1301, USA. */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="bsd4-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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,
Boston, MA 02110-1301, USA. */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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,
Boston, MA 02110-1301, USA. */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="bsd4-3" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-3" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-3" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
/* #define ncl_el /* DPX/2 210,220 etc */
/* #define ncl_mr 1 /* DPX/2 320,340 (and 360,380 ?) */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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)
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
/* This file was modified by Matt Crawford <matt@tank.uchicago.edu>
to work under Elxsi's 12.0 release of BSD unix. */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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)
A site running a pre-release of 2.1 should #define RELEASE2_1 in config.h.
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="hpux" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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 */
/* #define HPUX_5 */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
#define BITS_PER_LONG 64
#define BITS_PER_EMACS_INT 64
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
#undef INTEL386
#undef aix386
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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
work with certain new X window managers, and may be suboptimal.
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="aix3-1" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="bsd4-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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 */
#define BITS_PER_LONG 64
#define BITS_PER_EMACS_INT 64
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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)
Minor changes merged in 19.1.
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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,
Boston, MA 02110-1301, USA. */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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 */
(copy-file), it would say that it is non-critical...
#endif /* 0 */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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 */
#define ISI68K
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
the size of various data types. */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="rtu" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="bsd4-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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
your work; we'd like to distribute this information.
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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!
With this the file mips-siemens.h is obsolete.
NOTE-END */
-/* Define BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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.
Note that the proper m file for the Decstation is pmax.h.
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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 */
#define m68000
#endif
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
#define NeXT
#endif
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
/* 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'.
Use `-machine=ns16000' for both.
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="bsd4-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="bsd4-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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,
Boston, MA 02110-1301, USA. */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="darwin" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
USUAL-OPSYS="Solaris2.5.1 Windows/NT AIX 4.1.2"
*/
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="bsd4-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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 */
/* NOTE: this file works for DYNIX release 2.0
(not tested on 1.3) on NS32000's */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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
-opsystem=bsd4-2 for earlier versions.
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="hpux" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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;
problems caused by bugs in the "export" version of SunOS 4.
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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;
problems caused by bugs in the "export" version of SunOS 4.
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-3" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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
Berkeley you are running.
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="bsd4-3" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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,
Boston, MA 02110-1301, USA. */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-3" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-3" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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)
NOTE-END */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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. */
operating system this machine is likely to run.
USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
-/* Define BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
/* #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. */
operating system this machine is likely to run.
USUAL-OPSYS="usg5-2" */
-/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
#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
cfdate_to_lisp (date)
CFDateRef date;
{
- static const CFGregorianDate epoch_gdate = {1970, 1, 1, 0, 0, 0.0};
- static CFAbsoluteTime epoch = 0.0, sec;
- int high, low;
+ CFTimeInterval sec;
+ int high, low, microsec;
- if (epoch == 0.0)
- epoch = CFGregorianDateGetAbsoluteTime (epoch_gdate, NULL);
-
- sec = CFDateGetAbsoluteTime (date) - epoch;
+ sec = CFDateGetAbsoluteTime (date) + kCFAbsoluteTimeIntervalSince1970;
high = sec / 65536.0;
low = sec - high * 65536.0;
+ microsec = (sec - floor (sec)) * 1000000.0;
- return list3 (make_number (high), make_number (low), make_number (0));
+ return list3 (make_number (high), make_number (low), make_number (microsec));
}
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)
((value) + DIALOG_BUTTON_COMMAND_ID_OFFSET)
extern EMACS_TIME timer_check P_ ((int));
+static int quit_dialog_event_loop;
static pascal OSStatus
mac_handle_dialog_event (next_handler, event, data)
@@ -2340,7 +2341,6 @@ mac_handle_dialog_event (next_handler, event, data)
{
OSStatus err, result = eventNotHandledErr;
WindowRef window = (WindowRef) data;
- int quit_event_loop_p = 0;
switch (GetEventClass (event))
{
@@ -2355,7 +2355,7 @@ mac_handle_dialog_event (next_handler, event, data)
if (DIALOG_BUTTON_COMMAND_ID_P (command.commandID))
{
SetWRefCon (window, command.commandID);
- quit_event_loop_p = 1;
+ quit_dialog_event_loop = 1;
break;
}
@@ -2379,7 +2379,7 @@ mac_handle_dialog_event (next_handler, event, data)
switch (char_code)
{
case kEscapeCharCode:
- quit_event_loop_p = 1;
+ quit_dialog_event_loop = 1;
break;
default:
@@ -2395,7 +2395,7 @@ mac_handle_dialog_event (next_handler, event, data)
NULL, &key_code);
if (err == noErr)
if (mac_quit_char_key_p (modifiers, key_code))
- quit_event_loop_p = 1;
+ quit_dialog_event_loop = 1;
}
break;
}
@@ -2406,7 +2406,7 @@ mac_handle_dialog_event (next_handler, event, data)
abort ();
}
- if (quit_event_loop_p)
+ if (quit_dialog_event_loop)
{
err = QuitEventLoop (GetCurrentEventLoop ());
if (err == noErr)
@@ -2733,6 +2733,7 @@ create_and_show_dialog (f, first_wv)
{
EventTargetRef toolbox_dispatcher = GetEventDispatcherTarget ();
+ quit_dialog_event_loop = 0;
while (1)
{
EMACS_TIME next_time = timer_check (1);
@@ -2758,12 +2759,22 @@ create_and_show_dialog (f, first_wv)
SendEventToEventTarget (event, toolbox_dispatcher);
ReleaseEvent (event);
}
+#ifdef MAC_OSX
else if (err != eventLoopTimedOutErr)
{
if (err == eventLoopQuitErr)
err = noErr;
break;
}
+#else
+ /* The return value of ReceiveNextEvent seems to be
+ unreliable. Use our own global variable instead. */
+ if (quit_dialog_event_loop)
+ {
+ err = noErr;
+ break;
+ }
+#endif
}
}
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. */
#include "blockinput.h"
#include "keymap.h"
-#if !TARGET_API_MAC_CARBON
+#if TARGET_API_MAC_CARBON
+typedef ScrapRef Selection;
+#else /* !TARGET_API_MAC_CARBON */
+#include <Scrap.h>
#include <Endian.h>
-typedef int ScrapRef;
-typedef ResType ScrapFlavorType;
+typedef int Selection;
#endif /* !TARGET_API_MAC_CARBON */
-static OSStatus get_scrap_from_symbol P_ ((Lisp_Object, int, ScrapRef *));
-static ScrapFlavorType get_flavor_type_from_symbol P_ ((Lisp_Object));
-static int valid_scrap_target_type_p P_ ((Lisp_Object));
-static OSStatus clear_scrap P_ ((ScrapRef *));
-static OSStatus put_scrap_string P_ ((ScrapRef, Lisp_Object, Lisp_Object));
-static OSStatus put_scrap_private_timestamp P_ ((ScrapRef, unsigned long));
-static ScrapFlavorType scrap_has_target_type P_ ((ScrapRef, Lisp_Object));
-static Lisp_Object get_scrap_string P_ ((ScrapRef, Lisp_Object));
-static OSStatus get_scrap_private_timestamp P_ ((ScrapRef, unsigned long *));
-static Lisp_Object get_scrap_target_type_list P_ ((ScrapRef));
+static OSStatus mac_get_selection_from_symbol P_ ((Lisp_Object, int,
+ Selection *));
+static ScrapFlavorType get_flavor_type_from_symbol P_ ((Lisp_Object,
+ Selection));
+static int mac_valid_selection_target_p P_ ((Lisp_Object));
+static OSStatus mac_clear_selection P_ ((Selection *));
+static Lisp_Object mac_get_selection_ownership_info P_ ((Selection));
+static int mac_valid_selection_value_p P_ ((Lisp_Object, Lisp_Object));
+static OSStatus mac_put_selection_value P_ ((Selection, Lisp_Object,
+ Lisp_Object));
+static int mac_selection_has_target_p P_ ((Selection, Lisp_Object));
+static Lisp_Object mac_get_selection_value P_ ((Selection, Lisp_Object));
+static Lisp_Object mac_get_selection_target_list P_ ((Selection));
static void x_own_selection P_ ((Lisp_Object, Lisp_Object));
static Lisp_Object x_get_local_selection P_ ((Lisp_Object, Lisp_Object, int));
static Lisp_Object x_get_foreign_selection P_ ((Lisp_Object,
@@ -56,7 +61,7 @@ void init_service_handler P_ ((void));
Lisp_Object QPRIMARY, QSECONDARY, QTIMESTAMP, QTARGETS;
static Lisp_Object Vx_lost_selection_functions;
-/* Coding system for communicating with other programs via scrap. */
+/* Coding system for communicating with other programs via selections. */
static Lisp_Object Vselection_coding_system;
/* Coding system for the next communicating with other programs. */
@@ -70,23 +75,24 @@ static Lisp_Object Qforeign_selection;
extern unsigned long last_event_timestamp;
/* This is an association list whose elements are of the form
- ( SELECTION-NAME SELECTION-VALUE SELECTION-TIMESTAMP FRAME)
+ ( SELECTION-NAME SELECTION-VALUE SELECTION-TIMESTAMP FRAME OWNERSHIP-INFO)
SELECTION-NAME is a lisp symbol.
SELECTION-VALUE is the value that emacs owns for that selection.
It may be any kind of Lisp object.
SELECTION-TIMESTAMP is the time at which emacs began owning this selection,
as a cons of two 16-bit numbers (making a 32 bit time.)
FRAME is the frame for which we made the selection.
- If there is an entry in this alist, and the data for the flavor
- type SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP in the corresponding scrap
- (if exists) coincides with SELECTION-TIMESTAMP, then it can be
- assumed that Emacs owns that selection.
+ OWNERSHIP-INFO is a value saved when emacs owns for that selection.
+ If another application takes the ownership of that selection
+ later, then newly examined ownership info value should be
+ different from the saved one.
+ If there is an entry in this alist, the current ownership info for
+ the selection coincides with OWNERSHIP-INFO, then it can be
+ assumed that Emacs owns that selection.
The only (eq) parts of this list that are visible from Lisp are the
selection-values. */
static Lisp_Object Vselection_alist;
-#define SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP 'Etsp'
-
/* This is an alist whose CARs are selection-types and whose CDRs are
the names of Lisp functions to call to convert the given Emacs
selection value to a string representing the given selection type.
@@ -104,21 +110,22 @@ static Lisp_Object Qmac_scrap_name, Qmac_ostype;
static Lisp_Object Vmac_service_selection;
#endif
-/* Get a reference to the scrap corresponding to the symbol SYM. The
- reference is set to *SCRAP, and it becomes NULL if there's no
- corresponding scrap. Clear the scrap if CLEAR_P is non-zero. */
+/* Get a reference to the selection corresponding to the symbol SYM.
+ The reference is set to *SEL, and it becomes NULL if there's no
+ corresponding selection. Clear the selection if CLEAR_P is
+ non-zero. */
static OSStatus
-get_scrap_from_symbol (sym, clear_p, scrap)
+mac_get_selection_from_symbol (sym, clear_p, sel)
Lisp_Object sym;
int clear_p;
- ScrapRef *scrap;
+ Selection *sel;
{
OSStatus err = noErr;
Lisp_Object str = Fget (sym, Qmac_scrap_name);
if (!STRINGP (str))
- *scrap = NULL;
+ *sel = NULL;
else
{
#if TARGET_API_MAC_CARBON
@@ -127,19 +134,19 @@ get_scrap_from_symbol (sym, clear_p, scrap)
OptionBits options = (clear_p ? kScrapClearNamedScrap
: kScrapGetNamedScrap);
- err = GetScrapByName (scrap_name, options, scrap);
+ err = GetScrapByName (scrap_name, options, sel);
CFRelease (scrap_name);
#else /* !MAC_OSX */
if (clear_p)
err = ClearCurrentScrap ();
if (err == noErr)
- err = GetCurrentScrap (scrap);
+ err = GetCurrentScrap (sel);
#endif /* !MAC_OSX */
#else /* !TARGET_API_MAC_CARBON */
if (clear_p)
err = ZeroScrap ();
if (err == noErr)
- *scrap = 1;
+ *sel = 1;
#endif /* !TARGET_API_MAC_CARBON */
}
@@ -147,138 +154,154 @@ get_scrap_from_symbol (sym, clear_p, scrap)
}
/* Get a scrap flavor type from the symbol SYM. Return 0 if no
- corresponding flavor type. */
+ corresponding flavor type. If SEL is non-zero, the return value is
+ non-zero only when the SEL has the flavor type. */
static ScrapFlavorType
-get_flavor_type_from_symbol (sym)
+get_flavor_type_from_symbol (sym, sel)
Lisp_Object sym;
+ Selection sel;
{
Lisp_Object str = Fget (sym, Qmac_ostype);
+ ScrapFlavorType flavor_type;
if (STRINGP (str) && SBYTES (str) == 4)
- return EndianU32_BtoN (*((UInt32 *) SDATA (str)));
+ flavor_type = EndianU32_BtoN (*((UInt32 *) SDATA (str)));
+ else
+ flavor_type = 0;
+
+ if (flavor_type && sel)
+ {
+#if TARGET_API_MAC_CARBON
+ OSStatus err;
+ ScrapFlavorFlags flags;
- return 0;
+ err = GetScrapFlavorFlags (sel, flavor_type, &flags);
+ if (err != noErr)
+ flavor_type = 0;
+#else /* !TARGET_API_MAC_CARBON */
+ SInt32 size, offset;
+
+ size = GetScrap (NULL, flavor_type, &offset);
+ if (size < 0)
+ flavor_type = 0;
+#endif /* !TARGET_API_MAC_CARBON */
+ }
+
+ return flavor_type;
}
-/* Check if the symbol SYM has a corresponding scrap flavor type. */
+/* Check if the symbol SYM has a corresponding selection target type. */
static int
-valid_scrap_target_type_p (sym)
+mac_valid_selection_target_p (sym)
Lisp_Object sym;
{
- return get_flavor_type_from_symbol (sym) != 0;
+ return get_flavor_type_from_symbol (sym, 0) != 0;
}
-/* Clear the scrap whose reference is *SCRAP. */
+/* Clear the selection whose reference is *SEL. */
-static INLINE OSStatus
-clear_scrap (scrap)
- ScrapRef *scrap;
+static OSStatus
+mac_clear_selection (sel)
+ Selection *sel;
{
#if TARGET_API_MAC_CARBON
#ifdef MAC_OSX
- return ClearScrap (scrap);
+ return ClearScrap (sel);
#else
- return ClearCurrentScrap ();
+ OSStatus err;
+
+ err = ClearCurrentScrap ();
+ if (err == noErr)
+ err = GetCurrentScrap (sel);
+ return err;
#endif
#else /* !TARGET_API_MAC_CARBON */
return ZeroScrap ();
#endif /* !TARGET_API_MAC_CARBON */
}
-/* Put Lisp String STR to the scrap SCRAP. The target type is
- specified by TYPE. */
+/* Get ownership information for SEL. Emacs can detect a change of
+ the ownership by comparing saved and current values of the
+ ownership information. */
-static OSStatus
-put_scrap_string (scrap, type, str)
- ScrapRef scrap;
- Lisp_Object type, str;
+static Lisp_Object
+mac_get_selection_ownership_info (sel)
+ Selection sel;
{
- ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type);
-
- if (flavor_type == 0)
- return noTypeErr;
-
#if TARGET_API_MAC_CARBON
- return PutScrapFlavor (scrap, flavor_type, kScrapFlavorMaskNone,
- SBYTES (str), SDATA (str));
+ return long_to_cons ((unsigned long) sel);
#else /* !TARGET_API_MAC_CARBON */
- return PutScrap (SBYTES (str), flavor_type, SDATA (str));
+ ScrapStuffPtr scrap_info = InfoScrap ();
+
+ return make_number (scrap_info->scrapCount);
#endif /* !TARGET_API_MAC_CARBON */
}
-/* Put TIMESTAMP to the scrap SCRAP. The timestamp is used for
- checking if the scrap is owned by the process. */
+/* Return non-zero if VALUE is a valid selection value for TARGET. */
-static INLINE OSStatus
-put_scrap_private_timestamp (scrap, timestamp)
- ScrapRef scrap;
- unsigned long timestamp;
+static int
+mac_valid_selection_value_p (value, target)
+ Lisp_Object value, target;
{
-#if TARGET_API_MAC_CARBON
- return PutScrapFlavor (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
- kScrapFlavorMaskSenderOnly,
- sizeof (timestamp), &timestamp);
-#else /* !TARGET_API_MAC_CARBON */
- return PutScrap (sizeof (timestamp), SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
- &timestamp);
-#endif /* !TARGET_API_MAC_CARBON */
+ return STRINGP (value);
}
-/* Check if data for the target type TYPE is available in SCRAP. */
+/* Put Lisp Object VALUE to the selection SEL. The target type is
+ specified by TARGET. */
-static ScrapFlavorType
-scrap_has_target_type (scrap, type)
- ScrapRef scrap;
- Lisp_Object type;
+static OSStatus
+mac_put_selection_value (sel, target, value)
+ Selection sel;
+ Lisp_Object target, value;
{
- OSStatus err;
- ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type);
+ ScrapFlavorType flavor_type = get_flavor_type_from_symbol (target, 0);
- if (flavor_type)
- {
-#if TARGET_API_MAC_CARBON
- ScrapFlavorFlags flags;
+ if (flavor_type == 0 || !STRINGP (value))
+ return noTypeErr;
- err = GetScrapFlavorFlags (scrap, flavor_type, &flags);
- if (err != noErr)
- flavor_type = 0;
+#if TARGET_API_MAC_CARBON
+ return PutScrapFlavor (sel, flavor_type, kScrapFlavorMaskNone,
+ SBYTES (value), SDATA (value));
#else /* !TARGET_API_MAC_CARBON */
- SInt32 size, offset;
-
- size = GetScrap (NULL, flavor_type, &offset);
- if (size < 0)
- flavor_type = 0;
+ return PutScrap (SBYTES (value), flavor_type, SDATA (value));
#endif /* !TARGET_API_MAC_CARBON */
- }
+}
- return flavor_type;
+/* Check if data for the target type TARGET is available in SEL. */
+
+static int
+mac_selection_has_target_p (sel, target)
+ Selection sel;
+ Lisp_Object target;
+{
+ return get_flavor_type_from_symbol (target, sel) != 0;
}
-/* Get data for the target type TYPE from SCRAP and create a Lisp
+/* Get data for the target type TARGET from SEL and create a Lisp
string. Return nil if failed to get data. */
static Lisp_Object
-get_scrap_string (scrap, type)
- ScrapRef scrap;
- Lisp_Object type;
+mac_get_selection_value (sel, target)
+ Selection sel;
+ Lisp_Object target;
{
OSStatus err;
Lisp_Object result = Qnil;
- ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type);
+ ScrapFlavorType flavor_type = get_flavor_type_from_symbol (target, sel);
#if TARGET_API_MAC_CARBON
Size size;
if (flavor_type)
{
- err = GetScrapFlavorSize (scrap, flavor_type, &size);
+ err = GetScrapFlavorSize (sel, flavor_type, &size);
if (err == noErr)
{
do
{
result = make_uninit_string (size);
- err = GetScrapFlavorData (scrap, flavor_type,
+ err = GetScrapFlavorData (sel, flavor_type,
&size, SDATA (result));
if (err != noErr)
result = Qnil;
@@ -308,72 +331,25 @@ get_scrap_string (scrap, type)
return result;
}
-/* Get timestamp from the scrap SCRAP and set to *TIMPSTAMP. */
-
-static OSStatus
-get_scrap_private_timestamp (scrap, timestamp)
- ScrapRef scrap;
- unsigned long *timestamp;
-{
- OSStatus err = noErr;
-#if TARGET_API_MAC_CARBON
- ScrapFlavorFlags flags;
-
- err = GetScrapFlavorFlags (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &flags);
- if (err == noErr)
- {
- if (!(flags & kScrapFlavorMaskSenderOnly))
- err = noTypeErr;
- else
- {
- Size size = sizeof (*timestamp);
-
- err = GetScrapFlavorData (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
- &size, timestamp);
- if (err == noErr && size != sizeof (*timestamp))
- err = noTypeErr;
- }
- }
-#else /* !TARGET_API_MAC_CARBON */
- Handle handle;
- SInt32 size, offset;
-
- size = GetScrap (NULL, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &offset);
- if (size == sizeof (*timestamp))
- {
- handle = NewHandle (size);
- HLock (handle);
- size = GetScrap (handle, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &offset);
- if (size == sizeof (*timestamp))
- *timestamp = *((unsigned long *) *handle);
- DisposeHandle (handle);
- }
- if (size != sizeof (*timestamp))
- err = noTypeErr;
-#endif /* !TARGET_API_MAC_CARBON */
-
- return err;
-}
-
-/* Get the list of target types in SCRAP. The return value is a list
- of target type symbols possibly followed by scrap flavor type
+/* Get the list of target types in SEL. The return value is a list of
+ target type symbols possibly followed by scrap flavor type
strings. */
static Lisp_Object
-get_scrap_target_type_list (scrap)
- ScrapRef scrap;
+mac_get_selection_target_list (sel)
+ Selection sel;
{
- Lisp_Object result = Qnil, rest, target_type;
+ Lisp_Object result = Qnil, rest, target;
#if TARGET_API_MAC_CARBON
OSStatus err;
UInt32 count, i, type;
ScrapFlavorInfo *flavor_info = NULL;
Lisp_Object strings = Qnil;
- err = GetScrapFlavorCount (scrap, &count);
+ err = GetScrapFlavorCount (sel, &count);
if (err == noErr)
flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
- err = GetScrapFlavorInfoList (scrap, &count, flavor_info);
+ err = GetScrapFlavorInfoList (sel, &count, flavor_info);
if (err != noErr)
{
xfree (flavor_info);
@@ -387,11 +363,11 @@ get_scrap_target_type_list (scrap)
ScrapFlavorType flavor_type = 0;
if (CONSP (XCAR (rest))
- && (target_type = XCAR (XCAR (rest)),
- SYMBOLP (target_type))
- && (flavor_type = scrap_has_target_type (scrap, target_type)))
+ && (target = XCAR (XCAR (rest)),
+ SYMBOLP (target))
+ && (flavor_type = get_flavor_type_from_symbol (target, sel)))
{
- result = Fcons (target_type, result);
+ result = Fcons (target, result);
#if TARGET_API_MAC_CARBON
for (i = 0; i < count; i++)
if (flavor_info[i].flavorType == flavor_type)
@@ -428,9 +404,9 @@ x_own_selection (selection_name, selection_value)
Lisp_Object selection_name, selection_value;
{
OSStatus err;
- ScrapRef scrap;
+ Selection sel;
struct gcpro gcpro1, gcpro2;
- Lisp_Object rest, handler_fn, value, type;
+ Lisp_Object rest, handler_fn, value, target_type;
int count;
CHECK_SYMBOL (selection_name);
@@ -439,8 +415,8 @@ x_own_selection (selection_name, selection_value)
BLOCK_INPUT;
- err = get_scrap_from_symbol (selection_name, 1, &scrap);
- if (err == noErr && scrap)
+ err = mac_get_selection_from_symbol (selection_name, 1, &sel);
+ if (err == noErr && sel)
{
/* Don't allow a quit within the converter.
When the user types C-g, he would be surprised
@@ -451,49 +427,56 @@ x_own_selection (selection_name, selection_value)
for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest))
{
if (!(CONSP (XCAR (rest))
- && (type = XCAR (XCAR (rest)),
- SYMBOLP (type))
- && valid_scrap_target_type_p (type)
+ && (target_type = XCAR (XCAR (rest)),
+ SYMBOLP (target_type))
+ && mac_valid_selection_target_p (target_type)
&& (handler_fn = XCDR (XCAR (rest)),
SYMBOLP (handler_fn))))
continue;
if (!NILP (handler_fn))
value = call3 (handler_fn, selection_name,
- type, selection_value);
+ target_type, selection_value);
+
+ if (NILP (value))
+ continue;
- if (STRINGP (value))
- err = put_scrap_string (scrap, type, value);
+ if (mac_valid_selection_value_p (value, target_type))
+ err = mac_put_selection_value (sel, target_type, value);
else if (CONSP (value)
- && EQ (XCAR (value), type)
- && STRINGP (XCDR (value)))
- err = put_scrap_string (scrap, type, XCDR (value));
+ && EQ (XCAR (value), target_type)
+ && mac_valid_selection_value_p (XCDR (value), target_type))
+ err = mac_put_selection_value (sel, target_type, XCDR (value));
}
unbind_to (count, Qnil);
-
- if (err == noErr)
- err = put_scrap_private_timestamp (scrap, last_event_timestamp);
}
UNBLOCK_INPUT;
UNGCPRO;
- if (scrap && err != noErr)
+ if (sel && err != noErr)
error ("Can't set selection");
/* Now update the local cache */
{
Lisp_Object selection_time;
Lisp_Object selection_data;
+ Lisp_Object ownership_info;
Lisp_Object prev_value;
selection_time = long_to_cons (last_event_timestamp);
+ if (sel)
+ ownership_info = mac_get_selection_ownership_info (sel);
+ else
+ ownership_info = Qnil; /* dummy value for local-only selection */
selection_data = Fcons (selection_name,
Fcons (selection_value,
Fcons (selection_time,
- Fcons (selected_frame, Qnil))));
+ Fcons (selected_frame,
+ Fcons (ownership_info,
+ Qnil)))));
prev_value = assq_no_quit (selection_name, Vselection_alist);
Vselection_alist = Fcons (selection_data, Vselection_alist);
@@ -574,29 +557,20 @@ x_get_local_selection (selection_symbol, target_type, local_request)
unbind_to (count, Qnil);
}
+ if (local_request)
+ return value;
+
/* Make sure this value is of a type that we could transmit
- to another X client. */
+ to another application. */
+ type = target_type;
check = value;
if (CONSP (value)
&& SYMBOLP (XCAR (value)))
type = XCAR (value),
check = XCDR (value);
- if (STRINGP (check)
- || VECTORP (check)
- || SYMBOLP (check)
- || INTEGERP (check)
- || NILP (value))
- return value;
- /* Check for a value that cons_to_long could handle. */
- else if (CONSP (check)
- && INTEGERP (XCAR (check))
- && (INTEGERP (XCDR (check))
- ||
- (CONSP (XCDR (check))
- && INTEGERP (XCAR (XCDR (check)))
- && NILP (XCDR (XCDR (check))))))
+ if (NILP (value) || mac_valid_selection_value_p (check, type))
return value;
signal_error ("Invalid data returned by selection-conversion function",
@@ -676,22 +650,22 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp)
Lisp_Object selection_symbol, target_type, time_stamp;
{
OSStatus err;
- ScrapRef scrap;
+ Selection sel;
Lisp_Object result = Qnil;
BLOCK_INPUT;
- err = get_scrap_from_symbol (selection_symbol, 0, &scrap);
- if (err == noErr && scrap)
+ err = mac_get_selection_from_symbol (selection_symbol, 0, &sel);
+ if (err == noErr && sel)
{
if (EQ (target_type, QTARGETS))
{
- result = get_scrap_target_type_list (scrap);
+ result = mac_get_selection_target_list (sel);
result = Fvconcat (1, &result);
}
else
{
- result = get_scrap_string (scrap, target_type);
+ result = mac_get_selection_value (sel, target_type);
if (STRINGP (result))
Fput_text_property (make_number (0), make_number (SBYTES (result)),
Qforeign_selection, target_type, result);
@@ -770,7 +744,7 @@ Disowning it means there is no such selection. */)
Lisp_Object time;
{
OSStatus err;
- ScrapRef scrap;
+ Selection sel;
Lisp_Object local_selection_data;
check_mac ();
@@ -812,9 +786,9 @@ Disowning it means there is no such selection. */)
BLOCK_INPUT;
- err = get_scrap_from_symbol (selection, 0, &scrap);
- if (err == noErr && scrap)
- clear_scrap (&scrap);
+ err = mac_get_selection_from_symbol (selection, 0, &sel);
+ if (err == noErr && sel)
+ mac_clear_selection (&sel);
UNBLOCK_INPUT;
@@ -833,7 +807,7 @@ and t is the same as `SECONDARY'. */)
Lisp_Object selection;
{
OSStatus err;
- ScrapRef scrap;
+ Selection sel;
Lisp_Object result = Qnil, local_selection_data;
check_mac ();
@@ -848,15 +822,14 @@ and t is the same as `SECONDARY'. */)
BLOCK_INPUT;
- err = get_scrap_from_symbol (selection, 0, &scrap);
- if (err == noErr && scrap)
+ err = mac_get_selection_from_symbol (selection, 0, &sel);
+ if (err == noErr && sel)
{
- unsigned long timestamp;
+ Lisp_Object ownership_info;
- err = get_scrap_private_timestamp (scrap, &timestamp);
- if (err == noErr
- && (timestamp
- == cons_to_long (XCAR (XCDR (XCDR (local_selection_data))))))
+ ownership_info = XCAR (XCDR (XCDR (XCDR (XCDR (local_selection_data)))));
+ if (!NILP (Fequal (ownership_info,
+ mac_get_selection_ownership_info (sel))))
result = Qt;
}
else
@@ -878,7 +851,7 @@ and t is the same as `SECONDARY'. */)
Lisp_Object selection;
{
OSStatus err;
- ScrapRef scrap;
+ Selection sel;
Lisp_Object result = Qnil, rest;
/* It should be safe to call this before we have an Mac frame. */
@@ -893,12 +866,12 @@ and t is the same as `SECONDARY'. */)
BLOCK_INPUT;
- err = get_scrap_from_symbol (selection, 0, &scrap);
- if (err == noErr && scrap)
+ err = mac_get_selection_from_symbol (selection, 0, &sel);
+ if (err == noErr && sel)
for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest))
{
if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))
- && scrap_has_target_type (scrap, XCAR (XCAR (rest))))
+ && mac_selection_has_target_p (sel, XCAR (XCAR (rest))))
{
result = Qt;
break;
@@ -1700,7 +1673,7 @@ mac_handle_service_event (call_ref, event, data)
if (!SYMBOLP (Vmac_service_selection))
err = eventNotHandledErr;
else
- err = get_scrap_from_symbol (Vmac_service_selection, 0, &cur_scrap);
+ err = mac_get_selection_from_symbol (Vmac_service_selection, 0, &cur_scrap);
if (!(err == noErr && cur_scrap))
return eventNotHandledErr;
@@ -1719,7 +1692,7 @@ mac_handle_service_event (call_ref, event, data)
rest = XCDR (rest))
if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))
&& (flavor_type =
- get_flavor_type_from_symbol (XCAR (XCAR (rest)))))
+ get_flavor_type_from_symbol (XCAR (XCAR (rest)), 0)))
{
type = CreateTypeStringWithOSType (flavor_type);
if (type)
@@ -1804,14 +1777,15 @@ mac_handle_service_event (call_ref, event, data)
NULL, sizeof (ScrapRef), NULL,
&specific_scrap);
if (err == noErr)
- err = clear_scrap (&cur_scrap);
+ err = mac_clear_selection (&cur_scrap);
if (err == noErr)
for (rest = Vselection_converter_alist; CONSP (rest);
rest = XCDR (rest))
{
if (! (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))))
continue;
- flavor_type = get_flavor_type_from_symbol (XCAR (XCAR (rest)));
+ flavor_type = get_flavor_type_from_symbol (XCAR (XCAR (rest)),
+ specific_scrap);
if (flavor_type == 0)
continue;
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
frame_highlight (f)
struct frame *f;
{
- OSErr err;
- ControlRef root_control;
-
- BLOCK_INPUT;
- err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
- if (err == noErr)
- ActivateControl (root_control);
- UNBLOCK_INPUT;
x_update_cursor (f, 1);
}
@@ -4344,14 +4336,6 @@ static void
frame_unhighlight (f)
struct frame *f;
{
- OSErr err;
- ControlRef root_control;
-
- BLOCK_INPUT;
- err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
- if (err == noErr)
- DeactivateControl (root_control);
- UNBLOCK_INPUT;
x_update_cursor (f, 1);
}
@@ -6109,7 +6093,9 @@ free_frame_tool_bar (f)
BLOCK_INPUT;
ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), false,
- f == mac_focus_frame (dpyinfo));
+ (NILP (Fsymbol_value
+ (intern ("frame-notice-user-settings")))
+ && f == mac_focus_frame (dpyinfo)));
/* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events
on toolbar visibility change. */
mac_handle_origin_change (f);
@@ -9386,11 +9372,13 @@ mac_handle_font_event (next_handler, event, data)
static const EventParamName names_sel[] = {kEventParamATSUFontID,
kEventParamATSUFontSize,
kEventParamFMFontFamily,
+ kEventParamFMFontStyle,
kEventParamFMFontSize,
kEventParamFontColor};
static const EventParamType types_sel[] = {typeATSUFontID,
typeATSUSize,
typeFMFontFamily,
+ typeFMFontStyle,
typeFMFontSize,
typeFontColor};
@@ -10711,7 +10699,7 @@ mac_handle_window_event (next_handler, event, data)
{
struct frame *sf = SELECTED_FRAME ();
- if (!(FRAME_MAC_P (sf)))
+ if (!(FRAME_MAC_P (sf) && sf->async_visible))
RepositionWindow (wp, NULL, kWindowCenterOnMainScreen);
else
{
@@ -10726,8 +10714,11 @@ mac_handle_window_event (next_handler, event, data)
/* This is a workaround. RepositionWindow fails to put
a window at the cascading position when its parent
window has a Carbon HIToolbar. */
- if (f->top_pos == sf->top_pos && f->left_pos == sf->left_pos)
- MoveWindowStructure (wp, f->left_pos + 10, f->top_pos + 32);
+ if ((f->left_pos == sf->left_pos
+ && f->top_pos == sf->top_pos)
+ || (f->left_pos == sf->left_pos + 10 * 2
+ && f->top_pos == sf->top_pos + 32 * 2))
+ MoveWindowStructure (wp, sf->left_pos + 10, sf->top_pos + 32);
#endif
}
result = noErr;
@@ -10952,7 +10943,7 @@ mac_handle_keyboard_event (next_handler, event, data)
void *data;
{
OSStatus err, result = eventNotHandledErr;
- UInt32 event_kind, key_code, modifiers, mapped_modifiers;
+ UInt32 event_kind, key_code, modifiers;
unsigned char char_code;
event_kind = GetEventKind (event);
@@ -10961,32 +10952,16 @@ mac_handle_keyboard_event (next_handler, event, data)
case kEventRawKeyDown:
case kEventRawKeyRepeat:
case kEventRawKeyUp:
- if (read_socket_inev == NULL)
- {
- result = CallNextEventHandler (next_handler, event);
- break;
- }
-
- err = GetEventParameter (event, kEventParamKeyModifiers,
- typeUInt32, NULL,
- sizeof (UInt32), NULL, &modifiers);
- if (err != noErr)
- break;
-
- mapped_modifiers = mac_mapped_modifiers (modifiers);
-
/* When using Carbon Events, we need to pass raw keyboard events
to the TSM ourselves. If TSM handles it, it will pass back
noErr, otherwise it will pass back "eventNotHandledErr" and
we can process it normally. */
- if (!(mapped_modifiers
- & ~(mac_pass_command_to_system ? cmdKey : 0)
- & ~(mac_pass_control_to_system ? controlKey : 0)))
- {
- result = CallNextEventHandler (next_handler, event);
- if (result != eventNotHandledErr)
- break;
- }
+ result = CallNextEventHandler (next_handler, event);
+ if (result != eventNotHandledErr)
+ break;
+
+ if (read_socket_inev == NULL)
+ break;
#if USE_MAC_TSM
if (read_socket_inev->kind != NO_EVENT)
@@ -11011,6 +10986,12 @@ mac_handle_keyboard_event (next_handler, event, data)
if (err != noErr)
break;
+ err = GetEventParameter (event, kEventParamKeyModifiers,
+ typeUInt32, NULL,
+ sizeof (UInt32), NULL, &modifiers);
+ if (err != noErr)
+ break;
+
do_keystroke ((event_kind == kEventRawKeyDown ? keyDown : autoKey),
char_code, key_code, modifiers,
((unsigned long)
@@ -12157,7 +12138,7 @@ XTread_socket (sd, expected, hold_quit)
/* Window will be selected only when it is
not selected now and last mouse movement
event was not in it. Minibuffer window
- will be selected iff it is active. */
+ will be selected only when it is active. */
if (WINDOWP (window)
&& !EQ (window, last_window)
&& !EQ (window, selected_window))
@@ -12192,6 +12173,8 @@ XTread_socket (sd, expected, hold_quit)
case activateEvt:
{
WindowRef window_ptr = (WindowRef) er.message;
+ OSErr err;
+ ControlRef root_control;
if (window_ptr == tip_window)
{
@@ -12209,6 +12192,10 @@ XTread_socket (sd, expected, hold_quit)
/* A window has been activated */
Point mouse_loc;
+ err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
+ if (err == noErr)
+ ActivateControl (root_control);
+
x_detect_focus_change (dpyinfo, &er, &inev);
mouse_loc.h = (er.where.h
@@ -12224,6 +12211,10 @@ XTread_socket (sd, expected, hold_quit)
else
{
/* A window has been deactivated */
+ err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
+ if (err == noErr)
+ DeactivateControl (root_control);
+
#ifdef USE_TOOLKIT_SCROLL_BARS
if (dpyinfo->grabbed && tracked_scroll_bar)
{
@@ -12279,13 +12270,29 @@ XTread_socket (sd, expected, hold_quit)
clear_mouse_face (dpyinfo);
dpyinfo->mouse_face_hidden = 1;
}
+
+ {
+ UInt32 modifiers = er.modifiers, mapped_modifiers;
+
+#ifdef MAC_OSX
+ GetEventParameter (eventRef, kEventParamKeyModifiers,
+ typeUInt32, NULL,
+ sizeof (UInt32), NULL, &modifiers);
+#endif
+ mapped_modifiers = mac_mapped_modifiers (modifiers);
+
#if TARGET_API_MAC_CARBON
- goto OTHER;
-#else
- do_keystroke (er.what, er.message & charCodeMask,
- (er.message & keyCodeMask) >> 8,
- er.modifiers, timestamp, &inev);
+ if (!(mapped_modifiers
+ & ~(mac_pass_command_to_system ? cmdKey : 0)
+ & ~(mac_pass_control_to_system ? controlKey : 0)))
+ goto OTHER;
+ else
#endif
+ if (er.what != keyUp)
+ do_keystroke (er.what, er.message & charCodeMask,
+ (er.message & keyCodeMask) >> 8,
+ modifiers, timestamp, &inev);
+ }
break;
case kHighLevelEvent:
@@ -12339,7 +12346,6 @@ XTread_socket (sd, expected, hold_quit)
}
count++;
}
-
}
/* 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
char *mac_id_name;
/* The number of fonts actually stored in the font table.
- font_table[n] is used and valid iff 0 <= n < n_fonts. 0 <=
+ font_table[n] is used and valid if 0 <= n < n_fonts. 0 <=
n_fonts <= font_table_size and font_table[i].name != 0. */
int n_fonts;
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 ()
`dos_get_modifiers', they might have already released the
Alt key, and Emacs gets just `x', which is BAD.
However, for keys with the `Map' property set, the ASCII
- code returns zero iff Alt is pressed. So, when we DON'T
+ code returns zero only if Alt is pressed. So, when we DON'T
have to support international_keyboard, we don't have to
distinguish between the left and right Alt keys, and we
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;
/* Avoid actual stack overflow in print. */
int print_depth;
-/* Nonzero if inside outputting backquote in old style. */
-int old_backquote_output;
+/* Level of nesting inside outputting backquote in new style. */
+int new_backquote_output;
/* Detect most circularities to print finite output. */
#define PRINT_CIRCLE 200
@@ -1291,7 +1291,7 @@ print (obj, printcharfun, escapeflag)
register Lisp_Object printcharfun;
int escapeflag;
{
- old_backquote_output = 0;
+ new_backquote_output = 0;
/* Reset print_number_index and Vprint_number_table only when
the variable Vprint_continuous_numbering is nil. Otherwise,
@@ -1756,14 +1756,24 @@ print_object (obj, printcharfun, escapeflag)
print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
}
else if (print_quoted && CONSP (XCDR (obj)) && NILP (XCDR (XCDR (obj)))
- && ! old_backquote_output
+ && ((EQ (XCAR (obj), Qbackquote))))
+ {
+ print_object (XCAR (obj), printcharfun, 0);
+ new_backquote_output++;
+ print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
+ new_backquote_output--;
+ }
+ else if (print_quoted && CONSP (XCDR (obj)) && NILP (XCDR (XCDR (obj)))
+ && new_backquote_output
&& ((EQ (XCAR (obj), Qbackquote)
|| EQ (XCAR (obj), Qcomma)
|| EQ (XCAR (obj), Qcomma_at)
|| EQ (XCAR (obj), Qcomma_dot))))
{
print_object (XCAR (obj), printcharfun, 0);
+ new_backquote_output--;
print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
+ new_backquote_output++;
}
else
{
@@ -1783,9 +1793,7 @@ print_object (obj, printcharfun, escapeflag)
print_object (Qbackquote, printcharfun, 0);
PRINTCHAR (' ');
- ++old_backquote_output;
print_object (XCAR (XCDR (tem)), printcharfun, 0);
- --old_backquote_output;
PRINTCHAR (')');
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
:filter-multibyte BOOL -- If BOOL is non-nil, strings given to the
process filter are multibyte, otherwise they are unibyte.
-If this keyword is not specified, the strings are multibyte iff
+If this keyword is not specified, the strings are multibyte if
`default-enable-multibyte-characters' is non-nil.
:sentinel SENTINEL -- Install SENTINEL as the process sentinel.
@@ -3922,7 +3922,7 @@ it specifies a fractional number of seconds to wait.
If optional fourth arg JUST-THIS-ONE is non-nil, only accept output
from PROCESS, suspending reading output from other processes.
If JUST-THIS-ONE is an integer, don't run any timers either.
-Return non-nil iff we received any output before the timeout expired. */)
+Return non-nil if we received any output before the timeout expired. */)
(process, seconds, millisec, just_this_one)
register Lisp_Object process, seconds, millisec, just_this_one;
{
@@ -4254,16 +4254,16 @@ select_wrapper (n, rfd, wfd, xfd, tmo)
(and gobble terminal input into the buffer if any arrives).
If WAIT_PROC is specified, wait until something arrives from that
- process. The return value is true iff we read some input from
+ process. The return value is true if we read some input from
that process.
If JUST_WAIT_PROC is non-nil, handle only output from WAIT_PROC
(suspending output from other processes). A negative value
means don't run any timers either.
- If WAIT_PROC is specified, then the function returns true iff we
+ If WAIT_PROC is specified, then the function returns true if we
received input from that process before the timeout elapsed.
- Otherwise, return true iff we received input from any process. */
+ Otherwise, return true if we received input from any process. */
int
wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
@@ -7358,7 +7358,7 @@ Lisp_Object QCtype;
do_display != 0 means redisplay should be done to show subprocess
output that arrives.
- Return true iff we received input from any process. */
+ Return true if we received input from any process. */
int
wait_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[];
/* Alist of elements (NAME . PROCESS). */
extern Lisp_Object Vprocess_alist;
-/* True iff we are about to fork off a synchronous process or if we
+/* True if we are about to fork off a synchronous process or if we
are waiting for it. */
extern int synch_process_alive;
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)
else return 0;
}
-/* True iff CH is in the char class CC. */
+/* True if CH is in the char class CC. */
boolean
re_iswctype (ch, cc)
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)
have nontrivial translation are the same aside from the last byte.
This makes it possible to translate just the last byte of a
character, and do so after just a simple test of the context.
- CHARSET_BASE is nonzero iff there is such a non-ASCII character.
+ CHARSET_BASE is nonzero if there is such a non-ASCII character.
If that criterion is not satisfied, do not call this function. */
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;
EMACS_SECS (TIME) is an rvalue for the seconds component of TIME.
EMACS_SET_SECS (TIME, SECONDS) sets that to SECONDS.
- EMACS_HAS_USECS is defined iff EMACS_TIME has a usecs component.
+ EMACS_HAS_USECS is defined if EMACS_TIME has a usecs component.
EMACS_USECS (TIME) is an rvalue for the microseconds component of TIME.
This returns zero if EMACS_TIME doesn't have a microseconds component.
EMACS_SET_USECS (TIME, MICROSECONDS) sets that to MICROSECONDS.
@@ -83,7 +83,7 @@ extern time_t timezone;
EMACS_SUB_TIME (DEST, SRC1, SRC2) subtracts SRC2 from SRC1 and
stores the result in DEST. SRC should not be negative.
- EMACS_TIME_NEG_P (TIME) is true iff TIME is negative.
+ EMACS_TIME_NEG_P (TIME) is true if TIME is negative.
*/
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 {
written before making the change.
Return 0 if all went well, and -1 if anything failed.
- EMACS_TTY_TABS_OK (struct emacs_tty *P) is false iff the kernel
+ EMACS_TTY_TABS_OK (struct emacs_tty *P) is false if the kernel
expands tabs to spaces upon output; in that case, there is no
advantage to using tabs over spaces. */
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));
/* Input queue declarations and hooks. */
/* Expedient hack: only provide the below definitions to files that
- are prepared to handle lispy things. CONSP is defined iff lisp.h
+ are prepared to handle lispy things. CONSP is defined if lisp.h
has been included before this file. */
#ifdef CONSP
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. */)
The flag `modified' records if changes have been made.
When object is a buffer, we must call modify_region before changes are
made and signal_after_change when we are done.
- We call modify_region before calling remove_properties iff modified == 0,
- and we call signal_after_change before returning iff modified != 0. */
+ We call modify_region before calling remove_properties if modified == 0,
+ and we call signal_after_change before returning if modified != 0. */
for (;;)
{
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)
/* Window will be selected only when it is not
selected now and last mouse movement event was
not in it. Minibuffer window will be selected
- iff it is active. */
+ only when it is active. */
if (WINDOWP(window)
&& !EQ (window, last_window)
&& !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
char *w32_id_name;
/* The number of fonts actually stored in w32_font_table.
- font_table[n] is used and valid iff 0 <= n < n_fonts. 0 <=
+ font_table[n] is used and valid if 0 <= n < n_fonts. 0 <=
n_fonts <= font_table_size. and font_table[i].name != 0. */
int n_fonts;
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))). */)
return make_number (window_box_text_cols (decode_any_window (window)));
}
+DEFUN ("window-full-width-p", Fwindow_full_width_p, Swindow_full_width_p, 0, 1, 0,
+ doc: /* Return t if WINDOW is as wide as its frame.
+WINDOW defaults to the selected window. */)
+ (window)
+ Lisp_Object window;
+{
+ return WINDOW_FULL_WIDTH_P (decode_any_window (window)) ? Qt : Qnil;
+}
+
DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0,
doc: /* Return the number of columns by which WINDOW is scrolled from left margin.
WINDOW defaults to the selected window. */)
@@ -7517,6 +7526,7 @@ The selected frame is the one whose configuration has changed. */);
defsubr (&Swindow_buffer);
defsubr (&Swindow_height);
defsubr (&Swindow_width);
+ defsubr (&Swindow_full_width_p);
defsubr (&Swindow_hscroll);
defsubr (&Sset_window_hscroll);
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,
EXFUN (Fwindow_dedicated_p, 1);
extern int window_height P_ ((Lisp_Object));
extern int window_width P_ ((Lisp_Object));
+EXFUN (Fwindow_full_width_p, 1);
extern void set_window_height P_ ((Lisp_Object, int, int));
extern void set_window_width P_ ((Lisp_Object, int, int));
extern void change_window_heights P_ ((Lisp_Object, int));
@@ -818,7 +819,7 @@ extern int command_loop_level;
extern int minibuf_level;
-/* true iff we should redraw the mode lines on the next redisplay. */
+/* true if we should redraw the mode lines on the next redisplay. */
extern int update_mode_lines;
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)
{
struct position pos;
- if (!FRAME_WINDOW_P (it->f))
+ /* The commented-out optimization uses vmotion on terminals. This
+ gives bad results, because elements like it->what, on which
+ callers such as pos_visible_p rely, aren't updated. */
+ /* if (!FRAME_WINDOW_P (it->f))
{
struct text_pos textpos;
- /* We can use vmotion on frames without proportional fonts. */
pos = *vmotion (IT_CHARPOS (*it), dvpos, it->w);
SET_TEXT_POS (textpos, pos.bufpos, pos.bytepos);
reseat (it, textpos, 1);
it->vpos += pos.vpos;
it->current_y += pos.vpos;
}
- else if (dvpos == 0)
+ else */
+
+ if (dvpos == 0)
{
/* DVPOS == 0 means move to the start of the screen line. */
move_it_vertically_backward (it, 0);
@@ -13532,7 +13536,10 @@ redisplay_window (window, just_this_one_p)
/* Restore current_buffer and value of point in it. */
TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint));
set_buffer_internal_1 (old);
- TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));
+ /* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become
+ shorter. This can be caused by log truncation in *Messages*. */
+ if (CHARPOS (lpoint) <= ZV)
+ TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));
unbind_to (count, Qnil);
}
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)
{
/* Fill background with a stipple pattern. */
XSetFillStyle (s->display, s->gc, FillOpaqueStippled);
+ XSetTSOrigin (s->display, s->gc, - s->x, - s->y);
XFillRectangle (s->display, pixmap, s->gc,
0, 0, s->background_width, s->height);
XSetFillStyle (s->display, s->gc, FillSolid);
+ XSetTSOrigin (s->display, s->gc, 0, 0);
}
else
{
@@ -6711,7 +6713,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
/* Window will be selected only when it is not selected now and
last mouse movement event was not in it. Minibuffer window
- will be selected iff it is active. */
+ will be selected only when it is active. */
if (WINDOWP (window)
&& !EQ (window, last_window)
&& !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
char *x_id_name;
/* The number of fonts actually stored in x_font_table.
- font_table[n] is used and valid iff 0 <= n < n_fonts. 0 <=
+ font_table[n] is used and valid if 0 <= n < n_fonts. 0 <=
n_fonts <= font_table_size and font_table[i].name != 0. */
int n_fonts;