]> code.delx.au - gnu-emacs/commitdiff
Merge from emacs-23; up to 2010-05-28T19:18:47Z!juri@jurta.org.
authorGlenn Morris <rgm@gnu.org>
Wed, 16 Feb 2011 08:39:19 +0000 (00:39 -0800)
committerGlenn Morris <rgm@gnu.org>
Wed, 16 Feb 2011 08:39:19 +0000 (00:39 -0800)
1  2 
doc/misc/ChangeLog
doc/misc/dired-x.texi
src/ChangeLog
src/xdisp.c

diff --combined doc/misc/ChangeLog
index fe589bb6fdd4c76402296951c16c6a5807620a16,172c61876739889d38c8904fc5557372fc5c303b..21a2a593c2ac9895016b3841d68b2c90346884ee
 -2011-02-14  Glenn Morris  <rgm@gnu.org>
 +2011-02-16  Glenn Morris  <rgm@gnu.org>
  
+       * dired-x.texi: Drop meaningless version number.
+       (Introduction): Remove old info.
+       (Optional Installation Dired Jump): Autoload from dired-x.
+       Remove incorrect info about loaddefs.el.
+       (Bugs): Just refer to M-x report-emacs-bug.
 +      * dired-x.texi (Multiple Dired Directories): Update for rename of
 +      default-directory-alist.
 +      (Miscellaneous Commands): No longer mention very old VM version 4.
 +
 +2011-02-15  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Merge from gnulib.
 +      * texinfo.tex: Update to version 2011-02-14.11.
 +
 +2011-02-14  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * auth.texi (Help for users):
 +      Login collection is "Login" and not "login".
 +
 +2011-02-13  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * tramp.texi (History): Remove IMAP support.
 +      (External methods, Frequently Asked Questions): Remove `imap' and
 +      `imaps' methods.
 +      (Password handling): Remove IMAP entries for ~/.authinfo.gpg.
 +
 +      * trampver.texi: Remove default value of `emacsimap'.
 +
 +2011-02-13  Glenn Morris  <rgm@gnu.org>
 +
 +      * ada-mode.texi, dired-x.texi, ebrowse.texi, ediff.texi, eudc.texi:
 +      * idlwave.texi, reftex.texi, sc.texi, speedbar.texi: Add @top.
 +
  2011-02-12  Glenn Morris  <rgm@gnu.org>
  
        * sc.texi (Getting Connected): Remove old index entries.
  
 -2011-02-12  Ulrich Mueller <ulm@gentoo.org>
 +2011-02-12  Ulrich Mueller  <ulm@gentoo.org>
  
        * url.texi: Remove duplicate @dircategory (Bug#7942).
  
 -2011-02-03  Michael Albinus  <michael.albinus@gmx.de>
 +2011-02-11  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * auth.texi (Overview, Help for users, Help for developers):
 +      Update docs.
 +      (Help for users): Talk about spaces.
 +
 +2011-02-09  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * texinfo.tex: Update to version 2011-02-07.16.
 +
 +2011-02-07  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbus.texi (Bus names): Adapt descriptions for
 +      dbus-list-activatable-names and dbus-list-known-names.
 +
 +2011-02-07  Jay Belanger  <jay.p.belanger@gmail.com>
 +
 +      * calc.texi (Logarithmic Units): New section.
 +
 +2011-02-05  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * gnus-overrides.texi: Renamed from overrides.texi and all the relevant
 +      manuals use it now.
 +
 +      * Makefile.in (nowebhack): Fixed to use -D flag instead of overrides.
 +
 +2011-02-05  Katsumi Yamaoka  <yamaoka@jpl.org>
 +
 +      * overrides.texi: Remove.
 +
 +      * sieve.texi, sasl.texi, pgg.texi, message.texi, gnus.texi:
 +      * emacs-mime.texi, auth.texi, Makefile.in: Revert last changes.
 +
 +2011-02-05  Michael Albinus  <michael.albinus@gmx.de>
  
        * tramp.texi (Frequently Asked Questions): Mention problems with
        WinSSHD.
  
 -2011-01-03  Eduard Wiebe  <usenet@pusto.de>
 +      * trampver.texi: Update release number.
 +
 +2011-02-05  Era Eriksson  <era+tramp@iki.fi>  (tiny change)
 +
 +      * tramp.texi:
 +      Replace "delimet" with "delimit" globally.
 +      Replace "explicite" with "explicit" globally.
 +      Replace "instead of" with "instead" where there was nothing after "of".
 +      Audit use of comma before interrogative pronoun, "that", or "which".
 +      Minor word order, spelling, wording changes.
 +
 +2011-02-04  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * overrides.texi: New file to set or clear WEBHACKDEVEL.
 +
 +      * sieve.texi: Use WEBHACKDEVEL.
 +
 +      * sasl.texi: Use WEBHACKDEVEL.
 +
 +      * pgg.texi: Use WEBHACKDEVEL.
 +
 +      * message.texi: Use WEBHACKDEVEL.
 +
 +      * gnus.texi: Use WEBHACKDEVEL.
 +
 +      * emacs-mime.texi: Use WEBHACKDEVEL.
 +
 +      * auth.texi: Use WEBHACKDEVEL.
 +
 +      * Makefile.in (webhack, nowebhack): Hacks to produce for-the-web
 +      manuals.
 +
 +2011-02-04  Lars Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi: Add DEVEL header (suggested by Andreas Schwab).
 +
 +2011-02-03  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * texinfo.tex: Update to version 2011-02-01.10 from gnulib,
 +      which in turn is copied from ftp://tug.org/tex/.
 +
 +2011-02-03  Glenn Morris  <rgm@gnu.org>
 +
 +      * faq.texi (Contacting the FSF): Mainly just refer to the web-site.
 +      (Binding combinations of modifiers and function keys):
 +      Let's assume people reading this are not using Emacs 18.
 +
 +2011-02-03  Lars Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Article Date): Remove mention of gnus-stop-date-timer,
 +      since it's run automatically.
 +
 +2011-02-01  Lars Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Customizing Articles): Fix typo.
 +
 +2011-01-31  Lars Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Customizing Articles): Document the new way of customizing
 +      the date headers(s).
 +
 +2011-01-30  Lars Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Client-Side IMAP Splitting): Add a complete nnimap fancy
 +      splitting example.
 +
 +2011-01-29  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * makefile.w32-in (MAKEINFO): Remove options, leave only program name.
 +      (MAKEINFO_OPTS): New variable.
 +      (ENVADD, $(infodir)/emacs): Use $(MAKEINFO_OPTS).
 +      ($(infodir)/info, $(infodir)/ccmode, $(infodir)/ada-mode)
 +      ($(infodir)/pcl-cvs, $(infodir)/eshell, $(infodir)/cl)
 +      ($(infodir)/dbus, $(infodir)/dired-x, $(infodir)/ediff)
 +      ($(infodir)/flymake, $(infodir)/forms, $(infodir)/gnus)
 +      ($(infodir)/message, $(infodir)/emacs-mime, $(infodir)/sieve)
 +      ($(infodir)/pgg, $(infodir)/mh-e, $(infodir)/reftex)
 +      ($(infodir)/remember, $(infodir)/sasl, $(infodir)/sc)
 +      ($(infodir)/vip, $(infodir)/viper, $(infodir)/widget)
 +      ($(infodir)/efaq, $(infodir)/autotype, $(infodir)/calc)
 +      ($(infodir)/idlwave, $(infodir)/eudc, $(infodir)/ebrowse)
 +      ($(infodir)/woman, $(infodir)/speedbar, $(infodir)/tramp)
 +      ($(infodir)/ses, $(infodir)/smtpmail, $(infodir)/org)
 +      ($(infodir)/url, $(infodir)/newsticker, $(infodir)/nxml-mode)
 +      ($(infodir)/rcirc, $(infodir)/erc, $(infodir)/ert)
 +      ($(infodir)/epa, $(infodir)/mairix-el, $(infodir)/auth)
 +      ($(infodir)/eieio, $(infodir)/ede, $(infodir)/semantic)
 +      ($(infodir)/edt): Use $(MAKEINFO_OPTS).
 +
 +2011-01-26  Lars Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Article Date): Document gnus-article-update-lapsed-header.
 +
 +2011-01-24  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * message.texi (IDNA): Explain what it is.
 +
 +2011-01-24  Lars Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (The Empty Backend): Document nnnil (bug #7653).
 +
 +2011-01-23  Werner Lemberg  <wl@gnu.org>
 +
 +      * Makefile.in (MAKEINFO): Now controlled by `configure'.
 +      (MAKEINFO_OPTS): New variable.  Use it where appropriate.
 +      (ENVADD): Updated.
 +
 +2011-01-18  Glenn Morris  <rgm@gnu.org>
 +
 +      * ert.texi: Relicense under GFDL 1.3+, and standardize license notice.
 +
 +2011-01-14  Eduard Wiebe  <usenet@pusto.de>
  
        * nxml-mode.texi (Introduction): Fix file name typos.
  
 -2010-12-02  Glenn Morris  <rgm@gnu.org>
 +2011-01-13  Christian Ohler  <ohler@gnu.org>
 +
 +      * ert.texi: New file.
 +
 +      * Makefile.in:
 +      * makefile.w32-in: Add ert.texi.
 +
 +2011-01-10  Jan Moringen  <jan.moringen@uni-bielefeld.de>
 +
 +      * dbus.texi (Receiving Method Calls): New function
 +      dbus-register-service.  Rearrange node.
 +
 +2011-01-07  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * texinfo.tex: Update to version 2010-12-23.17 from gnulib,
 +      which in turn is copied from ftp://tug.org/tex/.
 +
 +2011-01-04  Jan Moringen  <jan.moringen@uni-bielefeld.de>
 +
 +      * dbus.texi (Receiving Method Calls): Describe new optional
 +      parameter dont-register-service of dbus-register-{method,property}.
 +
 +2010-12-17  Daiki Ueno  <ueno@unixuser.org>
 +
 +      * epa.texi (Encrypting/decrypting *.gpg files): Mention
 +      epa-file-select-keys.
 +
 +2010-12-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Archived Messages): Remove outdated text.
 +
 +2010-12-16  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * gnus.texi (Foreign Groups): Added clarification of foreign groups.
 +
 +2010-12-15  Andrew Cohen  <cohen@andy.bu.edu>
 +
 +      * gnus.texi (The hyrex Engine): Say that this engine is obsolete.
 +
 +2010-12-14  Andrew Cohen  <cohen@andy.bu.edu>
 +
 +      * gnus.texi (The swish++ Engine): Add customizable parameters
 +      descriptions.
 +      (The swish-e Engine): Ditto.
 +
 +2010-12-14  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * tramp.texi (Inline methods): Add "ksu" method.
 +      (Remote processes): Add example with remote `default-directory'.
 +
 +2010-12-14  Glenn Morris  <rgm@gnu.org>
 +
 +      * faq.texi (Expanding aliases when sending mail):
 +      Now build-mail-aliases is interactive.
 +
 +2010-12-13  Andrew Cohen  <cohen@andy.bu.edu>
 +
 +      * gnus.texi: First pass at adding (rough) nnir documentation.
 +
 +2010-12-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Filtering New Groups):
 +      Mention gnus-auto-subscribed-categories.
 +      (The First Time): Remove, since default-subscribed-newsgroups has been
 +      removed.
 +
 +2010-12-13  Glenn Morris  <rgm@gnu.org>
  
        * cl.texi (For Clauses): Small fixes for frames and windows.
  
 -2010-11-23  Glenn Morris  <rgm@gnu.org>
 +2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (Using capture): Document using prefix arguments for
 +      finalizing capture.
 +      (Agenda commands): Document prefix argument for the bulk scatter
 +      command.
 +      (Beamer class export): Document that also overlay arguments can be
 +      passed to the column environment.
 +      (Template elements): Document the new entry type.
 +
 +2010-12-11  Puneeth Chaganti  <punchagan@gmail.com>
 +
 +      * org.texi (Include files): Document :minlevel.
 +
 +2010-12-11  Julien Danjou  <julien@danjou.info>
 +
 +      * org.texi (Categories): Document category icons.
 +
 +2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
 +
 +      * org.texi (noweb): Fix typo.
 +
 +2010-12-06  Tassilo Horn  <tassilo@member.fsf.org>
 +
 +      * gnus.texi (Server Commands): Point to the rest of the server
 +      commands.
 +
 +2010-12-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Paging the Article): Note the reverse meanings of `C-u C-u
 +      g'.
 +
 +2010-12-02  Julien Danjou  <julien@danjou.info>
 +
 +      * gnus.texi (Archived Messages): Remove gnus-outgoing-message-group.
 +
 +2010-11-28  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Customizing the IMAP Connection): Note the new defaults.
 +      (Direct Functions): Note the STARTTLS upgrade.
 +
 +2010-11-27  Glenn Morris  <rgm@gnu.org>
            James Clark  <none@example.com>
  
        * nxml-mode.texi (Introduction): New section.
  
 -2010-11-10  Glenn Morris  <rgm@gnu.org>
 +2010-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Server Commands): Document gnus-server-show-server.
 +
 +2010-11-20  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      Sync with Tramp 2.2.0.
 +
 +      * trampver.texi: Update release number.
 +
 +2010-11-19  Jay Belanger  <jay.p.belanger@gmail.com>
 +
 +      * calc.texi (TeX and LaTeX Language Modes, Predefined Units):
 +      Mention that the TeX specific units won't use the `tex' prefix
 +      in TeX mode.
 +
 +2010-11-18  Katsumi Yamaoka  <yamaoka@jpl.org>
 +
 +      * gnus.texi (Misc Article): Document gnus-inhibit-images.
 +
 +2010-11-17  Glenn Morris  <rgm@gnu.org>
  
        * edt.texi: Remove information about Emacs 19.
  
 -2010-11-05  Michael Albinus  <michael.albinus@gmx.de>
 +2010-11-17  Michael Albinus  <michael.albinus@gmx.de>
  
        * trampver.texi: Update release number.
  
 -2010-11-03  Jay Belanger  <jay.p.belanger@gmail.com>
 +2010-11-12  Katsumi Yamaoka  <yamaoka@jpl.org>
 +
 +      * gnus.texi (Article Washing): Fix typo.
 +
 +2010-11-11  Noorul Islam  <noorul@noorul.com>
 +
 +      * org.texi: Fix typo.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (Using capture): Explain that refiling is
 +      sensitive to cursor position.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (Images and tables): Add cross reference to link section.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi: Document the <c> cookie.
 +
 +2010-11-11  Eric Schulte  <schulte.eric@gmail.com>
 +
 +      * org.texi: multi-line header arguments :PROPERTIES: :ID:
 +      b77c8857-6c76-4ea9-8a61-ddc2648d96c4 :END:.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (CSS support): Document :HTML_CONTAINER_CLASS: property.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (Project alist): Mention that this is a property list.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (Setting up the staging area): Document that
 +      file names remain visible when encrypting the MobileOrg files.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (Setting up the staging area): Document which
 +      versions are needed for encryption.
 +
 +2010-11-11  Eric Schulte  <schulte.eric@gmail.com>
 +
 +      * org.texi (noweb): Update :noweb documentation to
 +      reflect the new "tangle" argument.
 +
 +2010-11-11  Eric Schulte  <schulte.eric@gmail.com>
 +
 +      * org.texi (Batch execution): Improve tangling script in
 +      documentation.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (Handling links):
 +      (In-buffer settings): Document inlining images on startup.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (Setting up the staging area): Document use of
 +      crypt password.
 +
 +2010-11-11  David Maus  <dmaus@ictsoc.de>
 +
 +      * org.texi (Template expansion): Add date related link type escapes.
 +
 +2010-11-11  David Maus  <dmaus@ictsoc.de>
 +
 +      * org.texi (Template expansion): Add mew in table for link type
 +      escapes.
 +
 +2010-11-11  David Maus  <dmaus@ictsoc.de>
 +
 +      * org.texi (Template expansion): Fix typo in link type escapes.
 +
 +2010-11-11  Eric Schulte  <schulte.eric@gmail.com>
 +
 +      * org.texi (Structure of code blocks): Another documentation tweak.
 +
 +2010-11-11  Eric Schulte  <schulte.eric@gmail.com>
 +
 +      * org.texi (Structure of code blocks): Documentation tweak.
 +
 +2010-11-11  Eric Schulte  <schulte.eric@gmail.com>
 +
 +      * org.texi (Structure of code blocks):
 +      Update documentation to mention inline code block syntax.
 +
 +2010-11-11  Eric Schulte  <schulte.eric@gmail.com>
 +
 +      * org.texi (comments): Improve wording.
 +
 +2010-11-11  Eric Schulte  <schulte.eric@gmail.com>
 +
 +      * org.texi (comments): Document the new :comments header arguments.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (Installation): Remove the special
 +      installation instructions for XEmacs.
 +
 +2010-11-11  Jambunathan K  <kjambunathan@gmail.com>  (tiny change)
 +
 +      * org.texi (Easy Templates): New section.  Documents quick
 +      insertion of empty structural elements.
 +
 +2010-11-11  Noorul Islam  <noorul@noorul.com>
 +
 +      * org.texi: Fix doc.
 +
 +2010-11-11  Jambunathan K  <kjambunathan@gmail.com>  (tiny change)
 +
 +      * org.texi (The date/time prompt): Document specification
 +      of time ranges.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (Internal links): Document the changes in
 +      internal links.
 +
 +2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (Agenda commands): Document the limitation for
 +      the filter preset - it can only be used for an entire agenda
 +      view, not in an individual block in a block agenda.
 +
 +2010-11-11  Eric S Fraga  <e.fraga@ucl.ac.uk>
 +
 +      * org.texi (iCalendar export): Document alarm creation.
 +
 +2010-11-10  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbus.texi (Type Conversion): Introduce `:unix-fd' type mapping.
 +
 +2010-11-09  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Article Washing): Document gnus-article-treat-non-ascii.
 +
 +2010-11-09  Jay Belanger  <jay.p.belanger@gmail.com>
  
        * calc.texi: Use emacsver.texi to determine Emacs version.
  
 -2010-10-30  Glenn Morris  <rgm@gnu.org>
 +2010-11-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Customizing the IMAP Connection): Remove nnir mention,
 +      since that works by default.
 +
 +2010-11-03  Kan-Ru Chen  <kanru@kanru.info>  (tiny change)
 +
 +      * gnus.texi (Customizing the IMAP Connection): Document
 +      `nnimap-expunge' and remove `nnimap-expunge-inbox' from example.
 +
 +2010-11-04  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * tramp.texi (Remote shell setup): New item "Interactive shell
 +      prompt".  Reported by Christian Millour <cm@abtela.com>.
 +      (Remote shell setup, Remote processes): Use @code{} for
 +      environment variables.
 +
 +2010-11-03  Glenn Morris  <rgm@gnu.org>
 +
 +      * ediff.texi (Quick Help Commands, Miscellaneous):
 +      * gnus.texi (Agent Variables, Configuring nnmairix): Spelling fix.
 +
 +2010-10-31  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Paging the Article): Document C-u g/C-u C-u g.
 +
 +2010-10-31  Glenn Morris  <rgm@gnu.org>
  
        * mh-e.texi (Preface, From Bill Wohler): Change 23 to past tense.
  
 -2010-10-29  Glenn Morris  <rgm@gnu.org>
 +2010-10-31  Glenn Morris  <rgm@gnu.org>
  
        * cc-mode.texi: Remove reference to defunct viewcvs URL.
  
 -2010-10-22  Juanma Barranquero  <lekktu@gmail.com>
 +2010-10-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Client-Side IMAP Splitting): Mention
 +      nnimap-unsplittable-articles.
 +
 +2010-10-29  Julien Danjou  <julien@danjou.info>
 +
 +      * gnus.texi (Finding the News): Remove references to obsoletes
 +      variables `gnus-nntp-server' and `gnus-secondary-servers'.
 +
 +2010-10-29  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * makefile.w32-in (MAKEINFO): Add -I$(emacsdir).
 +      (ENVADD): Remove extra -I$(emacsdir), included in $(MAKEINFO).
 +      ($(infodir)/efaq): Remove -I$(emacsdir), included in $(MAKEINFO).
 +      ($(infodir)/calc, calc.dvi): Depend on $(emacsdir)/emacsver.texi.
 +
 +2010-10-28  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (MAKEINFO, ENVADD): Add $emacsdir to include path.
 +      (($(infodir)/calc, calc.dvi, calc.pdf): Depend on emacsver.texi.
 +      ($(infodir)/efaq): Remove -I option now in $MAKEINFO.
 +
 +2010-10-25  Daiki Ueno  <ueno@unixuser.org>
 +
 +      * epa.texi (Mail-mode integration): Add alternative key bindings
 +      for epa-mail commands; escape comma.
 +      Don't use the word "PGP", since it is a non-free program.
 +
 +2010-10-24  Jay Belanger  <jay.p.belanger@gmail.com>
 +
 +      * calc.texi: Use emacsver.texi to determine Emacs version.
 +
 +2010-10-24  Juanma Barranquero  <lekktu@gmail.com>
  
        * gnus.texi (Group Parameters, Buttons): Fix typos.
  
 +2010-10-22  Tassilo Horn  <tassilo@member.fsf.org>
 +
 +      * gnus.texi (Subscription Commands): Mention that you can also
 +      subscribe to new groups via the Server buffer, which is probably more
 +      convenient when subscribing to many groups.
 +
 +2010-10-21  Julien Danjou  <julien@danjou.info>
 +
 +      * message.texi (Message Headers): Allow message-default-headers to be a
 +      function.
 +
 +2010-10-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus-news.texi: Mention new archive defaults.
 +
 +2010-10-21  Katsumi Yamaoka  <yamaoka@jpl.org>
 +
 +      * gnus.texi (RSS): Remove nnrss-wash-html-in-text-plain-parts.
 +
 +2010-10-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (HTML): Document the function value of
 +      gnus-blocked-images.
 +      (Article Washing): shr and gnus-w3m, not the direct function names.
 +
 +2010-10-20  Julien Danjou  <julien@danjou.info>
 +
 +      * emacs-mime.texi (Flowed text): Add a note about mml-enable-flowed
 +      variable.
 +
 +2010-10-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Customizing the IMAP Connection): The port strings are
 +      strings.
 +      (Document Groups): Mention git.
 +
 +2010-10-18  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus-coding.texi (Gnus Maintainance Guide): Update to mention Emacs
 +      bzr/Gnus git sync.
 +
 +2010-10-15  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * auth.texi (GnuPG and EasyPG Assistant Configuration): Fix last
 +      change.
 +
 +2010-10-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * auth.texi (GnuPG and EasyPG Assistant Configuration): Fix up the
 +      @item syntax for in-Emacs makeinfo.
 +
 +2010-10-13  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * auth.texi (GnuPG and EasyPG Assistant Configuration): Fix syntax and
 +      trim sentence.
 +
 +2010-10-12  Daiki Ueno  <ueno@unixuser.org>
 +
 +      * epa.texi (Caching Passphrases):
 +      * auth.texi (GnuPG and EasyPG Assistant Configuration): Clarify
 +      some configurations require to set up gpg-agent.
 +
 +2010-10-11  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (.texi.dvi): Remove unnecessary suffix rule.
 +
 +2010-10-09  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Spam Package Introduction): Mention `$'.
 +
 +2010-10-09  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * makefile.w32-in (emacsdir): New variable.
 +      ($(infodir)/efaq, faq.dvi): Depend on emacsver.texi.
 +      (ENVADD, $(infodir)/efaq): Add -I$(emacsdir).
 +
 +2010-10-09  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (mostlyclean): Delete *.toc.
 +
 +      * Makefile.in: Use $< in rules.
 +
 +      * Makefile.in (maintainer-clean): Remove harmless, long-standing error.
 +
 +      * Makefile.in ($(infodir)): Delete rule.
 +      (mkinfodir): New.  Use it in all the info rules, rather than depending
 +      on infodir.
 +
 +2010-10-09  Glenn Morris  <rgm@gnu.org>
 +
 +      * gnus.texi (Article Washing): Fix previous change.
 +
 +      * Makefile.in (emacsdir): New variable.
 +      ($(infodir)/efaq): Pass -I $(emacsdir) to makeinfo.
 +      Depend on emacsver.texi.
 +
 +      * faq.texi (VER): Replace with EMACSVER from emacsver.texi.
 +
 +      * Makefile.in (.PHONY): Declare info, dvi, pdf and the clean rules.
 +
 +2010-10-08  Julien Danjou  <julien@danjou.info>
 +
 +      * gnus.texi: Add mm-shr.
 +
 +2010-10-08  Ludovic Courtès  <ludo@gnu.org>
 +
 +      * gnus.texi (Finding the Parent, The Gnus Registry)
 +      (Registry Article Refer Method): Update docs for nnregistry.el.
 +
 +2010-10-08  Daiki Ueno  <ueno@unixuser.org>
 +
 +      * auth.texi (Help for users)
 +      (GnuPG and EasyPG Assistant Configuration): Update docs.
 +
  2010-10-08  Glenn Morris  <rgm@gnu.org>
  
        * cl.texi (Organization, Installation, Old CL Compatibility):
        Deprecate cl-compat for new code.
 -
 -2010-10-07  Glenn Morris  <rgm@gnu.org>
 +      (Usage, Installation): Remove outdated information.
  
        * eudc.texi (CCSO PH/QI, LDAP Requirements): Remove old information.
  
 +2010-10-07  Katsumi Yamaoka  <yamaoka@jpl.org>
 +
 +      * gnus.texi (Gravatars): Document gnus-gravatar-too-ugly.
 +
 +2010-10-06  Julien Danjou  <julien@danjou.info>
 +
 +      * sieve.texi (Manage Sieve API): Document sieve-manage-authenticate.
 +
 +      * message.texi (PGP Compatibility): Remove reference to gpg-2comp,
 +      broken link.
 +
 +      * gnus-faq.texi (FAQ 8-3): Remove references to my.gnus.org.
 +
 +      * gnus.texi (Comparing Mail Back Ends): Remove broken link and allusion
 +      to ReiserFS.
 +
 +      * gnus-faq.texi (FAQ 5-5): Fix Flyspell URL.
 +      (FAQ 7-1): Fix getmail URL.
 +
 +2010-10-06  Daiki Ueno  <ueno@unixuser.org>
 +
 +      * epa.texi (Caching Passphrases): New section.
 +
  2010-10-06  Glenn Morris  <rgm@gnu.org>
  
 -      * cl.texi (Usage, Installation): Remove outdated information.
 +      * Makefile.in (SHELL): Set it.
 +      (info): Move the mkdir dependency to the individual info files.
 +      (mostlyclean): Tidy up.
 +      (clean): Only delete the specific dvi and pdf files.
 +      (maintainer-clean): Be more restrictive in what we delete.
 +      ($(infodir)): Add parallel build workaround.
 +
 +2010-10-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Misc Article): Document gnus-widen-article-window.
 +
 +2010-10-03  Julien Danjou  <julien@danjou.info>
 +
 +      * emacs-mime.texi (Display Customization): Update
 +      mm-inline-large-images documentation and add documentation for
 +      mm-inline-large-images-proportion.
 +
 +2010-10-03  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * tramp.texi (Frequently Asked Questions): Mention
 +      remote-file-name-inhibit-cache.
 +
 +2010-10-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Splitting Mail): Fix @xref syntax.
 +      (Splitting Mail): Really fix the @ref syntax.
 +
 +2010-10-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Splitting Mail): Mention the new fancy splitting
 +      function.
 +      (Article Hiding): Add google banner example.  Suggested by Benjamin
 +      Xu.
 +
 +2010-09-30  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * gnus.texi (Spam Package Configuration Examples, SpamOracle): Remove
 +      nnimap-split-rule from examples.
 +
 +2010-09-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Mail Source Specifiers): Remove webmail.el mentions.
 +      (NNTP): Document nntp-server-list-active-group.  Suggested by Barry
 +      Fishman.
 +      (Client-Side IMAP Splitting): Add nnimap-split-fancy.
 +
 +2010-09-30  Julien Danjou  <julien@danjou.info>
 +
 +      * gnus.texi (Gravatars): Fix documentation about
 +      gnu-gravatar-properties.
 +
 +2010-09-29  Daiki Ueno  <ueno@unixuser.org>
 +
 +      * epa.texi (Bug Reports): New section.
 +
 +2010-09-29  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (top_srcdir): Remove unused variable.
 +
 +2010-09-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Using IMAP): Remove the @acronyms from the headings.
 +      (Client-Side IMAP Splitting): Document 'default.
 +
 +2010-09-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Customizing the IMAP Connection): Document
 +      nnimap-fetch-partial-articles.
 +
 +2010-09-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus-news.texi: Mention nnimap-inbox.
 +
 +      * gnus.texi (Picons): Document gnus-picon-inhibit-top-level-domains.
 +
 +2010-09-26  Julien Danjou  <julien@danjou.info>
 +
 +      * gnus.texi (Oort Gnus): Remove mention of ssl.el.
 +
 +2010-09-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Security): Remove gpg.el mention.
 +
 +2010-09-26  Andreas Seltenreich  <seltenreich@gmx.de>
 +
 +      * gnus.texi (Browse Foreign Server): New variable
 +      gnus-browse-subscribe-newsgroup-method.
 +
 +      * gnus-news.texi: Mention it.
 +
 +2010-09-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (NoCeM): Removed.
 +      (Startup Variables): No jingle.
 +
 +2010-09-25  Ulrich Mueller  <ulm@gentoo.org>
 +
 +      * woman.texi (Interface Options): xz compression is now supported.
 +
 +2010-09-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Article Commands): Document gnus-fetch-partial-articles.
 +      (Unavailable Servers): Document gnus-server-copy-server.
 +      (Using IMAP): Document the new nnimap.
 +
 +2010-09-25  Julien Danjou  <julien@danjou.info>
 +
 +      * gnus.texi (Customizing Articles): Remove gnus-treat-translate.
 +
 +2010-09-24  Glenn Morris  <rgm@gnu.org>
 +
 +      * url.texi (Disk Caching): Tweak previous change.
 +
 +2010-09-24  Julien Danjou  <julien@danjou.info>
 +
 +      * url.texi (Disk Caching): Mention url-cache-expire-time,
 +      url-cache-expired, and url-fetch-from-cache.
 +
 +2010-09-24  Julien Danjou  <julien@danjou.info>
 +
 +      * gnus.texi: Add Gravatars.
 +
 +2010-09-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Startup Variables): Mention gnus-use-backend-marks.
 +
 +2010-09-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Expunging mailboxes): Update name of the expunging
 +      command.
 +
 +2010-09-20  Katsumi Yamaoka  <yamaoka@jpl.org>
 +
 +      * emacs-mime.texi (rfc2047): Update description for
 +      rfc2047-encode-parameter.
 +
 +2010-09-13  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * tramp.texi (Inline methods): Remove "ssh1_old", "ssh2_old" and
 +      "fish" methods.
 +      (External methods): Remove "scp1_old" and "scp2_old" methods.
 +
 +2010-09-09  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * tramp.texi: Remove Japanese manual.  Fix typo.
 +
 +      * trampver.texi: Update release number.  Remove japanesemanual.
 +
 +2010-09-09  Glenn Morris  <rgm@gnu.org>
 +
 +      * org.texi: Restore clobbered changes (copyright years, untabify).
 +
 +2010-09-04  Julien Danjou  <julien@danjou.info>  (tiny change)
 +
 +      * gnus.texi (Adaptive Scoring): Fix typo.
 +
 +2010-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Article Display): Document gnus-html-show-images.
 +
 +2010-09-02  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * cl.texi (Basic Setf): Remove x-get-cut-buffer and x-get-cutbuffer.
 +
 +2010-09-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (HTML): Document gnus-max-image-proportion.
 +
 +2010-08-31  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (HTML): Document gnus-blocked-images.
 +
 +      * message.texi (Wide Reply): Document message-prune-recipient-rules.
 +
 +2010-08-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Summary Mail Commands): Note that only the addresses from
 +      the first message are used for wide replies.
 +      (Changing Servers): Remove documentation on gnus-change-server and
 +      friends, since it's been removed.
 +
 +2010-08-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Drafts): Mention B DEL.
 +
 +2010-08-29  Tim Landscheidt  <tim@tim-landscheidt.de>  (tiny change)
 +
 +      * gnus.texi (Delayed Articles): Mention that the Date header is the
 +      original one, even if you delay.
 +
 +2010-08-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnus.texi (Asynchronous Fetching): Document
 +      gnus-async-post-fetch-function.
 +      (HTML): Made into its own section.
  
  2010-08-26  Michael Albinus  <michael.albinus@gmx.de>
  
  
        * trampver.texi: Update release number.
  
 -2010-08-01  Juanma Barranquero  <lekktu@gmail.com>
 +2010-08-23  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbus.texi (Alternative Buses): New chapter.
 +
 +2010-08-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * cl.texi (Mapping over Sequences): Rename mapc => cl-mapc.
 +
 +2010-08-09  Jay Belanger  <jay.p.belanger@gmail.com>
 +
 +      * calc.texi (Customizing Calc): Rearrange description of new
 +      variables to match the presentation of other variables.
 +
 +2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
  
        * org.texi (Footnotes, Tables in HTML export): Fix typos.
  
 -2010-07-23  Chong Yidong  <cyd@stupidchicken.com>
 +2010-08-08  Jay Belanger  <jay.p.belanger@gmail.com>
 +
 +      * calc.texi (Making Selections, Selecting Subformulas)
 +      (Customizing Calc): Mention how to use faces to emphasize selected
 +      sub-formulas.
 +
 +2010-08-05  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * tramp.texi (External packages): File attributes cache flushing
 +      for asynchronous processes.
 +
 +2010-08-01  Alan Mackenzie  <acm@muc.de>
 +
 +      Enhance the manual for the latest Java Mode.
 +
 +      * cc-mode.texi (Syntactic Symbols): New symbols annotation-top-cont and
 +      annotation-var-cont.
 +      (Java Symbols): Page renamed from Anonymous Class Symbol.  Document the
 +      two new symbols.
 +
 +2010-07-28  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * tramp.texi (Traces and Profiles): Describe verbose level 9.
 +
 +2010-07-27  Chong Yidong  <cyd@stupidchicken.com>
  
        * nxml-mode.texi (Limitations): Remove obsolete discussion (Bug#6708).
  
 +2010-07-19  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * org.texi: Fix typo in previous change (2010-07-19T09:47:27Z!carsten.dominik@gmail.com).
 +
 +2010-07-19  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi: Add macros to get plain quotes in PDF output.
 +      List additional contributors.
 +      (Capture): New section, replaces the section about remember.
 +      (Working With Source Code): New chapter, focused on documenting Org
 +      Babel.
 +      (Code evaluation security): New section.
 +      (MobileOrg): Document DropBox support.
 +      (TaskJuggler export): Document taskjuggler and Gantt chart support.
 +      (Special symbols): Show how to display UTF8 characters for entities.
 +      (Global TODO list): Clarify the use of the "M" key and the differences
 +      to the "m" key.
 +      (RSS Feeds): Mention Atom feeds as well.
 +      (Setting tags): Remove paragraph about
 +      `org-complete-tags-always-offer-all-agenda-tags'.
 +
 +2010-07-17  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * tramp.texi (Inline methods): Remove remark about doubled "-t"
 +      argument.
 +      (Frequently Asked Questions): Recommend "sshx" and "scpx" for
 +      echoing shells.
 +
 +2010-07-10  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * tramp.texi (Inline methods): Remove "kludgy" phrase.
 +      (Filename Syntax): Describe port numbers.
 +
 +2010-07-09  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbus.texi (Top): Introduce Index.  Emphasize "nil" whereever
 +      forgotten.
 +      (Type Conversion): Precise conversion of natural numbers.
 +      (Errors and Events): Add "debugging" to concept index.  Add variable
 +      `dbus-debug'.
 +
 +2010-07-04  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbus.texi (Receiving Method Calls): Add optional argument
 +      EMITS-SIGNAL to `dbus-register-property'.
 +
  2010-06-27  Alex Schroeder  <alex@gnu.org>
  
        * nxml-mode.texi (Commands for locating a schema): Fix typo.
        * idlwave.texi (Load-Path Shadows):
        * org.texi (Handling links): Fix typos.
  
 -2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
 +2010-06-07  Teodor Zlatanov  <tzz@lifelogs.com>
  
 -      * Version 23.2 released.
 +      * gnus.texi (Interactive): Explain effect of gnus-expert-user better.
 +
 +2010-05-26  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * eshell.texi (Built-ins): Describe, how to disable a built-in command
 +      by an alias.  (Bug#6226)
 +
 +2010-05-16  Jay Belanger  <jay.p.belanger@gmail.com>
  
 -2010-05-03  Štěpán Němec  <stepnem@gmail.com>  (tiny change)
 +      * calc.texi (Manipulating Vectors): Mention that vectors can
 +      be used to determine bins for `calc-histogram'.
 +
 +2010-05-13  Jay Belanger  <jay.p.belanger@gmail.com>
 +
 +      * calc.texi: Remove "\turnoffactive" commands throughout.
 +
 +2010-05-08  Štěpán Němec  <stepnem@gmail.com>  (tiny change)
  
        * url.texi (HTTP language/coding, Customization):
        * message.texi (Header Commands, Responses):
        * cl.texi (Argument Lists): Fix typos.
  
 -2010-04-18  Chong Yidong  <cyd@stupidchicken.com>
 +2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * ede.texi (EDE Mode): Refer to init file rather than `.emacs'.  Note
 -      that Development menu is always available.
 +      * ede.texi (EDE Mode): Refer to init file rather than `.emacs'.
 +      Note that Development menu is always available.
        (Creating a project): Fix terminology.
        (Add/Remove files): Fix typo.
  
 -2010-04-17  Teodor Zlatanov  <tzz@lifelogs.com>
 +2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * Version 23.2 released.
 +
 +2010-05-01  Daniel E. Doherty  <ddoherty03@gmail.com>  (tiny change)
 +
 +      * calc.texi (Tutorial): Use "^{\prime}" to indicate primes.
 +
 +2010-05-01  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * tramp.texi (Inline methods, Default Method):
 +      Mention `tramp-inline-compress-start-size'.
 +
 +2010-04-18  Teodor Zlatanov  <tzz@lifelogs.com>
  
        * gnus.texi (Gnus Versions, Oort Gnus): Mention the Git repo instead of
        the CVS repo.  Put the Git repo in the news section.
  
 -      * gnus-coding.texi (Gnus Maintainance Guide): Fixed title typo.
 +      * gnus-coding.texi (Gnus Maintainance Guide): Fix title typo.
        Removed some mentions of CVS.  Mention the new Git repo.
  
 -2010-04-15  Andreas Seltenreich  <seltenreich@gmx.de>
 +2010-04-18  Andreas Seltenreich  <seltenreich@gmx.de>
  
        * gnus.texi (Score File Format): Fix typo.  Reported by Štěpán Němec.
        (Mail Group Commands): Add index entry.
  
 -2010-04-15  Glenn Morris  <rgm@gnu.org>
 +2010-04-18  Glenn Morris  <rgm@gnu.org>
  
        * info.texi (Search Index): Mention Emacs's Info-virtual-index.
  
 -2010-03-14  Michael Albinus  <michael.albinus@gmx.de>
 +2010-04-18  Jay Belanger  <jay.p.belanger@gmail.com>
 +
 +      * calc.texi (Radix modes): Mention that the option prefix will
 +      turn on twos-complement mode.
 +      (Inverse and Hyperbolic Flags): Mention the Option flag.
 +
 +2010-04-15  Carsten Dominik  <carsten.dominik@gmail.com>
 +
 +      * org.texi (LaTeX and PDF export): Add a footnote about xetex.
 +      (LaTeX/PDF export commands): Rename and Move section.
 +      (Sectioning structure): Update.
 +      (References): New use case for field coordinates.
 +      (The export dispatcher): Rename from ASCII export.
 +      (Setting up the staging area): Document the availability of
 +      encryption for MobileOrg.
 +      (Images and tables): Document how to reference labels.
 +      (Index entries): New section.
 +      (Generating an index): New section.
 +      (Column width and alignment): Document that <N> now
 +      means a fixed width, not a maximum width.
 +      (Publishing options): Document the :email option.
 +      (Beamer class export): Fix bug in the BEAMER example.
 +      (Refiling notes): Document refile logging.
 +      (In-buffer settings): Document refile logging keywords.
 +      (Drawers): Document `C-c C-z' command.
 +      (Agenda commands): Mention the alternative key `C-c C-z'.
 +      (Special properties): Document the BLOCKED property.
 +      (The spreadsheet): Mention the formula editor.
 +      (References): Document field coordinates.
 +      (Publishing action): Correct the documentation for the
 +      publishing function.
 +      (The date/time prompt): Document that we accept dates
 +      like month/day/year.
 +      (Cooperation): Document the changes in table.el support.
 +      (Faces for TODO keywords, Faces for TODO keywords)
 +      (Priorities): Document the easy colors.
 +      (Visibility cycling): Document the new double prefix
 +      arg for `org-reveal'.
 +      (Cooperation): Remember.el is part of Emacs.
 +      (Clean view): Mention that `wrap-prefix' is also set by
 +      org-indent-mode.
 +      (Agenda commands): Add information about prefix args to
 +      scheduling and deadline commands.
 +      (Search view): Point to the docstring of
 +      `org-search-view' for more details.
 +      (Agenda commands): Document that `>' prompts for a date.
 +      (Setting tags): Document variable
 +      org-complete-tags-always-offer-all-agenda-tags.
 +      (Column attributes): Cross-reference special properties.
 +
 +2010-04-10  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      Synchronize with Tramp repository.
 +
 +      * tramp.texi (Auto-save and Backup): Remove reference to Emacs 21.
 +      (Frequently Asked Questions): Adapt supported (X)Emacs versions.  Adapt
 +      supported MS Windows versions.  Remove obsolete URL.  Use the $()
 +      syntax, texi2dvi reports errors with the backquotes.
  
        * trampver.texi: Update release number.
  
 +2010-04-01  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * gnus.texi (Finding the News): Add pointers to the Server buffer
 +      because it's essential.
 +
 +2010-03-31  Katsumi Yamaoka  <yamaoka@jpl.org>
 +
 +      * gnus.texi (MIME Commands): Update description of
 +      gnus-article-browse-html-article.
 +
 +2010-03-27  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * auth.texi (Secret Service API): Add TODO node.
 +      (Help for users): Explain the new source options for `auth-sources'.
 +
 +2010-03-24  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * trampver.texi: Update release number.
 +
 +2010-03-10  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * Branch for 23.2.
 +
  2010-03-03  Chong Yidong  <cyd@stupidchicken.com>
  
        * faq.texi (Escape sequences in shell output): Note that ansi-color is
  2010-01-17  Michael Albinus  <michael.albinus@gmx.de>
  
        * tramp.texi (Frequently Asked Questions): Add GNU Emacs 23 and
 -      SXEmacs 22 to the supported systems.  New item for hung ssh sessions.
 +      SXEmacs 22 to the supported systems.  New item for hung ssh sessions.
  
  2010-01-17  Glenn Morris  <rgm@gnu.org>
  
        (Agenda commands): Document new bulk commands.
        (Plain lists): Document new behavior of
        `org-cycle-include-plain-lists'.
 -       Hyphenation only in TeX.
 +      Hyphenation only in TeX.
        (Clocking work time): Document the key to update effort
        estimates.
        (Clocking work time): Document the clock time display.
  2008-06-15  Reiner Steib  <Reiner.Steib@gmx.de>
  
        * gnus.texi (Mail Source Customization): Correct values of
 -       `mail-source-delete-incoming'.  Reported by Tassilo Horn.
 +      `mail-source-delete-incoming'.  Reported by Tassilo Horn.
        (Oort Gnus): Fix version comment for mml-dnd-protocol-alist.
  
  2008-06-14  Reiner Steib  <Reiner.Steib@gmx.de>
  
        * gnus-news.texi, gnus-coding.texi, sasl.texi: New files.
  
 -2007-10-28  Emanuele Giaquinta  <e.giaquinta@glauco.it>  (tiny change)
 -
 -      * gnus-faq.texi ([5.12]): Remove reference to discontinued service.
 -
  2007-10-28  Reiner Steib  <Reiner.Steib@gmx.de>
  
        * gnus.texi (Sorting the Summary Buffer): Remove
  
        * org.texi (Progress logging): New section.
  
 -2006-05-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 -
 -      * viper.texi (Viper Specials):
 -      * gnus.texi (Example Setup):
 -      * faq.texi (Backspace invokes help):
 -      * dired-x.texi (Optional Installation Dired Jump):
 -      * calc.texi (Defining Simple Commands): Use ;; instead of ;;; to better
 -      follow coding conventions.
 -
 -2006-05-18  Reiner Steib  <Reiner.Steib@gmx.de>
 -
 -      * gnus.texi (Saving Articles): Clarify gnus-summary-save-article-mail.
 -
  2006-06-06  Carsten Dominik  <dominik@science.uva.nl>
  
        * org.texi (ASCII export): Document indentation adaptation.
  
        * org.texi: Small typo fixes.
  
 +2006-05-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * viper.texi (Viper Specials):
 +      * gnus.texi (Example Setup):
 +      * faq.texi (Backspace invokes help):
 +      * dired-x.texi (Optional Installation Dired Jump):
 +      * calc.texi (Defining Simple Commands): Use ;; instead of ;;; to better
 +      follow coding conventions.
 +
  2006-05-29  Michael Albinus  <michael.albinus@gmx.de>
  
        * tramp.texi (Frequently Asked Questions): Disable zsh zle.
  
        * gnus.texi (Article Washing): Additions.
  
 -2006-01-08  Alex Schroeder  <alex@gnu.org>
 -
 -      * pgg.texi (Caching passphrase): Rewording.
 -
  2006-01-13  Carsten Dominik  <dominik@science.uva.nl>
  
        * org.texi (Agenda commands): Document tags command.
  
        * org.texi (FAQ): Document `org-table-tab-jumps-over-hlines'.
        (Agenda): Document commands `org-cycle-agenda-files' and
 -      `org-agenda-file-to-front'
 +      `org-agenda-file-to-front'.
        (Built-in table editor): Document `org-table-sort-lines'.
        (HTML formatting): Export of hand-formatted lists.
  
  
  2000-12-14  Dave Love  <fx@gnu.org>
  
 -      * Makefile.in (mostlyclean): Remove gnustmp.*
 +      * Makefile.in (mostlyclean): Remove gnustmp.*.
        (gnus.dvi): Change rule to remove @latex stuff.
  
  2000-10-19  Eric M. Ludlam  <zappo@ultranet.com>
  
  ;; Local Variables:
  ;; coding: utf-8
 -;; fill-column: 79
 -;; add-log-time-zone-rule: t
  ;; End:
  
 -    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
 -      2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
 +  Copyright (C) 1993-1999, 2001-2011  Free Software Foundation, Inc.
  
    This file is part of GNU Emacs.
  
  
    You should have received a copy of the GNU General Public License
    along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 -
 -;; arch-tag: 08b2903e-900c-4c72-a4a9-e76416a80803
diff --combined doc/misc/dired-x.texi
index a1e7e0ae9fcdd601d10a65811a58e53b82c6b8b0,a31a3dac31991e7b1dd47f751097e7431fad55c9..6d2ee8ac872d32a2148ba6143797557a377b103d
@@@ -7,10 -7,9 +7,9 @@@
  @c [Dodd's address no longer valid.]
  
  @comment %**start of header (This is for running Texinfo on a region.)
- @c FOR GNU EMACS USE ../info/dired-x BELOW
  @setfilename ../../info/dired-x
- @c dired-x.el REVISION NUMBER
- @settitle Dired Extra Version 2 User's Manual
+ @settitle Dired Extra User's Manual
  @iftex
  @finalout
  @end iftex
@@@ -18,7 -17,8 +17,7 @@@
  @comment %**end of header (This is for running Texinfo on a region.)
  
  @copying
 -Copyright @copyright{} 1994, 1995, 1999, 2001, 2002, 2003, 2004,
 -2005, 2006, 2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
 +Copyright @copyright{} 1994-1995, 1999, 2001-2011  Free Software Foundation, Inc.
  
  @quotation
  Permission is granted to copy, distribute and/or modify this document
@@@ -47,8 -47,7 +46,7 @@@ developing GNU and promoting software f
  
  @titlepage
  @sp 6
- @c dired-x.el REVISION NUMBER
- @center @titlefont{Dired Extra Version 2}
+ @center @titlefont{Dired Extra}
  @sp 2
  @center @titlefont{For The GNU Emacs}
  @sp 1
  @ifnottex
  
  @node Top
- @comment  node-name,  next,  previous,  up
 +@top Dired Extra
  
  @noindent
- This documents the ``extra'' features for Dired Mode for GNU Emacs that are
+ This documents the ``extra'' features for GNU Emacs's Dired Mode that are
  provided by the file @file{dired-x.el}.
  
  @itemize @bullet
  @item
  Based on @file{dired.texi} by Sebastian Kremer <sk@@thp.uni-koeln.de>
  
- @c dired-x.el REVISION NUMBER
  @item
- For @file{dired-x.el} revision 2
- @c @item
- @c Revision of this manual: 2.53 (2001/02/25 14:05:46)
- @c @item
- @c Bugs to Lawrence R. Dodd <dodd@@roebling.poly.edu>.  @emph{Please} type
- @c @kbd{M-x dired-x-submit-report} to submit a bug report (@pxref{Bugs}).
- @c @item
- @c You can obtain a copy of this package via anonymous ftp in
- @c @t{/roebling.poly.edu:/pub/packages/dired-x.tar.gz}
+ For @file{dired-x.el} as distributed with GNU Emacs 23.
  
  @end itemize
  
  @end ifnottex
  
  @node Introduction, Installation, Top, Top
- @comment  node-name,  next,  previous,  up
  @chapter Introduction
  
- This documents the @emph{extra} features for Dired Mode for GNU Emacs.  It
- is derived from version 1.191 of Sebastian Kremer's @file{dired-x.el}.
- In adopting this @file{dired-x.el} to GNU Emacs v19 some material that has
- been incorporated into @file{dired.el} and @file{dired-aux.el} of the GNU Emacs
- 19 distribution has been removed and some material was modified for agreement
- with the functions in @file{dired.el} and @file{dired-aux.el}.  For example,
- the code using @code{gmhist} history functions was replaced with code using
- the mini-buffer history now built into GNU Emacs.  Finally, a few other
- features have been added and a few more functions have been bound to keys.
+ This documents some @emph{extra} features for GNU Emacs's Dired Mode
+ that are provided by @file{dired-x.el} (derived from Sebastian Kremer's
+ original @file{dired-x.el}).
  
  @ifnottex
  @menu
  @end ifnottex
  
  @node Features, Technical Details, , Introduction
- @comment  node-name,  next,  previous,  up
  @section Features
  @cindex Features
  
@@@ -194,7 -170,6 +170,6 @@@ C-f} and @kbd{C-x 4 C-f} to @code{dired
  Point}).
  
  @node Technical Details, , Features, Introduction
- @comment  node-name,  next,  previous,  up
  @section Technical Details
  @cindex Redefined functions
  @cindex @file{dired-aux.el}
@@@ -222,7 -197,6 +197,6 @@@ and the following functions from @file{
  @end itemize
  
  @node Installation, Omitting Files in Dired, Introduction, Top
- @comment  node-name,  next,  previous,  up
  @chapter Installation
  
  @noindent
@@@ -231,8 -205,8 +205,8 @@@ This manual describes the Dired feature
  file and (optionally) set some variables.
  
  @noindent
- In your @file{.emacs} file in your home directory, or in the system-wide
initialization file @file{default.el} in the @file{site-lisp} directory, put
+ In your @file{~/.emacs} file, or in the system-wide initialization file
+ @file{default.el} in the @file{site-lisp} directory, put
  
  @example
  (add-hook 'dired-load-hook
@@@ -261,48 -235,27 +235,27 @@@ when you first type @kbd{C-x d})
  @end ifnottex
  
  @node Optional Installation Dired Jump, Optional Installation File At Point, , Installation
- @comment  node-name,  next,  previous,  up
  @section Optional Installation Dired Jump
  
  @cindex Autoloading @code{dired-jump} and @code{dired-jump-other-window}
  
  In order to have @code{dired-jump} and @code{dired-jump-other-window}
  (@pxref{Miscellaneous Commands}) work @emph{before} @code{dired} and
- @code{dired-x} have been properly loaded the user should set-up an autoload
+ @code{dired-x} have been properly loaded you should set-up an autoload
  for these functions.  In your @file{.emacs} file put
  
  @example
- ;; Autoload `dired-jump' and `dired-jump-other-window'.
- ;; We autoload from FILE dired.el.  This will then load dired-x.el
- ;; and hence define `dired-jump' and `dired-jump-other-window'.
- (define-key global-map "\C-x\C-j" 'dired-jump)
- (define-key global-map "\C-x4\C-j" 'dired-jump-other-window)
+ (autoload 'dired-jump "dired-x"
+   "Jump to Dired buffer corresponding to current buffer." t)
  
- (autoload (quote dired-jump) "dired" "\
- Jump to Dired buffer corresponding to current buffer.
- If in a file, Dired the current directory and move to file's line.
- If in Dired already, pop up a level and goto old directory's line.
- In case the proper Dired file line cannot be found, refresh the Dired
- buffer and try again." t nil)
+ (autoload 'dired-jump-other-window "dired-x"
+   "Like \\[dired-jump] (dired-jump) but in other window." t)
  
- (autoload (quote dired-jump-other-window) "dired" "\
- Like \\[dired-jump] (dired-jump) but in other window." t nil)
- @end example
- Note that in recent releases of GNU Emacs 19 (i.e., 19.25 or later) the file
- @file{../lisp/loaddefs.el} of the Emacs distribution already contains the
- proper auto-loading for @code{dired-jump} so you need only put
- @example
  (define-key global-map "\C-x\C-j" 'dired-jump)
+ (define-key global-map "\C-x4\C-j" 'dired-jump-other-window)
  @end example
  
- @noindent
- in your @file{.emacs} file in order to have @kbd{C-x C-j} work
- before @code{dired} is loaded.
  @node Optional Installation File At Point, , Optional Installation Dired Jump, Installation
- @comment  node-name,  next,  previous,  up
  @section Optional Installation File At Point
  
  @cindex Binding @code{dired-x-find-file}
@@@ -335,7 -288,6 +288,6 @@@ loade
  @end example
  
  @node Omitting Files in Dired, Local Variables, Installation, Top
- @comment  node-name,  next,  previous,  up
  @chapter Omitting Files in Dired
  
  @cindex Omitting Files in Dired
@@@ -392,8 -344,6 +344,6 @@@ inside @code{dired-load-hook} (@pxref{I
  @end ifnottex
  
  @node Omitting Variables, Omitting Examples, , Omitting Files in Dired
- @comment  node-name,  next,  previous,  up
  @section Omitting Variables
  
  @cindex Customizing file omitting
@@@ -501,7 -451,6 +451,6 @@@ will show up again after reverting the 
  @end table
  
  @node Omitting Examples, Omitting Technical, Omitting Variables, Omitting Files in Dired
- @comment  node-name,  next,  previous,  up
  @section Examples of Omitting Various File Types
  
  @itemize @bullet
@@@ -555,7 -504,6 +504,6 @@@ in the @code{dired-load-hook} (@pxref{I
  @end itemize
  
  @node Omitting Technical, , Omitting Examples, Omitting Files in Dired
- @comment  node-name,  next,  previous,  up
  @section Some Technical Details of Omitting
  
  Loading @file{dired-x.el} will install Dired Omit by putting
  call @code{dired-extra-startup}, which in turn calls @code{dired-omit-startup}
  in your @code{dired-mode-hook}.
  
+ @c FIXME does the standard dir-locals mechanism obsolete this?
  @node Local Variables, Shell Command Guessing, Omitting Files in Dired, Top
- @comment  node-name,  next,  previous,  up
  @chapter Local Variables for Dired Directories
  
  @cindex Local Variables for Dired Directories
@@@ -633,7 -581,6 +581,6 @@@ Variables are hacked
  @end table
  
  @node Shell Command Guessing, Virtual Dired, Local Variables, Top
- @comment  node-name,  next,  previous,  up
  @chapter Shell Command Guessing
  @cindex Guessing shell commands for files.
  
@@@ -740,7 -687,6 +687,6 @@@ History list for commands that read dir
  @end table
  
  @node Virtual Dired, Advanced Mark Commands, Shell Command Guessing, Top
- @comment  node-name,  next,  previous,  up
  @chapter Virtual Dired
  
  @cindex Virtual Dired
@@@ -782,7 -728,6 +728,6 @@@ The regexp is a bit more complicated th
  local-variable files.
  
  @node Advanced Mark Commands, Multiple Dired Directories, Virtual Dired, Top
- @comment  node-name,  next,  previous,  up
  @chapter Advanced Mark Commands
  
  @table @kbd
@@@ -829,8 -774,6 +774,6 @@@ Flag all files with a certain extensio
  @end ifnottex
  
  @node Advanced Cleaning Functions, Advanced Cleaning Variables, , Advanced Mark Commands
- @comment  node-name,  next,  previous,  up
  @section Advanced Cleaning Functions
  
  @table @code
@@@ -862,8 -805,6 +805,6 @@@ and @file{*.dvi} files for deletion
  @end table
  
  @node Advanced Cleaning Variables, Special Marking Function, Advanced Cleaning Functions, Advanced Mark Commands
- @comment  node-name,  next,  previous,  up
  @section Advanced Cleaning Variables
  
  @noindent Variables used by the above cleaning commands (and in the default value for
@@@ -903,8 -844,6 +844,6 @@@ List of extensions of dispensable file
  @end table
  
  @node Special Marking Function, , Advanced Cleaning Variables, Advanced Mark Commands
- @comment  node-name,  next,  previous,  up
  @section Special Marking Function
  
  @table @kbd
@@@ -961,7 -900,6 +900,6 @@@ to mark all @file{.el} files without a 
  @end table
  
  @node Multiple Dired Directories, Find File At Point, Advanced Mark Commands, Top
- @comment  node-name,  next,  previous,  up
  @chapter Multiple Dired Directories and Non-Dired Commands
  
  @cindex Multiple Dired directories
@@@ -978,8 -916,8 +916,8 @@@ A general mechanism is provided for spe
  directory in special major modes:
  
  @table @code
 -@item default-directory-alist
 -@vindex default-directory-alist
 +@item dired-default-directory-alist
 +@vindex dired-default-directory-alist
  Default: @code{((dired-mode . (dired-current-directory)))}
  
  Alist of major modes and their notion of @code{default-directory}, as a
@@@ -990,12 -928,10 +928,10 @@@ in favor of @code{default-directory}
  @findex dired-default-directory
  Use this function like you would use the variable
  @code{default-directory}, except that @code{dired-default-directory}
 -also consults the variable @code{default-directory-alist}.
 +also consults the variable @code{dired-default-directory-alist}.
  @end table
  
  @node Find File At Point, Miscellaneous Commands, Multiple Dired Directories, Top
- @comment  node-name,  next,  previous,  up
  @section Find File At Point
  @cindex Visiting a file mentioned in a buffer
  @cindex Finding a file at point
@@@ -1072,7 -1008,6 +1008,6 @@@ that uses the value of @code{dired-x-ha
  @end table
  
  @node Miscellaneous Commands, Bugs, Find File At Point, Top
- @comment  node-name,  next,  previous,  up
  @chapter Miscellaneous Commands
  
  Miscellaneous features not fitting anywhere else:
@@@ -1141,12 -1076,13 +1076,12 @@@ file (assumed to be a UNIX mail folder)
  
  @vindex dired-vm-read-only-folders
  If you give this command a prefix argument, it will visit the folder
 -read-only.  This only works in VM 5, not VM 4.
 +read-only.
  
  If the variable @code{dired-vm-read-only-folders} is @code{t},
 -@code{dired-vm} will
 -visit all folders read-only.  If it is neither @code{nil} nor @code{t}, e.g.,
 -the symbol @code{if-file-read-only}, only files not writable by you are
 -visited read-only.  This is the recommended value if you run VM 5.
 +@code{dired-vm} will visit all folders read-only.  If it is neither
 +@code{nil} nor @code{t}, e.g., the symbol @code{if-file-read-only}, only
 +files not writable by you are visited read-only.
  
  @vindex dired-bind-vm
  If the variable @code{dired-bind-vm} is @code{t}, @code{dired-vm} will be bound
@@@ -1209,51 -1145,35 +1144,31 @@@ info
  @end table
  
  @node Bugs, GNU Free Documentation License, Miscellaneous Commands, Top
- @comment  node-name,  next,  previous,  up
  @chapter Bugs
  @cindex Bugs
- @findex dired-x-submit-report
  
  @noindent
- If you encounter a bug in this package, wish to suggest an
- enhancement, or want to make a smart remark, then type
- @example
- @kbd{M-x dired-x-submit-report}
- @end example
- @noindent
- to set up an outgoing mail buffer, with the proper address to the
- @file{dired-x.el} maintainer automatically inserted in the @samp{To:@:} field.
- This command also inserts information that the Dired X maintainer can use to
- recreate your exact setup, making it easier to verify your bug or social
- maladjustment.
- Lawrence R. Dodd
- @c <dodd@@roebling.poly.edu>
+ If you encounter a bug in this package, or wish to suggest an
+ enhancement, then please use @kbd{M-x report-emacs-bug} to report it.
  
  @node GNU Free Documentation License, Concept Index, Bugs, Top
  @appendix GNU Free Documentation License
  @include doclicense.texi
  
  @node     Concept Index, Command Index, GNU Free Documentation License, Top
- @comment  node-name,  next,  previous,  up
  @unnumbered Concept Index
  @printindex cp
  
  @node     Command Index, Key Index, Concept Index, Top
- @comment  node-name,  next,  previous,  up
  @unnumbered Function Index
  @printindex fn
  
  @node     Key Index, Variable Index, Command Index, Top
- @comment  node-name,  next,  previous,  up
  @unnumbered Key Index
  @printindex ky
  
  @node     Variable Index,  , Key Index, Top
- @comment  node-name,  next,  previous,  up
  @unnumbered Variable Index
  @printindex vr
  
  @bye
 -
 -@ignore
 -   arch-tag: 201727aa-9318-4c74-a0d7-4f51c550c4de
 -@end ignore
diff --combined src/ChangeLog
index aae583094f28ed3c2b94a8e8499f94132f855577,68e9c76a43786af11c701763700a35c58afffc46..d70da316ba95cdfefe9e04f319a08479461c06e0
 -2011-02-13  Eli Zaretskii  <eliz@gnu.org>
++2011-02-16  Eli Zaretskii  <eliz@gnu.org>
+       * xdisp.c (redisplay_internal): Resynchronize `w' if the selected
+       window is changed inside calls to do_pending_window_change.
+       (Bug#8020)
 -2011-02-12  Eli Zaretskii  <eliz@gnu.org>
 +2011-02-16  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Remove no-longer needed getloadavg symbols.
 +      * m/alpha.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Remove.
 +      * m/amdx86-64.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Remove.
 +      * m/ia64.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Remove.
 +      * m/ibms390.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Remove.
 +      * m/macppc.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Remove.
 +      * m/sparc.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Remove.
 +      * m/template.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Remove.
 +      * m/vax.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Remove.
 +      * s/aix4-2.h (KERNEL_FILE, LDAV_SYMBOL): Remove.
 +      * s/bsd-common.h (KERNEL_FILE, LDAV_SYMBOL): Remove #undef.
 +      * s/hpux10-20.h (KERNEL_FILE, LOAD_AVE_TYPE, LOAD_AVE_CVT):
 +      (LDAV_SYMBOL): Remove.
 +      * s/unixware.h (LOAD_AVE_TYPE, LOAD_AVE_CVT, FSCALE): Remove.
 +      * s/usg5-4-common.h (KERNEL_FILE, LDAV_SYMBOL): Remove.
 +
 +      Import getloadavg module from gnulib.
 +      * deps.mk (getloadavg.o): Remove; gnulib now does this.
 +      * lisp.h (getloadavg) [!defined HAVE_GETLOADAVG]: Remove; gnulib
 +      now does this.
 +      * src/s/freebsd.h (HAVE_GETLOADAVG): Remove; gnulib now does this.
 +      * src/s/netbsd.h (HAVE_GETLOADAVG): Likewise.
 +      * config.in: Regenerate.
 +
 +2011-02-15  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * nsfns.m (ns_set_name_as_filename, Fns_read_file_name): Use B_.
  
 -      * terminal.c (create_terminal): Use default-keyboard-coding-system
 -      and default-terminal-coding-system to initialize coding systems of
 -      the new terminal.  (Bug#7840)
 +2011-02-14  Michael Welsh Duggan  <md5i@md5i.com>
  
 -2011-02-09  Martin Rudalics  <rudalics@gmx.at>
 +      * print.c (float_to_string): Ensure that a decimal point is
 +      printed if using dtoastr (Bug#8033).
 +
 +2011-02-14  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * msdos.c (IT_frame_up_to_date):
 +      * s/msdos.h (MODE_LINE_BINARY_TEXT): Use B_ for the MS-DOS build.
 +
 +      * dired.c (directory_files_internal):
 +      * fileio.c (Finsert_file_contents):
 +      * insdel.c (prepare_to_modify_buffer):
 +      * xdisp.c (pos_visible_p):
 +      * s/ms-w32.h (MODE_LINE_BINARY_TEXT):
 +      * w32fns.c (Fw32_shell_execute, Fx_show_tip, x_create_tip_frame):
 +      Use B_ for the MS-Windows build.
 +
 +2011-02-14  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xrdb.c (x_load_resources): For LUCID and XFT, don't put a
 +      resource that specifies helvetica for menus and dialogs.
 +
 +      * xmenu.c (apply_systemfont_to_dialog): Apply to *dialog.font.
 +      (apply_systemfont_to_menu): Set resources *menubar*font and
 +      *popup*font.  Remove defflt.
 +      (set_frame_menubar, create_and_show_popup_menu): Call
 +      apply_systemfont_to_menu before lw_create_widget.
 +
 +2011-02-14  Tom Tromey  <tromey@redhat.com>
 +
 +      * buffer.c (init_buffer_once, syms_of_buffer): Use B_ in DOS_NT case.
 +
 +      * keyboard.h: Remove obsolete comment.
 +
 +2011-02-14  Tom Tromey  <tromey@parfait>
 +
 +      * composite.c (fill_gstring_header)
 +      (composition_compute_stop_pos, composition_adjust_point)
 +      (Ffind_composition_internal): Use B_.
 +      * intervals.c (set_point_both, get_local_map): Use B_.
 +      * callproc.c (Fcall_process, Fcall_process_region): Use B_.
 +      * process.c (get_process, list_processes_1, Fstart_process)
 +      (Fmake_serial_process, Fmake_network_process)
 +      (read_process_output, send_process, exec_sentinel)
 +      (status_notify, setup_process_coding_systems): Use B_.
 +      * bytecode.c (Fbyte_code): Use B_.
 +      * syntax.c (update_syntax_table, dec_bytepos, Fsyntax_table)
 +      (Fset_syntax_table, Fmodify_syntax_entry, skip_chars)
 +      (skip_syntaxes, scan_lists): Use B_.
 +      * lread.c (readchar, unreadchar, openp, readevalloop)
 +      (Feval_buffer, Feval_region): Use B_.
 +      * print.c (printchar, strout, print_string, PRINTDECLARE)
 +      (PRINTPREPARE, PRINTFINISH, temp_output_buffer_setup)
 +      (print_object): Use B_.
 +      * font.c (font_at): Use B_.
 +      * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5): Use
 +      B_.
 +      * callint.c (check_mark, Fcall_interactively): Use B_.
 +      * editfns.c (region_limit, Fmark_marker, save_excursion_save)
 +      (save_excursion_restore, Fprevious_char, Fchar_before)
 +      (general_insert_function, Finsert_char, Finsert_byte)
 +      (make_buffer_string_both, Finsert_buffer_substring)
 +      (Fcompare_buffer_substrings, subst_char_in_region_unwind)
 +      (subst_char_in_region_unwind_1, Fsubst_char_in_region)
 +      (Ftranslate_region_internal, save_restriction_restore)
 +      (Fchar_equal): Use B_.
 +      * data.c (swap_in_symval_forwarding, set_internal)
 +      (Fmake_local_variable, Fkill_local_variable, Flocal_variable_p):
 +      Use B_.
 +      * undo.c (record_point, record_insert, record_delete)
 +      (record_marker_adjustment, record_first_change)
 +      (record_property_change, Fundo_boundary, truncate_undo_list)
 +      (Fprimitive_undo): Use B_.
 +      * search.c (compile_pattern_1, compile_pattern, looking_at_1)
 +      (string_match_1, fast_looking_at, newline_cache_on_off)
 +      (search_command, search_buffer, simple_search, boyer_moore)
 +      (Freplace_match): Use B_.
 +      * indent.c (buffer_display_table, recompute_width_table)
 +      (width_run_cache_on_off, current_column, scan_for_column)
 +      (Findent_to, position_indentation, compute_motion, vmotion): Use
 +      B_.
 +      * casefiddle.c (casify_object, casify_region): Use B_.
 +      * casetab.c (Fcurrent_case_table, set_case_table): Use B_.
 +      * cmds.c (Fself_insert_command, internal_self_insert): Use B_.
 +      * fileio.c (Fexpand_file_name, Ffile_directory_p)
 +      (Ffile_regular_p, Ffile_selinux_context)
 +      (Fset_file_selinux_context, Ffile_modes, Fset_file_modes)
 +      (Fset_file_times, Ffile_newer_than_file_p, decide_coding_unwind)
 +      (Finsert_file_contents, choose_write_coding_system)
 +      (Fwrite_region, build_annotations, Fverify_visited_file_modtime)
 +      (Fset_visited_file_modtime, auto_save_error, auto_save_1)
 +      (Fdo_auto_save, Fset_buffer_auto_saved): Use B_.
 +      * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Use B_.
 +      * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted)
 +      (set_marker_both, set_marker_restricted_both, unchain_marker): Use
 +      B_.
 +      * insdel.c (check_markers, insert_char, insert_1_both)
 +      (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
 +      (adjust_after_replace, replace_range, del_range_2)
 +      (modify_region, prepare_to_modify_buffer)
 +      (Fcombine_after_change_execute): Use B_.
 +      * filelock.c (unlock_all_files, Flock_buffer, Funlock_buffer)
 +      (unlock_buffer): Use B_.
 +      * keymap.c (Flocal_key_binding, Fuse_local_map)
 +      (Fcurrent_local_map, push_key_description)
 +      (Fdescribe_buffer_bindings): Use B_.
 +      * keyboard.c (command_loop_1, read_char_minibuf_menu_prompt)
 +      (read_key_sequence): Use B_.
 +      * fringe.c (get_logical_cursor_bitmap)
 +      (get_logical_fringe_bitmap, update_window_fringes): Use B_.
 +      * xfns.c (x_create_tip_frame, Fx_show_tip): Use B_.
 +      * xfaces.c (compute_char_face): Use B_.
 +      * character.c (chars_in_text, Fget_byte): Use B_.
 +      * category.c (check_category_table, Fcategory_table)
 +      (Fset_category_table, char_category_set): Use B_.
 +      * coding.c (decode_coding, encode_coding)
 +      (make_conversion_work_buffer, decode_coding_gap)
 +      (decode_coding_object, encode_coding_object)
 +      (Fdetect_coding_region, Ffind_coding_systems_region_internal)
 +      (Funencodable_char_position, Fcheck_coding_systems_region): Use
 +      B_.
 +      * charset.c (Ffind_charset_region): Use B_.
 +      * window.c (window_display_table, unshow_buffer, window_loop)
 +      (window_min_size_2, set_window_buffer, Fset_window_buffer)
 +      (select_window, Fforce_window_update, temp_output_buffer_show)
 +      (Fset_window_configuration, save_window_save): Use B_.
 +      * xdisp.c (pos_visible_p, init_iterator, reseat_1)
 +      (message_dolog, update_echo_area, ensure_echo_area_buffers)
 +      (with_echo_area_buffer, setup_echo_area_for_printing)
 +      (set_message_1, update_menu_bar, update_tool_bar)
 +      (text_outside_line_unchanged_p, redisplay_internal)
 +      (try_scrolling, try_cursor_movement, redisplay_window)
 +      (try_window_reusing_current_matrix, row_containing_pos)
 +      (try_window_id, get_overlay_arrow_glyph_row, display_line)
 +      (Fcurrent_bidi_paragraph_direction, display_mode_lines)
 +      (decode_mode_spec_coding, decode_mode_spec, display_count_lines)
 +      (get_window_cursor_type, note_mouse_highlight): Use B_.
 +      * frame.c (make_frame_visible_1): Use B_.
 +      * dispnew.c (Fframe_or_buffer_changed_p): Use B_.
 +      * dispextern.h (WINDOW_WANTS_HEADER_LINE_P)
 +      (WINDOW_WANTS_MODELINE_P): Use B_.
 +      * syntax.h (Vstandard_syntax_table): Update.
 +      (CURRENT_SYNTAX_TABLE, SETUP_BUFFER_SYNTAX_TABLE): Use B_.
 +      * intervals.h (TEXT_PROP_MEANS_INVISIBLE): Update.
 +      (TEXT_PROP_MEANS_INVISIBLE): Use B_.
 +      * character.h (FETCH_CHAR_ADVANCE): Update.
 +      (INC_BOTH, ASCII_CHAR_WIDTH, DEC_BOTH): Use B_.
 +      * category.h (Vstandard_category_table): Update.
 +      * lisp.h (DEFVAR_BUFFER_DEFAULTS): Update for change to field
 +      names.
 +      (DOWNCASE_TABLE, UPCASE_TABLE): Use B_.
 +      * buffer.c (swapfield_): New macro.
 +      (Fbuffer_swap_text): Use swapfield_ where appropriate.
 +      (Fbuffer_live_p, Fget_file_buffer, get_truename_buffer)
 +      (Fget_buffer_create, clone_per_buffer_values)
 +      (Fmake_indirect_buffer, reset_buffer)
 +      (reset_buffer_local_variables, Fbuffer_name, Fbuffer_file_name)
 +      (Fbuffer_local_value, buffer_lisp_local_variables)
 +      (Fset_buffer_modified_p, Frestore_buffer_modified_p)
 +      (Frename_buffer, Fother_buffer, Fbuffer_enable_undo)
 +      (Fkill_buffer, Fset_buffer_major_mode, set_buffer_internal_1)
 +      (set_buffer_temp, Fset_buffer, set_buffer_if_live)
 +      (Fbarf_if_buffer_read_only, Fbury_buffer, Ferase_buffer)
 +      (Fbuffer_swap_text, Fset_buffer_multibyte)
 +      (swap_out_buffer_local_variables, record_overlay_string)
 +      (overlay_strings, init_buffer_once, init_buffer, syms_of_buffer):
 +      Use B_.
 +      * buffer.h (struct buffer): Rename all Lisp_Object fields.
 +      (BUFFER_INTERNAL_FIELD, B_): New macro.
 +      (FETCH_CHAR, FETCH_CHAR_AS_MULTIBYTE): Use B_.
 +
 +2011-02-14  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * gtkutil.c (xg_tool_bar_menu_proxy): Handle case when tool bar label
 +      is null.
 +
 +2011-02-13  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * callproc.c (Fcall_process):
 +      * process.c (create_process): Replace Gtk with GConf in SIGPIPE
 +      comment.
 +
 +2011-02-12  Martin Rudalics  <rudalics@gmx.at>
  
        * window.c (select_window): Check inhibit_point_swap argument when
        deciding whether to return immediately.
  
 -2011-02-08  Jan Djärv  <jan.h.d@swipnet.se>
 +2011-02-12  Jan Djärv  <jan.h.d@swipnet.se>
  
        * nsterm.m (setFrame, initFrame): Make sure pixel_height doesn't become
        zero (Bug#7348).
  
 -2011-02-03  Glenn Morris  <rgm@gnu.org>
 +2011-02-12  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * config.in (TERMINFO): New definition.
 +
 +      * s/netbsd.h: Use it to choose between terminfo and termcap
 +      (Bug#7642).
 +
 +2011-02-12  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * md5.c (md5_process_bytes): Use sizeof, not __alignof__.
 +      The difference doesn't matter here, in practice, and sizeof is
 +      more portable to non-GCC compilers.  Also, this makes the code
 +      match the already-existing comment.
 +
 +2011-02-12  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * process.c (create_process): Reset SIGPIPE handler in the child.
 +      * callproc.c (Fcall_process): Likewise.  (Bug#5238)
 +
 +2011-02-12  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c <this_line_min_pos>: New variable.
 +      (move_it_in_display_line_to): Record in this_line_min_pos the
 +      smallest position iterated across.
 +      (display_line): Use this_line_min_pos to record the smallest
 +      position in the line even if it is not displayed due to
 +      hscrolling.  (Bug#7939)
 +
 +2011-02-12  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Port to Sun C 5.11, which has __attribute__ ((__aligned (N))).
 +      * md5.h (ATTRIBUTE_ALIGNED): New macro.
 +      (struct md5_ctx): Use it.
 +
 +      Port to Solaris 10, which doesn't support FC_HINT_STYLE.
 +      * xftfont.c (FC_HINT_STYLE): #define to "hintstyle" if not
 +      defined.
 +      * xsettings.c (parse_settings, apply_xft_settings): Don't assume
 +      FC_HINT_STYLE is supported.
 +
 +2011-02-11  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.c (x_set_frame_alpha): Access data before it is free:d.
 +      Make sure we don't do x_catch_errors twice.
 +
 +2011-02-10  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (really-lwlib): Depend on globals.h, for parallel builds.
 +
 +2011-02-09  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * makefile.w32-in (GLOBAL_SOURCES, SOME_MACHINE_OBJECTS, obj):
 +      New macros.
 +      (globals.h, gl-stamp): New targets.
 +      (clean): Clean gl-stamp and globals.h.
 +
 +2011-02-09  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * Makefile.in (gl-stamp): Create globals.h here.
 +      (globals.h): Don't do it here.
 +      (mostlyclean): Clean globals.h and gl-stamp.
 +
 +2011-02-09  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * Makefile.in ($(otherobj)): Depend on globals.h.
 +      Otherwise 'make -j10' failed on my host, because the build lacked
 +      necessary dependencies, e.g., vm-limit.o depends on globals.h.
 +
 +2011-02-08  Tom Tromey  <tromey@redhat.com>
 +
 +      * Makefile.in (NS_OBJC_OBJ): New variable.
 +      (base_obj): Rename from 'obj'.
 +      (obj): New variable.
 +      (globals.h, gl-stamp, $(obj)): New targets.
 +      (GLOBAL_SOURCES): New variable.
 +      * globals.h: Remove.
 +      * nsselect.m (Vselection_alist): Define.  Reverts part of
 +      2011-01-19T22:11:33Z!jan.h.d@swipnet.se.
 +      * buffer.c: Don't use "no_cell" for name of kill-buffer-hook's
 +      variable.
 +      * xselect.c (Vselection_alist): Define.  Reverts part of 2011-01-19T23:32:42Z!eggert@cs.ucla.edu.
 +
 +2011-02-08  Kenichi Handa  <handa@m17n.org>
 +
 +      * font.c (Ffont_get): Do not cache :otf value.
 +
 +2011-02-07  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      conform to C89 pointer rules
 +
 +      * dired.c (scmp, file_name_completion):
 +      Change types between char * and unsigned char *, to satisfy C89
 +      rules about pointer type compatibility.
 +      * casefiddle.c (casify_object, casify_region): Likewise.
 +      * search.c (Freplace_match, Fregexp_quote): Likewise.
 +      * alloc.c (make_string, make_specified_string, make_pure_string):
 +      Likewise.
 +      * data.c (Fstring_to_number): Likewise.
 +      * print.c (float_to_string, PRINTFINISH, printchar, strout):
 +      (print_object): Likewise.
 +      * editfns.c (init_editfns, Fchar_to_string, Fbyte_to_string):
 +      (Fuser_full_name, Fsubst_char_in_region, Ftranslate_region_internal):
 +      (Fformat): Likewise.
 +      * callint.c (Fcall_interactively): Likewise.
 +      * fns.c (string_make_multibyte, string_to_multibyte):
 +      (string_make_unibyte, Fstring_as_unibyte, Fstring_to_unibyte):
 +      (Fbase64_encode_region, base64_encode_1, Fbase64_decode_region, Fmd5):
 +      Likewise.
 +      * lread.c (read1, hash_string): Likewise.
 +      * process.c (read_process_output, send_process, Fprocess_send_region):
 +      Likewise.
 +      * callproc.c (Fcall_process): Likewise.
 +      * doprnt.c (doprnt): Likewise.
 +      * indent.c (compute_motion): Likewise.
 +      * xfont.c (xfont_decode_coding_xlfd): Likewise.
 +      * ralloc.c (resize_bloc): Likewise.
 +      * image.c (tiff_load): Likewise.
 +      * xml.c (make_dom, parse_region): Likewise.
 +      * character.c (strwidth): Make its argument const char *, not const
 +      unsigned char *, since more callers prefer it that way.  All callers
 +      changed.
 +
 +2011-02-06  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * xterm.c (x_alloc_nearest_color_1): Avoid unportable int assumption.
 +      Emacs assumes two's complement elsewhere, but the assumption is
 +      easy to remove here, and this suppresses a warning with Sun C 5.8.
 +
 +      conform to C89 pointer rules
 +
 +      * xterm.c (x_draw_fringe_bitmap, handle_one_xevent, x_bitmap_icon):
 +      (same_x_server, x_term_init):
 +      Change types between char * and unsigned char *, to satisfy C89
 +      rules about pointer type compatibility.
 +      * doc.c (get_doc_string, Fsnarf_documentation):
 +      (Fsubstitute_command_keys): Likewise.
 +      * xfns.c (Fx_open_connection, Fx_window_property): Likewise.
 +      * bitmaps/gray.xbm (gray_bits): Likewise.
 +      * image.c (xbm_read_bitmap_data, xbm_load_image, xbm_load): Likewise.
 +      * keyboard.c (echo_char, MULTI_LETTER_MOD, tty_read_avail_input):
 +      Likewise.
 +      * keymap.c (Ftext_char_description): Likewise.
 +      * minibuf.c (Fread_buffer): Likewise.
 +      * fileio.c (IS_DRIVE) [defined WINDOWSNT]:
 +      (DRIVE_LETTER) [defined DOS_NT]:
 +      (report_file_error, Ffile_name_directory, Ffile_name_nondirectory):
 +      (make_temp_name, Fexpand_file_name, file_name_absolute_p):
 +      (search_embedded_absfilename, Fsubstitute_in_file_name):
 +      (barf_or_query_if_file_exists, Fmake_directory_internal):
 +      (Fdelete_directory_internal, Ffile_name_absolute_p, read_non_regular):
 +      (Finsert_file_contents, Fwrite_region):
 +      Likewise.
 +      * insdel.c (insert, insert_and_inherit, insert_before_markers):
 +      (insert_before_markers_and_inherit, insert_1, insert_1_both):
 +      Likewise.  This changes these functions' signatures, which is
 +      more convenient since most callers use char *.  All remaining
 +      callers changed.
 +      * editfns.c (general_insert_function): Change signature to
 +      match changes to insert functions' signatures.
 +      * keymap.c (map_keymap_char_table_item, map_keymap_internal): Use
 +      explicit cast when converting between void * and function pointer
 +      types, as C89 requires this.
 +
 +2011-02-05  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      don't ignore chdir failure
 +      * sysdep.c (sys_subshell) [!defined DOS_NT]: Diagnose chdir
 +      failure and exit.
 +      (sys_subshell) [defined DOS_NT]: Mark with a FIXME the two
 +      remaining unchecked chdir calls in this function; some DOS/NT
 +      expert needs to fix them.
 +      * emacs.c (main): Mark with a FIXME the unchecked chdir calls
 +      in this function; some NextStep expert needs to fix them.
 +
 +2011-02-05  Glenn Morris  <rgm@gnu.org>
  
        * xfaces.c (Finternal_set_lisp_face_attribute):
        Try to clarify some error messages.  (Bug#2659)
  
 -2011-02-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 +2011-02-05  Stefan Monnier  <monnier@iro.umontreal.ca>
  
        * editfns.c (save_restriction_restore): Don't forget to invalidate the
        current_column cache (bug#7946).
  
 -2011-02-02  Kenichi Handa  <handa@m17n.org>
 +2011-02-05  Kenichi Handa  <handa@m17n.org>
  
        * ftfont.c (ftfont_open): Use FC_DUAL only when it is defined.
  
        * xftfont.c (xftfont_open): Likewise.
  
 -2011-02-01  Andreas Schwab  <schwab@linux-m68k.org>
 +2011-02-05  Andreas Schwab  <schwab@linux-m68k.org>
  
        * window.c (Fselect_window): Add missing return value.
  
 -2011-01-29  Andreas Schwab  <schwab@linux-m68k.org>
 +2011-02-05  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      xstrcasecmp: conform to C89 pointer rules
 +      * xfaces.c (xstrcasecmp): Change args from const unsigned char *
 +      to const char *, since they're usually low-level C strings, and
 +      this stays compatible with C89 pointer rules.  All callers changed.
 +
 +      * charset.c: conform to C89 pointer rules
 +      (define_charset_internal): Switch between char * and unsigned char *.
 +
 +      * xmenu.c: conform to C89 const rules
 +      (xmenu_show, xdialog_show): Declare local var as char *, not
 +      const char *, to stay compatible with C89 const rules.
 +
 +      * xdisp.c: conform to C89 pointer rules
 +      (store_mode_line_noprop, display_string, reseat_to_string):
 +      (c_string_pos, number_of_chars, message_dolog):
 +      (message_log_check_duplicate, set_message_1, store_mode_line_noprop):
 +      (display_mode_element, display_string):
 +      Switch between char * and unsigned char * to stay compatible wth
 +      C89 pointer rules.
 +
 +      * regex.c: conform to C89 pointer rules
 +      (re_wctype): Add cast, as C89 does not allow assigning between
 +      char * and unsigned char *.
 +      (regex_compile): Likewise.
 +
 +      sync from gnulib to remove HAVE_STDBOOL_H
 +      * config.in: Regenerate.
 +
 +2011-02-04  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * makefile.w32-in (LISP_H, PROCESS_H): New variables.
 +      Replace all uses of lisp.h with $(LISP_H), and all uses of
 +      process.h with $(PROCESS_H).
 +      ($(BLD)/editfns.$(O)): Depend on ../lib/strftime.h.
 +      ($(BLD)/print.$(O)): Depend on ../lib/ftoastr.h and ../lib/intprops.h.
 +
 +      * deps.mk: Update for recent changes: gnutls support, gnulib
 +      imports, addition of globals.h.
 +
 +      * makefile.w32-in ($(BLD)/sysdep.$(O)): Depend on
 +      ../lib/ignore-value.h.
 +
 +2011-02-03  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      allow C code to suppress warnings about ignored return values
 +
 +      We need to go through the code and for each such warning, either
 +      fix the code to pay attention to the returned value, or tell GCC
 +      that we really do want to ignore the returned value.  Here is one
 +      example of how to do the latter.
 +      * sysdep.c: Include <ignore-value.h>.
 +      (sys_subshell): Suppress an undesirable warning about not checking
 +      the returned value of 'write', as there's nothing useful one can
 +      do with that returned value.
 +
 +2011-02-03  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.c (x_connection_closed): Remove all calls that calls
 +      XSync (Bug#7949).
 +
 +2011-02-01  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * image.c (tiff_load): Avoid compiler warning in 2nd arg to
 +      TIFFClientOpen.
 +
 +2011-02-01  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsmfns.c (ice_connection_closed): Call delete_read_fd.
 +      (x_session_check_input): Change args and return type so it can be used
 +      as argument to add_read_fd.  Make static.  Remove call to select.
 +      Call kbd_buffer_store_event for emacs_event.
 +      (smc_save_yourself_CB): Also store initial argv to SmRestartCommand.
 +      (ice_conn_watch_CB): Call add_read_fd.
 +
 +      * xterm.c (XTread_socket): Remove HAVE_X_SM block with call to
 +      x_session_check_input.
 +      (x_session_initialized): Remove definition.
 +      (x_initialize): Remove setting of x_session_initialized.
 +
 +      * xterm.h (x_session_check_input): Remove declaration.
 +
 +2011-02-01  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      format-time-string now supports subsecond time stamp resolution
 +      * editfns.c (emacs_nmemftime): Renamed from emacs_memftimeu,
 +      for consistency with its new argument and with gnulib nstrftime.
 +      All callers changed.  New argument NS.
 +      (Fformat_time_string): Check that the time argument's microseconds
 +      component, if any, is in range; this avoids integer overflow and
 +      also nstrftime needs this.  Document %N.
 +
 +2011-01-31  Andreas Schwab  <schwab@linux-m68k.org>
  
        * image.c (DEF_IMGLIB_FN): Add parameter rettype, use it instead
        of int.  All uses adjusted.
        (PNG_JMPBUF, png_load, jpeg_load, tiff_load, gif_load)
        (svg_load_image): Remove casts.
  
 -2011-01-29  Chong Yidong  <cyd@stupidchicken.com>
 +2011-01-31  Chong Yidong  <cyd@stupidchicken.com>
  
        * image.c (fn_png_longjmp, fn_png_set_longjmp_fn): New png
        function definitions for compiling with libpng-1.5.
        (my_png_error, png_load): Use them.  Suggested by Thomas Klausner
        (Bug#7908).
  
 +2011-01-31  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * s/ms-w32.h (HAVE_STRFTIME): Don't define.
 +
 +      * makefile.w32-in (OBJ2): Remove strftime.$(O).
 +      ($(BLD)/strftime.$(O)): Remove prerequisites.
 +
 +2011-01-31  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      src/emacs.c now gets version number from configure.in
 +      * emacs.c (emacs_version): Set to VERSION so that it
 +      is determined automatically from ../configure.in.
 +
 +2011-01-31  Jim Meyering  <meyering@redhat.com>
 +
 +      * charset.c (load_charset_map): Don't deref NULL on failed malloc.
 +      Use xmalloc rather than malloc.
 +
 +2011-01-30  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      strftime: import from gnulib
 +      * Makefile.in (obj): Remove strftime.o, as gnulib now does this for us.
 +      * deps.mk (strftime.o): Remove.
 +      * editfns.c: Include <strftime.h>, supplied by gnulib.
 +      (emacs_strftimeu): Remove decl.
 +      (emacs_memftimeu): Use nstrftime (the gnulib name) rather than
 +      emacs_strftimeu.
 +      * config.in: Regenerate.
 +      * strftime.c: Remove; we now use strftime from gnulib.
 +
 +      Use SSDATA when the context wants char *.
 +      * alloc.c, buffer.c, bytecode.c, callproc.c, dired.c:
 +      * dispnew.c, doc.c, editfns.c, emacs.c, fileio.c, filelock.c:
 +      * fns.c, font.c, frame.c, image.c, indent.c, keyboard.c:
 +      * lread.c, minibuf.c, print.c, process.c, search.c, widget.c:
 +      * xdisp.c, xfaces.c, xfns.c, xml.c, xselect.c, xterm.c:
 +      Use SSDATA (not SDATA) when the context of the expression wants
 +      char * (not unsigned char *).
 +
 +2011-01-30  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * .gdbinit: Read global lisp variables as globals.f_V*.
 +
 +2011-01-30  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * font.c (PROP_MATCH): Remove parameter N and use strlen instead.
 +      All uses changed.
 +      (PROP_SAVE): Likewise.
 +
 +2011-01-29  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * keyboard.c (make_lispy_position): Fix typo in last change
 +      (Bug#7935).
 +
 +2011-01-29  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * s/ms-w32.h (HAVE_MKTIME): Remove.
 +
 +      * makefile.w32-in (LOCAL_FLAGS): Add -I../lib.
 +      (GNULIB): New variable.
 +      (LIBS): Add $(GNULIB).
 +      $(TEMACS): Depend on $(GNULIB).
 +      <top-level>: Fix font-lock disrupted by a lone `"'.
 +
 +2011-01-29  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsselect.m (ns_string_from_pasteboard): Get length of string
 +      and use make_string instead of build_string (Bug#7934).
 +      (ns_string_to_pasteboard_internal): Use initWithBytesNoCopy
 +      instead of stringWithUTF8String  (Bug#7934).
 +
 +2011-01-29  Anders Lindgren  <andlind@gmail.com> (tiny change)
 +
 +        * nsfont.m (nsfont_open): Ensure that fonts with inexact
 +        descenders would not become one pixel too tall (Bug#7887).
 +
  2011-01-28  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * m/intel386.h: Define NO_ARG_ARRAY.  Suggested by Dan Nicolaescu.
 +      * keyboard.c (make_lispy_position): For clicks on right fringe or
 +      margin, compute text position using the X coordinate relative to
 +      the left of the text area (Bug#7839).
 +
 +2011-01-28  Kenichi Handa  <handa@m17n.org>
 +
 +      * ftfont.c (ftfont_spec_pattern): Check each extra property
 +      value.
 +
 +2011-01-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * xdisp.c (safe_eval_handler): Distinguish symbols and strings.
  
  2011-01-27  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * font.c (font_parse_fcname): Require GTK-style font sizes to
 -      occur at the end of the font string (Bug#7853).
 +      * font.c (font_parse_fcname): Undefine a temporary macro.
 +
 +2011-01-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      Let the debugger continue to the normal handler (bug#7825).
 +      * eval.c (maybe_call_debugger): Declare before new use.
 +      (find_handler_clause): Don't call debugger any more.
 +      Ignore Vstack_trace_on_error.
 +      Use XCAR/XCDR.
 +      (syms_of_eval): Remove Vstack_trace_on_error.
 +      (Fsignal): Only modify handlerlist when we know we need to do it.
 +      Call the debugger when necessary.
 +      * globals.h (Vstack_trace_on_error): Remove.
  
  2011-01-26  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * font.c (font_parse_fcname): Fix typo in string length.
 +      * font.c (font_parse_fcname): Rewrite GTK font name parser.
  
 -2011-01-24  Stefan Monnier  <monnier@iro.umontreal.ca>
 +2011-01-25  Stefan Monnier  <monnier@iro.umontreal.ca>
  
        * xdisp.c (handle_fontified_prop): Be careful with font-lock changing
        the buffer's point-max (bug#7876).
  
 -2011-01-23  Chong Yidong  <cyd@stupidchicken.com>
 +2011-01-25  Chong Yidong  <cyd@stupidchicken.com>
  
        * lisp.h (XPNTR): Obey DATA_SEG_BITS in all non-USE_LSB_TAG cases.
 -      Remove unused HAVE_SHM branch (Bug#6811).
 +      Remove unused case (Bug#6811).
 +
 +2011-01-23  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (x_set_offset): Set dont_constrain to 0 so the call to
 +      setFrameTopLeftPoint is constrained.
 +
 +2011-01-23  Paul Eggert  <eggert@cs.ucla.edu>
  
 -2011-01-23  Peter O'Gorman  <bug-gnu-emacs@mlists.thewrittenword.com>  (tiny change)
 +      Check return values of some library calls.
 +      * emacs.c (main): Check dup result.
 +      * frame.c: Include <limits.h>, for INT_MIN and INT_MAX.
 +      (frame_name_fnn_p): Check strtol result.
  
 -      * s/hpux11.h: Set CANNOT_DUMP on IA64 (Bug#6811).
 +      * image.c (x_create_bitmap_from_xpm_data): Add cast to fix type clash
 +      when calling XpmCreatePixmapFromData.
 +
 +      Promote SSDATA macro from gtkutil.c and xsmfns.c to lisp.h.
 +      * lisp.h (SSDATA): New macro.
 +      All uses of (char *) SDATA (x) replaced with SSDATA (x),
 +      and all uses of (unsigned char *) SDATA (x) replaced with SDATA (x).
 +      * gtkutil.c (SSDATA): Remove, as lisp.h now defines this.
 +      * xsmfns.c (SSDATA): Likewise.
  
  2011-01-22  Martin Rudalics  <rudalics@gmx.at>
  
        (inhibit_point_swap): Variable deleted.
        (Fset_window_configuration): Call select_window directly.
  
 -2011-01-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 +2011-01-22  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (constrainFrameRect): Only constrain the first time called.
 +
 +2011-01-21  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (x_set_offset, windowDidMove): When calculating y, use first
 +      screen, not the window screen.
 +      (x_set_window_size): Remove constraints.
 +      Calculate origin.y only if zooming is 0 and without referring to a
 +      screen.
 +      (windowWillResize): Don't modify frameSize.
 +      (windowDidBecomeKey, mouseDown): Set dont_constrain to 1.
 +      (initFrameFromEmacs): Initialize ns_userRect.
 +      (windowShouldZoom): Set zooming to one.  Remove all other code.
 +      (windowWillUseStandardFrame): Move static ns_userRect to EmacsView.
 +      Zero it after restore.
 +      (constrainFrameRect): New method for EmacsWindow.
 +      (mouseDragged): Always post NSWindowDidResizeNotification after call to
 +      windowWillResize.
 +
 +      * nsterm.h (ns_output): Add dont_constrain and zooming.
 +      (EmacsView): Add ns_userRect.
 +
 +      * nsterm.m (keyDown): If ns_right_alternate_modifier is Qleft, check
 +      if ns_alternate_modifier is none.
 +
 +2011-01-20  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * unexmacosx.c: Add comment about include order.
 +
 +2011-01-20  Glenn Morris  <rgm@gnu.org>
 +
 +      * minibuf.c (syms_of_minibuf) <read-expression-history>:
 +      Give it a doc string.
 +      * globals.h: Add Vread_expression_history.
 +
 +      * macros.c (syms_of_macros) <kbd-macro-termination-hook>:
 +      Give it a doc string.
 +      * globals.h: Add Vkbd_macro_termination_hook.
 +
 +2011-01-20  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * fns.c (Fyes_or_no_p): Revert 2011-01-07 change, removing ARGS.
 +
 +2011-01-19  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix X11 compilation failure.
 +      * globals.h (struct emacs_globals): Document f_Vselection_alist.
 +      * xselect.c (Vselection_alist): Remove declaration, moving its
 +      documentation to globals.h.  This fixes a compilation failure
 +      induced by the earlier change to globals.h today.
 +
 +2011-01-19  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * unexmacosx.c: Include config.h before unistd.h (Bug#7859).
 +
 +      * nsterm.m (ns_input_file, ns_input_font, ns_input_fontsize)
 +      (ns_input_line, ns_input_color, ns_input_text, ns_working_text)
 +      (ns_input_spi_name, ns_input_spi_arg)
 +      (ns_alternate_modifier, ns_right_alternate_modifier)
 +      (ns_command_modifier, ns_right_command_modifier, ns_control_modifier)
 +      (ns_right_control_modifier, ns_function_modifier)
 +      (ns_antialias_text, ns_confirm_quit): Move to globals.h.
 +      (Vx_toolkit_scroll_bars, x_use_underline_position_properties)
 +      (x_underline_at_descent_line): Remove declaration.
 +      (syms_of_nsterm): Remove & from DEFVAR_LISP and DEFVAR_BOOL.
 +
 +      * nsselect.m (Vns_sent_selection_hooks, Vns_lost_selection_hooks
 +      (Vselection_alist, Vselection_converter_alist): Move to globals.h.
 +      (syms_of_nsselect): Remove & from DEFVAR_LISP.
 +
 +      * nsmenu.m (Voverriding_local_map, Voverriding_local_map_menu_flag):
 +      Remove declaration.
 +
 +      * nsfont.m (Vns_reg_to_script, ns_antialias_text): Move to
 +      globals.h.
 +      (syms_of_nsfont): Remove & from DEFVAR_LISP.
 +
 +      * nsfns.m (Vmenu_bar_mode, Vtool_bar_mode): Remove declaration.
 +      (Vns_icon_type_alist, Vns_version_string): Move to globals.h.
 +      (syms_of_nsfns): Remove & from DEFVAR_LISP calls.
 +
 +      * globals.h (struct emacs_globals): Add f_ns_input_file,
 +      f_ns_input_font, f_ns_input_fontsize, f_ns_input_line,
 +      f_ns_input_color, f_ns_input_text, f_ns_working_text,
 +      f_ns_input_spi_name, f_ns_input_spi_arg, f_ns_alternate_modifier,
 +      f_ns_right_alternate_modifier, f_ns_command_modifier,
 +      f_ns_right_command_modifier, f_ns_control_modifier,
 +      f_ns_right_control_modifier, f_ns_function_modifier,
 +      f_ns_antialias_text, f_ns_confirm_quit, f_Vns_icon_type_alist,
 +      f_Vns_version_string, f_Vns_sent_selection_hooks,
 +      f_Vns_lost_selection_hooks, f_Vselection_alist, f_Vns_reg_to_script
 +      and corresponding defines.
 +
 +
 +2011-01-19  Sam Steingold  <sds@gnu.org>
 +
 +      * w32.c (check_windows_init_file): Remove declarations of
 +      Vwindow_system, Vload_path, Qfile_exists_p to fix compilation.
 +      * w32fns.c: Fix an error introduced by the previous patch.
 +
 +2011-01-19  Tom Tromey  <tromey@redhat.com>
 +
 +      * window.c: Fix error introduced by previous patch.
 +
 +2011-01-18  Tom Tromey  <tromey@parfait>
 +
 +      * globals.h: New file.
 +      * xterm.h (Vx_pixel_size_width_font_regexp): Remove declaration.
 +      * window.h (Vinitial_window_system, Vminibuf_scroll_window)
 +      (Vwindow_system_version): Remove declaration.
 +      * w32term.h (Vw32_enable_palette)
 +      (Vx_pixel_size_width_font_regexp): Remove declaration.
 +      * w32menu.c (Voverriding_local_map)
 +      (Voverriding_local_map_menu_flag): Remove declaration.
 +      * w32inevt.c (Vw32_alt_is_meta, Vw32_apps_modifier)
 +      (Vw32_capslock_is_shiftlock, Vw32_enable_caps_lock)
 +      (Vw32_enable_num_lock, Vw32_lwindow_modifier)
 +      (Vw32_pass_lwindow_to_system, Vw32_pass_rwindow_to_system)
 +      (Vw32_phantom_key_code, Vw32_recognize_altgr)
 +      (Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
 +      (w32_use_full_screen_buffer): Remove declaration.
 +      * w32.c (Vsystem_configuration, Vw32_downcase_file_names)
 +      (Vw32_generate_fake_inodes, Vw32_get_true_file_attributes)
 +      (w32_num_mouse_buttons, w32_pipe_read_delay): Remove declaration.
 +      * termopts.h (Vtruncate_partial_width_windows, inverse_video)
 +      (no_redraw_on_reenter, visible_bell): Remove declaration.
 +      * sysdep.c (Vsystem_name): Remove declaration.
 +      * syntax.h (parse_sexp_lookup_properties): Remove declaration.
 +      * menu.h (Vmenu_updating_frame): Remove declaration.
 +      * macros.h (Vexecuting_kbd_macro, executing_kbd_macro_index):
 +      Remove declaration.
 +      * lisp.h (Vafter_init_time, Vafter_load_alist)
 +      (Vauto_save_list_file_name, Vbefore_init_time, Vcommand_history)
 +      (Vcompletion_regexp_list, Vcurrent_load_list)
 +      (Vcurrent_prefix_arg, Vdata_directory, Vdebug_on_error)
 +      (Vdoc_directory, Vdoc_file_name, Vdynamic_library_alist)
 +      (Vexec_directory, Vexec_path, Vexec_suffixes)
 +      (Vface_font_rescale_alist, Vface_ignored_fonts, Vfeatures)
 +      (Vhelp_form, Vhistory_length, Vinhibit_field_text_motion)
 +      (Vinhibit_quit, Vinhibit_read_only, Vinhibit_redisplay)
 +      (Vinstallation_directory, Vinvocation_directory)
 +      (Vinvocation_name, Vload_file_rep_suffixes, Vload_history)
 +      (Vload_suffixes, Vmark_even_if_inactive, Vmemory_full)
 +      (Vmessage_log_max, Vobarray, Vprint_length, Vprint_level)
 +      (Vpurify_flag, Vquit_flag, Vsaved_region_selection)
 +      (Vscalable_fonts_allowed, Vselect_active_regions)
 +      (Vshell_file_name, Vstandard_input, Vstandard_output)
 +      (Vsystem_name, Vtemporary_file_directory, Vthrow_on_input)
 +      (Vtop_level, Vtty_erase_char, Vundo_outer_limit)
 +      (Vuser_login_name, Vwindow_scroll_functions)
 +      (Vwindow_system_version, Vx_no_window_manager)
 +      (Vx_resource_class, Vx_resource_name, baud_rate)
 +      (completion_ignore_case, debug_on_next_call, gc_cons_threshold)
 +      (history_delete_duplicates, inhibit_x_resources)
 +      (last_nonmenu_event, load_in_progress, max_specpdl_size)
 +      (minibuffer_auto_raise, print_escape_newlines, scroll_margin)
 +      (use_dialog_box, use_file_dialog): Remove declaration.  Include
 +      globals.h.
 +      * keymap.h (Voverriding_local_map)
 +      (Voverriding_local_map_menu_flag, meta_prefix_char): Remove
 +      declaration.
 +      * keyboard.h (Vdouble_click_time, Vfunction_key_map)
 +      (Vinput_method_function, Vkey_translation_map)
 +      (Vlucid_menu_bar_dirty_flag, Vthis_original_command)
 +      (do_mouse_tracking, extra_keyboard_modifiers)
 +      (num_nonmacro_input_events): Remove declaration.
 +      * intervals.h (Vchar_property_alias_alist)
 +      (Vdefault_text_properties, Vinhibit_point_motion_hooks)
 +      (Vtext_property_default_nonsticky): Remove declaration.
 +      * gtkutil.h (x_gtk_file_dialog_help_text)
 +      (x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
 +      (x_gtk_whole_detached_tool_bar): Remove declaration.
 +      * frame.h (Vdefault_frame_alist, Vframe_alpha_lower_limit)
 +      (Vmenu_bar_mode, Vmouse_highlight, Vterminal_frame)
 +      (Vtool_bar_mode, Vx_resource_class, Vx_resource_name)
 +      (focus_follows_mouse): Remove declaration.
 +      * fontset.h (Valternate_fontname_alist, Vfontset_alias_alist)
 +      (Vignore_relative_composition, Votf_script_alist)
 +      (Vuse_default_ascent, Vvertical_centering_font_regexp): Remove
 +      declaration.
 +      * font.h (Vfont_log): Remove declaration.
 +      * dosfns.h (Vdos_display_scancodes, Vdos_version)
 +      (Vdos_windows_version, dos_codepage, dos_country_code)
 +      (dos_decimal_point, dos_hyper_key, dos_keyboard_layout)
 +      (dos_keypad_mode, dos_super_key, dos_timezone_offset): Remove
 +      declaration.
 +      * disptab.h (Vglyph_table, Vstandard_display_table): Remove
 +      declaration.
 +      * dispextern.h (Vface_remapping_alist, Vglyphless_char_display)
 +      (Vmouse_autoselect_window, Voverflow_newline_into_fringe)
 +      (Vshow_trailing_whitespace, Vtool_bar_button_margin)
 +      (Vtool_bar_style, cursor_in_echo_area, display_hourglass_p)
 +      (inverse_video, mode_line_in_non_selected_windows)
 +      (tool_bar_button_relief, tool_bar_max_label_size)
 +      (underline_minimum_offset)
 +      (unibyte_display_via_language_environment, x_stretch_cursor_p):
 +      Remove declaration.
 +      * composite.h (Vauto_composition_function)
 +      (Vcomposition_function_table): Remove declaration.
 +      * commands.h (Vexecuting_kbd_macro)
 +      (Vminibuffer_local_completion_map)
 +      (Vminibuffer_local_filename_completion_map)
 +      (Vminibuffer_local_filename_must_match_map)
 +      (Vminibuffer_local_map, Vminibuffer_local_must_match_map)
 +      (Vminibuffer_local_ns_map, Vthis_command)
 +      (Vunread_command_events, cursor_in_echo_area)
 +      (last_command_event, last_nonmenu_event, unread_command_char):
 +      Remove declaration.
 +      * coding.h (Vcoding_system_for_read, Vcoding_system_for_write)
 +      (Vdefault_file_name_coding_system)
 +      (Vdefault_process_coding_system, Vfile_name_coding_system)
 +      (Vlast_coding_system_used, Vlocale_coding_system)
 +      (Vselect_safe_coding_system_function)
 +      (Vtranslation_table_for_input, coding_system_require_warning)
 +      (eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
 +      (eol_mnemonic_unix, inherit_process_coding_system): Remove
 +      declaration.
 +      * charset.h (Vcharset_list, Vcurrent_iso639_language): Remove
 +      declaration.
 +      * character.h (Vauto_fill_chars, Vchar_direction_table)
 +      (Vchar_script_table, Vchar_width_table, Vprintable_chars)
 +      (Vscript_representative_chars, Vtranslation_table_vector)
 +      (Vunicode_category_table): Remove declaration.
 +      * ccl.h (Vfont_ccl_encoder_alist): Remove declaration.
 +      * buffer.h (Vafter_change_functions, Vbefore_change_functions)
 +      (Vdeactivate_mark, Vfirst_change_hook, Vtransient_mark_mode)
 +      (inhibit_modification_hooks): Remove declaration.
 +      * xterm.c (syms_of_xterm): Update.
 +      (Vx_alt_keysym, Vx_hyper_keysym, Vx_keysym_table)
 +      (Vx_meta_keysym, Vx_super_keysym, Vx_toolkit_scroll_bars)
 +      (x_mouse_click_focus_ignore_position)
 +      (x_underline_at_descent_line)
 +      (x_use_underline_position_properties): Remove.
 +      * xsmfns.c (syms_of_xsmfns): Update.
 +      (Vx_session_id, Vx_session_previous_id): Remove.
 +      * xsettings.c (syms_of_xsettings): Update.
 +      (Vxft_settings, use_system_font): Remove.
 +      * xselect.c (syms_of_xselect): Update.
 +      (Vselection_converter_alist, Vx_lost_selection_functions)
 +      (Vx_sent_selection_functions, x_selection_timeout): Remove.
 +      * xfns.c (syms_of_xfns): Update.
 +      (Vgtk_version_string, Vmotif_version_string)
 +      (Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
 +      (Vx_max_tooltip_size, Vx_mode_pointer_shape)
 +      (Vx_no_window_manager, Vx_nontext_pointer_shape)
 +      (Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
 +      (Vx_sensitive_text_pointer_shape)
 +      (Vx_window_horizontal_drag_shape, x_gtk_file_dialog_help_text)
 +      (x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
 +      (x_gtk_use_system_tooltips, x_gtk_whole_detached_tool_bar):
 +      Remove.
 +      * xfaces.c (syms_of_xfaces): Update.
 +      (Vface_default_stipple, Vface_font_rescale_alist)
 +      (Vface_ignored_fonts, Vface_new_frame_defaults)
 +      (Vface_remapping_alist, Vfont_list_limit)
 +      (Vscalable_fonts_allowed, Vtty_defined_color_alist): Remove.
 +      * xdisp.c (syms_of_xdisp): Update.
 +      (Vauto_resize_tool_bars, Vblink_cursor_alist)
 +      (Vdisplay_pixels_per_inch, Vfontification_functions)
 +      (Vframe_title_format, Vglobal_mode_string)
 +      (Vglyphless_char_display, Vhourglass_delay, Vhscroll_step)
 +      (Vicon_title_format, Vinhibit_redisplay)
 +      (Vline_number_display_limit, Vline_prefix)
 +      (Vmax_mini_window_height, Vmenu_bar_update_hook)
 +      (Vmenu_updating_frame, Vmessage_log_max)
 +      (Vmouse_autoselect_window, Vnobreak_char_display)
 +      (Voverlay_arrow_position, Voverlay_arrow_string)
 +      (Voverlay_arrow_variable_list, Vredisplay_end_trigger_functions)
 +      (Vresize_mini_windows, Vshow_trailing_whitespace)
 +      (Vtool_bar_border, Vtool_bar_button_margin, Vtool_bar_style)
 +      (Vtruncate_partial_width_windows, Vvoid_text_area_pointer)
 +      (Vwindow_scroll_functions, Vwindow_size_change_functions)
 +      (Vwindow_text_change_functions, Vwrap_prefix)
 +      (auto_raise_tool_bar_buttons_p, automatic_hscrolling_p)
 +      (debug_end_pos, display_hourglass_p, emacs_scroll_step)
 +      (highlight_nonselected_windows, hscroll_margin)
 +      (inhibit_eval_during_redisplay, inhibit_free_realized_faces)
 +      (inhibit_menubar_update, inhibit_try_cursor_movement)
 +      (inhibit_try_window_id, inhibit_try_window_reusing)
 +      (line_number_display_limit_width)
 +      (make_cursor_line_fully_visible_p, message_truncate_lines)
 +      (mode_line_inverse_video, multiple_frames, overline_margin)
 +      (scroll_conservatively, scroll_margin, tool_bar_button_relief)
 +      (tool_bar_max_label_size, underline_minimum_offset)
 +      (unibyte_display_via_language_environment, x_stretch_cursor_p):
 +      Remove.
 +      * window.c (syms_of_window): Update.
 +      (Vminibuf_scroll_window, Vother_window_scroll_buffer)
 +      (Vrecenter_redisplay, Vscroll_preserve_screen_position)
 +      (Vtemp_buffer_show_function, Vwindow_configuration_change_hook)
 +      (Vwindow_point_insertion_type, auto_window_vscroll_p)
 +      (mode_line_in_non_selected_windows, next_screen_context_lines)
 +      (window_min_height, window_min_width): Remove.
 +      (scroll_margin): Remove declaration.
 +      * w32term.c (syms_of_w32term): Update.
 +      (Vw32_capslock_is_shiftlock, Vw32_grab_focus_on_raise)
 +      (Vw32_recognize_altgr, Vw32_swap_mouse_buttons)
 +      (Vx_toolkit_scroll_bars, w32_num_mouse_buttons)
 +      (w32_use_visible_system_caret, x_underline_at_descent_line)
 +      (x_use_underline_position_properties): Remove.
 +      (Vcommand_line_args, Vsystem_name, extra_keyboard_modifiers):
 +      Remove declaration.
 +      * w32select.c (syms_of_w32select): Update.
 +      (Vnext_selection_coding_system, Vselection_coding_system): Remove.
 +      * w32proc.c (syms_of_ntproc): Update.
 +      (Vw32_downcase_file_names, Vw32_generate_fake_inodes)
 +      (Vw32_get_true_file_attributes, Vw32_quote_process_args)
 +      (Vw32_start_process_inherit_error_mode)
 +      (Vw32_start_process_share_console)
 +      (Vw32_start_process_show_window, w32_pipe_read_delay): Remove.
 +      (Vsystem_name): Remove declaration.
 +      * w32font.c (syms_of_w32font): Update.
 +      (Vw32_charset_info_alist): Remove.
 +      * w32fns.c (globals_of_w32fns, syms_of_w32fns): Update.
 +      (Vw32_alt_is_meta, Vw32_apps_modifier, Vw32_bdf_filename_alist)
 +      (Vw32_color_map, Vw32_enable_caps_lock, Vw32_enable_num_lock)
 +      (Vw32_enable_palette, Vw32_lwindow_modifier)
 +      (Vw32_pass_alt_to_system, Vw32_pass_lwindow_to_system)
 +      (Vw32_pass_rwindow_to_system, Vw32_phantom_key_code)
 +      (Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
 +      (Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
 +      (Vx_max_tooltip_size, Vx_mode_pointer_shape)
 +      (Vx_no_window_manager, Vx_nontext_pointer_shape)
 +      (Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
 +      (Vx_sensitive_text_pointer_shape)
 +      (Vx_window_horizontal_drag_shape, w32_ansi_code_page)
 +      (w32_enable_synthesized_fonts, w32_mouse_button_tolerance)
 +      (w32_mouse_move_interval)
 +      (w32_pass_extra_mouse_buttons_to_system)
 +      (w32_pass_multimedia_buttons_to_system, w32_quit_key)
 +      (w32_strict_fontnames, w32_strict_painting): Remove.
 +      (Vhourglass_delay, Vmenu_bar_mode, Vtool_bar_mode)
 +      (Vw32_recognize_altgr, Vwindow_system_version)
 +      (w32_num_mouse_buttons, w32_use_visible_system_caret): Remove
 +      declaration.
 +      * w32console.c (syms_of_ntterm): Update.
 +      (w32_use_full_screen_buffer): Remove.
 +      (Vtty_defined_color_alist): Remove declaration.
 +      * w16select.c (syms_of_win16select): Update.
 +      (Vnext_selection_coding_system, Vselection_coding_system): Remove.
 +      * undo.c (syms_of_undo): Update.
 +      (Vundo_outer_limit, Vundo_outer_limit_function)
 +      (undo_inhibit_record_point, undo_limit, undo_strong_limit):
 +      Remove.
 +      * textprop.c (syms_of_textprop): Update.
 +      (Vchar_property_alias_alist, Vdefault_text_properties)
 +      (Vinhibit_point_motion_hooks, Vtext_property_default_nonsticky):
 +      Remove.
 +      * terminal.c (syms_of_terminal): Update.
 +      (Vdelete_terminal_functions, Vring_bell_function): Remove.
 +      * term.c (syms_of_term): Update.
 +      (Vresume_tty_functions, Vsuspend_tty_functions)
 +      (no_redraw_on_reenter, system_uses_terminfo, visible_cursor):
 +      Remove.
 +      * syntax.c (syms_of_syntax): Update.
 +      (Vfind_word_boundary_function_table, multibyte_syntax_as_symbol)
 +      (open_paren_in_column_0_is_defun_start)
 +      (parse_sexp_ignore_comments, parse_sexp_lookup_properties)
 +      (words_include_escapes): Remove.
 +      * search.c (syms_of_search): Update.
 +      (Vinhibit_changing_match_data, Vsearch_spaces_regexp): Remove.
 +      * process.c (syms_of_process): Update.
 +      (Vprocess_adaptive_read_buffering, Vprocess_connection_type)
 +      (delete_exited_processes): Remove.
 +      * print.c (syms_of_print): Update.
 +      (Vfloat_output_format, Vprint_charset_text_property)
 +      (Vprint_circle, Vprint_continuous_numbering, Vprint_gensym)
 +      (Vprint_length, Vprint_level, Vprint_number_table)
 +      (Vstandard_output, print_escape_multibyte)
 +      (print_escape_newlines, print_escape_nonascii, print_quoted):
 +      Remove.
 +      * msdos.c (syms_of_msdos): Update.
 +      (Vdos_unsupported_char_glyph): Remove.
 +      (unibyte_display_via_language_environment): Remove declaration.
 +      * minibuf.c (syms_of_minibuf): Update.
 +      (Vcompletion_regexp_list, Vhistory_add_new_input)
 +      (Vhistory_length, Vminibuffer_completing_file_name)
 +      (Vminibuffer_completion_confirm)
 +      (Vminibuffer_completion_predicate, Vminibuffer_completion_table)
 +      (Vminibuffer_exit_hook, Vminibuffer_help_form)
 +      (Vminibuffer_history_position, Vminibuffer_history_variable)
 +      (Vminibuffer_prompt_properties, Vminibuffer_setup_hook)
 +      (Vread_buffer_function, Vread_expression_map)
 +      (completion_ignore_case, enable_recursive_minibuffers)
 +      (history_delete_duplicates, minibuffer_allow_text_properties)
 +      (minibuffer_auto_raise, read_buffer_completion_ignore_case):
 +      Remove.
 +      * marker.c (syms_of_marker): Update.
 +      (byte_debug_flag): Remove.
 +      * macros.c (syms_of_macros): Update.
 +      (Vexecuting_kbd_macro, executing_kbd_macro_index): Remove.
 +      * lread.c (syms_of_lread): Update.
 +      (Vafter_load_alist, Vbyte_boolean_vars)
 +      (Vbytecomp_version_regexp, Vcurrent_load_list)
 +      (Veval_buffer_list, Vload_file_name, Vload_file_rep_suffixes)
 +      (Vload_history, Vload_path, Vload_read_function)
 +      (Vload_source_file_function, Vload_suffixes, Vobarray)
 +      (Vold_style_backquotes, Vpreloaded_file_list, Vread_circle)
 +      (Vread_symbol_positions_list, Vread_with_symbol_positions)
 +      (Vsource_directory, Vstandard_input, Vuser_init_file, Vvalues)
 +      (force_load_messages, load_convert_to_unibyte)
 +      (load_dangerous_libraries, load_force_doc_strings)
 +      (load_in_progress): Remove.
 +      * keymap.c (syms_of_keymap): Update.
 +      (Vdefine_key_rebound_commands, Vemulation_mode_map_alists)
 +      (Vminibuffer_local_completion_map)
 +      (Vminibuffer_local_filename_completion_map)
 +      (Vminibuffer_local_filename_must_match_map)
 +      (Vminibuffer_local_map, Vminibuffer_local_must_match_map)
 +      (Vminibuffer_local_ns_map, Vminor_mode_map_alist)
 +      (Vminor_mode_overriding_map_alist, Vwhere_is_preferred_modifier):
 +      Remove.
 +      * keyboard.c (syms_of_keyboard): Update.
 +      (Vauto_save_timeout, Vcommand_error_function)
 +      (Vcommand_hook_internal, Vdeactivate_mark)
 +      (Vdeferred_action_function, Vdeferred_action_list)
 +      (Vdisable_point_adjustment, Vdouble_click_time)
 +      (Vecho_keystrokes, Venable_disabled_menus_and_buttons)
 +      (Vfunction_key_map, Vglobal_disable_point_adjustment)
 +      (Vhelp_char, Vhelp_event_list, Vhelp_form)
 +      (Vinput_method_function, Vinput_method_previous_message)
 +      (Vkey_translation_map, Vlast_event_frame)
 +      (Vlucid_menu_bar_dirty_flag, Vmenu_bar_final_items)
 +      (Vminibuffer_message_timeout, Voverriding_local_map)
 +      (Voverriding_local_map_menu_flag, Vpost_command_hook)
 +      (Vpre_command_hook, Vprefix_help_command)
 +      (Vsaved_region_selection, Vselect_active_regions)
 +      (Vshow_help_function, Vspecial_event_map, Vsuggest_key_bindings)
 +      (Vthis_command, Vthis_command_keys_shift_translated)
 +      (Vthis_original_command, Vthrow_on_input, Vtimer_idle_list)
 +      (Vtimer_list, Vtool_bar_separator_image_expression, Vtop_level)
 +      (Vtty_erase_char, Vunread_command_events)
 +      (Vunread_input_method_events, Vunread_post_input_method_events)
 +      (auto_save_interval, cannot_suspend, do_mouse_tracking)
 +      (double_click_fuzz, extra_keyboard_modifiers)
 +      (inhibit_local_menu_bar_menus, last_command_event)
 +      (last_input_event, last_nonmenu_event, menu_prompt_more_char)
 +      (menu_prompting, meta_prefix_char, num_input_keys)
 +      (num_nonmacro_input_events, polling_period, unread_command_char):
 +      Remove.
 +      * insdel.c (syms_of_insdel): Update.
 +      (Vcombine_after_change_calls, check_markers_debug_flag): Remove.
 +      * indent.c (syms_of_indent): Update.
 +      (indent_tabs_mode): Remove.
 +      * image.c (syms_of_image): Update.
 +      (Vimage_cache_eviction_delay, Vimage_types)
 +      (Vimagemagick_render_type, Vmax_image_size, Vx_bitmap_file_path)
 +      (cross_disabled_images): Remove.
 +      * fringe.c (syms_of_fringe): Update.
 +      (Vfringe_bitmaps, Voverflow_newline_into_fringe): Remove.
 +      * frame.c (syms_of_frame): Update.
 +      (Vdefault_frame_alist, Vdefault_frame_scroll_bars)
 +      (Vdelete_frame_functions, Vframe_alpha_lower_limit)
 +      (Vmake_pointer_invisible, Vmenu_bar_mode, Vmouse_highlight)
 +      (Vmouse_position_function, Vterminal_frame, Vtool_bar_mode)
 +      (Vx_resource_class, Vx_resource_name, focus_follows_mouse):
 +      Remove.
 +      * fontset.c (syms_of_fontset): Update.
 +      (Valternate_fontname_alist, Vfont_encoding_charset_alist)
 +      (Vfontset_alias_alist, Vignore_relative_composition)
 +      (Votf_script_alist, Vuse_default_ascent)
 +      (Vvertical_centering_font_regexp): Remove.
 +      * font.c (syms_of_font): Update.
 +      (Vfont_encoding_alist, Vfont_log, Vfont_slant_table)
 +      (Vfont_weight_table, Vfont_width_table): Remove.
 +      * fns.c (syms_of_fns): Update.
 +      (Vfeatures, use_dialog_box, use_file_dialog): Remove.
 +      * filelock.c (syms_of_filelock): Update.
 +      (Vtemporary_file_directory): Remove.
 +      * fileio.c (syms_of_fileio): Update.
 +      (Vafter_insert_file_functions, Vauto_save_include_big_deletions)
 +      (Vauto_save_list_file_name, Vauto_save_visited_file_name)
 +      (Vdefault_file_name_coding_system, Vfile_name_coding_system)
 +      (Vfile_name_handler_alist, Vinhibit_file_name_handlers)
 +      (Vinhibit_file_name_operation, Vset_auto_coding_function)
 +      (Vwrite_region_annotate_functions)
 +      (Vwrite_region_annotations_so_far)
 +      (Vwrite_region_post_annotation_function)
 +      (delete_by_moving_to_trash, write_region_inhibit_fsync): Remove.
 +      (Vw32_get_true_file_attributes): Remove declaration.
 +      * eval.c (syms_of_eval): Update.
 +      (Vdebug_ignored_errors, Vdebug_on_error, Vdebug_on_signal)
 +      (Vdebugger, Vinhibit_quit, Vmacro_declaration_function)
 +      (Vquit_flag, Vsignal_hook_function, Vstack_trace_on_error)
 +      (debug_on_next_call, debug_on_quit, debugger_may_continue)
 +      (max_lisp_eval_depth, max_specpdl_size): Remove.
 +      * emacs.c (syms_of_emacs): Update.
 +      (Vafter_init_time, Vbefore_init_time, Vcommand_line_args)
 +      (Vdynamic_library_alist, Vemacs_copyright, Vemacs_version)
 +      (Vinstallation_directory, Vinvocation_directory)
 +      (Vinvocation_name, Vkill_emacs_hook, Vpath_separator)
 +      (Vprevious_system_messages_locale, Vprevious_system_time_locale)
 +      (Vsystem_configuration, Vsystem_configuration_options)
 +      (Vsystem_messages_locale, Vsystem_time_locale, Vsystem_type)
 +      (inhibit_x_resources, noninteractive1): Remove.
 +      * editfns.c (syms_of_editfns): Update.
 +      (Vbuffer_access_fontified_property)
 +      (Vbuffer_access_fontify_functions, Vinhibit_field_text_motion)
 +      (Voperating_system_release, Vsystem_name, Vuser_full_name)
 +      (Vuser_login_name, Vuser_real_login_name): Remove.
 +      * dosfns.c (syms_of_dosfns): Update.
 +      (Vdos_display_scancodes, Vdos_version, Vdos_windows_version)
 +      (dos_codepage, dos_country_code, dos_decimal_point)
 +      (dos_hyper_key, dos_keyboard_layout, dos_keypad_mode)
 +      (dos_super_key, dos_timezone_offset): Remove.
 +      * doc.c (syms_of_doc): Update.
 +      (Vbuild_files, Vdoc_file_name): Remove.
 +      * dispnew.c (syms_of_display): Update.
 +      (Vglyph_table, Vinitial_window_system)
 +      (Vredisplay_preemption_period, Vstandard_display_table)
 +      (Vwindow_system_version, baud_rate, cursor_in_echo_area)
 +      (inverse_video, redisplay_dont_pause, visible_bell): Remove.
 +      * dired.c (syms_of_dired): Update.
 +      (Vcompletion_ignored_extensions): Remove.
 +      (Vw32_get_true_file_attributes): Remove declaration.
 +      * dbusbind.c (syms_of_dbusbind): Update.
 +      (Vdbus_debug, Vdbus_registered_buses)
 +      (Vdbus_registered_objects_table): Remove.
 +      * data.c (syms_of_data): Update.
 +      (Vmost_negative_fixnum, Vmost_positive_fixnum): Remove.
 +      * composite.c (syms_of_composite): Update.
 +      (Vauto_composition_function, Vauto_composition_mode)
 +      (Vcompose_chars_after_function, Vcomposition_function_table):
 +      Remove.
 +      * coding.c (syms_of_coding): Update.
 +      (Vcharset_revision_table, Vcoding_category_list)
 +      (Vcoding_system_alist, Vcoding_system_for_read)
 +      (Vcoding_system_for_write, Vcoding_system_list)
 +      (Vdefault_process_coding_system, Venable_character_translation)
 +      (Vfile_coding_system_alist, Vlast_code_conversion_error)
 +      (Vlast_coding_system_used, Vlatin_extra_code_table)
 +      (Vlocale_coding_system, Vnetwork_coding_system_alist)
 +      (Vprocess_coding_system_alist)
 +      (Vselect_safe_coding_system_function)
 +      (Vstandard_translation_table_for_decode)
 +      (Vstandard_translation_table_for_encode)
 +      (Vtranslation_table_for_input, coding_system_require_warning)
 +      (eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
 +      (eol_mnemonic_unix, inherit_process_coding_system)
 +      (inhibit_eol_conversion, inhibit_iso_escape_detection)
 +      (inhibit_null_byte_detection): Remove.
 +      * cmds.c (syms_of_cmds): Update.
 +      (Vpost_self_insert_hook): Remove.
 +      * charset.c (syms_of_charset): Update.
 +      (Vcharset_list, Vcharset_map_path, Vcurrent_iso639_language)
 +      (inhibit_load_charset_map): Remove.
 +      * character.c (syms_of_character): Update.
 +      (Vauto_fill_chars, Vchar_direction_table, Vchar_script_table)
 +      (Vchar_width_table, Vprintable_chars)
 +      (Vscript_representative_chars, Vtranslation_table_vector)
 +      (Vunicode_category_table): Remove.
 +      * ccl.c (syms_of_ccl): Update.
 +      (Vcode_conversion_map_vector, Vfont_ccl_encoder_alist)
 +      (Vtranslation_hash_table_vector): Remove.
 +      * category.c (syms_of_category): Update.
 +      (Vword_combining_categories, Vword_separating_categories): Remove.
 +      * callproc.c (syms_of_callproc): Update.
 +      (Vconfigure_info_directory, Vdata_directory, Vdoc_directory)
 +      (Vexec_directory, Vexec_path, Vexec_suffixes)
 +      (Vinitial_environment, Vprocess_environment)
 +      (Vshared_game_score_directory, Vshell_file_name): Remove.
 +      * callint.c (syms_of_callint): Update.
 +      (Vcommand_debug_status, Vcommand_history, Vcurrent_prefix_arg)
 +      (Vmark_even_if_inactive, Vmouse_leave_buffer_hook): Remove.
 +      * bytecode.c (syms_of_bytecode): Update.
 +      (Vbyte_code_meter, byte_metering_on): Remove.
 +      * buffer.c (syms_of_buffer): Update.
 +      (Vafter_change_functions, Vbefore_change_functions)
 +      (Vchange_major_mode_hook, Vfirst_change_hook)
 +      (Vinhibit_read_only, Vkill_buffer_query_functions)
 +      (Vtransient_mark_mode, inhibit_modification_hooks): Remove.
 +      * alloc.c (syms_of_alloc): Update.
 +      (Vgc_cons_percentage, Vgc_elapsed, Vmemory_full)
 +      (Vmemory_signal_data, Vpost_gc_hook, Vpurify_flag)
 +      (cons_cells_consed, floats_consed, garbage_collection_messages)
 +      (gc_cons_threshold, gcs_done, intervals_consed)
 +      (misc_objects_consed, pure_bytes_used, string_chars_consed)
 +      (strings_consed, symbols_consed, vector_cells_consed): Remove.
 +
 +      * lisp.h (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL)
 +      (DEFVAR_INT): Assume global is in `globals'.
 +      * alloc.c (globals): Define.
 +
 +2011-01-18  Tom Tromey  <tromey@redhat.com>
 +
 +      * image.c (Vimagemagick_render_type): Remove redundant
 +      definition.
 +
 +2011-01-18  Tom Tromey  <tromey@redhat.com>
 +
 +      * xdisp.c (emacs_scroll_step): Rename from scroll_step.
 +      (try_scrolling): Rename argument to 'arg_scroll_conservatively'.
 +      (redisplay_window): Update.
 +      (syms_of_xdisp): Update.
 +
 +2011-01-18  Tom Tromey  <tromey@redhat.com>
 +
 +      * gtkutil.h (x_gtk_use_old_file_dialog, x_gtk_show_hidden_files)
 +      (x_gtk_file_dialog_help_text, x_gtk_whole_detached_tool_bar):
 +      Declare.
 +      * gtkutil.c (xg_uses_old_file_dialog):
 +      (xg_get_file_with_chooser):
 +      (xg_tool_bar_detach_callback): Don't redeclare globals.
 +
 +2011-01-18  Tom Tromey  <tromey@redhat.com>
 +
 +      * lisp.h (DEFVAR_BUFFER_DEFAULTS): New macro.
 +      * buffer.c (syms_of_buffer): Use DEFVAR_BUFFER_DEFAULTS.
 +
 +2011-01-18  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * lisp.h (DECL_ALIGN): Define if HAVE_ATTRIBUTE_ALIGNED, not if
 +      defined __GNUC__.  ../configure now checks for this GCC feature,
 +      which is now also supported by IBM and Oracle compilers.
 +      (USE_LSB_TAG) [defined DECL_ALIGN]: Also define if defined __sun,
 +      since Solaris malloc returns mult-of-8.
 +
 +2011-01-18  Stefan Monnier  <monnier@iro.umontreal.ca>
  
        * image.c (syms_of_image): Don't access XSYMBOL's internals directly.
  
 -2011-01-16  Eli Zaretskii  <eliz@gnu.org>
 +2011-01-17  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Give a name FLOAT_TO_STRING_BUFSIZE to the constant 350.
 +      * lisp.h (FLOAT_TO_STRING_BUFSIZE): New macro.
 +      * data.c (Fnumber_to_string): Use it.
 +      * print.c (float_to_string, print_object): Likewise.
 +
 +      Include <unistd.h> unilaterally.
 +      * alloc.c, atimer.c, buffer.c, callproc.c, dired.c, dispnew.c, doc.c:
 +      * doprnt.c, editfns.c, emacs.c, fileio.c, filelock.c, fns.c:
 +      * getloadavg.c, getpagesize.h, gmalloc.c, image.c, keyboard.c:
 +      * lread.c, process.c, process.h, ralloc.c, regex.c, sysdep.c:
 +      * systty.h, term.c, termcap.c, xfns.c, xrdb.c, xselect.c, xsmfns.c:
 +      * xterm.c:
 +      Include <unistd.h> without worrying about HAVE_UNISTD_H, since
 +      unistd.h is always present now, possibly supplied by gnulib.
 +
 +      * mktime.c: Remove; moving to ../lib.
 +
 +      Use gnulib's mktime module.
 +      * deps.mk (mktime.o): Remove rule.
 +
 +      Use gnulib's ftoastr module.
 +      * print.c: Include ftoastr.h.
 +      (FLT_RADIX, DBL_MANT_DIG, DBL_DIG, DBL_MIN, DOUBLE_DIGITS_BOUND):
 +      Remove; no longer needed.
 +      (float_to_string): Use dtoastr rather than rolling our own code,
 +      which had an off-by-one bug on non-IEEE hosts.
 +
 +      Automate syncing from gnulib.
 +      * Makefile.in (lib): New macro.
 +      (ALL_CFLAGS): Add -I$(lib) -I$(srcdir)/../lib.
 +      ($(lib)/libgnu.a): New rule.
 +      (temacs$(EXEEXT)): Also link $(lib)/libgnu.a.
 +
 +      * xfns.c (x_real_positions): Fix signedness of local var 'ign'.
 +      XGetGeometry wants unsigned int *, not int *, for its last 4 args,
 +      so change the type of 'ign' to unsigned int from int.
 +
 +      * regex.c (analyse_first): Remove unreachable 'continue' statement.
 +
 +      * xterm.h (struct x_display_info): Remove stray semicolon.
 +      The extra semicolon didn't conform to the C standard.
 +      Problem reported by Sun cc.
 +
 +      * lisp.h: Redo flags and XSET slightly to avoid overflow diagnostics.
 +      These changes make compilation easier to follow with Sun cc.
 +      (ARRAY_MARK_FLAG): Make it signed, so that it can be assigned to
 +      EMACS_INT values without provoking overflow diagnostics.
 +      (PSEUDOVECTOR_FLAG): Likewise, for consistency.
 +      (XSET) [! USE_LSB_TAG]: Use unsigned left shift to avoid overflow
 +      diagnostic with signed left shift.
 +
 +      * fileio.c (make_temp_name): Remove unreachable code.
  
 -      * image.c (syms_of_image): Don't use SET_SYMBOL_VALUE.  (Bug#7848)
 +      * fontset.c (free_realized_fontset): Mark unreachable code with if (0).
 +      Previously it was marked by preceding it with "return;", but
 +      Sun cc complains about this.
 +
 +      * coding.c (decode_coding_emacs_mule): Remove unreachable code.
 +      This is a typo left over from 2009-03-06T07:51:52Z!handa@m17n.org,
 +      which fixed Bug#2370.  Caught by Sun cc.
  
  2011-01-15  Martin Rudalics  <rudalics@gmx.at>
  
        (Fset_window_configuration): Set inhibit_point_swap to 1 instead
        of setting selected_window to nil (Bug#7728).
  
 -2011-01-12  Chong Yidong  <cyd@stupidchicken.com>
 +2011-01-11  Tassilo Horn  <tassilo@member.fsf.org>
  
 -      * config.in (TERMINFO): New definition.
 +      * image.c (imagemagick_load_image, Finit_image_library):
 +      Free intermediate image after creating a MagickWand from it.
 +      Terminate MagickWand environment after image loading.
  
 -      * s/netbsd.h: Use it to choose between terminfo and termcap
 -      (Bug#7642).
 +2011-01-10  Michael Albinus  <michael.albinus@gmx.de>
  
 -2011-01-03  Jan Djärv  <jan.h.d@swipnet.se>
 +      * dbusbind.c (Fdbus_register_service): Raise an error in case of
 +      unexpected return values.
 +      (Fdbus_register_method): Remove connection initialization.
  
 -      * coding.h (ENCODE_UTF_8): Remove "Used by ..." comment.
 +2011-01-10  Jan Moringen  <jan.moringen@uni-bielefeld.de>
  
 -      * nsfns.m (ns_set_name_iconic): Remove.
 -      (ns_get_screen): Don't assign integer to f.
 -      (ns_set_name_internal): New function (Bug#7517).
 -      (Vicon_title_format): Extern declare.
 -      (ns_set_name): Call ns_set_name_internal.
 -      (x_explicitly_set_name): Remove call to ns_set_name_iconic.
 -      (x_implicitly_set_name): Ditto.
 -      (x_set_title): Remove commet about EXPLICIT.  Call ns_set_name_internal.
 -      (ns_set_name_as_filename): Encode name with ENCODE_UTF_8.
 -      Always use buffer name for title and buffer filename only for
 -      RepresentedFilename.  Handle bad UTF-8 in buffer name (Bug#7517).
 +      * dbusbind.c (QCdbus_request_name_allow_replacement): New symbol;
 +      used by Fdbus_register_service.
 +      (QCdbus_request_name_replace_existing): Likewise.
 +      (QCdbus_request_name_do_not_queue): Likewise.
 +      (QCdbus_request_name_reply_primary_owner): Likewise.
 +      (QCdbus_request_name_reply_in_queue): Likewise.
 +      (QCdbus_request_name_reply_exists): Likewise.
 +      (QCdbus_request_name_reply_already_owner): Likewise.
 +      (Fdbus_register_service): New function.
 +      (Fdbus_register_method): Use Fdbus_register_service to do the name
 +      registration.
 +      (syms_of_dbusbind): Add symbols dbus-register-service,
 +      :allow-replacement, :replace-existing, :do-not-queue,
 +      :primary-owner, :existing, :in-queue and :already-owner.
 +
 +2011-01-09  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * gtkutil.c (update_frame_tool_bar): Don't advance tool-bar index
 +      when removing extra buttons.
 +
 +2011-01-08  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * fns.c (Fyes_or_no_p): Doc fix.
 +
 +2011-01-08  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * fns.c (Fyes_or_no_p): Add usage.
 +
 +2011-01-08  Glenn Morris  <rgm@gnu.org>
 +
 +      * makefile.w32-in ($(EMACS)):
 +      * Makefile.in (emacs$(EXEEXT)): -batch implies -q.
 +
 +      * xdisp.c (syms_of_xdisp) <Qrisky_local_variable>: Move from here...
 +      * emacs.c (syms_of_emacs) <Qrisky_local_variable>: ...to here.
 +
 +2011-01-07  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * image.c (imagemagick_load_image): Fix some resource leaks and
 +      error handling.
 +
 +2011-01-07  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * fns.c (Fyes_or_no_p): Accept format string args.
 +
 +2011-01-07  Glenn Morris  <rgm@gnu.org>
 +
 +      * emacs.c (no_site_lisp): New int.
 +      (USAGE1): Add --no-site-lisp, mention -Q uses it.
 +      (main): Set no_site_lisp.
 +      (standard_args): Add --no-site-lisp.
 +      * lisp.h (no_site_lisp): New int.
 +      * lread.c (init_lread): If no_site_lisp, don't re-add site-lisp
 +      directories to Vload_path.
 +
 +2011-01-05  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * alloc.c (mark_stack): Use __builtin_unwind_init if available.
 +
 +2011-01-04  Jan Moringen  <jan.moringen@uni-bielefeld.de>
 +
 +      * dbusbind.c (Fdbus_register_method): Add optional parameter
 +      dont_register_service.  Updated docstring accordingly.
 +
 +2011-01-04  Glenn Morris  <rgm@gnu.org>
 +
 +      * emacs.c (emacs_copyright): Update short copyright year to 2011.
  
  2011-01-03  Eli Zaretskii  <eliz@gnu.org>
  
        * image.c (png_jmpbuf): Remove definition.
        (my_png_error, png_load): Don't use png_jmpbuf.
  
 -2010-12-31  Eli Zaretskii  <eliz@gnu.org>
 +2011-01-02  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * keyboard.c (Vselect_active_regions): Doc fix.  (Bug#7702)
 +
 +2011-01-02  Eli Zaretskii  <eliz@gnu.org>
  
        * image.c <Qlibpng_version>: New variable.
        (syms_of_image): Intern and staticpro it.  Set its value to the
        (my_png_error, png_load): Use it instead of #ifdef'ing according
        to PNG_LIBPNG_VER_MAJOR and PNG_LIBPNG_VER_MINOR.
  
 -2010-12-27  Stefan Monnier  <monnier@iro.umontreal.ca>
 +2011-01-02  Stefan Monnier  <monnier@iro.umontreal.ca>
  
        * .gdbinit (xgetptr): Fix the union+lsb case.
        (xbacktrace): Fix the union case.
  
 -2010-12-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 +2011-01-02  Stefan Monnier  <monnier@iro.umontreal.ca>
  
        * window.c (Fmove_to_window_line): Avoid abort when called in a buffer
        different from selected-window's.
  
 -2010-12-25  Eli Zaretskii  <eliz@gnu.org>
 +2011-01-02  Eli Zaretskii  <eliz@gnu.org>
  
        * keyboard.c (parse_menu_item): Prepend "  " to the key sequence
        equivalent of a menu item when the key sequence is given by the
        * xdisp.c (Fformat_mode_line): Doc fix: no need to state that only
        the basic faces are supported.
  
 -2010-12-24  Jan Djärv  <jan.h.d@swipnet.se>
 +2011-01-02  Jan Djärv  <jan.h.d@swipnet.se>
  
        * xterm.c (x_check_fullscreen): Fix pixel/character mixup.
  
 -2010-12-17  Eli Zaretskii  <eliz@gnu.org>
 +2011-01-02  Eli Zaretskii  <eliz@gnu.org>
  
        * xdisp.c (Fformat_mode_line): Fix last change.
  
 -2010-12-16  Chong Yidong  <cyd@stupidchicken.com>
 +2011-01-02  Chong Yidong  <cyd@stupidchicken.com>
  
        * xdisp.c (Fformat_mode_line): Restrict the FACE argument to basic
        faces (Bug#7587).
  
 -2010-12-13  Eli Zaretskii  <eliz@gnu.org>
 +2011-01-02  Eli Zaretskii  <eliz@gnu.org>
  
        * fileio.c (Fexpand_file_name): One more doc fix.
  
 -2010-12-12  Eli Zaretskii  <eliz@gnu.org>
 +2011-01-01  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * fileio.c (Fexpand_file_name): Doc fix.  (Bug#7617)
 +      * gtkutil.c (xg_get_tool_bar_widgets): Use NULL for a missing
 +      image or label in the container.
 +      (xg_make_tool_item): Replace VERT_ONLY arg with HORIZ, TEXT_IMAGE.
 +      (xg_show_toolbar_item): Function deleted.
 +      (xg_tool_item_stale_p): New function.
 +      (update_frame_tool_bar): Calculate tool-bar style once per call.
 +      Instead of hiding text labels, omit them.  Don't use
 +      xg_show_toolbar_item; create new GtkToolItems from scratch if
 +      necessary, instead of trying to re-use them.  This avoids an
 +      annoying animation when changing tool-bars.
  
 -2010-12-11  Eli Zaretskii  <eliz@gnu.org>
 +2010-12-31  Jan Djärv  <jan.h.d@swipnet.se>
  
 -      * w32fns.c (Fx_show_tip): Call try_window with last argument
 -      TRY_WINDOW_IGNORE_FONTS_CHANGE.  Delete the TODO ifdef: problem
 -      solved.  Round up the tip height to an integral multiple of the
 -      frame's line height.  Add FRAME_COLUMN_WIDTH to the tip width.
 -      (Bug#7398)
 +      * nsfns.m (ns_set_name_as_filename): Always use buffer name for
 +      title and buffer filename only for RepresentedFilename.
 +      Handle bad UTF-8 in buffer name (Bug#7517).
 +
 +2010-12-30  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * coding.h (ENCODE_UTF_8): Remove "Used by ..." comment.
 +
 +      * nsfns.m (ns_set_name_iconic): Remove.
 +      (ns_set_name_internal): New function (Bug#7517).
 +      (Vicon_title_format): Extern declare.
 +      (ns_set_name): Call ns_set_name_internal.
 +      (x_explicitly_set_name): Remove call to ns_set_name_iconic.
 +      (x_implicitly_set_name): Ditto.
 +      (x_set_title): Remove commet about EXPLICIT.  Call ns_set_name_internal.
 +      (ns_set_name_as_filename): Encode name with ENCODE_UTF_8 (Bug#7517).
 +
 +2010-12-29  Štěpán Němec  <stepnem@gmail.com>  (tiny change)
 +
 +      * window.c (syms_of_window): Add missing defsubr for
 +      window-use-time.
 +
 +2010-12-28  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * xterm.h (x_alloc_lighter_color_for_widget): Restore declaration.
 +      * xterm.c (x_alloc_lighter_color_for_widget): Restore.
 +
 +2010-12-27  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * buffer.c: Remove unused declarations.
 +      * buffer.h: Likewise.
 +      * charset.h: Likewise.
 +      * composite.h: Likewise.
 +      * dispextern.h: Likewise.
 +      * dispnew.c: Likewise.
 +      * font.h: Likewise.
 +      * fontset.c: Likewise.
 +      * fontset.h: Likewise.
 +      * intervals.h: Likewise.
 +      * keymap.h: Likewise.
 +      * lisp.h: Likewise.
 +      * syntax.c: Likewise.
 +      * syntax.h: Likewise.
 +      * termhooks.h: Likewise.
 +      * window.h: Likewise.
 +      * xsettings.h: Likewise.
 +      * xterm.c: Likewise.
 +      * xterm.h: Likewise.
 +
 +      * chartab.c (sub_char_table_ref): Make static.
 +      * dispnew.c (line_hash_code, required_matrix_height)
 +      (required_matrix_width): Likewise.
 +      * eval.c (interactive_p, apply_lambda): Likewise.
 +      * fns.c (string_make_multibyte, copy_hash_table, hash_clear):
 +      Likewise.
 +      * font.c (QCadstyle, QCregistry, font_make_spec)
 +      (font_parse_fcname, font_encode_char, font_at): Likewise.
 +      * frame.c (x_frame_get_arg): Likewise.
 +      * keymap.c (get_keyelt): Likewise.
 +      * lread.c (read_filtered_event): Likewise.
 +      * print.c (write_string_1): Likewise.
 +      * window.c (delete_window, window_height, window_width)
 +      (foreach_window): Likewise.
 +      * xrdb.c (x_get_customization_string, x_get_resource): Likewise.
 +      * xterm.c (x_scroll_bar_clear, xembed_set_info)
 +      (xembed_send_message): Likewise.
 +
 +      * eval.c (run_hook_list_with_args): Delete.
 +      * font.c (font_unparse_gtkname, font_update_lface): Likewise.
 +      * terminal.c (get_terminal_param): Likewise.
 +      * xterm.c (x_alloc_lighter_color_for_widget): Likewise.
 +
 +      * scroll.c: Fix comment.
 +
 +      * dispnew.c (add_window_display_history)
 +      (add_frame_display_history, glyph_row_slice_p)
 +      (find_glyph_row_slice, flush_stdout)
 +      (check_matrix_pointer_lossage, matrix_row)
 +      (check_matrix_invariants, check_window_matrix_pointers)
 +      (check_matrix_pointers, window_to_frame_vpos)
 +      (window_to_frame_hpos): Prototize.
 +      * textprop.c (erase_properties): Likewise.
 +
 +2010-12-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * print.c (PRINT_NUMBER_OBJECT, PRINT_NUMBER_STATUS): Remove.
 +      (print_preprocess): Fix handling of uninterned symbols in last change.
 +
 +      * print.c (print, print_preprocess, print_object): Use a hash table
 +      rather than a linear table for Vprint_number_table.
 +
 +2010-12-20  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * frame.c (focus_follows_mouse): Default to 0 (Bug#7269).
 +
 +2010-12-20  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * keyboard.c (Vtool_bar_separator_image_expression): New variable.
 +      (parse_tool_bar_item): Use it to obtain image separators for
 +      displays not using native tool-bar separators.
 +
 +      * xdisp.c (build_desired_tool_bar_string): Don't handle separators
 +      specially, since this is now done in parse_tool_bar_item.
 +
 +2010-12-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      Minor clean up to silence some gcc warnings.
 +      * window.c (Fset_window_buffer):
 +      * xterm.c (x_set_frame_alpha): Restructure code to silence
 +      compiler warning.
 +      (handle_one_xevent): Remove unused var `p'.
 +      (do_ewmh_fullscreen): Remove unused var `lval'.
 +      (xembed_set_info): Remove unused var `atom'.
 +      * textprop.c (Fremove_list_of_text_properties): Add braces to silence
 +      compiler warning.
 +      * fontset.c (fontset_id_valid_p, dump_fontset):
 +      * ftfont.c (ftfont_drive_otf): Modernize k&r declaration.
 +      * eval.c (Feval, Ffuncall): Avoid unneeded gotos.
 +      * dispnew.c (update_frame, update_frame_1): Compile the `do_pause'
 +      label only when it's used.
 +      * image.c (x_create_bitmap_from_xpm_data):
 +      * dispextern.h (x_create_bitmap_from_xpm_data): Use const char** like
 +      its callers.
 +      * coding.c (detect_coding_utf_16): Remove unused vars `src_base' and
 +      `consumed_chars'.
 +      (DECODE_EMACS_MULE_21_COMPOSITION): Remove unused var `charbuf_base'.
 +      (decode_coding_emacs_mule): Remove unused label `retry'.
 +      (detect_eol): Add parens to silence compiler warning.
 +      * alloc.c (bytes_used_when_reconsidered): Move to the #ifdef where
 +      it's used to silence the compiler.
 +      (make_number): Modernize k&r declaration.
 +      (mark_char_table): Add parens to silence compiler warning.
 +
 +2010-12-17  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * keyboard.c (parse_tool_bar_item): Allow menu separators in
 +      tool-bar maps.
 +      (menu_separator_name_p): New function, from gtkutil.c.
 +      (separator_names): Move from gtkutil.c.
 +
 +      * keyboard.h (menu_separator_name_p): Add prototype.
 +
 +      * gtkutil.c (XG_BIN_CHILD): New macro.
 +      (xg_get_menu_item_label, xg_update_menubar)
 +      (xg_update_menu_item, xg_tool_bar_menu_proxy)
 +      (xg_show_toolbar_item, update_frame_tool_bar): Use it.
 +      (separator_names, xg_separator_p): Move to keyboard.c.
 +      (create_menus, xg_update_submenu, update_frame_tool_bar):
 +      Use menu_separator_name_p.
 +
 +      * nsmenu.m (name_is_separator): Function deleted.
 +      (addItemWithWidgetValue): Use menu_separator_name_p.
 +
 +      * w32menu.c (name_is_separator): Function deleted.
 +      (add_menu_item): Use menu_separator_name_p.
 +
 +2010-12-16  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (ns_draw_window_cursor): If the cursor color is the
 +      same as the background, use the face forground as cursor.
 +
 +2010-12-13  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * fileio.c (Fexpand_file_name): Doc fix.  (Bug#7617)
 +
 +2010-12-13  Eli Zaretskii  <eliz@gnu.org>
  
        * xdisp.c (string_pos_nchars_ahead, c_string_pos)
        (face_before_or_after_it_pos, next_element_from_string)
        (string_char_and_length): Update commentary: MAXLEN is no longer
        needed.
  
 -2010-12-10  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-12-13  Jan Djärv  <jan.h.d@swipnet.se>
  
        * keyboard.c (kbd_buffer_get_event): Construct SAVE_SESSION_EVENT
        as (Qsave_session arg).
        (Fhandle_save_session): If event has Qt as argument,
        call Fkill_emacs (Bug#7552).
  
 -2010-12-07  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-12-13  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * buffer.c (transient-mark-mode): Doc fix (Bug#7465).
 +
 +2010-12-13  Jan Djärv  <jan.h.d@swipnet.se>
  
        * xsmfns.c (smc_die_CB): Call Fkill_emacs (Bug#7552).
  
 -2010-12-06  Chong Yidong  <cyd@stupidchicken.com>
 +2010-12-13  Chong Yidong  <cyd@stupidchicken.com>
  
        * dispextern.h (struct it): New member overlay_strings_charpos.
  
        (next_overlay_string): Load overlay strings at recorded position,
        which may not be the same as the iterator's charpos (Bug#7016).
  
 -2010-12-05  Jan Djärv  <jan.h.d@swipnet.se>
 -
 -      * nsterm.m (ns_dumpglyphs_image): If drawing cursor, fill background
 -      with cursor color and draw a rectangle around the image (Bug#7412).
 -
 -2010-12-05  Chong Yidong  <cyd@stupidchicken.com>
 +2010-12-13  Chong Yidong  <cyd@stupidchicken.com>
  
        * xdisp.c (try_scrolling): Avoid infloop if the first line is
        obscured due to a vscroll (Bug#7537).
  
 -2010-12-02  Jan Djärv  <jhd@zeplinf.localdomain>
 +2010-12-13  Jan Djärv  <jhd@zeplinf.localdomain>
  
        * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGHT.
  
        (x_set_offset): Handle XNegative and YNegative in
        f->size_hint_flags (Bug#7510).
  
 -2010-11-25  Kenichi Handa  <handa@m17n.org>
 +2010-12-11  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * w32fns.c (Fx_show_tip): Call try_window with last argument
 +      TRY_WINDOW_IGNORE_FONTS_CHANGE.  Delete the TODO ifdef: problem
 +      solved.  Round up the tip height to an integral multiple of the
 +      frame's line height.  Add FRAME_COLUMN_WIDTH to the tip width.
 +      (Bug#7398)
 +
 +2010-12-08  Glenn Morris  <rgm@gnu.org>
 +
 +      * fileio.c (Fverify_visited_file_modtime): Default to current buffer.
 +
 +2010-12-06  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * xml.c (parse_region): Ignore blank HTML nodes.
 +      (make_dom): Return CDATA sections (like <style>foo</style>) as
 +      text nodes.
 +
 +2010-12-06  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * lread.c (read1): Allow newstyle unquote outside of backquote.
 +      Disallow old-style backquotes inside new-style backquotes.
 +      Don't count unquotes to figure out when we're "syntactically inside
 +      but semantically outside of a backquote" any more.
 +      Extend the restriction no-unescaped-commas-and-backquotes-in-symbols
 +      to all contexts.
 +
 +2010-12-05  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * process.c: Remove checks for HAVE_SYS_IOCTL_H (Bug#7484).
 +
 +2010-12-04  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * Makefile.in (M_FILE): Substitute @M_FILE@ instead of @machfile@.
 +      (S_FILE): Substitute @S_FILE@ instead of @opsysfile@.
 +      * m/arm.h, m/sh3.h, m/xtensa.h: Remove files.
 +
 +2010-12-03  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * lisp.h (union Lisp_Object): Explicitly declare signedness of
 +      bit-field.
 +      (XINT): Remove variant for EXPLICIT_SIGN_EXTEND.
 +      * m/alpha.h (EXPLICIT_SIGN_EXTEND): Don't define.
 +      * m/amdx86-64.h (EXPLICIT_SIGN_EXTEND): Likewise.
 +      * m/ia64.h (EXPLICIT_SIGN_EXTEND): Likewise.
 +      * m/ibms390.h (EXPLICIT_SIGN_EXTEND): Likewise.
 +      * m/ibms390x.h (EXPLICIT_SIGN_EXTEND): Likewise.
 +      * m/iris4d.h (EXPLICIT_SIGN_EXTEND): Likewise.
 +      * m/m68k.h (EXPLICIT_SIGN_EXTEND): Likewise.
 +      * m/sparc.h (EXPLICIT_SIGN_EXTEND): Likewise.
 +      * m/template.h (EXPLICIT_SIGN_EXTEND): Likewise.
 +      * m/hp800.h: Remove file.
 +      * m/mips.h: Remove file.
 +
 +2010-12-03  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (ns_dumpglyphs_image): If drawing cursor, fill background
 +      with cursor color and draw a rectangle around the image (Bug#7412).
 +
 +2010-12-03  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * frame.c (x_set_font): Remove unused variable.
 +
 +2010-12-02  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsmenu.m (update_frame_tool_bar): Remove NSLog on invalid image.
 +
 +      * nsterm.m (ns_draw_glyph_string): Switch fore- and background if
 +      drawing text under filled box cursor (Bug#7479).
 +
 +2010-11-27  Kenichi Handa  <handa@m17n.org>
  
        * charset.c (emacs_mule_charset): Make it an array of charset ID;
        i.e. integer.
 -      (Fdefine_charset_internal): Adjusted for the above change.
 +      (Fdefine_charset_internal): Adjust for the above change.
        (init_charset_once): Likewise.
  
 -      * charset.h (emacs_mule_charset): Adjust the prototype.  Delete
 -      duplicated extern.
 +      * charset.h (emacs_mule_charset): Adjust the prototype.
 +      Delete duplicated extern.
  
        * coding.c (emacs_mule_char): Adjust for the change of
        emacs_mule_charset.
        * lread.c (read_emacs_mule_char): Adjust for the change of
        emacs_mule_charset.
  
 -2010-11-22  Eli Zaretskii  <eliz@gnu.org>
 +2010-11-27  Eli Zaretskii  <eliz@gnu.org>
  
        * w32.c (_PROCESS_MEMORY_COUNTERS_EX): Don't define with versions
        of w32api >= 3.15.  (Bug#6989)  (Bug#7452)
  
 -2010-11-22  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +2010-11-27  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
  
        * alloc.c (mark_terminals): Ensure that the image cache is marked
        even if the terminal object was marked earlier (Bug#6301).
  
        * editfns.c (Fbyte_to_string): Signal an error arg is not a byte.
  
 -2010-11-20  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-11-27  Jan Djärv  <jan.h.d@swipnet.se>
  
        * gtkutil.c (menubar_map_cb): New function (Bug#7425).
        (xg_update_frame_menubar): Connect signal map to menubar_map_cb.
        Use 23 as menubar height if 0.  (Bug#7425).
  
 -2010-11-14  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-11-26  Eli Zaretskii  <eliz@gnu.org>
  
 -      * xsettings.c (init_gconf): Check HAVE_G_TYPE_INIT.
 +      * xdisp.c (set_message_1): Force paragraph direction in echo area
 +      be left-to-right.
  
 -      * config.in (HAVE_G_TYPE_INIT): New symbol.
 +      * keyboard.c (make_lispy_position): Put a meaningful value in yret
 +      when the click is on the header or mode line.
  
 -2010-11-12  Eli Zaretskii  <eliz@gnu.org>
 +2010-11-25  Eli Zaretskii  <eliz@gnu.org>
  
 -      * lread.c (Fload): Mention `load-in-progress' and
 -      `load-file-name'.  (Bug#7346)
 +      * xdisp.c (set_cursor_from_row): Don't forget to consider the
 +      `cursor' property of the first character in overlay strings.
 +      (Bug#7474)  (Bug#7481)
  
 -2010-11-09  Eli Zaretskii  <eliz@gnu.org>
 +2010-11-24  Jan Djärv  <jan.h.d@swipnet.se>
  
 -      * keyboard.c (kbd_buffer_nr_stored): Define only ifdef subprocesses.
 -      (kbd_buffer_store_event_hold, kbd_buffer_get_event)
 -      (tty_read_avail_input): Call kbd_buffer_nr_stored only ifdef
 -      subprocesses.  Use buffer_free only ifdef subprocesses.
 +      * nsterm.m (NSLeftControlKeyMask, NSLeftCommandKeyMask)
 +      (NSLeftAlternateKeyMask): New defines.
 +      (keyDown): Parse left and right keys separately (Bug#7458).
 +      Compare Left key masks exactly (Bug#7458).
  
 -      * process.c (init_process) [subprocesses]: Init kbd_is_on_hold in
 +2010-11-23  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * intervals.c (temp_set_point_both): Define before calling, to
 +      avoid GCC warnings.
 +
 +2010-11-23  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * nsmenu.m: Use #include <config.h> instead of "config.h".
 +
 +      * term.c (Qglyphless_char,last_glyphless_glyph_frame)
 +      (last_glyphless_glyph_face_id. last_glyphless_glyph_merged_face_id):
 +      Move declarations ...
 +      * lisp.h (Qglyphless_char,last_glyphless_glyph_frame)
 +      (last_glyphless_glyph_face_id. last_glyphless_glyph_merged_face_id):
 +      ... here.
 +
 +      * emacs.c (gdb_use_union, gdb_valbits,gdb_gctypebits)
 +      (gdb_data_seg_bits, gdb_array_mark_flag, PVEC_FLAG)
 +      (gdb_pvec_type):
 +      * print.c (print_output_debug_flag):
 +      * lisp.h (debug_print): Mark as EXTERNALLY_VISIBLE.
 +      (safe_debug_print): New declaration.
 +
 +      * xterm.c:
 +      * systty.h:
 +      * sound.c: Include <sys/ioctl.h> unconditionally.
 +
 +2010-11-22  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +
 +      * alloc.c (mark_maybe_object): Return early if given a Lisp
 +      integer (Bug#6301).
 +
 +2010-11-21  Ken Brown  <kbrown@cornell.edu>
 +
 +      * sheap.c (STATIC_HEAP_SIZE): Revert previous change.
 +
 +2010-11-21  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (ns_right_command_modifier, ns_right_control_modifier):
 +      Define (Bug#7458).
 +      (NSRightCommandKeyMask, NSRightControlKeyMask): Define (Bug#7458).
 +      (EV_MODIFIERS): Check for NSRightCommandKeyMask and
 +      NSRightControlKeyMask also (Bug#7458).
 +      (keyDown): Ditto (Bug#7458).
 +      (syms_of_nsterm): Defvar ns-right-command-modifier and
 +      ns-right-control-modifier (Bug#7458).
 +
 +2010-11-21  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * sysdep.c (sys_subshell): Remove SET_EMACS_PRIORITY.
 +      * emacs.c (emacs_priority, syms_of_emacs): Remove emacs_priority.
 +
 +      * intervals.h (temp_set_point, temp_set_point_both):
 +      * buffer.h (offset_intervals, copy_intervals): Remove INLINE.
 +
 +2010-11-20  Ken Brown  <kbrown@cornell.edu>
 +
 +      * sheap.c (STATIC_HEAP_SIZE): Increase to 13MB.
 +
 +2010-11-20  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * term.c (produce_glyphless_glyph): Use \uNNNN, \UNNNNNN, or
 +      \xNNNNNN for hex-code display of glyphless characters.
 +
 +2010-11-20  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * gtkutil.c (xg_make_tool_item): Take vert_only as argument.
 +      Set important to ! vert_only.
 +      (xg_show_toolbar_item): Don't show label horizontally if
 +      tool item isn't important.
 +      (update_frame_tool_bar): Get TOOL_BAR_ITEM_VERT_ONLY and pass it to
 +      xg_make_tool_item, or update important on existing tool item.
 +
 +      * keyboard.c (QCvert_only): New variable.
 +      (parse_tool_bar_item): Check for QCvert_only.
 +      (syms_of_keyboard): Initialize QCvert_only.
 +
 +      * dispextern.h (tool_bar_item_idx): Add TOOL_BAR_ITEM_VERT_ONLY.
 +
 +2010-11-20  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * msdos.c (dos_rawgetc): Use gen_help_event, instead of doing the
 +      same in-line.
 +
 +2010-11-20  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * xfaces.c (lookup_face): Make static.
 +      * dispnew.c (copy_row_except_pointers): Likewise.
 +      * syntax.c (dec_bytepos): Likewise.
 +      (inc_bytepos): Remove.
 +      * dispextern.h (lookup_face): Remove declaration.
 +
 +2010-11-19  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c (set_cursor_from_row): Display cursor after all the
 +      glyphs that come from an overlay.  Don't overstep the last glyph
 +      when skipping glyphs from an overlay.  (Bug#6687)
 +
 +2010-11-18  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * alloc.c (refill_memory_reserve): Move declaration ...
 +      * lisp.h (refill_memory_reserve): ... here.
 +
 +      * strftime.c (_strftime_copytm): Add declaration.
 +
 +      * callproc.c (syms_of_callproc): Use intern_c_string.
 +
 +      Move declarations from .c files to .h files.
 +      * process.c (timers_run):
 +      * minibuf.c (quit_char):
 +      * lread.c (read_emacs_mule_char):
 +      * keyboard.c (minibuf_level, message_enable_multibyte)
 +      (pending_malloc_warning):
 +      * insdel.c (Vselect_active_regions, Vsaved_region_selection)
 +      (Qonly): Remove declarations.
 +      * lisp.h (pending_malloc_warning, Vsaved_region_selection)
 +      (Vselect_active_regions):
 +      * keyboard.h (timers_run):  Add declarations.
 +
 +      * strftime.c (my_strftime_gmtime_r, my_strftime_localtime_r)
 +      (tm_diff): Convert definitions to standard C.
 +      (extra_args_spec_iso): Remove, unused.
 +
 +2010-11-18  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsettings.c (init_gconf): Check HAVE_G_TYPE_INIT.
 +
 +      * config.in (HAVE_G_TYPE_INIT): New symbol.
 +
 +2010-11-18  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * lread.c (Fload): Mention `load-in-progress' and
 +      `load-file-name'.  (Bug#7346)
 +
 +      * keyboard.c (kbd_buffer_nr_stored): Define only ifdef subprocesses.
 +      (kbd_buffer_store_event_hold, kbd_buffer_get_event)
 +      (tty_read_avail_input): Call kbd_buffer_nr_stored only ifdef
 +      subprocesses.  Use buffer_free only ifdef subprocesses.
 +
 +      * process.c (init_process) [subprocesses]: Init kbd_is_on_hold in
        the subprocesses version, not in the non-subprocesses one.
  
        * Makefile.in: Don't use ## comment, it breaks the MSDOS build.
  
 -      * xfns.c (x_real_positions): Fix declaration-after-statement
 -      problem.
 +2010-11-17  Eli Zaretskii  <eliz@gnu.org>
  
 -2010-11-05  Chong Yidong  <cyd@stupidchicken.com>
 +      * xdisp.c (set_cursor_from_row): Fix cursor positioning in empty
 +      lines on text-mode terminals.  (bug#7417)
  
 -      * image.c (free_image): Don't garbage the frame here, since this
 -      function can be called while redisplaying (Bug#7210).
 -      (uncache_image): Garbage the frame here (Bug#6426).
 +2010-11-17  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -2010-11-04  Chong Yidong  <cyd@stupidchicken.com>
 +      * xterm.c (get_current_wm_state): Rename from get_current_vm_state.
 +      (do_ewmh_fullscreen, x_handle_net_wm_state): Update callers.
  
 -      * process.c (Fmake_network_process): Don't apply Bug#5173 fix for
 -      Windows.
 +2010-11-17  Kenichi Handa  <handa@m17n.org>
  
 -2010-11-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +      * coding.c (Fset_terminal_coding_system_internal): Fix previous
 +      change (set charset-ID list instead of charset-symbol list).
  
 -      * process.c (Fmake_network_process): Don't call turn_on_atimers around
 -      `connect' (Bug#5723).
 +2010-11-16  Chong Yidong  <cyd@stupidchicken.com>
  
 -2010-11-04  Helmut Eller  <eller.helmut@gmail.com>
 +      * keyboard.c (make_lispy_position): For text area clicks, record Y
 +      pixel position relative to the text area, excluding header line.
 +      Also change X and Y to Lisp_Objects, not pointers; don't return
 +      coordinate values via pointers.  Pass ON_TEXT_AREA coordinate to
 +      buffer_posn_from_coords counting from the start of the text area.
 +      (Fposn_at_x_y, make_lispy_event): Callers changed.
  
 -      * process.c (Fmake_network_process): Call `select' for interrupted
 -      `connect' rather than creating new socket (Bug#5173).
 +      * window.c (coordinates_in_window): Change X and Y to ints rather
 +      than pointers; don't return coordinates via pointers.
 +      (struct check_window_data): Change X and Y from pointers to ints.
 +      (window_from_coordinates): Remove args WX and WY; don't return
 +      coordinates via pointers.
 +      (Fcoordinates_in_window_p, window_from_coordinates):
 +      (check_window_containing, Fwindow_at): Callers changed.
 +      (window_relative_x_coord): New function.
  
 -2010-11-04  Kenichi Handa  <handa@m17n.org>
 +      * window.h (window_from_coordinates, window_relative_x_coord):
 +      Update prototypes.
  
 -      * font.c (font_delete_unmatched): Check Vface_ignored_fonts.
 -      Don't sheck SPEC if it is nil.
 -      (font_list_entities): Call font_delete_unmatched if
 -      Vface_ignored_fonts is non-nil.
 +      * dispnew.c (buffer_posn_from_coords): Assume that X counts from
 +      the start of the text area.
  
 -2010-11-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +      * xdisp.c (remember_mouse_glyph): Change window_from_coordinates
 +      call.  Use window_relative_x_coord.
 +      (note_mouse_highlight): Change window_from_coordinates call.
  
 -      * dispextern.h (TRY_WINDOW_CHECK_MARGINS)
 -      (TRY_WINDOW_IGNORE_FONTS_CHANGE): New defines.
 +      * w32term.c (w32_read_socket):
 +      * msdos.c (dos_rawgetc):
 +      * xterm.c (handle_one_xevent): Likewise.
  
 -      * xdisp.c (try_window): Change arg from CHECK_MARGINS to FLAGS.
 -      Don't abort with fonts change if TRY_WINDOW_IGNORE_FONTS_CHANGE is
 -      set in FLAGS.  Callers with non-zero CHECK_MARGINS changed to use
 -      TRY_WINDOW_CHECK_MARGINS.
 +2010-11-16  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * xfns.c (Fx_show_tip): Undo last change.  Call try_window with
 -      TRY_WINDOW_IGNORE_FONTS_CHANGE (Bug#2423).
 +      * strftime.c (LOCALE_PARAM_DECL): Update for standard C.
 +      (LOCALE_PARAM, LOCALE_PARAM_PROTO): Remove, unused.
 +      (memcpy_lowcase, so_week_days, extra_args_spec, emacs_strftimeu):
 +      Convert definitions to standard C.
 +      * regex.c: Do not include <stdlib.h>, config.h does it.
 +      Include unistd.h.
 +      (xrealloc, init_syntax_once, re_match, regcomp, regexec)
 +      (regerror, regfree): Convert definitions to standard C.
 +      * mktime.c (my_mktime_localtime_r, ydhms_tm_diff, ranged_convert)
 +      (__mktime_internal): Convert definitions to standard C.
  
 -2010-11-04  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-11-15  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * xfns.c (x_real_positions): Only use _NET_FRAME_EXTENTS if our
 -      parent is the root window.  Check this after traversing window tree.
 +      * w32proc.c:
 +      * w32inevt.c:
 +      * w32heap.c:
 +      * w32.c: Remove config.h include guards.
  
 -      * xterm.c (x_term_init): Initialize Xatom_net_frame_extents.
 +      * callproc.c (child_setup): Reorder code to simplify #ifdefs.
 +      No code changes.
  
 -      * xterm.h (struct x_display_info): Xatom_net_frame_extents is new.
 +      * process.c: Include <sys/ioctl.h> unconditionally,
 +      keyboard.c already does it.
  
 -      * xfns.c (x_real_positions): Try to get _NET_FRAME_EXTENTS first
 -      before traversing window tree (Bug#5721).
 +      * keyboard.c (pending_malloc_warning): Add const to match
 +      definition in alloc.c.
 +      (Fset_input_interrupt_mode): Simplify #ifdefs.
  
 -2010-11-03  Glenn Morris  <rgm@gnu.org>
 +2010-11-15  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * Makefile.in (CRT_DIR): New variable, set by configure.
 -      * m/amdx86-64.h, m/ibms390x.h (START_FILES, LIB_STANDARD):
 -      Use $CRT_DIR rather than HAVE_LIB64_DIR.  (Bug#5655)
 +      Clean up systty.h macros.
 +      * systty.h (EMACS_GET_TTY_PGRP, EMACS_SET_TTY_PGRP, EMACS_GET_TTY)
 +      (EMACS_SET_TTY): Remove unneeded abstraction, instead inline the
 +      definition in all uses.
 +      (EMACS_TTY_TABS_OK): Remove, it has a single user.
 +      * sysdep.c (discard_tty_input, child_setup_tty)
 +      (init_sys_modes, tabs_safe_p, reset_sys_modes):
 +      * emacs.c (shut_down_emacs):
 +      * callproc.c (child_setup):
 +      * term.c (dissociate_if_controlling_tty): Inline removed macros.
  
 -2010-11-01  Jan Djärv  <jan.h.d@swipnet.se>
 +      * data.c (sign_extend_temp, sign_extend_lisp_int): Remove, unused.
  
 -      * process.c (kbd_is_on_hold): New variable.
 -      (hold_keyboard_input, unhold_keyboard_input, kbd_on_hold_p):
 -      New functions.
 -      (wait_reading_process_output): If kbd_on_hold_p returns non-zero,
 -      select on empty input mask.
 -      (init_process): Initialize kbd_is_on_hold to 0.
 +2010-11-14  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * process.h (hold_keyboard_input, unhold_keyboard_input)
 -      (kbd_on_hold_p): Declare.
 +      * w32fns.c (Fx_create_frame):
 +      * nsfns.m (Fx_create_frame): Don't check for the cursorColor
 +      resource here; it's now done at startup.
  
 -      * keyboard.c (input_available_signal): Declare.
 -      (kbd_buffer_nr_stored): New function.
 -      (kbd_buffer_store_event_hold): If kbd_buffer_nr_stored returns
 -      more than KBD_BUFFER_SIZE/2, stop reding input (Bug#6571).
 -      (kbd_buffer_get_event): If input is suspended and kbd_buffer_nr_stored
 -      returns less than KBD_BUFFER_SIZE/4, resume reding input (Bug#6571).
 -      (tty_read_avail_input): If input is on hold, return.
 -      Don't read more that free slots in kbd_buffer (Bug#6571).
 +2010-11-14  Jan Djärv  <jan.h.d@swipnet.se>
  
 -2010-10-31  Chong Yidong  <cyd@stupidchicken.com>
 +      * xterm.c (set_wm_state): Add Qnil to final cons.
  
 -      * xterm.c (x_connection_closed): Print informative error message
 -      when aborting on GTK.  This requires using shut_down_emacs
 -      directly instead of Fkill_emacs.
 +      * xselect.c (x_send_client_event): Remove unused variables cons and
 +      size.
  
 -2010-10-25  Michael Albinus  <michael.albinus@gmx.de>
 +2010-11-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
  
 -      * dbusbind.c (Fdbus_call_method_asynchronously)
 -      (Fdbus_register_signal, Fdbus_register_method): Check, whether
 -      `dbus-registered-objects-table' is initialized.
 +      * keyboard.c (modify_event_symbol) : Add const to array elements of
 +      arg NAME_TABLE.
 +      (lispy_accent_keys, lispy_function_keys, lispy_multimedia_keys)
 +      (lispy_kana_keys, iso_lispy_function_keys, lispy_wheel_names)
 +      (lispy_wheel_names, lispy_drag_n_drop_names, modifier_names):
 +      Add const to array elements.
 +      (scroll_bar_parts): Make static.  Fix position of const.
  
 -2010-10-24  Chong Yidong  <cyd@stupidchicken.com>
 +      * w32fns.c (lispy_function_keys): Add const to extern.
  
 -      * xterm.c (x_connection_closed): Kill Emacs unconditionally.
 +      * w32inevt.c (lispy_function_keys): Likewise.
  
 -2010-10-22  Eli Zaretskii  <eliz@gnu.org>
 +2010-11-14  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * frame.c (Fframep, Fwindow_system): Deprecate use as a predicate.
 +      * xfns.c (Fx_create_frame): Don't check for the cursorColor
 +      resource here; it's now done at startup.
  
 -      * dispnew.c (syms_of_display) <initial-window-system, window-system>:
 -      Deprecate use as a boolean flag.
 +2010-11-13  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -2010-10-18  Ken Brown  <kbrown@cornell.edu>
 +      * xmenu.c: Make it clear that ../lwlib/lwlib.h is only needed for Motif.
  
 -      * s/cygwin.h (SIGNALS_VIA_CHARACTERS): New define (bug#7225).
 +      Fix compilation on Solaris.
 +      * sysdep.c: Do not #include <term.h>.
 +      (tputs): Add declaration, similar to what cm.c does.  (Bug#7178)
  
 -2010-10-15  Kenichi Handa  <handa@m17n.org>
 +      * s/ms-w32.h (HAVE_TERMIOS_H): Do not undef, not used anymore.
  
 -      Fix incorrect font metrics when the same font is opened with
 -      different pixelsizes.
 +2010-11-13  Jan Djärv  <jan.h.d@swipnet.se>
  
 -      * xftfont.c: Include composite.h.
 -      (xftfont_shape): New function.
 -      (syms_of_xftfont): Set xftfont_driver.shape.
 +      * xterm.c (set_wm_state): Don't put Atom in cons, call
 +      make_fixnum_or_float on them first.
 +      (x_term_init): Initialize Xatom_net_supporting_wm_check and
 +      Xatom_net_supported correctly.
  
 -2010-10-13  Damyan Pepper  <damyanp@gmail.com>
 +      * xselect.c (x_send_client_event): Move CHECK_STRING ...
 +      (Fx_send_client_event): to here.
  
 -      Fix handling of font properties on Windows (bug#6303).
 -      * font.c (font_filter_properties): New function, refactored from
 -      ftfont_filter_properties.
 -      * font.h (font_filter_properties): Declare.
 -      * ftfont.c (ftfont_filter_properties): Use font_filter_properties.
 -      * w32font.c (w32font_booleans, w32font_non_booleans): New variables.
 -      (w32font_filter_properties): New function.
 -      (w32font_driver): Add w32font_filter_properties.
 +2010-11-13  Martin Rudalics  <rudalics@gmx.at>
  
 -2010-10-12  Juanma Barranquero  <lekktu@gmail.com>
 +      * window.c (Fwindow_use_time): New function.
  
 -      * font.c (Ffont_variation_glyphs):
 -      * ccl.c (Fccl_execute_on_string): Fix typo in docstring.
 +2010-11-13  Eli Zaretskii  <eliz@gnu.org>
  
 -2010-10-10  Jan Djärv  <jan.h.d@swipnet.se>
 +      * xdisp.c (set_cursor_from_row): Fix cursor positioning on
 +      zero-width characters.
  
 -      * nsterm.m (Qleft): Declare.
 -      (ns_right_alternate_modifier): New variable
 -      (NSRightAlternateKeyMask): New define.
 -      (EV_MODIFIERS): Parse NSRightAlternateKeyMask if
 -      ns_right_alternate_modifier isn't Qleft.
 -      (keyDown): If ns_right_alternate_modifier isn't Qleft, use it
 -      as emacs modifier for NSRightAlternateKeyMask.
 -      (syms_of_nsterm): DEFVAR_LISP ns-right-alternate-modifier.
 +      * .gdbinit (pgx): Adapt to latest changes in `struct glyph'.
  
 -2010-10-08  Michael Albinus  <michael.albinus@gmx.de>
 +      * w32term.c (x_draw_glyphless_glyph_string_foreground): Draw the
 +      box before drawing the glyphs inside it.
  
 -      * dbusbind.c (xd_get_dispatch_status): Return a Lisp_Object.
 -      (xd_pending_messages): Catch xd_get_dispatch_status calls.
 +      * xdisp.c (syms_of_xdisp) <glyphless-char-display>: Doc fix.
  
 -2010-10-08  Kenichi Handa  <handa@m17n.org>
 +      * dispextern.h (enum glyphless_display_method):
 +      Rename GLYPHLESS_DISPLAY_HEXA_CODE to GLYPHLESS_DISPLAY_HEX_CODE.
 +      All users changed.
  
 -      * coding.c (complement_process_encoding_system): Fix previous change.
 +      * term.c (append_glyphless_glyph, produce_glyphless_glyph):
 +      Fix comments.
 +      (produce_glyphless_glyph): Enclose "U+nnnn" and "empty box"
 +      whitespace in "[]", to simulate a box.  Don't use uninitialized
 +      variable `width'.
  
 -2010-10-03  Michael Albinus  <michael.albinus@gmx.de>
 +2010-11-11  Julien Danjou  <julien@danjou.info>
  
 -      * dbusbind.c (syms_of_dbusbind): Move putenv call ...
 -      (Fdbus_init_bus): ... here.  (Bug#7113)
 +      * xsettings.c (init_xsettings): Use already fetch atoms.
  
 -2010-10-03  Glenn Morris  <rgm@gnu.org>
 +      * xsmfns.c (create_client_leader_window): Use SM_CLIENT_ID atom
 +      from dpyinfo.
  
 -      * buffer.c (before-change-functions, after-change-functions):
 -      Three-year overdue doc fix following 2007-08-13 change.
 +      * xselect.c (Fx_send_client_event): Split and create
 +      x_send_client_event.
  
 -2010-10-02  Kenichi Handa  <handa@m17n.org>
 +      * lisp.h: Do not EXFUN Fx_send_client_event.
  
 -      * coding.c (coding_inherit_eol_type): If parent doesn't specify
 -      eol-format, inherit from the system's default.
 -      (complement_process_encoding_system): Make a new coding system
 -      inherit the original eol-format.
 +      * xterm.c (x_set_frame_alpha): Use _NET_WM_WINDOW_OPACITY atom
 +      from dpyinfo.
 +      (wm_supports): Use atoms from dpyinfo.
 +      (do_ewmh_fullscreen): Use atoms from dpyinfo.
 +      (x_ewmh_activate_frame): Use atoms from dpyinfo.
 +      (xembed_set_info): Use atoms from dpyinfo.
 +      (x_term_init): Fetch _XEMBED_INFO, _NET_SUPPORTED,
 +      _NET_SUPPORTING_WM_CHECK, _NET_WM_WINDOW_OPACITY and
 +      _NET_ACTIVE_WINDOW, XSETTINGS  atoms.
 +      Get all atoms in one round-trip.
 +      (set_wm_state): Use x_send_client_event rather than
 +      Fx_send_client_event, using Atom directly.
 +      (x_ewmh_activate_frame): Ditto.
 +      (x_set_sticky): Pass atoms to set_wm_state.
 +      (do_ewmh_fullscreen): Ditto.
  
 -2010-09-30  Kenichi Handa  <handa@m17n.org>
  
 -      * coding.c (complement_process_encoding_system): New function.
 +      * xterm.h (x_display_info): Add Xatom_net_supported,
 +      Xatom_net_supporting_wm_check, Xatom_net_active_window,
 +      Xatom_net_wm_window_opacity, Xatom_XEMBED_INFO, SM_CLIENT_ID.
  
 -      * coding.h (complement_process_encoding_system): Extern it.
 +      * xfns.c (Fx_show_tip): Fix typo in docstring.
  
 -      * callproc.c (Fcall_process): Complement the coding system for
 -      encoding arguments.
 -      (Fcall_process_region): Complement the coding system for encoding
 -      the input to the process.
 +2010-11-11  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -      * process.c (Fstart_process): Complement the coding system for
 -      encoding arguments.
 -      (send_process): Complement the coding system for encoding what
 -      sent to the process.
 +      * cmds.c (Fself_insert_command): Don't call XFASTINT without checking
 +      it's not negative.
  
 -2010-09-29  Kenichi Handa  <handa@m17n.org>
 +2010-11-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
  
 -      * xfont.c (xfont_open): Fix setting of font->average_width from
 -      :avgwidth property (Bug#7123).
 +      * font.c (font_filter_properties): Add const to array elements of
 +      properties args.
  
 -2010-09-28  Michael Albinus  <michael.albinus@gmx.de>
 +      * font.h (font_filter_properties): Likewise.
  
 -      * dbusbind.c (syms_of_dbusbind): Use putenv instead of setenv, it
 -      is more portable.
 +      * ftfont.c (ftfont_booleans, ftfont_non_booleans): Add const to array
 +      elements.
  
 -      * keyboard.c (gobble_input): Move call of xd_read_queued_messages ...
 -      (kbd_buffer_get_event): ... here.  This is needed for cygwin, which
 -      has not defined SIGIO.
 +      * w32font.c (w32font_booleans, w32font_non_booleans): Likewise.
  
 -2010-09-27  Michael Albinus  <michael.albinus@gmx.de>
 +2010-11-10  Michael Albinus  <michael.albinus@gmx.de>
  
 -      * dbusbind.c (syms_of_dbusbind): Set $DBUS_FATAL_WARNINGS to "0".
 -      (Bug#7113)
 +      * dbusbind.c (QCdbus_type_unix_fd): New Lisp object.
 +      (XD_BASIC_DBUS_TYPE, xd_symbol_to_dbus_type, xd_signature)
 +      (xd_append_arg, xd_retrieve_arg): Support DBUS_TYPE_UNIX_FD.
 +      (Fdbus_call_method): Add DBUS_TYPE_UNIX_FD type mapping to doc string.
 +      (syms_of_dbusbind): Initialize QCdbus_type_unix_fd).
  
 -2010-09-26  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-11-10  Glenn Morris  <rgm@gnu.org>
  
 -      * xgselect.c (xg_select): Clear file descriptors not set from
 -      rfds and wfds.
 +      * emacs.c (syms_of_emacs) <system-type>: Doc fix.
  
 -2010-09-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 +2010-11-09  Eli Zaretskii  <eliz@gnu.org>
  
 -      * syntax.c (back_comment): Detect the case where a 1-char comment
 -      starter is also the 2nd char of a 2-char comment ender.
 +      * xfns.c (x_real_positions): Fix declaration-after-statement problem.
  
 -2010-09-17  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-11-09  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * gtkutil.c (xg_tool_bar_menu_proxy): Set gtk-menu-items to TRUE.
 +      * image.c (free_image): Don't garbage the frame here, since this
 +      function can be called while redisplaying (Bug#7210).
 +      (uncache_image): Garbage the frame here (Bug#6426).
  
 -2010-09-12  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-11-09  Jan Djärv  <jan.h.d@swipnet.se>
  
 -      * xterm.c (get_current_vm_state): New function.
 -      (do_ewmh_fullscreen): Call get_current_vm_state and compare with
 -      want_fullscreen so set_wm_state calls are few (Bug#7013).
 -      (x_handle_net_wm_state): Move code to get_current_vm_state and
 -      call that function.
 +      * xfns.c (x_real_positions): Only use _NET_FRAME_EXTENTS if our
 +      parent is the root window.  Check this after traversing window tree.
 +
 +      * xterm.c (x_term_init): Initialize Xatom_net_frame_extents.
  
 -2010-09-11  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
 +      * xterm.h (struct x_display_info): Xatom_net_frame_extents is new.
  
 -      * term.c (tty_set_terminal_modes): Don't initialize twice (bug#7002).
 +      * xfns.c (x_real_positions): Try to get _NET_FRAME_EXTENTS first
 +      before traversing window tree (Bug#5721).
  
 -2010-09-08  Kenichi Handa  <handa@m17n.org>
 +2010-11-07  Jan Djärv  <jan.h.d@swipnet.se>
  
 -      * coding.c (encode_coding_iso_2022): Don't optimize for ASCII if
 -      we may use designation or locking-shift.
 +      * xfns.c (set_machine_and_pid_properties): Let X set WM_CLIENT_MACHINE.
  
 -2010-09-07  Kenichi Handa  <handa@m17n.org>
 +      * xdisp.c (note_mode_line_or_margin_highlight):
 +      Initialize Cursor to No_Cursor for HAVE_WINDOW_SYSTEM also.
  
 -      * coding.c (detect_coding_emacs_mule): Fix checking of multibyte
 -      sequence when the source is multibyte.
 +2010-11-06  Eli Zaretskii  <eliz@gnu.org>
  
 -2010-08-31  Kenichi Handa  <handa@m17n.org>
 +      * xfns.c (Fx_show_tip): If any of the tool-tip text lines is R2L,
 +      adjust width of tool-tip frame to the width of text, excluding the
 +      stretch glyph at the beginning of R2L glyph rows.
  
 -      * dispextern.h (FACE_FOR_CHAR): Use an ASCII face for 8-bit
 -      characters.
 +      * w32fns.c (Fx_show_tip): Likewise.
  
 -      * term.c (encode_terminal_code): Fix the previous change.
 -      (produce_glyphs): Don't set it->char_to_display here.
 -      Don't handle unibyte-display-via-language-environment here.
 -      (produce_special_glyphs): Set temp_it.char_to_display before
 -      calling produce_glyphs.
 +2010-11-06  Jan Djärv  <jan.h.d@swipnet.se>
  
 -      * xdisp.c (get_next_display_element): Set it->char_to_display
 -      here.  Convert all 8-bit bytes from unibyte buffer/string to 8-bit
 -      characters.
 -      (get_overlay_arrow_glyph_row): Set it.char_to_display too before
 -      calling PRODUCE_GLYPHS.
 -      (append_space_for_newline): Save and store it->char_to_display.
 -      Set it->char_to_display before calling PRODUCE_GLYPHS.
 -      (extend_face_to_end_of_line): Set it->char_to_display before
 -      calling PRODUCE_GLYPHS.
 -      (get_glyph_face_and_encoding): Set the glyph code an 8-bit
 -      character to its byte value.
 -      (get_char_glyph_code): New function.
 -      (produce_stretch_glyph): Set it2.char_to_display too before
 -      calling x_produce_glyphs.
 -      (x_produce_glyphs): Simplify by using the same code for ASCII and
 -      non-ASCII characters.  Don't set it->char_to_display here.
 -      Don't handle unibyte-display-via-language-environment here.  For a
 -      character of no glyph, use font->space_width instead of FONT_WIDTH.
 +      * nsfont.m: Include termchar for new mouse-highlight.
 +      (nsfont_draw): Use MOUSE_HL_INFO.
  
 -2010-08-29  Kenichi Handa  <handa@m17n.org>
 +2010-11-05  Eli Zaretskii  <eliz@gnu.org>
  
 -      * term.c (encode_terminal_code): Encode byte chars to the
 -      correspnding bytes.
 +      Unify mouse-highlight code for all GUI and TTY sessions.
  
 -2010-08-17  Andreas Schwab  <schwab@linux-m68k.org>
 +      * term.c: Remove static mouse_face_* variables.  All users
 +      changed.
 +      (term_show_mouse_face, term_clear_mouse_face)
 +      (fast_find_position, term_mouse_highlight): Functions deleted.
 +      (tty_draw_row_with_mouse_face): New function.
 +      (term_mouse_movement): Call note_mouse_highlight instead of
 +      term_mouse_highlight.
 +
 +      * nsterm.m (ns_update_window_begin, ns_update_window_end)
 +      (ns_update_end, x_destroy_window, ns_frame_up_to_date)
 +      (ns_dumpglyphs_box_or_relief, ns_maybe_dumpglyphs_background)
 +      (ns_dumpglyphs_image, ns_dumpglyphs_stretch)
 +      (ns_initialize_display_info, keyDown, mouseMoved, mouseExited):
 +      Replace Display_Info with Mouse_HLInfo everywhere where
 +      mouse_face_* members were accessed for mouse highlight purposes.
 +
 +      * xterm.c (x_update_window_begin, x_update_window_end)
 +      (x_update_end, XTframe_up_to_date, x_set_mouse_face_gc)
 +      (handle_one_xevent, x_free_frame_resources, x_term_init):
 +      Replace Display_Info with Mouse_HLInfo everywhere where mouse_face_*
 +      members were accessed for mouse highlight purposes.
 +
 +      * w32term.c (x_update_window_begin, x_update_window_end)
 +      (x_update_end, w32_read_socket, x_free_frame_resources)
 +      (w32_initialize_display_info): Replace Display_Info with
 +      Mouse_HLInfo everywhere where mouse_face_* members were accessed
 +      for mouse highlight purposes.
 +
 +      * xdisp.c (show_mouse_face, note_mode_line_or_margin_highlight)
 +      (note_mouse_highlight) [HAVE_WINDOW_SYSTEM]: Don't run GUI code
 +      unless the frame is on a window-system.
 +      (get_tool_bar_item, handle_tool_bar_click)
 +      (note_tool_bar_highlight, draw_glyphs, erase_phys_cursor)
 +      (show_mouse_face, clear_mouse_face, coords_in_mouse_face_p)
 +      (note_mode_line_or_margin_highlight, note_mouse_highlight)
 +      (x_clear_window_mouse_face, cancel_mouse_face, expose_frame):
 +      Replace Display_Info with Mouse_HLInfo everywhere where
 +      mouse_face_* members were accessed for mouse highlight purposes.
 +      (coords_in_mouse_face_p): Move prototype out of the
 +      HAVE_WINDOW_SYSTEM conditional.
 +      (x_y_to_hpos_vpos, frame_to_window_pixel_xy): Move out of the
 +      HAVE_WINDOW_SYSTEM block.
 +      (try_window_id) [HAVE_GPM || MSDOS]:
 +      Call x_clear_window_mouse_face.
 +      (draw_row_with_mouse_face): Implementation for HAVE_WINDOW_SYSTEM
 +      systems.  Call tty_draw_row_with_mouse_face for TTY systems.
 +      (show_mouse_face): Call draw_row_with_mouse_face, instead of
 +      calling draw_glyphs directly.
 +      (show_mouse_face, clear_mouse_face, coords_in_mouse_face_p)
 +      (cursor_in_mouse_face_p, rows_from_pos_range)
 +      (mouse_face_from_buffer_pos, mouse_face_from_string_pos)
 +      (note_mode_line_or_margin_highlight, note_mouse_highlight)
 +      (x_clear_window_mouse_face, cancel_mouse_face): Move out of the
 +      HAVE_WINDOW_SYSTEM block.  Ifdef away window-system specific
 +      fragments.
 +      (note_mouse_highlight): Call popup_activated for MSDOS as well.
 +      Clear mouse highlight if pointer is over glyphs whose OBJECT is an
 +      integer.
 +      (mouse_face_from_buffer_pos): Add parentheses around && within ||.
 +      (x_consider_frame_title, tool_bar_lines_needed):
 +      Move prototypes to HAVE_WINDOW_SYSTEM-only part.
 +      (get_window_cursor_type): Move inside a HAVE_WINDOW_SYSTEM-only
 +      part.  Remove "#ifdef HAVE_WINDOW_SYSTEM" from body of function.
 +      (null_glyph_slice): Move declaration into HAVE_WINDOW_SYSTEM-only
 +      part.
 +
 +      * dispnew.c (mirror_make_current): Set Y coordinate of the
 +      mode-line and header-line rows.
 +      (init_display): Setup initial frame's output_data for text
 +      terminal frames.
 +
 +      * xmenu.c (popup_activated): Don't define on MSDOS, which now has
 +      its own definition on msdos.c.
 +
 +      * msdos.c (show_mouse_face, clear_mouse_face)
 +      (fast_find_position, IT_note_mode_line_highlight)
 +      (IT_note_mouse_highlight): Functions deleted.
 +      (IT_frame_up_to_date, dos_rawgetc): Call note_mouse_highlight
 +      instead of IT_note_mouse_highlight.
 +      (draw_row_with_mouse_face, popup_activated): New functions.
 +      (dos_set_window_size, draw_row_with_mouse_face, IT_update_begin)
 +      (IT_update_end, IT_frame_up_to_date, internal_terminal_init)
 +      (dos_rawgetc): Replace Display_Info with Mouse_HLInfo everywhere
 +      where mouse_face_* members were accessed for mouse highlight
 +      purposes.
 +
 +      * msdos.h (initialize_msdos_display): Add prototype.
 +
 +      * frame.h (MOUSE_HL_INFO): New macro.
 +
 +      * lisp.h (Mouse_HLInfo): New data type.
 +
 +      * xterm.h (struct x_display_info):
 +      * w32term.h (struct w32_display_info):
 +      * nsterm.h (struct ns_display_info):
 +      * termchar.h (struct tty_display_info): Use it instead of
 +      mouse_face_* members.
 +
 +      * dispextern.h (show_mouse_face, clear_mouse_face): Update type of
 +      1st argument.
 +      (frame_to_window_pixel_xy, note_mouse_highlight)
 +      (x_clear_window_mouse_face, cancel_mouse_face, clear_mouse_face)
 +      (show_mouse_face, cursor_in_mouse_face_p): Move prototypes out of
 +      HAVE_WINDOW_SYSTEM conditional.
 +      (draw_row_with_mouse_face): Declare prototype.
 +      (tty_draw_row_with_mouse_face): Declare prototype.
 +
 +2010-11-05  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * term.c (append_glyphless_glyph, produce_glyphless_glyph):
 +      Remove unused variables.
 +
 +2010-11-05  Adrian Robert  <Adrian.B.Robert@gmail.com>
 +
 +      * nsterm.m (EmacsView-mouseExited:): Correct error in conditional
 +      logic pointed out by Eli Zaretskii.
 +
 +2010-11-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * coding.c (coding-category-list): Refer to set-coding-system-priority
 +      instead of the obsolete set-coding-priority in the doc string.
 +
 +
 +2010-11-04  Adrian Robert  <Adrian.B.Robert@gmail.com>
 +
 +      * nsfont.m (nsfont_draw):  Correct previous patch to return
 +      correct value.
 +      * nsimage.m (EmacsImage-setXBMColor:): Correct previous patch:
 +      don't change the method signature, change the return.
 +
 +2010-11-04  Ismail Donmez  <ismail@namtrac.org>  (tiny change)
 +
 +      * nsfont.m (nsfont_draw)
 +      * nsimage.m (EmacsImage-setXBMColor:)
 +      * nsterm.m (EmacsView-performDragOperation:): Correct empty return.
 +
 +2010-11-03  Julien Danjou  <julien@danjou.info>
 +
 +      * image.c (gif_load): Add support for transparency and specified
 +      :background.
 +
 +2010-11-01  Kenichi Handa  <handa@m17n.org>
 +
 +      * dispextern.h (lookup_glyphless_char_display): Extern it.
 +
 +      * termhooks.h (struct terminal): New member charset_list.
 +
 +      * coding.c (Fset_terminal_coding_system_internal): Set the
 +      `charset_list' member of struct terminal.
  
 -      * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA_LISP
 -      instead of SAFE_ALLOCA.
 +      * term.c (produce_glyphs): Handle the case it->what == IT_GLYPHLESS.
 +      (append_glyphless_glyph, produce_glyphless_glyph): New functions.
  
 -2010-08-17  Chong Yidong  <cyd@stupidchicken.com>
 +      * xdisp.c (lookup_glyphless_char_display): Make it non-static.
 +      (lookup_glyphless_char_display): Set it->what at the end.
 +      (last_glyphless_glyph_frame, last_glyphless_glyph_face_id)
 +      (last_glyphless_glyph_merged_face_id): Make them non-static.
  
 -      * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA
 -      (Bug#6214).
 +      * w32term.c (x_draw_glyphless_glyph_string_foreground):
 +      Fix the arg with_background for font->driver->draw.
  
 -2010-08-14  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-11-01  Kenichi Handa  <handa@m17n.org>
  
 -      * doc.c (Fsnarf_documentation): Set skip_file only if p[1] is S.
 +      * w32gui.h (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2):
 +      Surround chp by parentheses.
  
 -2010-08-13  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-11-01  Kenichi Handa  <handa@m17n.org>
  
 -      * doc.c (Fsnarf_documentation): Initialize skip_file before
 -      build-files test.
 +      Implement various display methods for glyphless characters.
  
 -2010-08-09  Peter O'Gorman <pogma@thewrittenword.com>  (tiny change)
 +      * xdisp.c (Qglyphless_char, Vglyphless_char_display)
 +      (Qglyphless_char_display, Qhexa_code, Qempty_box, Qthin_space)
 +      (Qzero_width): New variables.
 +      (THIN_SPACE_WIDTH): New macro.
 +      (lookup_glyphless_char_display): New funciton.
 +      (last_glyphless_glyph_frame, last_glyphless_glyph_face_id)
 +      (last_glyphless_glyph_merged_face_id): New variables.
 +      (get_next_display_element): Check glyphless characters.
 +      (redisplay_internal): Initialize last_glyphless_glyph_frame and
 +      last_glyphless_glyph_face_id.
 +      (fill_glyphless_glyph_string): New function.
 +      (BUILD_GLYPHLESS_GLYPH_STRING): New macro.
 +      (BUILD_GLYPH_STRINGS): Handle the case GLYPHLESS_GLYPH.
 +      (append_glyphless_glyph, produce_glyphless_glyph): New functions.
 +      (x_produce_glyphs): If a suitable font is not found, produce a
 +      glyphless glyph.  Handle the case it->what == IT_GLYPHLESS.
 +      (syms_of_xdisp): Intern and staticpro Qglyphless_char,
 +      Qglyphless_char_display, Qhexa_code, Qempty_box, Qthin_space, and
 +      Qzero_width.
 +      (Vglyphless_char_display): Declare it as a Lisp variable.
  
 -      * s/hpux10-20.h (HAVE_TERMIOS, NO_TERMIO, ORDINARY_LINK):
 -      New definitions.
 -      (HAVE_TERMIO): Remove.
 +      * dispextern.h (enum glyph_type): Add GLYPHLESS_GLYPH.
 +      (struct glyph): Change the size of the member "type" to 3.
 +      Add glyphless to the union slice and u.
 +      (enum display_element_type): Add IT_GLYPHLESS.
 +      (enum glyphless_display_method): New enum.
 +      (struct it): New member glyphless_method.
 +      (Vglyphless_char_display): Extern it.
 +
 +      * xterm.c (x_draw_glyphless_glyph_string_foreground): New function.
 +      (x_draw_glyph_string): Handle the case GLYPHLESS_GLYPH.
 +
 +      * w32term.c (x_draw_glyphless_glyph_string_foreground): New function.
 +      (x_draw_glyph_string): Handle the case GLYPHLESS_GLYPH.
 +
 +      * nsterm.m (ns_draw_glyph_string): Handle the case
 +      GLYPHLESS_GLYPH (the detail is not yet implemented).
 +
 +2010-10-31  Glenn Morris  <rgm@gnu.org>
 +
 +      * xterm.c (x_connection_closed) [USE_X_TOOLKIT]: Fix merge, maybe.
 +
 +      * frame.c (syms_of_frame) <tool-bar-mode>:
 +      Default to nil if !HAVE_WINDOW_SYSTEM.  (Bug#7299)
 +
 +2010-10-31  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xterm.c (x_connection_closed): Print informative error message
 +      when aborting on GTK.  This requires using shut_down_emacs
 +      directly instead of Fkill_emacs.
 +
 +2010-10-29  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * emacs.c (main): Call syms_of_filelock unconditionally.
 +
 +      * filelock.c (syms_of_filelock): Move out of #ifdef CLASH_DETECTION
 +      clause, but keep part of it conditioned on CLASH_DETECTION.
 +
 +2010-10-29  Glenn Morris  <rgm@gnu.org>
 +
 +      * nsfns.m (Fx-display-save-under, Fx-open-connection)
 +      (Fxw-color-defined-p, Fxw-display-color-p, Fx-show-tip):
 +      * w32fns.c (Fxw_color_defined_p, Fx_open_connection):
 +      * xfns.c (Fxw_color_defined_p, Fx_open_connection):
 +      Sync docs between X, W32, NS.
 +
 +      * buffer.c (syms_of_buffer) <abbrev-mode, transient-mark-mode>:
 +      * frame.c (syms_of_frame) <tool-bar-mode>: Move doc here from Lisp.
 +
 +2010-10-26  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * eval.c (init_eval_once): Set max_lisp_eval_depth to 600;
 +      otherwise, bootstrapping on Windows fails to compile macroexp.el.
 +
 +2010-10-26  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * cmds.c (internal_self_insert): Don't insert if argument N is
 +      zero or negative.  (Bug#7281)
 +
 +2010-10-26  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * gtkutil.c (qttip_cb): Set title to empty for ATK (Bug#7278).
 +
 +2010-10-25  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (SOME_MACHINE_LISP): Remove easymenu.elc.
 +
 +2010-10-24  Glenn Morris  <rgm@gnu.org>
 +
 +      * w32fns.c (Fx_synchronize, Fx_change_window_property)
 +      (Fx_window_property, Fx_file_dialog):
 +      * xfns.c (Fx_synchronize, Fx_change_window_property)
 +      (Fx_window_property, Fx_file_dialog): Sync docs between w32 and X.
 +
 +2010-10-24  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xterm.c (x_connection_closed): Kill Emacs unconditionally.
 +
 +2010-10-24  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * frame.c (Fframep, Fwindow_system): Deprecate use as a predicate.
 +
 +      * dispnew.c (syms_of_display) <initial-window-system, window-system>:
 +      Deprecate use as a boolean flag.
 +
 +2010-10-24  Jim Meyering  <jim@meyering.net>
 +
 +      * emacs.c (argmatch): Don't treat "--" as "--chdir".
 +
 +2010-10-24  Glenn Morris  <rgm@gnu.org>
 +
 +      * w16select.c (syms_of_win16select) <selection-coding-system>:
 +      <next-selection-coding-system>:
 +      * w32select.c (syms_of_w32select) <selection-coding-system>:
 +      <next-selection-coding-system>:
 +      Sync docs with select.el.
 +
 +      * xfaces.c (syms_of_xfaces) <tty-defined-color-alist>: Sync doc with
 +      Lisp version.
 +
 +      * w32term.c (syms_of_w32term) <x-use-underline-position-properties>:
 +      Sync doc with the xterm.c version.
 +
 +      * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
 +      * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
 +
 +2010-10-23  Glenn Morris  <rgm@gnu.org>
 +
 +      * buffer.c (syms_of_buffer) <cursor-in-non-selected-windows>:
 +      * frame.c (syms_of_frame) <menu-bar-mode>:
 +      * xdisp.c (syms_of_xdisp) <auto-hscroll-mode, display-hourglass>:
 +      <hourglass-delay>: Sync docs with Lisp.
 +
 +2010-10-23  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Implement mouse highlight for bidi-reordered lines.
 +
 +      * xdisp.c (fast_find_string_pos): #ifdef away, not used anymore.
 +      (mouse_face_from_string_pos): New function, replaces
 +      fast_find_string_pos.
 +      (note_mouse_highlight): Call it instead of fast_find_string_pos.
 +      (note_mode_line_or_margin_highlight): Support bidi-reordered
 +      strings and R2L glyph rows.  Fix comments.
 +      (note_mouse_highlight): When bidi reordering is turned on in a
 +      buffer, call next-single-property-change and
 +      previous-single-property-change with last argument nil.
 +      Clear mouse highlight when mouse pointer is in a R2L row on the stretch
 +      glyph that stands for no text beyond the line end.
 +      (row_containing_pos): Don't return too early when CHARPOS is in a
 +      bidi-reordered continued line.  Return immediately when the first
 +      hit is found in a line that is not continued, or when an exact
 +      match for CHARPOS is found.
 +      (rows_from_pos_range): New function.
 +      (mouse_face_from_buffer_pos): Use it instead of calling
 +      row_containing_pos for START_CHARPOS and END_CHARPOS.  Rewrite the
 +      function to support mouse highlight in bidi-reordered lines and
 +      not to assume that START_CHARPOS is always in mouse_face_beg_row.
 +      If necessary, swap mouse_face_beg_row and mouse_face_end_row so
 +      that the former is always above the latter or identical to it.
 +      (show_mouse_face): Support drawing highlighted R2L lines.
 +      (coords_in_mouse_face_p): New function, bidi-aware.
 +      (cursor_in_mouse_face_p, note_mouse_highlight, erase_phys_cursor):
 +      Call it instead of comparing with mouse-face members of dpyinfo.
 +      (note_mode_line_or_margin_highlight): Fix confusingly swapped
 +      usage of hpos and vpos.
 +
 +2010-10-22  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xrdb.c: Include keyboard.h for MOTIF.
 +
 +      * xmenu.c: Revert 2010-07-27 change: lwlib.h is needed for
 +      MOTIF (Bug#7263).
 +
 +      * xfns.c: Include Xm/TextF and Xm/List.
 +      (file_dialog_cb, file_dialog_unmap_cb, clean_up_file_dialog):
 +      Make ANSI prototypes.
 +
 +2010-10-22  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (SOME_MACHINE_LISP): Add w32-vars.
 +      Remove ccl and duplicate mouse.
 +
 +2010-10-21  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * insdel.c (prepare_to_modify_buffer): Don't set
 +      saved-region-selection if modification hooks are disabled.
 +
 +2010-10-19  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * cmds.c (Fdelete_char): Doc fix.
 +
 +2010-10-19  Ken Brown  <kbrown@cornell.edu>
 +
 +      * s/cygwin.h (SIGNALS_VIA_CHARACTERS): New define (bug#7225).
 +
 +2010-10-19  Kenichi Handa  <handa@m17n.org>
 +
 +      Fix incorrect font metrics when the same font is opened with
 +      different pixelsizes.
 +
 +      * xftfont.c: Include composite.h.
 +      (xftfont_shape): New function.
 +      (syms_of_xftfont): Set xftfont_driver.shape.
 +
 +2010-10-18  Julien Danjou  <julien@danjou.info>
 +
 +      * frame.c (Fframe_pointer_visible_p):
 +      Add `frame-pointer-visible-p' to get the pointer visibility.
 +
 +2010-10-18  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnutls.c (emacs_gnutls_read): Return 0 if we get a
 +      non-"EAGAIN"-like error to signal to Emacs that the socket should
 +      be closed.
 +
 +2010-10-15  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * unexcoff.c (make_hdr): Fix prototype according to changes in
 +      2010-10-03T13:59:56Z!dann@ics.uci.edu.
 +
 +      * image.c (tiff_load): Cast 3rd argument to avoid compiler warning.
 +
 +2010-10-15  Tassilo Horn  <tassilo@member.fsf.org>
 +
 +      * Makefile.in (really-oldXMenu): Fix typo in variable name that
 +      made building the X menu fail.
 +      (really-oldXMenu): Fix my previous fix.
 +
 +2010-10-14  Damyan Pepper  <damyanp@gmail.com>
 +
 +      Fix handling of font properties on Windows (bug#6303).
 +      * font.c (font_filter_properties): New function, refactored from
 +      ftfont_filter_properties.
 +      * font.h (font_filter_properties): Declare.
 +      * ftfont.c (ftfont_filter_properties): Use font_filter_properties.
 +      * w32font.c (w32font_booleans, w32font_non_booleans): New variables.
 +      (w32font_filter_properties): New function.
 +      (w32font_driver): Add w32font_filter_properties.
 +
 +2010-10-14  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * font.c (Ffont_variation_glyphs):
 +      * ccl.c (Fccl_execute_on_string): Fix typo in docstring.
 +
 +2010-10-14  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * w32fns.c (w32_wnd_proc, file_dialog_callback):
 +      * w32font.c (w32_generic_family):
 +      * w32inevt.c (key_event):
 +      * w32menu.c (fill_in_menu):
 +      * w32proc.c (reader_thread, w32_executable_type, compare_env)
 +      (merge_and_sort_env, int_from_hex, enum_locale_fn, enum_codepage_fn):
 +      * w32term.c (w32_read_socket): Make static.
 +
 +2010-10-13  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * image.c (DEF_IMGLIB_FN): Add argument to adapt to strict
 +      prototypes; all callers changed.
 +
 +2010-10-13  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in (TLIB2): Rename from TLIBW32.
 +      (OBJ2): New macro.
 +      (WIN32OBJ, FONTOBJ): Remove.
 +      (OBJ1): Redistribute object files with OBJ2.
 +      (LIBS, $(TEMACS)): Use TLIB2.
 +      (make-buildobj-CMD, make-buildobj-SH): Use OBJ2.
 +      ($(TLIB2), TAGS, TAGS-LISP, TAGS-gmake): Depend on OBJ2.
 +
 +2010-10-13  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * emacs.c (Vdynamic_library_alist)
 +      (syms_of_emacs) <dynamic-library-alist>: Move from image.c and rename.
 +      Doc fix.
 +
 +      * lisp.h (Vdynamic_library_alist): Declare extern.
 +
 +      * image.c (Vimage_library_alist)
 +      (syms_of_image) <image-library-alist>: Move to emacs.c and rename.
 +      (lookup_image_type): Use Vdynamic_library_alist.
 +      (Finit_image_library): Doc fix.
 +
 +2010-10-12  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * Makefile.in (lispsource, libsrc, etc, oldxmenudir, lwlibdir)
 +      (lispdir): Remove trailing /, update all uses.
 +
 +2010-10-12  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (Qleft): Declare.
 +      (ns_right_alternate_modifier): New variable
 +      (NSRightAlternateKeyMask): New define.
 +      (EV_MODIFIERS): Parse NSRightAlternateKeyMask if
 +      ns_right_alternate_modifier isn't Qleft.
 +      (keyDown): If ns_right_alternate_modifier isn't Qleft, use it
 +      as emacs modifier for NSRightAlternateKeyMask.
 +      (syms_of_nsterm): DEFVAR_LISP ns-right-alternate-modifier.
 +
 +2010-10-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnutls.c (emacs_gnutls_write): If we're trying to write before
 +      gnutls is ready, return EAGAIN as the errno.
 +
 +2010-10-10  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * vm-limit.c:
 +      * unexhp9k800.c:
 +      * unexelf.c:
 +      * unexaix.c:
 +      * termcap.c: Remove #ifdef emacs / #ifndef emacs code, unused.
 +
 +      * Makefile.in (temacs): Use $(ALL_CFLAGS) on the link line.
 +      (PROFILING_LDFLAGS): Remove, not needed anymore.
 +
 +      * Makefile.in: Use $(...) everywhere instead of ${...}
 +      (CRT_DIR): Move near potential user.
 +      (START_FILE): Move near CRT_DIR, it might use it.
 +
 +      * sysdep.c (LPASS8): Remove, unused.
 +      (emacs_ospeed): Change from being a global to a local in the only
 +      user: init_baud_rate.
 +
 +2010-10-09  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnutls.c (syms_of_gnutls): All the bootprops are keywords.
 +      (emacs_gnutls_write): Remove the debuggin fsync call.
 +      (emacs_gnutls_read): Return -1 if we got an error from
 +      gnutls_read.  This allows us to actually read lots of data from
 +      the GnuTLS stream.
 +      (emacs_gnutls_write): Check for GNUTLS_E_AGAIN and not EINTR.
 +      According to the documentation, this is correct, and it seems to
 +      make things work.
 +
 +2010-10-09  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xterm.c (x_draw_relief_rect): Clear corner pixels.
 +
 +2010-10-08  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * keyboard.c: Revert last change; it was not intended to be
 +      synchronized with the trunk.
 +
 +2010-10-08  Kenichi Handa  <handa@m17n.org>
 +
 +      * coding.c (complement_process_encoding_system): Fix previous change.
 +
 +2010-10-08  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbusbind.c (syms_of_dbusbind): Move putenv call ...
 +      (Fdbus_init_bus): ... here.  (Bug#7113)
 +
 +2010-10-08  Glenn Morris  <rgm@gnu.org>
 +
 +      * buffer.c (before-change-functions, after-change-functions):
 +      Three-year overdue doc fix following 2007-08-13 change.
 +
 +2010-10-08  Kenichi Handa  <handa@m17n.org>
 +
 +      * coding.c (coding_inherit_eol_type): If parent doesn't specify
 +      eol-format, inherit from the system's default.
 +      (complement_process_encoding_system): Make a new coding system
 +      inherit the original eol-format.
 +
 +2010-10-08  Kenichi Handa  <handa@m17n.org>
 +
 +      * coding.c (complement_process_encoding_system): New function.
 +
 +      * coding.h (complement_process_encoding_system): Extern it.
 +
 +      * callproc.c (Fcall_process): Complement the coding system for
 +      encoding arguments.
 +      (Fcall_process_region): Complement the coding system for encoding
 +      the input to the process.
 +
 +      * process.c (Fstart_process): Complement the coding system for
 +      encoding arguments.
 +      (send_process): Complement the coding system for encoding what
 +      sent to the process.
 +
 +2010-10-08  Kenichi Handa  <handa@m17n.org>
 +
 +      * xfont.c (xfont_open): Fix setting of font->average_width from
 +      :avgwidth property (Bug#7123).
 +
 +2010-10-08  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbusbind.c (syms_of_dbusbind): Use putenv instead of setenv, it
 +      is more portable.
 +
 +      * keyboard.c (gobble_input): Move call of xd_read_queued_messages ...
 +      (kbd_buffer_get_event): ... here.  This is needed for cygwin, which
 +      has not defined SIGIO.
 +
 +2010-10-08  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xterm.c (x_draw_relief_rect): If box width is larger than 1,
 +      draw the outermost line using the black relief, for legibility.
 +      Omit drawing the four corner pixels.
 +
 +2010-10-04  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * keyboard.c (echo_prompt): Function moved into read_key_sequence.
 +      (read_key_sequence): Inline echo_prompt.
 +      (echo_dash): Add a dash only if key is continued (Bug#7137).
 +
 +2010-10-04  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove O_RDONLY, O_WRONLY definitions, not needed.
 +      * unexcoff.c:
 +      * lread.c:
 +      * fileio.c:
 +      * doc.c:
 +      * callproc.c:
 +      * alloc.c:
 +      * termcap.c: Remove O_RDONLY O_WRONLY definitions.
 +
 +2010-10-03  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * gnutls.h (GNUTLS_LOG2): Convenience macro.
 +
 +      * gnutls.c: Add property list symbol holders.
 +      (emacs_gnutls_handshake): Clarify how sockets are passed to
 +      GnuTLS.
 +      (gnutls_log_function2): Convenience function using GNUTLS_LOG2.
 +      (Fgnutls_boot): Get all parameters from a plist.  Require trustfiles
 +      and keyfiles to be a list of file names.  Default to "NORMAL" for
 +      the priority string.  Improve logging.
 +
 +2010-10-03  Glenn Morris  <rgm@gnu.org>
 +
 +      * fileio.c (Vdirectory_sep_char): Remove.
 +
 +2010-10-03  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * termhooks.h: Remove #ifdef CONSP.
 +
 +      * xterm.c (NO_INLINE, noinline): Move definitions to ../configure.in.
 +
 +      Include <fcntl.h> unconditionally.
 +      * termcap.c:
 +      * sysdep.c:
 +      * lread.c:
 +      * keyboard.c:
 +      * filelock.c:
 +      * fileio.c:
 +      * doc.c:
 +      * callproc.c:
 +      * alloc.c: Remove include guards for <fcntl.h>, process.c already
 +      does it.
 +
 +      * process.c: Do not include <sys/wait.h>, syswait.h does it.
 +
 +      * sysdep.c (flush_pending_output): Remove code, does not do
 +      anything on any platform.
 +
 +      Remove unused code.
 +      * sysdep.c (select_alarm, sys_select, read_input_waiting):
 +      Remove select emulation, all systems support select.
 +      (set_exclusive_use): Remove, the only user is in an #if 0 block.
 +      * process.c (create_process): Remove #if 0 code.
 +
 +      Remove unused arguments for unexec.
 +      The third one is never used, and the last two are always passed as zero.
 +      * emacs.c (unexec): Add declaration.
 +      (Fdump_emacs): Only pass the first two arguments to unexec.
 +      Simplify #ifdef.
 +      * unexw32.c (unexec):
 +      * unexsol.c (unexec):
 +      * unexhp9k800.c (unexec):
 +      * unexcw.c (unexec): Remove the last 3 arguments, unused.
 +      * unexelf.c (unexec): Remove the last 3 arguments, unused.
 +      (find_section): Use const.
 +      * unexmacosx.c (unexec): Remove the last 3 arguments, unused.
 +      (unexec_error): Declare it NO_RETURN.
 +      * unexcoff.c (make_hdr): Assume bss_start is always zero, remove
 +      it as an argument, remove data_start and entry_address arguments, unused.
 +      (unexec): Remove bss_start, data_start and
 +      entry_address arguments.
 +      * unexaix.c (make_hdr): Assume bss_start is always zero, remove
 +      it as an argument, remove data_start and entry_address arguments, unused.
 +      (unexec): Remove bss_start, data_start and
 +      entry_address arguments.
 +
 +2010-10-03  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in (TAGS, TAGS-LISP, TAGS-gmake): Add $(FONTOBJ).
 +
 +      * gnutls.c (emacs_gnutls_handshake, gnutls_make_error)
 +      (gnutls_emacs_global_init, gnutls_emacs_global_deinit): Make static.
 +      (Fgnutls_get_initstage, Fgnutls_deinit, Fgnutls_boot, Fgnutls_bye):
 +      Fix typos in docstrings.
 +      (Fgnutls_error_fatalp, Fgnutls_error_string): Doc fixes.
 +      (Fgnutls_errorp): Doc fix; use ERR for the argument name.
 +
 +2010-10-03  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * keyboard.c (command_loop_1): Make sure the mark is really alive
 +      before using it (Bug#7044).
 +
 +2010-10-02  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in (tags): Rename target to full-tags.
 +
 +2010-10-02  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * emacs.c (main): Remove !WINDOWSNT conditional.
 +      (Fkill_emacs): Don't mention exemption on MS-Windows.
 +
 +2010-10-02  Glenn Morris  <rgm@gnu.org>
 +
 +      * character.c (Fchar_bytes): Remove obsolete function.
 +      (syms_of_character): Remove Schar_bytes.
 +
 +      * emacs.c (fatal_error_signal): Also run Fkill_emacs on SIGINT.
 +      (main) [!WINDOWSNT]: Handle SIGINT with fatal_error_signal
 +      in batch-mode.
 +      (Fkill_emacs): Doc fix.  Also run the hook in batch mode.
 +      (kill-emacs-hook): Doc fix.
 +
 +2010-10-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * xml.c (Flibxml_parse_xml_region, Flibxml_parse_html_region)
 +      (parse_region): Rework to take regions instead of strings, and
 +      renamed to reflect that these are the libxml functions.
 +
 +2010-10-01  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * term.c (init_tty) [DOS_NT]: Don't call Wcm_clear after setting
 +      screen dimensions in tty->Wcm.
 +
 +      * xdisp.c (set_cursor_from_row): When the row is truncated and
 +      point is outside the range of displayed characters, position the
 +      cursor inside the scroll margin.  (Bug#6349)
 +
 +2010-10-01  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Do not include stdlib.h and string.h, config.h does it.
 +      * xfont.c:
 +      * w32term.c:
 +      * w32reg.c:
 +      * w32inevt.c:
 +      * w32heap.c:
 +      * w32console.c:
 +      * w16select.c:
 +      * unexsol.c:
 +      * term.c:
 +      * sound.c:
 +      * scroll.c (m):
 +      * gtkutil.c:
 +      * font.c:
 +      * filelock.c:
 +      * fileio.c:
 +      * dosfns.c:
 +      * dbusbind.c:
 +      * bidi.c:
 +      * callproc.c:
 +      * process.c:
 +      * msdos.c:
 +      * charset.c: Do not include stdlib.h and string.h, config.h does it.
 +
 +      * callproc.c (SIGCHLD): Remove conditional definition, syssignal.h
 +      defines it.
 +
 +      * process.c: Move #include <pty.h> earlier.
 +      (SIGCHLD): Remove conditional definition, syssignal.h defines it.
 +      (pty_name): Move definition later.
 +
 +      * nsselect.m (syms_of_nsselect):
 +      * nsmenu.m (syms_of_nsmenu):
 +      * nsfns.m (syms_of_nsfns):
 +      * msdos.c (syms_of_msdos):
 +
 +      * image.c (syms_of_image):
 +      * charset.c (syms_of_charset): Use intern_c_string instead of intern.
 +
 +      * point.h: Remove, unused.
 +
 +2010-10-01  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * makefile.w32-in (TAGS, frc, TAGS-LISP, ../nt/TAGS, tags)
 +      (TAGS-gmake, TAGS-nmake, TAGS-LISP-gmake, TAGS-LISP-nmake)
 +      (nt-TAGS-gmake, nt-TAGS-nmake): New targets.
 +
 +2010-09-30  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * xml.c (parse_string): Use const.
 +
 +2010-09-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * eval.c (Fbacktrace): Don't overwrite print-level on exit.
 +      Also only override Vprint_level if it isn't already bound, and increase
 +      the level to 8 to produce more useful backtraces for bug reports.
 +
 +2010-09-30  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * Makefile.in: ecrt0.c does not exist anymore, do not mention it.
 +
 +2010-09-30  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * w32console.c (vga_stdcolor_name): Remove unused function;
 +      presumed dead after 2007-11-30T13:57:21Z!jasonr@gnu.org.
 +
 +2010-09-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnutls.c (emacs_gnutls_handshake): Made into internal function.
 +      (Fgnutls_boot): Start the handshake.
 +      (emacs_gnutls_read): Perform the handshake from the reader loop.
 +      (Fgnutls_boot): Remove some debugging messages.
 +      Change indentation throughout to use the Emacs style.
 +      (emacs_gnutls_handshake): Cast the fds to something that's
 +      possibly the expected length.
 +      (emacs_gnutls_write): Return -1 if we try to write before handshake.
 +
 +      * process.h (Lisp_Process): Add a gnutls_p field to Lisp_Process.
 +
 +      * process.c (make_process): Set the gnutls_p field to zero by
 +      default.
 +      (read_process_output): Always call the gnutls_read function if the
 +      stream is a gnutls stream.
 +      (send_process): Ditto for writes.
 +
 +      * gnutls.c (emacs_gnutls_write, emacs_gnutls_read): Refuse to read
 +      or write anything until the state is GNUTLS_STAGE_READY.
 +      (Fgnutls_boot): Mark the stream as being a gnutls stream.
 +
 +2010-09-29  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c (reseat_1): Initialize bidi_it.paragraph_dir to
 +      NEUTRAL_DIR.
 +      (handle_invisible_prop, iterate_out_of_display_property)
 +      (next_element_from_buffer): If bidi_it.first_elt is set, call
 +      bidi_paragraph_init with NO_DEFAULT_P argument non-zero.
 +      (Bug#7128)
 +
 +      * print.c (print_object): Fix format string and argument types for
 +      printing a Lisp_Misc_Marker.
 +
 +      * xdisp.c (pos_visible_p, c_string_pos, number_of_chars)
 +      (load_overlay_strings, get_overlay_strings_1)
 +      (get_overlay_strings, forward_to_next_line_start)
 +      (back_to_previous_visible_line_start, reseat, reseat_to_string)
 +      (get_next_display_element, next_element_from_string)
 +      (next_element_from_c_string, next_element_from_buffer)
 +      (move_it_vertically_backward, move_it_by_lines, add_to_log)
 +      (message_dolog, message_log_check_duplicate, message2_nolog)
 +      (message3, message3_nolog, vmessage, set_message, set_message_1)
 +      (hscroll_window_tree, text_outside_line_unchanged_p)
 +      (set_cursor_from_row, set_vertical_scroll_bar, redisplay_window)
 +      (find_last_unchanged_at_beg_row)
 +      (find_first_unchanged_at_end_row, row_containing_pos)
 +      (trailing_whitespace_p, display_mode_element, decode_mode_spec)
 +      (display_count_lines, x_produce_glyphs, note_mouse_highlight):
 +      Use EMACS_INT for buffer and string positions.
 +
 +      * dispextern.h (struct it) <string_nchars>: Declare EMACS_INT.
 +      (row_containing_pos): Adjust prototype.
 +
 +      * lisp.h (pos_visible_p, message2, message2_nolog, message3)
 +      (message2_nolog, set_message): Adjust prototypes.
 +
 +2010-09-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * gnutls.c (Fgnutls_boot): Remove unused vars `data' and `srp_cred'.
 +      (Fgnutls_boot): Use SDATA.
 +      (Fgnutls_handshake): Remove unused var `max_log_level'.
 +
 +2010-09-27  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbusbind.c (syms_of_dbusbind): Set $DBUS_FATAL_WARNINGS to "0".
 +      (Bug#7113)
 +
 +2010-09-27  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xgselect.c (xg_select): Clear file descriptors not set from
 +      rfds and wfds.
 +
 +      * process.c (wait_reading_process_output): Add missing FD_CLR
 +      for write_mask (must mirror connect_wait_mask).
 +
 +2010-09-27  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * gnutls.c (gnutls_log_function): Show level and "gnutls.c"
 +      prefix.
 +      (Fgnutls_boot): Use changed process members.  Use log level with a
 +      function parameter to set it.  Bring back Emacs-level debugging
 +      messages at log level 1 and 2.
 +
 +      * process.c (make_process): Initialize gnutls_log_level.
 +
 +      * process.h: Add gnutls_log_level and rename x509_cred and
 +      anon_cred to have the gnutls_ prefix for consistency.
 +
 +      * gnutls.h (GNUTLS_LOG): Add convenience macro.
 +
 +2010-09-27  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * w32.c (g_b_init_get_sid_identifier_authority)
 +      (GetSidIdentifierAuthority_Proc, get_sid_identifier_authority):
 +      Remove, not used.
 +      (globals_of_w32): Don't set g_b_init_get_sid_identifier_authority.
 +      (init_winsock): Remove useless assignment.
 +      (open_process_token, get_token_information, lookup_account_sid)
 +      (get_sid_sub_authority, get_sid_sub_authority_count, get_file_security)
 +      (get_security_descriptor_owner, get_security_descriptor_group)
 +      (is_valid_sid, equal_sid, get_length_sid, copy_sid)
 +      (get_native_system_info, get_system_times, init_user_info, crlf_to_lf)
 +      (is_unc_volume, GetCachedVolumeInformation, get_volume_info)
 +      (is_fat_volume, open_unc_volume, read_unc_volume, close_unc_volume)
 +      (unc_volume_file_attributes, convert_from_time_t)
 +      (create_toolhelp32_snapshot, process32_first, process32_next)
 +      (open_thread_token, impersonate_self, revert_to_self)
 +      (get_process_memory_info, get_process_working_set_size)
 +      (global_memory_status, global_memory_status_ex, socket_to_fd)
 +      (shutdown_handler): Make static.
 +
 +2010-09-27  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbusbind.c (dbus_fd_cb, xd_get_dispatch_status)
 +      (xd_pending_messages): Functions removed.
 +      (xd_read_queued_messages): Add parameters fd, *data, for_read in
 +      order to be compatible with add_read_fd.  Determine bus from data,
 +      and call xd_read_message just for this bus.
 +      (xd_add_watch): Use xd_read_queued_messages as callback function.
 +      Add data.
 +
 +      * lisp.h (xd_pending_messages, xd_read_queued_messages): Remove.
 +
 +2010-09-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnutls.c (gnutls_log_function): Add more debugging.
 +      (emacs_gnutls_read): Don't infloop while reading.
 +
 +2010-09-27  Kenichi Handa  <handa@m17n.org>
 +
 +      These changes are to remove restriction on the number of glyphs in
 +      one composition.
 +
 +      * dispextern.h (struct glyph): Change the member "slice" to union.
 +      Remove u.cmp.from and u.cmp.to.  Give more bits to u.cmp.id.
 +      (GLYPH_SLICE_EQUAL_P): Adjust for the above change.
 +
 +      * dispnew.c (buffer_posn_from_coords): Use glyph->slice.img
 +      instead of glyph->slice.
 +      (marginal_area_string): Likewise.
 +
 +      * term.c (encode_terminal_code): Use glyph->slice.cmp instead of
 +      glyph->u.cmp.
 +      (append_composite_glyph): Likewise.
 +
 +      * xdisp.c (dump_glyph): Use glyph->slice.cmp instead of
 +      glyph->u.cmp.
 +      (fill_gstring_glyph_string, x_get_glyph_overhangs)
 +      (append_composite_glyph): Likewise.
 +      (fill_image_glyph_string): Use glyph->slice.img instead of
 +      glyph->slice.
 +      (append_glyph, produce_image_glyph, append_stretch_glyph)
 +      (note_mouse_highlight): Likewise.
 +
 +2010-09-26  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * process.c (add_keyboard_wait_descriptor)
 +      (delete_keyboard_wait_descriptor): Reinstate ifdef subprocesses.
 +      (wait_reading_process_output): Don't pass write_mask to select
 +      if SELECT_CANT_DO_WRITE_MASK is defined.
 +      (SELECT_CANT_DO_WRITE_MASK): Define if SELECT_CANT_DO_WRITE_MASK.
 +
 +      * process.h (add_read_fd, delete_read_fd, add_write_fd)
 +      (delete_write_fd): Declare.
 +
 +      * process.c (gpm_wait_mask, max_gpm_desc): Remove.
 +      (write_mask): New variable.
 +      (max_input_desc): Rename from max_keyboard_desc.
 +      (fd_callback_info): New variable.
 +      (add_read_fd, delete_read_fd, add_write_fd, delete_write_fd):
 +      New functions.
 +      (Fmake_network_process): FD_SET write_mask.
 +      (deactivate_process): FD_CLR write_mask.
 +      (wait_reading_process_output): Connecting renamed to Writeok.
 +      check_connect removed.  check_write is new.  Remove references to gpm.
 +      Use Writeok/check_write unconditionally (i.e. no #ifdef
 +      NON_BLOCKING_CONNECT) instead of Connecting.
 +      Loop over file descriptors and call callbacks in fd_callback_info
 +      if file descriptor is ready for I/O.
 +      (add_gpm_wait_descriptor): Just call add_keyboard_wait_descriptor.
 +      (delete_gpm_wait_descriptor): Just call delete_keyboard_wait_descriptor.
 +      (keyboard_bit_set): Use max_input_desc.
 +      (add_keyboard_wait_descriptor, delete_keyboard_wait_descriptor):
 +      Remove #ifdef subprocesses.  Use max_input_desc.
 +      (init_process): Initialize write_mask and fd_callback_info.
 +
 +      * keyboard.c (readable_events, gobble_input): Remove DBUS code.
 +
 +      * dbusbind.c: Include process.h.
 +      (dbus_fd_cb, xd_find_watch_fd, xd_toggle_watch)
 +      (xd_read_message_1): New functions.
 +      (xd_add_watch, xd_remove_watch): Call xd_find_watch_fd.
 +      Handle watch for both read and write.
 +      (Fdbus_init_bus): Also register xd_toggle_watch.
 +      (Fdbus_call_method_asynchronously, Fdbus_method_return_internal)
 +      (Fdbus_method_error_internal, Fdbus_send_signal): Remove call
 +      to dbus_connection_flush.
 +      (xd_read_message): Move most of the code to xd_read_message_1.
 +      Call xd_read_message_1 until status is COMPLETE.
 +
 +2010-09-26  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * term.c: Do not include sys/ioctl.h, not needed.
 +      (init_tty): Reorder code to reduce the number of #ifdefs.
 +      No code changes.
 +
 +2010-09-26  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * process.h: Set up GnuTLS support.
 +
 +      * process.c (make_process, Fstart_process)
 +      (read_process_output, send_process): Set up GnuTLS support for
 +      process input/output file descriptors.
 +
 +      * gnutls.h: The GnuTLS glue for Emacs, macros and enums.
 +
 +      * gnutls.c: The source code for GnuTLS support in Emacs.
 +
 +      * emacs.c: Set up GnuTLS support and call syms_of_gnutls.
 +
 +      * config.in: Set up GnuTLS support.
 +
 +      * Makefile.in (LIBGNUTLS_LIBS, LIBGNUTLS_CFLAGS, ALL_CFLAGS)
 +      (obj, LIBES): Set up GnuTLS support.
 +
 +2010-09-26  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * w32.c (get_emacs_configuration_options): Fix previous change.
 +
 +2010-09-25  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * insdel.c (prepare_to_modify_buffer): Ensure the mark marker is
 +      alive before using it (Bug#6977).
 +
 +2010-09-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * xdisp.c (face_before_or_after_it_pos): EMACS_INT/int fixup.
 +
 +      * dispextern.h: EMACS_INT/int fixup.
 +
 +      * xdisp.c (string_pos_nchars_ahead, init_iterator): EMACS_INT/int
 +      fixup.
 +
 +      * xrdb.c (magic_file_p): EMACS_INT/int fixup.
 +
 +2010-09-25  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * window.c (Fpos_visible_in_window_p, Fdelete_other_windows)
 +      (Fselect_window, window_scroll_pixel_based)
 +      (window_scroll_line_based, Frecenter, Fset_window_configuration):
 +      Use EMACS_INT for buffer positions.
 +
 +      * textprop.c (validate_interval_range, interval_of)
 +      (property_change_between_p, Fadd_text_properties)
 +      (set_text_properties_1, Fremove_text_properties)
 +      (Fremove_list_of_text_properties, Ftext_property_any)
 +      (Ftext_property_not_all, copy_text_properties)
 +      (text_property_list, extend_property_ranges)
 +      (verify_interval_modification): Use EMACS_INT for buffer
 +      positions.
 +
 +      * term.c (fast_find_position, term_mouse_highlight): Use EMACS_INT
 +      for buffer positions.
 +
 +      * process.c (read_process_output, send_process)
 +      (Fprocess_send_region, status_notify): Use EMACS_INT for buffer
 +      and string positions and size.
 +
 +      * print.c (print_object, print_string, strout): Use EMACS_INT for
 +      string indices.
 +
 +      * minibuf.c (string_to_object): Use EMACS_INT for string position
 +      and size.
 +
 +      * marker.c (verify_bytepos): Use EMACS_INT for buffer positions.
 +
 +      * lread.c <read_from_string_index, read_from_string_index_byte>
 +      <read_from_string_limit, readchar_count>: Define EMACS_INT.
 +      (readchar, unreadchar, read_internal_start): Use EMACS_INT for
 +      buffer positions and string length.
 +
 +      * keyboard.c <last_point_position, last_non_minibuf_size>: Declare
 +      EMACS_INT.
 +      (echo_truncate, adjust_point_for_property, read_char)
 +      (gen_help_event, make_lispy_event, modify_event_symbol)
 +      (Fexecute_extended_command, stuff_buffered_input): Use EMACS_INT
 +      for buffer positions and string length.
 +
 +      * keyboard.h (gen_help_event): Adjust prototype.
 +
 +      * termhooks.h <struct input_event>: Make `code' member EMACS_INT.
 +
 +      * commands.h <last_point_position>: Declare EMACS_INT.
 +
 +      * xdisp.c <help_echo_pos>: Define as EMACS_INT.
 +      (truncate_echo_area): Accept EMACS_INT argument.
 +
 +      * dispextern.h <help_echo_pos>: Declare EMACS_INT.
 +
 +      * lisp.h (truncate_echo_area): Adjust prototype.
 +
 +      * composite.c (composition_adjust_point): Return EMACS_INT.
 +
 +      * composite.h (composition_adjust_point): Adjust prototype.
 +
 +2010-09-25  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * process.c (Fmake_network_process): When arg :host is 'local,
 +      use address 127.0.0.1, not name "localhost".  (Bug#6781)
 +
 +2010-09-24  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * indent.c (Fcurrent_indentation, indented_beyond_p)
 +      (compute_motion): Use EMACS_INT for buffer position variables.
 +
 +      * lisp.h (indented_beyond_p): Adjust prototype.
 +
 +      * buffer.c (overlay_strings): Return EMACS_INT.
 +
 +      * buffer.h (overlay_strings): Adjust prototype.
 +
 +      * region-cache.c (pp_cache): Adjust format to arguments.
 +
 +      * eval.c <specpdl_size, lisp_eval_depth>: Declare EMACS_INT.
 +      (call_debugger): Use EMACS_INT for specpdl_size related variables.
 +      (verror): Use EMACS_INT for size of allocated buffer.
 +
 +      * keyboard.c (make_lispy_position): Use EMACS_INT for buffer
 +      positions.
 +
 +      * xdisp.c (redisplay_internal, try_window_id)
 +      (set_cursor_from_row, find_first_unchanged_at_end_row):
 +      Use EMACS_INT for buffer positions.
 +
 +      * dispextern.h (set_cursor_from_row): Adjust prototype.
 +
 +      * dispnew.c (increment_matrix_positions)
 +      (increment_row_positions, copy_glyph_row_contents)
 +      (mode_line_string, marginal_area_string): Use EMACS_INT for buffer
 +      positions.
 +
 +      * dispextern.h (mode_line_string, marginal_area_string)
 +      (increment_matrix_positions, increment_row_positions):
 +      Adjust prototypes.
 +
 +      * data.c (Faref, Faset): Use EMACS_INT for string length and
 +      positions.
 +
 +      * cmds.c (internal_self_insert): Use EMACS_INT for the count of
 +      characters to insert.
 +
 +      * ccl.c (Fccl_execute_on_string): Use EMACS_INT for string
 +      position and size.
 +
 +      * syntax.c (scan_words, update_syntax_table)
 +      (prev_char_comend_first, back_comment, skip_chars)
 +      (skip_syntaxes, Fforward_comment, Fbackward_prefix_chars):
 +      Use EMACS_INT for buffer and string positions.
 +
 +      * syntax.h (scan_words, update_syntax_table): Adjust prototypes.
 +
 +      * casefiddle.c (operate_on_word): Use EMACS_INT for buffer
 +      positions.
 +
 +2010-09-24  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * scroll.c (calculate_scrolling, line_ins_del)
 +      (calculate_direct_scrolling, scroll_cost): Fix EMACS_INT/int
 +      conversion.
 +
 +      * region-cache.c (move_cache_gap, set_cache_region, pp_cache)
 +      (region_cache_backward, region_cache_forward)
 +      (revalidate_region_cache, set_cache_region): FIX EMACS_INT/int
 +      conversion.
 +
 +      * xdisp.c (message_dolog): Fix EMACS_INT/int conversion.
 +
 +      * eval.c (verror): Fix EMACS_INT/int conversion.
 +
 +      * print.c (PRINTDECLARE, PRINTPREPARE, strout, print_string)
 +      (print_preprocess, print_check_string_charset_prop)
 +      (print_object): Fix EMACS_INT/int conversion.
 +
 +      * xdisp.c (message_dolog): Fix EMACS_INT/int conversion.
 +
 +2010-09-24  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * callproc.c (Fcall_process): Use EMACS_INT for count of
 +      characters read from the subprocess.
 +
 +      * bidi.c (struct bidi_paragraph_info): Use EMACS_INT for buffer
 +      positions.
 +      (bidi_cache_search, bidi_cache_find): Use EMACS_INT for buffer
 +      positions.
 +
 +      * buffer.c (struct sortvec): Use EMACS_INT for buffer positions.
 +      (struct sortstrlist, overlay_str_len): Use EMACS_INT for string
 +      length.
 +      (advance_to_char_boundary, Fset_buffer_multibyte)
 +      (overlays_at, overlays_in, mouse_face_overlay_overlaps)
 +      (overlay_touches_p, record_overlay_string, overlay_strings)
 +      (recenter_overlay_lists, fix_start_end_in_overlays)
 +      (modify_overlay, Fmove_overlay, report_overlay_modification)
 +      (evaporate_overlays): Use EMACS_INT for buffer positions.
 +
 +      * lisp.h (fix_start_end_in_overlays, overlay_touches_p):
 +      Adjust prototypes.
 +
 +      * dispextern.h (struct bidi_saved_info): Use EMACS_INT for buffer
 +      positions.
 +
 +      * fns.c (Fcompare_strings, Fstring_lessp, concat)
 +      (string_make_unibyte, Fstring_as_unibyte, Fsubstring)
 +      (Fsubstring_no_properties, substring_both, Ffillarray)
 +      (Fclear_string, mapcar1, Fmapconcat, Fmapcar, Fmapc)
 +      (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
 +      (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
 +      (Fmd5): Use EMACS_INT for buffer and string positions and length
 +      variables and arguments.
 +
 +      * lisp.h (substring_both): Adjust prototype.
 +
 +2010-09-24  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      Remove W32 API function pointer unused since 2005-02-15 (revno 2005-02-15T23:19:26Z!jasonr@gnu.org).
 +      * w32fns.c (clipboard_sequence_fn): Don't declare.
 +      (globals_of_w32fns): Don't initialize it.
 +
 +2010-09-23  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * syntax.c (back_comment): Detect the case where a 1-char comment
 +      starter is also the 2nd char of a 2-char comment ender.
 +
 +2010-09-23  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * gtkutil.c (xg_tool_bar_menu_proxy): Set gtk-menu-items to TRUE.
 +
 +2010-09-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * eval.c (verror): EMACS_INT/int cleanup.
 +
 +      * lisp.h (SPECPDL_INDEX): Cast to int, since we're not going to
 +      unwind_protect more than 2GB worth of functions.
 +
 +      * editfns.c (Finsert_char): EMACS_INT/int cleanup.
 +
 +      * lisp.h: Have oblookup take EMACS_INT to allow interning big
 +      string and avoid compiler warnings.
 +      (USE_SAFE_ALLOCA): Cast to int to avoid compilation warnings in
 +      all users.
 +
 +      * lread.c (oblookup): EMACS_INT/int cleanup.
 +
 +      * cmds.c (Fforward_line, Fdelete_char): EMACS_INT/int cleanup.
 +
 +2010-09-23  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * editfns.c (clip_to_bounds): Return an EMACS_INT value.
 +
 +      * lisp.h (clip_to_bounds): Adjust prototype.
 +
 +      * intervals.c (adjust_for_invis_intang): Return EMACS_INT value.
 +
 +2010-09-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * lisp.h: doprnt.c EMACS_INT/int cleanup.
 +
 +      * doprnt.c (doprnt): EMACS_INT/int cleanup.
 +
 +      * doc.c (Fsnarf_documentation, get_doc_string): EMACS_INT/int
 +      cleanup.
 +
 +      * lisp.h: Change the definition of all marker.c functions that
 +      take and return buffer stuff to be EMACS_INT instead of int.
 +
 +      * marker.c (buf_charpos_to_bytepos, CONSIDER, set_marker_both)
 +      (buf_charpos_to_bytepos, bytepos_to_charpos)
 +      (buf_bytepos_to_charpos, Fbuffer_has_markers_at)
 +      (set_marker_restricted, set_marker_both): Convert int to EMACS_INT
 +      for all buffer positions.
 +
 +2010-09-23  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * intervals.c (traverse_intervals, rotate_right, rotate_left)
 +      (split_interval_right, find_interval, next_interval)
 +      (delete_node, delete_interval, interval_deletion_adjustment)
 +      (adjust_intervals_for_deletion, merge_interval_right)
 +      (merge_interval_left, graft_intervals_into_buffer)
 +      (copy_intervals): Convert EMACS_UINTs to EMACS_INT.
 +
 +      * intervals.h (traverse_intervals): Update prototype.
 +
 +2010-09-23  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * indent.c (compute_motion): Use EMACS_INT for arguments to
 +      region_cache_forward.
 +
 +      * region-cache.c (struct boundary, struct region_cache):
 +      Use EMACS_INT for positions.
 +      (find_cache_boundary, move_cache_gap, insert_cache_boundary)
 +      (delete_cache_boundaries, set_cache_region)
 +      (invalidate_region_cache, know_region_cache)
 +      (region_cache_forward, region_cache_backward, pp_cache):
 +      Use EMACS_INT for buffer positions.
 +
 +      * region-cache.h (know_region_cache, invalidate_region_cache)
 +      (region_cache_forward, region_cache_backward): Adjust prototypes.
 +
 +      * search.c (string_match_1, fast_c_string_match_ignore_case)
 +      (looking_at_1, scan_buffer, scan_newline)
 +      (find_next_newline_no_quit, find_before_next_newline)
 +      (search_command, trivial_regexp_p, search_buffer, simple_search)
 +      (boyer_moore, wordify, Freplace_match): Use EMACS_INT for buffer
 +      and string positions and length.
 +
 +      * lisp.h (scan_buffer, scan_newline, find_next_newline_no_quit)
 +      (find_before_next_newline): Adjust prototypes.
 +
 +      * editfns.c (transpose_markers, update_buffer_properties)
 +      (buildmark, clip_to_bounds, Fgoto_char, overlays_around)
 +      (get_pos_property, Fconstrain_to_field)
 +      (Fline_beginning_position, Fline_end_position, Fprevious_char)
 +      (Fchar_after, Fchar_before, Finsert_char)
 +      (Finsert_buffer_substring, Fcompare_buffer_substrings)
 +      (Fsubst_char_in_region, Fformat, Ftranspose_regions):
 +      Use EMACS_INT for buffer and string position variables.
 +      (Finsert_char): Protect against too large insertions.
 +
 +      * lisp.h (clip_to_bounds): Adjust prototype.
 +
 +      * intervals.c (traverse_intervals, rotate_right, rotate_left)
 +      (balance_an_interval, split_interval_right, split_interval_left)
 +      (find_interval, next_interval, update_interval)
 +      (adjust_intervals_for_insertion, delete_node, delete_interval)
 +      (interval_deletion_adjustment, adjust_intervals_for_deletion)
 +      (offset_intervals, merge_interval_right, merge_interval_left)
 +      (graft_intervals_into_buffer, adjust_for_invis_intang)
 +      (move_if_not_intangible, get_local_map, copy_intervals)
 +      (copy_intervals_to_string, compare_string_intervals)
 +      (set_intervals_multibyte_1): Use EMACS_INT for buffer positions
 +      and for interval tree size.
 +
 +      * intervals.h (traverse_intervals, split_interval_right)
 +      (split_interval_left, find_interval, offset_intervals)
 +      (graft_intervals_into_buffer, copy_intervals)
 +      (copy_intervals_to_string, move_if_not_intangible, get_local_map)
 +      (update_interval): Adjust prototypes.
 +
 +      * xdisp.c (check_point_in_composition, reconsider_clip_changes):
 +      Use EMACS_INT for buffer position variables and arguments.
 +
 +      * composite.c (get_composition_id, find_composition)
 +      (run_composition_function, compose_text)
 +      (composition_gstring_width, autocmp_chars)
 +      (composition_update_it, Ffind_composition_internal): Use EMACS_INT
 +      for buffer positions and string length variables and arguments.
 +
 +      * composite.h (get_composition_id, find_composition, compose_text)
 +      (composition_gstring_width): Adjust prototypes.
 +
 +      * editfns.c (Fformat): Use EMACS_INT for string size variables.
 +
 +      * xdisp.c (store_mode_line_noprop, display_mode_element):
 +      Use EMACS_INT for string positions.
 +
 +      * intervals.c (get_property_and_range): Use EMACS_INT for buffer
 +      position arguments.
 +
 +      * intervals.h (get_property_and_range): Adjust prototype.
 +
 +      * character.c (parse_str_as_multibyte, str_as_multibyte)
 +      (parse_str_to_multibyte, str_to_multibyte, str_as_unibyte)
 +      (string_count_byte8, string_escape_byte8, c_string_width)
 +      (strwidth, lisp_string_width, multibyte_chars_in_text):
 +      Use EMACS_INT for string length variables and arguments.
 +
 +      * character.h (parse_str_as_multibyte, str_as_multibyte)
 +      (parse_str_to_multibyte, str_to_multibyte, str_as_unibyte)
 +      (c_string_width, strwidth, lisp_string_width):
 +      Adjust prototypes.
 +
 +      * font.c (font_intern_prop): Use EMACS_INT for string length
 +      variables.
 +
 +      * font.c (font_intern_prop): Use EMACS_INT for string length
 +      variables.
 +
 +      * fns.c (Fstring_as_multibyte): Use EMACS_INT for string length
 +      variables.
 +
 +      * alloc.c <total_string_size>: Declare as EMACS_INT, not int.
 +      (Fmake_string): Protect against too large strings.
 +      (live_string_p, live_cons_p, live_symbol_p, live_float_p)
 +      (live_misc_p): Use ptrdiff_t instead of int for pointer
 +      differences.
 +      (string_bytes, check_sblock, check_string_free_list)
 +      (allocate_string_data, compact_small_strings, Fmake_string)
 +      (Fmake_bool_vector, make_string, make_unibyte_string)
 +      (make_multibyte_string, make_string_from_bytes)
 +      (make_specified_string_string, Fmake_list, Fmake_vector):
 +      Use EMACS_INT for string length variables and arguments.
 +      (find_string_data_in_pure, make_pure_string, make_pure_c_string)
 +      (Fpurecopy): Use EMACS_INT for string size.
 +      (mark_vectorlike, mark_char_table, mark_object): Use EMACS_UINT
 +      for vector size.
 +
 +      * lisp.h (make_string, make_unibyte_string, make_multibyte_string)
 +      (make_string_from_bytes, make_specified_string_string)
 +      (make_pure_string, string_bytes, check_point_in_composition):
 +      Adjust prototypes.
 +
 +2010-09-22  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * editfns.c (Fsubst_char_in_region, Ftranslate_region_internal)
 +      (check_translation): Use EMACS_INT for buffer positions and
 +      length.
 +
 +      * undo.c (record_marker_adjustment, record_delete)
 +      (record_change, record_point, record_insert)
 +      (record_property_change, Fprimitive_undo): Use EMACS_INT for
 +      buffer positions.
 +
 +      * lisp.h (record_marker_adjustment, record_delete)
 +      (record_change, record_point, record_insert)
 +      (record_property_change, Fprimitive_undo): Adjust prototypes.
 +
 +2010-09-22  Juanma Barranquero  <lekktu@gmail.com>
 +            Eli Zaretskii  <eliz@gnu.org>
 +
 +      * w32.c (get_emacs_configuration_options): Fix buffer overrun.
 +
 +2010-09-22  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * minibuf.c (Fminibuffer_contents)
 +      (Fminibuffer_contents_no_properties)
 +      (Fminibuffer_completion_contents): Use EMACS_INT for minibuffer
 +      positions.
 +
 +      * keyboard.c (command_loop_1): Use EMACS_INT to compare point with
 +      mark.
 +
 +      * alloc.c (make_uninit_string, make_uninit_multibyte_string)
 +      (allocate_string_data): Accept EMACS_INT for string length.
 +
 +      * editfns.c (Ffield_string, Ffield_string_no_properties)
 +      (make_buffer_string, make_buffer_string_both, Fbuffer_substring)
 +      (Fbuffer_substring_no_properties, find_field, Fdelete_field)
 +      (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
 +      (Ffield_end): Use EMACS_INT for buffer positions.
 +
 +      * insdel.c (prepare_to_modify_buffer): Use EMACS_INT to compare
 +      point with mark.
 +
 +      * lisp.h (allocate_string_data, make_uninit_string)
 +      (make_uninit_multibyte_string, make_buffer_string)
 +      (make_buffer_string_both): Adjust prototypes.
 +
 +2010-09-22  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xml.c: Switch to GNU indentation.
 +      (make_dom): Change parse tree format to match xml.el.
 +      (Fxml_parse_html_string_internal): Rename from html-parse-string.
 +      (Fxml_parse_string_internal): Rename from xml-parse-string.
 +
 +2010-09-22  Kenichi Handa  <handa@m17n.org>
 +
 +      * xdisp.c (compute_stop_pos): Call composition_compute_stop_pos
 +      only if we are not at a composition.
 +      (set_iterator_to_next): Give it->end_charpos to
 +      composition_compute_stop_pos.
 +      (set_iterator_to_next, next_element_from_buffer): Likewise.
 +
 +      * dispnew.c (buffer_posn_from_coords): Fix position when the
 +      current display element is a grapheme cluster in bidi-reordered
 +      region.
 +
 +2010-09-21  Ari Roponen  <ari.roponen@gmail.com>  (tiny change)
 +
 +      * doc.c (Fsnarf_documentation): Use memmove instead of memcpy as
 +      the regions may overlap.
 +
 +2010-09-21  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
 +
 +2010-09-21  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * emacs.c: Do not include sys/ioctl.h, not needed.
 +
 +      * doprnt.c: Do not include stdlib.h, config.h does it.
 +      Move #include before macro definition.
 +
 +2010-09-20  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * Makefile.in (temacs): Link using $(CC) not $(LD).
 +      (LD_FIRSTFLAG): Define using autoconf.
 +      (LD): Remove.
 +
 +      Remove HAVE_TERMIOS definitions.
 +      * s/usg5-4-common.h (HAVE_TERMIOS):
 +      * s/template.h (HAVE_TERMIOS):
 +      * s/gnu-linux.h (HAVE_TERMIOS):
 +      * s/darwin.h (HAVE_TERMIOS):
 +      * s/cygwin.h (HAVE_TERMIOS):
 +      * s/bsd-common.h (HAVE_TERMIOS):
 +      * s/aix4-2.h (HAVE_TERMIOS):
 +      * s/hpux10-20.h (HAVE_TERMIOS): Do not define, it is assumed
 +      defined on all non-MS platforms.
 +      (HAVE_PSTAT_GETDYNAMIC): Do not define, autoconf does it.
 +
 +      * xterm.c (xt_action_hook): Use const.
 +
 +2010-09-20  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      Don't make W32 code conditional on HAVE_SOCKETS, it's always defined.
 +      * w32.c: Remove top-level uses of #ifdef HAVE_SOCKETS.
 +      (gethostname) [!HAVE_SOCKETS]: Remove.
 +      (SOCK_REPLACE_HANDLE): Remove macro.
 +      (socket_to_fd, sys_close, _sys_read_ahead, sys_read, sys_write)
 +      (term_ntproc, init_ntproc): Don't conditionalize on HAVE_SOCKETS.
 +      * w32proc.c: Remove top-level uses of #ifdef HAVE_SOCKETS.
 +      (syms_of_ntproc): Don't conditionalize on HAVE_SOCKETS.
 +
 +2010-09-18  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * deps.mk (xml.o): Add dependencies.
 +
 +      * xdisp.c (Fcurrent_bidi_paragraph_direction):
 +      Call bidi_paragraph_init with NO_DEFAULT_P non-zero.  (Bug#7038)
 +
 +      * bidi.c (bidi_paragraph_init): Accept an additional argument
 +      NO_DEFAULT_P; all callers changed.  If NO_DEFAULT_P is non-zero,
 +      search back until a paragraph with a strong directional character
 +      is found, and use that to determine paragraph's base direction.
 +
 +      * dispextern.h (bidi_paragraph_init): Update prototype.
 +
 +2010-09-17  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * w32.c (_PROCESS_MEMORY_COUNTERS_EX): Don't define with versions
 +      of w32api >= 3.15.  (Bug#6989)
 +
 +2010-09-17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * process.c (wait_reading_process_output): Don't message about
 +      accept-process-output unless the time limit really is zero.
 +
 +2010-09-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * frame.c (Ftool_bar_pixel_width): YAILOM (Yet another
 +      int/Lisp_Object mixup).
 +
 +2010-09-17  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * keyboard.c (parse_tool_bar_item): For QClabel, set TOOL_BAR_ITEM_LABEL
 +      not HELP.
 +
 +2010-09-17  Stephen Berman  <stephen.berman@gmx.net>
 +
 +      * frame.c (Ftool_bar_pixel_width): New function to expose tool
 +      bar's pixel width to Lisp (Bug#7048).
 +
 +2010-09-14  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * cmds.c (syms_of_cmds) <post-self-insert-hook>: Fix typos in docstring.
 +
 +2010-09-17  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * gtkutil.c (xg_pack_tool_bar): Call gtk_handle_box_set_handle_position
 +      with argument top/left if tool bar is vertical/horizontal (Bug#7051).
 +
 +2010-09-17  Kenichi Handa  <handa@m17n.org>
 +
 +      * ftfont.c (ftfont_check_otf): Fix previous change.
 +
 +2010-09-14  Kenichi Handa  <handa@m17n.org>
 +
 +      * ftfont.c (ftfont_check_otf): Fix the case of checking just
 +      existence of GSUB or GPOS.
 +
 +2010-09-14  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * cmds.c (syms_of_cmds) <post-self-insert-hook>: Fix typos in docstring.
 +
 +2010-09-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * xml.c (parse_buffer): Rename to parse_string(), since that's
 +      what it does.
 +      (parse_string): Return nil when the document can't be parsed.
 +
 +2010-09-14  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.c (get_current_vm_state): New function.
 +      (do_ewmh_fullscreen): Call get_current_vm_state and compare with
 +      want_fullscreen so set_wm_state calls are few (Bug#7013).
 +      (x_handle_net_wm_state): Move code to get_current_vm_state and
 +      call that function.
 +
 +2010-09-14  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
 +
 +      * term.c (tty_set_terminal_modes): Don't initialize twice (bug#7002).
 +
 +2010-09-14  Kenichi Handa  <handa@m17n.org>
 +
 +      * coding.c (encode_coding_iso_2022): Don't optimize for ASCII if
 +      we may use designation or locking-shift.
 +
 +2010-09-14  Kenichi Handa  <handa@m17n.org>
 +
 +      * coding.c (detect_coding_emacs_mule): Fix checking of multibyte
 +      sequence when the source is multibyte.
 +
 +2010-09-14  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * xml.c (Fxml_parse_string, Fxml_parse_string): Revert last change.
 +      Don't make first argument optional.  Doc fix.
 +
 +2010-09-14  Leo  <sdl.web@gmail.com>  (tiny change)
 +
 +      * xml.c (Fxml_parse_string, Fhtml_parse_string): Fix up the
 +      parameters for the doc string.
 +
 +2010-09-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * xml.c (Fhtml_parse_string, Fxml_parse_string): Mention BASE-URL.
 +
 +2010-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * fns.c (Fy_or_n_p): Move to lisp/subr.el.
 +      (syms_of_fns): Don't defsubr Sy_or_n_p.
 +      * lisp.h: Don't declare Fy_or_n_p.
 +      * fileio.c (barf_or_query_if_file_exists): Fy_or_n_p -> y-or-n-p.
 +
 +2010-09-09  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * xml.c (Fxml_parse_buffer): New function to parse XML files.
 +
 +2010-09-08  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * xml.c: New file.
 +      (Fhtml_parse_buffer): New function to interface to the libxml2
 +      html parsing function.
 +
 +2010-09-05  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * biditype.h: Regenerate.
 +
 +2010-09-04  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * nsimage.m (ns_load_image): Check argument types.
 +
 +      * image.c: Remove all uses of gcpro.
 +      (xpm_load): Check all lisp types.
 +      (pbm_load): Likewise.
 +      (png_load): Likewise.
 +      (jpeg_load): Likewise.
 +      (tiff_load): Likewise.
 +      (gif_load): Likewise.
 +      (imagemagick_load_image): Likewise.
 +      (imagemagick_load): Likewise.
 +      (svg_load): Likewise.
 +      (gs_load): Likewise.
 +
 +2010-09-04  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * w32uniscribe.c (uniscribe_shape): Update commentary.
 +      Don't try to reorder grapheme clusters, since LGSTRING should always
 +      hold them in the logical order.
 +      (uniscribe_encode_char, uniscribe_shape): Force ScriptShape to
 +      return glyph codes in the logical order.
 +
 +2010-09-04  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * image.c (imagemagick_image_p): Replace bcopy by memcpy.
 +      (imagemagick_load_image): Fix type mismatch.
 +      (Fimagemagick_types): Likewise.  Doc fix.
 +
 +2010-09-02  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.h (struct dpyinfo): Remove cut_buffers_initialized.
 +
 +      * xterm.c (x_term_init): Don't set dpyinfo->cut_buffers_initialized.
 +
 +      * xselect.c: Remove declaration of cut-buffer objects and functions.
 +      (symbol_to_x_atom): Remove mapping to XA_CUT_BUFFERn.
 +      (x_atom_to_symbol): Remove mapping to QCUT_BUFFERn.
 +      (Fx_get_cut_buffer_internal, Fx_store_cut_buffer_internal)
 +      (Fx_rotate_cut_buffers_internal): Remove.
 +      (syms_of_xselect): Remove defsubr of above.
 +      Remove intern of QCUT_BUFFERn.
 +
 +2010-09-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * cmds.c (Vblink_paren_function): Remove.
 +      (internal_self_insert): Make it insert N chars at a time.
 +      Don't call blink-paren-function.
 +      (Fself_insert_command): Adjust accordingly.
 +      (syms_of_cmds): Don't declare blink-paren-function.
 +
 +2010-08-31  Kenichi Handa  <handa@m17n.org>
 +
 +      * dispextern.h (FACE_FOR_CHAR): Use an ASCII face for 8-bit
 +      characters.
 +
 +      * term.c (encode_terminal_code): Fix the previous change.
 +      (produce_glyphs): Don't set it->char_to_display here.
 +      Don't handle unibyte-display-via-language-environment here.
 +      (produce_special_glyphs): Set temp_it.char_to_display before
 +      calling produce_glyphs.
 +
 +      * xdisp.c (get_next_display_element): Set it->char_to_display
 +      here.  Convert all 8-bit bytes from unibyte buffer/string to 8-bit
 +      characters.
 +      (get_overlay_arrow_glyph_row): Set it.char_to_display too before
 +      calling PRODUCE_GLYPHS.
 +      (append_space_for_newline): Save and store it->char_to_display.
 +      Set it->char_to_display before calling PRODUCE_GLYPHS.
 +      (extend_face_to_end_of_line): Set it->char_to_display before
 +      calling PRODUCE_GLYPHS.
 +      (get_glyph_face_and_encoding): Set the glyph code an 8-bit
 +      character to its byte value.
 +      (get_char_glyph_code): New function.
 +      (produce_stretch_glyph): Set it2.char_to_display too before
 +      calling x_produce_glyphs.
 +      (x_produce_glyphs): Simplify by using the same code for ASCII and
 +      non-ASCII characters.  Don't set it->char_to_display here.
 +      Don't handle unibyte-display-via-language-environment here.  For a
 +      character of no glyph, use font->space_width instead of FONT_WIDTH.
 +
 +2010-08-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * keyboard.c (Fwindow_system): Fix compilation for USE_LISP_UNION_TYPE.
 +
 +2010-08-31  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * keyboard.c (command_loop_1): Don't call x-set-selection on tty.
 +
 +2010-08-30  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * marker.c (Fcopy_marker): Make the first arg optional.
 +
 +2010-08-30  Kenichi Handa  <handa@m17n.org>
 +
 +      * composite.c (composition_update_it): Fix computing of
 +      cmp_it->width.
 +
 +2010-08-29  Kenichi Handa  <handa@m17n.org>
 +
 +      * term.c (encode_terminal_code): Encode byte chars to the
 +      corresponding bytes.
 +
 +2010-08-29  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (ns_draw_window_cursor): Draw BAR_CURSOR correct for R2L.
 +
 +2010-08-26  Kenichi Handa  <handa@m17n.org>
 +
 +      * xdisp.c (compute_stop_pos): Pay attention to bidi scan direction
 +      on calling composition_compute_stop_pos.
 +
 +2010-08-25  Kenichi Handa  <handa@m17n.org>
 +
 +      * fontset.c (reorder_font_vector): Prefer a font-spec specifying
 +      :otf.
 +
 +      * composite.c (composition_compute_stop_pos): Don't break
 +      composition at PT.
 +      (composition_reseat_it): Likewise.  Fix calculation of character
 +      position starting a composition.
 +      (Fcomposition_get_gstring): Don't limit the number of components
 +      for automatic composition.
 +
 +2010-08-25  Kenichi Handa  <handa@m17n.org>
 +
 +      * composite.c (composition_compute_stop_pos): In forward search,
 +      pay attention to the possibility that some character after ENDPOS
 +      will be composed with charactrs before ENDPOS.
 +
 +2010-08-24  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * keyboard.c (command_loop_1): Don't clobber primary selection
 +      during handle-switch-frame (Bug#6872).
 +
 +2010-08-23  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbusbind.c: Accept UNIX domain sockets as bus address.
 +      (Fdbus_close_bus): New function.
 +      (Vdbus_registered_buses): New variable.
 +      (xd_initialize): Implement string as bus address.
 +      (Fdbus_init_bus): Add bus to Vdbus_registered_buses).
 +      (Fdbus_get_unique_name, Fdbus_call_method)
 +      (Fdbus_call_method_asynchronously, Fdbus_method_return_internal)
 +      (Fdbus_method_error_internal, Fdbus_send_signal)
 +      (Fdbus_register_signal, Fdbus_register_method): Remove bus type
 +      check.  This is done in xd_initialize_bus.  Adapt doc string, if
 +      necessary.
 +      (xd_pending_messages, xd_read_queued_messages): Loop over buses in
 +      Vdbus_registered_buses.
 +      (Vdbus_registered_objects_table): Create hash.
 +
 +2010-08-22  Juri Linkov  <juri@jurta.org>
 +
 +      * keyboard.c (Fexecute_extended_command): Move reading a command name
 +      with `completing-read' to a new Elisp function `read-extended-command'.
 +      Call it to read a command to `function'  (bug#5364, bug#5214).
 +
 +2010-08-22  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * emacs.c (main): Remove handling of --unibyte arg (Bug#6886).
 +
 +2010-08-22  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA_LISP
 +      instead of SAFE_ALLOCA.
 +
 +2010-08-22  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA
 +      (Bug#6214).
 +
 +2010-08-22  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * doc.c (Fsnarf_documentation): Set skip_file only if p[1] is S.
 +
 +2010-08-22  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * doc.c (Fsnarf_documentation): Initialize skip_file before
 +      build-files test.
 +
 +2010-08-22  Peter O'Gorman  <pogma@thewrittenword.com>  (tiny change)
 +
 +      * s/hpux10-20.h (HAVE_TERMIOS, NO_TERMIO, ORDINARY_LINK):
 +      New definitions.
 +      (HAVE_TERMIO): Remove.
 +
 +2010-08-22  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * deps.mk (sysdep.o, msdos.o): Depend on sysselect.h.
 +
 +      * sysselect.h [WINDOWSNT]: Don't define the FD_* and select stuff
 +      for w32.
 +
 +      * s/ms-w32.h (HAVE_SYS_TIMEB_H): Don't #undef HAVE_SYS_SELECT_H,
 +      it's done in nt/config.nt.
 +
 +      * makefile.w32-in ($(BLD)/sysdep.$(O)): Depend on sysselect.h.
 +
 +      * unexcoff.c (report_error, make_hdr, write_segment)
 +      (copy_text_and_data, copy_sym, mark_x, adjust_lnnoptrs, unexec):
 +      Convert argument lists and prototypes to ANSI C.
 +      (make_hdr, write_segment): Remove unused variables.
 +      (unexec): Remove commented-out line.  Initialize `new' to shut up
 +      compiler warnings.
 +
 +2010-08-22  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Simplify termio code.
 +      All non-MSDOS non-WINDOWSNT platforms define HAVE_TERMIOS, so
 +      HAVE_TERMIO code is obsolete.
 +      Replace HAVE_TERMIOS conditionals with !DOS_NT.
 +      * systty.h: Do not define HAVE_TCATTR.
 +      Remove HAVE_TERMIO, HAVE_LTCHARS and HAVE_TCHARS code.
 +      Do not define EMACS_HAVE_TTY_PGRP.  Only define
 +      EMACS_GET_TTY_PGRP for !DOS_NT.
 +      * sysdep.c: Include sysselect.h unconditionally.  Do not include
 +      sys/ioctl.h and termios.h, systty.h does it.
 +      Use HAVE_SYS_UTSNAME_H instead of USG as an include guard.
 +      (init_baud_rate): Remove HAVE_TERMIO code.
 +      (child_setup_tty): Remove HAVE_TERMIO code.
 +      (emacs_get_tty, emacs_set_tty): Remove HAVE_TERMIO, HAVE_TCHARS
 +      and HAVE_LTCHARS code.  Use !DOS_NT instead of HAVE_TCATTR.
 +      (new_ltchars, new_tchars): Remove, unused.
 +      (init_sys_modes): Remove HAVE_TERMIO, HAVE_TCHARS and HAVE_LTCHARS
 +      code.  Remove special casing for __mips__, it was a no-op.
 +      Remove HAVE_TCATTR conditional, it is implied by HAVE_TERMIOS.
 +      (init_sys_modes): Remove HPUX special case.
 +      * process.c: Include stdlib.h unconditionally.  Do not include
 +      fcntl.h, systty.h does it.  Remove conditional code for
 +      HAVE_SERIAL, it is always true.
 +      (process_send_signal): Remove HAVE_TERMIOS conditional, it's
 +      always true when SIGNALS_VIA_CHARACTERS is true.
 +      (Fcontinue_process, Fprocess_send_eof): Simplify conditionals:
 +      !WINDOWSNT means HAVE_TERMIOS.
 +      (create_process): Remove HAVE_TERMIOS, it's inside a HAVE_PTYS
 +      conditional, which is true for all HAVE_TERMIOS systems.
 +      * keyboard.c (init_keyboard): Do not use HAVE_TERMIO, use !DOS_NT
 +      instead of HAVE_TERMIOS.
 +      * emacs.c (shut_down_emacs): Use !defined DOS_NT instead of
 +      EMACS_HAVE_TTY_PGRP.
 +      * callproc.c (child_setup): Move EMACS_SET_TTY_PGRP use to the
 +      non-MSDOS, non-WINDOWSNT code, it's only defined for such systems
 +      anyway.
 +
 +2010-08-21  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * dispnew.c (buffer_posn_from_coords): Fix off-by-one error in
 +      mirroring pixel positions.
 +
 +2010-08-20  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * alloc.c (malloc_sbrk_used, malloc_sbrk_unused): Remove,
 +      write only.
 +      (init_alloc_once): Remove writes to malloc_sbrk_unused, and
 +      malloc_sbrk_used, nothing uses them.
 +
 +      * puresize.h: Remove code assuming PNTR_COMPARISON_TYPE is not
 +      defined, unconditionally defined in lisp.h.
 +
 +      * term.c: Do not include <termios.h>, systty.h does it.
 +
 +      * s/unixware.h (HAVE_TCATTR):
 +      * s/aix4-2.h (HAVE_TCATTR): Remove definitions, not needed.
 +      systty.h defines it when HAVE_TERMIOS is defined.
 +
 +2010-08-20  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * dispnew.c (buffer_posn_from_coords): Fix last change for text
 +      terminals: add one-character offset for R2L lines.
 +
 +      * emacs.c <emacs_version>: Add a comment regarding
 +      msdos/mainmake.v2's dependency on the syntax of this declaration.
 +
 +2010-08-20  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * dispnew.c (buffer_posn_from_coords): Fix calculation of buffer
 +      position for R2L lines by mirroring the pixel position wrt the
 +      text are box.  Improve commentary.
 +
 +2010-08-20  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * image.c (imagemagick_clear_image): Remove debugging output.
 +
 +2010-08-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * cmds.c (Vself_insert_face, Vself_insert_face_command): Remove.
 +      (Qpost_self_insert_hook, Vpost_self_insert_hook): New vars.
 +      (internal_self_insert): Run Qpost_self_insert_hook rather than handle
 +      self-insert-face.
 +      (syms_of_cmds): Initialize the new vars.
 +
 +2010-08-19  Jason Rumney  <jasonr@gnu.org>
 +
 +      * w32menu.c (set_frame_menubar): Remove call to undefined function.
 +
 +      * w32fns.c (w32_wnd_proc): Don't check context before initializing.
 +
 +2010-08-19  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsselect.m (nxatoms_of_nsselect): Use "Selection" and "Secondary".
 +
 +2010-08-18  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xterm.c (x_draw_bar_cursor):
 +      * w32term.c (x_draw_bar_cursor): If the character under cursor is
 +      R2L, draw the bar cursor on its right rather than on its left.
 +
 +2010-08-18  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * eval.c (Fdefmacro): Only obey one declaration.
 +
 +      * casefiddle.c (casify_region): Setup gl_state.
 +
 +2010-08-18  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (ns_define_frame_cursor): Call x_update_cursor (Bug#6868).
 +
 +2010-08-18  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * gtkutil.c (update_frame_tool_bar): Literal strings are const char*.
 +
 +2010-08-18  David De La Harpe Golden  <david@harpegolden.net>
 +
 +      * nsselect.m (QCLIPBOARD, NXPrimaryPboard): Define.
 +      (symbol_to_nsstring): Map QCLIPBOARD => NSGeneralPboard,
 +      QPRIMARY => NXPrimaryPboard.
 +      (ns_string_to_symbol): NSGeneralPboard => QCLIPBOARD,
 +      NXPrimaryPboard => QPRIMARY.
 +      (nxatoms_of_nsselect): NXPrimaryPboard = PrimarySelection,
 +      NXSecondaryPboard = SecondarySelection.
 +      (syms_of_nsselect): Intern QCLIPBOARD (Bug#6677).
 +
 +2010-08-18  Joakim Verona  <joakim@verona.se>
 +
 +      * image.c: Add support for ImageMagick.  When HAVE_IMAGEMAGICK is
 +      defined:
 +      (imagemagick_image_p): New function to test for ImageMagic image.
 +      (imagemagick_load): New function to load ImageMagick image.
 +      (imagemagick_load_image): New function, helper for imagemagick_load.
 +      (imagemagick-types): New function.
 +      (Qimagemagick): New Lisp_object.
 +      (imagemagick-render-type): New variable, decides which renderer to use.
 +
 +2010-08-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * gtkutil.c (update_frame_tool_bar): Don't assume TOOL_BAR_ITEM_LABEL
 +      is a string.
 +
 +2010-08-17  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsfns.m (ns_frame_parm_handlers): Add a slot for the
 +      x_set_tool_bar_position handler.
 +
 +2010-08-17  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * w32fns.c <w32_frame_parm_handlers>: Add a slot for the
 +      x_set_tool_bar_position handler, needed to support changes from
 +      2010-07-29T16:49:59Z!jan.h.d@swipnet.se for positioning the tool bar.  (Bug#6796)
 +
 +2010-08-16  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsselect.m: include keyboard.h for QPRIMARY, remove its
 +      declaration (Bug#6863).
 +      (syms_of_nsselect): Don't intern QPRIMARY.
 +
 +      * xselect.c: Remove declaration of QPRIMARY (Bug#6864).
 +
 +      * keyboard.h (QPRIMARY): Declare (Bug#6864).
 +
 +2010-08-16  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * keyboard.c (command_loop_1): Avoid setting selection twice,
 +      since it's done in deactivate-mark as well.
 +      (Vselect_active_regions): Change default to t.  Replace `lazy'
 +      with non-default value `only', meaning only set PRIMARY for
 +      temporarily active regions.
 +
 +      * insdel.c (prepare_to_modify_buffer): Handle `only' value of
 +      select-active-regions.
 +
 +2010-08-15  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * keyboard.c (parse_tool_bar_item): Put in a bad label if :label
 +      isn't a string.
 +
 +2010-08-15  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * keyboard.c (parse_tool_bar_item): Avoid excessive use of strlen.
 +
 +2010-08-15  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * keyboard.c (parse_tool_bar_item): malloc buf.
 +      Set TOOL_BAR_ITEM_LABEL to empty string if not set to
 +      new_lbl (Bug#6855).
 +
 +2010-08-14  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xterm.c (x_draw_stretch_glyph_string):
 +      * w32term.c (x_draw_stretch_glyph_string): In R2L rows, display
 +      the cursor on the right edge of the stretch glyph.
 +
 +      * xdisp.c (window_box_right_offset, window_box_right):
 +      Fix commentary.
 +
 +      * xdisp.c (Fcurrent_bidi_paragraph_direction): Fix paragraph
 +      direction when point is inside a run of whitespace characters.
 +
 +      * bidi.c (bidi_at_paragraph_end): Remove obsolete comment.
 +
 +2010-08-14  Jason Rumney  <jasonr@gnu.org>
 +
 +      * keyboard.c (lispy_function_keys): Do not define VK_PACKET (bug#4836)
 +
 +2010-08-14  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * fns.c (Fmake_hash_table): Doc fix (Bug#6851).
 +
 +2010-08-13  Jason Rumney  <jasonr@gnu.org>
 +
 +      * w32menu.c (simple_dialog_show): Use unicode message box if available.
 +      (MessageBoxW_Proc): New function typedef.
 +      (unicode-message-box): New function pointer.
 +      (globals_of_w32menu): Import it from user32.dll. (Bug#5629)
 +
 +2010-08-13  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * frame.h (Qtool_bar_position): Declare.
 +
 +      * xfns.c (Fx_create_frame): Call x_default_parameter for
 +      Qtool_bar_position.
 +
 +2010-08-13  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * unexcoff.c: Remove the parts used when "emacs" is not defined.
 +      (report_error, report_error_1): Ditto.
 +      (write_segment): Remove "#if 0" unused code.
 +      (make_hdr): Remove code that was "#ifndef NO_REMAP" before
 +      NO_REMAP was removed (in 2010-07-29T03:25:08Z!dann@ics.uci.edu).
 +      (start_of_text): Remove unused function (was used only if NO_REMAP
 +      was NOT defined).
 +
 +      * msdos.c (IT_set_face): Fix format string to match argument
 +      types.
 +      (IT_write_glyphs, IT_note_mode_line_highlight)
 +      (IT_set_frame_parameters): Remove unused variables.
 +      (x_set_menu_bar_lines): Declare set_menu_bar_lines.
 +      (IT_set_terminal_modes): Disambiguate expression in if clause.
 +      (Fmsdos_remember_default_colors): Return Qnil.
 +      (IT_set_frame_parameters): Add parens to disambiguate boolean
 +      expression for logging the cursor type to termscript.
 +      (keyboard_layout_list, keypad_translate_map)
 +      (grey_key_translate_map): Add braces in inner initializers.
 +      (dos_rawgetc): Add parens in condition for mouse-3 button-press.
 +      (dos_rawgetc): Remove unused label.
 +      (XMenuActivate): Add braces to remove ambiguous `else'.
 +      (dos_ttraw): Always return a value.
 +      (spawnve): Declare.
 +      (run_msdos_command): Cast 3rd arg of spawnve to "char **".
 +
 +      * dosfns.h (x_set_title): Declare.
 +
 +      * w16select.c (Fw16_set_clipboard_data, Fw16_get_clipboard_data):
 +      Remove unused variables.
 +
 +      * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Remove unused
 +      variables.
 +      (init_dosfns): Declare get_lim_data.
 +      (system_process_attributes): Declare Fget_internal_run_time.
 +
 +      * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Fix argument
 +      list to be consistent with menu.h.
 +
 +      * w32menu.c (add_menu_item, name_is_separator): Shut up compiler
 +      warnings due to mixing of "char *" and "const char *".
 +
 +2010-08-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      Introduce a new comment style "c" flag.
 +      * syntax.c (SYNTAX_FLAGS_COMMENT_STYLEB)
 +      (SYNTAX_FLAGS_COMMENT_STYLEC): New macros.
 +      (SYNTAX_FLAGS_COMMENT_STYLE): Use them, add an argument.
 +      (syntax_prefix_flag_p): New function.
 +      (Fstring_to_syntax): Understand new "c" flag.
 +      (Finternal_describe_syntax_value): Recognize new flag; use the
 +      SYNTAX_FLAGS_* macros.
 +      (scan_sexps_forward, Fparse_partial_sexp): Change representation of
 +      comment style to accomodate the new styles.
 +      (back_comment, forw_comment, Fforward_comment, scan_lists)
 +      (scan_sexps_forward): Update code to obey the new comment style flag.
 +
 +      * syntax.h: Move SYNTAX_FLAGS_FOO() macros to syntax.c.
 +
 +      * casefiddle.c (casify_region): Use the new syntax_prefix_flag_p.
 +
 +2010-08-11  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xfns.c (x_defined_color): If USE_GTK, call xg_check_special_colors
 +      first.
 +      (Fx_hide_tip): Check FRAME_LIVE_P (f) before calling xg_hide_tooltip.
 +
 +      * gtkutil.h (xg_check_special_colors): Declare.
 +
 +      * gtkutil.c (xg_check_special_colors, style_changed_cb): New functions.
 +      (xg_create_frame_widgets): Connect theme name changes to
 +      style_changed_cb.
 +
 +      * xterm.c (emacs_class): New char[] for EMACS_CLASS.
 +      (xim_open_dpy, xim_initialize, xim_close_dpy): Use emacs_class.
 +      (x_term_init): Use char[] display_opt and name_opt instead of
 +      string literal.  file is const char*.
 +
 +      * xsmfns.c (NOSPLASH_OPT): Change to char[].
 +      (smc_save_yourself_CB): Do xstrdup on all ->type and ->name for
 +      props.  Free them at the end.
 +
 +      * xselect.c (Fx_get_atom_name): Use char empty[] instead of literal "".
 +
 +      * xrdb.c (get_system_app): Make path const and use char *p for
 +      non-const char.
 +
 +      * xmenu.c (Fx_popup_dialog): error_name is const char*.
 +      (xmenu_show): error parameter is const char **.  pane_string is const
 +      char *.
 +      (button_names): Is const char *.
 +      (xdialog_show): error_name and pane_string is const.
 +
 +      * process.h (synch_process_death): Is const char*.
 +
 +      * w32menu.c (w32_menu_show):
 +      * nsmenu.m (ns_menu_show): error parameter is const char **.
 +
 +      * menu.h (w32_menu_show, ns_menu_show, xmenu_show): error parameter
 +      is const char **.
 +
 +      * menu.c (Fx_popup_menu): error_name is const.
 +
 +      * keyboard.h (_widget_value): Add defined USE_GTK.  Replace Boolean
 +      with unsigned char and XtPointer with void *.
 +
 +      * gtkutil.h: Replace widget_value with struct _widget_value.
 +      (enum button_type, struct _widget_value): Remove and use the one from
 +      keyboard.h.
 +
 +      * gtkutil.c (get_utf8_string): Always return an allocated string.
 +      Parameter is const.
 +      (create_dialog, xg_create_one_menuitem, create_menus)
 +      (xg_item_label_same_p, xg_update_menu_item): Free result from
 +      get_utf8_string.
 +      (xg_separator_p, xg_item_label_same_p): label is const.
 +
 +      * font.h (font_open_by_name): Make name const.
 +
 +      * font.c (font_open_by_name): Make name const.
 +
 +      * floatfns.c (matherr): Use a const char* variable for x->name.
 +
 +      * emacs.c (main): Pass char[] to putenv instead of literal.
 +
 +      * callproc.c (synch_process_death): Make const.
 +      (Fcall_process): Make signame const.
 +
 +      * nsterm.h (parseKeyEquiv, addSubmenuWithTitle)
 +      (addDisplayItemWithImage): Use const char*.
 +
 +      * nsmenu.m (parseKeyEquiv, addSubmenuWithTitle)
 +      (addDisplayItemWithImage, update_frame_tool_bar): Use const char*.
 +
 +      * nsfont.m (ns_descriptor_to_entity): Use const char*.
 +
 +      * keyboard.h (_widget_value): name, value and key are const char*.
 +
 +      * unexmacosx.c (unexec_error): Use const char *.
 +
 +2010-08-09  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * font.h (font_parse_xlfd, font_parse_fcname, font_unparse_fcname)
 +      (font_parse_name, font_open_by_name):
 +      * font.c (font_parse_xlfd, font_parse_fcname, font_unparse_fcname)
 +      (font_parse_name, font_open_by_name): Remove const.
 +
 +2010-08-09  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      Use autoconf determined WORDS_BIGENDIAN instead of hardcoded
 +      definition.
 +
 +      * m/alpha.h: Don't define/undef WORDS_BIG_ENDIAN.
 +      * m/amdx86-64.h: Likewise.
 +      * m/arm.h: Likewise.
 +      * m/hp800.h: Likewise.
 +      * m/ia64.h: Likewise.
 +      * m/ibmrs6000.h: Likewise.
 +      * m/ibms390.h: Likewise.
 +      * m/intel386.h: Likewise.
 +      * m/iris4d.h: Likewise.
 +      * m/m68k.h: Likewise.
 +      * m/macppc.h: Likewise.
 +      * m/mips.h: Likewise.
 +      * m/sh3.h: Likewise.
 +      * m/sparc.h: Likewise.
 +      * m/template.h: Likewise.
 +      * m/vax.h: Likewise.
 +      * m/xtensa.h: Likewise.
 +      * fringe.c (init_fringe_bitmap): Test WORDS_BIGENDIAN instead of
 +      WORDS_BIG_ENDIAN.
 +      * lisp.h: Likewise.
 +      * md5.c: Likewise.
 +      * sound.c (le2hl, le2hs, be2hl, be2hs): Likewise.
 +
 +2010-08-09  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Use const char* instead of char*.
 +      Reduce the number of warnings with -Wwrite-strings.
 +      * xrdb.c (get_environ_db, get_system_name):
 +      * unexelf.c (find_section):
 +      * term.c (string_cost, string_cost_one_line, per_line_cost)
 +      (get_named_tty, init_tty):
 +      * sysdep.c (sys_subshell):
 +      * sound.c (sound_perror, sound_warning, vox_open, vox_init)
 +      (alsa_sound_perror, alsa_open, alsa_configure, alsa_init):
 +      * search.c (Freplace_match):
 +      * process.c (Fmake_network_process, send_process, init_process):
 +      * lread.c (Fload, init_lread):
 +      * keymap.c (Fdescribe_buffer_bindings, describe_map_tree):
 +      * keyboard.c (parse_tool_bar_item, struct event_head):
 +      * gtkutil.h (xg_get_font_name):
 +      * gtkutil.c (get_dialog_title, create_dialog, xg_get_font_name)
 +      (make_widget_for_menu_item, make_menu_item, create_menus)
 +      (xg_make_tool_item):
 +      * font.c (parse_matrix, font_parse_name):
 +      * floatfns.c (rounding_driver, float_error_fn_name):
 +      * filelock.c (get_boot_time_1, lock_file_1):
 +      * fileio.c (barf_or_query_if_file_exists, check_writable):
 +      * editfns.c (get_system_name, get_operating_system_release)
 +      (Fencode_time, Fset_time_zone_rule):
 +      * dispextern.h (string_cost, per_line_cost, get_named_tty, init_tty):
 +      * buffer.c (defvar_per_buffer): Use const.
 +
 +2010-08-08  Kenichi Handa  <handa@m17n.org>
 +
 +      * charset.c: Include <stdlib.h>.
 +      (struct charset_sort_data): New struct.
 +      (charset_compare): New function.
 +      (Fsort_charsets): New function.
 +      (syms_of_charset): Declare Fsort_charsets as a Lisp function.
 +
 +      * coding.c (decode_coding_iso_2022): Fix checking of dimension
 +      number in CTEXT extended segment.
 +
 +2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * w32fns.c (syms_of_w32fns) <x-max-tooltip-size>: Fix typo in docstring.
 +      * xfns.c (syms_of_xfns) <x-max-tooltip-size>: Reflow docstring.
 +
 +2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * fns.c (Fsubstring_no_properties, Fnthcdr, Ffeaturep)
 +      (Fhash_table_size): Fix typos in docstrings.
 +      (Fmake_hash_table): Doc fix.
 +
 +2010-08-08  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * minibuf.c (syms_of_minibuf) <read-buffer-function>:
 +      Doc fix (bug#5625).
 +
 +2010-08-08  Ken Brown  <kbrown@cornell.edu>
 +
 +      * dired.c (DIRENTRY_NONEMPTY) [cygwin]: Use d_ino instead of
 +      the MSDOS definition.
 +
 +2010-08-08  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Use const char* instead of char*.
 +      * xterm.c (x_create_toolkit_scroll_bar):
 +      * xfont.c (xfont_list_pattern):
 +      * xfns.c (x_default_scroll_bar_color_parameter)
 +      (xic_create_fontsetname, x_default_font_parameter)
 +      (x_screen_planes):
 +      * xdisp.c (c_string_pos, number_of_chars, reseat_to_string)
 +      (store_mode_line_string, decode_mode_spec, display_string):
 +      * menu.c (digest_single_submenu):
 +      * keymap.h (initial_define_key, initial_define_lispy_key):
 +      * keymap.c (initial_define_key, initial_define_lispy_key):
 +      * image.c (image_error, image_keyword):
 +      * gtkutil.h (xg_create_widget, xg_create_scroll_bar):
 +      * gtkutil.c (xg_create_widget, xg_create_scroll_bar):
 +      * ftfont.c (struct fc_charset_table, ftfont_spec_pattern)
 +      (ftfont_list, ftfont_match):
 +      * frame.c (frame_parm_table):
 +      * font.h (font_intern_prop, font_parse_xlfd, font_parse_fcname)
 +      (font_unparse_fcname, font_unparse_fcname, font_open_by_name)
 +      (font_add_log, font_deferred_log):
 +      * font.c (font_intern_prop, font_parse_xlfd, font_parse_fcname)
 +      (font_unparse_fcname, font_unparse_fcname, font_open_by_name)
 +      (font_add_log, font_deferred_log):
 +      * emacs.c (argmatch):
 +      * dispextern.h (struct it):
 +      * coding.c (ENCODE_DESIGNATION):
 +      * charset.c (define_charset_internal): Use const.
 +
 +      * s/freebsd.h (DECLARE_GETPWUID_WITH_UID_T): Remove, unused.
 +
 +      * xrdb.c: Remove include guard.
 +      Remove DECLARE_GETPWUID_WITH_UID_T conditional it had no effect.
 +      Remove #if 0 code.  Replace malloc->xmalloc, free->xfree,
 +      realloc->xrealloc instead of using #defines.
 +
 +2010-08-08  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * cmds.c (Fforward_line, Fbeginning_of_line, Fend_of_line):
 +      * editfns.c (Fline_beginning_position, Fline_end_position):
 +      State in the doc strings that start and end of line are in the
 +      logical order.
 +
 +      * xdisp.c (display_line): Move the handling of overlay arrow after
 +      the call to find_row_edges.  (Bug#6699)
 +
 +2010-08-07  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * keyboard.c (command_loop_1):
 +      * insdel.c (prepare_to_modify_buffer): Don't call validate_region.
 +
 +2010-08-07  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * insdel.c (prepare_to_modify_buffer): Save active region text to
 +      Vsaved_region_selection.
 +
 +      * xselect.c (QPRIMARY): Move to keyboard.c.
 +
 +      * keyboard.c (Vselect_active_regions): Move from simple.el.
 +      (Vsaved_region_selection, Qx_set_selection, QPRIMARY, Qlazy): New vars.
 +      (command_loop_1): Set window selection prior to deactivating the mark.
 +
 +2010-08-07  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * alloc.c (lisp_malloc):
 +      * buffer.c (set_buffer_internal, set_buffer_internal_1):
 +      * charset.h (emacs_mule_charset):
 +      * dispextern.h (inhibit_free_realized_faces, redraw_frame)
 +      (redraw_garbaged_frames, scroll_cost, update_frame, scrolling)
 +      (bitch_at_user):
 +      * lisp.h (Fcheck_coding_system, Fget_text_property)
 +      (Qfunction, Qcompletion_ignore_case, QCwidth, QCsize):
 +      Remove duplicate declarations.
 +
 +2010-08-06  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * process.c: Simplify include logic.
 +
 +      * keyboard.h (quit_char): Add declaration.
 +      * process.h (QCport, QCspeed, QCprocess, QCbytesize, QCstopbits)
 +      (QCparity, Qodd, Qeven, QCflowcontrol, Qhw, Qsw, QCsummary):
 +      Add declarations.
 +      * sysdep.c:
 +      * w32.c: Remove the above declarations.
 +
 +      Remove extern declarations in .c files, .h files have them.
 +      * xterm.c:
 +      * xdisp.c:
 +      * msdos.c:
 +      * image.c:
 +      * gtkutil.c:
 +      * fileio.c:
 +      * eval.c: Remove declarations.
 +
 +      * frame.c (frame_params): Make const.
 +
 +      * lisp.h (fatal_error_signal, emacs_root_dir): Add declaration.
 +
 +      * emacs.c (emacs_copyright, emacs_version): Make static.
 +      (Vinitial_window_system, Vauto_save_list_file_name)
 +      (Vinhibit_redisplay): Remove declarations.
 +      (main): Remove HAVE_SHM code, unused.  Remove _I386 conditional
 +      for AIX.
 +
 +      Use const for some arrays and functions.
 +      * xterm.h (xg_set_icon_from_xpm_data):
 +      * xfns.c (xg_set_icon_from_xpm_data):
 +      * term.c (fkeys):
 +      * keyboard.c (lispy_accent_keys, lispy_function_keys)
 +      (lispy_multimedia_keys, lispy_kana_keys, iso_lispy_function_keys)
 +      (lispy_drag_n_drop_names, scroll_bar_parts, modify_event_symbol)
 +      (frame.c frame_parms):
 +      * emacs-icon.h (gnu_xpm_bits):
 +      * callint.c (callint_argfuns): Use const.
 +
 +2010-08-06  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * sysdep.c: Move include term.h last of includes (Bug#6812).
 +
 +2010-08-06  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * dispnew.c (realloc_glyph_pool): Zero out newly allocated glyphs.
 +
 +      * msdos.c (IT_display_cursor): Log cursor position on termscript.
 +
 +      * .gdbinit (pgx): Display the avoid_cursor_p flag.
 +
 +2010-08-06  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in ($(BLD)/xdisp.$(O)): Update dependencies.
 +
 +2010-08-06  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.h (x_get_focus_frame): Declare.
 +
 +      * keyboard.h (poll_for_input_1): Unconditionally declare.
 +
 +      * nsterm.h (x_set_menu_bar_lines): Declare.
 +
 +      * window.c: Don't include menu.h, it depends on lots of other .h-files.
 +
 +      * xfaces.c (x_create_gc, x_free_gc): Convert to ANSI C prototypes.
 +
 +      * window.c: Include menu.h.
 +
 +      * unexmacosx.c (print_region_list, print_regions)
 +      (build_region_list, find_emacs_zone_regions)
 +      (unexec_regions_merge, read_load_commands, dump_it)
 +      (unexec_init_emacs_zone): Convert to ANSI C prototypes.
 +
 +      * term.c: Check HAVE_SYS_IOCTL_H.
 +
 +      * sysdep.c: Check HAVE_TERM_H.
 +
 +      * process.c: Check HAVE_UTIL_H.  Include nsterm.h if HAVE_NS.
 +
 +      * nsterm.m (ns_init_paths, ns_alloc_autorelease_pool)
 +      (ns_ring_bell, ns_defined_color, hide_hourglass)
 +      (x_display_pixel_height, x_display_pixel_width, syms_of_nsterm):
 +      Convert to ANSI C prototypes.
 +      (x_set_window_size, ns_draw_fringe_bitmap, judge): Move declarations
 +      before code.
 +
 +      * nsterm.h : Include sysselect.h.
 +      (x_sync, x_get_focus_frame, x_set_mouse_position)
 +      (x_set_mouse_pixel_position, x_make_frame_visible)
 +      (x_make_frame_invisible, x_iconify_frame, x_char_width, x_char_height)
 +      (x_pixel_width, x_pixel_height, x_set_frame_alpha, x_set_tool_bar_lines)
 +      (x_activate_menubar, free_frame_menubar, ns_init_paths, ns_select)
 +      (syms_of_nsterm, syms_of_nsfns, syms_of_nsmenu, syms_of_nsselect):
 +      Declare.
 +
 +      * nsmenu.m (popup_activated, name_is_separator)
 +      (syms_of_nsmenu): Convert to ANSI C prototypes.
 +      (runMenuAt): Prototypes and move declarations before code.
 +
 +      * nsimage.m (ns_load_image): Move NSTRACE after declarations.
 +
 +      * nsfont.m (ns_fallback_entity, syms_of_nsfont): Convert to ANSI C
 +      prototypes.
 +
 +      * nsfns.m (have_menus_p, ns_display_info_for_name)
 +      (x_set_cursor_type, ns_appkit_version_str)
 +      (ns_appkit_version_int, ns_do_applescript)
 +      (x_set_scroll_bar_default_width, x_sync, compute_tip_xy)
 +      (syms_of_nsfns): Convert to ANSI C prototypes.
 +
 +      * menu.h (x_set_menu_bar_line): Declare.
 +      (free_menubar_widget_value_tree et.al): Add HAVE_NS for these functions.
 +
 +      * lisp.h (fmod_float): Declare.
 +
 +      * image.c (xpm_scan, xpm_make_color_table_v)
 +      (xpm_put_color_table_v, xpm_get_color_table_v)
 +      (xpm_make_color_table_h, xpm_put_color_table_h)
 +      (xpm_get_color_table_h, xpm_str_to_color_key, xpm_load_image)
 +      (xpm_load): Convert to ANSI C prototypes.
 +
 +      * emacs.c: Include nsterm.h if HAVE_NS.
 +
 +      * bidi.c (bidi_dump_cached_states): Fix fprintf warning.
 +
 +2010-08-06  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * process.c: Remove HAVE_SOCKETS #ifdefs inside #ifdef
 +      subprocesses, only MSDOS does not define HAVE_SOCKETS.
 +      (socket_options): Use const char* for name.
 +
 +2010-08-06  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      Fix changes in 2010-08-05T23:15:24Z!dann@ics.uci.edu..2010-08-05T23:34:12Z!dann@ics.uci.edu for Windows build.
 +
 +      * xmenu.c [USE_X_TOOLKIT || USE_GTK]:
 +      Don't declare xmalloc_widget_value and digest_single_submenu.
 +
 +      * w32font.c (Qlatin): Remove declaration.
 +
 +      * menu.h (xmalloc_widget_value, digest_single_submenu): Declare.
 +
 +      * dired.c (compile_pattern): Restore declaration.
 +
 +2010-08-05  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove extern declarations in .c files, .h files have them.
 +      * data.c:
 +      * dired.c:
 +      * editfns.c:
 +      * filelock.c:
 +      * fns.c:
 +      * font.c:
 +      * fontset.c:
 +      * frame.c:
 +      * fringe.c:
 +      * ftfont.c:
 +      * gtkutil.c:
 +      * indent.c:
 +      * keyboard.c:
 +      * keymap.c:
 +      * lread.c:
 +      * menu.c:
 +      * print.c:
 +      * search.c:
 +      * sound.c:
 +      * window.c:
 +      * xdisp.c:
 +      * xfaces.c:
 +      * xfns.c:
 +      * xfont.c:
 +      * xftfont.c:
 +      * xmenu.c:
 +      * xterm.c: Remove declarations.
 +
 +      Cleanup syssignal.h.
 +      * syssignal.h (sighold, sigrelse, RETSIGTYPE): Remove, unused.
 +      (main_thread): Move down to remove #ifdef.
 +      (SIGMASKTYPE, SIGEMPTYMASK, SIGFULLMASK, sigmask, sigunblock):
 +      Remove conditional definition following unconditional ones.
 +
 +      * lisp.h: Remove HAVE_SHM code, unused.
 +      (QCmap, QCrehash_size, QCrehash_threshold, QCsize, QCtest)
 +      (QCweakness, Qabove_handle, Qbackquote, Qbar, Qbelow_handle)
 +      (Qborder, Qbottom, Qbox, Qcircular_list, Qcomma, Qcomma_at)
 +      (Qcomma_dot, Qcursor, Qdefault, Qdown, Qend_scroll, Qeq, Qeql)
 +      (Qequal, Qfile_exists_p, Qfont_param, Qfringe, Qfunction)
 +      (Qfunction_documentation, Qhandle, Qhbar, Qheader_line, Qhollow)
 +      (Qidentity, Qleft_margin, Qmenu, Qmenu_bar_update_hook)
 +      (Qmode_line_inactive, Qmouse, Qoverriding_local_map)
 +      (Qoverriding_terminal_local_map, Qratio, Qregion, Qright_margin)
 +      (Qscroll_bar, Qtool_bar, Qtop, Qup, Qvertical_border, Qwhen)
 +      (Qwindow_scroll_functions, Vafter_load_alist)
 +      (Vauto_save_list_file_name, Vface_alternative_font_family_alist)
 +      (Vface_alternative_font_registry_alist, Vface_font_rescale_alist)
 +      (Vface_ignored_fonts, Vinhibit_redisplay, Vminibuffer_list)
 +      (Vprint_length, Vprint_level, Vscalable_fonts_allowed)
 +      (Vshell_file_name, Vsystem_name, Vwindow_scroll_functions)
 +      (Vwindow_system_version, Vx_no_window_manager, initial_argc)
 +      (initial_argv, last_nonmenu_event, load_in_progress)
 +      (noninteractive_need_newline, scroll_margin): Add declarations.
 +
 +      * keyboard.h (xmalloc_widget_value, digest_single_submenu):
 +      Remove declarations, menu.h has them.
 +      (QCbutton, QCtoggle, QCradio, QClabel, extra_keyboard_modifiers)
 +      (Vinput_method_function, Qinput_method_function)
 +      (Qevent_symbol_element_mask, last_event_timestamp):
 +      * dispextern.h (Voverflow_newline_into_fringe):
 +      * font.h (QCantialias, Qp, syms_of_ftfont, syms_of_xfns)
 +      (syms_of_ftxfont, syms_of_xftfont, syms_of_bdffont)
 +      (syms_of_w32font, syms_of_nsfont):
 +      * fontset.h (find_font_encoding, Qlatin):
 +      * frame.h (Qtooltip, Qrun_hook_with_args, Vmenu_bar_mode)
 +      (Vtool_bar_mode, set_frame_menubar):
 +      * ftfont.h (ftfont_font_format, ftfont_get_fc_charset):
 +      * xterm.h (Qx_gtk_map_stock):
 +      * keymap.h (meta_prefix_char): Add declarations.
 +
 +      * term.c: Remove dead code.
 +
 +      Fix emacs -Q -f server-start & emacsclient -t on GNU/Linux.
 +      * term.c (dissociate_if_controlling_tty): Use USG5 instead of
 +      USG.  This is equivalent to defined (USG) && !defined (BSD_PGRPS),
 +      which is what was there before BSD_PGRPS was removed.
 +
 +2010-08-05  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * deps.mk (unexcoff.o): Rename unexec.[co] => unexcoff.[co].
 +
 +      * unexcoff.c: Renamed from unexec.c.
 +
 +2010-08-04  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * sysdep.c (child_setup_tty): Comment-out left-over non-ICANON code.
 +
 +2010-08-03  Johan Bockgård  <bojohan@gnu.org>
 +
 +      * data.c (Flocal_variable_p): Handle variable aliases correctly.
 +      (Bug#6744)
 +
 +2010-08-02  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.c (x_create_toolkit_scroll_bar): Only set XtNbeNiceToColormap
 +      to TRUE if depth of screen is < 16.
 +
 +      * gtkutil.c (hierarchy_ch_cb, qttip_cb): Do not define unless
 +      USE_GTK_TOOLTIP.
 +      (xg_prepare_tooltip): Return 0 unless USE_GTK_TOOLTIP.
 +      (xg_show_tooltip, xg_hide_tooltip): Do nothing unless USE_GTK_TOOLTIP.
 +      (xg_create_frame_widgets): Surround tooltip-related code with ifdef
 +      USE_GTK_TOOLTIP.
 +      (xg_free_frame_widgets): Don't delete ttip_* unless USE_GTK_TOOLTIP.
 +
 +      * xterm.h (USE_GTK_TOOLTIP): New define.
 +      (struct x_output): Put ttip_* inside ifdef USE_GTK_TOOLTIP.
 +
 +      * sysdep.c (child_setup_tty): Enable ICANON in lflags and set VEOF
 +      to Control-D (Bug#6771).
 +
 +2010-08-02  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * editfns.c (Fregion_beginning, Fregion_end): Doc fixes (bug#6493).
 +      Wording by Drew Adams <drew.adams@oracle.com>.
 +
 +2010-08-01  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.h (struct x_output): Add ttip_widget, ttip_window and
 +      ttip_lbl.
 +
 +      * xterm.c (x_clear_frame): Check FRAME_GTK_WIDGET (f) before
 +      calling gtk_widget_queue_draw.
 +      (x_free_frame_resources): Call xg_free_frame_widgets.
 +
 +      * xfns.c (x_gtk_use_system_tooltips): New variable.
 +      (Fx_show_tip): If USE_GTK and x_gtk_use_system_tooltips, call
 +      new gtkutil tooltip functions to show the tooltip.
 +      (Fx_hide_tip): Call xg_hide_tooltip.
 +      (syms_of_xfns): Defvar x-gtk-use-system-tooltips.
 +
 +      * gtkutil.h (xg_free_frame_widgets, xg_prepare_tooltip)
 +      (xg_show_tooltip, xg_hide_tooltip): Declare.
 +
 +      * gtkutil.c (hierarchy_ch_cb, qttip_cb, xg_prepare_tooltip)
 +      (xg_show_tooltip, xg_hide_tooltip, xg_free_frame_widgets):
 +      New functions.
 +      (xg_create_frame_widgets): Set ttip_* to 0.  Set a dummy tooltip
 +      text so qttip_cb is called.  Connect query-tooltip to qttip_cb.
 +      Remove code that is commented out.
 +
 +2010-08-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * keymap.c (Fdefine_key, Flookup_key): Say what event is invalid.
 +
 +2010-07-31  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xselect.c (x_own_selection): Use list4.
 +
 +2010-07-30  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * buffer.c (Qwindow): Do not define, already defined in data.c.
 +      (syms_of_buffer): Do not intern and staticpro Qwindow.  (Bug#6760)
 +
 +2010-07-29  Chad Brown  <yandros@mit.edu>
 +
 +      Replace tests for SYSV_SYSTEM_DIR with HAVE_DIRENT_H, set via autoconf.
 +      * dired.c, sysdep.c: Test HAVE_DIRENT_H instead of SYSV_SYSTEM_DIR.
 +      * config.in: Undef HAVE_DIRENT_H.
 +      * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h,
 +      * s/msdos.h, s/usg5-4.h: Don't define SYSV_SYSTEM_DIR.
 +
 +2010-07-29  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Rename s/usg5-4.h -> s/usg5-4-common.h.
 +      * s/usg5-4.h: Rename file to ...
 +      * s/usg5-4-common.h: ... this for consistency with what we do for BSD.
 +      * s/unixware.h:
 +      * s/sol2-6.h:
 +      * s/irix6-5.h: Update includes accordingly.
 +
 +2010-07-29  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xfns.c (x_set_tool_bar_position): Remove debug fprintf.
 +
 +      * xterm.h (struct x_output): Add toolbar_top_height,
 +      toolbar_bottom_height, toolbar_left_width, toolbar_right_width.
 +      Remove toolbar_height.
 +      If USE_GTK: Add hbox_widget and toolbar_in_hbox.
 +      (FRAME_TOOLBAR_TOP_HEIGHT, FRAME_TOOLBAR_BOTTOM_HEIGHT)
 +      (FRAME_TOOLBAR_LEFT_WIDTH, FRAME_TOOLBAR_RIGHT_WIDTH): New macros.
 +      (FRAME_TOOLBAR_HEIGHT): Is now TOP_HEIGHT + BOTTOM_HEIGHT.
 +
 +      * xterm.c (x_set_window_size_1): Add FRAME_TOOLBAR_WIDTH to pixelwidth.
 +
 +      * xfns.c (x_set_tool_bar_position): New function.
 +      (xic_set_statusarea): Use FRAME_TOOLBAR_TOP_HEIGHT.
 +      (x_frame_parm_handlers): Add x_set_tool_bar_position.
 +      (syms_of_xfns): If USE_GTK, provide move-toolbar.
 +
 +      * window.c (calc_absolute_offset): Check for FRAME_TOOLBAR_TOP_HEIGHT
 +      and FRAME_TOOLBAR_LEFT_WIDTH.
 +
 +      * gtkutil.h (xg_change_toolbar_position): Declare.
 +
 +      * gtkutil.c (FRAME_TOTAL_PIXEL_WIDTH): New macro.
 +      (xg_frame_set_char_size): Add FRAME_TOOLBAR_WIDTH to pixelwidth.
 +      (xg_height_or_width_changed): Use FRAME_TOTAL_PIXEL_WIDTH.
 +      (xg_create_frame_widgets): Create a hobox for placing widgets
 +      vertically.  Use gtk_box_pack_start.
 +      (xg_height_or_width_changed): Rename from xg_height_changed.
 +      (x_wm_set_size_hint): Add FRAME_TOOLBAR_WIDTH to base_width.
 +      (xg_update_frame_menubar, free_frame_menubar): Change to
 +      xg_height_or_width_changed.
 +      (xg_tool_bar_detach_callback): Update left/right/top/bottom tool bar
 +      size correctly.  Remove hardcoded 4, instead use handlebox size -
 +      toolbar size.
 +      (xg_tool_bar_attach_callback): Update left/right/top/bottom tool bar
 +      size correctly.  Use handlebox size + toolbar size as additional size.
 +      (xg_pack_tool_bar): POS is a new parameter.
 +      Set orientation of tool bar based on pos.
 +      Only make handlebox_widget if NULL.
 +      Check if tool bar goes to vbox or hbox depending on pos.
 +      (xg_update_tool_bar_sizes): New function.
 +      (update_frame_tool_bar): Remove old_req, new_req.  Do not get tool bar
 +      height, call xg_update_tool_bar_sizes instead.
 +      (free_frame_tool_bar): Remove from hbox or vbox depending on
 +      toolbar_in_hbox,  Set all FRAME_TOOLBAR_*_(WIDTH|HEIGHT) to zero.
 +      (xg_change_toolbar_position): New function.
 +
 +      * frame.h (struct frame): Add tool_bar_position.
 +      (Qbottom): Declare.
 +
 +      * frame.c (Qtool_bar_position): New variable.
 +      (make_frame): Set tool_bar_position to Qtop.
 +      (frame_parms): Add tool-bar-position.
 +      (x_report_frame_params): Store tool_bar_position.
 +      (x_set_fringe_width): Reset wm size hint after fringe changes.
 +
 +2010-07-29  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Make lisp_time_argument declaration work on all systems.
 +      * lisp.h (lisp_time_argument): Move declaration ...
 +      * systime.h (lisp_time_argument): ... here
 +      * editfns.c (lisp_time_argument): Remove declaration.  (Bug#6751)
 +
 +2010-07-29  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * vm-limit.c (POINTER): Add typedef for it.
 +      (start_of_data): Change return type from POINTER to char *.
 +
 +      * frame.h (Qtty_color_mode): Move declaration out of ifdef
 +      HAVE_WINDOW_SYSTEM.
 +
 +2010-07-29  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * vm-limit.c: Do not include sys/resource.h, mem-limits.h does it.
 +      Remove reference to __osf__, unused.
 +
 +      * mem-limits.h: Remove duplicated includes.
 +      (NULL): Remove definition, unused.
 +      (POINTER): Remove definition.
 +      (start_of_data): Use char* in prototype, as the function
 +      definition does.
 +
 +      Remove extern declarations from .c files, and them to .h files.
 +      * keyboard.h (Qhelp_echo, waiting_for_input)
 +      (input_available_clear_time, ignore_mouse_drag_p)
 +      (Vdouble_click_time, real_this_command, Vthis_original_command):
 +      * keymap.h (Qremap, Qmenu_item, Voverriding_local_map)
 +      (Voverriding_local_map_menu_flag):
 +      * lisp.h (Qinteractive_form, use_file_dialog)
 +      (Qcursor_in_echo_area, QCascent, QCmargin, QCrelief, Qcount)
 +      (Qextension_data, QCconversion, QCcolor_symbols, QCheuristic_mask)
 +      (QCindex, QCmatrix, QCcolor_adjustment, QCmask)
 +      (Qrisky_local_variable, map_char_table_for_charset, Vprint_level)
 +      (Qfunction, debug_on_next_call, Qfield)
 +      (Vinhibit_field_text_motion, Vuser_login_name, lisp_time_argument)
 +      (Qpriority, Qwindow, Qevaporate, Qbefore_string, Qafter_string)
 +      (Qfile_directory_p, Qinsert_file_contents)
 +      (Qcompletion_ignore_case, Qcompletion_ignore_case)
 +      (Vcompletion_regexp_list, Vhistory_length, completion_ignore_case)
 +      (history_delete_duplicates, minibuffer_auto_raise, Qonly)
 +      (Qfile_name_handler_alist, Qfront_sticky, Qrear_nonsticky)
 +      (Qminibuffer_prompt)
 +      (Vtemporary_file_directory,char_ins_del_vector, Qface):
 +      * xterm.h (gray_bitmap_width, gray_bitmap_height)
 +      (gray_bitmap_bits, xic_create_fontsetname):
 +      * coding.h (Vtranslation_table_for_input): Add extern declarations.
 +
 +      * xsmfns.c (Vuser_login_name):
 +      * xrdb.c (Vdouble_click_time):
 +      * xfaces.c (xic_create_fontsetname):
 +      * w32select.c (waiting_for_input):
 +      * print.c (minibuffer_auto_raise):
 +      * msdos.c (Qhelp_echo):
 +      * macros.c (real_this_command):
 +      * keymap.c (Voverriding_local_map):
 +      * xterm.c (poll_for_input_1, gray_bitmap_width)
 +      (gray_bitmap_height, gray_bitmap_bits;
 +      * xmenu.c ( Voverriding_local_map)
 +      (Voverriding_local_map_menu_flag; Qmenu_item; use_dialog_box)
 +      (use_file_dialog, Xt_app_con):
 +      * xdisp.c (minibuffer_auto_raise, Voverriding_local_map)
 +      (Voverriding_local_map_menu_flag, Qmenu_item, Qface, Qinvisible)
 +      (Qwidth, Qinvisible, Qwindow, Qpriority, Qtool_bar_lines)
 +      (Qtool_bar_lines, ignore_mouse_drag_p):
 +      * minibuf.c (Voverriding_local_map, Qfield, Qfront_sticky)
 +      (Qrear_nonsticky, nconc2):
 +      * keyboard.c (current_global_map, minibuf_level, Qmenu_item)
 +      (Vhistory_length, Vtranslation_table_for_input, Qcomposition)
 +      (Qdisplay, Qafter_string, Qbefore_string, Qundefined):
 +      * fileio.c (use_dialog_box, use_file_dialog, Vuser_login_name)
 +      (minibuf_level, minibuffer_auto_raise, lisp_time_argument):
 +      * eval.c (Qinteractive_form, Qrisky_local_variable, Qfunction)
 +      (gc_in_progress):
 +      * doc.c (Voverriding_local_map, Qremap):
 +      * dired.c (completion_ignore_case, Qcompletion_ignore_case)
 +      (Vcompletion_regexp_list):
 +      * coding.c (Qmac, Qinsert_file_contents, Qwrite_region)
 +      (Qcompletion_ignore_case):
 +      * callint.c (Qcursor_in_echo_area, Qfile_directory_p, Qonly)
 +      (Vhistory_length, Vthis_original_command, real_this_command)
 +      (Qface, Qminibuffer_prompt, history_delete_duplicates):
 +      * image.c (Qrisky_local_variable):
 +      * fontset.c (QCname):
 +      * fns.c (minibuffer_auto_raise, QCname):
 +      * dispnew.c (char_ins_del_cost):
 +      * composite.c (font_fill_lglyph_metrics):
 +      * cmds.c (Qface, Vtranslation_table_for_input):
 +      * charset.c (map_char_table_for_charset, Qfile_name_handler_alist):
 +      * ccl.c (charset_unicode):
 +      * callproc.c (Vtemporary_file_directory):
 +      * buffer.c (emacs_strerror): Remove extern declarations.
 +
 +      * data.c (Qwindow): Make non-static, used from other files too.
 +      * frame.c (validate_x_resource_name): Remove shadow definition for i.
 +
 +      * unexec.c (make_hdr): Remove references to NO_REMAP, COFF,
 +      SEGMENT_MASK, SECTION_ALIGNMENT, ADJUST_EXEC_HEADER.
 +      * s/usg5-4.h (COFF):
 +      * s/template.h:
 +      * s/msdos.h (COFF, NO_REMAP):
 +      * s/ms-w32.h (NO_REMAP):
 +      * s/hpux10-20.h (NO_REMAP):
 +      * m/sparc.h (SEGMENT_MASK):
 +      * m/m68k.h (NO_REMAP):
 +      * m/intel386.h (SEGMENT_MASK):
 +      * m/arm.h (NO_REMAP):
 +      * m/alpha.h (COFF):
 +      * m/template.h: Remove references to unused defines.
 +
 +2010-07-28  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsettings.c (Ftool_bar_get_system_style): Also check for
 +      Qtext_image_horiz.
 +
 +      * xdisp.c (Qtext_image_horiz): Define.
 +      (syms_of_xdisp): Initialize Qtext_image_horiz.  Add text-image-horiz
 +      to documentation of tool-bar-style.
 +
 +      * lisp.h (Qtext_image_horiz): Declare.
 +
 +      * gtkutil.c (xg_make_tool_item, xg_show_toolbar_item): Handle tool bar
 +      style text_image_horiz.
 +
 +2010-07-27  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * emacs.c (Fkill_emacs): Remove return statement.
 +
 +      * term.c (Qspace, QCalign_to, QCwidth): Remove declarations.
 +      (encode_terminal_code, produce_composite_glyph): Remove unused variables.
 +      (set_tty_color_mode, term_mouse_highlight, term_get_fkeys):
 +      Remove local extern declarations.
 +
 +      * xmenu.c: Do not included lwlib.h, not needed.
 +
 +      * m/iris4d.h (XUINT, XSET): Remove, not needed.
 +
 +      * process.c: Move definitions earlier to minimize #ifdefs.
 +
 +      * xterm.h (x_get_customization_string, x_load_resources)
 +      (x_get_resource, x_text_icon, x_text_icon, x_check_errors)
 +      (x_check_errors, x_property_data_to_lisp, defined_color)
 +      (xic_set_xfontset, x_defined_color): Use const.
 +
 +      * xterm.c (xlwmenu_window_p, xlwmenu_redisplay): Remove declarations.
 +      (x_text_icon, x_check_errors, x_connection_closed): Use const.
 +
 +      * xselect.c (selection_data_to_lisp_data)
 +      (x_property_data_to_lisp):
 +      * xrdb.c (x_get_string_resource, file_p)
 +      (x_get_customization_string, magic_file_p, search_magic_path)
 +      (get_system_app, get_user_app, x_load_resources, x_get_resource)
 +      (x_get_string_resource): Use const.
 +
 +      * xfns.c: Include xlwmenu.h when USE_LUCID.
 +      (x_defined_color, xic_set_xfontset): Use const.
 +      (Fx_hide_tip): Remove local extern declaration.
 +
 +      * xfaces.c (Qmouse_face): Remove declaration.
 +      (face_color_gray_p, tty_defined_color, defined_color)
 +      (face_color_gray_p, face_color_supported_p): Add const.
 +
 +      * xdisp.c (do_mouse_tracking): Remove declaration.
 +      (add_to_log): Use const.
 +
 +      * minibuf.c (Qmouse_face): Remove declaration.
 +
 +      * msdos.c (IT_note_mouse_highlight): Remove local extern declaration.
 +
 +      * keyboard.h (do_mouse_tracking): Add declaration.
 +
 +      * image.c (QCwidth, QCheight, QCforeground, QCbackground, QCfile)
 +      (QCdata, QCtype, Qcenter): Remove declarations.
 +
 +      * frame.c (x_get_resource_string, x_get_string_resource)
 +      (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg)
 +      (x_default_parameter): Use const.
 +
 +      * font.c (Qnormal, QCtype, QCfamily, QCweight, QCslant, QCwidth)
 +      (QCheight, QCsize, QCname): Remove declarations.
 +
 +      * emacs.c (main): Remove local extern declaration.
 +
 +      * editfns.c (region_limit, syms_of_editfns): Remove local extern
 +      declarations.
 +
 +      * dispnew.c: Remove duplicate #include <unistd.h>.
 +      (update_window, update_frame_1, init_display): Remove local extern
 +      declarations.
 +
 +      * dispextern.h (add_to_log): Remove declaration.
 +      (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg)
 +      (x_frame_get_and_record_arg, x_default_parameter): Add const.
 +
 +      * dired.c (scmp): Add const.
 +      (directory_files_internal): Remove local extern declaration.
 +
 +      * data.c (Finteractive_form): Use const.
 +
 +      * composite.c (syms_of_composite): Remove local extern declarations.
 +
 +      * charset.c (add_to_log): Remove declaration.
 +
 +      * character.c (strwidth, parse_str_to_multibyte): Add const.
 +
 +      * character.h (strwidth, parse_str_to_multibyte): Likewise.
 +
 +      * buffer.c (Fset_buffer_multibyte): Remove local extern declaration.
 +
 +      * lisp.h (Fkill_emacs): Mark as NO_RETURN.
 +      (Lisp_Subr): Make doc and intspec constant.
 +      (QCsize, Qspace, Qcenter, QCalign_to, QCdata, QCfile, QCtype)
 +      (Qlocal, Qapply, Qnormal, QCfamily, QCweight, QCslant, QCwidth)
 +      (QCheight, QCsize, QCname, QCwidth, QCforeground)
 +      (QCbackground, add_to_log, stack_base, Vmark_even_if_inactive)
 +      (display_arg): Add declarations.
 +
 +2010-07-27  Christoph Scholtes  <cschol2112@gmail.com>
 +
 +      * minibuf.c (Fread_buffer): Doc fix (bug#6528).
 +
 +      * window.c (Fwindow_height): Doc fix (bug#6518).
 +
 +2010-07-27  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * buffer.c (syms_of_buffer) <fringe-indicator-alist>: Doc fix.
 +
 +2010-07-26  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * keyboard.c (Ftop_level, Fexit_recursive_edit)
 +      (Fabort_recursive_edit): Remove return statements in NO_RETURN
 +      functions.
 +
 +      * frame.h (Qtty_color_mode): Add declaration.
 +
 +      * lisp.h (Ftop_level, Fexit_recursive_edit)
 +      (Fabort_recursive_edit): Mark as NO_RETURN.
 +
 +2010-07-26  Kenichi Handa  <handa@m17n.org>
 +
 +      * font.c (Ffont_shape_gstring): Terminate GSTRING by nil if the
 +      number of glyphs gets smaller than the original length.  (Bug#6621)
 +
 +2010-07-26  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * lread.c (unreadpure, mapatoms_1): Make static.
 +
 +2010-07-25  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * terminfo.c (tparam): Fix prototype of tparm.
 +
 +2010-07-25  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * emacs.c (main) [PROFILING]: Use __executable_start if defined to
 +      find start of text segment.
 +      * dispnew.c (safe_bcopy): Don't define if HAVE___EXECUTABLE_START
 +      is defined.
 +
 +      * callproc.c (set_initial_environment): Avoid unbalanced braces.
 +
 +2010-07-25  Ken Brown  <kbrown@cornell.edu>
 +
 +      * vm-limit.c (check_memory_limits): Fix previous change;
 +      accidentally reverted an earlier change.
 +
 +2010-07-25  Ken Brown  <kbrown@cornell.edu>
 +
 +      * mem-limits.h (BSD4_2) [cygwin]: Don't define here; instead...
 +      * vm-limit.c: ...add 'defined (CYGWIN)' here (Bug#6715).
 +
 +2010-07-25  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * callproc.c (relocate_fd): Set inside #ifndef WINDOWSNT.
 +      * dired.c (opendir, readdir): Fix prototypes.
 +      * editfns.c (w32_get_internal_run_time): Fix prototypes.
 +      * keyboard.c (input_available_signal): Declare inside #ifdef SIGIO.
 +      * ndir.h (opendir, readdir, seekdir, closedir): Fix prototypes.
 +      (telldir): Remove declaration.
 +      * ralloc.c (real_morecore, __morecore): Fix prototypes.
 +      * sound.c (alsa_sound_perror): Declare inside #ifdef HAVE_ALSA.
 +      * syssignal.h (strsignal): Fix prototype.
 +      * term.c (tparam): Fix prototype.
 +      (term_get_fkeys_address, term_get_fkeys_kboard, term_get_fkeys_1)
 +      (term_get_fkeys): Set inside "#ifndef DOS_NT".
 +      * vm-limit.c (check_memory_limits): Fix prototypes of real_morecore
 +      and __morecore.
 +      * w32gui.h (XParseGeometry): Fix prototype.
 +      * w32heap.h (get_data_start, get_data_end, init_heap): Fix prototypes.
 +      * w32term.c (my_set_focus): Declare inside #if 0.
 +      * w32term.h (x_window_to_frame, x_display_info_for_name, w32_term_init)
 +      (w32_fill_rect, w32_clear_window, init_crit, delete_crit, signal_quit)
 +      (drain_message_queue, get_next_msg, post_msg, parse_button)
 +      (ClipboardSequence_Proc): Fix prototypes.
 +      (wait_for_sync): Remove declaration.
 +
 +2010-07-24  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * w32fns.c (w32_to_x_color): Remove, unused.
 +
 +2010-07-24  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * lisp.h: Remove leftover P_.
 +
 +2010-07-24  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * ecrt0.c, unexalpha.c: Remove files, unused.
 +
 +2010-07-24  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * cmds.c (internal_self_insert): Make static.
 +      * lisp.h (internal_self_insert): Remove declaration.
 +
 +2010-07-23  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * alloc.c (free_float):
 +      * font.c [ENABLE_CHECKING] (font_match_xlfd, font_check_xlfd_parse):
 +      * frame.c (delete_frame_handler):
 +      * ralloc.c (reorder_bloc):
 +      * w32menu.c (menubar_id_to_frame, add_left_right_boundary):
 +      Remove unused static functions.
 +
 +      * menu.c (cleanup_popup_menu): Set inside "#ifdef HAVE_NS";
 +      it is called only from NS code.
 +
 +      * w32term.c (my_set_focus): #ifdef away; it is called only from
 +      "#ifdef 0" code.
 +
 +      * w32fns.c (x_edge_detection):
 +      * xfaces.c (may_use_scalable_font_p):
 +      Remove obsolete static declarations.
 +
 +2010-07-20  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * alloc.c (emacs_blocked_free, emacs_blocked_malloc)
 +      (emacs_blocked_realloc, uninterrupt_malloc):
 +      * fringe.c (w32_reset_fringes):
 +      * image.c (convert_mono_to_color_image, lookup_rgb_color)
 +      (init_color_table, XPutPixel, jpeg_resync_to_restart_wrapper):
 +      * sound.c (be2hs, do_play_sound):
 +      * vm-limit.c (get_lim_data, ret_lim_data):
 +      * w32term.c (x_free_frame_resources):
 +      * xfaces.c (x_create_gc, x_free_gc):
 +      Convert definitions to standard C.
 +
 +2010-07-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * eval.c (Feval, Ffuncall): Use the new names.
 +
 +      * lisp.h (struct Lisp_Subr): Rename `am' to aMANY and add aUNEVALLED.
 +      (DEFUN): Add braces around the union initialisation and use ## to
 +      specify the right union alternative and avoid a cast.
 +
 +2010-07-18  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in ($(BLD)/keyboard.$(O)): Update dependencies.
 +
 +2010-07-17  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * frame.c (make_initial_frame): Use set_menu_bar_lines (Bug#6660).
 +
 +2010-07-17  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * gtkutil.c (xg_event_is_for_menubar): Also check that event window
 +      is related to the menu bar (Bug#6499).
 +      (xg_frame_resized): GTK_IS_MAPPED => gtk_widget_get_mapped, for Gtk 3.0.
 +
 +2010-07-16  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.h (x_menubar_window_to_frame): Second parameter is XEvent*.
 +
 +      * xterm.c (handle_one_xevent): Pass event to x_menubar_window_to_frame.
 +
 +      * xmenu.c (x_activate_menubar): Revert previous fix for Bug#6499,
 +      i.e. don't put back ButtonRelease (Bug#6608).
 +
 +      * xfns.c (x_menubar_window_to_frame): Take XEvent as second parameter
 +      instead of Window.  Call xg_event_is_for_menubar when
 +      USE_GTK (Bug#6499).
 +
 +      * gtkutil.h (xg_event_is_for_menubar): Declare.
 +
 +      * gtkutil.c (xg_event_is_for_menubar): New function (Bug#6499).
 +
 +2010-07-16  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * w32fns.c (x_set_foreground_color): Fix setting the cursor color
 +      when it's the same as the old foreground.  (Bug#6609)
 +
 +2010-07-16  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xmenu.c (free_frame_menubar): Only call x_set_window_size if
 +      widget is non-null (Bug#6645).
 +
 +2010-07-15  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * xterm.c (x_fully_uncatch_errors, x_trace_wire, x_check_font):
 +      Convert old-style definition.
 +
 +      * xmenu.c (create_and_show_popup_menu, xmenu_show): Fix type of
 +      timestamp argument.
 +
 +2010-07-15  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * fringe.c (update_window_fringes): Restore mistakenly reverted
 +      code from 2010-04-17T12:33:05Z!eliz@gnu.org merged in 2010-04-20T13:31:28Z!eliz@gnu.org.
 +
 +2010-07-14  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.c (xm_scroll_callback, x_process_timeouts): K&R => prototype.
 +      (SET_SAVED_KEY_EVENT): Remove (not used).
 +      (SET_SAVED_MENU_EVENT): Rename to SET_SAVED_BUTTON_EVENT and
 +      remove size parameter.
 +      (handle_one_xevent): Check popup_activated () for menu for Xt also.
 +      Remove #ifdef USE_GTK around finish = X_EVENT_DROP.
 +      Remove #ifdef USE_MOTIF code that did SET_SAVED_BUTTON_EVENT for
 +      ButtonRelease.
 +      (x_set_window_size_1): scroll_bar_actual_width is always
 +      SCROLL_BAR_COLS * COLUMN_WIDTH for the purpose of frame sizing.
 +
 +      * xdisp.c (pending_menu_activation): Remove extern declaration.
 +      (prepare_menu_bars): Remove setting of pending_menu_activation.
 +
 +      * xmenu.c (pending_menu_activation): Remove.
 +      (x_activate_menubar): Set popup_activated_flag for Xt also.
 +      Remove setting of pending_menu_activation.
 +      (set_frame_menubar): Remove check of pending_menu_activation.
 +      Declare menubar_size before code.  Correct spelling in comment.
 +
 +2010-07-14  Kenichi Handa  <handa@m17n.org>
 +
 +      * font.c (font_open_entity): Cancel previous change.
 +      (Ffont_get): Don't check FONT_ENTITY_INDEX of a font-object.
 +
 +2010-07-13  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Remove subprocesses #ifdefs.
 +      * process.c <inhibit_sentinels>: Move to the common part.
 +      (Fwaiting_for_user_input_p): Move to the common part; return nil
 +      if async subprocesses aren't supported.
 +      * sysdep.c (wait_for_termination) [!MSDOS]: Don't compile on
 +      MS-DOS.  Remove "#ifdef subprocesses".
 +      (sys_subshell, sys_select): Remove "#ifdef subprocesses".
 +      (gettimeofday): Remove "#ifdef subprocesses".
 +      (wait_without_blocking): Remove function.
 +      (flush_pending_output, child_setup_tty): Don't compile on MS-DOS.
 +      Remove "#ifdef subprocesses".
 +      (child_setup_tty): Use WINDOWSNT instead of DOS_NT, since not
 +      compiled on MS-DOS.
 +      * callproc.c (Fcall_process) [!MSDOS]: Don't call
 +      wait_for_termination on MS-DOS.
 +      * emacs.c (shut_down_emacs): Remove "#ifndef subprocesses" from
 +      initialization of inhibit_sentinels.
 +      * keyboard.c (record_asynch_buffer_change): Remove "#ifdef
 +      subprocesses" conditional.
 +      * callproc.c (Fcall_process) [!subprocesses]: Don't call
 +      wait_for_termination, since `buffer' cannot be an integer when
 +      async subprocesses are not supported
 +      * xdisp.c (decode_mode_spec): Use `MSDOS' instead of `subprocesses'
 +      for ifdefing away the call to Fprocess_status.
 +
 +      * process.c (add_keyboard_wait_descriptor) [!subprocesses]: Ifdef
 +      away the entire body of the function.
 +
 +2010-07-13  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove subprocesses #ifdefs from term.c.
 +      * process.c (add_keyboard_wait_descriptor)
 +      (delete_keyboard_wait_descriptor): Move to common section, do
 +      nothing when subprocesses is not defined.
 +      * term.c (Fsuspend_tty, Fresume_tty, init_tty):
 +      Remove subprocesses #ifdefs.
 +
 +      Convert maybe_fatal to standard C.
 +      * lisp.h (verror): Declare.
 +      * eval.c (verror): New function containing the code from ...
 +      (error): ... this.  Call verror.
 +      * term.c (vfatal): New function containing the code from ...
 +      (fatal): ... this.  Call vfatal.
 +      (maybe_fatal): Convert to standard C, use variable number of
 +      arguments.  Declare as non-return.
 +      (init_tty): Fix maybe_fatal call.
 +
 +2010-07-12  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * xterm.c (x_scroll_bar_set_handle, x_scroll_bar_expose)
 +      (_scroll_bar_note_movement): Convert definitions to standard C.
 +      * xmenu.c (menu_help_callback, pop_down_menu, xmenu_show):
 +      * xfns.c (hack_wm_protocols, x_window, x_window): Likewise.
 +
 +2010-07-12  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * xterm.c (x_frame_of_widget, x_alloc_nearest_color_for_widget)
 +      (x_alloc_lighter_color_for_widget, cvt_string_to_pixel)
 +      (cvt_pixel_dtor, x_window_to_menu_bar, xt_action_hook)
 +      (xaw_jump_callback, xaw_scroll_callback)
 +      (x_create_toolkit_scroll_bar, x_set_toolkit_scroll_bar_thumb)
 +      (x_wm_set_size_hint, x_activate_timeout_atimer):
 +      Convert definitions to standard C.
 +      * xmenu.c (menubar_id_to_frame, popup_get_selection)
 +      (popup_activate_callback, popup_deactivate_callback)
 +      (menu_highlight_callback, menubar_selection_callback)
 +      (apply_systemfont_to_dialog, apply_systemfont_to_menu)
 +      (free_frame_menubar, popup_selection_callback, as)
 +      (create_and_show_popup_menu, dialog_selection_callback)
 +      (create_and_show_dialog):
 +      * xfns.c (hack_wm_protocols, x_window):
 +      * xfaces.c (x_update_menu_appearance):
 +      * widget.c (get_default_char_pixel_size, pixel_to_char_size)
 +      (char_to_pixel_size, round_size_to_char, get_wm_shell)
 +      (set_frame_size, update_wm_hints, setup_frame_gcs)
 +      (update_various_frame_slots, update_from_various_frame_slots)
 +      (EmacsFrameInitialize, EmacsFrameRealize, EmacsFrameResize)
 +      (EmacsFrameSetValues, EmacsFrameQueryGeometry)
 +      (EmacsFrameSetCharSize, widget_store_internal_border): Likewise.
 +
 +2010-07-12  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * dbusbind.c (xd_initialize): Don't compare boolean with a constant.
 +
 +2010-07-12  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * process.c (setup_process_coding_systems): Move to the part
 +      shared by non-subprocesses systems, and make its body empty when
 +      subprocesses is not defined.
 +      (close_process_descs): Move to the part shared by non-subprocesses
 +      systems.
 +      (wait_reading_process_output) [!subprocesses]: Convert arg list to
 +      ANSI C.
 +
 +2010-07-12  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * editfns.c (transpose_markers): Convert old-style definition.
 +      * emacs.c (abort, shut_down_emacs, fixup_locale)
 +      (synchronize_system_time_locale)
 +      (synchronize_system_messages_locale, syms_of_emacs): Likewise.
 +      * floatfns.c (extract_float, matherr, init_floatfns)
 +      (syms_of_floatfns): Likewise.
 +      * fns.c (make_hash_table): Likewise.
 +      * ftfont.c (ftfont_get_otf, ftfont_otf_features)
 +      (ftfont_otf_capability, ftfont_get_glyph_id, ftfont_get_metrics)
 +      (ftfont_drive_otf, ftfont_shape_by_flt, ftfont_shape)
 +      (ftfont_variation_glyphs): Likewise.
 +      * gtkutil.c (xg_create_widget, xg_modify_menubar_widgets): Likewise.
 +      * keymap.c (describe_map_tree, describe_map, describe_vector): Likewise.
 +      * lread.c (read_filtered_event): Likewise.
 +      * minibuf.c (read_minibuf_noninteractive, read_minibuf): Likewise.
 +      * process.c (wait_reading_process_output): Likewise.
 +      * scroll.c (do_line_insertion_deletion_costs): Likewise.
 +      * search.c (search_buffer, boyer_moore): Likewise.
 +      * syntax.c (scan_sexps_forward): Likewise.
 +      * xdisp.c (try_scrolling): Likewise.
 +      * xfaces.c (face_at_buffer_position, face_for_overlay_string)
 +      (face_at_string_position): Likewise.
 +      * xfns.c (x_default_scroll_bar_color_parameter): Likewise.
 +      * xselect.c (x_get_window_property, receive_incremental_selection)
 +      (x_get_window_property_as_lisp_data, lisp_data_to_selection_data):
 +      Likewise.
 +      * xterm.c (x_draw_relief_rect, x_draw_box_rect): Likewise.
 +
 +2010-07-12  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * callproc.c (child_setup): Remove subprocesses conditional.
 +      Remove code dealing with SET_EMACS_PRIORITY, unused.
 +
 +      * buffer.c (Fset_buffer_multibyte): Remove subprocesses conditional.
 +      * process.c (close_process_descs): Use DOS_NT instead of WINDOWSNT.
 +
 +      * emacs.c (__do_global_ctors, __do_global_ctors_aux)
 +      (__do_global_dtors, __main): Use void in definition.
 +      (main): Remove code dealing with SET_EMACS_PRIORITY, unused.
 +      Remove SYMS_MACHINE code, unused.  Remove SYMS_SYSTEM, inline
 +      the only users from ...
 +      * s/ms-w32.h (SYMS_SYSTEM): ... here and ...
 +      * s/msdos.h (SYMS_SYSTEM): ... here.  Remove.
 +      (HAVE_VOLATILE): Remove, unused.
 +
 +      Convert more function definitions to standard C.
 +      * xdisp.c (window_box_edges, handle_single_display_spec)
 +      (display_string): Convert definition to standard C.
 +      * scroll.c (do_direct_scrolling, scrolling_1):
 +      * dispnew.c (allocate_matrices_for_frame_redisplay)
 +      (mirrored_line_dance):
 +      * coding.c (code_convert_string):
 +      * charset.c (map_charset_chars):
 +      * ccl.c (Fccl_program_p, Fccl_execute, Fccl_execute_on_string)
 +      (Fregister_ccl_program, Fregister_code_conversion_map):
 +      * keyboard.c (kbd_buffer_nr_stored): Likewise.
 +      (head_table): Make static and const.
 +
 +2010-07-12  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS)
 +      (PROFILING_LDFLAGS): Set from substitution.
 +      (ALL_CFLAGS): Add C_WARNINGS_SWITCH and PROFILING_CFLAGS, put
 +      CFLAGS last.
 +
 +2010-07-12  Kenichi Handa  <handa@m17n.org>
 +
 +      * Makefile.in (lisp): Change hebrew.el to hebrew.elc.
 +      (shortlisp): Likewise.
 +
 +      * font.h (enum font_property_index): New member FONT_ENTITY_INDEX.
 +
 +      * font.c (font_open_entity): Record ENTITY in FONT_OBJECT's slot
 +      of FONT_ENTITY_INDEX.
 +      (Ffont_get): If KEY is :otf and the font-object doesn't have the
 +      property, get the property value dynamically.
 +      (Ffont_put): Accept font-entity and font-object too.
 +      (Ffont_get_glyhphs): Rename from Fget_font_glyphs.  Arguments and
 +      return value changed.
 +      (syms_of_font): Adjust for the above change.
 +
 +2010-07-11  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * blockinput.h: Remove obsolete comment.
 +
 +      * lisp.h: Include <stddef.h>.
 +      (OFFSETOF): Don't define.
 +      (VECSIZE): Use offsetof instead of OFFSETOF.
 +      (PSEUDOVECSIZE): Likewise.
 +      * process.c (conv_sockaddr_to_lisp): Likewise.
 +      * alloc.c: Don't include <stddef.h>.
 +      * buffer.h (PER_BUFFER_VAR_OFFSET): Use offsetof.
 +
 +      * process.c: Remove obsolete comment.
 +
 +2010-07-11  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xfaces.c (Vface_remapping_alist): Doc fix (Bug#6091).
 +
 +2010-07-11  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * callint.c (Fcall_interactively): Use strchr, strrchr instead of
 +      index, rindex.
 +      * doc.c (get_doc_string, Fsnarf_documentation): Likewise.
 +      * editfns.c (Fuser_full_name, Fformat): Likewise.
 +      * emacs.c (argmatch, sort_args, decode_env_path): Likewise.
 +      * fileio.c (Ffile_symlink_p): Likewise.
 +      * filelock.c (current_lock_owner): Likewise.
 +      * font.c (font_parse_name, font_parse_family_registry): Likewise.
 +      * fontset.c (fontset_pattern_regexp): Likewise.
 +      * lread.c (read1): Likewise.
 +      * sysdep.c (init_system_name): Likewise.
 +      * xfns.c (select_visual): Likewise.
 +      * s/hpux10-20.h (index, rindex): Don't define.
 +      * s/ms-w32.h (index): Likewise.
 +      * s/usg5-4.h: Likewise.
 +
 +      * callproc.c (relocate_fd): Use F_DUPFD if defined.
 +
 +      * alloc.c (pending_malloc_warning, malloc_warning): Add const.
 +      * callproc.c (relocate_fd, getenv_internal_1, getenv_internal)
 +      (egetenv): Likewise.
 +      * doprnt.c (doprnt): Likewise.
 +      * editfns.c (set_time_zone_rule, format2): Likewise.
 +      * emacs.c (decode_env_path): Likewise.
 +      * eval.c (signal_error, error): Likewise.
 +      * insdel.c (replace_range_2): Likewise.
 +      * keyboard.c (cmd_error_internal): Likewise.
 +      * lread.c (isfloat_string, make_symbol, dir_warning): Likewise.
 +      * print.c (write_string, write_string_1, print_error_message):
 +      Likewise.
 +      * vm-limit.c (warn_function, memory_warnings): Likewise.
 +      * xdisp.c (message1, message1_nolog, message_with_string)
 +      (vmessage, message, message_nolog): Likewise.
 +      * emacs.c: Remove duplicate declaration.
 +      * keyboard.h: Likewise.
 +      * lisp.h: Update prototypes.
 +
 +      * eval.c: Fix indentation problem.
 +
 +      * keyboard.c: Include "process.h"
 +
 +      * eval.c: Remove obsolete noinline declaration.
 +      * fns.c: Likewise.
 +
 +2010-07-11  Ken Raeburn  <raeburn@raeburn.org>
 +
 +      * doprnt.c (doprnt): Take a va_list argument instead of count and
 +      pointer.
 +      * eval.c (error): Change to a standard-C variadic function.
 +      * xdisp.c (vmessage): Rename from message, made static, and
 +      changed to take a va_list argument.
 +      (message): New variadic wrapper.
 +      (message_nolog): Now a variadic function, calling vmessage.
 +      * lisp.h: Include stdarg.h for va_list.
 +      (doprnt, error, message, message_nolog): Decls updated.
 +
 +2010-07-11  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * process.c (syms_of_process) <delete-exited-processes>: Define
 +      even if !subprocesses.
 +      (delete_exited_processes): Ditto.
 +
 +      * msdos.c (syms_of_msdos) <delete-exited-processes>: Remove DEFVAR.
 +      (delete_exited_processes): Don't define.
 +
 +2010-07-10  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * frame.c (make_frame): Initialize menu_bar_lines and
 +      tool_bar_lines members.
 +      (make_initial_frame, make_terminal_frame):
 +      Initialize menu_bar_lines using value of menu-bar-mode.
 +
 +      * msdos.c (IT_set_frame_parameters): Don't set menu-bar-lines.
 +
 +2010-07-10  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * process.c: Reshuffle #include's.  Condition some of the global
 +      and static variables on `subprocesses'.
 +      (hold_keyboard_input, unhold_keyboard_input, kbd_on_hold_p):
 +      Leave only one implementation.
 +      (Fget_buffer_process, Fprocess_inherit_coding_system_flag)
 +      (kill_buffer_processes, Flist_system_processes)
 +      (Fprocess_attributes, init_process, syms_of_process): Unify the
 +      implementations for with subprocesses and without them.
 +
 +2010-07-09  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xmenu.c (set_frame_menubar): Must realize menubar_widget to get the
 +      correct size for Motif.
 +      (free_frame_menubar): Call x_set_window_size to update frame size.
 +
 +      * xfns.c (x_window): Set borderWidth to 0 for pane and
 +      EmacsFrame.  Frame size calculation is wrong otherwise.
 +
 +2010-07-09  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * dbusbind.c (xd_initialize): Add new argument RAISE_ERROR, which
 +      allows to suppress errors when polling in Emacs' main loop.
 +      (Fdbus_init_bus, Fdbus_get_unique_name, Fdbus_call_method)
 +      (Fdbus_call_method_asynchronously, Fdbus_method_return_internal)
 +      (Fdbus_method_error_internal, Fdbus_send_signal)
 +      (xd_get_dispatch_status, xd_read_message, Fdbus_register_signal)
 +      (Fdbus_register_method): Use it.  (Bug#6579)
 +
 +2010-07-08  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * alloc.c: Convert DEFUNs to standard C.
 +      * buffer.c:
 +      * bytecode.c:
 +      * callint.c:
 +      * callproc.c:
 +      * casefiddle.c:
 +      * casetab.c:
 +      * category.c:
 +      * character.c:
 +      * charset.c:
 +      * chartab.c:
 +      * cmds.c:
 +      * coding.c:
 +      * composite.c:
 +      * data.c:
 +      * dbusbind.c:
 +      * dired.c:
 +      * dispnew.c:
 +      * doc.c:
 +      * dosfns.c:
 +      * editfns.c:
 +      * emacs.c:
 +      * eval.c:
 +      * fileio.c:
 +      * filelock.c:
 +      * floatfns.c:
 +      * fns.c:
 +      * font.c:
 +      * fontset.c:
 +      * frame.c:
 +      * fringe.c:
 +      * image.c:
 +      * indent.c:
 +      * insdel.c:
 +      * keyboard.c:
 +      * keymap.c:
 +      * lread.c:
 +      * macros.c:
 +      * marker.c:
 +      * menu.c:
 +      * minibuf.c:
 +      * msdos.c:
 +      * nsfns.m:
 +      * nsmenu.m:
 +      * nsselect.m:
 +      * print.c:
 +      * process.c:
 +      * search.c:
 +      * sound.c:
 +      * syntax.c:
 +      * term.c:
 +      * terminal.c:
 +      * textprop.c:
 +      * undo.c:
 +      * w16select.c:
 +      * w32console.c:
 +      * w32fns.c:
 +      * w32font.c:
 +      * w32menu.c:
 +      * w32proc.c:
 +      * w32select.c:
 +      * window.c:
 +      * xdisp.c:
 +      * xfaces.c:
 +      * xfns.c:
 +      * xmenu.c:
 +      * xselect.c:
 +      * xsettings.c:
 +      * xsmfns.c: Likewise.
 +
 +2010-07-08  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * process.c (kbd_is_on_hold, hold_keyboard_input)
 +      (unhold_keyboard_input, kbd_on_hold_p) [!subprocesses]: Define.
 +
 +2010-07-08  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
 +      (create_and_show_dialog): Don't call apply_systemfont_to_(menu|dialog)
 +      unless USE_LUCID.
 +
 +2010-07-08  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * xdisp.c (store_mode_line_noprop_char): Remove K&R alternative
 +      declaration.
 +
 +      Clean up include guards.
 +      * tparam.c: Remove include guards for config.h, string.h and code
 +      that assumes #ifndef emacs.
 +      * termcap.c:
 +      * unexalpha.c:
 +      * sysdep.c:
 +      * filemode.c:
 +      * filelock.c:
 +      * bidi.c: Likewise.
 +
 +      Remove prefix-args.c
 +      * prefix-args.c: Remove file.
 +      * autodeps.mk (ALLOBJS): Remove reference to prefix-args.
 +      * Makefile.in (temacs${EXEEXT}): Remove references to
 +      PRE_EDIT_LDFLAGS and POST_EDIT_LDFLAGS.
 +      (mostlyclean): Remove reference to prefix-args.
 +      (prefix-args): Remove.
 +
 +      Simplify cstart_of_data, start_of_code and related code.
 +      * mem-limits.h: Remove !emacs and _LIBC conditional code.
 +      (start_of_data): Merge into start_of_data function.
 +      * sysdep.c (start_of_text): Remove.  Move simplified versions of
 +      it in the only users: unexaix.c and unexec.c.
 +      (read_input_waiting): Remove local declaration of quit_char.
 +      (start, etext): Remove declarations.
 +      (start_of_data): Merge with the version in mem-limits.h and move
 +      to vm-limits.c.
 +      * vm-limit.c (start_of_data): Merged and simplified version of the
 +      code formerly in mem-limits.h and sysdep.c.
 +      * unexec.c (start): New declaration, moved from sysdep.c.
 +      (start_of_text): Simplified version of the code formerly in sysdep.c.
 +      * unexaix.c (start_of_text): Simplified version of the code
 +      formerly in sysdep.c.
 +      * m/alpha.h (HAVE_TEXT_START): Remove.
 +      (TEXT_START): Move ...
 +      * unexalpha.c (TEXT_START): ... here.
 +      * s/hpux10-20.h (TEXT_START): Remove.
 +      * s/darwin.h (TEXT_START):
 +      * m/mips.h (TEXT_START):
 +      * m/macppc.h (HAVE_TEXT_START):
 +      * m/m68k.h (TEXT_START):
 +      * m/iris4d.h (TEXT_START):
 +      * m/intel386.h (TEXT_START):
 +      * m/ibmrs6000.h (TEXT_START):
 +      * m/ia64.h (HAVE_TEXT_START):
 +      * s/msdos.h (TEXT_START): Likewise.
 +
 +2010-07-07  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * alloc.c (overrun_check_malloc, overrun_check_realloc)
 +      (overrun_check_free, xstrdup, allocate_string)
 +      (allocate_string_data, compact_small_strings, Fmake_string)
 +      (make_unibyte_string, make_multibyte_string)
 +      (make_string_from_bytes, make_specified_string, make_float)
 +      (Fcons, allocate_terminal, allocate_frame, make_pure_string)
 +      (Fgarbage_collect): Replace bcopy, safe_bcopy, bzero, bcmp by
 +      memcpy, memmove, memset, memcmp.
 +      * atimer.c (start_atimer, set_alarm): Likewise.
 +      * buffer.c (clone_per_buffer_values, report_overlay_modification)
 +      (mmap_realloc, init_buffer_once): Likewise.
 +      * callint.c (Fcall_interactively): Likewise.
 +      * callproc.c (Fcall_process, Fcall_process_region, child_setup)
 +      (getenv_internal_1): Likewise.
 +      * casefiddle.c (casify_object): Likewise.
 +      * ccl.c (ccl_driver): Likewise.
 +      * character.c (str_as_multibyte, str_to_multibyte): Likewise.
 +      * charset.c (load_charset_map_from_file)
 +      (load_charset_map_from_file, load_charset_map_from_vector)
 +      (Fdefine_charset_internal): Likewise.
 +      * cm.c (Wcm_clear): Likewise.
 +      * coding.c (decode_eol, decode_coding_object)
 +      (Fset_coding_system_priority, make_subsidiaries): Likewise.
 +      * data.c (Faset): Likewise.
 +      * dired.c (directory_files_internal, file_name_completion_stat):
 +      Likewise.
 +      * dispnew.c (new_glyph_matrix, adjust_glyph_matrix)
 +      (clear_glyph_row, copy_row_except_pointers)
 +      (copy_glyph_row_contents, new_glyph_pool, realloc_glyph_pool)
 +      (save_current_matrix, restore_current_matrix)
 +      (build_frame_matrix_from_leaf_window, mirrored_line_dance)
 +      (mirror_line_dance, scrolling_window): Likewise.
 +      * doc.c (Fsnarf_documentation, Fsubstitute_command_keys):
 +      Likewise.
 +      * doprnt.c (doprnt): Likewise.
 +      * editfns.c (Fuser_full_name, make_buffer_string_both)
 +      (Fmessage_box, Fformat, Ftranspose_regions): Likewise.
 +      * emacs.c (sort_args): Likewise.
 +      * eval.c (Fapply, Ffuncall): Likewise.
 +      * fileio.c (Ffile_name_directory, make_temp_name)
 +      (Fexpand_file_name, search_embedded_absfilename)
 +      (Fsubstitute_in_file_name, Ffile_symlink_p, Finsert_file_contents)
 +      (auto_save_error): Likewise.
 +      * fns.c (Fstring_equal, Fcopy_sequence, concat)
 +      (string_to_multibyte, Fstring_as_unibyte, Fstring_as_multibyte)
 +      (internal_equal, Fclear_string, larger_vector, copy_hash_table)
 +      (Fmake_hash_table): Likewise.
 +      * fringe.c (Fdefine_fringe_bitmap): Likewise.
 +      * ftfont.c (ftfont_text_extents): Likewise.
 +      * getloadavg.c (getloadavg): Likewise.
 +      * image.c (define_image_type, make_image, make_image_cache)
 +      (x_create_x_image_and_pixmap, xbm_image_p)
 +      (w32_create_pixmap_from_bitmap_data, xbm_load, xpm_lookup_color)
 +      (xpm_image_p, x_create_bitmap_from_xpm_data, xpm_load)
 +      (init_color_table, x_build_heuristic_mask, pbm_image_p, pbm_load)
 +      (png_image_p, png_read_from_memory, png_load, jpeg_image_p)
 +      (tiff_image_p, tiff_read_from_memory, gif_image_p)
 +      (gif_read_from_memory, gif_load, svg_image_p, gs_image_p):
 +      Likewise.
 +      * indent.c (scan_for_column, compute_motion): Likewise.
 +      * insdel.c (gap_left, gap_right, make_gap_smaller, copy_text)
 +      (insert_1_both, insert_from_gap, replace_range_2): Likewise.
 +      * intervals.c (reproduce_tree, reproduce_tree_obj): Likewise.
 +      * keyboard.c (echo_char, save_getcjmp, restore_getcjmp)
 +      (kbd_buffer_store_event_hold, apply_modifiers_uncached)
 +      (store_user_signal_events, menu_bar_items, tool_bar_items)
 +      (process_tool_bar_item, append_tool_bar_item)
 +      (read_char_minibuf_menu_prompt, read_key_sequence)
 +      (Fread_key_sequence, Fread_key_sequence_vector, Frecent_keys):
 +      Likewise.
 +      * keymap.c (current_minor_maps, Fdescribe_buffer_bindings):
 +      Likewise.
 +      * lisp.h (STRING_COPYIN): Likewise.
 +      * lread.c (Fload, read1, oblookup): Likewise.
 +      * msdos.c (Frecent_doskeys): Likewise.
 +      * nsfns.m (Fx_create_frame): Likewise.
 +      * nsfont.m (nsfont_open, nsfont_text_extents, ns_glyph_metrics):
 +      Likewise.
 +      * nsimage.m (EmacsImage-initFromSkipXBM:width:height:)
 +      (EmacsImage-initForXPMWithDepth:width:height:flip:length:):
 +      Likewise.
 +      * nsmenu.m (ns_update_menubar): Likewise.
 +      * nsterm.m (ns_draw_fringe_bitmap, ns_term_init): Likewise.
 +      * print.c (print_unwind, printchar, strout, print_string)
 +      (print_error_message): Likewise.
 +      * process.c (conv_lisp_to_sockaddr, set_socket_option)
 +      (Fmake_network_process, Fnetwork_interface_list)
 +      (Fnetwork_interface_info, read_process_output, Fprocess_send_eof)
 +      (init_process): Likewise.
 +      * ralloc.c (resize_bloc, r_alloc_sbrk, r_alloc_init): Likewise.
 +      * regex.c (init_syntax_once, regex_compile, re_compile_fastmap):
 +      Likewise.
 +      * scroll.c (do_scrolling, do_direct_scrolling)
 +      (scrolling_max_lines_saved): Likewise.
 +      * search.c (search_buffer, wordify, Freplace_match): Likewise.
 +      * sound.c (wav_init, au_init, Fplay_sound_internal): Likewise.
 +      * syntax.c (skip_chars, skip_syntaxes): Likewise.
 +      * sysdep.c (child_setup_tty, sys_subshell, emacs_get_tty)
 +      (emacs_set_tty): Likewise.
 +      * term.c (encode_terminal_code, calculate_costs)
 +      (produce_special_glyphs, create_tty_output, init_tty, delete_tty):
 +      Likewise.
 +      * termcap.c (tgetst1, gobble_line): Likewise.
 +      * termhooks.h (EVENT_INIT): Likewise.
 +      * tparam.c (tparam1): Likewise.
 +      * unexalpha.c (unexec): Likewise.
 +      * unexec.c (write_segment): Likewise.
 +      * unexmacosx.c (unexec_write_zero): Likewise.
 +      * w32fns.c (w32_wnd_proc, Fx_create_frame, x_create_tip_frame)
 +      (Fx_file_dialog, Fsystem_move_file_to_trash): Likewise.
 +      * w32font.c (w32font_list_family, w32font_text_extents)
 +      (w32font_list_internal, w32font_match_internal)
 +      (w32font_open_internal, compute_metrics, Fx_select_font):
 +      Likewise.
 +      * w32menu.c (set_frame_menubar, add_menu_item)
 +      (w32_menu_display_help, w32_free_submenu_strings): Likewise.
 +      * w32term.c (XCreateGC, w32_initialize_display_info): Likewise.
 +      * w32uniscribe.c (uniscribe_list_family): Likewise.
 +      * w32xfns.c (get_next_msg, post_msg, prepend_msg): Likewise.
 +      * window.c (make_window, replace_window, set_window_buffer)
 +      (Fsplit_window): Likewise.
 +      * xdisp.c (init_iterator, RECORD_OVERLAY_STRING, reseat_to_string)
 +      (add_to_log, message3, x_consider_frame_title)
 +      (append_space_for_newline, extend_face_to_end_of_line)
 +      (decode_mode_spec_coding, init_glyph_string): Likewise.
 +      * xfaces.c (x_create_gc, get_lface_attributes_no_remap)
 +      (Finternal_copy_lisp_face, Finternal_merge_in_global_face)
 +      (face_attr_equal_p, make_realized_face, make_face_cache)
 +      (free_realized_faces, lookup_named_face, smaller_face)
 +      (face_with_height, lookup_derived_face)
 +      (x_supports_face_attributes_p, Finternal_set_font_selection_order)
 +      (Finternal_set_font_selection_order, realize_default_face)
 +      (compute_char_face, face_at_buffer_position)
 +      (face_for_overlay_string, face_at_string_position, merge_faces):
 +      Likewise.
 +      * xfns.c (xic_create_fontsetname, Fx_create_frame)
 +      (Fx_window_property, x_create_tip_frame)
 +      (Fx_backspace_delete_keys_p): Likewise.
 +      * xfont.c (xfont_list, xfont_match, xfont_list_family)
 +      (xfont_text_extents): Likewise.
 +      * xmenu.c (set_frame_menubar, xmenu_show): Likewise.
 +      * xrdb.c (magic_file_p, x_get_resource): Likewise.
 +      * xselect.c (x_queue_event, x_get_window_property)
 +      (receive_incremental_selection): Likewise.
 +      * xsmfns.c (x_session_check_input): Likewise.
 +      * xterm.c (x_send_scroll_bar_event, SET_SAVED_MENU_EVENT)
 +      (handle_one_xevent, x_check_errors, xim_initialize, x_term_init):
 +      Likewise.
 +      * character.h (BCOPY_SHORT): Removed.
 +      * config.in: Regenerate.
 +      * dispnew.c (safe_bcopy): Only define as dummy if PROFILING.
 +      * emacs.c (main) [PROFILING]: Don't declare
 +      dump_opcode_frequencies.
 +      * lisp.h (safe_bcopy): Remove declaration.
 +      (memset) [!HAVE_MEMSET]: Declare.
 +      (memcpy) [!HAVE_MEMCPY]: Likewise.
 +      (memmove) [!HAVE_MEMMOVE]: Likewise.
 +      (memcmp) [!HAVE_MEMCMP]: Likewise.
 +      * s/ms-w32.h (bzero, bcopy, bcmp, GAP_USE_BCOPY)
 +      (BCOPY_UPWARD_SAFE, BCOPY_DOWNWARD_SAFE, HAVE_BCOPY, HAVE_BCMP):
 +      Don't define.
 +      (HAVE_MEMCMP, HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET): Define.
 +      * s/msdos.h (GAP_USE_BCOPY, BCOPY_UPWARD_SAFE)
 +      (BCOPY_DOWNWARD_SAFE): Don't define.
 +      * sysdep.c (memset) [!HAVE_MEMSET]: Define.
 +      (memcpy) [!HAVE_MEMCPY]: Define.
 +      (memmove) [!HAVE_MEMMOVE]: Define.
 +      (memcmp) [!HAVE_MEMCMP]: Define.
 +
 +2010-07-07  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * process.c (kbd_is_on_hold): New variable.
 +      (hold_keyboard_input, unhold_keyboard_input, kbd_on_hold_p):
 +      New functions.
 +      (wait_reading_process_output): If kbd_on_hold_p returns non-zero,
 +      select on empty input mask.
 +      (init_process): Initialize kbd_is_on_hold to 0.
 +
 +      * process.h (hold_keyboard_input, unhold_keyboard_input)
 +      (kbd_on_hold_p): Declare.
 +
 +      * keyboard.c (input_available_signal): Declare.
 +      (kbd_buffer_nr_stored): New function.
 +      (kbd_buffer_store_event_hold): If kbd_buffer_nr_stored returns
 +      more than KBD_BUFFER_SIZE/2, stop reding input (Bug#6571).
 +      (kbd_buffer_get_event): If input is suspended and kbd_buffer_nr_stored
 +      returns less than KBD_BUFFER_SIZE/4, resume reding input (Bug#6571).
 +      (tty_read_avail_input): If input is on hold, return.
 +      Don't read more that free slots in kbd_buffer (Bug#6571).
 +
 +2010-07-07  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * msdos.h:
 +      * msdos.c:
 +      * dosfns.c:
 +      * w16select.c: Convert function definitions to ANSI C.
 +
 +      * msdos.h (ctrl_break_func, install_ctrl_break_check):
 +      Remove unused prototypes.
 +
 +2010-07-07  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * coding.c, sysdep.c: Convert some more functions to standard C.
 +
 +2010-07-07  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * coding.c (decode_coding_gap, encode_coding_gap, decode_coding_object)
 +      (encode_coding_object): Use SPECPDL_INDEX.
 +      (syms_of_coding): Use DOS_NT.
 +
 +2010-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * intervals.h (interval): Use EMACS_UINT instead of unsigned EMACS_INT.
 +
 +      Make the function member of Lisp_Subr use standard C prototypes.
 +      * lisp.h (struct Lisp_Subr): Use a union for the function member.
 +      (DECL_ALIGN): Add a cast for the function.
 +      * eval.c (Feval, Ffuncall): Use the proper type for each type
 +      function call.
 +
 +2010-07-06  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * fringe.c (draw_fringe_bitmap_1): Use lookup_named_face to get
 +      fringe face id, so face-remapping-alist works (Bug#6091).
 +
 +2010-07-06  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * w32.c, w32console.c, w32fns.c, w32font.c, w32heap.c, w32inevt.c
 +      * w32menu.c, w32proc.c, w32reg.c, w32select.c, w32term.c
 +      * w32uniscribe.c, w32xfns.c: Convert function definitions to standard C.
 +
 +2010-07-06  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * xterm.c (x_get_keysym_name): Change type of parameter to int.
 +      * lisp.h: Declare x_get_keysym_name.
 +      * keyboard.c (modify_event_symbol): Don't declare
 +      x_get_keysym_name here.
 +
 +2010-07-06  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * ecrt0.c: Revert conversion to standard C.
 +
 +2010-07-05  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * vm-limit.c (memory_warnings):
 +      * keyboard.c (modify_event_symbol):
 +      * floatfns.c (rounding_driver, ceiling2, floor2, truncate2)
 +      (round2, emacs_rint):
 +      * process.c (send_process, old_sigpipe): Convert function
 +      definitions and declarations to standard C.
 +
 +2010-07-05  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * buffer.c, cm.c, eval.c, keyboard.c, process.c, term.c, vm-limit.c,
 +      * xdisp.c: Convert function definitions to standard C.
 +
 +      * cm.c (cmputc): Arg C is now int, not char.
 +      * process.c (Fmake_network_process): Cast sockaddr_in* to sockaddr*.
 +
 +2010-07-05  James Cloos  <cloos@jhcloos.com>
 +
 +      * xterm.h (Xatom_net_wm_name, Xatom_net_wm_icon_name): New.
 +
 +      * xterm.c (x_term_init): Intern the _NET_WM_NAME and
 +      _NET_WM_ICON_NAME atoms.
 +
 +      * xfns.c (x_set_name_internal): Set the EWMH _NET_WM_NAME
 +      and _NET_WM_ICON_NAME properties, too, matching what is
 +      done in the Gtk+ case.
 +
 +2010-07-05  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.c (XTring_bell, XTset_terminal_window): Fix wrong prototype.
 +
 +      * xsmfns.c (SSDATA): New macro.
 +      (smc_save_yourself_CB, x_session_initialize): Use SSDATA for strings
 +      passed to strlen/strcpy/strcat.
 +      (create_client_leader_window): Surround with #ifndef USE_GTK.
 +      Cast 7:th arg to XChangeProperty to (unsigned char *).
 +
 +      * xsettings.c (something_changedCB, parse_settings)
 +      (apply_xft_settings): Reformat prototype.
 +      (something_changedCB, init_gconf): Remove unused variable i.
 +      (read_settings): Remove unused variable long_len.
 +
 +      * gtkutil.c (xg_get_pixbuf_from_pix_and_mask)
 +      (xg_get_image_for_pixmap, create_dialog)
 +      (xg_get_file_with_selection, xg_get_file_name, update_cl_data)
 +      (menuitem_highlight_callback, make_menu_item)
 +      (xg_create_one_menuitem, create_menus, xg_update_menu_item)
 +      (xg_create_scroll_bar, xg_update_scrollbar_pos)
 +      (xg_set_toolkit_scroll_bar_thumb, xg_tool_bar_button_cb)
 +      (xg_tool_bar_proxy_help_callback, xg_tool_bar_detach_callback)
 +      (xg_tool_bar_attach_callback, xg_tool_bar_help_callback)
 +      (xg_tool_bar_item_expose_callback): Reformat prototype.
 +      (xg_update_menubar): GList *group => GSList *group.
 +      (xg_modify_menubar_widgets): Initialize witem to 0, check witem != 0
 +      before use.
 +      (update_frame_tool_bar): 4:th param to xg_get_image_for_pixmap changed
 +      to GTK_IMAGE (wimage).
 +
 +2010-07-05  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * atimer.c: Use "" instead of <> for local includes for
 +      consistency with the rest of the code.
 +
 +      * xsmfns.c (smc_save_yourself_CB, smc_error_handler):
 +      * xrdb.c (get_system_name):
 +      * window.c (shrink_windows):
 +      * syntax.c (forw_comment):
 +      * scroll.c (calculate_scrolling, calculate_direct_scrolling)
 +      (ins_del_costs):
 +      * mem-limits.h (start_of_data):
 +      * lread.c (readevalloop):
 +      * gtkutil.c (xg_dialog_response_cb, xg_get_file_with_chooser)
 +      (xg_get_file_with_selection, xg_update_menubar, xg_update_submenu):
 +      * frame.c (x_get_focus_frame):
 +      * floatfns.c (fmod_float):
 +      * fileio.c (choose_write_coding_system):
 +      * emacs.c (fatal_error_signal, init_cmdargs, argmatch)
 +      (malloc_initialize_hook, sort_args, synchronize_locale):
 +      * doprnt.c (doprnt):
 +      * dired.c (compile_pattern):
 +      * data.c (fmod_float):
 +      * chartab.c (map_sub_char_table, map_sub_char_table_for_charset)
 +      (map_char_table_for_charset):
 +      * charset.c (define_charset_internal):
 +      * alloc.c (Fgarbage_collect): Convert declarations or definitions
 +      to standard C.
 +
 +2010-07-04  Tetsurou Okazaki  <okazaki@be.to>  (tiny change)
 +            Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * lread.c (read1): Fix up last change to not mess up `c'.
 +
 +2010-07-04  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * strftime.c: Revert conversion to standard C (2010-07-04T07:50:25Z!dann@ics.uci.edu).
 +
 +2010-07-04  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      Fix prototypes.
 +
 +      * atimer.c (start_atimer): Use EMACS_TIME, not struct timeval.
 +      * dired.c (file_name_completion_stat): Use DIRENTRY, not struct dirent.
 +      * fileio.c (read_non_regular, read_non_regular_quit): Add Lisp_Object
 +      arg, as required by internal_condition_case_1.
 +      * print.c (strout): Use const char* for arg PTR.
 +      * regex.c (bcmp_translate): Use RE_TRANSLATE_TYPE, not Lisp_Object.
 +      (analyse_first): Fix "const const".
 +      * sysdep.c (set_file_times): Use EMACS_TIME, not struct timeval.
 +      * unexelf.c (round_up, find_section): Use ElfW macro for arguments.
 +      * xgselect.c (xg_select): Use SELECT_TYPE, EMACS_TIME.
 +
 +2010-07-04  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * alloc.c: Convert function definitions to standard C.
 +      * atimer.c:
 +      * bidi.c:
 +      * bytecode.c:
 +      * callint.c:
 +      * callproc.c:
 +      * casefiddle.c:
 +      * casetab.c:
 +      * category.c:
 +      * ccl.c:
 +      * character.c:
 +      * charset.c:
 +      * chartab.c:
 +      * cmds.c:
 +      * coding.c:
 +      * composite.c:
 +      * data.c:
 +      * dbusbind.c:
 +      * dired.c:
 +      * dispnew.c:
 +      * doc.c:
 +      * doprnt.c:
 +      * ecrt0.c:
 +      * editfns.c:
 +      * fileio.c:
 +      * filelock.c:
 +      * filemode.c:
 +      * fns.c:
 +      * font.c:
 +      * fontset.c:
 +      * frame.c:
 +      * fringe.c:
 +      * ftfont.c:
 +      * ftxfont.c:
 +      * gtkutil.c:
 +      * indent.c:
 +      * insdel.c:
 +      * intervals.c:
 +      * keymap.c:
 +      * lread.c:
 +      * macros.c:
 +      * marker.c:
 +      * md5.c:
 +      * menu.c:
 +      * minibuf.c:
 +      * prefix-args.c:
 +      * print.c:
 +      * ralloc.c:
 +      * regex.c:
 +      * region-cache.c:
 +      * scroll.c:
 +      * search.c:
 +      * sound.c:
 +      * strftime.c:
 +      * syntax.c:
 +      * sysdep.c:
 +      * termcap.c:
 +      * terminal.c:
 +      * terminfo.c:
 +      * textprop.c:
 +      * tparam.c:
 +      * undo.c:
 +      * unexelf.c:
 +      * window.c:
 +      * xfaces.c:
 +      * xfns.c:
 +      * xfont.c:
 +      * xftfont.c:
 +      * xgselect.c:
 +      * xmenu.c:
 +      * xrdb.c:
 +      * xselect.c:
 +      * xsettings.c:
 +      * xsmfns.c:
 +      * xterm.c: Likewise.
 +
 +2010-07-03  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * msdos.c (IT_set_frame_parameters): Fix setting of colors in
 +      frames other than the initial one.  Fix reversal of colors when
 +      `reverse' is specified in the frame parameters.
 +      Call update_face_from_frame_parameter instead of
 +      internal-set-lisp-face-attribute.  Initialize screen colors from
 +      initial_screen_colors[] when f->default_face_done_p is zero,
 +      instead of depending on being called with default-frame-alist as
 +      the alist argument.
 +
 +      * xfaces.c (update_face_from_frame_parameter): Move out of
 +      HAVE_WINDOW_SYSTEM portion.  Condition window-system only parts
 +      with HAVE_WINDOW_SYSTEM.
 +
 +      * msdos.c (IT_set_frame_parameters): Set menu-bar-lines according
 +      to menu-bar-mode, if not set in the frame parameters or in
 +      default-frame-alist.
 +
 +      * w32console.c (sys_tputs): Adjust argument list to prototype in
 +      term.c.
 +
 +2010-07-03  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * lisp.h (memory_warnings): Fix prototype.
 +
 +      * cm.h (evalcost): Fix prototype.
 +
 +      * cm.c (evalcost): Fix arg type.
 +
 +2010-07-02  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * term.c (term_clear_mouse_face, Fidentity):
 +      * syssignal.h (signal_handler_t):
 +      * lisp.h (memory_warnings):
 +      * coding.h (preferred_coding_system):
 +      * cm.h (evalcost):
 +      * blockinput.h (reinvoke_input_signal): Convert to standard C prototypes.
 +
 +2010-07-02  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * dosfns.h (msdos_stdcolor_idx, msdos_stdcolor_name): Remove P_
 +      from prototypes.
 +
 +      * msdos.h (load_pixmap): Don't define away.
 +
 +2010-07-02  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * lisp.h:
 +      * atimer.h: Remove define for P_.
 +
 +      * alloc.c: Remove __P and P_ from .c and .m files.
 +      * atimer.c:
 +      * buffer.c:
 +      * callint.c:
 +      * category.c:
 +      * charset.c:
 +      * chartab.c:
 +      * cm.c:
 +      * coding.c:
 +      * composite.c:
 +      * data.c:
 +      * dired.c:
 +      * dispnew.c:
 +      * doc.c:
 +      * editfns.c:
 +      * emacs.c:
 +      * eval.c:
 +      * fileio.c:
 +      * filelock.c:
 +      * fns.c:
 +      * font.c:
 +      * fontset.c:
 +      * frame.c:
 +      * ftfont.c:
 +      * ftxfont.c:
 +      * gmalloc.c:
 +      * gtkutil.c:
 +      * image.c:
 +      * indent.c:
 +      * intervals.c:
 +      * keyboard.c:
 +      * keymap.c:
 +      * lread.c:
 +      * marker.c:
 +      * menu.c:
 +      * minibuf.c:
 +      * print.c:
 +      * process.c:
 +      * scroll.c:
 +      * search.c:
 +      * sound.c:
 +      * strftime.c:
 +      * syntax.c:
 +      * sysdep.c:
 +      * term.c:
 +      * terminal.c:
 +      * textprop.c:
 +      * unexalpha.c:
 +      * w32console.c:
 +      * w32fns.c:
 +      * w32font.c:
 +      * w32menu.c:
 +      * w32term.c:
 +      * w32uniscribe.c:
 +      * window.c:
 +      * xdisp.c:
 +      * xfaces.c:
 +      * xfns.c:
 +      * xfont.c:
 +      * xftfont.c:
 +      * xmenu.c:
 +      * xselect.c:
 +      * xterm.c: Likewise.
 +
 +      Remove P_ and __P macros.
 +      * atimer.h: Remove P_ and __P macros.
 +      * buffer.h:
 +      * category.h:
 +      * ccl.h:
 +      * character.h:
 +      * charset.h:
 +      * cm.h:
 +      * coding.h:
 +      * composite.h:
 +      * dispextern.h:
 +      * disptab.h:
 +      * dosfns.h:
 +      * font.h:
 +      * fontset.h:
 +      * frame.h:
 +      * gtkutil.h:
 +      * indent.h:
 +      * intervals.h:
 +      * keyboard.h:
 +      * keymap.h:
 +      * lisp.h:
 +      * macros.h:
 +      * md5.h:
 +      * menu.h:
 +      * msdos.h:
 +      * nsterm.h:
 +      * puresize.h:
 +      * region-cache.h:
 +      * syntax.h:
 +      * syssignal.h:
 +      * systime.h:
 +      * termhooks.h:
 +      * w32font.h:
 +      * w32term.h:
 +      * widget.h:
 +      * window.h:
 +      * xgselect.h:
 +      * xsettings.h:
 +      * xterm.h: Likewise.
 +
 +2010-07-02  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * lisp.h: Document that USE_LISP_UNION_TYPE is now enabled using autoconf.
 +
 +      Cleanup old code.
 +      * dired.c (BSD4_3): Remove all uses, redundant with BSD4_2.
 +      * syssignal.h: Remove code for Lynx, not supported anymore.
 +      * vm-limit.c: Remove unused code the depends on emacs not being
 +      defined and NO_LIM_DATA being defined.
 +      * mem-limits.h: Remove dead code.
 +
 +2010-07-01  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * window.c (Fwindow_absolute_pixel_edges): Doc fix.
 +
 +      * window.c (calc_absolute_offset, Fwindow_absolute_pixel_edges)
 +      (Fwindow_inside_absolute_pixel_edges): New functions (bug#5721).
 +
 +      * nsfns.m (compute_tip_xy): Do not convert coordinates from frame
 +      parameters, they are already absolute.
 +
 +      * nsterm.m (x_set_window_size, initFrameFromEmacs):
 +      Rename FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT.
 +
 +      * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGHT.
 +
 +      * nsmenu.m (update_frame_tool_bar, free_frame_tool_bar):
 +      Update FRAME_TOOLBAR_HEIGHT.
 +
 +      * nsmenu.m (free_frame_tool_bar, update_frame_tool_bar):
 +      Add BLOCK/UNBLOCK_INPUT so asserts don't trigger.
 +
 +2010-06-30  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * frame.c (get_future_frame_param, Fmake_terminal_frame):
 +      Don't check default-frame-alist.
 +
 +2010-06-30  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * process.c (create_process): Avoid using invalid file descriptors.
 +
 +      * callproc.c (child_setup): Avoid closing a file descriptor twice.
 +
 +2010-06-30  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
 +      Improve documentation.  Return font regardless of use_system_font.
 +      (syms_of_xsettings): Improve documentation for font-use-system-font.
 +
 +2010-07-10  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xfaces.c (realize_face): Garbage the frame if a face is removed
 +      (Bug#6593).
 +
 +2010-07-05  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * keyboard.c: Remove duplicate <setjmp.h>.
 +      (read_key_sequence): Remove volatile qualifiers.
 +
 +2010-07-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +
 +      * dispextern.h (FRINGE_HEIGHT_BITS): New define.
 +      (struct glyph_row): New members left_fringe_offset and
 +      right_fringe_offset.
 +
 +      * xterm.c (x_draw_fringe_bitmap): Don't clip bottom aligned bitmap
 +      specially.
 +      * w32term.c (w32_draw_fringe_bitmap): Likewise.
 +      * nsterm.m (ns_draw_fringe_bitmap): Likewise.
 +
 +      * fringe.c (draw_fringe_bitmap_1): Don't clip bitmap here.
 +      Take account of bitmap offset.
 +      (draw_window_fringes): Take account of window vscroll.
 +      (update_window_fringes): Likewise.  Extend top-aligned top indicator
 +      or bottom-aligned bottom indicator to adjacent rows if it doesn't fit
 +      in one row.  Don't set redraw_fringe_bitmaps_p outside row comparison.
 +      Set left_fringe_offset and right_fringe_offset (Bug#5634, Bug#6325).
 +
 +2010-07-04  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * w32fns.c (Qtooltip): Declare.
 +      Suggested by Andy Moreton <andrewjmoreton@gmail.com>.
 +
 +2010-07-03  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xmenu.c (x_activate_menubar): Send Press/Release for Gtk+ to avoid
 +      grab on just Press (Bug#6499).
 +
 +2010-07-02  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * frame.c (Qtooltip): New var.
 +      (delete_frame): Use it.  Fix faulty if statement.  Don't update
 +      mode line for tooltip frames.  Suggested by Martin Rudalics.
 +
 +      * xfns.c (x_create_tip_frame):
 +      * w32fns.c (x_create_tip_frame): Use it.
 +
 +2010-06-17  Naohiro Aota  <naota@elisp.net>  (tiny change)
 +
 +      * xftfont.c (xftfont_open): Check font width one by one also when
 +      spacing is dual.
 +
 +      * ftfont.c (ftfont_open): Ditto.
 +
 +2010-06-30  Glenn Morris  <rgm@gnu.org>
 +
 +      * s/sol2-6.h (INHIBIT_X11R6_XIM): Remove, handled by configure now.
 +
 +      * Makefile.in (CANNOT_DUMP): Update for configure name change.
 +
 +      * s/freebsd.h (USE_MMAP_FOR_BUFFERS):
 +      * s/irix6-5.h (USE_MMAP_FOR_BUFFERS):
 +      * s/darwin.h (SYSTEM_MALLOC):
 +      * s/sol2-10.h (SYSTEM_MALLOC): Move to configure.
 +
 +2010-06-29  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsfns.m: extern declare Vmenu_bar_mode, Vtool_bar_mode.
 +      (ns_get_screen): Don't assign integer to f.
 +      (Fx_display_color_cells): Declarations before statements.
 +
 +2010-06-28  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xfns.c (x_default_font_parameter): Remove got_from_system
 +      (Bug#6526).
 +
 +      * xterm.h (gtk_widget_get_window, gtk_widget_get_mapped)
 +      (gtk_adjustment_get_page_size, gtk_adjustment_get_upper):
 +      New defines based on what configure finds.
 +
 +      * xterm.c (XTflash): Use gtk_widget_get_window.
 +      (xg_scroll_callback): Use gtk_adjustment_get_upper and
 +      gtk_adjustment_get_page_size.
 +      (handle_one_xevent): Use gtk_widget_get_mapped.
 +      (x_term_init): Remove HAVE_GTK_MULTIDISPLAY and associated error
 +      messages.
 +
 +      * xmenu.c (create_and_show_popup_menu): Call gtk_widget_get_mapped.
 +
 +      * gtkutil.h: Replace HAVE_GTK_FILE_BOTH with
 +      HAVE_GTK_FILE_SELECTION_NEW.
 +
 +      * gtkutil.c (xg_display_open, xg_display_close):
 +      Remove HAVE_GTK_MULTIDISPLAY, it is always defined.
 +      (xg_display_open): Return type is void.
 +      (gtk_widget_set_has_window)
 +      (gtk_dialog_get_action_area, gtk_dialog_get_content_area)
 +      (gtk_widget_get_sensitive, gtk_adjustment_set_page_size)
 +      (gtk_adjustment_set_page_increment)
 +      (gtk_adjustment_get_step_increment): #define these if not found
 +      by configure.
 +      (remove_submenu): New define based on Gtk+ version.
 +      (xg_set_cursor, xg_frame_resized, xg_event_is_for_scrollbar):
 +      Use gtk_widget_get_window.
 +      (xg_frame_resized, xg_update_frame_menubar): Use gtk_widget_get_mapped.
 +      (xg_create_frame_widgets): Use gtk_widget_set_has_window.
 +      (create_dialog): Use gtk_dialog_get_action_area and
 +      gtk_dialog_get_content_area.
 +      (xg_uses_old_file_dialog, xg_get_file_name): Remove HAVE_GTK_FILE_BOTH
 +      and HAVE_GTK_FILE_CHOOSER_DIALOG_NEW.  File chooser is always
 +      available, so checking for HAVE_GTK_FILE_SELECTION_NEW is enough.
 +      (xg_update_menubar, xg_update_submenu, xg_show_toolbar_item):
 +      Use g_object_ref and g_object_unref.
 +      (xg_update_menu_item, xg_tool_bar_menu_proxy):
 +      Use gtk_widget_get_sensitive.
 +      (xg_update_submenu): Use remove_submenu.
 +      (xg_update_scrollbar_pos): Don't use GtkFixedChild, use child
 +      properties instead to get old x and y position.
 +      (xg_set_toolkit_scroll_bar_thumb): Use gtk_adjustment_get_page_size,
 +      gtk_adjustment_get_step_increment, gtk_adjustment_set_page_size,
 +      gtk_adjustment_set_step_increment and gtk_adjustment_set_page_increment.
 +      (xg_get_tool_bar_widgets): New function.
 +      (xg_tool_bar_menu_proxy, xg_show_toolbar_item)
 +      (update_frame_tool_bar): Call xg_get_tool_bar_widgets.
 +      (toolbar_set_orientation): New #define based on if configure
 +      finds gtk_orientable_set_orientation.
 +      (xg_create_tool_bar): Call toolbar_set_orientation.
 +      (xg_make_tool_item, xg_show_toolbar_item): Call gtk_box_pack_start
 +      instead of gtk_box_pack_start_defaults.
 +
 +2010-06-28  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * cmds.c (Fdelete_backward_char): Move into Lisp.
 +
 +2010-06-27  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * s/freebsd.h (BSD4_2): Remove redundant definition.
 +      bsd-common.h defines it already.
 +
 +2010-06-27  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xfns.c (Fx_create_frame): Don't consult X resouces when setting
 +      menu-bar-lines and tool-bar-lines.  Use menu-bar-mode and
 +      tool-bar-mode, which are now set using these X resources at
 +      startup, to determine the defaults (Bug#2249).
 +
 +      * w32fns.c (Fx_create_frame):
 +      * nsfns.m (Fx_create_frame): Likewise.
 +
 +      * frame.c (Vmenu_bar_mode, Vtool_bar_mode): New vars.
 +
 +2010-06-24  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * gtkutil.c (xg_update_scrollbar_pos):
 +      Avoid C99 mid-block variable declaration.
 +
 +2010-06-22  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.c (x_scroll_bar_create): Remove call to xg_show_scroll_bar.
 +
 +      * gtkutil.h (xg_show_scroll_bar): Remove.
 +
 +      * gtkutil.c (xg_update_scrollbar_pos): Show/hide scroll bar as needed
 +      if height is less than scroll bar min size.
 +      (xg_show_scroll_bar): Remove, show moved to xg_update_scrollbar_pos.
 +
 +      * xfns.c (x_default_font_parameter): Try to open font from system
 +      before using it (bug#6478).  Rename got_from_gconf to got_from_system.
 +
 +2010-06-22  Keith Packard  <keithp@keithp.com>  (tiny change)
 +
 +      * font.c (font_parse_fcname): Allow . for sizes like 7.5 (bug#6437).
 +
 +2010-06-20  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c (try_scrolling): When scroll-conservatively is set to
 +      most-positive-fixnum, be extra accurate when scrolling window
 +      start, to avoid missing the cursor line.
 +
 +2010-06-19  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c (try_scrolling): Compute the limit for searching point
 +      in forward scroll from scroll_max, instead of an arbitrary limit
 +      of 10 screen lines.
 +      See http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00766.html
 +      and
 +      http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00773.html
 +      for details.
 +
 +2010-06-16  Glenn Morris  <rgm@gnu.org>
 +
 +      * editfns.c (Fbyte_to_string): Pacify compiler.
 +
 +2010-06-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * lread.c (read1): Phase out old-style backquotes a bit more.
 +
 +2010-06-12  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * makefile.w32-in ($(BLD)/bidi.$(O)): Depend on biditype.h and
 +      bidimirror.h.
 +
 +      * deps.mk (bidi.o): Depend on biditype.h and bidimirror.h.
 +
 +      * bidi.c (bidi_initialize): Remove explicit initialization of
 +      bidi_type_table; include biditype.h instead.  Don't support
 +      entries whose second codepoint is zero.  Initialize bidi_mirror_table.
 +      (bidi_mirror_char): Use bidi_mirror_table.
 +
 +      * biditype.h: New file.
 +
 +      * bidimirror.h: New file.
 +
 +      * window.c (syms_of_window): Doc fix (bug#6409).
 +
 +2010-06-12  Romain Francoise  <romain@orebokech.com>
 +
 +      * Makefile.in (lisp, shortlisp): Use new location of vc-hooks and
 +      ediff-hook.
 +
 +2010-06-10  Glenn Morris  <rgm@gnu.org>
 +
 +      * editfns.c (Fbyte_to_string): Pacify compiler.
 +
 +      * m/ibms390x.h: Rather than duplicating ibms390.h, just include it.
 +
 +2010-06-26  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * alloc.c (Fmake_byte_code): Don't access undefined argument
 +      (Bug#6517).
 +
 +2010-06-25  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xdisp.c (next_element_from_image): Ensure that after-strings are
 +      read the next time we hit handle_stop (Bug#1336).
 +
 +2010-06-23  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * lread.c (read1): Signal error if #s is not followed by paren.
 +
 +2010-06-19  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * image.c (free_image): Mark frame as garbaged (Bug#6426).
 +
 +      * keymap.c (Fdefine_key): Doc fix (Bug#6460).
 +
 +2010-06-15  Glenn Morris  <rgm@gnu.org>
 +
 +      * editfns.c (Fbyte_to_string): Pacify compiler.
 +
 +2010-06-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * dbusbind.c (xd_append_arg): Don't "make-unibyte" the string.
 +      Check `object's type before accessing its guts.
 +
 +2010-06-09  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * s/usg5-4.h: Fix previous change.
 +      Suggested by Lawrence Mitchell <wence@gmx.li>
 +
 +2010-06-08  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * minibuf.c (Fall_completions): Add more checks.
 +
 +2010-06-08  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * minibuf.c (Fall_completions): Check COLLECTION's size (bug#6378).
 +
 +2010-06-08  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * lread.c (X_OK): Remove, unused.
 +
 +      * dispnew.c: Remove obsolete comment.
 +
 +      Remove INCLUDED_FCNTL.
 +      * xterm.c (INCLUDED_FCNTL):
 +      * callproc.c (INCLUDED_FCNTL):
 +      * alloc.c (INCLUDED_FCNTL):
 +      * systty.h (INCLUDED_FCNTL): Remove all uses, not needed anymore.
 +      (emacs_get_tty, emacs_set_tty): Declare unconditionally.
 +
 +2010-06-07  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.c (Fselect_window): Move `record_buffer' up to the
 +      beginning of this function, so the buffer gets recorded
 +      even if the selected window does not change.
 +      http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00137.html
 +
 +2010-06-07  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * cmds.c (Fforward_char, Fbackward_char): Fix typos in docstrings.
 +      (Fforward_line, Fbeginning_of_line): Reflow docstrings.
 +
 +2010-06-06  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove BSTRING related code, all platforms define it.
 +      * s/usg5-4.h (BSTRING): Remove definition.
 +      * s/template.h (BSTRING):
 +      * s/msdos.h (BSTRING):
 +      * s/ms-w32.h (BSTRING):
 +      * s/hpux10-20.h (BSTRING):
 +      * s/gnu-linux.h (BSTRING):
 +      * s/darwin.h (BSTRING):
 +      * s/cygwin.h (BSTRING):
 +      * s/bsd-common.h (BSTRING):
 +      * s/aix4-2.h (BSTRING): Likewise.
 +      * sysdep.c: Remove code depending on BSTRING not being defined.
 +
 +2010-06-05  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      Remove obsolete macro BASE_LEADING_CODE_P.
 +      * character.h (BASE_LEADING_CODE_P): Remove.
 +      * regex.c [!emacs] (BASE_LEADING_CODE_P): Remove.
 +      * buffer.c (Fset_buffer_multibyte):
 +      * indent.c (scan_for_column, compute_motion):
 +      * insdel.c (count_combining_before, count_combining_after):
 +      Use LEADING_CODE_P instead of BASE_LEADING_CODE_P.
 +
 +2010-06-04  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      Turn `directory-sep-char' into a noop.
 +
 +      * lisp.h [WINDOWSNT] (Vdirectory_sep_char): Don't declare.
 +      (DIRECTORY_SEP): Define unconditionally.
 +
 +      * s/ms-w32.h (DIRECTORY_SEP): Remove.
 +
 +      * emacs.c (decode_env_path): Don't check DIRECTORY_SEP,
 +      call dostounix_filename directly.
 +
 +      * fileio.c (CORRECT_DIR_SEPS): Remove.
 +      (Ffile_name_directory, directory_file_name, Fexpand_file_name)
 +      (Fsubstitute_in_file_name): Use dostounix_filename instead.
 +      (file_name_as_directory): Use dostounix_filename, DIRECTORY_SEP.
 +      (syms_of_fileio) <directory-sep-char>: Move to subr.el.
 +
 +      * w32proc.c (CORRECT_DIR_SEPS): Remove.
 +      (Fw32_short_file_name, Fw32_long_file_name): Use dostounix_filename.
 +
 +2010-06-03  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * process.c (conv_lisp_to_sockaddr): Fix conversion of IPv4 address.
 +      (Bug#6346)
 +
 +2010-06-03  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * ccl.c (Fccl_program_p): Fix typo in docstring.
 +
 +2010-06-03  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Move UNEXEC definition to autoconf.
 +      * s/usg5-4.h (UNEXEC): Remove, move to configure.in.
 +      * s/sol2-10.h (UNEXEC):
 +      * s/irix6-5.h (UNEXEC):
 +      * s/hpux10-20.h (UNEXEC):
 +      * s/gnu-linux.h (UNEXEC):
 +      * s/darwin.h (UNEXEC):
 +      * s/cygwin.h (UNEXEC):
 +      * s/bsd-common.h (UNEXEC):
 +      * s/aix4-2.h (UNEXEC):
 +      * m/alpha.h (UNEXEC): Likewise.
 +      * Makefile.in (UNEXEC_OBJ): Define using @UNEXEC_OBJ@.
 +
 +2010-06-03  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      Remove obsolete pre-unicode2 macros.
 +      * character.h (MULTIBYTE_FORM_LENGTH, PARSE_MULTIBYTE_SEQ): Remove.
 +      * composite.c (composition_reseat_it):
 +      * data.c (Faset):
 +      * fns.c (Ffillarray):
 +      * regex.c (re_search_2): Use BYTES_BY_CHAR_HEAD.
 +      [!emacs] (BYTES_BY_CHAR_HEAD): Define instead of MULTIBYTE_FORM_LENGTH.
 +
 +2010-06-03  Juri Linkov  <juri@jurta.org>
 +
 +      * buffer.c (Fother_buffer): Add CHECK_FRAME.
 +      (Fswitch_to_buffer): Remove unused variable `err'.
 +
 +2010-06-03  Glenn Morris  <rgm@gnu.org>
 +
 +      * m/template.h (NO_SOCK_SIGIO): Remove, no longer used.
 +
 +      * m/hp800.h (alloca) [__NetBSD__ && __GNUC__]: No need to define it,
 +      now that AH_BOTTOM does it.
 +
 +      * m/hp800.h (HAVE_ALLOCA):
 +      * m/ibms390x.h (HAVE_ALLOCA): Do not define, no longer needed.
 +
 +      * m/ia64.h, s/gnu-linux.h, s/gnu.h, s/netbsd.h, s/usg5-4.h:
 +      Remove NOT_C_CODE tests, it is always true now.
 +
 +2010-06-02  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Fix config.h includes.
 +      * xsettings.c:
 +      * xgselect.c:
 +      * nsterm.m:
 +      * nsselect.m:
 +      * nsimage.m:
 +      * nsfont.m:
 +      * nsfns.m:
 +      * dbusbind.c: Use #include <config.h> instead of "config.h" as all
 +      other files do.
 +
 +      * gmalloc.c: Remove BROKEN_PROTOTYPES reference, unused.
 +
 +      * s/sol2-6.h: Remove obsolete comments.
 +
 +      Remove unnecessary alloca.h includes.
 +      * keymap.c: Do not include alloca.h, config.h does that.
 +      * sysdep.c: Likewise.  Do not define fwrite, not used.
 +
 +2010-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * sysdep.c (child_setup_tty): Move the non-canonical initialization to
 +      the HAVE_TERMIO where it belongs (bug#6149).
 +
 +2010-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * keymap.c (Fwhere_is_internal): Fix handling of remapping (in thread
 +      of bug#6305).
 +
 +2010-05-30  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * bidi.c (bidi_move_to_visually_next): Make sure the sentinel
 +      state is always cached (bug#6306).
 +
 +2010-05-29  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Fix cursor motion in bidi-reordered continued lines.
 +      * xdisp.c (try_cursor_movement): Backup to non-continuation line
 +      only after finding point's row.  Fix the logic.  Rewrite the loop
 +      over continuation lines in bidi-reordered buffers.
 +      Return CURSOR_MOVEMENT_MUST_SCROLL upon failure to find a suitable row,
 +      rather than CURSOR_MOVEMENT_CANNOT_BE_USED.
 +
 +2010-05-28  Michael Albinus  <michael.albinus@gmx.de>
 +
 +      * fileio.c (Fdelete_file): Pass TRASH arg to handler call.
 +
 +2010-05-28  Kenichi Handa  <handa@m17n.org>
 +
 +      * font.c (font_delete_unmatched): Check Vface_ignored_fonts.
 +      Don't sheck SPEC if it is nil.
 +      (font_list_entities): Call font_delete_unmatched if
 +      Vface_ignored_fonts is non-nil.  (Bug#6287)
 +
 +2010-05-28  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (LIBES): Remove $LOADLIBES, it is never set.
 +
 +2010-05-27  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * fileio.c (Fdelete_file): Change meaning of optional arg to mean
 +      whether to trash.
 +      (internal_delete_file, Frename_file): Callers changed.
 +      (delete_by_moving_to_trash): Doc fix.
 +      (Fdelete_directory_internal): Don't move to trash.
 +
 +      * callproc.c (delete_temp_file):
 +      * buffer.c (Fkill_buffer): Callers changed.
 +
 +      * lisp.h: Update prototype.
 +
 +2010-05-27  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xdisp.c (redisplay_window): After redisplay, check if point is
 +      still valid before setting it (Bug#6177).
 +
 +2010-05-27  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in, autodeps.mk, deps.mk, ns.mk:
 +      Convert comments to Makefile format.
 +
 +      * Makefile.in (bootstrap-clean): No more Makefile.c.
 +
 +2010-05-26  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (YMF_PASS_LDFLAGS): Remove.
 +      (temacs${EXEEXT}): Use PRE_EDIT_LDFLAGS, POST_EDIT_LDFLAGS.
 +
 +      * Makefile.in (NS_IMPL_GNUSTEP_INC, NS_IMPL_GNUSTEP_TEMACS_LDFLAGS):
 +      Remove.
 +      (TEMACS_LDFLAGS): Do not use NS_IMPL_GNUSTEP_TEMACS_LDFLAGS.
 +
 +2010-05-26  Kenichi Handa  <handa@m17n.org>
 +
 +      * composite.c (composition_compute_stop_pos): Fix condition for
 +      backward scanning.
 +
 +2010-05-25  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (@NS_IMPL_GNUSTEP_INC@, NS_IMPL_GNUSTEP_TEMACS_LDFLAGS):
 +      Move before TEMACS_LDFLAGS.
 +      (TEMACS_LDFLAGS): Use $NS_IMPL_GNUSTEP_TEMACS_LDFLAGS.
 +      (temacs${EXEEXT}): Do not use $NS_IMPL_GNUSTEP_TEMACS_LDFLAGS.
 +
 +      * Makefile.in (NOT_C_CODE): No longer define.
 +      (config.h): No longer include.
 +
 +      * Makefile.in (LD_SWITCH_SYSTEM_TEMACS): Move definition after some
 +      variables it may reference.
 +
 +      * Makefile.in (LD_SWITCH_SYSTEM_EXTRA): Remove.
 +      (TEMACS_LDFLAGS): Remove LD_SWITCH_SYSTEM_EXTRA.
 +
 +2010-05-25  Kenichi Handa  <handa@m17n.org>
 +
 +      * dispextern.h (struct composition_it): New members rule_idx and
 +      charpos.
 +
 +      * xdisp.c (set_iterator_to_next): While scanning backward, assume
 +      that the character positions of IT point the last character of the
 +      current grapheme cluster.
 +      (next_element_from_composition): Don't change character positions
 +      of IT.
 +      (append_composite_glyph): Set glyph->charpos to
 +      it->cmp_it.charpos.
 +
 +      * composite.c (autocmp_chars): Change the first argument to RULE,
 +      and try composition with RULE only.
 +      (composition_compute_stop_pos): Record the index number of the
 +      composition rule in CMP_IT->rule_idx.
 +      (composition_reseat_it): Call autocmp_chars repeatedly until the
 +      correct rule of the composition is found.
 +      (composition_update_it): Set CMP_IT->charpos.  Assume the CHARPOS
 +      is at the last character of the current grapheme cluster when
 +      CMP_IT->reversed_p is nonzero.
 +
 +2010-05-24  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * editfns.c (Fbyte_to_string): New function.
 +
 +2010-05-24  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * process.c (Fmake_network_process): Set :host to nil if it's not used.
 +      Suggested by Masatake YAMATO <yamato@redhat.com>.
 +
 +2010-05-23  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * dispextern.h (init_iterator): Sync prototype with changed definition.
 +
 +2010-05-20  enami tsugutomo  <tsugutomo.enami@jp.sony.com>
 +
 +      * s/netbsd.h: If terminfo is found, use it in preference to
 +      termcap.  (Bug#6190)  [Backport from trunk]
 +
 +2010-05-19  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Redesign and reimplement bidi-aware edge positions of glyph rows.
 +
 +      * dispextern.h (struct glyph_row): New members minpos and maxpos.
 +      (MATRIX_ROW_START_CHARPOS, MATRIX_ROW_START_BYTEPOS)
 +      (MATRIX_ROW_END_CHARPOS, MATRIX_ROW_END_BYTEPOS): Reference minpos
 +      and maxpos members instead of start.pos and end.pos, respectively.
 +
 +      * xdisp.c (display_line): Compare IT_CHARPOS with the position in
 +      row->start.pos, rather than with MATRIX_ROW_START_CHARPOS.
 +      (cursor_row_p): Use row->end.pos rather than MATRIX_ROW_END_CHARPOS.
 +      (try_window_reusing_current_matrix, try_window_id):
 +      Use ROW->minpos rather than ROW->start.pos.
 +      (init_from_display_pos, init_iterator): Use EMACS_INT for
 +      character and byte positions.
 +      (find_row_edges): Rename from find_row_end.  Accept additional
 +      arguments for minimum and maximum buffer positions seen by
 +      display_line for this row.  Don't use iterator to find the
 +      position following the maximum one; instead, increment the
 +      position found by display_line directly.  Fix logic; eol_pos
 +      should be tested before the rest.  Handle the case of characters
 +      delivered from display vector (bug#6036).  Fix tests related to
 +      it->method.  Handle the truncated_on_right_p rows.
 +      (RECORD_MAX_MIN_POS): New macro.
 +      (display_line): Use it to record the minimum and maximum buffer
 +      positions for glyphs in the row being assembled.  Record the
 +      position of the newline that terminates the line.  If word wrap is
 +      in effect, restore minimum and maximum positions seen up to the
 +      wrap point, when iterator returns to it.
 +      (try_window_reusing_current_matrix): Give up if in bidi-reordered
 +      row and cursor not already at point.  Restore original pre-bidi
 +      code for unidirectional buffers.
 +
 +      * dispnew.c (increment_row_positions, check_matrix_invariants):
 +      Increment and check row->start.pos and row->end.pos, in addition
 +      to MATRIX_ROW_START_CHARPOS and MATRIX_ROW_END_CHARPOS.
 +
 +      * .gdbinit (prowlims): Display row->minpos and row->maxpos.
 +      Display truncated_on_left_p and truncated_on_right_p flags.
 +      Formatting fixes.
 +      (pmtxrows): Display the ordinal number of each row.  Don't display
 +      rows beyond the last one.
 +
 +      * bidi.c (bidi_cache_iterator_state): Don't zero out new_paragraph:
 +      it is not copied by bidi_copy_it.
 +
 +2010-05-22  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * w32.c (sys_write): Break writes into chunks smaller than 32MB.
 +      (Bug#6237)
 +
 +2010-05-22  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * image.c (Fimage_flush): Rename from image-refresh.
 +
 +2010-05-21  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xdisp.c (redisplay_internal): Clear caches even if redisplaying
 +      just one window.
 +
 +      * image.c (Vimage_cache_eviction_delay): Decrease to 300.
 +      (clear_image_cache): If the number of cached images is unusually
 +      large, decrease the cache eviction delay (Bug#6230).
 +
 +2010-05-21  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (${ns_appdir}, ${ns_appbindir}Emacs, ns-app):
 +      Move these rules to ns.mk.
 +      * ns.mk: New file.
 +
 +      * Makefile.in (../src/$(OLDXMENU), $(OLDXMENU)): Always define rules.
 +
 +      * Makefile.in (CANNOT_DUMP): New, set by configure.
 +      (emacs${EXEEXT}, bootstrap-emacs${EXEEXT}): Use $CANNOT_DUMP.
 +
 +2010-05-20  Juri Linkov  <juri@jurta.org>
 +
 +      * fileio.c (Fdelete_file): Change interative spec to use
 +      `read-file-name' like in `find-file-read-args' where the default
 +      value is `default-directory' instead of `buffer-file-name'.
 +      http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00533.html
 +
 +2010-05-20  Kevin Ryde  <user42@zip.com.au>
 +
 +      * keyboard.c (Vlast_command, Vkeyboard_translate_table)
 +      (Voverriding_terminal_local_map, Vsystem_key_alist)
 +      (Vlocal_function_key_map): Fix manual link in docstring (Bug#6224).
 +
 +2010-05-20  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (DEPDIR): New constant.
 +      (DEPFLAGS): Set with configure, not cpp.
 +      (MKDEPDIR): New, set by configure.
 +      (.c.o, .m.o, ecrt0.o): Use $MKDEPDIR.
 +      (clean): Use $DEPDIR.
 +      (deps_frag): Include from configure.
 +      Move static/dynamic dependency stuff to deps.mk/autodeps.mk.
 +      * deps.mk, autodeps.mk: New files, extracted from Makefile.in.
 +
 +      * bidi.c (bidi_cache_shrink, bidi_cache_iterator_state):
 +      Fix reallocation of the cache.  (Bug#6210)
 +
 +2010-05-19  Glenn Morris  <rgm@gnu.org>
 +
 +      * s/msdos.h (ORDINARY_LINK): Move to sed2v2.inp.
 +
 +      * Makefile.in (LD, YMF_PASS_LDFLAGS): Set with configure, not cpp.
 +      (GNULIB_VAR): Remove.
 +      (LIBES): Use LIB_GCC instead of GNULIB_VAR.
 +
 +      * m/ibms390x.h (LINKER):
 +      * m/macppc.h (LINKER) [GNU_LINUX]:
 +      * s/aix4-2.h (ORDINARY_LINK):
 +      * s/cygwin.h (LINKER):
 +      * s/darwin.h (ORDINARY_LINK):
 +      * s/gnu.h (ORDINARY_LINK):
 +      * s/netbsd.h (LINKER):
 +      * s/usg5-4.h (ORDINARY_LINK):
 +      Move to configure.
 +
 +      * s/aix4-2.h (LINKER): Remove; this file sets ORDINARY_LINK.
 +
 +2010-05-18  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * character.c (Fstring, Funibyte_string): Use SAFE_ALLOCA to
 +      prevent stack overflow if number of arguments is too large
 +      (Bug#6214).
 +
 +2010-05-18  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * charset.c (load_charset_map_from_file): Don't call close after fclose.
 +
 +2010-05-18  Glenn Morris  <rgm@gnu.org>
 +
 +      * s/gnu-linux.h: Combine two conditionals.
 +
 +      * Makefile.in (otherobj): Include $(VMLIMIT_OBJ) separately from
 +      $(POST_ALLOC_OBJ).
 +
 +      * Makefile.in (RALLOC_OBJ): New, set by configure.
 +      (rallocobj): Replace with the previous variable.
 +      (otherobj): Use $RALLOC_OBJ.
 +
 +      * s/gnu.h (REL_ALLOC) [DOUG_LEA_MALLOC]:
 +      * s/gnu-linux.h (REL_ALLOC) [DOUG_LEA_MALLOC]: Move undef to configure.
 +
 +      * Makefile.in (GMALLOC_OBJ, VMLIMIT_OBJ): New, set by configure.
 +      (gmallocobj, vmlimitobj): Replace with previous two variables.
 +      (otherobj): Use $GMALLOC_OBJ, $VMLIMIT_OBJ.
 +
 +2010-05-17  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (OLDXMENU_DEPS): New, set by configure.
 +      (stamp-oldxmenu): Use $OLDXMENU_DEPS.
 +
 +2010-05-16  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (${ns_appbindir}Emacs, ns-app): Always define these rules.
 +
 +      * Makefile.in (clean): Get rid of HAVE_NS conditional.
 +
 +      * Makefile.in (ns_appdir, ns_appbindir): Now configure adds the
 +      trailing "/".
 +
 +      * Makefile.in (TEMACS_LDFLAGS2): New, set by configure.
 +      (temacs${EXEEXT}): Combine the NS_IMPL_GNUSTEP case with the default.
 +
 +      * Makefile.in (GNUSTEP_SYSTEM_LIBRARIES): Remove, unused.
 +      (NS_IMPL_GNUSTEP_TEMACS_LDFLAGS): New, set by configure.
 +      (LD) [NS_IMPL_GNUSTEP]: Set to $(CC) -rdynamic.
 +      (temacs${EXEEXT}): Remove $LOCALCPP, never defined or referenced.
 +      Make most of the NS_IMPL_GNUSTEP case the same as the default case.
 +
 +      * Makefile.in (temacs${EXEEXT}) [!NS_IMPL_GNUSTEP]:
 +      Remove ${STARTFLAGS}, nothing ever sets it.
 +
 +2010-05-16  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * m/ia64.h (UNEXEC): Remove, set in s/*.h.
 +
 +2010-05-16  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (LIBX_BASE): Always define.
 +
 +      * Makefile.in (LIBX_OTHER): Move out of cpp section.
 +
 +      * Makefile.in (LIBXT): Always define.
 +
 +2010-05-15  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (OLDXMENU, LIBXMENU, LIBX_OTHER): Always define.
 +
 +      * Makefile.in (FONT_DRIVERS): Remove, replace with $FONT_OBJ.
 +      (obj, SOME_MACHINE_OBJECTS): Use $FONT_OBJ.
 +
 +2010-05-15  Ken Raeburn  <raeburn@raeburn.org>
 +
 +      * lisp.h (XFLOAT_DATA): Use "0?x:x" to generate an rvalue.  (Bug#5916)
 +      (LISP_MAKE_RVALUE) [!USE_LISP_UNION_TYPE && !__GNUC__]: Likewise.
 +
 +      * emacs.c (main): Initialize initial-environment and
 +      process-environment before generating from env, not after.
 +
 +      Handle --version reasonably in CANNOT_DUMP configuration.
 +      * emacs.c (emacs_version, emacs_copyright): New string variables.
 +      (Vemacs_version, Vemacs_copyright): New Lisp_Object variables.
 +      (syms_of_emacs): Defvar them, and initialize them from the C
 +      string variables.
 +      (main): If initialization hasn't been done, print initial version
 +      info from the C strings, instead of starting an interactive session.
 +
 +2010-05-15  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * bidi.c (bidi_paragraph_init): Don't leave alone garbage values
 +      of bidi_it->paragraph_dir.  Call bidi_initialize if needed.
 +      (bidi_paragraph_init): Remove redundant assertion that we are at
 +      the beginning of a line after call to bidi_find_paragraph_start.
 +
 +      * xdisp.c (Fcurrent_bidi_paragraph_direction): New function.
 +      (syms_of_xdisp): Defsubr it.
 +
 +      * cmds.c (Fforward_char, Fbackward_char): Doc fix.
 +
 +      * Makefile.in: Fix MSDOS-related comments.
 +
 +2010-05-15  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (OLDXMENU_TARGET): New, set by configure.
 +      (really-lwlib, really-oldXMenu): Always define.
 +      ($OLDXMENU): Depend on $OLDXMENU_TARGET.
 +
 +      * Makefile.in: Simplify cpp conditional.
 +
 +      * Makefile.in (${ns_appdir}): Simplify using umask.
 +
 +      * Makefile.in (${ns_appdir}): Remove references to CVS-related files.
 +
 +2010-05-14  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * eval.c (specbind): Remove left-over duplicate test.
 +      Disallow let-binding frame-local vars.  Add comment.
 +
 +2010-05-14  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Make the cache of bidi iterator states dynamically allocated.
 +      * bidi.c (bidi_cache_shrink): New function.
 +      (bidi_init_it): Call it.
 +      (bidi_cache_iterator_state): Enlarge the cache if needed.
 +
 +      * bidi.c (bidi_move_to_visually_next): Rename from
 +      bidi_get_next_char_visually.  All callers changed.
 +
 +2010-05-14  Kenichi Handa  <handa@m17n.org>
 +
 +      * dispextern.h (struct composition_it): New member reversed_p.
 +
 +      * composite.c (composition_compute_stop_pos): Search backward if
 +      ENDPOS < CHARPOS.
 +      (composition_reseat_it): Handle the case that ENDPOS < CHARPOS.
 +      Set CMP_IT->reversed_p.
 +      (composition_update_it): Pay attention to CMP_IT->reversed_p.
 +
 +      * xdisp.c (set_iterator_to_next):
 +      Call composition_compute_stop_pos with negative ENDPOS if we are
 +      scanning backward.  Call composition_compute_stop_pos if scan
 +      direction is changed.
 +      (next_element_from_buffer): Call composition_compute_stop_pos with
 +      negative ENDPOS if we are scanning backward.
 +      (next_element_from_composition): Pay attention to
 +      IT->cmp_it.reversed_p.
 +
 +2010-05-14  Kenichi Handa  <handa@m17n.org>
 +
 +      * font.c (font_range): Return the range for the font found at first.
 +
 +2010-05-14  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Always define.
 +
 +      * Makefile.in (mktime, X11, register): Move undefs to configure.
 +
 +      * Makefile.in (MSDOS_OBJ): Default to empty, let msdos scripts set it.
 +      (MSDOS_X_OBJ): New variable.
 +      (MSDOS_SUPPORT_REAL): New constant.
 +      (MSDOS_SUPPORT): Set as a variable, not with cpp.
 +      (obj): Use MSDOS_X_OBJ.
 +      (lisp): Use MSDOS_SUPPORT as a variable.
 +
 +      * Makefile.in (REAL_MOUSE_SUPPORT): New constant.
 +      (GPM_MOUSE_SUPPORT): Now it's a constant.
 +      (MOUSE_SUPPORT, TOOLTIP_SUPPORT, WINDOW_SUPPORT): Set with configure,
 +      not cpp.
 +
 +      * Makefile.in (@NS_IMPL_GNUSTEP_INC@): Use in place of #ifdef.
 +      (ns_appresdir): Remove, unused.
 +
 +      * Makefile.in (SHELL): Move outside cpp section.
 +
 +      * s/netbsd.h (AMPERSAND_FULL_NAME): Remove (defined in AH_BOTTOM).
 +
 +2010-05-13  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (FONT_DRIVERS): Place with other HAVE_X_WINDOWS stuff.
 +      (TOOLTIP_SUPPORT): Place with other HAVE_WINDOW_SYSTEM stuff.
 +
 +      * Makefile.in (FONT_DRIVERS): If HAVE_X_WINDOWS is defined,
 +      HAVE_WINDOW_SYSTEM must be too.
 +
 +      * Makefile.in (WINNT_SUPPORT): Remove, nt build does not use this file.
 +      (lisp): Remove WINNT_SUPPORT.
 +
 +      * Makefile.in (OLDXMENU, LIBXMENU) [!HAVE_MENUS]:
 +      Let configure set these variables (to empty) in this case as well.
 +
 +      * Makefile.in (LD_SWITCH_X_SITE): Define as a variable, not via cpp.
 +      (LIBX_BASE): Use $LD_SWITCH_X_SITE.
 +
 +      * Makefile.in (C_SWITCH_X_SYSTEM, C_SWITCH_X_SITE, LIB_STANDARD)
 +      (LIB_MATH, FONTCONFIG_CFLAGS, FONTCONFIG_LIBS, FREETYPE_CFLAGS)
 +      (FREETYPE_LIBS, LIBOTF_CFLAGS, LIBOTF_LIBS, M17N_FLT_CFLAGS)
 +      (M17N_FLT_LIBS, GNU_OBJC_CFLAGS, GNUSTEP_SYSTEM_LIBRARIES, LIBGPM)
 +      (LIBRESOLV, UNEXEC_OBJ): For clarity, define variables to hold
 +      the values output by configure.
 +      (ALL_CFLAGS, obj, LIBES, temacs${EXEEXT}): Use the above variables.
 +
 +2010-05-12  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (YMF_PASS_LDFLAGS, LD, LINKER): Simplify the logic.
 +      (LINKER_WAS_SPECIFIED): Remove.
 +
 +      * Makefile.in (LIB_GCC): Set using configure, not cpp.
 +      (GNULIB_VAR) [!ORDINARY_LINK]: Always set to $LIB_GCC.
 +      * m/arm.h (LIB_GCC) [GNU_LINUX]:
 +      * s/cygwin.h (LIB_GCC):
 +      * s/freebsd.h (LIB_GCC):
 +      * s/gnu-linux.h (LIB_GCC):
 +      * s/msdos.h (LIB_GCC):
 +      * s/netbsd.h (LIB_GCC):
 +      Move to configure.
 +
 +2010-05-11  Karel Klíč  <kklic@redhat.com>
 +
 +      * ftfont.c: Fix incorrect parentheses of #if condition for
 +      definining M17N_FLT_USE_NEW_FEATURE.
 +
 +2010-05-11  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (LIBS_SYSTEM) [MSDOS]: Do not reset.
 +      * s/msdos.h (MSDOS_LIBS_SYSTEM): Remove.
 +
 +2010-05-10  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c (init_iterator): Don't turn on bidi reordering in
 +      unibyte buffers.  See
 +      http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00263.html.
 +
 +2010-05-10  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (LIBS_SYSTEM): Set using configure, not cpp.
 +      (LIBS_SYSTEM) [MSDOS]: Reset with MSDOS_LIBS_SYSTEM.
 +      (LIBES): Use LIBS_SYSTEM as a variable.
 +      * s/msdos.h (LIBS_SYSTEM): Rename to MSDOS_LIBS_SYSTEM.  Always define.
 +      * s/aix4-2.h (LIBS_SYSTEM):
 +      * s/freebsd.h (LIBS_SYSTEM):
 +      * s/hpux10-20.h (LIBS_SYSTEM):
 +      * s/sol2-6.h (LIBS_SYSTEM):
 +      * s/unixware.h (LIBS_SYSTEM):
 +      Move to configure.
 +
 +      * s/aix4-2.h (MAIL_USE_LOCKF):
 +      * s/bsd-common.h (MAIL_USE_FLOCK):
 +      * s/darwin.h (MAIL_USE_FLOCK):
 +      * s/gnu-linux.h (MAIL_USE_FLOCK):
 +      * s/irix6-5.h (MAIL_USE_FLOCK):
 +      * s/template.h (MAIL_USE_FLOCK):
 +      Move to configure.
 +
 +2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * Version 23.2 released.
 +
 +2010-05-08  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * composite.c (autocmp_chars): Save point as marker before calling
 +      auto-composition-function (Bug#5984).
 +
 +      * lisp.h (restore_point_unwind): Add prototype.
 +
 +      * fileio.c (restore_point_unwind): Remove static attribute.
 +
 +2010-05-08  Kenichi Handa  <handa@m17n.org>
 +
 +      * ftfont.c (M17N_FLT_USE_NEW_FEATURE): Define it if we can use the
 +      new feature of libotf and m17n-flt.
 +      (ftfont_check_otf) [M17N_FLT_USE_NEW_FEATURE]:
 +      Call OTF_check_features even if no specific feature is given.
 +      (PACK_OTF_TAG) [M17N_FLT_USE_NEW_FEATURE]: New macro.
 +      (ftfont_drive_otf) [M17N_FLT_USE_NEW_FEATURE]: Handle the case
 +      that OUT is NULL.  Use OTF_drive_gsub_with_log and
 +      OTF_drive_gpos_with_log instead of OTF_drive_gsub and
 +      OTF_drive_gpos.
 +      (ftfont_try_otf) [M17N_FLT_USE_NEW_FEATURE]: New function.
 +      (ftfont_shape_by_flt) [M17N_FLT_USE_NEW_FEATURE]:
 +      Setup mflt_enable_new_feature and mflt_try_otf.
 +
 +2010-05-08  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsettings.c (Ftool_bar_get_system_style): Correct comment.
 +
 +      * gtkutil.c (xg_pack_tool_bar): Change show_all to show for handle
 +      box and toolbar (Bug #6139).
 +      (xg_create_tool_bar): Remove comment (Bug #6139).
 +      (xg_make_tool_item): Remove gtk_widget_show_all (Bug #6139).
 +      (xg_show_toolbar_item): Add gtk_widget_show for weventbox (Bug #6139).
 +
 +2010-05-08  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in ($(BLD)/eval.$(O), $(BLD)/w32fns.$(O)):
 +      Update dependencies.
 +
 +2010-05-08  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * fringe.c (update_window_fringes): Set up truncation bitmaps for
 +      R2L lines.
 +
 +2010-05-08  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (THIS_IS_MAKEFILE): Remove, unused.
 +
 +      * Makefile.in (LIBS_TERMCAP): Set with configure, not cpp.
 +      (TERMCAP_OBJ): New, set by configure, replacing termcapobj.
 +      (termcapobj): Replace with TERMCAP_OBJ.
 +      (otherobj): Use $TERMCAP_OBJ instead of $termcapobj.
 +      (LIBES): Use LIBS_TERMCAP as a variable.
 +
 +      * s/freebsd.h (osreldate.h): No longer include, since this file
 +      does not use __FreeBSD_version any more.
 +
 +      * s/aix4-2.h (TERMINFO):
 +      * s/cygwin.h (TERMINFO):
 +      * s/darwin.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]:
 +      * s/freebsd.h (TERMINFO, LIBS_TERMCAP):
 +      * s/gnu-linux.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]:
 +      * s/gnu.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]:
 +      * s/hpux10-20.h (TERMINFO, LIBS_TERMCAP):
 +      * s/irix6-5.h (TERMINFO):
 +      * s/netbsd.h (LIBS_TERMCAP):
 +      * s/openbsd.h (TERMINFO, LIBS_TERMCAP):
 +      * s/sol2-6.h (LIBS_TERMCAP) [!TERMINFO]:
 +      * s/usg5-4.h (TERMINFO):
 +      Move to configure.
 +
 +2010-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * eval.c (unbind_to): Don't unbind a local binding into the global
 +      binding when the local binding disappeared.  Inversely, don't unbind
 +      a global binding into a newly created local binding.
 +      * data.c (set_internal): Make its `buf' arg into a `where' arg so we
 +      can specify the frame to use, when applicable.  Adjust callers.
 +
 +2010-05-07  Vincent Belaïche  <vincent.belaiche@gmail.com>
 +            Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * floatfns.c (Fisnan, Fcopysign, Ffrexp, Fldexp): New functions.
 +
 +2010-05-07  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * w32fns.c: Include w32.h.
 +      (Fw32_shell_execute): Decode the error message before passing it
 +      to `error'.  (Bug#6126)
 +
 +      * msdos.c (dos_set_window_size):
 +      * w16select.c (Fx_selection_exists_p): Use `Fsymbol_value (foo)'
 +      instead of `XSYMBOL (foo)->value'.
 +
 +2010-05-07  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Fix the MS-DOS build, broken by autoconfiscation.
 +
 +      * Makefile.in: Don't use Make-style comments past the "start of
 +      cpp stuff" line.
 +      (MSDOS_OBJ): Remove xmenu.o (it is now defined by XMENU_OBJ).
 +
 +      * s/msdos.h (UNEXEC): Don't define (@unexec@ in Makefile.in is
 +      edited directly by msdos/sed1v2.inp).
 +
 +2010-05-07  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (LD_SWITCH_SYSTEM): Set with configure, not cpp.
 +      (LD_SWITCH_SYSTEM_EXTRA): New variable, set by configure.
 +      (TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM and $LD_SWITCH_SYSTEM_EXTRA,
 +      move out of cpp section.
 +      * s/freebsd.h (LD_SWITCH_SYSTEM):
 +      * s/gnu-linux.h (LD_SWITCH_SYSTEM):
 +      * s/netbsd.h (LD_SWITCH_SYSTEM):
 +      * s/openbsd.h (LD_SWITCH_SYSTEM): Move to configure.in.
 +
 +2010-05-07  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Define LIB_STANDARD and START_FILES using autoconf.
 +      * s/usg5-4.h (LIB_STANDARD):
 +      * s/netbsd.h (START_FILES):
 +      * s/irix6-5.h (LIB_STANDARD):
 +      * s/hpux10-20.h (LIB_STANDARD, START_FILES):
 +      * s/gnu-linux.h (START_FILES, LIB_STANDARD):
 +      * s/freebsd.h (START_FILES):
 +      * s/darwin.h (START_FILES):
 +      * s/cygwin.h (START_FILES):
 +      * s/aix4-2.h (LIB_STANDARD):
 +      * m/ibmrs6000.h (START_FILES): Remove, move logic to configure.in.
 +      * Makefile.in (STARTFILES): Rename to START_FILES, define using
 +      autoconf, not cpp.
 +
 +2010-05-06  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove NEED_BSDTTY and NEED_UNISTD_H.
 +      * s/hpux10-20.h (NEED_BSDTTY): Remove.
 +      * s/aix4-2.h (NEED_UNISTD_H): Remove.
 +      * systty.h: Simplify conditionals for including <sys/bsdtty.h>,
 +      <sys/ptyio.h> and <unistd.h>.
 +
 +      * emacs.c (main): Remove NO_DIR_LIBRARY conditional, unused.
 +
 +      * Makefile.in (STARTFILES): Conditionally define to make the usage clear.
 +      * s/gnu.h (START_FILES): Remove empty definition.
 +
 +2010-05-06  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xterm.c (x_draw_image_relief): Move declaration of extra to beginning.
 +
 +2010-05-06  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (CPP, LN_S): Remove unused variables.
 +
 +2010-05-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * syntax.c (Fchar_syntax): Check the arg is a character (bug#6080).
 +
 +2010-05-05  Lawrence Mitchell  <wence@gmx.li>
 +
 +      * m/sparc.h: Fix typo in earlier change.
 +
 +2010-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      Misc tweaks.
 +      * eval.c (Fdefvaralias): Remove unintended nested if.
 +      (internal_condition_case_2, internal_condition_case_n): Use ANSI type.
 +
 +2010-05-04  Bernhard Herzog  <bh@intevation.de>  (tiny change)
 +
 +      * xsmfns.c (smc_save_yourself_CB): strlen(client_id) => strlen(cwd).
 +
 +2010-05-04  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove BSD_PGRPS.
 +      * s/bsd-common.h (BSD_PGRPS): Remove undef.
 +      * s/gnu-linux.h (BSD_PGRPS): Remove.
 +      * term.c (dissociate_if_controlling_tty):
 +      * sysdep.c (narrow_foreground_group, widen_foreground_group)
 +      (init_sys_modes, reset_sys_modes):
 +      * emacs.c (main):
 +      * callproc.c (Fcall_process, child_setup): Remove code depending
 +      on BSD_PGRPS.
 +
 +      Remove POSIX_SIGNALS.
 +      * s/usg5-4.h (POSIX_SIGNALS):
 +      * s/netbsd.h (POSIX_SIGNALS):
 +      * s/msdos.h (POSIX_SIGNALS):
 +      * s/ms-w32.h (POSIX_SIGNALS):
 +      * s/hpux11.h (POSIX_SIGNALS):
 +      * s/gnu.h (POSIX_SIGNALS):
 +      * s/gnu-linux.h (POSIX_SIGNALS):
 +      * s/freebsd.h (POSIX_SIGNALS):
 +      * s/darwin.h (POSIX_SIGNALS):
 +      * s/cygwin.h (POSIX_SIGNALS):
 +      * s/aix4-2.h (POSIX_SIGNALS): Remove definition.
 +      * s/unixware.h:
 +      * s/sol2-6.h: Remove comments on POSIX_SIGNALS.
 +      * process.c (create_process):
 +      * syssignal.h:
 +      * sysdep.c (wait_for_termination, init_signals):
 +      * process.c (create_process):
 +      * msdos.c: POSIX_SIGNALS is always defined on all platforms,
 +      remove all code that assumes the contrary.
 +
 +2010-05-04  Glenn Morris  <rgm@gnu.org>
 +
 +      * s/gnu-linux.h (LD_SWITCH_SYSTEM): Use LD_SWITCH_X_SITE_AUX as a shell
 +      variable.
 +      * s/netbsd.h (LD_SWITCH_SYSTEM_tmp): Remove.
 +      (LD_SWITCH_SYSTEM): Use $LD_SWITCH_X_SITE_AUX_RPATH.
 +      * s/openbsd.h (LD_SWITCH_SYSTEM_tmp): Remove.
 +      (LD_SWITCH_SYSTEM): Use $LD_SWITCH_X_SITE_AUX_RPATH instead of
 +      LD_SWITCH_SYSTEM_tmp.
 +      * Makefile.in (LD_SWITCH_X_SITE_AUX, LD_SWITCH_X_SITE_AUX_RPATH):
 +      New variables, set by configure.
 +
 +      * s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in.
 +      * s/darwin.h (HEADERPAD_EXTRA, LIBS_NSGUI): Remove.
 +      (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in.
 +      * Makefile.in (LD_SWITCH_SYSTEM_TEMACS): New variable, set by configure.
 +      (TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM_TEMACS.
 +
 +      * s/aix4-2.h (C_SWITCH_SYSTEM):
 +      * m/alpha.h (C_SWITCH_MACHINE):
 +      Move to configure.in.
 +      * Makefile.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM):
 +      New variables, set by configure.
 +      (ALL_CFLAGS): Use $C_SWITCH_MACHINE and $C_SWITCH_SYSTEM in place of
 +      $c_switch_machine and $c_switch_system.
 +
 +2010-05-04  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * s/hpux10-20.h (LIB_STANDARD): New definition.
 +      * Makefile.in (ORDINARY_LINK): Remove setting LIB_STANDARD based
 +      on it, not used anymore.
 +
 +2010-05-03  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * eval.c (internal_condition_case_n): Rename from
 +      internal_condition_case_2.
 +      (internal_condition_case_2): New function.
 +
 +      * xdisp.c (safe_call): Use internal_condition_case_n.
 +
 +      * fileio.c (Fdelete_file, internal_delete_file): New arg FORCE.
 +      (internal_delete_file, Frename_file): Callers changed.
 +
 +      * buffer.c (Fkill_buffer):
 +      * callproc.c (delete_temp_file): Callers changed (Bug#6070).
 +
 +      * lisp.h: Update prototypes.
 +
 +2010-05-03  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (LIBX_EXTRA, LIBX_BASE): New variables.
 +      (LIBXT_OTHER, LIBX_OTHER): New, set by configure.
 +      (LIBXT): Set with configure, not cpp.
 +      (LIBX): Remove.
 +      (LIBES): Replace $LIBX with $LIBX_BASE and $LIBX_OTHER.
 +
 +2010-05-02  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * m/amdx86-64.h (START_FILES, LIB_STANDARD): Remove.
 +      The FreeBSD is not needed, the default works, Solaris version is
 +      not needed, and the remaining case is not supported by configure.
 +
 +2010-05-02  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsmfns.c (CHDIR_OPT): New define.
 +      (smc_save_yourself_CB): Add CHDIR_OPT to options to use when
 +      restarting emacs.
 +
 +      * xterm.c (x_connection_closed): Call Fkill_emacs instead of
 +      shut_down_emacs.
 +
 +      * emacs.c (USAGE1): Mention --chdir.
 +      (main): Handle --chdir.
 +      (standard_args): Add --chdir.
 +      (fatal_error_signal): Call Fkill_emacs for SIGTERM and SIGHUP (Bug
 +      #5552).
 +
 +2010-05-01  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove LD_SWITCH_MACHINE.
 +      * Makefile.in (LD_SWITCH_MACHINE): Remove definition, unused.
 +      (TEMACS_LDFLAGS): Do not use LD_SWITCH_MACHINE.
 +
 +      Clean up IRIX code.
 +      * m/iris4d.h (TERMINFO, FIRST_PTY_LETTER): Move definitions ...
 +      * s/irix6-5.h (TERMINFO, FIRST_PTY_LETTER): ... here.
 +
 +      Clean up AIX code.
 +      * m/ibmrs6000.inp: Remove file, unused.
 +      * m/ibmrs6000.h (IBMR2AIX): Remove, unused.
 +      (LD_SWITCH_MACHINE): Rename to LD_SWITCH_SYSTEM_TEMACS, and move
 +      definition ...
 +      * s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): ... here.
 +
 +      * sysdep.c (child_setup_tty, init_sys_modes): Remove !IBMR2AIX code,
 +      unused.
 +
 +2010-05-01  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Emulate POSIX_SIGNALS on MS-Windows.
 +
 +      * s/ms-w32.h (POSIX_SIGNALS, struct sigaction, SIG_BLOCK)
 +      (SIG_SETMASK, SIG_UNBLOCK): Define.
 +
 +      * sysdep.c (sys_signal) [WINDOWSNT]: #ifdef away.
 +      (wait_for_termination) [WINDOWSNT]: Move MS-Windows specific code
 +      from non-POSIX_SIGNALS section to POSIX_SIGNALS section.
 +
 +      * w32.c (sigemptyset, sigaddset, sigfillset, sigprocmask):
 +      New stubs.
 +
 +      Miscellaneous fixes of bidi display.
 +
 +      * xdisp.c (find_row_end): New function, refactored from display_line.
 +      (display_line): Use it.
 +      (extend_face_to_end_of_line): In almost-filled rows, extend only
 +      if the row is R2L and not continued.
 +      (display_line): Fix prepending of truncation glyphs to R2L rows.
 +      Preserve overlay and string info in row->end.
 +      (insert_left_trunc_glyphs): Support addition of left truncation
 +      glyphs to R2L rows.
 +      (set_cursor_from_row): Don't place cursor on the vertical border
 +      glyph between adjacent windows.  Fix a crash when a display string
 +      is continued to the next line.  Don't return zero if cursor was
 +      found by `cursor' property of a display string.
 +      (try_cursor_movement): Don't assume that row->end == (row+1)->start,
 +      test for that explicitly.
 +
 +2010-05-01  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (gmallocobj, rallocobj, vmlimitobj): Initialize to null,
 +      for clarity.
 +      (OTHER_OBJ): Remove.
 +      (PRE_ALLOC_OBJ, POST_ALLOC_OBJ): New, set by configure.
 +      (otherobj): Use PRE_ALLOC_OBJ, POST_ALLOC_OBJ rather than OTHER_OBJ.
 +
 +2010-05-01  Karel Klíč  <kklic@redhat.com>
 +
 +      * fileio.c (Ffile_selinux_context): Context functions may return null.
 +
 +2010-04-30  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * s/gnu.h (POSIX_SIGNALS, START_FILES): New definitions.
 +
 +2010-04-30  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (vmlimitobj) [!SYSTEM_MALLOC]: New variable.  (Bug#6065)
 +      (OTHER_OBJ): Define as a separate variable, for clarity.
 +
 +2010-04-30  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsettings.c: include limits.h and update file comment.
 +
 +2010-04-30  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (OLDXMENU, LIBXMENU) [HAVE_MENUS]:
 +      Set with configure, not cpp.
 +      (LIBW): Remove, replace with $TOOLKIT_LIBW.
 +
 +      * Makefile.in (mallocobj): Remove.
 +      (otherobj): Simplify using @OTHER_OBJ@.
 +
 +      * Makefile.in (dispnew.o, frame.o, fringe.o, font.o, fontset.o)
 +      (keyboard.o, window.o, xdisp.o, xfaces.o, menu.o):
 +      Don't bother making nsgui.h dependency platform-specific.
 +
 +      * Makefile.in (nsfns.o): Remove duplicate nsgui.h dependency.
 +
 +2010-04-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * process.c (read_process_output, exec_sentinel): Don't burp if the
 +      sentinel/filter kills the current buffer (bug#6060).
 +
 +      Fix wrong-docstring problem introduced with hash-consing.  (Bug#6008)
 +      * eval.c (Fautoload): Set doc to a unique number rather than to 0.
 +      Remove unused var `args'.
 +      * lisp.h (XSETCARFASTINT, XSETCDRFASTINT): Remove.
 +      (LOADHIST_ATTACH): Wrap with do...while to avoid surprises for callers.
 +      * doc.c (store_function_docstring): Use XSETCAR.
 +
 +2010-04-28  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT): New variables.
 +      (WINDOW_SUPPORT) [HAVE_WINDOW_SYSTEM]: Use them.
 +
 +      * Makefile.in (CYGWIN_OBJ): Set with configure, not cpp.
 +
 +      * Makefile.in (GPM_MOUSE_SUPPORT): New, set by configure.
 +      (MOUSE_SUPPORT) [!HAVE_MOUSE]: Use $GPM_MOUSE_SUPPORT.
 +
 +      * Makefile.in (FONT_OBJ): New, set by configure.
 +      (FONT_DRIVERS): Use $FONT_OBJ.
 +
 +      * Makefile.in (LIBXMU): Set with configure, not cpp.
 +      * s/aix4-2.h (LIBXMU):
 +      * s/hpux10-20.h (LIBXMU):
 +      Remove definition, now set in configure.
 +
 +      * Makefile.in (NS_OBJ, NS_SUPPORT): Set with configure, not cpp.
 +
 +      * m/amdx86-64.h [i386]: Move this test to configure.in.
 +
 +2010-04-27  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (LIBXTR6): Set with configure, not cpp.
 +      * s/unixware.h (NEED_LIBW): Remove definition.
 +
 +      * Makefile.in (LUCID_LIBW, MOTIF_LIBW): Remove, replacing by...
 +      (TOOLKIT_LIBW): New, set by configure.
 +      (@X_TOOLKIT_TYPE@): No longer define it.
 +
 +      * Makefile.in (LIBXP): Remove, since included in MOTIF_LIBW.
 +      (MOTIF_LIBW): Set with configure, not cpp.
 +      * s/aix4-2.h (LIB_MOTIF):
 +      * s/gnu-linux.h (LIB_MOTIF):
 +      * s/unixware.h (LIB_MOTIF): Move to configure.in.
 +
 +2010-04-27  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Reduce CPP usage.
 +      * Makefile.in (LIB_X11_LIB): Remove, inline in the only user.
 +      (obj): Use autoconf for unexec instead of cpp.
 +      (C_SWITCH_SYSTEM, C_SWITCH_MACHINE, C_SWITCH_X_SITE):
 +      Remove definitions and undefs.  Inline definitions in the only user.
 +      (ALL_CFLAGS): Substitute C_SWITCH_X_SYSTEM using autoconf.
 +
 +2010-04-27  Glenn Morris  <rgm@gnu.org>
 +
 +      * m/amdx86-64.h (START_FILES, LIB_STANDARD): Change the logic around,
 +      since the defaults (set by the system file) are fine in most cases.
 +      [GNU_LINUX, __OpenBSD__, __NetBSD__, __APPLE__]: Remove sections.
 +      * m/ibms390x.h (START_FILES, LIB_STANDARD):
 +      * m/macppc.h (START_FILES, LIB_STANDARD) [GNU_LINUX]:
 +      * m/sparc.h (START_FILES, LIB_STANDARD) [__linux__]:
 +      Remove definitions, since they are set correctly in s/gnu-linux.h.
 +      * s/freebsd.h (START_FILES, LIB_STANDARD):
 +      * s/gnu-linux.h (START_FILES, LIB_STANDARD):
 +      * s/hpux10-20.h (START_FILES):
 +      * s/netbsd.h (START_FILES, LIB_STANDARD, START_FILES_1, END_FILES_1):
 +      Use $CRT_DIR in place of fixed /usr/lib, /lib directories.
 +
 +      * Makefile.in (LIBXP, LUCID_LIBW, WIDGET_OBJ): Set via configure.
 +      (MOTIF_LIBW): Use $LIBXP.
 +      (otherobj): Use $WIDGET_OBJ.
 +
 +2010-04-26  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * Makefile.in (LIBS_MACHINE): Remove, unused.
 +
 +      Use autoconf instead of cpp for LIB_MATH.
 +      * s/darwin.h (LIB_MATH): Do not define here, move to configure.
 +      * s/cygwin.h (LIB_MATH): Likewise.
 +      * Makefile.in (LIB_MATH): Do not define with cpp.
 +      (LIBES): Use autoconf for LIB_MATH.
 +
 +2010-04-26  Kenichi Handa  <handa@m17n.org>
 +
 +      * composite.c (Ffind_composition_internal): Fix the return value
 +      for an automatic composition.
 +
 +2010-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove all NO_ARG_ARRAY uses.
 +      * fns.c (concat2, concat3, nconc2):
 +      * eval.c (apply1, call1, call2, call3, call4, call5, call6)
 +      (call7): Remove NO_ARG_ARRAY usage, assume it's always true.
 +      * m/xtensa.h (NO_ARG_ARRAY):
 +      * m/template.h (NO_ARG_ARRAY):
 +      * m/sparc.h (NO_ARG_ARRAY):
 +      * m/sh3.h (NO_ARG_ARRAY):
 +      * m/mips.h (NO_ARG_ARRAY):
 +      * m/macppc.h (NO_ARG_ARRAY):
 +      * m/iris4d.h (NO_ARG_ARRAY):
 +      * m/intel386.h (NO_ARG_ARRAY):
 +      * m/ibms390x.h (NO_ARG_ARRAY):
 +      * m/ibms390.h (NO_ARG_ARRAY):
 +      * m/ibmrs6000.h (NO_ARG_ARRAY):
 +      * m/ia64.h (NO_ARG_ARRAY):
 +      * m/hp800.h (NO_ARG_ARRAY):
 +      * m/arm.h (NO_ARG_ARRAY):
 +      * m/amdx86-64.h (NO_ARG_ARRAY):
 +      * m/alpha.h (NO_ARG_ARRAY): Remove definition.
 +
 +2010-04-25  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c (display_line): Don't assume 2nd call to
 +      get_next_display_element cannot return zero.  (Bug#6030)
 +      (iterate_out_of_display_property): New function, body from pop_it.
 +      (pop_it): Use it.
 +
 +2010-04-24  Glenn Morris  <rgm@gnu.org>
 +
 +      * m/amdx86-64.h (START_FILES, LIB_STANDARD) [__OpenBSD__]:
 +      For clarity, revert to using fixed /usr/lib rather than $CRT_DIR.
 +      (START_FILES, LIB_STANDARD) [__FreeBSD__]: Merge into the generic case,
 +      since CRT_DIR defaults to /usr/lib.  Suggested by Dan Nicolaescu.
 +
 +2010-04-24  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c (display_line): Use `reseat' instead of `reseat_1', and
 +      use `get_next_display_element' and `set_iterator_to_next' to
 +      advance to the next character, when looking for the character that
 +      begins the next row.
 +
 +      * .gdbinit: Add a "set Fmake_symbol" line to force GDB to load the
 +      definition of "struct Lisp_Symbol".
 +
 +2010-04-24  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (CRT_DIR): New variable, set by configure.
 +      * m/amdx86-64.h, m/ibms390x.h (START_FILES, LIB_STANDARD):
 +      Use $CRT_DIR rather than HAVE_LIB64_DIR.  (Bug#5655)
 +
 +2010-04-23  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * Makefile.in: Remove C_SWITCH_X_MACHINE, unused.
 +
 +      * s/cygwin.h (LIBS_DEBUG): Remove, unused.
 +
 +      Remove redundant flags.
 +      * s/freebsd.h (C_SWITCH_SYSTEM):
 +      * s/hpux10-20.h (C_SWITCH_X_SYSTEM, LD_SWITCH_X_DEFAULT):
 +      * s/netbsd.h (C_SWITCH_SYSTEM):
 +      * s/openbsd.h (LD_SWITCH_X_DEFAULT): Remove, configure takes care
 +      of these.
 +
 +      Simplify m/intel386.h.
 +      * m/intel386.h (CRT0_DUMMIES): Remove, inline value in the only
 +      user: ecrt0.c.
 +      (SOLARIS2): Remove LOAD_AVE_TYPE, LOAD_AVE_CVT, LIBS_MACHINE, unused.
 +      (USG5_4): Move LOAD_AVE_TYPE, LOAD_AVE_CVT, FSCALE definitions to
 +      the only user: s/unixware.h.
 +      * ecrt0.c: Remove #ifndef static.  Inline CRT0_DUMMIES definition
 +      from m/intel386.h.
 +      * s/unixware.h (LOAD_AVE_TYPE, LOAD_AVE_CVT, FSCALE):
 +      Definitions moved here from m/intel386.h.
 +
 +      * m/mips.h: Remove #if 0 code.
 +
 +2010-04-23  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Fix display of composed characters from L2R scripts in bidi buffers.
 +      * xdisp.c (set_iterator_to_next, next_element_from_composition):
 +      After advancing IT past the composition, resync the bidi iterator
 +      with IT's position.  (Bug#5977)
 +
 +2010-04-23  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * Makefile.in (LD_SWITCH_MACHINE_TEMACS): Remove, unused.
 +      (TEMACS_LDFLAGS): Don't use LD_SWITCH_SYSTEM_TEMACS.
 +
 +2010-04-23  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * gtkutil.c: Include xsettings.h for Ftool_bar_get_system_style.
 +
 +2010-04-23  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Support `display' text properties and overlay strings in bidi buffers.
 +      * xdisp.c (pop_it): When the stack is popped after displaying
 +      from a string, bidi-iterate to exit from the text portion covered
 +      by the `display' property or overlay.  (Bug#5988, bug#5920)
 +
 +2010-04-23  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * m/macppc.h (LD_SWITCH_SYSTEM_TEMACS): Remove #undef.
 +      (LD_SWITCH_MACHINE_TEMACS): Remove, configure sets nocombreloc.
 +
 +      * s/netbsd.h (LD_SWITCH_SYSTEM_TEMACS): Remove, configure sets nocombreloc.
 +      * s/openbsd.h (LD_SWITCH_SYSTEM_TEMACS): Remove.
 +
 +      Simplify STARTFILES definition.
 +      * s/hpux10-20.h (START_FILES): Explicitly define here instead of
 +      relying on Makefile.in to define it.
 +      * s/cygwin.h (START_FILES): Likewise.
 +      * Makefile.in (STARTFILES): Remove conditional code, not needed anymore.
 +
 +      Clean up Solaris code.
 +      * s/sol2-6.h (LD_SWITCH_SYSTEM_TEMACS, C_SWITCH_X_SYSTEM)
 +      (LIB_MOTIF): Remove, configure takes care of this.
 +      (NOT_USING_MOTIF): Remove, unused.
 +      * xrdb.c: Remove #if 0-ed #include.
 +      (SYSV): Remove conditional for old SysV.
 +      * sysdep.c (closedir): Remove conditional code for Solaris,
 +      Solaris has closedir.
 +
 +2010-04-22  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsettings.c (read_and_apply_settings): Check if current_font is
 +      NULL before strcmp (Bug#6001).
 +
 +2010-04-21  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Clean up HP-UX files.
 +      * m/hp800.h (NO_REMAP, VIRT_ADDR_VARIES, DATA_SEG_BITS)
 +      (DATA_START, TEXT_START, LOAD_AVE_TYPE, LOAD_AVE_CVT)
 +      (LDAV_SYMBOL, index, rindex): Move definitions only used in HP-UX ...
 +      * s/hpux10-20.h: ... to the only user, here.
 +
 +2010-04-21  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * bidi.c (bidi_find_paragraph_start, bidi_at_paragraph_end): Don't
 +      use buffer-local values of paragraph-start and paragraph-separate.
 +      <paragraph_start_re, paragraph_separate_re>: Rename from
 +      fallback_paragraph_start_re and fallback_paragraph_separate_re.
 +      (Bug#5992)
 +
 +2010-04-21  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsettings.c: Qmonospace_font_name, Qtool_bar_style and
 +      current_tool_bar_style are new.
 +      (store_config_changed_event): Rename from store_font_changed_event.
 +      (XSETTINGS_TOOL_BAR_STYLE): New define.
 +      (SEEN_FONT, SEEN_TB_STYLE): New enum values.
 +      (struct xsettings): Add font and tb_style, set xft stuff inside #ifdef
 +      HAVE_XFT.
 +      (something_changedCB): store_font_changed_event is now
 +      store_config_changed_event.
 +      (parse_settings): Rename from parse_xft_settings.
 +      Read non-xft xsettings outside #ifdef HAVE_XFT.
 +      (read_settings): Rename from read_xft_settings.
 +      (apply_xft_settings): Take current settings as parameter.  Do not
 +      call read_(xft)_settings.
 +      (read_and_apply_settings): New function.
 +      (xft_settings_event): Do non-xft stuff out of HAVE_XFT.
 +      Call read_and_apply_settings if there are settings to be read.
 +      (init_xsettings): Rename from init_xfd_settings.
 +      Call read_and_apply_settings unconditionally.
 +      (xsettings_initialize): Call init_xsettings.
 +      (Ftool_bar_get_system_style): New function.
 +      (syms_of_xsettings): Define Qmonospace_font_name and
 +      Qtool_bar_style.  Initialize current_tool_bar_style to nil.
 +      defsubr Stool_bar_get_system_style.  Fprovide on
 +      dynamic-setting.
 +      Move misplaced HAVE_GCONF
 +
 +      * xsettings.h (Ftool_bar_get_system_style): Declare.
 +
 +      * xdisp.c: Vtool_bar_style, tool_bar_max_label_size,
 +      Qtext, Qboth, Qboth_horiz are new.
 +      (syms_of_xdisp): Intern Qtext, Qboth, Qboth_horiz, DEFVAR
 +      Vtool_bar_style, tool_bar_max_label_size.
 +
 +      * lisp.h: Extern declare Qtext, Qboth, Qboth_horiz.
 +
 +      * keyboard.c: QClabel is new.
 +      (parse_tool_bar_item): Take out QClabel from tool bar items.
 +      Try to construct a label if ther is no QClabel.
 +      (syms_of_keyboard): Intern :label as QClabel.
 +
 +      * dispextern.h (tool_bar_item_idx): TOOL_BAR_ITEM_LABEL is new.
 +      (Vtool_bar_style, tool_bar_max_label_size, DEFAULT_TOOL_BAR_LABEL_SIZE):
 +      New.
 +
 +      * Makefile.in (SOME_MACHINE_LISP): font-setting.el renamed to
 +      dynamic-setting.el.
 +
 +      * gtkutil.c (xg_tool_bar_menu_proxy): Handle label in tool bar item.
 +      (xg_make_tool_item, xg_show_toolbar_item): New function.
 +      (update_frame_tool_bar): Take label from TOOL_BAR_ITEM_LABEL.
 +      Call xg_make_tool_item to make a tool bar item.
 +      Call xg_show_toolbar_item.  Use wtoolbar instead of x->toolbar_widget.
 +
 +      * xterm.c (x_draw_image_relief): Take Vtool_bar_button_margin
 +      into account for toolbars.
 +
 +2010-04-21  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * data.c (make_blv): Declarations before code (Bug#5993).
 +
 +2010-04-21  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (DBUS_OBJ, GTK_OBJ, XMENU_OBJ, XOBJ):
 +      Define using autoconf, not cpp.
 +      (LIBXSM): New variable, set by autoconf.
 +      (LIBXT): Use $LIBXSM.
 +
 +2010-04-21  Dan Nicolaescu  <local_user@dannlt>
 +
 +      Remove NOMULTIPLEJOBS, unused.
 +      * s/template.h (NOMULTIPLEJOBS):
 +      * s/msdos.h (NOMULTIPLEJOBS): Remove, unused.
 +
 +      Simplify LD_SWITCH_SYSTEM_TEMACS usage.
 +      * s/freebsd.h (LD_SWITCH_SYSTEM_TEMACS):
 +      * s/gnu-linux.h (LD_SWITCH_SYSTEM_TEMACS): Remove, configure
 +      detects -znocombreloc and passes it to the linker
 +      * s/hpux10-20.h (LD_SWITCH_SYSTEM_TEMACS): Remove, empty.
 +
 +2010-04-21  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (LIBSELINUX_LIBS): Move out of #ifdef.
 +
 +2010-04-21  Karel Klíč  <kklic@redhat.com>
 +
 +      * Makefile.in (LIBSELINUX_LIBS): New.
 +      (LIBES): Add $LIBSELINUX_LIBS.
 +      * eval.c, lisp.h (call7): New function.
 +      * fileio.c [HAVE_LIBSELINUX]: Include selinux headers.
 +      (Ffile_selinux_context, Fset_file_selinux_context):
 +      New functions.
 +      (Fcopy_file): New parameter preserve-selinux-context.
 +      (Frename_file): Preserve selinux context when renaming by copy-file.
 +
 +2010-04-21  Juanma Barranquero  <lekktu@gmail.com>
 +            Eli Zaretskii  <eliz@gnu.org>
 +
 +      Don't depend on cm.c or termcap.c on Windows, use stubs.
 +      * makefile.w32-in (OBJ1): Remove cm.$(O) and termcap.$(O).
 +      ($(BLD)/cm.$(O), $(BLD)/termcap.$(O)): Remove.
 +      * w32console.c (current_tty, cost): New vars; lifted from cm.c.
 +      (evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear)
 +      (sys_tputs, sys_tgetstr): New stubs.
 +      * s/ms-w32.h (chcheckmagic, cmcostinit, cmgoto, cmputc, Wcm_clear)
 +      (tputs, tgetstr): New; define to sys_*.
 +
 +2010-04-20  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * buffer.c (syms_of_buffer) <bidi-display-reordering>: Doc fix.
 +
 +2010-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
 +      Just signal a warning rather than an error when inside a let.
 +      (Fmake_variable_frame_local): Add the same test.
 +
 +      * font.c (syms_of_font): Make the style table vars read-only.
 +
 +      * buffer.h (struct buffer): Remove unused var `direction_reversed'.
 +      * buffer.c (init_buffer_once, syms_of_buffer): Remove its initialization.
 +
 +      * bidi.c (bidi_initialize): Simplify fallback_paragraph_*_re init.
 +
 +2010-04-20  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Fix R2L paragraph display on TTY.
 +
 +      * xdisp.c (unproduce_glyphs): New function.
 +      (display_line): Use it when produced glyphs are discarded from R2L
 +      glyph rows.
 +      (append_composite_glyph): In R2L rows, prepend the glyph rather
 +      than appending it.
 +
 +      * term.c (append_composite_glyph): In R2L rows, prepend the glyph
 +      rather than append it.  Set up the resolved_level and bidi_type
 +      attributes of the appended glyph.
 +      (produce_special_glyphs): Mirror the backslash continuation
 +      character in R2L lines.
 +
 +      Implement display of R2L paragraphs in GUI sessions.
 +
 +      * xdisp.c [HAVE_WINDOW_SYSTEM]: Add prototype for
 +      append_stretch_glyph.
 +      (set_cursor_from_row) <cursor_x>: Remove unused variable.
 +      Fix off-by-one error in computing x at end of text in the row.
 +      (append_stretch_glyph): In reversed row, prepend the glyph rather
 +      than append it.  Set resolved_level and bidi_type of the glyph.
 +      (extend_face_to_end_of_line): If the row is reversed, prepend a
 +      stretch glyph whose width is such that the rightmost glyph will be
 +      drawn at the right margin of the window.  Fix off-by-one error on
 +      TTY frames in testing whether a line needs face extension.
 +      Fix face extension at ZV.  If this is the last glyph row, use
 +      DEFAULT_FACE_ID, to avoid painting the rest of the window with the
 +      region face.
 +      (set_cursor_from_row, display_line):
 +      Use MATRIX_ROW_CONTINUATION_LINE_P instead of testing value of
 +      row->continuation_lines_width.
 +      (next_element_from_buffer): Don't call bidi_paragraph_init if we
 +      are at ZV.  Fixes a crash when reseated to ZV by
 +      try_window_reusing_current_matrix.
 +      (display_and_set_cursor, erase_phys_cursor): Handle negative HPOS,
 +      which happens with R2L glyph rows.  Fixes a crash when inserting a
 +      character at end of an R2L line.
 +      (set_cursor_from_row): Don't be fooled by truncated rows: don't
 +      treat them as having zero-width characters.  Improve comments.
 +      Don't reverse pos_before and pos_after for reversed glyph rows.
 +      Set cursor.x to negative value when the cursor might be on the
 +      left fringe.
 +      (IT_OVERFLOW_NEWLINE_INTO_FRINGE): For R2L lines, consider the
 +      left fringe, not the right one.
 +      (notice_overwritten_cursor, draw_phys_cursor_glyph)
 +      (erase_phys_cursor): For reversed cursor_row, support cursor on
 +      the left fringe.
 +
 +      * fringe.c (update_window_fringes): For R2L rows, swap the bitmaps
 +      of continuation indicators on the fringes.
 +      (draw_fringe_bitmap): For reversed glyph rows, allow cursor on the
 +      left fringe.
 +
 +      * w32term.c (w32_draw_window_cursor): For reversed glyph rows,
 +      draw cursor on the left fringe.
 +
 +      * xterm.c (x_draw_window_cursor): For reversed glyph rows, draw
 +      cursor on the left fringe.
 +
 +      * dispnew.c (update_text_area): Handle reversed desired rows when
 +      the cursor is on the left fringe.
 +      (set_window_cursor_after_update): Limit cursor's hpos by -1 from
 +      below, not by 0, for when the cursor is on the left fringe.
 +
 +2010-04-20  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * gtkutil.c (xg_event_is_for_scrollbar): Check if grabbed
 +      widget is a scrollbar.
 +
 +2010-04-20  Kenichi Handa  <handa@m17n.org>
 +
 +      * charset.c (char_charset): Consider Vcharset_non_preferred_head
 +      only when the arg CHARSET_LIST is nil.
 +
 +2010-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      Make variable forwarding explicit rather the using special values.
 +      Basically, this makes the structure of buffer-local values and object
 +      forwarding explicit in the type of Lisp_Symbols rather than use
 +      special Lisp_Objects for that.  This tends to lead to slightly more
 +      verbose code, but is more C-like, simpler, and makes it easier to make
 +      sure we handled all cases, among other things by letting the compiler
 +      help us check it.
 +      * lisp.h (enum Lisp_Misc_Type, union Lisp_Misc):
 +      Removing forwarding objects.
 +      (enum Lisp_Fwd_Type, enum symbol_redirect, union Lisp_Fwd): New types.
 +      (struct Lisp_Symbol): Make the various forms of variable-forwarding
 +      explicit rather than hiding them inside Lisp_Object "values".
 +      (XFWDTYPE): New macro.
 +      (XINTFWD, XBOOLFWD, XOBJFWD, XKBOARD_OBJFWD): Redefine.
 +      (XBUFFER_LOCAL_VALUE): Remove.
 +      (SYMBOL_VAL, SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL)
 +      (SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD): New macros.
 +      (SYMBOL_VALUE, SET_SYMBOL_VALUE): Remove.
 +      (struct Lisp_Intfwd, struct Lisp_Boolfwd, struct Lisp_Objfwd)
 +      (struct Lisp_Buffer_Objfwd, struct Lisp_Kboard_Objfwd):
 +      Remove the Lisp_Misc_* header.
 +      (struct Lisp_Buffer_Local_Value): Redefine.
 +      (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): New macros.
 +      (struct Lisp_Misc_Any): Add filler to get the right size.
 +      (struct Lisp_Free): Use struct Lisp_Misc_Any rather than struct
 +      Lisp_Intfwd.
 +      (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
 +      (DEFVAR_KBOARD): Allocate a forwarding object.
 +      * data.c (do_blv_forwarding, store_blv_forwarding): New macros.
 +      (let_shadows_global_binding_p): New function.
 +      (union Lisp_Val_Fwd): New type.
 +      (make_blv): New function.
 +      (swap_in_symval_forwarding, indirect_variable, do_symval_forwarding)
 +      (store_symval_forwarding, swap_in_global_binding, Fboundp)
 +      (swap_in_symval_forwarding, find_symbol_value, Fset)
 +      (let_shadows_buffer_binding_p, set_internal, default_value)
 +      (Fset_default, Fmake_variable_buffer_local, Fmake_local_variable)
 +      (Fkill_local_variable, Fmake_variable_frame_local)
 +      (Flocal_variable_p, Flocal_variable_if_set_p)
 +      (Fvariable_binding_locus):
 +      * xdisp.c (select_frame_for_redisplay):
 +      * lread.c (Fintern, Funintern, init_obarray, defvar_int)
 +      (defvar_bool, defvar_lisp_nopro, defvar_lisp, defvar_kboard):
 +      * frame.c (store_frame_param):
 +      * eval.c (Fdefvaralias, Fuser_variable_p, specbind, unbind_to):
 +      * bytecode.c (Fbyte_code) <varref, varset>: Adapt to the new symbol
 +      value structure.
 +      * buffer.c (PER_BUFFER_SYMBOL): Move from buffer.h.
 +      (clone_per_buffer_values): Only adjust markers into the current buffer.
 +      (reset_buffer_local_variables): PER_BUFFER_IDX is never -2.
 +      (Fbuffer_local_value, set_buffer_internal_1)
 +      (swap_out_buffer_local_variables):
 +      Adapt to the new symbol value structure.
 +      (DEFVAR_PER_BUFFER): Allocate a Lisp_Buffer_Objfwd object.
 +      (defvar_per_buffer): Take a new arg for the fwd object.
 +      (buffer_lisp_local_variables): Return a proper alist (different fix
 +      for bug#4138).
 +      * alloc.c (Fmake_symbol): Use SET_SYMBOL_VAL.
 +      (Fgarbage_collect): Don't handle buffer_defaults specially.
 +      (mark_object): Handle new symbol value structure rather than the old
 +      special Lisp_Misc_* objects.
 +      (gc_sweep) <symbols>: Free also the buffer-local-value objects.
 +      * term.c (set_tty_color_mode):
 +      * bidi.c (bidi_initialize): Don't access the ->value field directly.
 +      * buffer.h (PER_BUFFER_VAR_OFFSET): Don't bother with
 +      a buffer_local_flags.
 +      * print.c (print_object): Get rid of impossible forwarding objects.
 +
 +2010-04-19  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * bidi.c (bidi_get_type, bidi_get_category)
 +      (bidi_at_paragraph_end, bidi_resolve_weak, bidi_resolve_neutral)
 +      (bidi_type_of_next_char, bidi_level_of_next_char):
 +      Declare static.  Use `INLINE' rather than `inline'.
 +
 +2010-04-19  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * dired.c (Ffile_attributes): Fix typo in docstring.
 +
 +2010-04-19  Adrian Robert  <Adrian.B.Robert@gmail.com>
 +
 +      * nsmenu.m (EmacsDialog-runDialogAt:): Declare ret as
 +      NSInteger (Bug#5811).
 +
 +2010-04-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +
 +      * s/darwin.h (PTY_ITERATION, PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF)
 +      (PTY_OPEN): New defines.  Use openpty (Bug#726, Bug#5819).
 +
 +2010-04-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
  
 -2010-08-06  Kenichi Handa  <handa@m17n.org>
 +      * frame.h (FRAME_LINE_TO_PIXEL_Y): Add missing parenthesis.
  
 -      * charset.c: Include <stdlib.h>
 -      (struct charset_sort_data): New struct.
 -      (charset_compare): New function.
 -      (Fsort_charsets): New function.
 -      (syms_of_charset): Declare Fsort_charsets as a Lisp function.
 +2010-04-19  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * coding.c (decode_coding_iso_2022): Fix checking of dimension
 -      number in CTEXT extended segment.
 +      * xdisp.c (prepare_menu_bars): Don't call ns_set_doc_edited for
 +      terminal frames (Bug#5837).
  
 -2010-08-01  Juanma Barranquero  <lekktu@gmail.com>
 +2010-04-19  Eli Zaretskii  <eliz@gnu.org>
  
 -      * w32fns.c (syms_of_w32fns) <x-max-tooltip-size>: Fix typo in docstring.
 -      * xfns.c (syms_of_xfns) <x-max-tooltip-size>: Reflow docstring.
 +      * .gdbinit (xsubchartable): New command.
  
 -2010-07-30  Juanma Barranquero  <lekktu@gmail.com>
 +2010-04-19  Eli Zaretskii  <eliz@gnu.org>
  
 -      * fns.c (Fsubstring_no_properties, Fnthcdr, Ffeaturep)
 -      (Fhash_table_size): Fix typos in docstrings.
 -      (Fmake_hash_table): Doc fix.
 +      * xdisp.c (display_line): Don't write beyond the last glyph row in
 +      the desired matrix.  Fixes a crash in "emacs -nw" (bug#5972), see
 +      http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00075.html
 +      and
 +      http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00213.html
  
 -2010-07-28  Juanma Barranquero  <lekktu@gmail.com>
 +2010-04-18  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -      * minibuf.c (syms_of_minibuf) <read-buffer-function>:
 -      Doc fix (bug#5625).
 +      * alloc.c (Fpurecopy): Hash-cons if requested.
 +      (syms_of_alloc): Update purify-flag docstring.
  
 -2010-07-27  Ken Brown  <kbrown@cornell.edu>
 +2010-04-18  Jan Djärv  <jan.h.d@swipnet.se>
  
 -      * dired.c (DIRENTRY_NONEMPTY) [cygwin]: Use d_ino instead of
 -      the MSDOS definition.
 +      * gtkutil.c (xg_set_geometry): Set size in geometry string also.
 +      (x_wm_set_size_hint): Set USER_POS in hint_flags (Bug#5968).
  
 -2010-07-25  Christoph Scholtes  <cschol2112@gmail.com>
 +2010-04-17  Eli Zaretskii  <eliz@gnu.org>
  
 -      * minibuf.c (Fread_buffer): Doc fix (bug#6528).
 +      Fix a crash when an NSM character is inserted at BEGV.
  
 -2010-07-22  Christoph Scholtes  <cschol2112@gmail.com>
 +      * bidi.c (bidi_init_it): Fix initialization of bidi_it->prev.
 +      (bidi_resolve_weak): Don't use prev.type_after_w1 if it is
 +      NEUTRAL_B or UNKNOWN_BT.
  
 -      * window.c (Fwindow_height): Doc fix (bug#6518).
 +2010-04-16  Eli Zaretskii  <eliz@gnu.org>
  
 -2010-07-21  Juanma Barranquero  <lekktu@gmail.com>
 +      * xdisp.c (set_cursor_from_row): Don't consider possibility of
 +      other rows with cursor unless they are different from this row and
 +      this row is part of a continued line.  (Bug#5943)
  
 -      * buffer.c (syms_of_buffer) <fringe-indicator-alist>: Doc fix.
 +2010-04-16  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -2010-07-17  Jan Djärv  <jan.h.d@swipnet.se>
 +      * s/freebsd.h: Restore osreldate.h include.
 +      Suggested by Naohiro Aota.
  
 -      * gtkutil.c (xg_event_is_for_menubar): Also check that event window
 -      is related to the menu bar (Bug#6499).
 +2010-04-16  Jan Djärv  <jan.h.d@swipnet.se>
  
 -2010-07-14  Jan Djärv  <jan.h.d@swipnet.se>
 +      * xmenu.c (apply_systemfont_to_menu): *childs was incorrectly used.
  
 -      * xterm.h (x_menubar_window_to_frame): Second parameter is XEvent*.
 +2010-04-16  Ken Brown  <kbrown@cornell.edu>  (tiny change)
  
 -      * xterm.c (handle_one_xevent): Pass event to x_menubar_window_to_frame.
 +      * s/cygwin.h: Avoid linking against static libgcc.
  
 -      * xmenu.c (x_activate_menubar): Revert previous fix for Bug#6499,
 -      i.e. don't put back ButtonRelease (Bug#6608).
 +2010-04-15  Juri Linkov  <juri@jurta.org>
  
 -      * xfns.c (x_menubar_window_to_frame): Take XEvent as second parameter
 -      instead of Window.  Call xg_event_is_for_menubar when
 -      USE_GTK (Bug#6499).
 +      * window.c: Add Qscroll_command.
 +      Remove Vscroll_preserve_screen_position_commands.
 +      (window_scroll_pixel_based, window_scroll_line_based): Check the
 +      `scroll-command' property on the last command instead of searching
 +      the last command in Vscroll_preserve_screen_position_commands.
 +      (syms_of_window): Initialize and staticpro `Qscroll_command'.
 +      Put Qscroll_command property on Qscroll_up and Qscroll_down.
 +      (scroll-preserve-screen-position): Doc fix.
 +      (Vscroll_preserve_screen_position_commands): Remove variable.
  
 -      * gtkutil.h (xg_event_is_for_menubar): Declare.
 +2010-04-15  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * gtkutil.c (xg_event_is_for_menubar): New function (Bug#6499).
 +      * xdisp.c (message): Do not use NO_ARG_ARRAY.
  
 -2010-07-14  Eli Zaretskii  <eliz@gnu.org>
 +2010-04-14  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * w32fns.c (x_set_foreground_color): Fix setting the cursor color
 -      when it's the same as the old foreground.  (Bug#6609)
 +      Reduce cpp use in Makefile.in.
 +      * Makefile.in (DBUS_CFLAGS, DBUS_LIBS, GCONF_CFLAGS, GCONF_LIBS)
 +      (LIBSOUND, CFLAGS_SOUND, RSVG_LIBS, RSVG_CFLAGS, INTERVALS_H)
 +      (GETLOADAVG_LIBS, RUN_TEMACS): Move to the autoconf section.
 +      (ORDINARY_LINK): Remove, defined in src/s/gnu.h.
 +      (CRT0_COMPILE): Remove, inline it in the only user.
  
 -2010-07-10  Chong Yidong  <cyd@stupidchicken.com>
 +2010-04-14  Juri Linkov  <juri@jurta.org>
  
 -      * xfaces.c (realize_face): Garbage the frame if a face is removed
 -      (Bug#6593).
 +      * window.c (keys_of_window): Rebind `C-v' from `scroll-up' to
 +      `scroll-up-command' and `M-v' from `scroll-down' to
 +      `scroll-down-command'.
  
 -2010-07-05  Andreas Schwab  <schwab@linux-m68k.org>
 +2010-04-14  Juri Linkov  <juri@jurta.org>
  
 -      * keyboard.c: Remove duplicate <setjmp.h>.
 -      (read_key_sequence): Remove volatile qualifiers.
 +      * window.c (Vscroll_preserve_screen_position_commands): New variable
 +      with the default value as the list of Qscroll_down and Qscroll_up.
 +      (window_scroll_pixel_based, window_scroll_line_based): Search the
 +      last command in the list Vscroll_preserve_screen_position_commands
 +      instead of comparing with Qscroll_up and Qscroll_down.
  
 -2010-07-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +2010-04-13  Jan Djärv  <jan.h.d@swipnet.se>
  
 -      * dispextern.h (FRINGE_HEIGHT_BITS): New define.
 -      (struct glyph_row): New members left_fringe_offset and
 -      right_fringe_offset.
 +      * gtkutil.c (xg_set_geometry): Set geometry for PPosition also.
 +      (x_wm_set_size_hint): Dont set position flags, gtk_window_parse_geometry
 +      does that.
  
 -      * xterm.c (x_draw_fringe_bitmap): Don't clip bottom aligned bitmap
 -      specially.
 -      * w32term.c (w32_draw_fringe_bitmap): Likewise.
 -      * nsterm.m (ns_draw_fringe_bitmap): Likewise.
 +      * xfns.c (Fx_create_frame, x_create_tip_frame): Set default border width
 +      to zero.
  
 -      * fringe.c (draw_fringe_bitmap_1): Don't clip bitmap here.
 -      Take account of bitmap offset.
 -      (draw_window_fringes): Take account of window vscroll.
 -      (update_window_fringes): Likewise.  Extend top-aligned top indicator
 -      or bottom-aligned bottom indicator to adjacent rows if it doesn't fit
 -      in one row.  Don't set redraw_fringe_bitmaps_p outside row comparison.
 -      Set left_fringe_offset and right_fringe_offset (Bug#5634, Bug#6325).
 +2010-04-13  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -2010-07-04  Juanma Barranquero  <lekktu@gmail.com>
 +      * term.c (init_tty): Move common text outside of #ifdef TERMINFO.
  
 -      * w32fns.c (Qtooltip): Declare.
 -      Suggested by Andy Moreton <andrewjmoreton@gmail.com>.
 +      Try to solve the problem of spurious EOF chars in long lines of text
 +      sent to interactive subprocesses.
 +      * sysdep.c (child_setup_tty): Do not enable ICANON any more.
 +      (system_process_attributes): Remove unused var `ttotal'.
 +      * process.c (send_process): Don't bother breaking long line with EOF
 +      chars when talking to ttys any more.
 +      (wait_reading_process_output): Output a warning when called in such
 +      a way that it could block without being interruptible.
  
 -2010-07-03  Jan Djärv  <jan.h.d@swipnet.se>
 +      Try to detect file modification within the same second.
 +      * buffer.h (struct buffer): New field modtime_size.
 +      * buffer.c (reset_buffer): Initialize it.
 +      * fileio.c (Finsert_file_contents, Fwrite_region): Set it.
 +      (Fverify_visited_file_modtime): Check it.
 +      (Fclear_visited_file_modtime, Fset_visited_file_modtime): Clear it.
 +      (Fset_visited_file_modtime): Set (or clear) it.
  
 -      * xmenu.c (x_activate_menubar): Send Press/Release for Gtk+ to avoid
 -      grab on just Press (Bug#6499).
 +2010-04-12  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -2010-07-02  Chong Yidong  <cyd@stupidchicken.com>
 +      * process.c (status_notify): Remove unused var `ro'.
  
 -      * frame.c (Qtooltip): New var.
 -      (delete_frame): Use it.  Fix faulty if statement.  Don't update
 -      mode line for tooltip frames.  Suggested by Martin Rudalics.
 +2010-04-12  Jan Djärv  <jan.h.d@swipnet.se>
  
 -      * xfns.c (x_create_tip_frame):
 -      * w32fns.c (x_create_tip_frame): Use it.
 +      * xfns.c (select_visual): Don't call error if XGetVisualInfo returns
 +      more than one visual (Bug#5938).
  
 -2010-06-30  Naohiro Aota  <naota@elisp.net>  (tiny change)
 +2010-04-12  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * xftfont.c (xftfont_open): Check font width one by one also when
 -      spacing is dual.
 +      * Makefile.in (C_SWITCH_SYSTEM,C_SWITCH_MACHINE,C_SWITCH_X_SITE):
 +      Undefine.
  
 -      * ftfont.c (ftfont_open): Ditto.
 +2010-04-11  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -2010-06-26  Andreas Schwab  <schwab@linux-m68k.org>
 +      Remove C_SWITCH_SYSTEM_TEMACS.
 +      * s/darwin.h (C_SWITCH_SYSTEM_TEMACS): Remove.
 +      (malloc, realloc, free): Use emacs, not temacs for conditional
 +      definition.
  
 -      * alloc.c (Fmake_byte_code): Don't access undefined argument
 -      (Bug#6517).
 +      * Makefile.in (C_SWITCH_SYSTEM_TEMACS): Remove.
 +      (ALL_CFLAGS): Do not use C_SWITCH_SYSTEM_TEMACS.
  
 -2010-06-25  Chong Yidong  <cyd@stupidchicken.com>
 +      Use autoconf, not cpp for some variables.
 +      * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE)
 +      (C_SWITCH_X_SITE): Define using autoconf, not cpp.
 +      (ALL_CFLAGS): Use them as make variables.
 +      (really-lwlib, really-oldXMenu): Do not pass them.
  
 -      * xdisp.c (next_element_from_image): Ensure that after-strings are
 -      read the next time we hit handle_stop (Bug#1336).
 +2010-04-11  Jan Djärv  <jan.h.d@swipnet.se>
  
 -2010-06-23  Andreas Schwab  <schwab@linux-m68k.org>
 +      * xmenu.c (apply_systemfont_to_dialog): New.
 +      (create_and_show_dialog): Call apply_systemfont_to_dialog if HAVE_XFT.
  
 -      * lread.c (read1): Signal error if #s is not followed by paren.
 +2010-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -2010-06-19  Chong Yidong  <cyd@stupidchicken.com>
 +      * process.c (exec_sentinel): Preserve current-buffer.
  
 -      * image.c (free_image): Mark frame as garbaged (Bug#6426).
 +      * process.c (read_process_output): Move the save-current-buffer to
 +      apply to both the filter and the non-filter branches.
  
 -      * keymap.c (Fdefine_key): Doc fix (Bug#6460).
 +2010-04-10  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -2010-06-15  Glenn Morris  <rgm@gnu.org>
 +      * s/msdos.h (UNEXEC): New definition.
  
 -      * editfns.c (Fbyte_to_string): Pacify compiler.
 +2010-04-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
  
 -2010-06-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 +      * dispextern.h (TRY_WINDOW_CHECK_MARGINS)
 +      (TRY_WINDOW_IGNORE_FONTS_CHANGE): New defines.
  
 -      * dbusbind.c (xd_append_arg): Don't "make-unibyte" the string.
 -      Check `object's type before accessing its guts.
 +      * xdisp.c (try_window): Change arg from CHECK_MARGINS to FLAGS.
 +      Don't abort with fonts change if TRY_WINDOW_IGNORE_FONTS_CHANGE is
 +      set in FLAGS.  Callers with non-zero CHECK_MARGINS changed to use
 +      TRY_WINDOW_CHECK_MARGINS.
  
 -2010-06-08  Andreas Schwab  <schwab@linux-m68k.org>
 +      * xfns.c (Fx_show_tip): Undo last change.  Call try_window with
 +      TRY_WINDOW_IGNORE_FONTS_CHANGE (Bug#2423).  Subtract last glyph's
 +      width only when it is for padding.
  
 -      * minibuf.c (Fall_completions): Add more checks.
 +2010-04-09  Jan Djärv  <jan.h.d@swipnet.se>
  
 -2010-06-08  Juanma Barranquero  <lekktu@gmail.com>
 +      * xfns.c (Fx_show_tip): Call try_window in a loop until
 +      fonts_changed_p is zero (Bug#2423).
  
 -      * minibuf.c (Fall_completions): Check COLLECTION's size (bug#6378).
 +2010-04-08  Eli Zaretskii  <eliz@gnu.org>
  
 -2010-06-03  Andreas Schwab  <schwab@linux-m68k.org>
 +      * xdisp.c (set_cursor_from_row): Don't dereference glyphs beyond
 +      the end of TEXT_AREA.  (Bug#5856)
  
 -      * process.c (conv_lisp_to_sockaddr): Fix conversion of IPv4
 -      address.  (Bug#6346)
 +2010-04-08  Jan Djärv  <jan.h.d@swipnet.se>
  
 -2010-06-03  Juanma Barranquero  <lekktu@gmail.com>
 +      * xsettings.c (XSETTINGS_FONT_NAME): Move XSETTINGS_FONT_NAME out of
 +      HAVE_GCONF.
  
 -      * ccl.c (Fccl_program_p): Fix typo in docstring.
 +2010-04-08  Eli Zaretskii  <eliz@gnu.org>
  
 -2010-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 +      * bidi.c (bidi_resolve_weak): Use prev.type_after_w1, instead of
 +      prev.orig_type, for resolving type of NSM.  (Bug#5858)
  
 -      * keymap.c (Fwhere_is_internal): Fix handling of remapping (in thread
 -      of bug#6305).
 +2010-04-08  Jan Djärv  <jan.h.d@swipnet.se>
  
 -2010-05-27  Chong Yidong  <cyd@stupidchicken.com>
 +      * xsettings.c (current_font, SYSTEM_FONT, XSETTINGS_FONT_NAME): New.
 +      (parse_xft_settings): Also check for XSETTINGS_FONT_NAME and save that
 +      in current_font.
 +      (init_gconf): Read value of SYSTEM_FONT and save it in current_font.
 +      (Ffont_get_system_normal_font, xsettings_get_system_normal_font):
 +      New functions.
 +      (syms_of_xsettings): Initialize current_font.
 +      defsubr Sfont_get_system_normal_font.
  
 -      * xdisp.c (redisplay_window): After redisplay, check if point is
 -      still valid before setting it (Bug#6177).
 +      * xsettings.h (Ffont_get_system_normal_font)
 +      (xsettings_get_system_normal_font): Declare.
  
 -2010-05-20  enami tsugutomo  <tsugutomo.enami@jp.sony.com>
 +      * xfns.c (extern xlwmenu_default_font): Remove.
 +      (Fx_create_frame): Remove setting of xlwmenu_default_font, moved
 +      to xlwmenu.c.
  
 -      * s/netbsd.h: If terminfo is found, use it in preference to
 -      termcap.  (Bug#6190)  [Backport from trunk]
 +      * menu.c (digest_single_submenu): If USE_LUCID and HAVE_XFT, encode
 +      menu items in UTF-8.
  
 -2010-05-20  Kevin Ryde  <user42@zip.com.au>
 +      * xmenu.c: include xsettings.h and xlwmenu.h if USE_LUCID.
 +      (apply_systemfont_to_menu): New function.
 +      (set_frame_menubar, create_and_show_popup_menu):
 +      Call apply_systemfont_to_menu.
  
 -      * keyboard.c (Vlast_command, Vkeyboard_translate_table)
 -      (Voverriding_terminal_local_map, Vsystem_key_alist)
 -      (Vlocal_function_key_map): Fix manual link in docstring (Bug#6224).
 +2010-04-07  Jan Djärv  <jan.h.d@swipnet.se>
  
 -2010-05-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 +      * frame.h (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Don't use
 +      FRAME_LINE_TO_PIXEL_Y.
  
 -      * editfns.c (Fbyte_to_string): New function.
 +      * xterm.c (x_set_window_size_1): Don't add border_width/height to
 +      pixelwidth/height.
  
 -2010-05-18  Chong Yidong  <cyd@stupidchicken.com>
 +2010-04-07  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * character.c (Fstring, Funibyte_string): Use SAFE_ALLOCA to
 -      prevent stack overflow if number of arguments is too large
 -      (Bug#6214).
 +      Simplify code for HP machines.
 +      * m/hp800.h (LOAD_AVE_TYPE, LOAD_AVE_CVT, NO_REMAP): Do not define
 +      for GNU_LINUX, not needed.
 +      (UNEXEC, NEED_BSDTTY): Move definitions...
 +      * s/hpux10-20.h (UNEXEC, NEED_BSDTTY): ... here.
  
 -2010-05-11  Eli Zaretskii  <eliz@gnu.org>
 +      * m/iris4d.h (UNEXEC): Move definition ...
 +      * s/irix6-5.h (UNEXEC): ... here.
  
 -      * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(SRC)/w32.h.
 +2010-04-04  Jan Djärv  <jan.h.d@swipnet.se>
  
 -      * w32fns.c: Include w32.h.
 -      (Fw32_shell_execute): Decode the error message before passing it
 -      to `error'.  (Bug#6126)
 +      * xfns.c (set_machine_and_pid_properties): New function.
 +      (Fx_create_frame): Call set_machine_and_pid_properties.
  
 -2010-05-11  Karel Klic  <kklic@redhat.com>
 +2010-04-03  Eli Zaretskii  <eliz@gnu.org>
  
 -      * ftfont.c: Fix incorrect parentheses of #if condition for
 -      definining M17N_FLT_USE_NEW_FEATURE.
 +      * bidi.c (bidi_resolve_explicit, bidi_level_of_next_char):
 +      Check bidi_it->bytepos against ZV_BYTE instead of bidi_it->ch against
 +      BIDI_EOB.  Fixes infloop with vertical cursor motion at ZV.
  
 -2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
 +      * w32fns.c (x_create_tip_frame): Copy `parms' before we modify it
 +      in this function.  (Bug#5703)
  
 -      * Version 23.2 released.
 +2010-04-03  Chong Yidong  <cyd@stupidchicken.com>
  
 -2010-04-30  Andreas Schwab  <schwab@linux-m68k.org>
 +      * nsterm.h: Fix last change.
  
 -      * composite.c (autocmp_chars): Save point as marker before calling
 -      auto-composition-function (Bug#5984).
 +2010-04-03  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * lisp.h (restore_point_unwind): Add prototype.
 +      * m/intel386.h (NO_REMAP): Move definition ...
 +      * s/msdos.h (NO_REMAP): ... here.
  
 -      * fileio.c (restore_point_unwind): Remove static attribute.
 +      * m/vax.h (CRT0_DUMMIES): Remove, unused.
  
 -2010-04-23  Kenichi Handa  <handa@m17n.org>
 +      * ecrt0.c: Remove MSDOS, m68k and __sparc__ conditionals, file not
 +      used on those platforms.
  
 -      * ftfont.c (M17N_FLT_USE_NEW_FEATURE): Define it if we can use the
 -      new feature of libotf and m17n-flt.
 -      (ftfont_check_otf) [M17N_FLT_USE_NEW_FEATURE]:
 -      Call OTF_check_features even if no specific feature is given.
 -      (PACK_OTF_TAG) [M17N_FLT_USE_NEW_FEATURE]: New macro.
 -      (ftfont_drive_otf) [M17N_FLT_USE_NEW_FEATURE]: Handle the case
 -      that OUT is NULL.  Use OTF_drive_gsub_with_log and
 -      OTF_drive_gpos_with_log instead of OTF_drive_gsub and
 -      OTF_drive_gpos.
 -      (ftfont_try_otf) [M17N_FLT_USE_NEW_FEATURE]: New function.
 -      (ftfont_shape_by_flt) [M17N_FLT_USE_NEW_FEATURE]:
 -      Setup mflt_enable_new_feature and mflt_try_otf.
 +2010-04-02  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -2010-04-19  Juanma Barranquero  <lekktu@gmail.com>
 +      Remove extern errno declarations.
 +      * xterm.c:
 +      * xrdb.c:
 +      * w32term.c:
 +      * unexec.c:
 +      * unexaix.c:
 +      * sysdep.c:
 +      * process.c:
 +      * lread.c:
 +      * keyboard.c:
 +      * floatfns.c:
 +      * filelock.c:
 +      * fileio.c:
 +      * emacs.c (main):
 +      * ecrt0.c:
 +      * dispnew.c:
 +      * callproc.c:
 +      * buffer.c: Remove errno extern declarations.
 +      * s/netbsd.h (NEED_ERRNO): Remove.
  
 -      * dired.c (Ffile_attributes): Fix typo in docstring.
 +2010-04-01  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -2010-04-13  Adrian Robert  <Adrian.B.Robert@gmail.com>
 +      Remove all uses of LIBX11_SYSTEM.
 +      * Makefile.in (LIBX11_SYSTEM): Remove.
 +      * s/msdos.h (LIBX11_SYSTEM): Do not define, define LIBS_SYSTEM
 +      instead.
  
 -      * nsmenu.m (EmacsDialog-runDialogAt:): Declare ret as
 -      NSInteger (Bug#5811).
 +2010-04-01  Eli Zaretskii  <eliz@gnu.org>
  
 -2010-04-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +      Remove support for DJGPP v1.x (bug#5813).
  
 -      * s/darwin.h (PTY_ITERATION, PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF)
 -      (PTY_OPEN): New defines.  Use openpty (Bug#726, Bug#5819).
 +      * w16select.c (__dpmi_int): Remove DJGPP v1.x compatibility.
 +      * s/msdos.h:
 +      * unexec.c (make_hdr, copy_text_and_data):
 +      * sysdep.c (wait_for_termination, sys_subshell):
 +      * msdos.c (dos_set_window_size, msdos_set_cursor_shape)
 +      (IT_set_terminal_modes, __write, _rename, gethostname)
 +      (gettimeofday, alarm, fork, kill, dos_ttraw, dos_ttcooked)
 +      (run_msdos_command, abort): Remove DJGPP v1.x code and tests of
 +      the value of __DJGPP__.
 +      (nice, pause, sigsetmask, sigblock): Remove DJGPP v1.x
 +      compatibility code.
 +      * lread.c:
 +      * gmalloc.c (memalign):
 +      * fileio.c (Fcopy_file, check_executable, Ffile_modes):
 +      * emacs.c (main):
 +      * dosfns.c (init_dosfns):
 +      * dired.c (file_name_completion_stat): Remove tests of __DJGPP__.
  
 -2010-04-08  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +2010-04-01  Eli Zaretskii  <eliz@gnu.org>
  
 -      * frame.h (FRAME_LINE_TO_PIXEL_Y): Add missing parenthesis.
 +      * xdisp.c (set_cursor_from_row): Fix cursor positioning when the
 +      string with `cursor' property comes from an `after-string'
 +      overlay.  (Bug#5816)
  
 -2010-04-07  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-04-01  Glenn Morris  <rgm@gnu.org>
  
 -      * frame.h (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Don't use
 -      FRAME_LINE_TO_PIXEL_Y.
 +      * Makefile.in (LIBTIFF, LIBJPEG, LIBPNG, LIBGIF, LIBXPM, XFT_LIBS):
 +      Define as Makefile variables.
 +      (LIBX): Use above variables rather than directly using autoconf.
  
 -      * xterm.c (x_set_window_size_1): Don't add border_width/height to
 -      pixelwidth/height.
 +2010-03-31  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -2010-04-05  Chong Yidong  <cyd@stupidchicken.com>
 +      Clean up BSD_SYSTEM use.
 +      * xterm.c:
 +      * process.c:
 +      * emacs.c: Use HAVE_SYS_IOCTL_H instead of BSD_SYSTEM as a guard
 +      for including <sys/ioctl.h>.
 +      * sysdep.c (wait_without_blocking): Remove BSD_SYSTEM case, this
 +      code is only used for MSDOS.
  
 -      * xdisp.c (prepare_menu_bars): Don't call ns_set_doc_edited for
 -      terminal frames (Bug#5837).
 +2010-03-31  Juri Linkov  <juri@jurta.org>
 +
 +      * image.c: Add `Qextension_data'.
 +      (syms_of_image): Initialize and staticpro `Qextension_data'.
 +      (Fimage_metadata): Rename from `Fimage_extension_data'.
 +      (gif_load): Put GIF extension data to the property
 +      `Qextension_data'.
  
  2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
  
  
  2010-03-31  Eli Zaretskii  <eliz@gnu.org>
  
 -      * w32fns.c (x_create_tip_frame): Copy `parms' before we modify it
 -      in this function.  (Bug#5703)
 +      * xdisp.c (highlight_trailing_whitespace): Support highlight of
 +      trailing whitespace in right-to-left rows.
  
 -2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
 +2010-03-31  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -      * nsterm.h: Fix last change.
 +      Get rid of the direct_output optimizations.
 +      * keyboard.c (nonundocount): Remove extern declaration.
 +      (command_loop_1): Remove brittle optimisation for cheap and
 +      common operations.
 +      * xdisp.c (redisplay_internal): Don't bother checking
 +      redisplay_performed_directly_p any more.
 +      * sysdep.c (init_sys_modes): Don't call direct_output_forward_char
 +      any more.
 +      * dispnew.c (redisplay_performed_directly_p)
 +      (direct_output_for_insert, direct_output_forward_char):
 +      * dispextern.h (redisplay_performed_directly_p)
 +      (direct_output_for_insert, direct_output_forward_char): Remove.
 +      * cmds.c (nonundocount): Make it static.
  
 -2010-03-30  Bernhard Herzog  <bh@intevation.de>  (tiny change)
 +2010-03-31  Bernhard Herzog  <bh@intevation.de>  (tiny change)
  
        * menu.c (Fx_popup_menu): Use last_event_timestamp (Bug#4930).
  
 -2010-03-30  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-03-31  Jan Djärv  <jan.h.d@swipnet.se>
  
        * xdisp.c (note_mouse_highlight): Don't do highlight if pointer is
        invisible (Bug#5766).
  
 -2010-03-29  Adrian Robert  <adrian.b.robert@gmail.com>
 +2010-03-31  Adrian Robert  <adrian.b.robert@gmail.com>
  
 -      * xdisp.c (x_consider_frame_title, update_window_cursor): Remove
 -      HAVE_NS conditionals.
 +      * xdisp.c (x_consider_frame_title, update_window_cursor):
 +      Remove HAVE_NS conditionals.
        (prepare_menu_bars) [HAVE_NS]: Call ns_set_doc_edited.
  
        * nsfns.m (x_implicitly_set_name): If frame-title-format is t, use
  
        * nsterm.m: Remove unneeded prototype.
  
 -2010-03-28  Glenn Morris  <rgm@gnu.org>
 +2010-03-31  Glenn Morris  <rgm@gnu.org>
  
        * Makefile.in (SOME_MACHINE_OBJECTS): Ensure dbus stuff is always
        in the DOC file.  (Bug#5336)
  
 -2010-03-24  Chong Yidong  <cyd@stupidchicken.com>
 +2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
  
        * xdisp.c (pos_visible_p): Revert 2008-01-25 change (Bug#5730).
  
 -2010-03-20  Jan Djärv  <jan.h.d@swipnet.se>
 +2010-03-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * window.c (keys_of_window): Remove redundant/overridden bindings.
 +
 +2010-03-30  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c (BUFFER_POS_REACHED_P, move_it_in_display_line_to):
 +      Restore original behavior when the iterator is not bidi_p.
 +
 +2010-03-30  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * xdisp.c (syms_of_xdisp): Use intern_c_string instead of intern.
 +
 +2010-03-30  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * bidi.c (bidi_cache_iterator_state): Invalidate the cache if we
 +      are outside the range of cached character positions.
 +
 +2010-03-30  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in ($(BLD)/bidi.$(O)): Add dependency on w32gui.h.
 +
 +2010-03-30  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Initial support for bidirectional editing.
 +
 +      * Makefile.in (obj): Include bidi.o.
 +      (bidi.o): New target.
 +
 +      * makefile.w32-in (OBJ1): Add $(BLD)/bidi.$(O).
 +      ($(BLD)/bidi.$(O)): New target.
 +
 +      * bidi.c: New file.
 +
 +      * buffer.h (struct buffer): New members bidi_display_reordering
 +      and bidi_paragraph_direction.
 +
 +      * buffer.c (init_buffer_once): Initialize bidi_display_reordering
 +      and bidi_paragraph_direction.
 +      (syms_of_buffer): Declare Lisp variables bidi-display-reordering
 +      and bidi-paragraph-direction.
 +      (Fbuffer_swap_text): Swap the values of
 +      bidi_display_reordering and bidi_paragraph_direction.
 +
 +      * dispextern.h (BIDI_MAXLEVEL, BIDI_AT_BASE_LEVEL): New macros.
 +      (bidi_type_t, bidi_dir_t): New types.
 +      (bidi_saved_info, bidi_stack, bidi_it): New structures.
 +      (struct it): New members bidi_p, bidi_it, paragraph_embedding,
 +      prev_stop, base_level_stop, and eol_pos.
 +      (bidi_init_it, bidi_get_next_char_visually): New prototypes.
 +      (IT_STACK_SIZE): Enlarge to 5.
 +      (struct glyph_row): New member reversed_p.
 +      <string_buffer_position>: Update prototype.
 +      (PRODUCE_GLYPHS): Set the reversed_p flag in the iterator's
 +      glyph_row if bidi_it.paragraph_dir == R2L.
 +      (struct glyph): New members resolved_level and bidi_type.
 +
 +      * dispnew.c (direct_output_forward_char): Give up if we need bidi
 +      processing or buffer's direction is right-to-left.
 +      (prepare_desired_row): Preserve the reversed_p flag.
 +      (row_equal_p): Compare the reversed_p attributes as well.
 +
 +      * xdisp.c (init_iterator): Initialize it->bidi_p.
 +      Call bidi_init_it and set it->paragraph_embedding from the current
 +      buffer's value of bidi_paragraph_direction.
 +      (reseat_1): Initialize bidi_it.first_elt.
 +      (set_iterator_to_next, next_element_from_buffer): Use the value of
 +      paragraph_embedding to determine the paragraph direction.
 +      (set_iterator_to_next): Under bidi reordering, call
 +      bidi_get_next_char_visually.  Call bidi_paragraph_init if the
 +      new_paragraph flag is set in the bidi iterator.
 +      (next_element_from_buffer): If bidi_it.first_elt is set,
 +      initialize paragraph direction and find the first character to
 +      display in the visual order.  If reseated to a middle of a line,
 +      prime the bidi iterator starting at the line's beginning.
 +      Handle the situation where we overstepped stop_charpos due to
 +      non-linearity of the bidi iteration.  Likewise for when we back up
 +      beyond the previous stop_charpos.  When moving across stop_charpos,
 +      record it in prev_stop.
 +      (display_line): Set row->end and it->start for the next row to the
 +      next character in logical order.  Always extend reversed_p rows to
 +      the end of line, even if they end at ZV.  Copy the reversed_p flag
 +      to the next glyph row.  Keep calling set_cursor_from_row for
 +      bidi-reordered rows even if we already have a possible candidate
 +      for cursor position.  Set row_end after all the row's glyphs have
 +      been produced, by looping over the glyphs.  Record the position
 +      after EOL in it->eol_pos, and use it to set end_pos of the last
 +      row produced for a continued line.
 +      <Qright_to_left, Qleft_to_right>: New variables.
 +      (syms_of_xdisp): Initialize and staticpro them.
 +      (string_buffer_position_lim): New function.
 +      (string_buffer_position): Most of code moved to
 +      string_buffer_position_lim.  Last argument and return value are
 +      now EMACS_INT; all callers changed.
 +      (set_cursor_from_row): Rewritten to support bidirectional text and
 +      reversed glyph rows.
 +      (text_outside_line_unchanged_p, try_window_id):
 +      Disable optimizations if we are reordering bidirectional text and the
 +      paragraph direction can be affected by the change.
 +      (append_glyph, append_composite_glyph)
 +      (produce_image_glyph, append_stretch_glyph): Set the
 +      resolved_level and bidi_type members of each glyph.
 +      (append_glyph): If the glyph row is reversed, prepend the glyph
 +      rather than appending it.
 +      (handle_stop_backwards): New function.
 +      (reseat_1, pop_it, push_it): Set prev_stop and base_level_stop.
 +      (reseat): call handle_stop_backwards to recompute prev_stop and
 +      base_level_stop for the new position.
 +      (handle_invisible_prop): Under bidi iteration, skip invisible text
 +      using bidi_get_next_char_visually.  If we are `reseat'ed, init the
 +      paragraph direction.  Update IT->prev_stop after skipping
 +      invisible text.
 +      (move_it_in_display_line_to): New variables prev_method
 +      and prev_pos.  Compare for strict equality in
 +      BUFFER_POS_REACHED_P.
 +      (try_cursor_movement): Examine all the candidate rows that occlude
 +      point, to return the best match.  If rows are bidi-reordered
 +      and point moved backwards, back up to the row that is not a
 +      continuation line, and start looking for a suitable row from
 +      there.
 +
 +      * term.c (append_glyph): Reverse glyphs by pre-pending them,
 +      rather than appending, if the glyph_row's reversed_p flag is set.
 +      Set the resolved_level and bidi_type members of each glyph.
 +
 +      * .gdbinit (pbiditype): New command.
 +      (pgx): Use it to display bidi level and type of the glyph.
 +      (pitx): Display some bidi information about the iterator.
 +      (prowlims, pmtxrows): New commands.
 +
 +2010-03-30  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove all uses of C_DEBUG_SWITCH and LIBS_DEBUG.
 +      * s/usg5-4.h (LIBS_DEBUG):
 +      * s/irix6-5.h (C_DEBUG_SWITCH):
 +      * s/gnu-linux.h (LIBS_DEBUG):
 +      * s/darwin.h (LIBS_DEBUG):
 +      * s/bsd-common.h (LIBS_DEBUG):
 +      * s/aix4-2.h (LIBS_DEBUG, C_DEBUG_SWITCH):
 +      * m/iris4d.h (LIBS_DEBUG):
 +      * m/hp800.h (LIBS_DEBUG): Remove definitions.
 +
 +      * Makefile.in (LIBES): Remove reference to LIBS_DEBUG.
 +      (LIBS_DEBUG): Remove definition.
 +
 +2010-03-27  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * process.c (Fmake_network_process): Don't apply Bug#5173 fix for
 +      Windows.
 +
 +2010-03-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +
 +      * process.c (Fmake_network_process): Don't call turn_on_atimers around
 +      `connect' (Bug#5723).
 +
 +2010-03-25  Helmut Eller  <eller.helmut@gmail.com>
 +
 +      * process.c (Fmake_network_process): Call `select' for interrupted
 +      `connect' rather than creating new socket (Bug#5173).
 +
 +2010-03-24  Jan Djärv  <jan.h.d@swipnet.se>
  
        * frame.c (x_get_arg): Handle RES_TYPE_BOOLEAN_NUMBER (bug #5736).
  
  
        * dispextern.h (resource_types): RES_TYPE_BOOLEAN_NUMBER is new.
  
 -2010-03-20  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +2010-03-24  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
  
        * xfns.c (Fx_create_frame) [USE_LUCID]: Add BLOCK_INPUT around
        XLoadQueryFont.
  
 -2010-03-16  Kenichi Handa  <handa@m17n.org>
 +2010-03-24  Kenichi Handa  <handa@m17n.org>
  
        * coding.c (decode_coding_ccl): Fix previous change for the
        multibyte case.
        case that the output buffer is fullfilled.
        (encode_coding): Setup ccl program here.
  
 -2010-03-15  Andreas Politz  <politza@fh-trier.de>  (tiny change)
 +2010-03-23  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * s/gnu-linux.h (LIBS_SYSTEM): Remove, same as default.
 +
 +      Simplify LIBS_MACHINE definitions.
 +      * m/hp800.h (LIBS_MACHINE): Remove, same as default.
 +      * m/iris4d.h (LIBS_MACHINE): Likewise.
 +      * m/ibmrs6000.h (LIBS_MACHINE): Rename to LIBS_SYSTEM and move ...
 +      * s/aix4-2.h (LIBS_SYSTEM): ... here.
 +      * s/netbsd.h: Remove commented out code.
 +
 +2010-03-22  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove dead code dealing with POSIX_SIGNALS.
 +      * atimer.c (set_alarm): Remove dead code, all USG systems define
 +      POSIX_SIGNALS.
 +      * data.c (arith_error): Likewise.
 +      * keyboard.c (input_available_signal, handle_user_signal)
 +      (interrupt_signal): Likewise.
 +      * process.c (sigchld_handler): Likewise.
 +      (create_process): Remove if 0 code.  Remove HPUX conditional when
 +      !defined (POSIX_SIGNALS), it cannot be true.
 +      * syssignal.h: Remove USG5_4 and USG conditionals when
 +      !POSIX_SIGNALS, they cannot be true.
 +
 +      * keyboard.c (Fset_input_interrupt_mode): Remove code depending on
 +      NO_SOCK_SIGIO, not used anymore.
 +
 +2010-03-21  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * m/vax.h (BSD_SYSTEM, BSD4_2): Remove conditionals, we only
 +      support vax on BSDs.
 +
 +      * m/ibmrs6000.h (ORDINARY_LINK): Move definition ...
 +      * s/aix4-2.h (ORDINARY_LINK): ... here.
 +
 +2010-03-21  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * Makefile.in (abs_builddir): Define.
 +      (bootstrap_exe): Use it.
 +      (VPATH): Use $(srcdir) instead of @srcdir@.
 +
 +2010-03-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * Makefile.in (bootstrap_exe): Use an absolute name.
 +
 +2010-03-20  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove support for old GNU/Linux using libc version 5.
 +      * m/alpha.h (LINUX_SBRK_BUG): Remove definition.
 +      * emacs.c (main): Remove code depending on LINUX_SBRK_BUG.
 +
 +      Consolidate redundant definitions in s/bsd-common.h.
 +      * s/bsd-common.h (BSD4_2, TABDLY, TAB3, HAVE_TERMIOS, NO_TERMIO)
 +      (LIBS_DEBUG, SYSV_SYSTEM_DIR, UNEXEC, NARROWPROTO, BSD_PGRPS)
 +      (LDAV_SYMBOL, KERNEL_FILE): Define (or undefine) here instead of
 +      doing it in all files that include this one.
 +      * s/gnu.h (BSD4_2, TABDLY, TAB3, HAVE_TERMIOS, NO_TERMIO)
 +      (LIBS_DEBUG, SYSV_SYSTEM_DIR, UNEXEC, NARROWPROTO, BSD_PGRPS)
 +      (LDAV_SYMBOL, KERNEL_FILE): Remove.
 +      * s/freebsd.h (BSD4_2, TABDLY, TAB3, HAVE_TERMIOS, NO_TERMIO)
 +      (LIBS_DEBUG, SYSV_SYSTEM_DIR, UNEXEC, NARROWPROTO, BSD_PGRPS)
 +      (LDAV_SYMBOL, KERNEL_FILE): Remove.
 +      * s/netbsd.h (BSD4_2, TABDLY, TAB3, HAVE_TERMIOS, NO_TERMIO)
 +      (LIBS_DEBUG, SYSV_SYSTEM_DIR, UNEXEC, NARROWPROTO, BSD_PGRPS)
 +      (LDAV_SYMBOL, KERNEL_FILE): Remove.
 +
 +      Consolidate redundant definitions.
 +      * s/usg5-4.h (sigsetmask, PTY_TTY_NAME_SPRINTF): Do not define,
 +      it's undefined in all files that include this one.
 +      (POSIX_SIGNALS): Define here instead of doing it in all files that
 +      include this one.
 +      * s/irix6-5.h (sigsetmask, PTY_TTY_NAME_SPRINTF): Do not undef.
 +      (POSIX_SIGNALS): Do not define.
 +      * s/sol2-6.h (sigsetmask, PTY_TTY_NAME_SPRINTF): Do not undef.
 +      (POSIX_SIGNALS): Do not define.
 +      * s/unixware.h (sigsetmask, PTY_TTY_NAME_SPRINTF): Do not undef.
 +      (POSIX_SIGNALS): Do not define.
 +
 +      Remove support for old UNIX System V systems.
 +      * s/unixware.h: Add the contents of s/usg-5-4-2.h.
 +      * s/usg-5-4-2.h: Remove.
 +
 +      Remove support for Solaris on PPC and for old versions.
 +      * s/sol2-6.h: Add the contents of s/sol-2.3.h, s/sol-2.4.h, s/sol-2.5.h.
 +      (LD_SWITCH_SYSTEM, USE_MMAP_FOR_BUFFERS): Remove #defines/#undef
 +      that cancel each other.
 +      * s/sol2-3.h:
 +      * s/sol2-4.h:
 +      * s/sol2-5.h: Remove.
 +      * m/ibmrs6000.h: Remove code for USG5_4, this file is only used on AIX.
 +      (NO_REMAP): Remove, unused.
 +      (UNEXEC): Move definition ...
 +      * s/aix4-2.h (UNEXEC): ... here.
 +
 +      * s/openbsd.h: Remove support for non-ELF and for systems that do
 +      not support shared libraries.
 +      * s/netbsd.h:
 +      * s/freebsd.h: Likewise.
 +
 +2010-03-20  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove non-working support for lynxos 3.0.
 +      * s/lynxos.h: Remove file.
 +
 +      * unexec.c (unexec, adjust_lnnoptrs): Do not depend on
 +      COFF_BSD_SYMBOLS, nothing defines it anymore.
 +
 +2010-03-20  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Remove obsolete uses of HAVE_SHM.
 +      * emacs.c (standard_args):
 +      (Fdump_emacs):
 +      (syms_of_emacs): Remove code depending on HAVE_SHM.
 +
 +      * alloc.c: Remove HAVE_SHM dependent definition.
 +
 +      * Makefile.in (RUN_TEMACS): Do not depend on HAVE_SHM.
 +
 +2010-03-18  Glenn Morris  <rgm@gnu.org>
 +
 +      * emacs.c (USAGE4): Hard-code bug address.
 +      (REPORT_EMACS_BUG_ADDRESS, REPORT_EMACS_BUG_PRETEST_ADDRESS): Remove.
 +      (bug_reporting_address): Remove.
 +      (main): Don't call bug_reporting_address.
 +
 +      * Makefile.in (XFT_LIBS, LIBXPM, LIBJPEG, LIBPNG, LIBTIFF, LIBGIF)
 +      (LIBGPM, LIBRESOLV): Set using autoconf rather than cpp.
 +
 +2010-03-15  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xfns.c (Fx_create_frame):
 +      * frame.c (Vdefault_frame_scroll_bars): Put non-GTK X scroll-bars
 +      on left.
 +
 +2010-03-13  Andreas Politz  <politza@fh-trier.de>  (tiny change)
  
        * editfns.c (Fformat): Account for string precision when computing
        field width (Bug#5710).
  
 +2010-03-12  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xfns.c (Fx_create_frame): Set default to Qright.
 +
 +      * frame.c (Vdefault_frame_scroll_bars): Set default to Qright for
 +      all window systems.
 +
 +2010-03-12  Eli Zaretskii  <eliz@gnu.org>
 +
 +      These changes remove termcap.c from the build on Posix platforms.
 +      * Makefile.in (termcapobj): Move termcap.o from here...
 +      (MSDOS_OBJ): ...to here.
 +      (termcapobj) [!LIBS_TERMCAP]: Remove specialized value, as it is
 +      now identical to when LIBS_TERMCAP is defined.
 +
 +      * term.c: Remove (ifdef'ed away) inclusion of termcap.h.
 +
 +      * cm.c: Remove (ifdef'ed away) inclusion of termcap.h.
 +
 +      * config.in: Regenerated.  (See top-level ChangeLog.)
 +
 +2010-03-10  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * Branch for 23.2.
 +
 +2010-03-10  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      Cleanup setup of gl_state in various parts of the code.
 +      * syntax.h (SETUP_BUFFER_SYNTAX_TABLE): New macro.
 +      (SETUP_SYNTAX_TABLE, SETUP_SYNTAX_TABLE_FOR_OBJECT):
 +      * syntax.c (find_defun_start, Fchar_syntax, Fmatching_paren)
 +      (skip_chars):
 +      * regex.c (regex_compile): Use it.
 +      (re_compile_pattern): Don't set gl_state.current_syntax_table since
 +      it's now set in regex_compile when/if we need it.
 +
  2010-03-05  Stefan Monnier  <monnier@iro.umontreal.ca>
  
        Make it possible to C-g in a tight bytecode loop again (bug#5680).
        (scroll_end_callback): Remove.
        (xg_create_scroll_bar): Add parameter end_callback, bind it to
        button-release-event.  Replace value-changed event with change-value,
 -      bug #5177,
 +      bug #5177.
        (xg_event_is_for_scrollbar): Only return true if button is less than 4,
        bug #5177.
  
  
  2009-12-12  Eli Zaretskii  <eliz@gnu.org>
  
 -      * dispextern.h (struct text_pos): Use EMACS_INT;
 +      * dispextern.h (struct text_pos): Use EMACS_INT.
        (struct glyph): Use EMACS_INT for charpos.
        (struct it): Use EMACS_INT for stop_charpos, end_charpos,
        region_beg_charpos, region_end_charpos,
        (store_symval_forwarding): Take into account the fact that Ints can
        now have more than one tag.
        * buffer.c (syms_of_buffer): Use LISP_INT_TAG.
 -      buffer_slot_type_mismatch):
 +      (buffer_slot_type_mismatch):
        * xfaces.c (face_attr_equal_p):
        * print.c (print_object):
        * alloc.c (mark_maybe_object, mark_object, survives_gc_p):
  2009-09-18  Adrian Robert  <Adrian.B.Robert@gmail.com>
  
        * emacs.c (inhibit_x_resources): Update doc string for NS.
 -      (main) [HAVE_NS]: Don't process --no-init-file option.  Remove
 -      legacy code for -NXHost.  Fix error printf in daemon case.
 +      (main) [HAVE_NS]: Don't process --no-init-file option.
 +      Remove legacy code for -NXHost.  Fix error printf in daemon case.
  
        * nsterm.h (ns_no_defaults): Remove.
  
        (ns_use_qd_smoothing): Remove legacy variable.
        (EmacsView-windowShouldZoom:): Set frame left_pos, top_pos and
        don't update the NSWindow itself.
 -      (EmacsView-windowWillUseStandardFrame:defaultFrame:): Improve
 -      state detection and store user rect ourselves.  (Bug #3581)
 +      (EmacsView-windowWillUseStandardFrame:defaultFrame:):
 +      Improve state detection and store user rect ourselves.  (Bug #3581)
  
        * nsfont.m (nsfont_draw) [NS_IMPL_COCOA]: Don't use
        ns_use_qd_smoothing.
        * xterm.h: Rename x_non_menubar_window_to_frame to
        x_menubar_window_to_frame.
  
 -      * xterm.c: Remove declarations also in xterm.h
 +      * xterm.c: Remove declarations also in xterm.h.
        (XTmouse_position): Do not return valid positions
        for clicks in the menubar and the toolbar for Gtk+.
  
  
        * makefile.w32-in ($(BLD)/doc.$(O)): Depend on buildobj.h, not on
        $(SRC)/buildobj.h.
 -      (buildobj.h): Renamed from $(SRC)/buildobj.h.
 +      (buildobj.h): Rename from $(SRC)/buildobj.h.
        (make-buildobj-CMD, make-buildobj-SH): Create buildobj.h, not
        $(SRC)/buildobj.h.
        (clean): Add buildobj.h.
  2009-08-21  Adrian Robert  <Adrian.B.Robert@gmail.com>
  
        * nsterm.m (ns_get_color): Update documentation properly for last
 -      change, and clean up loose ends in the code left by it.  Fix
 -      longstanding bug with 16-bit hex parsing, and add support for
 +      change, and clean up loose ends in the code left by it.
 +      Fix longstanding bug with 16-bit hex parsing, and add support for
        yet another X11 format (rgb:r/g/b) for compatibility.
        * nsfns.m (EmacsDialogPanel-runDialogAt): Add declaration of
        timer_check() to avoid crash on Leopard/PPC.  Bug #2154.
  2009-07-04  Eli Zaretskii  <eliz@gnu.org>
  
        Emulation of `getloadavg' on MS-Windows.
 -      * w32.c: Include float.h
 +      * w32.c: Include float.h.
        (g_b_init_get_native_system_info, g_b_init_get_system_times)
        (GetNativeSystemInfo_Proc, GetSystemTimes_Proc): Declare.
        (get_native_system_info, get_system_times): New functions.
        (Fdefine_coding_system_internal): Likewise.
        (setup_coding_system): Likewise.  Remove unneeded casts.
        (detect_coding_iso_2022): Compare Viso_2022_charset_list with
 -      CODING_ATTR_CHARSET_LIST, not CODING_ATTR_SAFE_CHARSETS.  Remove
 -      unneeded casts.
 +      CODING_ATTR_CHARSET_LIST, not CODING_ATTR_SAFE_CHARSETS.
 +      Remove unneeded casts.
  
        * insdel.c (del_range_2): Don't modify gap contents when called
        from decode_coding_object.  (Bug#1809)
  
        * lisp.h: Define Qfont_spec, Qfont_entity, Qfont_object extern.
  
 -      * font.c (Qfont_spec, Qfont_entity, Qfont_object): Definitions
 -      moved to data.c.
 +      * font.c (Qfont_spec, Qfont_entity, Qfont_object):
 +      Definitions moved to data.c.
  
  2009-02-20  Adrian Robert  <Adrian.B.Robert@gmail.com>
  
        here; it will be done in init_frame_faces.
  
        * xterm.h (struct xim_inst_t): Definition moved from xterm.c.
 -      (struct x_display_info): Remove unused member null_pixel.  New
 -      member xim_callback_data.
 +      (struct x_display_info): Remove unused member null_pixel.
 +      New member xim_callback_data.
  
        * xterm.c (struct xim_inst_t): Definition moved to xterm.h.
        (xim_initialize): Save pointer to callback function data.
  
  2008-12-13  Kenichi Handa  <handa@m17n.org>
  
 -      * font.c (font_rescale_ratio): Moved from xfaces.c.
 +      * font.c (font_rescale_ratio): Move from xfaces.c.
        Argument type changed.  Handle a font-spec too.
        (font_score): Check Vface_font_rescale_alist.
        (font_open_entity): Likewise.  (Bug#1547)
  
 -      * xfaces.c (font_rescale_ratio): Moved to font.c.
 +      * xfaces.c (font_rescale_ratio): Move to font.c.
  
  2008-12-13  Chong Yidong  <cyd@stupidchicken.com>
  
  
  2008-12-12  Jason Rumney  <jasonr@gnu.org>
  
 -      * w32fns.c (x_display_info_for_name, Fx_open_connection): Set
 -      Vwindow_system_version to the real w32 major version.
 +      * w32fns.c (x_display_info_for_name, Fx_open_connection):
 +      Set Vwindow_system_version to the real w32 major version.
  
  2008-12-12  Dan Nicolaescu  <dann@ics.uci.edu>
  
  
  2008-12-11  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * term.c (tty_free_frame_resources): Renamed from delete_tty_output;
 +      * term.c (tty_free_frame_resources): Rename from delete_tty_output;
        all callers changed.  Call free_frame_faces to free the face cache.
  
  2008-12-11  Jason Rumney  <jasonr@gnu.org>
        (set_category_set): Extern it.
  
        * category.c (hash_get_category_set): New function.
 -      (Fmodify_category_entry): Adjusted for the change of
 +      (Fmodify_category_entry): Adjust for the change of
        char_table_ref_and_range.  Call hash_get_category_set to get a
        category set to store in the table.
  
        (SET_TEMP_CHARSET_WORK_ENCODER, GET_TEMP_CHARSET_WORK_ENCODER)
        (SET_TEMP_CHARSET_WORK_DECODER, GET_TEMP_CHARSET_WORK_DECODER):
        New macros.
 -      (load_charset_map): Meaning of control_flag changed.  If
 -      inhibit_load_charset_map is nonzero, setup a table in
 +      (load_charset_map): Meaning of control_flag changed.
 +      If inhibit_load_charset_map is nonzero, setup a table in
        temp_charset_work.
        (load_charset): New argument control_flag.
        (map_charset_for_dump): New function.
        (syms_of_charset): Make `inhibit-load-charset-map' a Lisp
        variable.
  
 -      * chartab.c (sub_char_table_ref_and_range): Adjusted for the
 +      * chartab.c (sub_char_table_ref_and_range): Adjust for the
        change of char_table_ref_and_range.
        (char_table_ref_and_range): Change the meaning of argument FROM
        and TO.  Now the caller must provide initial values for *FROM
        and *TO.
  
 -      * fontset.c (fontset_add): Adjusted for the change of
 +      * fontset.c (fontset_add): Adjust for the change of
        char_table_ref_and_range.
        (fontset_get_font_group): Likewise.
        (Ffontset_info): Likewise.
  
 -      * keymap.c (describe_vector): Adjusted for the change of
 +      * keymap.c (describe_vector): Adjust for the change of
        char_table_ref_and_range.  For char-table, put boundary between
        non-ASCII and 8-bit characters.
  
        <after-change-functions>: Reflow docstrings.
  
  2008-08-04  Adrian Robert  <Adrian.B.Robert@gmail.com>
 -          Ken Raeburn  <raeburn@gnu.org>
 +            Ken Raeburn  <raeburn@gnu.org>
  
        Dock menu customization, based on a patch by Ken Raeburn, plus some
        other fixes.
  
        * s/darwin.h: Add #define DARWIN_OS.  Get rid of C_SWITCH_SYSTEM def.
        Change LIBS_MACGUI to LIBS_NSGUI.  Move temacs-conditionalized defs
 -      closer to C_SWITCH_SYSTEM_TEMACS so usage is understood.  Expand
 -      comment on NO_SOCK_SIGIO.
 +      closer to C_SWITCH_SYSTEM_TEMACS so usage is understood.
 +      Expand comment on NO_SOCK_SIGIO.
  
  2008-08-03  Chong Yidong  <cyd@stupidchicken.com>
  
  
  2008-07-15  Chris Hall  <chris@web.workinglinux.com>  (tiny change)
  
 -      * callproc.c (set_initial_environment): Initialize
 -      Vprocess_environment under CANNOT_DUMP (fixes crash when
 +      * callproc.c (set_initial_environment):
 +      Initialize Vprocess_environment under CANNOT_DUMP (fixes crash when
        batch-compiling for bootstrap).
  
  2008-07-15  Chris Hall  <chris@web.workinglinux.com>  (tiny change)
 -          YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +            YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
  
 -      (make_initial_frame): Call init_frame_faces(f) in CANNOT_DUMP case --
 -      fix crash due to different init order.
 +      * frame.c (make_initial_frame): Call init_frame_faces(f) in
 +      CANNOT_DUMP case -- fix crash due to different init order.
  
  2008-07-15  Adrian Robert  <Adrian.B.Robert@gmail.com>
  
        * m/macppc.h:
        * m/alpha.h: Use GNU_LINUX instead of LINUX.  Reorganize conditionals.
  
 -      * m/ibms390x.h (XINT, XUINT): Don't define, same as the default
 +      * m/ibms390x.h (XINT, XUINT): Don't define, same as the default.
        (SPECIAL_EMACS_INT):
        * m/ia64.h (SPECIAL_EMACS_INT):
        * m/amdx86-64.h (SPECIAL_EMACS_INT):
  2008-07-10  Dan Nicolaescu  <dann@ics.uci.edu>
  
        * fileio.c:
 -      * sysdep.c
 +      * sysdep.c:
        * systty.h:
        * m/ibmrs6000.h:
        * m/iris4d.h:
  
        * xftfont.c (struct xftfont_info): New member ft_size.  Make the
        member order compatible with struct ftfont_info.
 -      (xftfont_open): Add FC_CHARSET to the pattern.  Set
 -      xftfont_info->ft_size.  Don't unlock the face.  Check BDF
 +      (xftfont_open): Add FC_CHARSET to the pattern.
 +      Set xftfont_info->ft_size.  Don't unlock the face.  Check BDF
        properties if appropriate.
        (xftfont_close): Unlock the face.
        (xftfont_anchor_point, xftfont_shape): Deleted.
        (USG_SHARED_LIBRARIES): Remove duplicate definition.
  
  2008-06-26  Juanma Barranquero  <lekktu@gmail.com>
 -          Eli Zaretskii  <eliz@gnu.org>
 +            Eli Zaretskii  <eliz@gnu.org>
  
        * makefile.w32-in (LOCAL_FLAGS):
        Don't include WINDOWSNT, DOS_NT and _UCHAR_T.
        truncate only if the window width is below that integer.
        (start_display, resize_mini_window, produce_stretch_glyph)
        (display_string, move_it_in_display_line_to): Use line_wrap.
 -      (back_to_previous_visible_line_start, reseat_1): Reset
 -      string_from_display_prop_p.
 +      (back_to_previous_visible_line_start, reseat_1):
 +      Reset string_from_display_prop_p.
        (display_line): Extend default face to end of line when wrapping.
  
  2008-06-24  Kim F. Storm  <storm@cua.dk>
        the property of LFACE_FONT of LFACE (if any).
  
  2008-06-21  Seiji Zenitani  <zenitani@mac.com>
 -          Ryo Yoshitake  <ryo@shiftmode.net>
 +            Ryo Yoshitake  <ryo@shiftmode.net>
  
        * xterm.c (x_set_frame_alpha): Add x_catch_errors for bug#437.
  
        definitions from xmenu.c.  Suggested by Adrian Robert.
  
        * xmenu.c: Remove platform-independent menu definitions.
 -      (menu_items menu_items_inuse, menu_items_allocated)
 +      (menu_items, menu_items_inuse, menu_items_allocated)
        (menu_items_used, menu_items_n_panes)
        (menu_items_submenu_depth): Move to keyboard.h.
        (init_menu_items, finish_menu_items, unuse_menu_items)
        * xterm.c (x_set_frame_alpha): Move declarations before statements.
  
  2008-05-21  Seiji Zenitani  <zenitani@mac.com>
 -          Ryo Yoshitake  <ryo@shiftmode.net>
 +            Ryo Yoshitake  <ryo@shiftmode.net>
  
        * frame.c (Qalpha): Add a new frame parameter `alpha'.
        (Vframe_alpha_lower_limit): New variable.
        (struct glyph_string): New member underline_position and
        underline_thickness.
        (enum lface_attribute_index): Remove LFACE_AVGWIDTH_INDEX.
 -      (struct face): Change type of `font' to `struct font *'.  Remove
 -      members `font_name', `font_info_id'.
 +      (struct face): Change type of `font' to `struct font *'.
 +      Remove members `font_name', `font_info_id'.
        (per_char_metric, encode_char): Delete externs.
        (calc_pixel_width_or_height): Adjust the prototype.
  
        (FONT_WEIGHT_NAME_NUMERIC, FONT_SLANT_NAME_NUMERIC)
        (FONT_WIDTH_NAME_NUMERIC, FONT_SET_STYLE): New macros.
        (struct font_spec, struct font_entity): New structs.
 -      (FONT_ENCODING_NOT_DECIDED): Moved from fontset.h.
 +      (FONT_ENCODING_NOT_DECIDED): Move from fontset.h.
        (struct font): Many members from old "struct font_info" moved to
        here.  Members font and entity deleted.
        (FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P, FONTP): Modified for
        (CHECK_FONT_SPEC, CHECK_FONT_ENTITY, CHECK_FONT_OBJECT)
        (CHECK_FONT_GET_OBJECT): Likewise.
        (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT, XSETFONT): New macros.
 -      (PT_PER_INCH, POINT_TO_PIXEL, PIXEL_TO_POINT): Moved from font.h.
 -      (struct font_driver): New members case_sensitive anc check.  Type
 -      of the member list and open changed.
 +      (PT_PER_INCH, POINT_TO_PIXEL, PIXEL_TO_POINT): Move from font.h.
 +      (struct font_driver): New members case_sensitive anc check.
 +      Type of the member list and open changed.
        (enable_font_backend, font_symbolic_weight, font_symbolic_slant)
        (font_symbolic_width, font_find_object, font_get_spec)
        (font_set_lface_from_name): Delete extern.
        (enable_font_backend): Delete it.
        (Qfont_spec, Qfont_entity, Qfont_object): New variables.
        (CHECK_VALIDATE_FONT_SPEC): Delete it.
 -      (PT_PER_INCH, POINT_TO_PIXEL, PIXEL_TO_POINT): Moved to font.h.
 +      (PT_PER_INCH, POINT_TO_PIXEL, PIXEL_TO_POINT): Move to font.h.
        (null_string): Delete it.
        (null_vector): Make it static.
        (font_family_alist): Delete it.
        (QCextra, QClanguage): Delete it.
        (QClang, QCavgwidth, QCfont_entity, QCfc_unknown_spec): New variables.
        (font_make_spec, font_make_entity, font_make_object)
 -      (font_intern_prop): Renamed from intern_downcase.  Don't downcase
 +      (font_intern_prop): Rename from intern_downcase.  Don't downcase
        the string.  Callers changed.
 -      (font_pixel_size): Adjusted for the format change of font-related
 +      (font_pixel_size): Adjust for the format change of font-related
        objects.
        (prop_name_to_numeric, prop_numeric_to_name): Delete them.
        (font_style_to_value, font_style_symbolic): New function.
        (font_registry_charsets): Use Fassoc_string instead of
        assq_no_quit.
        (font_prop_validate_symbol): Don't return null_string.
 -      (font_prop_validate_style): Adjusted for the change of
 +      (font_prop_validate_style): Adjust for the change of
        style-related values in a font vector.
        (font_property_table): Delete entries for QClanguage and
        QCantialias, add entries for QCavgwidth.
        (get_font_prop_index): Delete the 2nd argument FROM.
        (font_prop_validate): Arguments changed.
 -      (font_put_extra): Adjusted for the change of font-related objects.
 +      (font_put_extra): Adjust for the change of font-related objects.
        (font_expand_wildcards, font_parse_xlfd, font_unparse_xlfd)
        (font_parse_fcname, font_unparse_fcname)
        (font_prepare_composition): Likewise.
 -      (font_parse_family_registry): Renamed from font_merge_old_spec.
 +      (font_parse_family_registry): Rename from font_merge_old_spec.
        (otf_open): Delete the 1st arg entity.
 -      (font_otf_capability): Adjusted for the above change.
 +      (font_otf_capability): Adjust for the above change.
        (font_score): New arg alternate_families.  Adjusted for the change
        of font-related objects.
        (font_sort_entites): New arg best_only.
        (font_match_p): Check alternate families.
        (font_find_object): Delete it.
        (font_check_object): New function.
 -      (font_clear_cache): Adjusted for the change of font-related objects.
 +      (font_clear_cache): Adjust for the change of font-related objects.
        (font_delete_unmatched): New arg.
        (font_list_entities): Call font_driver->list with a spec that
        doesn't specify style-related properties.
        (font_matching_entity): Arguments changed.  Caller changed.
 -      (font_open_entity): Adjusted for the change of font-related objects.
 +      (font_open_entity): Adjust for the change of font-related objects.
        (font_close_object, font_has_char, font_encode_char)
        (font_get_name, font_get_spec): Likewise.
        (font_spec_from_name, font_clear_prop, font_update_lface):
        New functions.
        (font_find_for_lface, font_open_for_lface, font_load_for_lface)
        (font_prepare_for_face, font_done_for_face, font_open_by_name)
 -      (font_at): Adjusted for the change of font-related objects.
 +      (font_at): Adjust for the change of font-related objects.
        (font_range): New function.
        (Ffontp, Ffont_spec, Ffont_get, Ffont_put, Flist_fonts)
 -      (Ffont_xlfd_name): Adjusted for the change of font-related objects.
 +      (Ffont_xlfd_name): Adjust for the change of font-related objects.
        (Fcopy_font_spec, Fmerge_font_spec): New function.
 -      (Ffont_family_list): Renamed from list-families.
 +      (Ffont_family_list): Rename from list-families.
        (Finternal_set_font_style_table): Arguments changed.
        (Ffont_fill_gstring, Ffont_shape_text, Fopen_font)
 -      (Ffont_drive_otf, Fquery_font, Ffont_match_p): Adjusted for the
 +      (Ffont_drive_otf, Fquery_font, Ffont_match_p): Adjust for the
        change of font-related objects.
        (syms_of_font): Delete "ifdef USE_FONT_BACKEND".  DEFSYM new symbols.
  
        * fontset.h (struct font_info): Delete it.  Most members go to
        struct font.
 -      (FONT_ENCODING_NOT_DECIDED): Moved to font.h.
 +      (FONT_ENCODING_NOT_DECIDED): Move to font.h.
        (enum FONT_SPEC_INDEX): Delete it.
        (font_info, list_fonts_func, load_font_func, query_font_func)
        (set_frame_fontset_func, find_ccl_program_func)
 -      (get_font_repertory_func, new_fontset_from_font_name): Delete
 -      externs.
 +      (get_font_repertory_func, new_fontset_from_font_name):
 +      Delete externs.
        (fontset_from_font_name): Extern it.
        (FS_LOAD_FONT, FONT_INFO_ID, FONT_INFO_FROM_ID)
        (FONT_INFO_FROM_FACE): Deleted.
        (face_for_char): Likewise.  Call face_for_char with font_object.
        (fs_load_font): Delete.  Delete #pragma surrounding it.
        (fs_query_fontset): Use strcasecmp instead of strcmp.
 -      (generate_ascii_font_name): Adjusted for the format change of
 +      (generate_ascii_font_name): Adjust for the format change of
        font-spec.
        (Fset_fontset_font): Likewise.  Use new macros to set elements of
        font-def.
        (Fnew_fontset): Use font_unparse_xlfd to generate
        FONTSET_ASCII (fontset).
        (new_fontset_from_font_name): Deleted.
 -      (fontset_from_font): Renamed from new_fontset_from_font.  Check if
 +      (fontset_from_font): Rename from new_fontset_from_font.  Check if
        a fontset is already created for the font.  FIx updating of
        Vfontset_alias_alist.
        (fontset_ascii_font): Deleted.
 -      (Ffont_info): Adjusted for the format change of font-spec.
 +      (Ffont_info): Adjust for the format change of font-spec.
        (Finternal_char_font): Likewise.
        (Ffontset_info): Likewise.
        (syms_of_fontset): Don't check load_font_func.
        (x_set_font_backend): Use FRAME_FONT macro to check if a font is
        already set for the frame.
  
 -      * ftfont.c (ftfont_pattern_entity): Argument FRAME removed.  Make
 -      a font-entity by font_make_entity.  Use font_intern_prop instead
 +      * ftfont.c (ftfont_pattern_entity): Argument FRAME removed.
 +      Make a font-entity by font_make_entity.  Use font_intern_prop instead
        of intern_downcase.  Use FONT_SET_STYLE to set a style-related
        font property.  If a font is scalable, set avgwidth property to 0.
        Set font-entity property by font_put_extra.
        (ftfont_list_generic_family): Argument SPEC and REGISTRY removed.
 -      (ffont_driver): Adjusted for the change of struct font_driver.
 +      (ffont_driver): Adjust for the change of struct font_driver.
        (ftfont_spec_pattern): New function.
        (ftfont_list): Return a list, not vector.
        (ftfont_match): Use ftfont_spec_pattern to get a pattern.
        font property.  Don't update dpyinfo->smallest_font_height and
        dpyinfo->smallest_char_width.
        (ftfont_close): Don't free `struct font'.
 -      (ftfont_has_char): Adjusted for the format change of font-entity.
 +      (ftfont_has_char): Adjust for the format change of font-entity.
        (ftfont_encode_char, ftfont_text_extents): Likewise.
  
        * ftxfont.c (ftxfont_list): Return a list, not vector.
        font property.  Don't update dpyinfo->smallest_font_height and
        dpyinfo->smallest_char_width.
        (ftxfont_close): Don't decrease FRAME_X_DISPLAY_INFO (f)->n_fonts.
 -      (ftxfont_draw): Adjusted for the change of struct font.
 +      (ftxfont_draw): Adjust for the change of struct font.
  
 -      * image.c (image_ascent): Don't include "charset.h".  Include
 -      "character.h" and "font.h".
 +      * image.c (image_ascent): Don't include "charset.h".
 +      Include "character.h" and "font.h".
  
        * lisp.h (enum pvec_type): New member PREV_FONT.
        (Fassoc_string): EXFUN it.
        'struct font *'.
        (get_char_face_and_encoding): Assign the whole encoding task to
        the `encode-char' method of a font driver.
 -      (fill_composite_glyph_string): Adjusted for the change of `struct
 +      (fill_composite_glyph_string): Adjust for the change of `struct
        face' and `struct glyph_string'.
        (fill_glyph_string): Likewise.
        (get_per_char_metric): Arguments changed.
 -      (x_get_glyph_overhangs): Adjusted for the change of `struct face'
 +      (x_get_glyph_overhangs): Adjust for the change of `struct face'
        and `struct glyph_string'.
        (produce_stretch_glyph, calc_line_height_property)
        (x_produce_glyphs): Likewise.
  
        * xfaces.c: Throughout the file, delete all USE_FONT_BACKEND
        conditionals.  Don't check enable_font_backend.  Delete all codes
 -      used only when USE_FONT_BACKEND is not defined.  Use
 -      FONT_XXX_NAME_NUMERIC instead of face_numeric_xxx.
 +      used only when USE_FONT_BACKEND is not defined.
 +      Use FONT_XXX_NAME_NUMERIC instead of face_numeric_xxx.
        (QCfoundry, QCadstyle, QCregistry, QCspacing, QCsize, QCavgwidth)
        (Qp): Extern them.
        (clear_font_table, load_face_font, xlfd_lookup_field_contents):
        by FONTP.
        (lface_fully_specified_p): Don't check LFACE_AVGWIDTH.
        (set_lface_from_font_name): Delete it.
 -      (set_lface_from_font): Renamed from
 +      (set_lface_from_font): Rename from
        set_lface_from_font_and_fontset.  Caller changed.  Don't set
        LFACE_AVGWIDTH.  Use FONT_XXX_FOR_FACE to get a symbol suitable
        for face.
        * xfont.c: Include <stdlib.h> and "ccl.h".
        (struct xfont_info): New structure.
        (xfont_query_font): Deleted.
 -      (xfont_find_ccl_program): Renamed from x_find_ccl_program and
 +      (xfont_find_ccl_program): Rename from x_find_ccl_program and
        moved from xterm.c.
 -      (xfont_driver): Adjusted for the change of struct font_driver.
 +      (xfont_driver): Adjust for the change of struct font_driver.
        (compare_font_names): New function.
 -      (xfont_list_pattern): Sort font names case insensitively.  Make
 -      font_entity by calling font_make_entity.  Avoid auto-scaled fonts.
 +      (xfont_list_pattern): Sort font names case insensitively.
 +      Make font_entity by calling font_make_entity.  Avoid auto-scaled fonts.
        (xfont_list): Return a list, not vector.
        (xfont_match): If the font doesn't have QCname property, generate
        a name from the other font properties.
        font property.  Don't update dpyinfo->smallest_font_height and
        dpyinfo->smallest_char_width.
        (xfont_close): Don't free struct font.
 -      (xfont_prepare_face): Adjusted for the change of struct font.
 +      (xfont_prepare_face): Adjust for the change of struct font.
        (xfont_done_face): Deleted.
 -      (xfont_has_char): Adjusted for the change of struct font.
 +      (xfont_has_char): Adjust for the change of struct font.
        (xfont_encode_char, xfont_draw): Likewise.
        (xfont_check): New function.
  
 -      * xftfont.c (xftfont_list): Adjusted for the change of `list'
 +      * xftfont.c (xftfont_list): Adjust for the change of `list'
        callback function.
 -      (xftfont_match): Adjusted for the format change of font-entity.
 -      (xftfont_open): Adjusted for the format change of font-entity and
 +      (xftfont_match): Adjust for the format change of font-entity.
 +      (xftfont_open): Adjust for the format change of font-entity and
        font-object.  Adjusted for the change of struct font.  Return a
        font-object.  Don't update dpyinfo->smallest_font_height and
        dpyinfo->smallest_char_width.
        used only when USE_FONT_BACKEND is not defined.  Don't include ccl.h.
        (x_per_char_metric, x_encode_char): Deleted.
        (x_set_cursor_gc, x_set_mouse_face_gc): Don't set GCFont.
 -      (x_compute_glyph_string_overhangs): Adjusted for the change of
 +      (x_compute_glyph_string_overhangs): Adjust for the change of
        `struct face'.
        (x_draw_glyph_string_foreground)
        (x_draw_composite_glyph_string_foreground): Likewise.
        (x_draw_glyph_string): Likewise.  Use font->underline_position and
        font->underline_thickness.
 -      (x_new_font): Renamed from x_new_fontset2.
 +      (x_new_font): Rename from x_new_fontset2.
        (x_new_fontset, x_get_font_info, x_list_fonts): Deleted.
        (x_check_font): Call `check' method of a font driver.
        (x_font_min_bounds, x_compute_min_glyph_bounds, x_load_font)
        (x_query_font, x_get_font_repertory): Deleted.
 -      (x_find_ccl_program): Renamed and moved to xfont.c.
 -      (x_redisplay_interface): Adjusted for the change of `struct
 +      (x_find_ccl_program): Rename and moved to xfont.c.
 +      (x_redisplay_interface): Adjust for the change of `struct
        redisplay_interface'.
  
        * w32fns.c: Throughout the file, delete all USE_FONT_BACKEND
        (w32font_close): Don't free struct font.  Adjusted for the change
        of struct w32font_info.
        (w32font_encode_char, w32font_text_extents, w32font_draw):
 -      Adjusted for the change of struct w32font_info.
 +      Adjust for the change of struct w32font_info.
        (w32font_draw): Likewise.
        (w32font_list_internal): Return a list, not vector.
        (w32font_open_internal): Change the 4th arg to font-object.
        Use FONT_SET_STYLE to set a style-related font property.  If a
        font is scalable, set avgwidth property to 0.  Set font-entity
        property by font_put_extra.
 -      (font_matches_spec): Adjusted for the format change of font-entity.
 +      (font_matches_spec): Adjust for the format change of font-entity.
        (w32_weight_table, w32_decode_weight): New variables.
        (w32_encode_weight): New function.
 -      (fill_in_logfont): Adjusted for the format change of font-spec.
 +      (fill_in_logfont): Adjust for the format change of font-spec.
        (w32font_full_name): Use FONT_WEIGHT_SYMBOLIC to get a symbol
        weight value.
 -      (w32font_driver): Adjusted for the change of struct font_driver.
 +      (w32font_driver): Adjust for the change of struct font_driver.
  
        * w32term.h: Throughout the file, delete all USE_FONT_BACKEND
        conditionals.  Don't check enable_font_backend.  Surround non-used
        code by "#ifdef OLD_FONT" and "endif".
        (FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_DESCENT)
 -      (FONT_AVG_WIDTH): Adjusted for the change of struct font.
 +      (FONT_AVG_WIDTH): Adjust for the change of struct font.
  
        * w32term.c: Throughout the file, delete all USE_FONT_BACKEND
        conditionals.  Don't check enable_font_backend.  Delete all codes
        * w32uniscribe.c: Delete USE_FONT_BACKEND conditional.
        (uniscribe_open): Return value changed to font-object.
        Adjusted for the format change of font-object.
 -      (uniscribe_otf_capability): Adjusted for the change of struct font.
 +      (uniscribe_otf_capability): Adjust for the change of struct font.
        (add_opentype_font_name_to_list): Don't downcase names.
 -      (uniscribe_font_driver): Adjusted for the change of struct
 +      (uniscribe_font_driver): Adjust for the change of struct
        font_driver.
  
  2008-05-13  Chong Yidong  <cyd@stupidchicken.com>
        Report an error when image size is invalid.
        Read two bytes at a time when raw images have max_color_idx above 255.
  
 -2008-04-05  Eli Zaretskii  <eliz@gnu.org>
 -
 -      * w32.c (readdir): If FindFirstFile/FindNextFile return in
 -      cFileName a file name that includes `?' characters, use the 8+3
 -      alias in cAlternateFileName instead.
 -
  2008-04-05  Kenichi Handa  <handa@ni.aist.go.jp>
  
        * ccl.c (ccl_driver): If ccl->quit_silently is nonzero, don't
        * xterm.c (handle_one_xevent): For Gtk+ and ConfigureNotify, call
        xg_frame_resized when the event is for the edit widget.
  
 -      * gtkutil.h (xg_frame_resized): Renamed from xg_resize_widgets.
 +      * gtkutil.h (xg_frame_resized): Rename from xg_resize_widgets.
  
        * gtkutil.c (xg_resize_outer_widget): Only do one of set_geometry or
        set_char_size.
 -      (xg_frame_resized): Renamed from xg_resize_widgets.  Remove all
 +      (xg_frame_resized): Rename from xg_resize_widgets.  Remove all
        operations on widgets here.  Just set frame size if needed.
        (flush_and_sync, x_wm_size_hint_off, xg_pack_tool_bar): New functions.
        (xg_frame_set_char_size): Call x_wm_size_hint_off before resizing.
  
  2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>
  
 -      * coding.c (decode_coding_object, encode_coding_object): Adjust
 -      marker positions after conversion.
 +      * coding.c (decode_coding_object, encode_coding_object):
 +      Adjust marker positions after conversion.
  
        * lisp.h (struct Lisp_Marker): New member need_adjustment.
  
  
  2008-02-01  Jason Rumney  <jasonr@gnu.org>
  
 -      * w32term.c (x_set_glyph_string_clipping): Use
 -      get_glyph_string_clip_rects.
 +      * w32term.c (x_set_glyph_string_clipping):
 +      Use get_glyph_string_clip_rects.
        (x_set_glyph_string_clipping_exactly, x_draw_glyph_string):
        Adjust for the change of struct glyph_string.
  
        * xftfont.c (xftfont_draw): Adjust for the change of struct
        glyph_string.
  
 -      * xterm.c (x_set_glyph_string_clipping): Use
 -      get_glyph_string_clip_rects.
 +      * xterm.c (x_set_glyph_string_clipping):
 +      Use get_glyph_string_clip_rects.
        (x_set_glyph_string_clipping_exactly, x_draw_glyph_string):
        Adjust for the change of struct glyph_string.
  
        constant.  Save QCspacing value.  Save list of scripts instead of
        binary subranges.
        (w32_generic_family, logfonts_match, font_matches_spec): New functions.
 -      (add_font_entity_to_list): Use font_callback_data struct.  Filter
 -      unwanted fonts.
 +      (add_font_entity_to_list): Use font_callback_data struct.
 +      Filter unwanted fonts.
        (add_one_font_entity_to_list): Use font_callback_data struct.
        (w32_registry): Default to iso10646_1.
        (fill_in_logfont): Use dpi from extra slot.  Don't bother with
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
 -      * xterm.c (x_draw_composite_glyph_string_foreground): Fix
 -      indexing into elements of s->cmp and s->char2b.
 +      * xterm.c (x_draw_composite_glyph_string_foreground):
 +      Fix indexing into elements of s->cmp and s->char2b.
  
  2008-02-01  Juanma Barranquero  <lekktu@gmail.com>
  
  
        * font.c (font_parse_fcname, font_parse_name): Don't change :name
        property of FONT.
 -      (LGSTRING_HEADER_SIZE, LGSTRING_GLYPH_SIZE, check_gstring): Define
 -      them unconditionally.
 +      (LGSTRING_HEADER_SIZE, LGSTRING_GLYPH_SIZE, check_gstring):
 +      Define them unconditionally.
        (font_matching_entity): New function.
        (font_open_by_name): Try font_matching_entity if exact match is
        not found.
        (font_prepare_composition): Set cmp->glyph_len.
        (font_open_entity): Set font->scalable.
        (Ffont_get): Handle :otf property.
 -      (Ffont_otf_gsub, Ffont_otf_gpos, Ffont_otf_alternates): New
 -      functions.
 +      (Ffont_otf_gsub, Ffont_otf_gpos, Ffont_otf_alternates):
 +      New functions.
        (Fquery_font): Use font->font.full_name.
        (syms_of_font): Defsubr Sfont_otf_gsub, Sfont_otf_gpos, and
        Sfont_otf_alternates.
        (font_at): New function.
        (Ffont_get): If FONT is a font-object, get entity from it.
        (Ffont_make_gstring): Initialize elements of glyphs with nil.
 -      (Ffont_fill_gstring): Use macro LGSTRING_XXX and LGLYPH_XXX.  Fix
 -      range check.
 +      (Ffont_fill_gstring): Use macro LGSTRING_XXX and LGLYPH_XXX.
 +      Fix range check.
        (Ffont_at): New function.
        (syms_of_font): Defsubr Sfont_at.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
        * font.h (LGLYPH_XOFF, LGLYPH_YOFF, LGLYPH_WIDTH, LGLYPH_WADJUST)
 -      (LGLYPH_SET_WIDTH): Adjusted for the change of LGLYPH format.
 +      (LGLYPH_SET_WIDTH): Adjust for the change of LGLYPH format.
        (LGLYPH_ADJUSTMENT, LGLYPH_SET_ADJUSTMENT): New macros.
  
        * font.c (font_merge_old_spec): Treat '*' in foundry as a wild card.
        (font_prop_validate_extra): Delete.
        (font_prop_validate_spacing): New function.
        (font_property_table): Add elements for all known properties.
 -      (get_font_prop_index): Rename from check_font_prop_name.  New
 -      argument FROM.  Change caller.
 +      (get_font_prop_index): Rename from check_font_prop_name.
 +      New argument FROM.  Change caller.
        (font_prop_validate): Validate all known properties.
        (font_put_extra): Delete argument force.  Change caller.
        (font_expand_wildcards): Make it static.  Fix the way of shrinking
        (font_open_for_lface, font_open_by_name): Fix handling of font size.
        (Ffont_spec): Add QCname property that contains only unknown properties.
  
 -      * ftfont.c (ftfont_list): Use assq_no_quit, not Fassq.  Don't
 -      include weight in listing pattern, instead check weight of each
 +      * ftfont.c (ftfont_list): Use assq_no_quit, not Fassq.
 +      Don't include weight in listing pattern, instead check weight of each
        listed font.  Don't include scalable in pattern.  Pay attention to
        FONT_PIXEL_SIZE_QUANTUM.
  
  
        * font.c (XLFD_SMALLNUM_MASK): Delete this macro.
        (XLFD_LARGENUM_MASK): Delete XLFD_ENCODING_MASK from it.
 -      (font_expand_wildcards): Fix handling ENCODING field.  Avoid
 -      unnecessary checks for weight, slant, and swidth.
 +      (font_expand_wildcards): Fix handling ENCODING field.
 +      Avoid unnecessary checks for weight, slant, and swidth.
        (font_parse_fcname): New function.
        (font_unparse_fcname): New function.
        (font_parse_name): New function.
        * font.c (enum xlfd_field_index): Rename XLFD_XXX_SIZE_INDEX to
        XLFD_XXX_INDEX.
        (enum xlfd_field_mask): New enum.
 -      (intern_font_field): Changed argument.  Change caller.  If digits
 +      (intern_font_field): Change argument.  Change caller.  If digits
        are followed by non-digits, return a symbol.
        (font_expand_wildcards): New function.
        (font_parse_xlfd): Fix wildcard handling.
        * xfns.c [USE_FONT_BACKEND]: Include "font.h".
        (x_default_font_parameter) [USE_FONT_BACKEND]: New function.
        (Fx_create_frame) [USE_FONT_BACKEND]: If enable_font_backend is
 -      nonzero, register all available font drivers.  Call
 -      x_default_font_parameter for deciding a font.
 +      nonzero, register all available font drivers.
 +      Call x_default_font_parameter for deciding a font.
        (x_create_tip_frame) [USE_FONT_BACKEND]: Likewise.
  
        * xterm.c [USE_FONT_BACKEND]: Include "font.h".
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
 -      * coding.c (DECODE_EMACS_MULE_20_RELATIVE_COMPOSITION): Fix
 -      condition to terminate the loop.
 +      * coding.c (DECODE_EMACS_MULE_20_RELATIVE_COMPOSITION):
 +      Fix condition to terminate the loop.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
 -      * xterm.c (x_set_glyph_string_clipping_exactly): Set
 -      src->clip_head and src->clip_tail temporarily instead of src->hl.
 +      * xterm.c (x_set_glyph_string_clipping_exactly):
 +      Set src->clip_head and src->clip_tail temporarily instead of src->hl.
  
        * ccl.c (CCL_WRITE_STRING): Handle a flag bit for multibyte
        character sequence.
        (BUILD_COMPOSITE_GLYPH_STRING): If C is TAB, set s->face to NULL.
        (x_produce_glyphs): If CH is TAB, set cmp->offsets properly.
  
 -      * xterm.c (x_draw_composite_glyph_string_foreground): Check
 -      s->face is NULL or not.
 +      * xterm.c (x_draw_composite_glyph_string_foreground):
 +      Check s->face is NULL or not.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
        Qnil.  Use JIS_TO_SJIS instead of ENCODE_SJIS.
        (decode_mac_font_name): Use decode_coding_c_string instead of
        decode_coding.
 -      (x_load_font): Initialize fontp->fontset to -1.  Set
 -      fontp->encoding_type.
 +      (x_load_font): Initialize fontp->fontset to -1.
 +      Set fontp->encoding_type.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
        * search.c (search_buffer): Give up BM search on case-fold-search
        if one of a target character has a case-equivalence of different
 -      byte length even if that target charcter is an ASCII.
 +      byte length even if that target character is an ASCII.
        (simple_search): Fix calculation of byte length of matched text.
        (boyer_moore): Fix handling of case-equivalent multibyte characters.
  
        (emacs${EXEEXT}): Run $(RUN_TEMACS) unconditionally.
        (UNIDATA): New variable.
        (${lispsource}international/charprop.el): Depends on ${UNIDATA}.
 -      (bootstrap-emacs${EXEEXT}): Depends on charprop.el.  Run
 -      $(RUN_TEMACS) unconditionally.
 +      (bootstrap-emacs${EXEEXT}): Depends on charprop.el.
 +      Run $(RUN_TEMACS) unconditionally.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
  
        * w32select.c (validate_coding_system)
        (setup_windows_coding_system): New functions.
 -      (convert_to_handle_as_coded, Fw32_get_clipboard_data): Use
 -      setup_windows_coding_system.
 -      (setup_config, Fw32_get_clipboard_data): Use
 -      validate_coding_system.
 +      (convert_to_handle_as_coded, Fw32_get_clipboard_data):
 +      Use setup_windows_coding_system.
 +      (setup_config, Fw32_get_clipboard_data):
 +      Use validate_coding_system.
        (Fx_selection_exists): Move call to setup_config to a place
        where signals are allowed.
  
  
        * fontset.c (fs_load_font): Use fast_string_match_ignore_case
        instead of fast_c_string_match_ignore_case.
 -      (find_font_encoding): Change argument to Lisp_Object.  Use
 -      fast_string_match_ignore_case instead of
 +      (find_font_encoding): Change argument to Lisp_Object.
 +      Use fast_string_match_ignore_case instead of
        fast_c_string_match_ignore_case.  Change caller.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
        Qundecided.
        (Fterminal_coding_system): Return nil if terminal coding system is
        `undecided'.
 -      (syms_of_coding): Define coding-system `undecided' here.  Setup
 -      terminal_coding as `undecided'.
 +      (syms_of_coding): Define coding-system `undecided' here.
 +      Setup terminal_coding as `undecided'.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
 -      * xdisp.c (message_dolog, set_message_1): Call
 -      unibyte_char_to_multibyte with arg type int.
 +      * xdisp.c (message_dolog, set_message_1):
 +      Call unibyte_char_to_multibyte with arg type int.
  
        * lread.c (read1): Fix reading of a char-table.
  
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
 -      * coding.c (Ffind_coding_systems_region_internal): Include
 -      raw-text and no-conversion in the result.
 +      * coding.c (Ffind_coding_systems_region_internal):
 +      Include raw-text and no-conversion in the result.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
  
        * fontset.c: Include "intervals.h".
        (fontset_face): Fix comparing of Lisp_Objects.
 -      (free_face_fontset, new_fontset_from_font_name): Fix
 -      Lisp_Object/int mixup.
 +      (free_face_fontset, new_fontset_from_font_name):
 +      Fix Lisp_Object/int mixup.
  
        * editfns.c (Ftranslate_region_internal): Fix Lisp_Object/int mixup.
  
        * coding.c: Add many prototypes for static functions.
        (get_translation_table): Allow max_lookup to be NULL.
        (decode_coding, Ffind_coding_systems_region_internal)
 -      (Funencodable_char_position, Fcheck_coding_systems_region): Call
 -      get_translation_table with max_lookup NULL.
 +      (Funencodable_char_position, Fcheck_coding_systems_region):
 +      Call get_translation_table with max_lookup NULL.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
        (Fdefine_coding_system_internal): Accept list of translation
        tables as :encode-translation-table and :decode-translation-table.
        (Fcoding_system_put): New function.
 -      (syms_of_coding): Declare new symbols.  Defsubr
 -      Scoding_system_put.
 +      (syms_of_coding): Declare new symbols.
 +      Defsubr Scoding_system_put.
        (decode_coding_sjis, encode_coding_sjis): Handle 4th charset,
        typically JISX0212.
  
        * chartab.c (map_sub_char_table_for_charset): Fix args to
        c_function with.
  
 -      * coding.h (enum coding_result_code): Delete
 -      CODING_RESULT_INSUFFICIENT_CMP, add CODING_RESULT_INVALID_SRC.
 +      * coding.h (enum coding_result_code):
 +      Delete CODING_RESULT_INSUFFICIENT_CMP, add CODING_RESULT_INVALID_SRC.
  
        * coding.c (Qinsufficient_source, Qinconsistent_eol)
        (Qinvalid_source, Qinterrupted, Qinsufficient_memory): New variables.
  
        * w32console.c: Include character.h.  Use terminal_encode_buffer
        from term.c.
 -      (write_glyphs): Use new version of encode_terminal_code.  Use
 -      encode_coding_object in place of encode_coding.
 +      (write_glyphs): Use new version of encode_terminal_code.
 +      Use encode_coding_object in place of encode_coding.
  
        * w32bdf.c (w32_load_bdf_font): Clear font_info before filling.
        encoding becomes encoding_type.
        * charset.h (charset_unicode): Extern it.
  
        * charset.c (string_xstring_p): Check by (C >= 0x100).
 -      (find_charsets_in_text): Change format of the arc CHARSETS.  New
 -      arg MULTIBYTE.
 +      (find_charsets_in_text): Change format of the arc CHARSETS.
 +      New arg MULTIBYTE.
        (Ffind_charset_region, Ffind_charset_string): Adjust for the
        change of find_charsets_in_text.
        (Fsplit_char): Fix doc.  Never return unknown.
  
        * chartab.c (char_table_translate): Use CHARACTERP, not INTEGERP.
  
 -      * coding.c (Fdefine_coding_system_alias): Update
 -      Vcoding_system_list.
 +      * coding.c (Fdefine_coding_system_alias):
 +      Update Vcoding_system_list.
  
        * fontset.c (load_font_get_repertory): Pay attention to the case
        that ENCODING of a font is specified by a char-table.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
 -      * term.c (encode_terminal_code): Don't handle glyph-table.  Check
 -      if a character is encodable by the terminal coding system.  If
 -      not, produces proper number of `?'s.  Update
 +      * term.c (encode_terminal_code): Don't handle glyph-table.
 +      Check if a character is encodable by the terminal coding system.
 +      If not, produces proper number of `?'s.  Update
        terminal_encode_buffer and terminal_encode_buf_size if necessary.
        (produce_glyphs): Check by CHAR_BYTE8_P, not SINGLE_BYTE_CHAR_P.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
 -      * term.c (terminal_encode_buffer, terminal_encode_buf_size): New
 -      variables.
 +      * term.c (terminal_encode_buffer, terminal_encode_buf_size):
 +      New variables.
        (encode_terminal_code): Change argument.  Encode multiple
        characters at once.  Store the result of encoding in
        terminal_encode_buffer.
  
        * casetab.c (set_case_table): Remove unused var.
  
 -      * window.c (Fdisplay_buffer, Fframe_selected_window): Remove
 -      unused vars.
 +      * window.c (Fdisplay_buffer, Fframe_selected_window):
 +      Remove unused vars.
  
  2008-02-01  Dave Love  <fx@gnu.org>
  
        (update_compositions, Ffind_composition_internal): Make buffer
        positions EMACS_INT.
  
 -      * composite.h (find_composition, update_compositions): Make
 -      position args EMACS_INT.
 +      * composite.h (find_composition, update_compositions):
 +      Make position args EMACS_INT.
  
        * keyboard.c (adjust_point_for_property): Make beg and end EMACS_INT.
  
  
  2008-02-01  Andreas Schwab  <schwab@suse.de>
  
 -      * chartab.c (map_char_table, map_char_table_for_charset): Protect
 -      `range' from GC.
 +      * chartab.c (map_char_table, map_char_table_for_charset):
 +      Protect `range' from GC.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
        (re_match_2_internal): Don't check RE_TARGET_MULTIBYTE_P (bufp).
        It is the same as RE_MULTIBYTE_P (bufp) now.
        <exactn>: Translate via multibyte.
 -      <anychar>: Fetch a character by RE_STRING_CHAR_AND_LENGTH.  Don't
 -      translate it.
 +      <anychar>: Fetch a character by RE_STRING_CHAR_AND_LENGTH.
 +      Don't translate it.
        <charset, charset_not>: Fetch a character by
        RE_STRING_CHAR_AND_LENGTH.  Translate via multibyte.
        <duplicate>: Call bcmp_translate with the last arg `multibyte'.
        FONT_SPEC_INDEX.  If font_spec is a string, extract the registry
        name by using split_font_name_into_vector.
        (Fnew_fontset): If no ASCII font is specified in FONTLIST,
 -      generate a proper font name from the fontset name.  Update
 -      Vfontset_alias_alist.
 +      generate a proper font name from the fontset name.
 +      Update Vfontset_alias_alist.
        (n_auto_fontsets): New variable.
        (new_fontset_from_font_name): New function.
        (Ffont_info): Store the information about fonts generated from the
        sequence is valid in this coding system.  Change callers.
        (MAX_ANNOTATION_LENGTH): New macro.
        (ADD_ANNOTATION_DATA): New macro.
 -      (ADD_COMPOSITION_DATA): Change argument.  Change callers.  Call
 -      ADD_ANNOTATION_DATA.  Change the format of annotation data.
 +      (ADD_COMPOSITION_DATA): Change argument.  Change callers.
 +      Call ADD_ANNOTATION_DATA.  Change the format of annotation data.
        (ADD_CHARSET_DATA): New macro.
        (emacs_mule_char): New argument ID.  Change callers.
        (decode_coding_emacs_mule, decode_coding_iso_2022)
        (produce_composition): Adjust for the new annotation data format.
        (produce_charset): New function.
        (produce_annotation): Handle charset annotation.
 -      (handle_composition_annotation, handle_charset_annotation): New
 -      functions.
 +      (handle_composition_annotation, handle_charset_annotation):
 +      New functions.
        (consume_chars): Handle charset annotation.  Utilize the above two
        functions.
        (encode_coding_object): If SRC_OBJECT and DST_OBJECT are the same
  
        * coding.c (detect_coding_charset): If only ASCII bytes are found,
        return 0.
 -      (Fdefine_coding_system_internal): Setup
 -      CODING_ATTR_ASCII_COMPAT (attrs) correctly.
 +      (Fdefine_coding_system_internal):
 +      Setup CODING_ATTR_ASCII_COMPAT (attrs) correctly.
  
  2008-02-01  Dave Love  <fx@gnu.org>
  
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
 -      * coding.c (decode_coding): Fix args to translate_chars.  Pay
 -      attention to Vstandard_translation_table_for_decode.
 +      * coding.c (decode_coding): Fix args to translate_chars.
 +      Pay attention to Vstandard_translation_table_for_decode.
        (encode_coding): Fix args to translate_chars.  Pay attention to
        Vstandard_translation_table_for_encode.
  
  
        * character.h (CHAR_STRING, CHAR_STRING_ADVANCE): Call char_string
        if C is greater than MAX_3_BYTE_CHAR.
 -      (STRING_CHAR, STRING_CHAR_AND_LENGTH, STRING_CHAR_ADVANCE): Call
 -      string_char instead of string_char_with_unification.
 +      (STRING_CHAR, STRING_CHAR_AND_LENGTH, STRING_CHAR_ADVANCE):
 +      Call string_char instead of string_char_with_unification.
  
  2008-02-01  Dave Love  <fx@gnu.org>
  
  
        * keyboard.c (read_key_sequence): Fix type error.
  
 -      * buffer.c (Fset_buffer_multibyte, Fset_buffer_multibyte): Fix
 -      type error.
 +      * buffer.c (Fset_buffer_multibyte, Fset_buffer_multibyte):
 +      Fix type error.
  
        * fontset.c (fontset_add): Return Lisp_Object.
  
        * regex.h (struct re_pattern_buffer): New member target_multibyte.
  
        * regex.c (RE_TARGET_MULTIBYTE_P): New macro.
 -      (GET_CHAR_BEFORE_2): Check target_multibyte, not multibyte.  If
 -      that is zero, convert an eight-bit char to multibyte.
 +      (GET_CHAR_BEFORE_2): Check target_multibyte, not multibyte.
 +      If that is zero, convert an eight-bit char to multibyte.
        (MAKE_CHAR_MULTIBYTE, CHAR_LEADING_CODE): New dummy new macros for
        non-emacs case.
        (PATFETCH): Convert an eight-bit char to multibyte.
        multibyte always 1.
        (re_search_2): In emacs, set the locale variable multibyte to 1,
        otherwise to 0.  New local variable target_multibyte.  Check it
 -      to decide the multibyteness of STR1 and STR2.  If
 -      target_multibyte is zero, convert unibyte chars to multibyte
 +      to decide the multibyteness of STR1 and STR2.
 +      If target_multibyte is zero, convert unibyte chars to multibyte
        before translating and checking fastmap.
        (TARGET_CHAR_AND_LENGTH): New macro.
        (re_match_2_internal): In emacs, set the locale variable multibyte
 -      to 1, otherwise to 0.  New local variable target_multibyte.  Check
 -      it to decide the multibyteness of STR1 and STR2.  Use
 -      TARGET_CHAR_AND_LENGTH to fetch a character from D.
 +      to 1, otherwise to 0.  New local variable target_multibyte.
 +      Check it to decide the multibyteness of STR1 and STR2.
 +      Use TARGET_CHAR_AND_LENGTH to fetch a character from D.
        <charset, charset_not>: If multibyte is nonzero, check fastmap
        only for ASCII chars.  Call bcmp_translate with
        target_multibyte, not with multibyte.
  
        * lisp.h (Fset_buffer_multibyte): Adjust prototype.
  
 -      * xdisp.c (setup_echo_area_for_printing, set_message_1): Adjust
 -      for the change of Fset_buffer_multibyte.
 +      * xdisp.c (setup_echo_area_for_printing, set_message_1):
 +      Adjust for the change of Fset_buffer_multibyte.
  
        * fns.c (Fstring_to_multibyte): New function.
        (syms_of_fns): Declare Fstring_to_multibyte as Lisp subroutine.
        (find_font_encoding): New function.
        (list_fontsets): Use STRINGP, not ! NILP.
        (accumulate_script_ranges): New function.
 -      (Fset_fontset_font, Fnew_fontset, Ffontset_info): Completely
 -      re-written to handle new fontset structure.
 +      (Fset_fontset_font, Fnew_fontset, Ffontset_info):
 +      Completely re-written to handle new fontset structure.
        (Ffontset_font): Return a copy of element.
 -      (syms_of_fontset): Define symbols Qprepend and Qappend.  Fix
 -      docstring of font-encoding-alist.
 +      (syms_of_fontset): Define symbols Qprepend and Qappend.
 +      Fix docstring of font-encoding-alist.
  
        * lisp.h (CHAR_TABLE_REF): Remove unnecessary check (IDX >= 0).
        (Fset_fotset_font): Fix arguments to 5.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
 -      * xdisp.c (face_before_or_after_it_pos): Call
 -      FETCH_MULTIBYTE_CHAR with byte postion, not char position.
 +      * xdisp.c (face_before_or_after_it_pos):
 +      Call FETCH_MULTIBYTE_CHAR with byte postion, not char position.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
        * charset.c (charset_ordered_list_tick): New variable.
        (Fdefine_charset_internal): Increment charset_ordered_list_tick.
        (Funify_charset): New optional arg DEUNIFY.  If it is non-nil,
 -      deunify intead of unify a charset.
 +      deunify instead of unify a charset.
        (string_xstring_p): Add `const' to local variables.
        (find_charsets_in_text): Add `const' to arguments and local variables.
 -      (encode_char): Adjust for the change of Funify_charset.  Fix
 -      detecting of invalid code.
 +      (encode_char): Adjust for the change of Funify_charset.
 +      Fix detecting of invalid code.
        (Fset_charset_priority): Increment charset_ordered_list_tick.
        (Fmap_charset_chars): Fix handling of default value for FROM_CODE
        and TO_CODE.
  
  2008-02-01  Dave Love  <fx@gnu.org>
  
 -      * casetab.c (init_casetab_once, init_casetab_once): Fix
 -      CHAR_TABLE_SET call.
 +      * casetab.c (init_casetab_once, init_casetab_once):
 +      Fix CHAR_TABLE_SET call.
  
        * category.c (Fmodify_category_entry): Fix CATEGORY_MEMBER call.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
        * category.c (Fmodify_category_entry): Don't modify the contents
 -      of category_set for characters out of the range.  Avoid
 -      unnecessary modification.
 +      of category_set for characters out of the range.
 +      Avoid unnecessary modification.
  
        * character.h (MAYBE_UNIFY_CHAR): Adjust for the change of
        Vchar_unify_table.  The default value of the table is now nil.
        * character.c (syms_of_character): Setup Vchar_width_table for
        eight-bit-control and raw-byte chars.
  
 -      * charset.h (enum define_charset_arg_index): Delete
 -      charset_arg_parents and add charset_arg_subset and
 +      * charset.h (enum define_charset_arg_index):
 +      Delete charset_arg_parents and add charset_arg_subset and
        charset_arg_superset.
        (enum charset_attr_index): Delete charset_parents and add
        charset_subset and charset_superset.
  
        * charset.c (load_charset_map): Set the default value of encoder
        and deunifier char-tables to nil.
 -      (map_charset_chars): Change argument.  Change callers.  Use
 -      map_char_table_for_charset instead of map_char_table.
 +      (map_charset_chars): Change argument.  Change callers.
 +      Use map_char_table_for_charset instead of map_char_table.
        (Fmap_charset_chars): New optional args from_code and to_code.
        (Fdefine_charset_internal): Adjust for the change of
        `define-charset' (:parents -> :subset or :superset).
        Fdefine_charset_internal.
        (Ffind_charset_string): Setup the vector `charsets' correctly.
  
 -      * chartab.c (sub_char_table_ref_and_range): New arg default.  Fix
 -      the previous change.
 +      * chartab.c (sub_char_table_ref_and_range): New arg default.
 +      Fix the previous change.
        (char_table_ref_and_range): Adjust for the above change.
        (map_sub_char_table_for_charset): New function.
        (map_char_table_for_charset): New function.
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
        * coding.c (ONE_MORE_BYTE_NO_CHECK): Increment consumed_chars.
 -      (emacs_mule_char): New arg src.  Delete arg `composition'.  Change
 -      caller.  Handle 2-byte and 3-byte charsets correctly.
 +      (emacs_mule_char): New arg src.  Delete arg `composition'.
 +      Change caller.  Handle 2-byte and 3-byte charsets correctly.
        (DECODE_EMACS_MULE_COMPOSITION_RULE_20): Rename from
        DECODE_EMACS_MULE_COMPOSITION_RULE.  Change caller.
        (DECODE_EMACS_MULE_COMPOSITION_RULE_21): New macro.
 -      (DECODE_EMACS_MULE_21_COMPOSITION): Call
 -      DECODE_EMACS_MULE_COMPOSITION_RULE_21.  Produce correct annotation
 +      (DECODE_EMACS_MULE_21_COMPOSITION):
 +      Call DECODE_EMACS_MULE_COMPOSITION_RULE_21.  Produce correct annotation
        sequence.
        (decode_coding_emacs_mule): Handle composition correctly.  Rewind
        `src' and `consumed_chars' correctly before calling emacs_mule_char.
  
        * character.h (string_escape_byte8): Declare.
  
 -      * charset.c (load_charset_map, load_charset_map_from_file): Remove
 -      unused vars.
 +      * charset.c (load_charset_map, load_charset_map_from_file):
 +      Remove unused vars.
        (Fdefine_charset_internal, Fsplit_char, syms_of_charset)
        (Fmap_charset_chars): Doc fix.
  
        * coding.c (coding_set_source): Delete the local variable beg_byte.
        (encode_coding_charset, Fdefine_coding_system_internal):
        Delete the local variable charset.
 -      (Fdefine_coding_system_internal): Setup
 -      attrs[coding_attr_charset_valids] correctly.
 +      (Fdefine_coding_system_internal):
 +      Setup attrs[coding_attr_charset_valids] correctly.
  
        * charset.c (CODE_POINT_TO_INDEX): Utilize `code_space_mask'
        member to check if CODE is valid or not.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
 -      * coding.c (decode_coding_charset, encode_coding_charset): Handle
 -      multiple charsets correctly.
 +      * coding.c (decode_coding_charset, encode_coding_charset):
 +      Handle multiple charsets correctly.
  
  2008-02-01  Kenichi Handa  <handa@m17n.org>
  
        (SUB_CHAR_TABLE_P): Check PVEC_CHAR_TABLE.
        (GC_SUB_CHAR_TABLE_P): New macro.
        (Fencode_coding_string, Fdecode_coding_string): Update EXFUN.
 -      (code_convert_string_norecord): Deleted extern.
 +      (code_convert_string_norecord): Delete extern.
        (init_character_once, syms_of_character, init_charset)
        (syms_of_composite, Qeq, Fmakehash, insert_from_gap): Extern them.
  
@@@ -30871,9 -22671,10 +30877,9 @@@ See ChangeLog.10 for earlier changes
  
  ;; Local Variables:
  ;; coding: utf-8
 -;; add-log-time-zone-rule: t
  ;; End:
  
 -    Copyright (C) 2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
 +  Copyright (C) 2007-2011  Free Software Foundation, Inc.
  
    This file is part of GNU Emacs.
  
  
    You should have received a copy of the GNU General Public License
    along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 -
 -;; arch-tag: dfb6ad96-1550-4905-9e53-d2059ee84c40
diff --combined src/xdisp.c
index 68f7835f0d7c49abb91b72538300e2620a8a1cf0,c2af4d68b6efa0d4c94cfc1eb0acf7362ed64297..147f2965d0e14df6d62769e0a540a2165ab05365
@@@ -1,6 -1,8 +1,6 @@@
  /* Display generation from window structure and buffer text.
 -   Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995,
 -                 1997, 1998, 1999, 2000, 2001, 2002, 2003,
 -                 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 -                 Free Software Foundation, Inc.
 +
 +Copyright (C) 1985-1988, 1993-1995, 1997-2011  Free Software Foundation, Inc.
  
  This file is part of GNU Emacs.
  
@@@ -30,7 -32,9 +30,7 @@@ along with GNU Emacs.  If not, see <htt
     decides it's time to do it.  This is done either automatically for
     you as part of the interpreter's command loop or as the result of
     calling Lisp functions like `sit-for'.  The C function `redisplay'
 -   in xdisp.c is the only entry into the inner redisplay code.  (Or,
 -   let's say almost---see the description of direct update
 -   operations, below.)
 +   in xdisp.c is the only entry into the inner redisplay code.
  
     The following diagram shows how redisplay code is invoked.  As you
     can see, Lisp calls redisplay and vice versa.  Under window systems
     change the interpreter's state.  If you don't follow these rules,
     you will encounter bugs which are very hard to explain.
  
 -           (Direct functions, see below)
 -             direct_output_for_insert,
 -             direct_forward_char (dispnew.c)
 -        +---------------------------------+
 -          |                                 |
 -        |                                 V
     +--------------+   redisplay     +----------------+
     | Lisp machine |---------------->| Redisplay code |<--+
     +--------------+   (xdisp.c)     +----------------+   |
     then compared to find a cheap way to update the display, e.g. by
     reusing part of the display by scrolling lines.
  
 -
 -   Direct operations.
 -
     You will find a lot of redisplay optimizations when you start
     looking at the innards of redisplay.  The overall goal of all these
     optimizations is to make redisplay fast because it is done
 -   frequently.
 +   frequently.  Some of these optimizations are implemented by the
 +   following functions:
 +
 +    . try_cursor_movement
 +
 +      This function tries to update the display if the text in the
 +      window did not change and did not scroll, only point moved, and
 +      it did not move off the displayed portion of the text.
 +
 +    . try_window_reusing_current_matrix
 +
 +      This function reuses the current matrix of a window when text
 +      has not changed, but the window start changed (e.g., due to
 +      scrolling).
 +
 +    . try_window_id
  
 -   Two optimizations are not found in xdisp.c.  These are the direct
 -   operations mentioned above.  As the name suggests they follow a
 -   different principle than the rest of redisplay.  Instead of
 -   building a desired matrix and then comparing it with the current
 -   display, they perform their actions directly on the display and on
 -   the current matrix.
 +      This function attempts to redisplay a window by reusing parts of
 +      its existing display.  It finds and reuses the part that was not
 +      changed, and redraws the rest.
  
 -   One direct operation updates the display after one character has
 -   been entered.  The other one moves the cursor by one position
 -   forward or backward.  You find these functions under the names
 -   `direct_output_for_insert' and `direct_output_forward_char' in
 -   dispnew.c.
 +    . try_window
  
 +      This function performs the full redisplay of a single window
 +      assuming that its fonts were not changed and that the cursor
 +      will not end up in the scroll margins.  (Loading fonts requires
 +      re-adjustment of dimensions of glyph matrices, which makes this
 +      method impossible to use.)
 +
 +   These optimizations are tried in sequence (some can be skipped if
 +   it is known that they are not applicable).  If none of the
 +   optimizations were successful, redisplay calls redisplay_windows,
 +   which performs a full redisplay of all windows.
  
     Desired matrices.
  
     see in dispextern.h.
  
     Glyphs in a desired matrix are normally constructed in a loop
 -   calling get_next_display_element and then produce_glyphs.  The call
 -   to produce_glyphs will fill the iterator structure with pixel
 +   calling get_next_display_element and then PRODUCE_GLYPHS.  The call
 +   to PRODUCE_GLYPHS will fill the iterator structure with pixel
     information about the element being displayed and at the same time
     produce glyphs for it.  If the display element fits on the line
     being displayed, set_iterator_to_next is called next, otherwise the
 -   glyphs produced are discarded.
 -
 +   glyphs produced are discarded.  The function display_line is the
 +   workhorse of filling glyph rows in the desired matrix with glyphs.
 +   In addition to producing glyphs, it also handles line truncation
 +   and continuation, word wrap, and cursor positioning (for the
 +   latter, see also set_cursor_from_row).
  
     Frame matrices.
  
     wanted to have without having to move many bytes around.  To be
     honest, there is a little bit more done, but not much more.  If you
     plan to extend that code, take a look at dispnew.c.  The function
 -   build_frame_matrix is a good starting point.  */
 +   build_frame_matrix is a good starting point.
 +
 +   Bidirectional display.
 +
 +   Bidirectional display adds quite some hair to this already complex
 +   design.  The good news are that a large portion of that hairy stuff
 +   is hidden in bidi.c behind only 3 interfaces.  bidi.c implements a
 +   reordering engine which is called by set_iterator_to_next and
 +   returns the next character to display in the visual order.  See
 +   commentary on bidi.c for more details.  As far as redisplay is
 +   concerned, the effect of calling bidi_move_to_visually_next, the
 +   main interface of the reordering engine, is that the iterator gets
 +   magically placed on the buffer or string position that is to be
 +   displayed next.  In other words, a linear iteration through the
 +   buffer/string is replaced with a non-linear one.  All the rest of
 +   the redisplay is oblivious to the bidi reordering.
 +
 +   Well, almost oblivious---there are still complications, most of
 +   them due to the fact that buffer and string positions no longer
 +   change monotonously with glyph indices in a glyph row.  Moreover,
 +   for continued lines, the buffer positions may not even be
 +   monotonously changing with vertical positions.  Also, accounting
 +   for face changes, overlays, etc. becomes more complex because
 +   non-linear iteration could potentially skip many positions with
 +   changes, and then cross them again on the way back...
 +
 +   One other prominent effect of bidirectional display is that some
 +   paragraphs of text need to be displayed starting at the right
 +   margin of the window---the so-called right-to-left, or R2L
 +   paragraphs.  R2L paragraphs are displayed with R2L glyph rows,
 +   which have their reversed_p flag set.  The bidi reordering engine
 +   produces characters in such rows starting from the character which
 +   should be the rightmost on display.  PRODUCE_GLYPHS then reverses
 +   the order, when it fills up the glyph row whose reversed_p flag is
 +   set, by prepending each new glyph to what is already there, instead
 +   of appending it.  When the glyph row is complete, the function
 +   extend_face_to_end_of_line fills the empty space to the left of the
 +   leftmost character with special glyphs, which will display as,
 +   well, empty.  On text terminals, these special glyphs are simply
 +   blank characters.  On graphics terminals, there's a single stretch
 +   glyph of a suitably computed width.  Both the blanks and the
 +   stretch glyph are given the face of the background of the line.
 +   This way, the terminal-specific back-end can still draw the glyphs
 +   left to right, even for R2L lines.
 +
 +   Bidirectional display and character compositions
 +
 +   Some scripts cannot be displayed by drawing each character
 +   individually, because adjacent characters change each other's shape
 +   on display.  For example, Arabic and Indic scripts belong to this
 +   category.
 +
 +   Emacs display supports this by providing "character compositions",
 +   most of which is implemented in composite.c.  During the buffer
 +   scan that delivers characters to PRODUCE_GLYPHS, if the next
 +   character to be delivered is a composed character, the iteration
 +   calls composition_reseat_it and next_element_from_composition.  If
 +   they succeed to compose the character with one or more of the
 +   following characters, the whole sequence of characters that where
 +   composed is recorded in the `struct composition_it' object that is
 +   part of the buffer iterator.  The composed sequence could produce
 +   one or more font glyphs (called "grapheme clusters") on the screen.
 +   Each of these grapheme clusters is then delivered to PRODUCE_GLYPHS
 +   in the direction corresponding to the current bidi scan direction
 +   (recorded in the scan_dir member of the `struct bidi_it' object
 +   that is part of the buffer iterator).  In particular, if the bidi
 +   iterator currently scans the buffer backwards, the grapheme
 +   clusters are delivered back to front.  This reorders the grapheme
 +   clusters as appropriate for the current bidi context.  Note that
 +   this means that the grapheme clusters are always stored in the
 +   LGSTRING object (see composite.c) in the logical order.
 +
 +   Moving an iterator in bidirectional text
 +   without producing glyphs
 +
 +   Note one important detail mentioned above: that the bidi reordering
 +   engine, driven by the iterator, produces characters in R2L rows
 +   starting at the character that will be the rightmost on display.
 +   As far as the iterator is concerned, the geometry of such rows is
 +   still left to right, i.e. the iterator "thinks" the first character
 +   is at the leftmost pixel position.  The iterator does not know that
 +   PRODUCE_GLYPHS reverses the order of the glyphs that the iterator
 +   delivers.  This is important when functions from the the move_it_*
 +   family are used to get to certain screen position or to match
 +   screen coordinates with buffer coordinates: these functions use the
 +   iterator geometry, which is left to right even in R2L paragraphs.
 +   This works well with most callers of move_it_*, because they need
 +   to get to a specific column, and columns are still numbered in the
 +   reading order, i.e. the rightmost character in a R2L paragraph is
 +   still column zero.  But some callers do not get well with this; a
 +   notable example is mouse clicks that need to find the character
 +   that corresponds to certain pixel coordinates.  See
 +   buffer_posn_from_coords in dispnew.c for how this is handled.  */
  
  #include <config.h>
  #include <stdio.h>
  #include "macros.h"
  #include "disptab.h"
  #include "termhooks.h"
 +#include "termopts.h"
  #include "intervals.h"
  #include "coding.h"
  #include "process.h"
  
  #define INFINITY 10000000
  
 -#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
 -    || defined(HAVE_NS) || defined (USE_GTK)
 -extern void set_frame_menubar P_ ((struct frame *f, int, int));
 -extern int pending_menu_activation;
 -#endif
 -
 -extern int interrupt_input;
 -extern int command_loop_level;
 -
 -extern Lisp_Object do_mouse_tracking;
 -
 -extern int minibuffer_auto_raise;
 -extern Lisp_Object Vminibuffer_list;
 -
 -extern Lisp_Object Qface, Qdefault;
 -extern Lisp_Object Qmode_line, Qmode_line_inactive, Qheader_line;
 -
 -extern Lisp_Object Voverriding_local_map;
 -extern Lisp_Object Voverriding_local_map_menu_flag;
 -extern Lisp_Object Qmenu_item;
 -extern Lisp_Object Qwhen;
 -extern Lisp_Object Qhelp_echo;
 -extern Lisp_Object Qbefore_string, Qafter_string;
 -
  Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
 -Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions;
 -Lisp_Object Qwindow_text_change_functions, Vwindow_text_change_functions;
 -Lisp_Object Qredisplay_end_trigger_functions, Vredisplay_end_trigger_functions;
 +Lisp_Object Qwindow_scroll_functions;
 +Lisp_Object Qwindow_text_change_functions;
 +Lisp_Object Qredisplay_end_trigger_functions;
  Lisp_Object Qinhibit_point_motion_hooks;
  Lisp_Object QCeval, QCfile, QCdata, QCpropertize;
  Lisp_Object Qfontified;
  Lisp_Object Qgrow_only;
  Lisp_Object Qinhibit_eval_during_redisplay;
  Lisp_Object Qbuffer_position, Qposition, Qobject;
 +Lisp_Object Qright_to_left, Qleft_to_right;
  
  /* Cursor shapes */
  Lisp_Object Qbar, Qhbar, Qbox, Qhollow;
  /* Pointer shapes */
  Lisp_Object Qarrow, Qhand, Qtext;
  
 -Lisp_Object Qrisky_local_variable;
 -
  /* Holds the list (error).  */
  Lisp_Object list_of_error;
  
 -/* Functions called to fontify regions of text.  */
 -
 -Lisp_Object Vfontification_functions;
  Lisp_Object Qfontification_functions;
  
 -/* Non-nil means automatically select any window when the mouse
 -   cursor moves into it.  */
 -Lisp_Object Vmouse_autoselect_window;
 -
 -Lisp_Object Vwrap_prefix, Qwrap_prefix;
 -Lisp_Object Vline_prefix, Qline_prefix;
 -
 -/* Non-zero means draw tool bar buttons raised when the mouse moves
 -   over them.  */
 -
 -int auto_raise_tool_bar_buttons_p;
 -
 -/* Non-zero means to reposition window if cursor line is only partially visible.  */
 -
 -int make_cursor_line_fully_visible_p;
 -
 -/* Margin below tool bar in pixels.  0 or nil means no margin.
 -   If value is `internal-border-width' or `border-width',
 -   the corresponding frame parameter is used.  */
 -
 -Lisp_Object Vtool_bar_border;
 -
 -/* Margin around tool bar buttons in pixels.  */
 -
 -Lisp_Object Vtool_bar_button_margin;
 -
 -/* Thickness of shadow to draw around tool bar buttons.  */
 -
 -EMACS_INT tool_bar_button_relief;
 -
 -/* Non-nil means automatically resize tool-bars so that all tool-bar
 -   items are visible, and no blank lines remain.
 -
 -   If value is `grow-only', only make tool-bar bigger.  */
 -
 -Lisp_Object Vauto_resize_tool_bars;
 -
 -/* Non-zero means draw block and hollow cursor as wide as the glyph
 -   under it.  For example, if a block cursor is over a tab, it will be
 -   drawn as wide as that tab on the display.  */
 -
 -int x_stretch_cursor_p;
 +Lisp_Object Qwrap_prefix;
 +Lisp_Object Qline_prefix;
  
  /* Non-nil means don't actually do any redisplay.  */
  
 -Lisp_Object Vinhibit_redisplay, Qinhibit_redisplay;
 -
 -/* Non-zero means Lisp evaluation during redisplay is inhibited.  */
 -
 -int inhibit_eval_during_redisplay;
 +Lisp_Object Qinhibit_redisplay;
  
  /* Names of text properties relevant for redisplay.  */
  
  Lisp_Object Qdisplay;
 -extern Lisp_Object Qface, Qinvisible, Qwidth;
  
 -/* Symbols used in text property values.  */
 -
 -Lisp_Object Vdisplay_pixels_per_inch;
  Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height;
  Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qraise;
  Lisp_Object Qslice;
  Lisp_Object Qcenter;
  Lisp_Object Qmargin, Qpointer;
  Lisp_Object Qline_height;
 -extern Lisp_Object Qheight;
 -extern Lisp_Object QCwidth, QCheight, QCascent;
 -extern Lisp_Object Qscroll_bar;
 -extern Lisp_Object Qcursor;
 -
 -/* Non-nil means highlight trailing whitespace.  */
 -
 -Lisp_Object Vshow_trailing_whitespace;
 -
 -/* Non-nil means escape non-break space and hyphens.  */
 -
 -Lisp_Object Vnobreak_char_display;
  
  #ifdef HAVE_WINDOW_SYSTEM
 -extern Lisp_Object Voverflow_newline_into_fringe;
  
  /* Test if overflow newline into fringe.  Called with iterator IT
     at or past right window margin, and with IT->current_x set.  */
  
 -#define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it)   \
 -  (!NILP (Voverflow_newline_into_fringe)      \
 -   && FRAME_WINDOW_P (it->f)                  \
 -   && WINDOW_RIGHT_FRINGE_WIDTH (it->w) > 0   \
 -   && it->current_x == it->last_visible_x     \
 -   && it->line_wrap != WORD_WRAP)
 +#define IT_OVERFLOW_NEWLINE_INTO_FRINGE(IT)           \
 +  (!NILP (Voverflow_newline_into_fringe)              \
 +   && FRAME_WINDOW_P ((IT)->f)                                \
 +   && ((IT)->bidi_it.paragraph_dir == R2L             \
 +       ? (WINDOW_LEFT_FRINGE_WIDTH ((IT)->w) > 0)     \
 +       : (WINDOW_RIGHT_FRINGE_WIDTH ((IT)->w) > 0))   \
 +   && (IT)->current_x == (IT)->last_visible_x         \
 +   && (IT)->line_wrap != WORD_WRAP)
  
  #else /* !HAVE_WINDOW_SYSTEM */
  #define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) 0
  #define IT_DISPLAYING_WHITESPACE(it)                          \
    (it->what == IT_CHARACTER && (it->c == ' ' || it->c == '\t'))
  
 -/* Non-nil means show the text cursor in void text areas
 -   i.e. in blank areas after eol and eob.  This used to be
 -   the default in 21.3.  */
 -
 -Lisp_Object Vvoid_text_area_pointer;
 -
  /* Name of the face used to highlight trailing whitespace.  */
  
  Lisp_Object Qtrailing_whitespace;
@@@ -394,7 -386,7 +394,7 @@@ Lisp_Object Qescape_glyph
  Lisp_Object Qnobreak_space;
  
  /* The symbol `image' which is the car of the lists used to represent
 -   images in Lisp.  */
 +   images in Lisp.  Also a tool bar style.  */
  
  Lisp_Object Qimage;
  
  Lisp_Object QCmap, QCpointer;
  Lisp_Object Qrect, Qcircle, Qpoly;
  
 +/* Tool bar styles */
 +Lisp_Object Qboth, Qboth_horiz, Qtext_image_horiz;
 +
  /* Non-zero means print newline to stdout before next mini-buffer
     message.  */
  
@@@ -444,16 -433,41 +444,16 @@@ static int this_line_pixel_height
  
  static int this_line_start_x;
  
 -/* Buffer that this_line_.* variables are referring to.  */
 -
 -static struct buffer *this_line_buffer;
 -
 -/* Nonzero means truncate lines in all windows less wide than the
 -   frame.  */
 -
 -Lisp_Object Vtruncate_partial_width_windows;
 -
 -/* A flag to control how to display unibyte 8-bit character.  */
 -
 -int unibyte_display_via_language_environment;
 -
 -/* Nonzero means we have more than one non-mini-buffer-only frame.
 -   Not guaranteed to be accurate except while parsing
 -   frame-title-format.  */
 -
 -int multiple_frames;
 -
 -Lisp_Object Vglobal_mode_string;
 +/* The smallest character position seen by move_it_* functions as they
 +   move across display lines.  Used to set MATRIX_ROW_START_CHARPOS of
 +   hscrolled lines, see display_line.  */
  
 +static struct text_pos this_line_min_pos;
  
 -/* List of variables (symbols) which hold markers for overlay arrows.
 -   The symbols on this list are examined during redisplay to determine
 -   where to display overlay arrows.  */
 -
 -Lisp_Object Voverlay_arrow_variable_list;
 -
 -/* Marker for where to display an arrow on top of the buffer text.  */
 -
 -Lisp_Object Voverlay_arrow_position;
 +/* Buffer that this_line_.* variables are referring to.  */
  
 -/* String to display for the arrow.  Only used on terminal frames.  */
 +static struct buffer *this_line_buffer;
  
 -Lisp_Object Voverlay_arrow_string;
  
  /* Values of those variables at last redisplay are stored as
     properties on `overlay-arrow-position' symbol.  However, if
@@@ -467,12 -481,47 +467,12 @@@ Lisp_Object Qlast_arrow_position, Qlast
  
  Lisp_Object Qoverlay_arrow_string, Qoverlay_arrow_bitmap;
  
 -/* Like mode-line-format, but for the title bar on a visible frame.  */
 -
 -Lisp_Object Vframe_title_format;
 -
 -/* Like mode-line-format, but for the title bar on an iconified frame.  */
 -
 -Lisp_Object Vicon_title_format;
 -
 -/* List of functions to call when a window's size changes.  These
 -   functions get one arg, a frame on which one or more windows' sizes
 -   have changed.  */
 -
 -static Lisp_Object Vwindow_size_change_functions;
 -
 -Lisp_Object Qmenu_bar_update_hook, Vmenu_bar_update_hook;
 +Lisp_Object Qmenu_bar_update_hook;
  
  /* Nonzero if an overlay arrow has been displayed in this window.  */
  
  static int overlay_arrow_seen;
  
 -/* Nonzero means highlight the region even in nonselected windows.  */
 -
 -int highlight_nonselected_windows;
 -
 -/* If cursor motion alone moves point off frame, try scrolling this
 -   many lines up or down if that will bring it back.  */
 -
 -static EMACS_INT scroll_step;
 -
 -/* Nonzero means scroll just far enough to bring point back on the
 -   screen, when appropriate.  */
 -
 -static EMACS_INT scroll_conservatively;
 -
 -/* Recenter the window whenever point gets within this many lines of
 -   the top or bottom of the window.  This value is translated into a
 -   pixel value by multiplying it with FRAME_LINE_HEIGHT, which means
 -   that there is really a fixed pixel height scroll margin.  */
 -
 -EMACS_INT scroll_margin;
 -
  /* Number of windows showing the buffer of the selected window (or
     another buffer with the same base buffer).  keyboard.c refers to
     this.  */
@@@ -483,6 -532,14 +483,6 @@@ int buffer_shared
  
  static Lisp_Object default_invis_vector[3];
  
 -/* Zero means display the mode-line/header-line/menu-bar in the default face
 -   (this slightly odd definition is for compatibility with previous versions
 -   of emacs), non-zero means display them using their respective faces.
 -
 -   This variable is deprecated.  */
 -
 -int mode_line_inverse_video;
 -
  /* Prompt to display in front of the mini-buffer contents.  */
  
  Lisp_Object minibuf_prompt;
@@@ -528,6 -585,19 +528,6 @@@ int cursor_type_changed
  
  int line_number_displayed;
  
 -/* Maximum buffer size for which to display line numbers.  */
 -
 -Lisp_Object Vline_number_display_limit;
 -
 -/* Line width to consider when repositioning for line number display.  */
 -
 -static EMACS_INT line_number_display_limit_width;
 -
 -/* Number of lines to keep in the message log buffer.  t means
 -   infinite.  nil means don't log at all.  */
 -
 -Lisp_Object Vmessage_log_max;
 -
  /* The name of the *Messages* buffer, a string.  */
  
  static Lisp_Object Vmessages_buffer_name;
@@@ -558,6 -628,23 +558,6 @@@ int message_buf_print
  /* The symbol `inhibit-menubar-update' and its DEFVAR_BOOL variable.  */
  
  Lisp_Object Qinhibit_menubar_update;
 -int inhibit_menubar_update;
 -
 -/* When evaluating expressions from menu bar items (enable conditions,
 -   for instance), this is the frame they are being processed for.  */
 -
 -Lisp_Object Vmenu_updating_frame;
 -
 -/* Maximum height for resizing mini-windows.  Either a float
 -   specifying a fraction of the available height, or an integer
 -   specifying a number of lines.  */
 -
 -Lisp_Object Vmax_mini_window_height;
 -
 -/* Non-zero means messages should be displayed with truncated
 -   lines instead of being continued.  */
 -
 -int message_truncate_lines;
  Lisp_Object Qmessage_truncate_lines;
  
  /* Set to 1 in clear_message to make redisplay_internal aware
  
  static int message_cleared_p;
  
 -/* How to blink the default frame cursor off.  */
 -Lisp_Object Vblink_cursor_alist;
 -
  /* A scratch glyph row with contents used for generating truncation
     glyphs.  Also used in direct_output_for_insert.  */
  
@@@ -596,6 -686,11 +596,6 @@@ int current_mode_line_height, current_h
  
  #if GLYPH_DEBUG
  
 -/* Variables to turn off display optimizations from Lisp.  */
 -
 -int inhibit_try_window_id, inhibit_try_window_reusing;
 -int inhibit_try_cursor_movement;
 -
  /* Non-zero means print traces of redisplay if compiled with
     GLYPH_DEBUG != 0.  */
  
@@@ -612,12 -707,40 +612,12 @@@ int trace_move
  #define TRACE_MOVE(x) (void) 0
  #endif
  
 -/* Non-zero means automatically scroll windows horizontally to make
 -   point visible.  */
 -
 -int automatic_hscrolling_p;
  Lisp_Object Qauto_hscroll_mode;
  
 -/* How close to the margin can point get before the window is scrolled
 -   horizontally.  */
 -EMACS_INT hscroll_margin;
 -
 -/* How much to scroll horizontally when point is inside the above margin.  */
 -Lisp_Object Vhscroll_step;
 -
 -/* The variable `resize-mini-windows'.  If nil, don't resize
 -   mini-windows.  If t, always resize them to fit the text they
 -   display.  If `grow-only', let mini-windows grow only until they
 -   become empty.  */
 -
 -Lisp_Object Vresize_mini_windows;
 -
  /* Buffer being redisplayed -- for redisplay_window_error.  */
  
  struct buffer *displayed_buffer;
  
 -/* Space between overline and text. */
 -
 -EMACS_INT overline_margin;
 -
 -/* Require underline to be at least this many screen pixels below baseline
 -   This to avoid underline "merging" with the base of letters at small
 -   font sizes, particularly when x_use_underline_position_properties is on. */
 -
 -EMACS_INT underline_minimum_offset;
 -
  /* Value returned from text property handlers (see below).  */
  
  enum prop_handled
@@@ -641,15 -764,15 +641,15 @@@ struct prop
  
    /* A handler function called to set up iterator IT from the property
       at IT's current position.  Value is used to steer handle_stop.  */
 -  enum prop_handled (*handler) P_ ((struct it *it));
 +  enum prop_handled (*handler) (struct it *it);
  };
  
 -static enum prop_handled handle_face_prop P_ ((struct it *));
 -static enum prop_handled handle_invisible_prop P_ ((struct it *));
 -static enum prop_handled handle_display_prop P_ ((struct it *));
 -static enum prop_handled handle_composition_prop P_ ((struct it *));
 -static enum prop_handled handle_overlay_change P_ ((struct it *));
 -static enum prop_handled handle_fontified_prop P_ ((struct it *));
 +static enum prop_handled handle_face_prop (struct it *);
 +static enum prop_handled handle_invisible_prop (struct it *);
 +static enum prop_handled handle_display_prop (struct it *);
 +static enum prop_handled handle_composition_prop (struct it *);
 +static enum prop_handled handle_overlay_change (struct it *);
 +static enum prop_handled handle_fontified_prop (struct it *);
  
  /* Properties handled by iterators.  */
  
@@@ -708,15 -831,17 +708,15 @@@ static int clear_face_cache_count
  #ifdef HAVE_WINDOW_SYSTEM
  #define CLEAR_IMAGE_CACHE_COUNT       101
  static int clear_image_cache_count;
 +
 +/* Null glyph slice */
 +static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 };
  #endif
  
  /* Non-zero while redisplay_internal is in progress.  */
  
  int redisplaying_p;
  
 -/* Non-zero means don't free realized faces.  Bound while freeing
 -   realized faces is dangerous because glyph matrices might still
 -   reference them.  */
 -
 -int inhibit_free_realized_faces;
  Lisp_Object Qinhibit_free_realized_faces;
  
  /* If a string, XTread_socket generates an event to display that string.
  Lisp_Object help_echo_string;
  Lisp_Object help_echo_window;
  Lisp_Object help_echo_object;
 -int help_echo_pos;
 +EMACS_INT help_echo_pos;
  
  /* Temporary variable for XTread_socket.  */
  
  Lisp_Object previous_help_echo_string;
  
 -/* Null glyph slice */
 -
 -static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 };
 -
  /* Platform-independent portion of hourglass implementation. */
  
 -/* Non-zero means we're allowed to display a hourglass pointer.  */
 -int display_hourglass_p;
 -
  /* Non-zero means an hourglass cursor is currently shown.  */
  int hourglass_shown_p;
  
     an hourglass cursor on all frames.  */
  struct atimer *hourglass_atimer;
  
 -/* Number of seconds to wait before displaying an hourglass cursor.  */
 -Lisp_Object Vhourglass_delay;
 +/* Name of the face used to display glyphless characters.  */
 +Lisp_Object Qglyphless_char;
 +
 +/* Symbol for the purpose of Vglyphless_char_display.  */
 +Lisp_Object Qglyphless_char_display;
 +
 +/* Method symbols for Vglyphless_char_display.  */
 +static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width;
 +
 +/* Default pixel width of `thin-space' display method.  */
 +#define THIN_SPACE_WIDTH 1
  
  /* Default number of seconds to wait before displaying an hourglass
     cursor.  */
  \f
  /* Function prototypes.  */
  
 -static void setup_for_ellipsis P_ ((struct it *, int));
 -static void mark_window_display_accurate_1 P_ ((struct window *, int));
 -static int single_display_spec_string_p P_ ((Lisp_Object, Lisp_Object));
 -static int display_prop_string_p P_ ((Lisp_Object, Lisp_Object));
 -static int cursor_row_p P_ ((struct window *, struct glyph_row *));
 -static int redisplay_mode_lines P_ ((Lisp_Object, int));
 -static char *decode_mode_spec_coding P_ ((Lisp_Object, char *, int));
 -
 -static Lisp_Object get_it_property P_ ((struct it *it, Lisp_Object prop));
 -
 -static void handle_line_prefix P_ ((struct it *));
 -
 -static void pint2str P_ ((char *, int, int));
 -static void pint2hrstr P_ ((char *, int, int));
 -static struct text_pos run_window_scroll_functions P_ ((Lisp_Object,
 -                                                      struct text_pos));
 -static void reconsider_clip_changes P_ ((struct window *, struct buffer *));
 -static int text_outside_line_unchanged_p P_ ((struct window *, int, int));
 -static void store_mode_line_noprop_char P_ ((char));
 -static int store_mode_line_noprop P_ ((const unsigned char *, int, int));
 -static void x_consider_frame_title P_ ((Lisp_Object));
 -static void handle_stop P_ ((struct it *));
 -static int tool_bar_lines_needed P_ ((struct frame *, int *));
 -static int single_display_spec_intangible_p P_ ((Lisp_Object));
 -static void ensure_echo_area_buffers P_ ((void));
 -static Lisp_Object unwind_with_echo_area_buffer P_ ((Lisp_Object));
 -static Lisp_Object with_echo_area_buffer_unwind_data P_ ((struct window *));
 -static int with_echo_area_buffer P_ ((struct window *, int,
 -                                    int (*) (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT),
 -                                    EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
 -static void clear_garbaged_frames P_ ((void));
 -static int current_message_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
 -static int truncate_message_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
 -static int set_message_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
 -static int display_echo_area P_ ((struct window *));
 -static int display_echo_area_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
 -static int resize_mini_window_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
 -static Lisp_Object unwind_redisplay P_ ((Lisp_Object));
 -static int string_char_and_length P_ ((const unsigned char *, int *));
 -static struct text_pos display_prop_end P_ ((struct it *, Lisp_Object,
 -                                           struct text_pos));
 -static int compute_window_start_on_continuation_line P_ ((struct window *));
 -static Lisp_Object safe_eval_handler P_ ((Lisp_Object));
 -static void insert_left_trunc_glyphs P_ ((struct it *));
 -static struct glyph_row *get_overlay_arrow_glyph_row P_ ((struct window *,
 -                                                        Lisp_Object));
 -static void extend_face_to_end_of_line P_ ((struct it *));
 -static int append_space_for_newline P_ ((struct it *, int));
 -static int cursor_row_fully_visible_p P_ ((struct window *, int, int));
 -static int try_scrolling P_ ((Lisp_Object, int, EMACS_INT, EMACS_INT, int, int));
 -static int try_cursor_movement P_ ((Lisp_Object, struct text_pos, int *));
 -static int trailing_whitespace_p P_ ((int));
 -static int message_log_check_duplicate P_ ((int, int, int, int));
 -static void push_it P_ ((struct it *));
 -static void pop_it P_ ((struct it *));
 -static void sync_frame_with_window_matrix_rows P_ ((struct window *));
 -static void select_frame_for_redisplay P_ ((Lisp_Object));
 -static void redisplay_internal P_ ((int));
 -static int echo_area_display P_ ((int));
 -static void redisplay_windows P_ ((Lisp_Object));
 -static void redisplay_window P_ ((Lisp_Object, int));
 -static Lisp_Object redisplay_window_error ();
 -static Lisp_Object redisplay_window_0 P_ ((Lisp_Object));
 -static Lisp_Object redisplay_window_1 P_ ((Lisp_Object));
 -static int update_menu_bar P_ ((struct frame *, int, int));
 -static int try_window_reusing_current_matrix P_ ((struct window *));
 -static int try_window_id P_ ((struct window *));
 -static int display_line P_ ((struct it *));
 -static int display_mode_lines P_ ((struct window *));
 -static int display_mode_line P_ ((struct window *, enum face_id, Lisp_Object));
 -static int display_mode_element P_ ((struct it *, int, int, int, Lisp_Object, Lisp_Object, int));
 -static int store_mode_line_string P_ ((char *, Lisp_Object, int, int, int, Lisp_Object));
 -static char *decode_mode_spec P_ ((struct window *, int, int, int,
 -                                 Lisp_Object *));
 -static void display_menu_bar P_ ((struct window *));
 -static int display_count_lines P_ ((int, int, int, int, int *));
 -static int display_string P_ ((unsigned char *, Lisp_Object, Lisp_Object,
 -                             EMACS_INT, EMACS_INT, struct it *, int, int, int, int));
 -static void compute_line_metrics P_ ((struct it *));
 -static void run_redisplay_end_trigger_hook P_ ((struct it *));
 -static int get_overlay_strings P_ ((struct it *, int));
 -static int get_overlay_strings_1 P_ ((struct it *, int, int));
 -static void next_overlay_string P_ ((struct it *));
 -static void reseat P_ ((struct it *, struct text_pos, int));
 -static void reseat_1 P_ ((struct it *, struct text_pos, int));
 -static void back_to_previous_visible_line_start P_ ((struct it *));
 -void reseat_at_previous_visible_line_start P_ ((struct it *));
 -static void reseat_at_next_visible_line_start P_ ((struct it *, int));
 -static int next_element_from_ellipsis P_ ((struct it *));
 -static int next_element_from_display_vector P_ ((struct it *));
 -static int next_element_from_string P_ ((struct it *));
 -static int next_element_from_c_string P_ ((struct it *));
 -static int next_element_from_buffer P_ ((struct it *));
 -static int next_element_from_composition P_ ((struct it *));
 -static int next_element_from_image P_ ((struct it *));
 -static int next_element_from_stretch P_ ((struct it *));
 -static void load_overlay_strings P_ ((struct it *, int));
 -static int init_from_display_pos P_ ((struct it *, struct window *,
 -                                    struct display_pos *));
 -static void reseat_to_string P_ ((struct it *, unsigned char *,
 -                                Lisp_Object, int, int, int, int));
 +static void setup_for_ellipsis (struct it *, int);
 +static void mark_window_display_accurate_1 (struct window *, int);
 +static int single_display_spec_string_p (Lisp_Object, Lisp_Object);
 +static int display_prop_string_p (Lisp_Object, Lisp_Object);
 +static int cursor_row_p (struct window *, struct glyph_row *);
 +static int redisplay_mode_lines (Lisp_Object, int);
 +static char *decode_mode_spec_coding (Lisp_Object, char *, int);
 +
 +static Lisp_Object get_it_property (struct it *it, Lisp_Object prop);
 +
 +static void handle_line_prefix (struct it *);
 +
 +static void pint2str (char *, int, int);
 +static void pint2hrstr (char *, int, int);
 +static struct text_pos run_window_scroll_functions (Lisp_Object,
 +                                                    struct text_pos);
 +static void reconsider_clip_changes (struct window *, struct buffer *);
 +static int text_outside_line_unchanged_p (struct window *,
 +                                        EMACS_INT, EMACS_INT);
 +static void store_mode_line_noprop_char (char);
 +static int store_mode_line_noprop (const char *, int, int);
 +static void handle_stop (struct it *);
 +static void handle_stop_backwards (struct it *, EMACS_INT);
 +static int single_display_spec_intangible_p (Lisp_Object);
 +static void ensure_echo_area_buffers (void);
 +static Lisp_Object unwind_with_echo_area_buffer (Lisp_Object);
 +static Lisp_Object with_echo_area_buffer_unwind_data (struct window *);
 +static int with_echo_area_buffer (struct window *, int,
 +                                  int (*) (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT),
 +                                  EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 +static void clear_garbaged_frames (void);
 +static int current_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 +static int truncate_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 +static int set_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 +static int display_echo_area (struct window *);
 +static int display_echo_area_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 +static int resize_mini_window_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 +static Lisp_Object unwind_redisplay (Lisp_Object);
 +static int string_char_and_length (const unsigned char *, int *);
 +static struct text_pos display_prop_end (struct it *, Lisp_Object,
 +                                         struct text_pos);
 +static int compute_window_start_on_continuation_line (struct window *);
 +static Lisp_Object safe_eval_handler (Lisp_Object);
 +static void insert_left_trunc_glyphs (struct it *);
 +static struct glyph_row *get_overlay_arrow_glyph_row (struct window *,
 +                                                      Lisp_Object);
 +static void extend_face_to_end_of_line (struct it *);
 +static int append_space_for_newline (struct it *, int);
 +static int cursor_row_fully_visible_p (struct window *, int, int);
 +static int try_scrolling (Lisp_Object, int, EMACS_INT, EMACS_INT, int, int);
 +static int try_cursor_movement (Lisp_Object, struct text_pos, int *);
 +static int trailing_whitespace_p (EMACS_INT);
 +static int message_log_check_duplicate (EMACS_INT, EMACS_INT,
 +                                      EMACS_INT, EMACS_INT);
 +static void push_it (struct it *);
 +static void pop_it (struct it *);
 +static void sync_frame_with_window_matrix_rows (struct window *);
 +static void select_frame_for_redisplay (Lisp_Object);
 +static void redisplay_internal (int);
 +static int echo_area_display (int);
 +static void redisplay_windows (Lisp_Object);
 +static void redisplay_window (Lisp_Object, int);
 +static Lisp_Object redisplay_window_error (Lisp_Object);
 +static Lisp_Object redisplay_window_0 (Lisp_Object);
 +static Lisp_Object redisplay_window_1 (Lisp_Object);
 +static int update_menu_bar (struct frame *, int, int);
 +static int try_window_reusing_current_matrix (struct window *);
 +static int try_window_id (struct window *);
 +static int display_line (struct it *);
 +static int display_mode_lines (struct window *);
 +static int display_mode_line (struct window *, enum face_id, Lisp_Object);
 +static int display_mode_element (struct it *, int, int, int, Lisp_Object, Lisp_Object, int);
 +static int store_mode_line_string (const char *, Lisp_Object, int, int, int, Lisp_Object);
 +static const char *decode_mode_spec (struct window *, int, int, int,
 +                                   Lisp_Object *);
 +static void display_menu_bar (struct window *);
 +static int display_count_lines (EMACS_INT, EMACS_INT, EMACS_INT, int,
 +                              EMACS_INT *);
 +static int display_string (const char *, Lisp_Object, Lisp_Object,
 +                           EMACS_INT, EMACS_INT, struct it *, int, int, int, int);
 +static void compute_line_metrics (struct it *);
 +static void run_redisplay_end_trigger_hook (struct it *);
 +static int get_overlay_strings (struct it *, EMACS_INT);
 +static int get_overlay_strings_1 (struct it *, EMACS_INT, int);
 +static void next_overlay_string (struct it *);
 +static void reseat (struct it *, struct text_pos, int);
 +static void reseat_1 (struct it *, struct text_pos, int);
 +static void back_to_previous_visible_line_start (struct it *);
 +void reseat_at_previous_visible_line_start (struct it *);
 +static void reseat_at_next_visible_line_start (struct it *, int);
 +static int next_element_from_ellipsis (struct it *);
 +static int next_element_from_display_vector (struct it *);
 +static int next_element_from_string (struct it *);
 +static int next_element_from_c_string (struct it *);
 +static int next_element_from_buffer (struct it *);
 +static int next_element_from_composition (struct it *);
 +static int next_element_from_image (struct it *);
 +static int next_element_from_stretch (struct it *);
 +static void load_overlay_strings (struct it *, EMACS_INT);
 +static int init_from_display_pos (struct it *, struct window *,
 +                                  struct display_pos *);
 +static void reseat_to_string (struct it *, const char *,
 +                              Lisp_Object, EMACS_INT, EMACS_INT, int, int);
  static enum move_it_result
         move_it_in_display_line_to (struct it *, EMACS_INT, int,
                                   enum move_operation_enum);
 -void move_it_vertically_backward P_ ((struct it *, int));
 -static void init_to_row_start P_ ((struct it *, struct window *,
 -                                 struct glyph_row *));
 -static int init_to_row_end P_ ((struct it *, struct window *,
 -                              struct glyph_row *));
 -static void back_to_previous_line_start P_ ((struct it *));
 -static int forward_to_next_line_start P_ ((struct it *, int *));
 -static struct text_pos string_pos_nchars_ahead P_ ((struct text_pos,
 -                                                  Lisp_Object, int));
 -static struct text_pos string_pos P_ ((int, Lisp_Object));
 -static struct text_pos c_string_pos P_ ((int, unsigned char *, int));
 -static int number_of_chars P_ ((unsigned char *, int));
 -static void compute_stop_pos P_ ((struct it *));
 -static void compute_string_pos P_ ((struct text_pos *, struct text_pos,
 -                                  Lisp_Object));
 -static int face_before_or_after_it_pos P_ ((struct it *, int));
 -static EMACS_INT next_overlay_change P_ ((EMACS_INT));
 -static int handle_single_display_spec P_ ((struct it *, Lisp_Object,
 -                                         Lisp_Object, Lisp_Object,
 -                                         struct text_pos *, int));
 -static int underlying_face_id P_ ((struct it *));
 -static int in_ellipses_for_invisible_text_p P_ ((struct display_pos *,
 -                                               struct window *));
 +void move_it_vertically_backward (struct it *, int);
 +static void init_to_row_start (struct it *, struct window *,
 +                               struct glyph_row *);
 +static int init_to_row_end (struct it *, struct window *,
 +                            struct glyph_row *);
 +static void back_to_previous_line_start (struct it *);
 +static int forward_to_next_line_start (struct it *, int *);
 +static struct text_pos string_pos_nchars_ahead (struct text_pos,
 +                                                Lisp_Object, EMACS_INT);
 +static struct text_pos string_pos (EMACS_INT, Lisp_Object);
 +static struct text_pos c_string_pos (EMACS_INT, const char *, int);
 +static EMACS_INT number_of_chars (const char *, int);
 +static void compute_stop_pos (struct it *);
 +static void compute_string_pos (struct text_pos *, struct text_pos,
 +                                Lisp_Object);
 +static int face_before_or_after_it_pos (struct it *, int);
 +static EMACS_INT next_overlay_change (EMACS_INT);
 +static int handle_single_display_spec (struct it *, Lisp_Object,
 +                                       Lisp_Object, Lisp_Object,
 +                                       struct text_pos *, int);
 +static int underlying_face_id (struct it *);
 +static int in_ellipses_for_invisible_text_p (struct display_pos *,
 +                                             struct window *);
  
  #define face_before_it_pos(IT) face_before_or_after_it_pos ((IT), 1)
  #define face_after_it_pos(IT)  face_before_or_after_it_pos ((IT), 0)
  
  #ifdef HAVE_WINDOW_SYSTEM
  
 -static void update_tool_bar P_ ((struct frame *, int));
 -static void build_desired_tool_bar_string P_ ((struct frame *f));
 -static int redisplay_tool_bar P_ ((struct frame *));
 -static void display_tool_bar_line P_ ((struct it *, int));
 -static void notice_overwritten_cursor P_ ((struct window *,
 -                                         enum glyph_row_area,
 -                                         int, int, int, int));
 -
 +static void x_consider_frame_title (Lisp_Object);
 +static int tool_bar_lines_needed (struct frame *, int *);
 +static void update_tool_bar (struct frame *, int);
 +static void build_desired_tool_bar_string (struct frame *f);
 +static int redisplay_tool_bar (struct frame *);
 +static void display_tool_bar_line (struct it *, int);
 +static void notice_overwritten_cursor (struct window *,
 +                                       enum glyph_row_area,
 +                                       int, int, int, int);
 +static void append_stretch_glyph (struct it *, Lisp_Object,
 +                                  int, int, int);
  
  
  #endif /* HAVE_WINDOW_SYSTEM */
  
 +static int coords_in_mouse_face_p (struct window *, int, int);
 +
 +
  \f
  /***********************************************************************
                      Window display dimensions
     This is the height of W minus the height of a mode line, if any.  */
  
  INLINE int
 -window_text_bottom_y (w)
 -     struct window *w;
 +window_text_bottom_y (struct window *w)
  {
    int height = WINDOW_TOTAL_HEIGHT (w);
  
     the left and right of the window.  */
  
  INLINE int
 -window_box_width (w, area)
 -     struct window *w;
 -     int area;
 +window_box_width (struct window *w, int area)
  {
    int cols = XFASTINT (w->total_cols);
    int pixels = 0;
     including mode lines of W, if any.  */
  
  INLINE int
 -window_box_height (w)
 -     struct window *w;
 +window_box_height (struct window *w)
  {
    struct frame *f = XFRAME (w->frame);
    int height = WINDOW_TOTAL_HEIGHT (w);
     whole window, to the right of the left fringe of W.  */
  
  INLINE int
 -window_box_left_offset (w, area)
 -     struct window *w;
 -     int area;
 +window_box_left_offset (struct window *w, int area)
  {
    int x;
  
  
  
  /* Return the window-relative coordinate of the right edge of display
 -   area AREA of window W.  AREA < 0 means return the left edge of the
 +   area AREA of window W.  AREA < 0 means return the right edge of the
     whole window, to the left of the right fringe of W.  */
  
  INLINE int
 -window_box_right_offset (w, area)
 -     struct window *w;
 -     int area;
 +window_box_right_offset (struct window *w, int area)
  {
    return window_box_left_offset (w, area) + window_box_width (w, area);
  }
     whole window, to the right of the left fringe of W.  */
  
  INLINE int
 -window_box_left (w, area)
 -     struct window *w;
 -     int area;
 +window_box_left (struct window *w, int area)
  {
    struct frame *f = XFRAME (w->frame);
    int x;
  
  
  /* Return the frame-relative coordinate of the right edge of display
 -   area AREA of window W.  AREA < 0 means return the left edge of the
 +   area AREA of window W.  AREA < 0 means return the right edge of the
     whole window, to the left of the right fringe of W.  */
  
  INLINE int
 -window_box_right (w, area)
 -     struct window *w;
 -     int area;
 +window_box_right (struct window *w, int area)
  {
    return window_box_left (w, area) + window_box_width (w, area);
  }
     *BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box.  */
  
  INLINE void
 -window_box (w, area, box_x, box_y, box_width, box_height)
 -     struct window *w;
 -     int area;
 -     int *box_x, *box_y, *box_width, *box_height;
 +window_box (struct window *w, int area, int *box_x, int *box_y,
 +          int *box_width, int *box_height)
  {
    if (box_width)
      *box_width = window_box_width (w, area);
     box.  */
  
  INLINE void
 -window_box_edges (w, area, top_left_x, top_left_y,
 -                bottom_right_x, bottom_right_y)
 -     struct window *w;
 -     int area;
 -     int *top_left_x, *top_left_y, *bottom_right_x, *bottom_right_y;
 +window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y,
 +                 int *bottom_right_x, int *bottom_right_y)
  {
    window_box (w, area, top_left_x, top_left_y, bottom_right_x,
              bottom_right_y);
     This can modify IT's settings.  */
  
  int
 -line_bottom_y (it)
 -     struct it *it;
 +line_bottom_y (struct it *it)
  {
    int line_height = it->max_ascent + it->max_descent;
    int line_top_y = it->current_y;
     Set *ROWH and *VPOS to row's visible height and VPOS (row number).  */
  
  int
 -pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos)
 -     struct window *w;
 -     int charpos, *x, *y, *rtop, *rbot, *rowh, *vpos;
 +pos_visible_p (struct window *w, EMACS_INT charpos, int *x, int *y,
 +             int *rtop, int *rbot, int *rowh, int *vpos)
  {
    struct it it;
    struct text_pos top;
    if (WINDOW_WANTS_MODELINE_P (w))
      current_mode_line_height
        = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w),
 -                         current_buffer->mode_line_format);
 +                         B_ (current_buffer, mode_line_format));
  
    if (WINDOW_WANTS_HEADER_LINE_P (w))
      current_header_line_height
        = display_mode_line (w, HEADER_LINE_FACE_ID,
 -                             current_buffer->header_line_format);
 +                             B_ (current_buffer, header_line_format));
  
    start_display (&it, w, top);
    move_it_to (&it, charpos, -1, it.last_visible_y-1, -1,
     with the length of the invalid character.  */
  
  static INLINE int
 -string_char_and_length (str, len)
 -     const unsigned char *str;
 -     int *len;
 +string_char_and_length (const unsigned char *str, int *len)
  {
    int c;
  
     in STRING, return the position NCHARS ahead (NCHARS >= 0).  */
  
  static struct text_pos
 -string_pos_nchars_ahead (pos, string, nchars)
 -     struct text_pos pos;
 -     Lisp_Object string;
 -     int nchars;
 +string_pos_nchars_ahead (struct text_pos pos, Lisp_Object string, EMACS_INT nchars)
  {
    xassert (STRINGP (string) && nchars >= 0);
  
     for character position CHARPOS in STRING.  */
  
  static INLINE struct text_pos
 -string_pos (charpos, string)
 -     int charpos;
 -     Lisp_Object string;
 +string_pos (EMACS_INT charpos, Lisp_Object string)
  {
    struct text_pos pos;
    xassert (STRINGP (string));
     means recognize multibyte characters.  */
  
  static struct text_pos
 -c_string_pos (charpos, s, multibyte_p)
 -     int charpos;
 -     unsigned char *s;
 -     int multibyte_p;
 +c_string_pos (EMACS_INT charpos, const char *s, int multibyte_p)
  {
    struct text_pos pos;
  
        SET_TEXT_POS (pos, 0, 0);
        while (charpos--)
        {
 -        string_char_and_length (s, &len);
 +        string_char_and_length ((const unsigned char *) s, &len);
          s += len;
          CHARPOS (pos) += 1;
          BYTEPOS (pos) += len;
  /* Value is the number of characters in C string S.  MULTIBYTE_P
     non-zero means recognize multibyte characters.  */
  
 -static int
 -number_of_chars (s, multibyte_p)
 -     unsigned char *s;
 -     int multibyte_p;
 +static EMACS_INT
 +number_of_chars (const char *s, int multibyte_p)
  {
 -  int nchars;
 +  EMACS_INT nchars;
  
    if (multibyte_p)
      {
 -      int rest = strlen (s), len;
 -      unsigned char *p = (unsigned char *) s;
 +      EMACS_INT rest = strlen (s);
 +      int len;
 +      const unsigned char *p = (const unsigned char *) s;
  
        for (nchars = 0; rest > 0; ++nchars)
        {
     NEWPOS->charpos must be >= POS.charpos.  */
  
  static void
 -compute_string_pos (newpos, pos, string)
 -     struct text_pos *newpos, pos;
 -     Lisp_Object string;
 +compute_string_pos (struct text_pos *newpos, struct text_pos pos, Lisp_Object string)
  {
    xassert (STRINGP (string));
    xassert (CHARPOS (*newpos) >= CHARPOS (pos));
     frame F.  FACE_ID specifies what line's height to estimate.  */
  
  int
 -estimate_mode_line_height (f, face_id)
 -     struct frame *f;
 -     enum face_id face_id;
 +estimate_mode_line_height (struct frame *f, enum face_id face_id)
  {
  #ifdef HAVE_WINDOW_SYSTEM
    if (FRAME_WINDOW_P (f))
     not force the value into range.  */
  
  void
 -pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip)
 -     FRAME_PTR f;
 -     register int pix_x, pix_y;
 -     int *x, *y;
 -     NativeRectangle *bounds;
 -     int noclip;
 +pixel_to_glyph_coords (FRAME_PTR f, register int pix_x, register int pix_y,
 +                     int *x, int *y, NativeRectangle *bounds, int noclip)
  {
  
  #ifdef HAVE_WINDOW_SYSTEM
     return 0.  */
  
  int
 -glyph_to_pixel_coords (w, hpos, vpos, frame_x, frame_y)
 -     struct window *w;
 -     int hpos, vpos;
 -     int *frame_x, *frame_y;
 +glyph_to_pixel_coords (struct window *w, int hpos, int vpos,
 +                     int *frame_x, int *frame_y)
  {
  #ifdef HAVE_WINDOW_SYSTEM
    if (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w))))
  }
  
  
 -#ifdef HAVE_WINDOW_SYSTEM
 -
  /* Find the glyph under window-relative coordinates X/Y in window W.
     Consider only glyphs from buffer text, i.e. no glyphs from overlay
     strings.  Return in *HPOS and *VPOS the row and column number of
  
  static
  struct glyph *
 -x_y_to_hpos_vpos (w, x, y, hpos, vpos, dx, dy, area)
 -     struct window *w;
 -     int x, y;
 -     int *hpos, *vpos, *dx, *dy, *area;
 +x_y_to_hpos_vpos (struct window *w, int x, int y, int *hpos, int *vpos,
 +                int *dx, int *dy, int *area)
  {
    struct glyph *glyph, *end;
    struct glyph_row *row = NULL;
    return glyph;
  }
  
 -
  /* EXPORT:
     Convert frame-relative x/y to coordinates relative to window W.
     Takes pseudo-windows into account.  */
  
  void
 -frame_to_window_pixel_xy (w, x, y)
 -     struct window *w;
 -     int *x, *y;
 +frame_to_window_pixel_xy (struct window *w, int *x, int *y)
  {
    if (w->pseudo_window_p)
      {
      }
  }
  
 +#ifdef HAVE_WINDOW_SYSTEM
 +
  /* EXPORT:
     Return in RECTS[] at most N clipping rectangles for glyph string S.
     Return the number of stored rectangles.  */
  
  int
 -get_glyph_string_clip_rects (s, rects, n)
 -     struct glyph_string *s;
 -     NativeRectangle *rects;
 -     int n;
 +get_glyph_string_clip_rects (struct glyph_string *s, NativeRectangle *rects, int n)
  {
    XRectangle r;
  
     Return in *NR the clipping rectangle for glyph string S.  */
  
  void
 -get_glyph_string_clip_rect (s, nr)
 -     struct glyph_string *s;
 -     NativeRectangle *nr;
 +get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr)
  {
    get_glyph_string_clip_rects (s, nr, 1);
  }
  */
  
  void
 -get_phys_cursor_geometry (w, row, glyph, xp, yp, heightp)
 -     struct window *w;
 -     struct glyph_row *row;
 -     struct glyph *glyph;
 -     int *xp, *yp, *heightp;
 +get_phys_cursor_geometry (struct window *w, struct glyph_row *row,
 +                        struct glyph *glyph, int *xp, int *yp, int *heightp)
  {
    struct frame *f = XFRAME (WINDOW_FRAME (w));
    int x, y, wd, h, h0, y0;
   */
  
  void
 -remember_mouse_glyph (f, gx, gy, rect)
 -     struct frame *f;
 -     int gx, gy;
 -     NativeRectangle *rect;
 +remember_mouse_glyph (struct frame *f, int gx, int gy, NativeRectangle *rect)
  {
    Lisp_Object window;
    struct window *w;
       frame pixel coordinates X/Y on frame F.  */
  
    if (!f->glyphs_initialized_p
 -      || (window = window_from_coordinates (f, gx, gy, &part, &x, &y, 0),
 +      || (window = window_from_coordinates (f, gx, gy, &part, 0),
          NILP (window)))
      {
        width = FRAME_SMALLEST_CHAR_WIDTH (f);
    width = WINDOW_FRAME_COLUMN_WIDTH (w);
    height = WINDOW_FRAME_LINE_HEIGHT (w);
  
 +  x = window_relative_x_coord (w, part, gx);
 +  y = gy - WINDOW_TOP_EDGE_Y (w);
 +
    r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
    end_row = MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w);
  
  /* Error handler for safe_eval and safe_call.  */
  
  static Lisp_Object
 -safe_eval_handler (arg)
 -     Lisp_Object arg;
 +safe_eval_handler (Lisp_Object arg)
  {
 -  add_to_log ("Error during redisplay: %s", arg, Qnil);
 +  add_to_log ("Error during redisplay: %S", arg, Qnil);
    return Qnil;
  }
  
     redisplay during the evaluation.  */
  
  Lisp_Object
 -safe_call (nargs, args)
 -     int nargs;
 -     Lisp_Object *args;
 +safe_call (int nargs, Lisp_Object *args)
  {
    Lisp_Object val;
  
        specbind (Qinhibit_redisplay, Qt);
        /* Use Qt to ensure debugger does not run,
         so there is no possibility of wanting to redisplay.  */
 -      val = internal_condition_case_2 (Ffuncall, nargs, args, Qt,
 +      val = internal_condition_case_n (Ffuncall, nargs, args, Qt,
                                       safe_eval_handler);
        UNGCPRO;
        val = unbind_to (count, val);
     Return the result, or nil if something went wrong.  */
  
  Lisp_Object
 -safe_call1 (fn, arg)
 -     Lisp_Object fn, arg;
 +safe_call1 (Lisp_Object fn, Lisp_Object arg)
  {
    Lisp_Object args[2];
    args[0] = fn;
@@@ -2349,9 -2521,12 +2349,9 @@@ check_window_end (w
     the desired matrix of W.  */
  
  void
 -init_iterator (it, w, charpos, bytepos, row, base_face_id)
 -     struct it *it;
 -     struct window *w;
 -     int charpos, bytepos;
 -     struct glyph_row *row;
 -     enum face_id base_face_id;
 +init_iterator (struct it *it, struct window *w,
 +             EMACS_INT charpos, EMACS_INT bytepos,
 +             struct glyph_row *row, enum face_id base_face_id)
  {
    int highlight_region_p;
    enum face_id remapped_base_face_id = base_face_id;
      }
  
    /* Clear IT.  */
 -  bzero (it, sizeof *it);
 +  memset (it, 0, sizeof *it);
    it->current.overlay_string_index = -1;
    it->current.dpvec_index = -1;
    it->base_face_id = remapped_base_face_id;
    if (base_face_id == DEFAULT_FACE_ID
        && FRAME_WINDOW_P (it->f))
      {
 -      if (NATNUMP (current_buffer->extra_line_spacing))
 -      it->extra_line_spacing = XFASTINT (current_buffer->extra_line_spacing);
 -      else if (FLOATP (current_buffer->extra_line_spacing))
 -      it->extra_line_spacing = (XFLOAT_DATA (current_buffer->extra_line_spacing)
 +      if (NATNUMP (B_ (current_buffer, extra_line_spacing)))
 +      it->extra_line_spacing = XFASTINT (B_ (current_buffer, extra_line_spacing));
 +      else if (FLOATP (B_ (current_buffer, extra_line_spacing)))
 +      it->extra_line_spacing = (XFLOAT_DATA (B_ (current_buffer, extra_line_spacing))
                                  * FRAME_LINE_HEIGHT (it->f));
        else if (it->f->extra_line_spacing > 0)
        it->extra_line_spacing = it->f->extra_line_spacing;
    it->override_ascent = -1;
  
    /* Are control characters displayed as `^C'?  */
 -  it->ctl_arrow_p = !NILP (current_buffer->ctl_arrow);
 +  it->ctl_arrow_p = !NILP (B_ (current_buffer, ctl_arrow));
  
    /* -1 means everything between a CR and the following line end
       is invisible.  >0 means lines indented more than this value are
       invisible.  */
 -  it->selective = (INTEGERP (current_buffer->selective_display)
 -                 ? XFASTINT (current_buffer->selective_display)
 -                 : (!NILP (current_buffer->selective_display)
 +  it->selective = (INTEGERP (B_ (current_buffer, selective_display))
 +                 ? XFASTINT (B_ (current_buffer, selective_display))
 +                 : (!NILP (B_ (current_buffer, selective_display))
                      ? -1 : 0));
    it->selective_display_ellipsis_p
 -    = !NILP (current_buffer->selective_display_ellipses);
 +    = !NILP (B_ (current_buffer, selective_display_ellipses));
  
    /* Display table to use.  */
    it->dp = window_display_table (w);
  
    /* Are multibyte characters enabled in current_buffer?  */
 -  it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
 +  it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters));
 +
 +  /* Do we need to reorder bidirectional text?  Not if this is a
 +     unibyte buffer: by definition, none of the single-byte characters
 +     are strong R2L, so no reordering is needed.  And bidi.c doesn't
 +     support unibyte buffers anyway.  */
 +  it->bidi_p
 +    = !NILP (B_ (current_buffer, bidi_display_reordering)) && it->multibyte_p;
  
    /* Non-zero if we should highlight the region.  */
    highlight_region_p
      = (!NILP (Vtransient_mark_mode)
 -       && !NILP (current_buffer->mark_active)
 -       && XMARKER (current_buffer->mark)->buffer != 0);
 +       && !NILP (B_ (current_buffer, mark_active))
 +       && XMARKER (B_ (current_buffer, mark))->buffer != 0);
  
    /* Set IT->region_beg_charpos and IT->region_end_charpos to the
       start and end of a visible region in window IT->w.  Set both to
              && WINDOWP (minibuf_selected_window)
              && w == XWINDOW (minibuf_selected_window))))
      {
 -      int charpos = marker_position (current_buffer->mark);
 +      EMACS_INT charpos = marker_position (B_ (current_buffer, mark));
        it->region_beg_charpos = min (PT, charpos);
        it->region_end_charpos = max (PT, charpos);
      }
      it->redisplay_end_trigger_charpos = XINT (w->redisplay_end_trigger);
  
    /* Correct bogus values of tab_width.  */
 -  it->tab_width = XINT (current_buffer->tab_width);
 +  it->tab_width = XINT (B_ (current_buffer, tab_width));
    if (it->tab_width <= 0 || it->tab_width > 1000)
      it->tab_width = 8;
  
                  && (WINDOW_TOTAL_COLS (it->w)
                      < XINT (Vtruncate_partial_width_windows))))))
      it->line_wrap = TRUNCATE;
 -  else if (NILP (current_buffer->truncate_lines))
 -    it->line_wrap = NILP (current_buffer->word_wrap)
 +  else if (NILP (B_ (current_buffer, truncate_lines)))
 +    it->line_wrap = NILP (B_ (current_buffer, word_wrap))
        ? WINDOW_WRAP : WORD_WRAP;
    else
      it->line_wrap = TRUNCATE;
    it->glyph_row = row;
    it->area = TEXT_AREA;
  
 +  /* Forget any previous info about this row being reversed.  */
 +  if (it->glyph_row)
 +    it->glyph_row->reversed_p = 0;
 +
    /* Get the dimensions of the display area.  The display area
       consists of the visible window area plus a horizontally scrolled
       part to the left of the window.  All x-values are relative to the
        it->start_of_box_run_p = 1;
      }
  
 +  /* If we are to reorder bidirectional text, init the bidi
 +     iterator.  */
 +  if (it->bidi_p)
 +    {
 +      /* Note the paragraph direction that this buffer wants to
 +       use.  */
 +      if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qleft_to_right))
 +      it->paragraph_embedding = L2R;
 +      else if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qright_to_left))
 +      it->paragraph_embedding = R2L;
 +      else
 +      it->paragraph_embedding = NEUTRAL_DIR;
 +      bidi_init_it (charpos, bytepos, &it->bidi_it);
 +    }
 +
    /* If a buffer position was specified, set the iterator there,
       getting overlays and face properties from that position.  */
    if (charpos >= BUF_BEG (current_buffer))
  /* Initialize IT for the display of window W with window start POS.  */
  
  void
 -start_display (it, w, pos)
 -     struct it *it;
 -     struct window *w;
 -     struct text_pos pos;
 +start_display (struct it *it, struct window *w, struct text_pos pos)
  {
    struct glyph_row *row;
    int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
     text.  W is the window we display, for text property lookup.  */
  
  static int
 -in_ellipses_for_invisible_text_p (pos, w)
 -     struct display_pos *pos;
 -     struct window *w;
 +in_ellipses_for_invisible_text_p (struct display_pos *pos, struct window *w)
  {
    Lisp_Object prop, window;
    int ellipses_p = 0;
 -  int charpos = CHARPOS (pos->pos);
 +  EMACS_INT charpos = CHARPOS (pos->pos);
  
    /* If POS specifies a position in a display vector, this might
       be for an ellipsis displayed for invisible text.  We won't
     is zero if there are overlay strings with newlines at POS.  */
  
  static int
 -init_from_display_pos (it, w, pos)
 -     struct it *it;
 -     struct window *w;
 -     struct display_pos *pos;
 +init_from_display_pos (struct it *it, struct window *w, struct display_pos *pos)
  {
 -  int charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos);
 +  EMACS_INT charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos);
    int i, overlay_strings_with_newlines = 0;
  
    /* If POS specifies a position in a display vector, this might
       to 16 in 22.1 to make this a lesser problem.  */
    for (i = 0; i < it->n_overlay_strings && i < OVERLAY_STRING_CHUNK_SIZE; ++i)
      {
 -      const char *s = SDATA (it->overlay_strings[i]);
 +      const char *s = SSDATA (it->overlay_strings[i]);
        const char *e = s + SBYTES (it->overlay_strings[i]);
  
        while (s < e && *s != '\n')
     starting at ROW->start.  */
  
  static void
 -init_to_row_start (it, w, row)
 -     struct it *it;
 -     struct window *w;
 -     struct glyph_row *row;
 +init_to_row_start (struct it *it, struct window *w, struct glyph_row *row)
  {
    init_from_display_pos (it, w, &row->start);
    it->start = row->start;
     end position.  */
  
  static int
 -init_to_row_end (it, w, row)
 -     struct it *it;
 -     struct window *w;
 -     struct glyph_row *row;
 +init_to_row_end (struct it *it, struct window *w, struct glyph_row *row)
  {
    int success = 0;
  
     to stop.  */
  
  static void
 -handle_stop (it)
 -     struct it *it;
 +handle_stop (struct it *it)
  {
    enum prop_handled handled;
    int handle_overlay_change_p;
     information for IT's current position.  */
  
  static void
 -compute_stop_pos (it)
 -     struct it *it;
 +compute_stop_pos (struct it *it)
  {
    register INTERVAL iv, next_iv;
    Lisp_Object object, limit, position;
        }
      }
  
 -  composition_compute_stop_pos (&it->cmp_it, charpos, bytepos,
 -                              it->stop_charpos, it->string);
 +  if (it->cmp_it.id < 0)
 +    {
 +      EMACS_INT stoppos = it->end_charpos;
 +
 +      if (it->bidi_p && it->bidi_it.scan_dir < 0)
 +      stoppos = -1;
 +      composition_compute_stop_pos (&it->cmp_it, charpos, bytepos,
 +                                  stoppos, it->string);
 +    }
  
    xassert (STRINGP (it->string)
           || (it->stop_charpos >= BEGV
     xmalloc.  */
  
  static EMACS_INT
 -next_overlay_change (pos)
 -     EMACS_INT pos;
 +next_overlay_change (EMACS_INT pos)
  {
    int noverlays;
    EMACS_INT endpos;
     regions of text.  */
  
  static enum prop_handled
 -handle_fontified_prop (it)
 -     struct it *it;
 +handle_fontified_prop (struct it *it)
  {
    Lisp_Object prop, pos;
    enum prop_handled handled = HANDLED_NORMALLY;
        specbind (Qfontification_functions, Qnil);
  
        xassert (it->end_charpos == ZV);
 -      
 +
        if (!CONSP (val) || EQ (XCAR (val), Qlambda))
        safe_call1 (val, pos);
        else
         as is/was done in grep.el where some escapes sequences are turned
         into face properties (bug#7876).  */
        it->end_charpos = ZV;
 -      
 +
        /* Return HANDLED_RECOMPUTE_PROPS only if function fontified
         something.  This avoids an endless loop if they failed to
         fontify the text for which reason ever.  */
     Called from handle_stop.  */
  
  static enum prop_handled
 -handle_face_prop (it)
 -     struct it *it;
 +handle_face_prop (struct it *it)
  {
    int new_face_id;
    EMACS_INT next_stop;
      }
    else
      {
 -      int base_face_id, bufpos;
 +      int base_face_id;
 +      EMACS_INT bufpos;
        int i;
        Lisp_Object from_overlay
        = (it->current.overlay_string_index >= 0
     Otherwise, use the iterator's base_face_id.  */
  
  static int
 -underlying_face_id (it)
 -     struct it *it;
 +underlying_face_id (struct it *it)
  {
    int face_id = it->base_face_id, i;
  
     position.  Value is the id of the face.  */
  
  static int
 -face_before_or_after_it_pos (it, before_p)
 -     struct it *it;
 -     int before_p;
 +face_before_or_after_it_pos (struct it *it, int before_p)
  {
    int face_id, limit;
    EMACS_INT next_check_charpos;
  
    if (STRINGP (it->string))
      {
 -      int bufpos, base_face_id;
 +      EMACS_INT bufpos;
 +      int base_face_id;
  
        /* No face change past the end of the string (for the case
         we are padding with spaces).  No face change before the
     position.  Called from handle_stop.  */
  
  static enum prop_handled
 -handle_invisible_prop (it)
 -     struct it *it;
 +handle_invisible_prop (struct it *it)
  {
    enum prop_handled handled = HANDLED_NORMALLY;
  
    if (STRINGP (it->string))
      {
 -      extern Lisp_Object Qinvisible;
        Lisp_Object prop, end_charpos, limit, charpos;
  
        /* Get the value of the invisible text property at the
    else
      {
        int invis_p;
 -      EMACS_INT newpos, next_stop, start_charpos;
 +      EMACS_INT newpos, next_stop, start_charpos, tem;
        Lisp_Object pos, prop, overlay;
  
        /* First of all, is there invisible text at this position?  */
 -      start_charpos = IT_CHARPOS (*it);
 -      pos = make_number (IT_CHARPOS (*it));
 +      tem = start_charpos = IT_CHARPOS (*it);
 +      pos = make_number (tem);
        prop = get_char_property_and_overlay (pos, Qinvisible, it->window,
                                            &overlay);
        invis_p = TEXT_PROP_MEANS_INVISIBLE (prop);
  
        /* If we are on invisible text, skip over it.  */
 -      if (invis_p && IT_CHARPOS (*it) < it->end_charpos)
 +      if (invis_p && start_charpos < it->end_charpos)
        {
          /* Record whether we have to display an ellipsis for the
             invisible text.  */
          do
            {
              /* Try to skip some invisible text.  Return value is the
 -               position reached which can be equal to IT's position
 -               if there is nothing invisible here.  This skips both
 +               position reached which can be equal to where we start
 +               if there is nothing invisible there.  This skips both
                 over invisible text properties and overlays with
                 invisible property.  */
 -            newpos = skip_invisible (IT_CHARPOS (*it),
 -                                     &next_stop, ZV, it->window);
 +            newpos = skip_invisible (tem, &next_stop, ZV, it->window);
  
              /* If we skipped nothing at all we weren't at invisible
                 text in the first place.  If everything to the end of
                 the buffer was skipped, end the loop.  */
 -            if (newpos == IT_CHARPOS (*it) || newpos >= ZV)
 +            if (newpos == tem || newpos >= ZV)
                invis_p = 0;
              else
                {
              /* If we ended up on invisible text, proceed to
                 skip starting with next_stop.  */
              if (invis_p)
 -              IT_CHARPOS (*it) = next_stop;
 +              tem = next_stop;
  
                /* If there are adjacent invisible texts, don't lose the
                   second one's ellipsis. */
          while (invis_p);
  
          /* The position newpos is now either ZV or on visible text.  */
 -        IT_CHARPOS (*it) = newpos;
 -        IT_BYTEPOS (*it) = CHAR_TO_BYTE (newpos);
 +        if (it->bidi_p && newpos < ZV)
 +          {
 +            /* With bidi iteration, the region of invisible text
 +               could start and/or end in the middle of a non-base
 +               embedding level.  Therefore, we need to skip
 +               invisible text using the bidi iterator, starting at
 +               IT's current position, until we find ourselves
 +               outside the invisible text.  Skipping invisible text
 +               _after_ bidi iteration avoids affecting the visual
 +               order of the displayed text when invisible properties
 +               are added or removed.  */
 +            if (it->bidi_it.first_elt)
 +              {
 +                /* If we were `reseat'ed to a new paragraph,
 +                   determine the paragraph base direction.  We need
 +                   to do it now because next_element_from_buffer may
 +                   not have a chance to do it, if we are going to
 +                   skip any text at the beginning, which resets the
 +                   FIRST_ELT flag.  */
 +                bidi_paragraph_init (it->paragraph_embedding,
 +                                     &it->bidi_it, 1);
 +              }
 +            do
 +              {
 +                bidi_move_to_visually_next (&it->bidi_it);
 +              }
 +            while (it->stop_charpos <= it->bidi_it.charpos
 +                   && it->bidi_it.charpos < newpos);
 +            IT_CHARPOS (*it) = it->bidi_it.charpos;
 +            IT_BYTEPOS (*it) = it->bidi_it.bytepos;
 +            /* If we overstepped NEWPOS, record its position in the
 +               iterator, so that we skip invisible text if later the
 +               bidi iteration lands us in the invisible region
 +               again. */
 +            if (IT_CHARPOS (*it) >= newpos)
 +              it->prev_stop = newpos;
 +          }
 +        else
 +          {
 +            IT_CHARPOS (*it) = newpos;
 +            IT_BYTEPOS (*it) = CHAR_TO_BYTE (newpos);
 +          }
  
          /* If there are before-strings at the start of invisible
             text, and the text is invisible because of a text
             overlay property instead of a text property, this is
             already handled in the overlay code.)  */
          if (NILP (overlay)
 -            && get_overlay_strings (it, start_charpos))
 +            && get_overlay_strings (it, it->stop_charpos))
            {
              handled = HANDLED_RECOMPUTE_PROPS;
              it->stack[it->sp - 1].display_ellipsis_p = display_ellipsis_p;
                   first invisible character.  */
              if (!STRINGP (it->object))
                {
 -                it->position.charpos = IT_CHARPOS (*it) - 1;
 +                it->position.charpos = newpos - 1;
                  it->position.bytepos = CHAR_TO_BYTE (it->position.charpos);
                }
              it->ellipsis_p = 1;
     Replaces LEN characters from buffer.  */
  
  static void
 -setup_for_ellipsis (it, len)
 -     struct it *it;
 -     int len;
 +setup_for_ellipsis (struct it *it, int len)
  {
    /* Use the display table definition for `...'.  Invalid glyphs
       will be handled by the method returning elements from dpvec.  */
     Otherwise we return HANDLED_NORMALLY.  */
  
  static enum prop_handled
 -handle_display_prop (it)
 -     struct it *it;
 +handle_display_prop (struct it *it)
  {
    Lisp_Object prop, object, overlay;
    struct text_pos *position;
     at START_POS in OBJECT.  */
  
  static struct text_pos
 -display_prop_end (it, object, start_pos)
 -     struct it *it;
 -     Lisp_Object object;
 -     struct text_pos start_pos;
 +display_prop_end (struct it *it, Lisp_Object object, struct text_pos start_pos)
  {
    Lisp_Object end;
    struct text_pos end_pos;
     of buffer or string text.  */
  
  static int
 -handle_single_display_spec (it, spec, object, overlay, position,
 -                          display_replaced_before_p)
 -     struct it *it;
 -     Lisp_Object spec;
 -     Lisp_Object object;
 -     Lisp_Object overlay;
 -     struct text_pos *position;
 -     int display_replaced_before_p;
 +handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
 +                          Lisp_Object overlay, struct text_pos *position,
 +                          int display_replaced_before_p)
  {
    Lisp_Object form;
    Lisp_Object location, value;
     treated as intangible.  */
  
  static int
 -single_display_spec_intangible_p (prop)
 -     Lisp_Object prop;
 +single_display_spec_intangible_p (Lisp_Object prop)
  {
    /* Skip over `when FORM'.  */
    if (CONSP (prop) && EQ (XCAR (prop), Qwhen))
     treated as intangible.  */
  
  int
 -display_prop_intangible_p (prop)
 -     Lisp_Object prop;
 +display_prop_intangible_p (Lisp_Object prop)
  {
    if (CONSP (prop)
        && CONSP (XCAR (prop))
  /* Return 1 if PROP is a display sub-property value containing STRING.  */
  
  static int
 -single_display_spec_string_p (prop, string)
 -     Lisp_Object prop, string;
 +single_display_spec_string_p (Lisp_Object prop, Lisp_Object string)
  {
    if (EQ (string, prop))
      return 1;
  /* Return 1 if STRING appears in the `display' property PROP.  */
  
  static int
 -display_prop_string_p (prop, string)
 -     Lisp_Object prop, string;
 +display_prop_string_p (Lisp_Object prop, Lisp_Object string)
  {
    if (CONSP (prop)
        && CONSP (XCAR (prop))
    return 0;
  }
  
 -
 -/* Determine which buffer position in W's buffer STRING comes from.
 -   AROUND_CHARPOS is an approximate position where it could come from.
 -   Value is the buffer position or 0 if it couldn't be determined.
 +/* Look for STRING in overlays and text properties in W's buffer,
 +   between character positions FROM and TO (excluding TO).
 +   BACK_P non-zero means look back (in this case, TO is supposed to be
 +   less than FROM).
 +   Value is the first character position where STRING was found, or
 +   zero if it wasn't found before hitting TO.
  
     W's buffer must be current.
  
 -   This function is necessary because we don't record buffer positions
 -   in glyphs generated from strings (to keep struct glyph small).
     This function may only use code that doesn't eval because it is
     called asynchronously from note_mouse_highlight.  */
  
 -int
 -string_buffer_position (w, string, around_charpos)
 -     struct window *w;
 -     Lisp_Object string;
 -     int around_charpos;
 +static EMACS_INT
 +string_buffer_position_lim (struct window *w, Lisp_Object string,
 +                          EMACS_INT from, EMACS_INT to, int back_p)
  {
    Lisp_Object limit, prop, pos;
 -  const int MAX_DISTANCE = 1000;
    int found = 0;
  
 -  pos = make_number (around_charpos);
 -  limit = make_number (min (XINT (pos) + MAX_DISTANCE, ZV));
 -  while (!found && !EQ (pos, limit))
 +  pos = make_number (from);
 +
 +  if (!back_p)        /* looking forward */
      {
 -      prop = Fget_char_property (pos, Qdisplay, Qnil);
 -      if (!NILP (prop) && display_prop_string_p (prop, string))
 -      found = 1;
 -      else
 -      pos = Fnext_single_char_property_change (pos, Qdisplay, Qnil, limit);
 +      limit = make_number (min (to, ZV));
 +      while (!found && !EQ (pos, limit))
 +      {
 +        prop = Fget_char_property (pos, Qdisplay, Qnil);
 +        if (!NILP (prop) && display_prop_string_p (prop, string))
 +          found = 1;
 +        else
 +          pos = Fnext_single_char_property_change (pos, Qdisplay, Qnil,
 +                                                   limit);
 +      }
      }
 -
 -  if (!found)
 +  else                /* looking back */
      {
 -      pos = make_number (around_charpos);
 -      limit = make_number (max (XINT (pos) - MAX_DISTANCE, BEGV));
 +      limit = make_number (max (to, BEGV));
        while (!found && !EQ (pos, limit))
        {
          prop = Fget_char_property (pos, Qdisplay, Qnil);
    return found ? XINT (pos) : 0;
  }
  
 +/* Determine which buffer position in W's buffer STRING comes from.
 +   AROUND_CHARPOS is an approximate position where it could come from.
 +   Value is the buffer position or 0 if it couldn't be determined.
 +
 +   W's buffer must be current.
 +
 +   This function is necessary because we don't record buffer positions
 +   in glyphs generated from strings (to keep struct glyph small).
 +   This function may only use code that doesn't eval because it is
 +   called asynchronously from note_mouse_highlight.  */
 +
 +EMACS_INT
 +string_buffer_position (struct window *w, Lisp_Object string, EMACS_INT around_charpos)
 +{
 +  const int MAX_DISTANCE = 1000;
 +  EMACS_INT found = string_buffer_position_lim (w, string, around_charpos,
 +                                              around_charpos + MAX_DISTANCE,
 +                                              0);
 +
 +  if (!found)
 +    found = string_buffer_position_lim (w, string, around_charpos,
 +                                      around_charpos - MAX_DISTANCE, 1);
 +  return found;
 +}
 +
  
  \f
  /***********************************************************************
     position.  Called from handle_stop.  */
  
  static enum prop_handled
 -handle_composition_prop (it)
 -     struct it *it;
 +handle_composition_prop (struct it *it)
  {
    Lisp_Object prop, string;
    EMACS_INT pos, pos_byte, start, end;
@@@ -4568,7 -4684,8 +4568,7 @@@ struct overlay_entr
     Called from handle_stop.  */
  
  static enum prop_handled
 -handle_overlay_change (it)
 -     struct it *it;
 +handle_overlay_change (struct it *it)
  {
    if (!STRINGP (it->string) && get_overlay_strings (it, 0))
      return HANDLED_RECOMPUTE_PROPS;
     Otherwise IT->string is set to nil.  */
  
  static void
 -next_overlay_string (it)
 -     struct it *it;
 +next_overlay_string (struct it *it)
  {
    ++it->current.overlay_string_index;
    if (it->current.overlay_string_index == it->n_overlay_strings)
  
  
  static int
 -compare_overlay_entries (e1, e2)
 -     void *e1, *e2;
 +compare_overlay_entries (const void *e1, const void *e2)
  {
    struct overlay_entry *entry1 = (struct overlay_entry *) e1;
    struct overlay_entry *entry2 = (struct overlay_entry *) e2;
     compare_overlay_entries.  */
  
  static void
 -load_overlay_strings (it, charpos)
 -     struct it *it;
 -     int charpos;
 +load_overlay_strings (struct it *it, EMACS_INT charpos)
  {
 -  extern Lisp_Object Qwindow, Qpriority;
    Lisp_Object overlay, window, str, invisible;
    struct Lisp_Overlay *ov;
 -  int start, end;
 +  EMACS_INT start, end;
    int size = 20;
    int n = 0, i, j, invis_p;
    struct overlay_entry *entries
          entries =                                                     \
              (struct overlay_entry *) alloca (new_size                 \
                                             * sizeof *entries);        \
 -        bcopy (old, entries, size * sizeof *entries);                 \
 +        memcpy (entries, old, size * sizeof *entries);                \
          size = new_size;                                              \
        }                                                               \
                                                                        \
     least one overlay string was found.  */
  
  static int
 -get_overlay_strings_1 (it, charpos, compute_stop_p)
 -     struct it *it;
 -     int charpos;
 -     int compute_stop_p;
 +get_overlay_strings_1 (struct it *it, EMACS_INT charpos, int compute_stop_p)
  {
    /* Get the first OVERLAY_STRING_CHUNK_SIZE overlay strings to
       process.  This fills IT->overlay_strings with strings, and sets
  }
  
  static int
 -get_overlay_strings (it, charpos)
 -     struct it *it;
 -     int charpos;
 +get_overlay_strings (struct it *it, EMACS_INT charpos)
  {
    it->string = Qnil;
    it->method = GET_FROM_BUFFER;
     processed.  */
  
  static void
 -push_it (it)
 -     struct it *it;
 +push_it (struct it *it)
  {
    struct iterator_stack_entry *p;
  
    p = it->stack + it->sp;
  
    p->stop_charpos = it->stop_charpos;
 +  p->prev_stop = it->prev_stop;
 +  p->base_level_stop = it->base_level_stop;
    p->cmp_it = it->cmp_it;
    xassert (it->face_id >= 0);
    p->face_id = it->face_id;
    ++it->sp;
  }
  
 +static void
 +iterate_out_of_display_property (struct it *it)
 +{
 +  /* Maybe initialize paragraph direction.  If we are at the beginning
 +     of a new paragraph, next_element_from_buffer may not have a
 +     chance to do that.  */
 +  if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV)
 +    bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1);
 +  /* prev_stop can be zero, so check against BEGV as well.  */
 +  while (it->bidi_it.charpos >= BEGV
 +       && it->prev_stop <= it->bidi_it.charpos
 +       && it->bidi_it.charpos < CHARPOS (it->position))
 +    bidi_move_to_visually_next (&it->bidi_it);
 +  /* Record the stop_pos we just crossed, for when we cross it
 +     back, maybe.  */
 +  if (it->bidi_it.charpos > CHARPOS (it->position))
 +    it->prev_stop = CHARPOS (it->position);
 +  /* If we ended up not where pop_it put us, resync IT's
 +     positional members with the bidi iterator. */
 +  if (it->bidi_it.charpos != CHARPOS (it->position))
 +    {
 +      SET_TEXT_POS (it->position,
 +                  it->bidi_it.charpos, it->bidi_it.bytepos);
 +      it->current.pos = it->position;
 +    }
 +}
  
  /* Restore IT's settings from IT->stack.  Called, for example, when no
     more overlay strings must be processed, and we return to delivering
     elements from an overlay string, or from a buffer.  */
  
  static void
 -pop_it (it)
 -     struct it *it;
 +pop_it (struct it *it)
  {
    struct iterator_stack_entry *p;
  
    --it->sp;
    p = it->stack + it->sp;
    it->stop_charpos = p->stop_charpos;
 +  it->prev_stop = p->prev_stop;
 +  it->base_level_stop = p->base_level_stop;
    it->cmp_it = p->cmp_it;
    it->face_id = p->face_id;
    it->current = p->current;
        break;
      case GET_FROM_BUFFER:
        it->object = it->w->buffer;
 +      if (it->bidi_p)
 +      {
 +        /* Bidi-iterate until we get out of the portion of text, if
 +           any, covered by a `display' text property or an overlay
 +           with `display' property.  (We cannot just jump there,
 +           because the internal coherency of the bidi iterator state
 +           can not be preserved across such jumps.)  We also must
 +           determine the paragraph base direction if the overlay we
 +           just processed is at the beginning of a new
 +           paragraph.  */
 +        iterate_out_of_display_property (it);
 +      }
        break;
      case GET_FROM_STRING:
        it->object = it->string;
  /* Set IT's current position to the previous line start.  */
  
  static void
 -back_to_previous_line_start (it)
 -     struct it *it;
 +back_to_previous_line_start (struct it *it)
  {
    IT_CHARPOS (*it) = find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1);
    IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it));
     leads to wrong cursor motion.  */
  
  static int
 -forward_to_next_line_start (it, skipped_p)
 -     struct it *it;
 -     int *skipped_p;
 +forward_to_next_line_start (struct it *it, int *skipped_p)
  {
    int old_selective, newline_found_p, n;
    const int MAX_NEWLINE_DISTANCE = 500;
       short-cut.  */
    if (!newline_found_p)
      {
 -      int start = IT_CHARPOS (*it);
 -      int limit = find_next_newline_no_quit (start, 1);
 +      EMACS_INT start = IT_CHARPOS (*it);
 +      EMACS_INT limit = find_next_newline_no_quit (start, 1);
        Lisp_Object pos;
  
        xassert (!STRINGP (it->string));
     IT->hpos.  */
  
  static void
 -back_to_previous_visible_line_start (it)
 -     struct it *it;
 +back_to_previous_visible_line_start (struct it *it)
  {
    while (IT_CHARPOS (*it) > BEGV)
      {
        if (IT_CHARPOS (*it) <= BEGV)
        break;
  
 -      /* If selective > 0, then lines indented more than that values
 -       are invisible.  */
 +      /* If selective > 0, then lines indented more than its value are
 +       invisible.  */
        if (it->selective > 0
          && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it),
                                (double) it->selective)) /* iftc */
  
        {
        struct it it2;
 -      int pos;
 +      EMACS_INT pos;
        EMACS_INT beg, end;
        Lisp_Object val, overlay;
  
     face information etc.  */
  
  void
 -reseat_at_previous_visible_line_start (it)
 -     struct it *it;
 +reseat_at_previous_visible_line_start (struct it *it)
  {
    back_to_previous_visible_line_start (it);
    reseat (it, it->current.pos, 1);
     is invisible because of text properties.  */
  
  static void
 -reseat_at_next_visible_line_start (it, on_newline_p)
 -     struct it *it;
 -     int on_newline_p;
 +reseat_at_next_visible_line_start (struct it *it, int on_newline_p)
  {
    int newline_found_p, skipped_p = 0;
  
     IT->check_charpos of a property.  */
  
  static void
 -reseat (it, pos, force_p)
 -     struct it *it;
 -     struct text_pos pos;
 -     int force_p;
 +reseat (struct it *it, struct text_pos pos, int force_p)
  {
 -  int original_pos = IT_CHARPOS (*it);
 +  EMACS_INT original_pos = IT_CHARPOS (*it);
  
    reseat_1 (it, pos, 0);
  
    if (force_p
        || CHARPOS (pos) > it->stop_charpos
        || CHARPOS (pos) < original_pos)
 -    handle_stop (it);
 +    {
 +      if (it->bidi_p)
 +      {
 +        /* For bidi iteration, we need to prime prev_stop and
 +           base_level_stop with our best estimations.  */
 +        if (CHARPOS (pos) < it->prev_stop)
 +          {
 +            handle_stop_backwards (it, BEGV);
 +            if (CHARPOS (pos) < it->base_level_stop)
 +              it->base_level_stop = 0;
 +          }
 +        else if (CHARPOS (pos) > it->stop_charpos
 +                 && it->stop_charpos >= BEGV)
 +          handle_stop_backwards (it, it->stop_charpos);
 +        else  /* force_p */
 +          handle_stop (it);
 +      }
 +      else
 +      {
 +        handle_stop (it);
 +        it->prev_stop = it->base_level_stop = 0;
 +      }
 +
 +    }
  
    CHECK_IT (it);
  }
     IT->stop_pos to POS, also.  */
  
  static void
 -reseat_1 (it, pos, set_stop_p)
 -     struct it *it;
 -     struct text_pos pos;
 -     int set_stop_p;
 +reseat_1 (struct it *it, struct text_pos pos, int set_stop_p)
  {
    /* Don't call this function when scanning a C string.  */
    xassert (it->s == NULL);
    it->method = GET_FROM_BUFFER;
    it->object = it->w->buffer;
    it->area = TEXT_AREA;
 -  it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
 +  it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters));
    it->sp = 0;
    it->string_from_display_prop_p = 0;
    it->face_before_selective_p = 0;
 +  if (it->bidi_p)
 +    {
 +      it->bidi_it.first_elt = 1;
 +      it->bidi_it.paragraph_dir = NEUTRAL_DIR;
 +    }
  
    if (set_stop_p)
 -    it->stop_charpos = CHARPOS (pos);
 +    {
 +      it->stop_charpos = CHARPOS (pos);
 +      it->base_level_stop = CHARPOS (pos);
 +    }
  }
  
  
     calling this function.  */
  
  static void
 -reseat_to_string (it, s, string, charpos, precision, field_width, multibyte)
 -     struct it *it;
 -     unsigned char *s;
 -     Lisp_Object string;
 -     int charpos;
 -     int precision, field_width, multibyte;
 +reseat_to_string (struct it *it, const char *s, Lisp_Object string,
 +                EMACS_INT charpos, EMACS_INT precision, int field_width,
 +                int multibyte)
  {
    /* No region in strings.  */
    it->region_beg_charpos = it->region_end_charpos = -1;
    it->stop_charpos = -1;
  
    /* Set iterator position and end position.  */
 -  bzero (&it->current, sizeof it->current);
 +  memset (&it->current, 0, sizeof it->current);
    it->current.overlay_string_index = -1;
    it->current.dpvec_index = -1;
    xassert (charpos >= 0);
      }
    else
      {
 -      it->s = s;
 +      it->s = (const unsigned char *) s;
        it->string = Qnil;
  
        /* Note that we use IT->current.pos, not it->current.string_pos,
  \f
  /***********************************************************************
                              Iteration
 - ***********************************************************************/
 +***********************************************************************/
  
  /* Map enum it_method value to corresponding next_element_from_* function.  */
  
 -static int (* get_next_element[NUM_IT_METHODS]) P_ ((struct it *it)) =
 +static int (* get_next_element[NUM_IT_METHODS]) (struct it *it) =
  {
    next_element_from_buffer,
    next_element_from_display_vector,
                                 (IT)->string)))
  
  
 +/* Lookup the char-table Vglyphless_char_display for character C (-1
 +   if we want information for no-font case), and return the display
 +   method symbol.  By side-effect, update it->what and
 +   it->glyphless_method.  This function is called from
 +   get_next_display_element for each character element, and from
 +   x_produce_glyphs when no suitable font was found.  */
 +
 +Lisp_Object
 +lookup_glyphless_char_display (int c, struct it *it)
 +{
 +  Lisp_Object glyphless_method = Qnil;
 +
 +  if (CHAR_TABLE_P (Vglyphless_char_display)
 +      && CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (Vglyphless_char_display)) >= 1)
 +    glyphless_method = (c >= 0
 +                      ? CHAR_TABLE_REF (Vglyphless_char_display, c)
 +                      : XCHAR_TABLE (Vglyphless_char_display)->extras[0]);
 + retry:
 +  if (NILP (glyphless_method))
 +    {
 +      if (c >= 0)
 +      /* The default is to display the character by a proper font.  */
 +      return Qnil;
 +      /* The default for the no-font case is to display an empty box.  */
 +      glyphless_method = Qempty_box;
 +    }
 +  if (EQ (glyphless_method, Qzero_width))
 +    {
 +      if (c >= 0)
 +      return glyphless_method;
 +      /* This method can't be used for the no-font case.  */
 +      glyphless_method = Qempty_box;
 +    }
 +  if (EQ (glyphless_method, Qthin_space))
 +    it->glyphless_method = GLYPHLESS_DISPLAY_THIN_SPACE;
 +  else if (EQ (glyphless_method, Qempty_box))
 +    it->glyphless_method = GLYPHLESS_DISPLAY_EMPTY_BOX;
 +  else if (EQ (glyphless_method, Qhex_code))
 +    it->glyphless_method = GLYPHLESS_DISPLAY_HEX_CODE;
 +  else if (STRINGP (glyphless_method))
 +    it->glyphless_method = GLYPHLESS_DISPLAY_ACRONYM;
 +  else
 +    {
 +      /* Invalid value.  We use the default method.  */
 +      glyphless_method = Qnil;
 +      goto retry;
 +    }
 +  it->what = IT_GLYPHLESS;
 +  return glyphless_method;
 +}
 +
  /* Load IT's display element fields with information about the next
     display element from the current position of IT.  Value is zero if
     end of buffer (or C string) is reached.  */
@@@ -5622,12 -5643,9 +5622,12 @@@ static struct frame *last_escape_glyph_
  static unsigned last_escape_glyph_face_id = (1 << FACE_ID_BITS);
  static int last_escape_glyph_merged_face_id = 0;
  
 +struct frame *last_glyphless_glyph_frame = NULL;
 +unsigned last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
 +int last_glyphless_glyph_merged_face_id = 0;
 +
  int
 -get_next_display_element (it)
 -     struct it *it;
 +get_next_display_element (struct it *it)
  {
    /* Non-zero means that we found a display element.  Zero means that
       we hit the end of what we iterate over.  Performance note: the
  
    if (it->what == IT_CHARACTER)
      {
 +      /* UAX#9, L4: "A character is depicted by a mirrored glyph if
 +       and only if (a) the resolved directionality of that character
 +       is R..."  */
 +      /* FIXME: Do we need an exception for characters from display
 +       tables?  */
 +      if (it->bidi_p && it->bidi_it.type == STRONG_R)
 +      it->c = bidi_mirror_char (it->c);
        /* Map via display table or translate control characters.
         IT->c, IT->len etc. have been set to the next character by
         the function call above.  If we have a display table, and it
              goto get_next;
            }
  
 +        if (! NILP (lookup_glyphless_char_display (c, it)))
 +          {
 +            if (it->what == IT_GLYPHLESS)
 +              goto done;
 +            /* Don't display this character.  */
 +            set_iterator_to_next (it, 0);
 +            goto get_next;
 +          }
 +
          if (! ASCII_CHAR_P (c) && ! NILP (Vnobreak_char_display))
            nbsp_or_shy = (c == 0xA0   ? char_is_nbsp
                           : c == 0xAD ? char_is_soft_hyphen
        }
        else
        {
 -        int pos = (it->s ? -1
 -                   : STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
 -                   : IT_CHARPOS (*it));
 +        EMACS_INT pos = (it->s ? -1
 +                         : STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
 +                         : IT_CHARPOS (*it));
  
          it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display, pos,
                                       it->string);
      }
  #endif
  
 + done:
    /* Is this character the last one of a run of characters with
       box?  If yes, set IT->end_of_box_run_p to 1.  */
    if (it->face_box_p
     decrement position function which would not be easy to write.  */
  
  void
 -set_iterator_to_next (it, reseat_p)
 -     struct it *it;
 -     int reseat_p;
 +set_iterator_to_next (struct it *it, int reseat_p)
  {
    /* Reset flags indicating start and end of a sequence of characters
       with box.  Reset them at the start of this function because
        reseat_at_next_visible_line_start (it, 0);
        else if (it->cmp_it.id >= 0)
        {
 -        IT_CHARPOS (*it) += it->cmp_it.nchars;
 -        IT_BYTEPOS (*it) += it->cmp_it.nbytes;
 -        if (it->cmp_it.to < it->cmp_it.nglyphs)
 -          it->cmp_it.from = it->cmp_it.to;
 +        /* We are currently getting glyphs from a composition.  */
 +        int i;
 +
 +        if (! it->bidi_p)
 +          {
 +            IT_CHARPOS (*it) += it->cmp_it.nchars;
 +            IT_BYTEPOS (*it) += it->cmp_it.nbytes;
 +            if (it->cmp_it.to < it->cmp_it.nglyphs)
 +              {
 +                it->cmp_it.from = it->cmp_it.to;
 +              }
 +            else
 +              {
 +                it->cmp_it.id = -1;
 +                composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
 +                                              IT_BYTEPOS (*it),
 +                                              it->end_charpos, Qnil);
 +              }
 +          }
 +        else if (! it->cmp_it.reversed_p)
 +          {
 +            /* Composition created while scanning forward.  */
 +            /* Update IT's char/byte positions to point to the first
 +               character of the next grapheme cluster, or to the
 +               character visually after the current composition.  */
 +            for (i = 0; i < it->cmp_it.nchars; i++)
 +              bidi_move_to_visually_next (&it->bidi_it);
 +            IT_BYTEPOS (*it) = it->bidi_it.bytepos;
 +            IT_CHARPOS (*it) = it->bidi_it.charpos;
 +
 +            if (it->cmp_it.to < it->cmp_it.nglyphs)
 +              {
 +                /* Proceed to the next grapheme cluster.  */
 +                it->cmp_it.from = it->cmp_it.to;
 +              }
 +            else
 +              {
 +                /* No more grapheme clusters in this composition.
 +                   Find the next stop position.  */
 +                EMACS_INT stop = it->end_charpos;
 +                if (it->bidi_it.scan_dir < 0)
 +                  /* Now we are scanning backward and don't know
 +                     where to stop.  */
 +                  stop = -1;
 +                composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
 +                                              IT_BYTEPOS (*it), stop, Qnil);
 +              }
 +          }
          else
            {
 -            it->cmp_it.id = -1;
 -            composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
 -                                          IT_BYTEPOS (*it), it->stop_charpos,
 -                                          Qnil);
 +            /* Composition created while scanning backward.  */
 +            /* Update IT's char/byte positions to point to the last
 +               character of the previous grapheme cluster, or the
 +               character visually after the current composition.  */
 +            for (i = 0; i < it->cmp_it.nchars; i++)
 +              bidi_move_to_visually_next (&it->bidi_it);
 +            IT_BYTEPOS (*it) = it->bidi_it.bytepos;
 +            IT_CHARPOS (*it) = it->bidi_it.charpos;
 +            if (it->cmp_it.from > 0)
 +              {
 +                /* Proceed to the previous grapheme cluster.  */
 +                it->cmp_it.to = it->cmp_it.from;
 +              }
 +            else
 +              {
 +                /* No more grapheme clusters in this composition.
 +                   Find the next stop position.  */
 +                EMACS_INT stop = it->end_charpos;
 +                if (it->bidi_it.scan_dir < 0)
 +                  /* Now we are scanning backward and don't know
 +                     where to stop.  */
 +                  stop = -1;
 +                composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
 +                                              IT_BYTEPOS (*it), stop, Qnil);
 +              }
            }
        }
        else
        {
          xassert (it->len != 0);
 -        IT_BYTEPOS (*it) += it->len;
 -        IT_CHARPOS (*it) += 1;
 +
 +        if (!it->bidi_p)
 +          {
 +            IT_BYTEPOS (*it) += it->len;
 +            IT_CHARPOS (*it) += 1;
 +          }
 +        else
 +          {
 +            int prev_scan_dir = it->bidi_it.scan_dir;
 +            /* If this is a new paragraph, determine its base
 +               direction (a.k.a. its base embedding level).  */
 +            if (it->bidi_it.new_paragraph)
 +              bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 0);
 +            bidi_move_to_visually_next (&it->bidi_it);
 +            IT_BYTEPOS (*it) = it->bidi_it.bytepos;
 +            IT_CHARPOS (*it) = it->bidi_it.charpos;
 +            if (prev_scan_dir != it->bidi_it.scan_dir)
 +              {
 +                /* As the scan direction was changed, we must
 +                   re-compute the stop position for composition.  */
 +                EMACS_INT stop = it->end_charpos;
 +                if (it->bidi_it.scan_dir < 0)
 +                  stop = -1;
 +                composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
 +                                              IT_BYTEPOS (*it), stop, Qnil);
 +              }
 +          }
          xassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it)));
        }
        break;
              composition_compute_stop_pos (&it->cmp_it,
                                            IT_STRING_CHARPOS (*it),
                                            IT_STRING_BYTEPOS (*it),
 -                                          it->stop_charpos, it->string);
 +                                          it->end_charpos, it->string);
            }
        }
        else
     is restored into IT->face_id in set_iterator_to_next.  */
  
  static int
 -next_element_from_display_vector (it)
 -     struct it *it;
 +next_element_from_display_vector (struct it *it)
  {
    Lisp_Object gc;
  
    it->face_id = it->saved_face_id;
  
    /* KFS: This code used to check ip->dpvec[0] instead of the current element.
 -          That seemed totally bogus - so I changed it...  */
 +     That seemed totally bogus - so I changed it...  */
    gc = it->dpvec[it->current.dpvec_index];
  
    if (GLYPH_CODE_P (gc) && GLYPH_CODE_CHAR_VALID_P (gc))
     overlay string.  */
  
  static int
 -next_element_from_string (it)
 -     struct it *it;
 +next_element_from_string (struct it *it)
  {
    struct text_pos position;
  
     reached, including padding spaces.  */
  
  static int
 -next_element_from_c_string (it)
 -     struct it *it;
 +next_element_from_c_string (struct it *it)
  {
    int success_p = 1;
  
     ellipsis if an ellipsis is to be displayed.  */
  
  static int
 -next_element_from_ellipsis (it)
 -     struct it *it;
 +next_element_from_ellipsis (struct it *it)
  {
    if (it->selective_display_ellipsis_p)
      setup_for_ellipsis (it, it->len);
  
  
  static int
 -next_element_from_image (it)
 -     struct it *it;
 +next_element_from_image (struct it *it)
  {
    it->what = IT_IMAGE;
    it->ignore_overlay_strings_at_pos_p = 0;
     always 1.  */
  
  static int
 -next_element_from_stretch (it)
 -     struct it *it;
 +next_element_from_stretch (struct it *it)
  {
    it->what = IT_STRETCH;
    return 1;
  }
  
 +/* Scan forward from CHARPOS in the current buffer, until we find a
 +   stop position > current IT's position.  Then handle the stop
 +   position before that.  This is called when we bump into a stop
 +   position while reordering bidirectional text.  CHARPOS should be
 +   the last previously processed stop_pos (or BEGV, if none were
 +   processed yet) whose position is less that IT's current
 +   position.  */
 +
 +static void
 +handle_stop_backwards (struct it *it, EMACS_INT charpos)
 +{
 +  EMACS_INT where_we_are = IT_CHARPOS (*it);
 +  struct display_pos save_current = it->current;
 +  struct text_pos save_position = it->position;
 +  struct text_pos pos1;
 +  EMACS_INT next_stop;
 +
 +  /* Scan in strict logical order.  */
 +  it->bidi_p = 0;
 +  do
 +    {
 +      it->prev_stop = charpos;
 +      SET_TEXT_POS (pos1, charpos, CHAR_TO_BYTE (charpos));
 +      reseat_1 (it, pos1, 0);
 +      compute_stop_pos (it);
 +      /* We must advance forward, right?  */
 +      if (it->stop_charpos <= it->prev_stop)
 +      abort ();
 +      charpos = it->stop_charpos;
 +    }
 +  while (charpos <= where_we_are);
 +
 +  next_stop = it->stop_charpos;
 +  it->stop_charpos = it->prev_stop;
 +  it->bidi_p = 1;
 +  it->current = save_current;
 +  it->position = save_position;
 +  handle_stop (it);
 +  it->stop_charpos = next_stop;
 +}
  
  /* Load IT with the next display element from current_buffer.  Value
     is zero if end of buffer reached.  IT->stop_charpos is the next
     end.  */
  
  static int
 -next_element_from_buffer (it)
 -     struct it *it;
 +next_element_from_buffer (struct it *it)
  {
    int success_p = 1;
  
    xassert (IT_CHARPOS (*it) >= BEGV);
  
 +  /* With bidi reordering, the character to display might not be the
 +     character at IT_CHARPOS.  BIDI_IT.FIRST_ELT non-zero means that
 +     we were reseat()ed to a new buffer position, which is potentially
 +     a different paragraph.  */
 +  if (it->bidi_p && it->bidi_it.first_elt)
 +    {
 +      it->bidi_it.charpos = IT_CHARPOS (*it);
 +      it->bidi_it.bytepos = IT_BYTEPOS (*it);
 +      if (it->bidi_it.bytepos == ZV_BYTE)
 +      {
 +        /* Nothing to do, but reset the FIRST_ELT flag, like
 +           bidi_paragraph_init does, because we are not going to
 +           call it.  */
 +        it->bidi_it.first_elt = 0;
 +      }
 +      else if (it->bidi_it.bytepos == BEGV_BYTE
 +        /* FIXME: Should support all Unicode line separators.  */
 +        || FETCH_CHAR (it->bidi_it.bytepos - 1) == '\n'
 +        || FETCH_CHAR (it->bidi_it.bytepos) == '\n')
 +      {
 +        /* If we are at the beginning of a line, we can produce the
 +           next element right away.  */
 +        bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1);
 +        bidi_move_to_visually_next (&it->bidi_it);
 +      }
 +      else
 +      {
 +        EMACS_INT orig_bytepos = IT_BYTEPOS (*it);
 +
 +        /* We need to prime the bidi iterator starting at the line's
 +           beginning, before we will be able to produce the next
 +           element.  */
 +        IT_CHARPOS (*it) = find_next_newline_no_quit (IT_CHARPOS (*it), -1);
 +        IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it));
 +        it->bidi_it.charpos = IT_CHARPOS (*it);
 +        it->bidi_it.bytepos = IT_BYTEPOS (*it);
 +        bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1);
 +        do
 +          {
 +            /* Now return to buffer position where we were asked to
 +               get the next display element, and produce that.  */
 +            bidi_move_to_visually_next (&it->bidi_it);
 +          }
 +        while (it->bidi_it.bytepos != orig_bytepos
 +               && it->bidi_it.bytepos < ZV_BYTE);
 +      }
 +
 +      it->bidi_it.first_elt = 0; /* paranoia: bidi.c does this */
 +      /*  Adjust IT's position information to where we ended up.  */
 +      IT_CHARPOS (*it) = it->bidi_it.charpos;
 +      IT_BYTEPOS (*it) = it->bidi_it.bytepos;
 +      SET_TEXT_POS (it->position, IT_CHARPOS (*it), IT_BYTEPOS (*it));
 +      {
 +      EMACS_INT stop = it->end_charpos;
 +      if (it->bidi_it.scan_dir < 0)
 +        stop = -1;
 +      composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
 +                                    IT_BYTEPOS (*it), stop, Qnil);
 +      }
 +    }
 +
    if (IT_CHARPOS (*it) >= it->stop_charpos)
      {
        if (IT_CHARPOS (*it) >= it->end_charpos)
              success_p = 0;
            }
        }
 +      else if (!(!it->bidi_p
 +               || BIDI_AT_BASE_LEVEL (it->bidi_it)
 +               || IT_CHARPOS (*it) == it->stop_charpos))
 +      {
 +        /* With bidi non-linear iteration, we could find ourselves
 +           far beyond the last computed stop_charpos, with several
 +           other stop positions in between that we missed.  Scan
 +           them all now, in buffer's logical order, until we find
 +           and handle the last stop_charpos that precedes our
 +           current position.  */
 +        handle_stop_backwards (it, it->stop_charpos);
 +        return GET_NEXT_DISPLAY_ELEMENT (it);
 +      }
        else
        {
 +        if (it->bidi_p)
 +          {
 +            /* Take note of the stop position we just moved across,
 +               for when we will move back across it.  */
 +            it->prev_stop = it->stop_charpos;
 +            /* If we are at base paragraph embedding level, take
 +               note of the last stop position seen at this
 +               level.  */
 +            if (BIDI_AT_BASE_LEVEL (it->bidi_it))
 +              it->base_level_stop = it->stop_charpos;
 +          }
          handle_stop (it);
          return GET_NEXT_DISPLAY_ELEMENT (it);
        }
      }
 +  else if (it->bidi_p
 +         /* We can sometimes back up for reasons that have nothing
 +            to do with bidi reordering.  E.g., compositions.  The
 +            code below is only needed when we are above the base
 +            embedding level, so test for that explicitly.  */
 +         && !BIDI_AT_BASE_LEVEL (it->bidi_it)
 +         && IT_CHARPOS (*it) < it->prev_stop)
 +    {
 +      if (it->base_level_stop <= 0)
 +      it->base_level_stop = BEGV;
 +      if (IT_CHARPOS (*it) < it->base_level_stop)
 +      abort ();
 +      handle_stop_backwards (it, it->base_level_stop);
 +      return GET_NEXT_DISPLAY_ELEMENT (it);
 +    }
    else
      {
        /* No face changes, overlays etc. in sight, so just return a
         character from current_buffer.  */
        unsigned char *p;
 +      EMACS_INT stop;
  
        /* Maybe run the redisplay end trigger hook.  Performance note:
         This doesn't seem to cost measurable time.  */
          && IT_CHARPOS (*it) >= it->redisplay_end_trigger_charpos)
        run_redisplay_end_trigger_hook (it);
  
 +      stop = it->bidi_it.scan_dir < 0 ? -1 : it->end_charpos;
        if (CHAR_COMPOSED_P (it, IT_CHARPOS (*it), IT_BYTEPOS (*it),
 -                         it->end_charpos)
 +                         stop)
          && next_element_from_composition (it))
        {
          return 1;
  /* Run the redisplay end trigger hook for IT.  */
  
  static void
 -run_redisplay_end_trigger_hook (it)
 -     struct it *it;
 +run_redisplay_end_trigger_hook (struct it *it)
  {
    Lisp_Object args[3];
  
     next_element_from_string when necessary.  */
  
  static int
 -next_element_from_composition (it)
 -     struct it *it;
 +next_element_from_composition (struct it *it)
  {
    it->what = IT_COMPOSITION;
    it->len = it->cmp_it.nbytes;
        {
          IT_CHARPOS (*it) += it->cmp_it.nchars;
          IT_BYTEPOS (*it) += it->cmp_it.nbytes;
 +        if (it->bidi_p)
 +          {
 +            if (it->bidi_it.new_paragraph)
 +              bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 0);
 +            /* Resync the bidi iterator with IT's new position.
 +               FIXME: this doesn't support bidirectional text.  */
 +            while (it->bidi_it.charpos < IT_CHARPOS (*it))
 +              bidi_move_to_visually_next (&it->bidi_it);
 +          }
          return 0;
        }
        it->position = it->current.pos;
     line on the display without producing glyphs.
  
     OP should be a bit mask including some or all of these bits:
 -    MOVE_TO_X: Stop on reaching x-position TO_X.
 -    MOVE_TO_POS: Stop on reaching buffer or string position TO_CHARPOS.
 -   Regardless of OP's value, stop in reaching the end of the display line.
 +    MOVE_TO_X: Stop upon reaching x-position TO_X.
 +    MOVE_TO_POS: Stop upon reaching buffer or string position TO_CHARPOS.
 +   Regardless of OP's value, stop upon reaching the end of the display line.
  
     TO_X is normally a value 0 <= TO_X <= IT->last_visible_x.
     This means, in particular, that TO_X includes window's horizontal
@@@ -6885,8 -6656,6 +6885,8 @@@ move_it_in_display_line_to (struct it *
    struct glyph_row *saved_glyph_row;
    struct it wrap_it, atpos_it, atx_it;
    int may_wrap = 0;
 +  enum it_method prev_method = it->method;
 +  EMACS_INT prev_pos = IT_CHARPOS (*it);
  
    /* Don't produce glyphs in produce_glyphs.  */
    saved_glyph_row = it->glyph_row;
  #define BUFFER_POS_REACHED_P()                                        \
    ((op & MOVE_TO_POS) != 0                                    \
     && BUFFERP (it->object)                                    \
 -   && IT_CHARPOS (*it) >= to_charpos                          \
 +   && (IT_CHARPOS (*it) == to_charpos                         \
 +       || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos))     \
     && (it->method == GET_FROM_BUFFER                          \
         || (it->method == GET_FROM_DISPLAY_VECTOR              \
           && it->dpvec + it->current.dpvec_index + 1 >= it->dpend)))
        && it->current_y < it->last_visible_y)
      handle_line_prefix (it);
  
 +  if (IT_CHARPOS (*it) < CHARPOS (this_line_min_pos))
 +    SET_TEXT_POS (this_line_min_pos, IT_CHARPOS (*it), IT_BYTEPOS (*it));
 +
    while (1)
      {
        int x, i, ascent = 0, descent = 0;
        if ((op & MOVE_TO_POS) != 0
          && BUFFERP (it->object)
          && it->method == GET_FROM_BUFFER
 -        && IT_CHARPOS (*it) > to_charpos)
 +        && ((!it->bidi_p && IT_CHARPOS (*it) > to_charpos)
 +            || (it->bidi_p
 +                && (prev_method == GET_FROM_IMAGE
 +                    || prev_method == GET_FROM_STRETCH)
 +                /* Passed TO_CHARPOS from left to right.  */
 +                && ((prev_pos < to_charpos
 +                     && IT_CHARPOS (*it) > to_charpos)
 +                    /* Passed TO_CHARPOS from right to left.  */
 +                    || (prev_pos > to_charpos
 +                        && IT_CHARPOS (*it) < to_charpos)))))
        {
          if (it->line_wrap != WORD_WRAP || wrap_it.sp < 0)
            {
            atpos_it = *it;
        }
  
 +      prev_method = it->method;
 +      if (it->method == GET_FROM_BUFFER)
 +      prev_pos = IT_CHARPOS (*it);
        /* Stop when ZV reached.
           We used to stop here when TO_CHARPOS reached as well, but that is
           too soon if this glyph does not fit on this line.  So we handle it
        if (it->area != TEXT_AREA)
        {
          set_iterator_to_next (it, 1);
 +        if (IT_CHARPOS (*it) < CHARPOS (this_line_min_pos))
 +          SET_TEXT_POS (this_line_min_pos,
 +                        IT_CHARPOS (*it), IT_BYTEPOS (*it));
          continue;
        }
  
                            }
  
                          set_iterator_to_next (it, 1);
 +                        if (IT_CHARPOS (*it) < CHARPOS (this_line_min_pos))
 +                          SET_TEXT_POS (this_line_min_pos,
 +                                        IT_CHARPOS (*it), IT_BYTEPOS (*it));
                          /* On graphical terminals, newlines may
                             "overflow" into the fringe if
                             overflow-newline-into-fringe is non-nil.
          break;
        }
  
 +      if (it->method == GET_FROM_BUFFER)
 +      prev_pos = IT_CHARPOS (*it);
        /* The current display element has been consumed.  Advance
         to the next.  */
        set_iterator_to_next (it, 1);
 +      if (IT_CHARPOS (*it) < CHARPOS (this_line_min_pos))
 +      SET_TEXT_POS (this_line_min_pos, IT_CHARPOS (*it), IT_BYTEPOS (*it));
  
        /* Stop if lines are truncated and IT's current x-position is
         past the right edge of the window now.  */
@@@ -7320,7 -7063,10 +7320,7 @@@ move_it_in_display_line (struct it *it
     TO_CHARPOS.  */
  
  void
 -move_it_to (it, to_charpos, to_x, to_y, to_vpos, op)
 -     struct it *it;
 -     int to_charpos, to_x, to_y, to_vpos;
 -     int op;
 +move_it_to (struct it *it, EMACS_INT to_charpos, int to_x, int to_y, int to_vpos, int op)
  {
    enum move_it_result skip, skip2 = MOVE_X_REACHED;
    int line_height, line_start_x = 0, reached = 0;
     set to the top of the line moved to.  */
  
  void
 -move_it_vertically_backward (it, dy)
 -     struct it *it;
 -     int dy;
 +move_it_vertically_backward (struct it *it, int dy)
  {
    int nlines, h;
    struct it it2, it3;
 -  int start_pos;
 +  EMACS_INT start_pos;
  
   move_further_back:
    xassert (dy >= 0);
     end, IT will be on the start of a screen line.  */
  
  void
 -move_it_vertically (it, dy)
 -    struct it *it;
 -    int dy;
 +move_it_vertically (struct it *it, int dy)
  {
    if (dy <= 0)
      move_it_vertically_backward (it, -dy);
  /* Move iterator IT past the end of the text line it is in.  */
  
  void
 -move_it_past_eol (it)
 -     struct it *it;
 +move_it_past_eol (struct it *it)
  {
    enum move_it_result rc;
  
     truncate-lines nil.  */
  
  void
 -move_it_by_lines (it, dvpos, need_y_p)
 -     struct it *it;
 -     int dvpos, need_y_p;
 +move_it_by_lines (struct it *it, int dvpos, int need_y_p)
  {
 -  struct position pos;
  
    /* 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 position pos;
 +    if (!FRAME_WINDOW_P (it->f))
      {
        struct text_pos textpos;
  
    else
      {
        struct it it2;
 -      int start_charpos, i;
 +      EMACS_INT start_charpos, i;
  
        /* Start at the beginning of the screen line containing IT's
         position.  This may actually move vertically backwards,
  /* Return 1 if IT points into the middle of a display vector.  */
  
  int
 -in_display_vector_p (it)
 -     struct it *it;
 +in_display_vector_p (struct it *it)
  {
    return (it->method == GET_FROM_DISPLAY_VECTOR
          && it->current.dpvec_index > 0
     to *Messages*.  */
  
  void
 -add_to_log (format, arg1, arg2)
 -     char *format;
 -     Lisp_Object arg1, arg2;
 +add_to_log (const char *format, Lisp_Object arg1, Lisp_Object arg2)
  {
    Lisp_Object args[3];
    Lisp_Object msg, fmt;
    char *buffer;
 -  int len;
 +  EMACS_INT len;
    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
    USE_SAFE_ALLOCA;
  
  
    len = SBYTES (msg) + 1;
    SAFE_ALLOCA (buffer, char *, len);
 -  bcopy (SDATA (msg), buffer, len);
 +  memcpy (buffer, SDATA (msg), len);
  
    message_dolog (buffer, len - 1, 1, 0);
    SAFE_FREE ();
  /* Output a newline in the *Messages* buffer if "needs" one.  */
  
  void
 -message_log_maybe_newline ()
 +message_log_maybe_newline (void)
  {
    if (message_log_need_newline)
      message_dolog ("", 0, 1, 0);
     so the buffer M must NOT point to a Lisp string.  */
  
  void
 -message_dolog (m, nbytes, nlflag, multibyte)
 -     const char *m;
 -     int nbytes, nlflag, multibyte;
 +message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
  {
 +  const unsigned char *msg = (const unsigned char *) m;
 +
    if (!NILP (Vmemory_full))
      return;
  
        struct buffer *oldbuf;
        Lisp_Object oldpoint, oldbegv, oldzv;
        int old_windows_or_buffers_changed = windows_or_buffers_changed;
 -      int point_at_end = 0;
 -      int zv_at_end = 0;
 +      EMACS_INT point_at_end = 0;
 +      EMACS_INT zv_at_end = 0;
        Lisp_Object old_deactivate_mark, tem;
        struct gcpro gcpro1;
  
        old_deactivate_mark = Vdeactivate_mark;
        oldbuf = current_buffer;
        Fset_buffer (Fget_buffer_create (Vmessages_buffer_name));
 -      current_buffer->undo_list = Qt;
 +      B_ (current_buffer, undo_list) = Qt;
  
        oldpoint = message_dolog_marker1;
        set_marker_restricted (oldpoint, make_number (PT), Qnil);
        /* Insert the string--maybe converting multibyte to single byte
         or vice versa, so that all the text fits the buffer.  */
        if (multibyte
 -        && NILP (current_buffer->enable_multibyte_characters))
 +        && NILP (B_ (current_buffer, enable_multibyte_characters)))
        {
 -        int i, c, char_bytes;
 -        unsigned char work[1];
 +        EMACS_INT i;
 +        int c, char_bytes;
 +        char work[1];
  
          /* Convert a multibyte string to single-byte
             for the *Message* buffer.  */
          for (i = 0; i < nbytes; i += char_bytes)
            {
 -            c = string_char_and_length (m + i, &char_bytes);
 +            c = string_char_and_length (msg + i, &char_bytes);
              work[0] = (ASCII_CHAR_P (c)
                         ? c
                         : multibyte_char_to_unibyte (c, Qnil));
            }
        }
        else if (! multibyte
 -             && ! NILP (current_buffer->enable_multibyte_characters))
 +             && ! NILP (B_ (current_buffer, enable_multibyte_characters)))
        {
 -        int i, c, char_bytes;
 -        unsigned char *msg = (unsigned char *) m;
 +        EMACS_INT i;
 +        int c, char_bytes;
          unsigned char str[MAX_MULTIBYTE_LENGTH];
          /* Convert a single-byte string to multibyte
             for the *Message* buffer.  */
              c = msg[i];
              MAKE_CHAR_MULTIBYTE (c);
              char_bytes = CHAR_STRING (c, str);
 -            insert_1_both (str, 1, char_bytes, 1, 0, 0);
 +            insert_1_both ((char *) str, 1, char_bytes, 1, 0, 0);
            }
        }
        else if (nbytes)
  
        if (nlflag)
        {
 -        int this_bol, this_bol_byte, prev_bol, prev_bol_byte, dup;
 +        EMACS_INT this_bol, this_bol_byte, prev_bol, prev_bol_byte;
 +        int dup;
          insert_1 ("\n", 1, 1, 0, 0);
  
          scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0);
     value N > 1 if we should also append " [N times]".  */
  
  static int
 -message_log_check_duplicate (prev_bol, prev_bol_byte, this_bol, this_bol_byte)
 -     int prev_bol, this_bol;
 -     int prev_bol_byte, this_bol_byte;
 +message_log_check_duplicate (EMACS_INT prev_bol, EMACS_INT prev_bol_byte,
 +                           EMACS_INT this_bol, EMACS_INT this_bol_byte)
  {
 -  int i;
 -  int len = Z_BYTE - 1 - this_bol_byte;
 +  EMACS_INT i;
 +  EMACS_INT len = Z_BYTE - 1 - this_bol_byte;
    int seen_dots = 0;
    unsigned char *p1 = BUF_BYTE_ADDRESS (current_buffer, prev_bol_byte);
    unsigned char *p2 = BUF_BYTE_ADDRESS (current_buffer, this_bol_byte);
        int n = 0;
        while (*p1 >= '0' && *p1 <= '9')
        n = n * 10 + *p1++ - '0';
 -      if (strncmp (p1, " times]\n", 8) == 0)
 +      if (strncmp ((char *) p1, " times]\n", 8) == 0)
        return n+1;
      }
    return 0;
     This may GC, so the buffer M must NOT point to a Lisp string.  */
  
  void
 -message2 (m, nbytes, multibyte)
 -     const char *m;
 -     int nbytes;
 -     int multibyte;
 +message2 (const char *m, EMACS_INT nbytes, int multibyte)
  {
    /* First flush out any partial line written with print.  */
    message_log_maybe_newline ();
  /* The non-logging counterpart of message2.  */
  
  void
 -message2_nolog (m, nbytes, multibyte)
 -     const char *m;
 -     int nbytes, multibyte;
 +message2_nolog (const char *m, EMACS_INT nbytes, int multibyte)
  {
    struct frame *sf = SELECTED_FRAME ();
    message_enable_multibyte = multibyte;
     This function cancels echoing.  */
  
  void
 -message3 (m, nbytes, multibyte)
 -     Lisp_Object m;
 -     int nbytes;
 -     int multibyte;
 +message3 (Lisp_Object m, EMACS_INT nbytes, int multibyte)
  {
    struct gcpro gcpro1;
  
        USE_SAFE_ALLOCA;
  
        SAFE_ALLOCA (buffer, char *, nbytes);
 -      bcopy (SDATA (m), buffer, nbytes);
 +      memcpy (buffer, SDATA (m), nbytes);
        message_dolog (buffer, nbytes, 1, multibyte);
        SAFE_FREE ();
      }
     and make this cancel echoing.  */
  
  void
 -message3_nolog (m, nbytes, multibyte)
 -     Lisp_Object m;
 -     int nbytes, multibyte;
 +message3_nolog (Lisp_Object m, EMACS_INT nbytes, int multibyte)
  {
    struct frame *sf = SELECTED_FRAME ();
    message_enable_multibyte = multibyte;
     that was alloca'd.  */
  
  void
 -message1 (m)
 -     char *m;
 +message1 (const char *m)
  {
    message2 (m, (m ? strlen (m) : 0), 0);
  }
  /* The non-logging counterpart of message1.  */
  
  void
 -message1_nolog (m)
 -     char *m;
 +message1_nolog (const char *m)
  {
    message2_nolog (m, (m ? strlen (m) : 0), 0);
  }
     which gets replaced with STRING.  */
  
  void
 -message_with_string (m, string, log)
 -     char *m;
 -     Lisp_Object string;
 -     int log;
 +message_with_string (const char *m, Lisp_Object string, int log)
  {
    CHECK_STRING (string);
  
  /* Dump an informative message to the minibuf.  If M is 0, clear out
     any existing message, and let the mini-buffer text show through.  */
  
 -/* VARARGS 1 */
 -void
 -message (m, a1, a2, a3)
 -     char *m;
 -     EMACS_INT a1, a2, a3;
 +static void
 +vmessage (const char *m, va_list ap)
  {
    if (noninteractive)
      {
          if (noninteractive_need_newline)
            putc ('\n', stderr);
          noninteractive_need_newline = 0;
 -        fprintf (stderr, m, a1, a2, a3);
 +        vfprintf (stderr, m, ap);
          if (cursor_in_echo_area == 0)
            fprintf (stderr, "\n");
          fflush (stderr);
        {
          if (m)
            {
 -            int len;
 -#ifdef NO_ARG_ARRAY
 -            char *a[3];
 -            a[0] = (char *) a1;
 -            a[1] = (char *) a2;
 -            a[2] = (char *) a3;
 +            EMACS_INT len;
  
              len = doprnt (FRAME_MESSAGE_BUF (f),
 -                          FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, 3, a);
 -#else
 -            len = doprnt (FRAME_MESSAGE_BUF (f),
 -                          FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, 3,
 -                          (char **) &a1);
 -#endif /* NO_ARG_ARRAY */
 +                          FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, ap);
  
              message2 (FRAME_MESSAGE_BUF (f), len, 0);
            }
      }
  }
  
 +void
 +message (const char *m, ...)
 +{
 +  va_list ap;
 +  va_start (ap, m);
 +  vmessage (m, ap);
 +  va_end (ap);
 +}
 +
  
  /* The non-logging version of message.  */
  
  void
 -message_nolog (m, a1, a2, a3)
 -     char *m;
 -     EMACS_INT a1, a2, a3;
 +message_nolog (const char *m, ...)
  {
    Lisp_Object old_log_max;
 +  va_list ap;
 +  va_start (ap, m);
    old_log_max = Vmessage_log_max;
    Vmessage_log_max = Qnil;
 -  message (m, a1, a2, a3);
 +  vmessage (m, ap);
    Vmessage_log_max = old_log_max;
 +  va_end (ap);
  }
  
  
     critical.  */
  
  void
 -update_echo_area ()
 +update_echo_area (void)
  {
    if (!NILP (echo_area_buffer[0]))
      {
        Lisp_Object string;
        string = Fcurrent_message ();
        message3 (string, SBYTES (string),
 -              !NILP (current_buffer->enable_multibyte_characters));
 +              !NILP (B_ (current_buffer, enable_multibyte_characters)));
      }
  }
  
     If they aren't, make new ones.  */
  
  static void
 -ensure_echo_area_buffers ()
 +ensure_echo_area_buffers (void)
  {
    int i;
  
    for (i = 0; i < 2; ++i)
      if (!BUFFERP (echo_buffer[i])
 -      || NILP (XBUFFER (echo_buffer[i])->name))
 +      || NILP (B_ (XBUFFER (echo_buffer[i]), name)))
        {
        char name[30];
        Lisp_Object old_buffer;
        old_buffer = echo_buffer[i];
        sprintf (name, " *Echo Area %d*", i);
        echo_buffer[i] = Fget_buffer_create (build_string (name));
 -      XBUFFER (echo_buffer[i])->truncate_lines = Qnil;
 +      B_ (XBUFFER (echo_buffer[i]), truncate_lines) = Qnil;
        /* to force word wrap in echo area -
           it was decided to postpone this*/
        /* XBUFFER (echo_buffer[i])->word_wrap = Qt; */
     Value is what FN returns.  */
  
  static int
 -with_echo_area_buffer (w, which, fn, a1, a2, a3, a4)
 -     struct window *w;
 -     int which;
 -     int (*fn) P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
 -     EMACS_INT a1;
 -     Lisp_Object a2;
 -     EMACS_INT a3, a4;
 +with_echo_area_buffer (struct window *w, int which,
 +                     int (*fn) (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT),
 +                     EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
  {
    Lisp_Object buffer;
    int this_one, the_other, clear_buffer_p, rc;
        set_marker_both (w->pointm, buffer, BEG, BEG_BYTE);
      }
  
 -  current_buffer->undo_list = Qt;
 -  current_buffer->read_only = Qnil;
 +  B_ (current_buffer, undo_list) = Qt;
 +  B_ (current_buffer, read_only) = Qnil;
    specbind (Qinhibit_read_only, Qt);
    specbind (Qinhibit_modification_hooks, Qt);
  
     FN called in with_echo_area_buffer.  */
  
  static Lisp_Object
 -with_echo_area_buffer_unwind_data (w)
 -     struct window *w;
 +with_echo_area_buffer_unwind_data (struct window *w)
  {
    int i = 0;
    Lisp_Object vector, tmp;
     with_echo_area_buffer_unwind_data.  */
  
  static Lisp_Object
 -unwind_with_echo_area_buffer (vector)
 -     Lisp_Object vector;
 +unwind_with_echo_area_buffer (Lisp_Object vector)
  {
    set_buffer_internal_1 (XBUFFER (AREF (vector, 0)));
    Vdeactivate_mark = AREF (vector, 1);
     non-zero means we will print multibyte.  */
  
  void
 -setup_echo_area_for_printing (multibyte_p)
 -     int multibyte_p;
 +setup_echo_area_for_printing (int multibyte_p)
  {
    /* If we can't find an echo area any more, exit.  */
    if (! FRAME_LIVE_P (XFRAME (selected_frame)))
  
        /* Switch to that buffer and clear it.  */
        set_buffer_internal (XBUFFER (echo_area_buffer[0]));
 -      current_buffer->truncate_lines = Qnil;
 +      B_ (current_buffer, truncate_lines) = Qnil;
  
        if (Z > BEG)
        {
  
        /* Set up the buffer for the multibyteness we need.  */
        if (multibyte_p
 -        != !NILP (current_buffer->enable_multibyte_characters))
 +        != !NILP (B_ (current_buffer, enable_multibyte_characters)))
        Fset_buffer_multibyte (multibyte_p ? Qt : Qnil);
  
        /* Raise the frame containing the echo area.  */
        {
          /* Someone switched buffers between print requests.  */
          set_buffer_internal (XBUFFER (echo_area_buffer[0]));
 -        current_buffer->truncate_lines = Qnil;
 +        B_ (current_buffer, truncate_lines) = Qnil;
        }
      }
  }
     display the current message.  */
  
  static int
 -display_echo_area (w)
 -     struct window *w;
 +display_echo_area (struct window *w)
  {
    int i, no_message_p, window_height_changed_p, count;
  
     Value is non-zero if height of W was changed.  */
  
  static int
 -display_echo_area_1 (a1, a2, a3, a4)
 -     EMACS_INT a1;
 -     Lisp_Object a2;
 -     EMACS_INT a3, a4;
 +display_echo_area_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
  {
    struct window *w = (struct window *) a1;
    Lisp_Object window;
     is active, don't shrink it.  */
  
  void
 -resize_echo_area_exactly ()
 +resize_echo_area_exactly (void)
  {
    if (BUFFERP (echo_area_buffer[0])
        && WINDOWP (echo_area_window))
     resize_mini_window returns.  */
  
  static int
 -resize_mini_window_1 (a1, exactly, a3, a4)
 -     EMACS_INT a1;
 -     Lisp_Object exactly;
 -     EMACS_INT a3, a4;
 +resize_mini_window_1 (EMACS_INT a1, Lisp_Object exactly, EMACS_INT a3, EMACS_INT a4)
  {
    return resize_mini_window ((struct window *) a1, !NILP (exactly));
  }
     Value is non-zero if the window height has been changed.  */
  
  int
 -resize_mini_window (w, exact_p)
 -     struct window *w;
 -     int exact_p;
 +resize_mini_window (struct window *w, int exact_p)
  {
    struct frame *f = XFRAME (w->frame);
    int window_height_changed_p = 0;
     current message.  */
  
  Lisp_Object
 -current_message ()
 +current_message (void)
  {
    Lisp_Object msg;
  
  
  
  static int
 -current_message_1 (a1, a2, a3, a4)
 -     EMACS_INT a1;
 -     Lisp_Object a2;
 -     EMACS_INT a3, a4;
 +current_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
  {
    Lisp_Object *msg = (Lisp_Object *) a1;
  
     worth optimizing.  */
  
  int
 -push_message ()
 +push_message (void)
  {
    Lisp_Object msg;
    msg = current_message ();
  /* Restore message display from the top of Vmessage_stack.  */
  
  void
 -restore_message ()
 +restore_message (void)
  {
    Lisp_Object msg;
  
  /* Handler for record_unwind_protect calling pop_message.  */
  
  Lisp_Object
 -pop_message_unwind (dummy)
 -     Lisp_Object dummy;
 +pop_message_unwind (Lisp_Object dummy)
  {
    pop_message ();
    return Qnil;
  /* Pop the top-most entry off Vmessage_stack.  */
  
  void
 -pop_message ()
 +pop_message (void)
  {
    xassert (CONSP (Vmessage_stack));
    Vmessage_stack = XCDR (Vmessage_stack);
     somewhere.  */
  
  void
 -check_message_stack ()
 +check_message_stack (void)
  {
    if (!NILP (Vmessage_stack))
      abort ();
     time we display it---but don't redisplay it now.  */
  
  void
 -truncate_echo_area (nchars)
 -     int nchars;
 +truncate_echo_area (EMACS_INT nchars)
  {
    if (nchars == 0)
      echo_area_buffer[0] = Qnil;
     message to at most NCHARS characters.  */
  
  static int
 -truncate_message_1 (nchars, a2, a3, a4)
 -     EMACS_INT nchars;
 -     Lisp_Object a2;
 -     EMACS_INT a3, a4;
 +truncate_message_1 (EMACS_INT nchars, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
  {
    if (BEG + nchars < Z)
      del_range (BEG + nchars, Z);
    */
  
  void
 -set_message (s, string, nbytes, multibyte_p)
 -     const char *s;
 -     Lisp_Object string;
 -     int nbytes, multibyte_p;
 +set_message (const char *s, Lisp_Object string,
 +           EMACS_INT nbytes, int multibyte_p)
  {
    message_enable_multibyte
      = ((s && multibyte_p)
     current.  */
  
  static int
 -set_message_1 (a1, a2, nbytes, multibyte_p)
 -     EMACS_INT a1;
 -     Lisp_Object a2;
 -     EMACS_INT nbytes, multibyte_p;
 +set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multibyte_p)
  {
    const char *s = (const char *) a1;
 +  const unsigned char *msg = (const unsigned char *) s;
    Lisp_Object string = a2;
  
    /* Change multibyteness of the echo buffer appropriately.  */
    if (message_enable_multibyte
 -      != !NILP (current_buffer->enable_multibyte_characters))
 +      != !NILP (B_ (current_buffer, enable_multibyte_characters)))
      Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil);
  
 -  current_buffer->truncate_lines = message_truncate_lines ? Qt : Qnil;
 +  B_ (current_buffer, truncate_lines) = message_truncate_lines ? Qt : Qnil;
 +  if (!NILP (B_ (current_buffer, bidi_display_reordering)))
 +    B_ (current_buffer, bidi_paragraph_direction) = Qleft_to_right;
  
    /* Insert new message at BEG.  */
    TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
  
    if (STRINGP (string))
      {
 -      int nchars;
 +      EMACS_INT nchars;
  
        if (nbytes == 0)
        nbytes = SBYTES (string);
        if (nbytes == 0)
        nbytes = strlen (s);
  
 -      if (multibyte_p && NILP (current_buffer->enable_multibyte_characters))
 +      if (multibyte_p && NILP (B_ (current_buffer, enable_multibyte_characters)))
        {
          /* Convert from multi-byte to single-byte.  */
 -        int i, c, n;
 -        unsigned char work[1];
 +        EMACS_INT i;
 +        int c, n;
 +        char work[1];
  
          /* Convert a multibyte string to single-byte.  */
          for (i = 0; i < nbytes; i += n)
            {
 -            c = string_char_and_length (s + i, &n);
 +            c = string_char_and_length (msg + i, &n);
              work[0] = (ASCII_CHAR_P (c)
                         ? c
                         : multibyte_char_to_unibyte (c, Qnil));
            }
        }
        else if (!multibyte_p
 -             && !NILP (current_buffer->enable_multibyte_characters))
 +             && !NILP (B_ (current_buffer, enable_multibyte_characters)))
        {
          /* Convert from single-byte to multi-byte.  */
 -        int i, c, n;
 -        const unsigned char *msg = (const unsigned char *) s;
 +        EMACS_INT i;
 +        int c, n;
          unsigned char str[MAX_MULTIBYTE_LENGTH];
  
          /* Convert a single-byte string to multibyte.  */
              c = msg[i];
              MAKE_CHAR_MULTIBYTE (c);
              n = CHAR_STRING (c, str);
 -            insert_1_both (str, 1, n, 1, 0, 0);
 +            insert_1_both ((char *) str, 1, n, 1, 0, 0);
            }
        }
        else
     last displayed.  */
  
  void
 -clear_message (current_p, last_displayed_p)
 -     int current_p, last_displayed_p;
 +clear_message (int current_p, int last_displayed_p)
  {
    if (current_p)
      {
     and ensure a complete redisplay of all windows.  */
  
  static void
 -clear_garbaged_frames ()
 +clear_garbaged_frames (void)
  {
    if (frame_garbaged)
      {
     mini-windows height has been changed.  */
  
  static int
 -echo_area_display (update_frame_p)
 -     int update_frame_p;
 +echo_area_display (int update_frame_p)
  {
    Lisp_Object mini_window;
    struct window *w;
@@@ -9488,7 -9288,8 +9488,7 @@@ format_mode_line_unwind_data (struct bu
  }
  
  static Lisp_Object
 -unwind_format_mode_line (vector)
 -     Lisp_Object vector;
 +unwind_format_mode_line (Lisp_Object vector)
  {
    mode_line_target = XINT (AREF (vector, 0));
    mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1));
     Re-allocate mode_line_noprop_buf if necessary.  */
  
  static void
 -#ifdef PROTOTYPES
  store_mode_line_noprop_char (char c)
 -#else
 -store_mode_line_noprop_char (c)
 -    char c;
 -#endif
  {
    /* If output position has reached the end of the allocated buffer,
       double the buffer's size.  */
  
  
  /* Store part of a frame title in mode_line_noprop_buf, beginning at
 -   mode_line_noprop_ptr.  STR is the string to store.  Do not copy
 +   mode_line_noprop_ptr.  STRING is the string to store.  Do not copy
     characters that yield more columns than PRECISION; PRECISION <= 0
     means copy the whole string.  Pad with spaces until FIELD_WIDTH
     number of characters have been copied; FIELD_WIDTH <= 0 means don't
     frame title.  */
  
  static int
 -store_mode_line_noprop (str, field_width, precision)
 -     const unsigned char *str;
 -     int field_width, precision;
 +store_mode_line_noprop (const char *string, int field_width, int precision)
  {
 +  const unsigned char *str = (const unsigned char *) string;
    int n = 0;
 -  int dummy, nbytes;
 +  EMACS_INT dummy, nbytes;
  
    /* Copy at most PRECISION chars from STR.  */
 -  nbytes = strlen (str);
 +  nbytes = strlen (string);
    n += c_string_width (str, nbytes, precision, &dummy, &nbytes);
    while (nbytes--)
      store_mode_line_noprop_char (*str++);
     frame_title_format.  */
  
  static void
 -x_consider_frame_title (frame)
 -     Lisp_Object frame;
 +x_consider_frame_title (Lisp_Object frame)
  {
    struct frame *f = XFRAME (frame);
  
         higher level than this.)  */
        if (! STRINGP (f->name)
          || SBYTES (f->name) != len
 -        || bcmp (title, SDATA (f->name), len) != 0)
 +        || memcmp (title, SDATA (f->name), len) != 0)
        x_implicitly_set_name (f, make_string (title, len), Qnil);
      }
  }
     appropriate.  This can call eval.  */
  
  void
 -prepare_menu_bars ()
 +prepare_menu_bars (void)
  {
    int all_windows;
    struct gcpro gcpro1, gcpro2;
        update_tool_bar (sf, 1);
  #endif
      }
 -
 -  /* Motif needs this.  See comment in xmenu.c.  Turn it off when
 -     pending_menu_activation is not defined.  */
 -#ifdef USE_X_TOOLKIT
 -  pending_menu_activation = 0;
 -#endif
  }
  
  
     updated value of this flag, to pass to the next call.  */
  
  static int
 -update_menu_bar (f, save_match_data, hooks_run)
 -     struct frame *f;
 -     int save_match_data;
 -     int hooks_run;
 +update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
  {
    Lisp_Object window;
    register struct window *w;
               < BUF_MODIFF (XBUFFER (w->buffer)))
              != !NILP (w->last_had_star))
          || ((!NILP (Vtransient_mark_mode)
 -             && !NILP (XBUFFER (w->buffer)->mark_active))
 +             && !NILP (B_ (XBUFFER (w->buffer), mark_active)))
              != !NILP (w->region_showing)))
        {
          struct buffer *prev = current_buffer;
@@@ -9894,7 -9711,8 +9894,7 @@@ struct cursor_pos output_cursor
     positions are relative to updated_window.  */
  
  void
 -set_output_cursor (cursor)
 -    struct cursor_pos *cursor;
 +set_output_cursor (struct cursor_pos *cursor)
  {
    output_cursor.hpos = cursor->hpos;
    output_cursor.vpos = cursor->vpos;
     selected_window and display the cursor at the given position.  */
  
  void
 -x_cursor_to (vpos, hpos, y, x)
 -     int vpos, hpos, y, x;
 +x_cursor_to (int vpos, int hpos, int y, int x)
  {
    struct window *w;
  
@@@ -9963,7 -9782,8 +9963,7 @@@ int last_tool_bar_item
  
  
  static Lisp_Object
 -update_tool_bar_unwind (frame)
 -     Lisp_Object frame;
 +update_tool_bar_unwind (Lisp_Object frame)
  {
    selected_frame = frame;
    return Qnil;
     and restore it here.  */
  
  static void
 -update_tool_bar (f, save_match_data)
 -     struct frame *f;
 -     int save_match_data;
 +update_tool_bar (struct frame *f, int save_match_data)
  {
  #if defined (USE_GTK) || defined (HAVE_NS)
    int do_update = FRAME_EXTERNAL_TOOL_BAR (f);
               < BUF_MODIFF (XBUFFER (w->buffer)))
              != !NILP (w->last_had_star))
          || ((!NILP (Vtransient_mark_mode)
 -             && !NILP (XBUFFER (w->buffer)->mark_active))
 +             && !NILP (B_ (XBUFFER (w->buffer), mark_active)))
              != !NILP (w->region_showing)))
        {
          struct buffer *prev = current_buffer;
     been set up previously by calling prepare_menu_bars.  */
  
  static void
 -build_desired_tool_bar_string (f)
 -     struct frame *f;
 +build_desired_tool_bar_string (struct frame *f)
  {
    int i, size, size_needed;
    struct gcpro gcpro1, gcpro2, gcpro3;
        int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P));
        int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P));
        int hmargin, vmargin, relief, idx, end;
 -      extern Lisp_Object QCrelief, QCmargin, QCconversion;
  
        /* If image is a vector, choose the image according to the
         button state.  */
  */
  
  static void
 -display_tool_bar_line (it, height)
 -     struct it *it;
 -     int height;
 +display_tool_bar_line (struct it *it, int height)
  {
    struct glyph_row *row = it->glyph_row;
    int max_x = it->last_visible_x;
              row->used[TEXT_AREA] = n_glyphs_before;
              *it = it_before;
              /* If this is the only glyph on this line, it will never fit on the
 -               toolbar, so skip it.  But ensure there is at least one glyph,
 +               tool-bar, so skip it.  But ensure there is at least one glyph,
                 so we don't accidentally disable the tool-bar.  */
              if (n_glyphs_before == 0
                  && (it->vpos > 0 || IT_STRING_CHARPOS (*it) < it->end_charpos-1))
     returned in *N_ROWS if non-NULL.  */
  
  static int
 -tool_bar_lines_needed (f, n_rows)
 -     struct frame *f;
 -     int *n_rows;
 +tool_bar_lines_needed (struct frame *f, int *n_rows)
  {
    struct window *w = XWINDOW (f->tool_bar_window);
    struct it it;
  DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
         0, 1, 0,
         doc: /* Return the number of lines occupied by the tool bar of FRAME.  */)
 -     (frame)
 -     Lisp_Object frame;
 +  (Lisp_Object frame)
  {
    struct frame *f;
    struct window *w;
     height should be changed.  */
  
  static int
 -redisplay_tool_bar (f)
 -     struct frame *f;
 +redisplay_tool_bar (struct frame *f)
  {
    struct window *w;
    struct it it;
        if ((nlines = tool_bar_lines_needed (f, &f->n_tool_bar_rows),
           nlines != WINDOW_TOTAL_LINES (w)))
        {
 -        extern Lisp_Object Qtool_bar_lines;
          Lisp_Object frame;
          int old_height = WINDOW_TOTAL_LINES (w);
  
         frame parameter.  */
        if (change_height_p)
        {
 -        extern Lisp_Object Qtool_bar_lines;
          Lisp_Object frame;
          int old_height = WINDOW_TOTAL_LINES (w);
          int nrows;
     GLYPH doesn't display a tool-bar item.  */
  
  static int
 -tool_bar_item_info (f, glyph, prop_idx)
 -     struct frame *f;
 -     struct glyph *glyph;
 -     int *prop_idx;
 +tool_bar_item_info (struct frame *f, struct glyph *glyph, int *prop_idx)
  {
    Lisp_Object prop;
    int success_p;
     1  otherwise.  */
  
  static int
 -get_tool_bar_item (f, x, y, glyph, hpos, vpos, prop_idx)
 -     struct frame *f;
 -     int x, y;
 -     struct glyph **glyph;
 -     int *hpos, *vpos, *prop_idx;
 +get_tool_bar_item (struct frame *f, int x, int y, struct glyph **glyph,
 +                 int *hpos, int *vpos, int *prop_idx)
  {
 -  Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
 +  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
    struct window *w = XWINDOW (f->tool_bar_window);
    int area;
  
      return -1;
  
    /* Is mouse on the highlighted item?  */
 -  if (EQ (f->tool_bar_window, dpyinfo->mouse_face_window)
 -      && *vpos >= dpyinfo->mouse_face_beg_row
 -      && *vpos <= dpyinfo->mouse_face_end_row
 -      && (*vpos > dpyinfo->mouse_face_beg_row
 -        || *hpos >= dpyinfo->mouse_face_beg_col)
 -      && (*vpos < dpyinfo->mouse_face_end_row
 -        || *hpos < dpyinfo->mouse_face_end_col
 -        || dpyinfo->mouse_face_past_end))
 +  if (EQ (f->tool_bar_window, hlinfo->mouse_face_window)
 +      && *vpos >= hlinfo->mouse_face_beg_row
 +      && *vpos <= hlinfo->mouse_face_end_row
 +      && (*vpos > hlinfo->mouse_face_beg_row
 +        || *hpos >= hlinfo->mouse_face_beg_col)
 +      && (*vpos < hlinfo->mouse_face_end_row
 +        || *hpos < hlinfo->mouse_face_end_col
 +        || hlinfo->mouse_face_past_end))
      return 0;
  
    return 1;
     release.  */
  
  void
 -handle_tool_bar_click (f, x, y, down_p, modifiers)
 -     struct frame *f;
 -     int x, y, down_p;
 -     unsigned int modifiers;
 +handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
 +                     unsigned int modifiers)
  {
 -  Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
 +  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
    struct window *w = XWINDOW (f->tool_bar_window);
    int hpos, vpos, prop_idx;
    struct glyph *glyph;
    if (down_p)
      {
        /* Show item in pressed state.  */
 -      show_mouse_face (dpyinfo, DRAW_IMAGE_SUNKEN);
 -      dpyinfo->mouse_face_image_state = DRAW_IMAGE_SUNKEN;
 +      show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN);
 +      hlinfo->mouse_face_image_state = DRAW_IMAGE_SUNKEN;
        last_tool_bar_item = prop_idx;
      }
    else
        EVENT_INIT (event);
  
        /* Show item in released state.  */
 -      show_mouse_face (dpyinfo, DRAW_IMAGE_RAISED);
 -      dpyinfo->mouse_face_image_state = DRAW_IMAGE_RAISED;
 +      show_mouse_face (hlinfo, DRAW_IMAGE_RAISED);
 +      hlinfo->mouse_face_image_state = DRAW_IMAGE_RAISED;
  
        key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY);
  
     note_mouse_highlight.  */
  
  static void
 -note_tool_bar_highlight (f, x, y)
 -     struct frame *f;
 -     int x, y;
 +note_tool_bar_highlight (struct frame *f, int x, int y)
  {
    Lisp_Object window = f->tool_bar_window;
    struct window *w = XWINDOW (window);
    Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
 +  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
    int hpos, vpos;
    struct glyph *glyph;
    struct glyph_row *row;
    enum draw_glyphs_face draw = DRAW_IMAGE_RAISED;
    int mouse_down_p, rc;
  
 -  /* Function note_mouse_highlight is called with negative x(y
 +  /* Function note_mouse_highlight is called with negative X/Y
       values when mouse moves outside of the frame.  */
    if (x <= 0 || y <= 0)
      {
 -      clear_mouse_face (dpyinfo);
 +      clear_mouse_face (hlinfo);
        return;
      }
  
    if (rc < 0)
      {
        /* Not on tool-bar item.  */
 -      clear_mouse_face (dpyinfo);
 +      clear_mouse_face (hlinfo);
        return;
      }
    else if (rc == 0)
      /* On same tool-bar item as before.  */
      goto set_help_echo;
  
 -  clear_mouse_face (dpyinfo);
 +  clear_mouse_face (hlinfo);
  
    /* Mouse is down, but on different tool-bar item?  */
    mouse_down_p = (dpyinfo->grabbed
        && last_tool_bar_item != prop_idx)
      return;
  
 -  dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT;
 +  hlinfo->mouse_face_image_state = DRAW_NORMAL_TEXT;
    draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
  
    /* If tool-bar item is not enabled, don't highlight it.  */
        x += row->glyphs[TEXT_AREA][i].pixel_width;
  
        /* Record this as the current active region.  */
 -      dpyinfo->mouse_face_beg_col = hpos;
 -      dpyinfo->mouse_face_beg_row = vpos;
 -      dpyinfo->mouse_face_beg_x = x;
 -      dpyinfo->mouse_face_beg_y = row->y;
 -      dpyinfo->mouse_face_past_end = 0;
 -
 -      dpyinfo->mouse_face_end_col = hpos + 1;
 -      dpyinfo->mouse_face_end_row = vpos;
 -      dpyinfo->mouse_face_end_x = x + glyph->pixel_width;
 -      dpyinfo->mouse_face_end_y = row->y;
 -      dpyinfo->mouse_face_window = window;
 -      dpyinfo->mouse_face_face_id = TOOL_BAR_FACE_ID;
 +      hlinfo->mouse_face_beg_col = hpos;
 +      hlinfo->mouse_face_beg_row = vpos;
 +      hlinfo->mouse_face_beg_x = x;
 +      hlinfo->mouse_face_beg_y = row->y;
 +      hlinfo->mouse_face_past_end = 0;
 +
 +      hlinfo->mouse_face_end_col = hpos + 1;
 +      hlinfo->mouse_face_end_row = vpos;
 +      hlinfo->mouse_face_end_x = x + glyph->pixel_width;
 +      hlinfo->mouse_face_end_y = row->y;
 +      hlinfo->mouse_face_window = window;
 +      hlinfo->mouse_face_face_id = TOOL_BAR_FACE_ID;
  
        /* Display it as active.  */
 -      show_mouse_face (dpyinfo, draw);
 -      dpyinfo->mouse_face_image_state = draw;
 +      show_mouse_face (hlinfo, draw);
 +      hlinfo->mouse_face_image_state = draw;
      }
  
   set_help_echo:
                         Horizontal scrolling
   ************************************************************************/
  
 -static int hscroll_window_tree P_ ((Lisp_Object));
 -static int hscroll_windows P_ ((Lisp_Object));
 +static int hscroll_window_tree (Lisp_Object);
 +static int hscroll_windows (Lisp_Object);
  
  /* For all leaf windows in the window tree rooted at WINDOW, set their
     hscroll value so that PT is (i) visible in the window, and (ii) so
     changed.  */
  
  static int
 -hscroll_window_tree (window)
 -     Lisp_Object window;
 +hscroll_window_tree (Lisp_Object window)
  {
    int hscrolled_p = 0;
    int hscroll_relative_p = FLOATP (Vhscroll_step);
              struct it it;
              int hscroll;
              struct buffer *saved_current_buffer;
 -            int pt;
 +            EMACS_INT pt;
              int wanted_x;
  
              /* Find point in a display of infinite width.  */
     of WINDOW are cleared.  */
  
  static int
 -hscroll_windows (window)
 -     Lisp_Object window;
 +hscroll_windows (Lisp_Object window)
  {
    int hscrolled_p = hscroll_window_tree (window);
    if (hscrolled_p)
@@@ -11023,12 -10866,12 +11023,12 @@@ int debug_dvpos, debug_dy
  
  /* Delta in characters and bytes for try_window_id.  */
  
 -int debug_delta, debug_delta_bytes;
 +EMACS_INT debug_delta, debug_delta_bytes;
  
  /* Values of window_end_pos and window_end_vpos at the end of
     try_window_id.  */
  
 -EMACS_INT debug_end_pos, debug_end_vpos;
 +EMACS_INT debug_end_vpos;
  
  /* Append a string to W->desired_matrix->method.  FMT is a printf
     format string.  A1...A9 are a supplement for a variable-length
@@@ -11061,7 -10904,7 +11061,7 @@@ debug_method_add (w, fmt, a1, a2, a3, a
             w,
             ((BUFFERP (w->buffer)
               && STRINGP (XBUFFER (w->buffer)->name))
 -            ? (char *) SDATA (XBUFFER (w->buffer)->name)
 +            ? SSDATA (XBUFFER (w->buffer)->name)
              : "no buffer"),
             buffer);
  }
     redisplay_internal for display optimization.  */
  
  static INLINE int
 -text_outside_line_unchanged_p (w, start, end)
 -     struct window *w;
 -     int start, end;
 +text_outside_line_unchanged_p (struct window *w,
 +                             EMACS_INT start, EMACS_INT end)
  {
    int unchanged_p = 1;
  
        /* If selective display, can't optimize if changes start at the
         beginning of the line.  */
        if (unchanged_p
 -        && INTEGERP (current_buffer->selective_display)
 -        && XINT (current_buffer->selective_display) > 0
 +        && INTEGERP (B_ (current_buffer, selective_display))
 +        && XINT (B_ (current_buffer, selective_display)) > 0
          && (BEG_UNCHANGED < start || GPT <= start))
        unchanged_p = 0;
  
              && overlay_touches_p (Z - end))
            unchanged_p = 0;
        }
 +
 +      /* Under bidi reordering, adding or deleting a character in the
 +       beginning of a paragraph, before the first strong directional
 +       character, can change the base direction of the paragraph (unless
 +       the buffer specifies a fixed paragraph direction), which will
 +       require to redisplay the whole paragraph.  It might be worthwhile
 +       to find the paragraph limits and widen the range of redisplayed
 +       lines to that, but for now just give up this optimization.  */
 +      if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))
 +        && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction)))
 +      unchanged_p = 0;
      }
  
    return unchanged_p;
     mini-buffer if that is in use.  */
  
  void
 -redisplay ()
 +redisplay (void)
  {
    redisplay_internal (0);
  }
  
  
  static Lisp_Object
 -overlay_arrow_string_or_property (var)
 -     Lisp_Object var;
 +overlay_arrow_string_or_property (Lisp_Object var)
  {
    Lisp_Object val;
  
  
  /* Return 1 if there are any overlay-arrows in current_buffer.  */
  static int
 -overlay_arrow_in_current_buffer_p ()
 +overlay_arrow_in_current_buffer_p (void)
  {
    Lisp_Object vlist;
  
     has changed.  */
  
  static int
 -overlay_arrows_changed_p ()
 +overlay_arrows_changed_p (void)
  {
    Lisp_Object vlist;
  
  /* Mark overlay arrows to be updated on next redisplay.  */
  
  static void
 -update_overlay_arrows (up_to_date)
 -     int up_to_date;
 +update_overlay_arrows (int up_to_date)
  {
    Lisp_Object vlist;
  
     Return nil if no overlay arrow.  */
  
  static Lisp_Object
 -overlay_arrow_at_row (it, row)
 -     struct it *it;
 -     struct glyph_row *row;
 +overlay_arrow_at_row (struct it *it, struct glyph_row *row)
  {
    Lisp_Object vlist;
  
          && (MATRIX_ROW_START_CHARPOS (row) == marker_position (val)))
        {
          if (FRAME_WINDOW_P (it->f)
 +            /* FIXME: if ROW->reversed_p is set, this should test
 +               the right fringe, not the left one.  */
              && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0)
            {
  #ifdef HAVE_WINDOW_SYSTEM
     position.  BUF and PT are the current point buffer and position.  */
  
  int
 -check_point_in_composition (prev_buf, prev_pt, buf, pt)
 -     struct buffer *prev_buf, *buf;
 -     int prev_pt, pt;
 +check_point_in_composition (struct buffer *prev_buf, EMACS_INT prev_pt,
 +                          struct buffer *buf, EMACS_INT pt)
  {
    EMACS_INT start, end;
    Lisp_Object prop;
     in window W.  */
  
  static INLINE void
 -reconsider_clip_changes (w, b)
 -     struct window *w;
 -     struct buffer *b;
 +reconsider_clip_changes (struct window *w, struct buffer *b)
  {
    if (b->clip_changed
           && !NILP (w->window_end_valid)
    if (!b->clip_changed
        && BUFFERP (w->buffer) && !NILP (w->window_end_valid))
      {
 -      int pt;
 +      EMACS_INT pt;
  
        if (w == XWINDOW (selected_window))
        pt = BUF_PT (current_buffer);
     directly.  */
  
  static void
 -select_frame_for_redisplay (frame)
 -     Lisp_Object frame;
 +select_frame_for_redisplay (Lisp_Object frame)
  {
 -  Lisp_Object tail, symbol, val;
 +  Lisp_Object tail, tem;
    Lisp_Object old = selected_frame;
    struct Lisp_Symbol *sym;
  
  
    selected_frame = frame;
  
 -  do
 -    {
 -      for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail))
 -      if (CONSP (XCAR (tail))
 -          && (symbol = XCAR (XCAR (tail)),
 -              SYMBOLP (symbol))
 -          && (sym = indirect_variable (XSYMBOL (symbol)),
 -              val = sym->value,
 -              (BUFFER_LOCAL_VALUEP (val)))
 -          && XBUFFER_LOCAL_VALUE (val)->check_frame)
 -        /* Use find_symbol_value rather than Fsymbol_value
 -           to avoid an error if it is void.  */
 -        find_symbol_value (symbol);
 -    } while (!EQ (frame, old) && (frame = old, 1));
 +  do {
 +    for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail))
 +      if (CONSP (XCAR (tail))
 +        && (tem = XCAR (XCAR (tail)),
 +            SYMBOLP (tem))
 +        && (sym = indirect_variable (XSYMBOL (tem)),
 +            sym->redirect == SYMBOL_LOCALIZED)
 +        && sym->val.blv->frame_local)
 +      /* Use find_symbol_value rather than Fsymbol_value
 +         to avoid an error if it is void.  */
 +      find_symbol_value (tem);
 +  } while (!EQ (frame, old) && (frame = old, 1));
  }
  
  
@@@ -11416,9 -11257,11 +11416,10 @@@ do { if (polling_stopped_here) start_po
     causes some problems.  */
  
  static void
 -redisplay_internal (preserve_echo_area)
 -     int preserve_echo_area;
 +redisplay_internal (int preserve_echo_area)
  {
    struct window *w = XWINDOW (selected_window);
+   struct window *sw;
    struct frame *f;
    int pause;
    int must_finish = 0;
    if (!f->glyphs_initialized_p)
      return;
  
 -  /* The flag redisplay_performed_directly_p is set by
 -     direct_output_for_insert when it already did the whole screen
 -     update necessary.  */
 -  if (redisplay_performed_directly_p)
 -    {
 -      redisplay_performed_directly_p = 0;
 -      if (!hscroll_windows (selected_window))
 -      return;
 -    }
 -
  #if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS)
    if (popup_activated ())
      return;
    }
  
   retry:
+   /* Remember the currently selected window.  */
+   sw = w;
    if (!EQ (old_frame, selected_frame)
        && FRAME_LIVE_P (XFRAME (old_frame)))
      /* When running redisplay, we play a bit fast-and-loose and allow e.g.
    reconsider_clip_changes (w, current_buffer);
    last_escape_glyph_frame = NULL;
    last_escape_glyph_face_id = (1 << FACE_ID_BITS);
 +  last_glyphless_glyph_frame = NULL;
 +  last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
  
    /* If new fonts have been loaded that make a glyph matrix adjustment
       necessary, do it.  */
    /* Notice any pending interrupt request to change frame size.  */
    do_pending_window_change (1);
  
+   /* do_pending_window_change could change the selected_window due to
+      frame resizing which makes the selected window too small.  */
+   if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw)
+     {
+       sw = w;
+       reconsider_clip_changes (w, current_buffer);
+     }
    /* Clear frames marked as garbaged.  */
    if (frame_garbaged)
      clear_garbaged_frames ();
       the whole window.  The assignment to this_line_start_pos prevents
       the optimization directly below this if-statement.  */
    if (((!NILP (Vtransient_mark_mode)
 -      && !NILP (XBUFFER (w->buffer)->mark_active))
 +      && !NILP (B_ (XBUFFER (w->buffer), mark_active)))
         != !NILP (w->region_showing))
        || (!NILP (w->region_showing)
          && !EQ (w->region_showing,
 -                Fmarker_position (XBUFFER (w->buffer)->mark))))
 +                Fmarker_position (B_ (XBUFFER (w->buffer), mark)))))
      CHARPOS (this_line_start_pos) = 0;
  
    /* Optimize the case that only the line containing the cursor in the
                {
                  struct glyph_row *row
                    = MATRIX_ROW (w->current_matrix, this_line_vpos + 1);
 -                int delta, delta_bytes;
 +                EMACS_INT delta, delta_bytes;
  
                  /* We used to distinguish between two cases here,
                     conditioned by Z - CHARPOS (tlendpos) == ZV, for
          if (!must_finish)
            {
              do_pending_window_change (1);
+             /* If selected_window changed, redisplay again.  */
+             if (WINDOWP (selected_window)
+                 && (w = XWINDOW (selected_window)) != sw)
+               goto retry;
  
              /* We used to always goto end_of_redisplay here, but this
                 isn't enough if we have a blinking cursor.  */
        /* If highlighting the region, or if the cursor is in the echo area,
         then we can't just move the cursor.  */
        else if (! (!NILP (Vtransient_mark_mode)
 -                && !NILP (current_buffer->mark_active))
 -             && (EQ (selected_window, current_buffer->last_selected_window)
 +                && !NILP (B_ (current_buffer, mark_active)))
 +             && (EQ (selected_window, B_ (current_buffer, last_selected_window))
                   || highlight_nonselected_windows)
               && NILP (w->region_showing)
               && NILP (Vshow_trailing_whitespace)
    do_pending_window_change (1);
  
    /* If we just did a pending size change, or have additional
-      visible frames, redisplay again.  */
-   if (windows_or_buffers_changed && !pause)
+      visible frames, or selected_window changed, redisplay again.  */
+   if ((windows_or_buffers_changed && !pause)
+       || (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw))
      goto retry;
  
 -  /* Clear the face cache eventually.  */
 -  if (consider_all_windows_p)
 +  /* Clear the face and image caches.
 +
 +     We used to do this only if consider_all_windows_p.  But the cache
 +     needs to be cleared if a timer creates images in the current
 +     buffer (e.g. the test case in Bug#6230).  */
 +
 +  if (clear_face_cache_count > CLEAR_FACE_CACHE_COUNT)
      {
 -      if (clear_face_cache_count > CLEAR_FACE_CACHE_COUNT)
 -      {
 -        clear_face_cache (0);
 -        clear_face_cache_count = 0;
 -      }
 +      clear_face_cache (0);
 +      clear_face_cache_count = 0;
 +    }
 +
  #ifdef HAVE_WINDOW_SYSTEM
 -      if (clear_image_cache_count > CLEAR_IMAGE_CACHE_COUNT)
 -      {
 -        clear_image_caches (Qnil);
 -        clear_image_cache_count = 0;
 -      }
 -#endif /* HAVE_WINDOW_SYSTEM */
 +  if (clear_image_cache_count > CLEAR_IMAGE_CACHE_COUNT)
 +    {
 +      clear_image_caches (Qnil);
 +      clear_image_cache_count = 0;
      }
 +#endif /* HAVE_WINDOW_SYSTEM */
  
   end_of_redisplay:
    unbind_to (count, Qnil);
     called.  This is useful for debugging.  */
  
  void
 -redisplay_preserve_echo_area (from_where)
 -     int from_where;
 +redisplay_preserve_echo_area (int from_where)
  {
    TRACE ((stderr, "redisplay_preserve_echo_area (%d)\n", from_where));
  
     failure during redisplay, for example).  */
  
  static Lisp_Object
 -unwind_redisplay (val)
 -     Lisp_Object val;
 +unwind_redisplay (Lisp_Object val)
  {
    Lisp_Object old_redisplaying_p, old_frame;
  
     redisplay_internal is called.  */
  
  static void
 -mark_window_display_accurate_1 (w, accurate_p)
 -     struct window *w;
 -     int accurate_p;
 +mark_window_display_accurate_1 (struct window *w, int accurate_p)
  {
    if (BUFFERP (w->buffer))
      {
     be redisplayed the next time redisplay_internal is called.  */
  
  void
 -mark_window_display_accurate (window, accurate_p)
 -     Lisp_Object window;
 -     int accurate_p;
 +mark_window_display_accurate (Lisp_Object window, int accurate_p)
  {
    struct window *w;
  
     macro DISP_CHAR_VECTOR.  */
  
  Lisp_Object
 -disp_char_vector (dp, c)
 -     struct Lisp_Char_Table *dp;
 -     int c;
 +disp_char_vector (struct Lisp_Char_Table *dp, int c)
  {
    Lisp_Object val;
  
  /* Redisplay all leaf windows in the window tree rooted at WINDOW.  */
  
  static void
 -redisplay_windows (window)
 -     Lisp_Object window;
 +redisplay_windows (Lisp_Object window)
  {
    while (!NILP (window))
      {
  }
  
  static Lisp_Object
 -redisplay_window_error ()
 +redisplay_window_error (Lisp_Object ignore)
  {
    displayed_buffer->display_error_modiff = BUF_MODIFF (displayed_buffer);
    return Qnil;
  }
  
  static Lisp_Object
 -redisplay_window_0 (window)
 -     Lisp_Object window;
 +redisplay_window_0 (Lisp_Object window)
  {
    if (displayed_buffer->display_error_modiff < BUF_MODIFF (displayed_buffer))
      redisplay_window (window, 0);
  }
  
  static Lisp_Object
 -redisplay_window_1 (window)
 -     Lisp_Object window;
 +redisplay_window_1 (Lisp_Object window)
  {
    if (displayed_buffer->display_error_modiff < BUF_MODIFF (displayed_buffer))
      redisplay_window (window, 1);
     Return 0 if cursor is not on this row, 1 otherwise.  */
  
  int
 -set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
 -     struct window *w;
 -     struct glyph_row *row;
 -     struct glyph_matrix *matrix;
 -     int delta, delta_bytes, dy, dvpos;
 +set_cursor_from_row (struct window *w, struct glyph_row *row,
 +                   struct glyph_matrix *matrix,
 +                   EMACS_INT delta, EMACS_INT delta_bytes,
 +                   int dy, int dvpos)
  {
    struct glyph *glyph = row->glyphs[TEXT_AREA];
    struct glyph *end = glyph + row->used[TEXT_AREA];
    struct glyph *cursor = NULL;
 -  /* The first glyph that starts a sequence of glyphs from a string
 -     that is a value of a display property.  */
 -  struct glyph *string_start;
 -  /* The X coordinate of string_start.  */
 -  int string_start_x;
    /* The last known character position in row.  */
 -  int last_pos = MATRIX_ROW_START_CHARPOS (row) + delta;
 -  /* The last known character position before string_start.  */
 -  int string_before_pos;
 +  EMACS_INT last_pos = MATRIX_ROW_START_CHARPOS (row) + delta;
    int x = row->x;
 -  int cursor_x = x;
 -  /* Last buffer position covered by an overlay.  */
 -  int cursor_from_overlay_pos = 0;
 -  int pt_old = PT - delta;
 -
 -  /* Skip over glyphs not having an object at the start of the row.
 -     These are special glyphs like truncation marks on terminal
 -     frames.  */
 +  EMACS_INT pt_old = PT - delta;
 +  EMACS_INT pos_before = MATRIX_ROW_START_CHARPOS (row) + delta;
 +  EMACS_INT pos_after = MATRIX_ROW_END_CHARPOS (row) + delta;
 +  struct glyph *glyph_before = glyph - 1, *glyph_after = end;
 +  /* A glyph beyond the edge of TEXT_AREA which we should never
 +     touch.  */
 +  struct glyph *glyphs_end = end;
 +  /* Non-zero means we've found a match for cursor position, but that
 +     glyph has the avoid_cursor_p flag set.  */
 +  int match_with_avoid_cursor = 0;
 +  /* Non-zero means we've seen at least one glyph that came from a
 +     display string.  */
 +  int string_seen = 0;
 +  /* Largest and smalles buffer positions seen so far during scan of
 +     glyph row.  */
 +  EMACS_INT bpos_max = pos_before;
 +  EMACS_INT bpos_min = pos_after;
 +  /* Last buffer position covered by an overlay string with an integer
 +     `cursor' property.  */
 +  EMACS_INT bpos_covered = 0;
 +
 +  /* Skip over glyphs not having an object at the start and the end of
 +     the row.  These are special glyphs like truncation marks on
 +     terminal frames.  */
    if (row->displays_text_p)
 -    while (glyph < end
 -         && INTEGERP (glyph->object)
 -         && glyph->charpos < 0)
 -      {
 -      x += glyph->pixel_width;
 -      ++glyph;
 -      }
 -
 -  string_start = NULL;
 -  while (glyph < end
 -       && !INTEGERP (glyph->object)
 -       && (!BUFFERP (glyph->object)
 -           || (last_pos = glyph->charpos) < pt_old
 -           || glyph->avoid_cursor_p))
      {
 -      if (! STRINGP (glyph->object))
 -      {
 -        string_start = NULL;
 -        x += glyph->pixel_width;
 -        ++glyph;
 -        /* If we are beyond the cursor position computed from the
 -           last overlay seen, that overlay is not in effect for
 -           current cursor position.  Reset the cursor information
 -           computed from that overlay.  */
 -        if (cursor_from_overlay_pos
 -            && last_pos >= cursor_from_overlay_pos)
 -          {
 -            cursor_from_overlay_pos = 0;
 -            cursor = NULL;
 -          }
 -      }
 -      else
 +      if (!row->reversed_p)
        {
 -        if (string_start == NULL)
 +        while (glyph < end
 +               && INTEGERP (glyph->object)
 +               && glyph->charpos < 0)
            {
 -            string_before_pos = last_pos;
 -            string_start = glyph;
 -            string_start_x = x;
 -          }
 -        /* Skip all glyphs from a string.  */
 -        do
 -          {
 -            Lisp_Object cprop;
 -            int pos;
 -            if ((cursor == NULL || glyph > cursor)
 -                && (cprop = Fget_char_property (make_number ((glyph)->charpos),
 -                                                Qcursor, (glyph)->object),
 -                    !NILP (cprop))
 -                && (pos = string_buffer_position (w, glyph->object,
 -                                                  string_before_pos),
 -                    (pos == 0   /* from overlay */
 -                     || pos == pt_old)))
 -              {
 -                /* Compute the first buffer position after the overlay.
 -                   If the `cursor' property tells us how  many positions
 -                   are associated with the overlay, use that.  Otherwise,
 -                   estimate from the buffer positions of the glyphs
 -                   before and after the overlay.  */
 -                cursor_from_overlay_pos = (pos ? 0 : last_pos
 -                                           + (INTEGERP (cprop) ? XINT (cprop) : 0));
 -                cursor = glyph;
 -                cursor_x = x;
 -              }
              x += glyph->pixel_width;
              ++glyph;
            }
 -        while (glyph < end && EQ (glyph->object, string_start->object));
 +        while (end > glyph
 +               && INTEGERP ((end - 1)->object)
 +               /* CHARPOS is zero for blanks and stretch glyphs
 +                  inserted by extend_face_to_end_of_line.  */
 +               && (end - 1)->charpos <= 0)
 +          --end;
 +        glyph_before = glyph - 1;
 +        glyph_after = end;
        }
 -    }
 -
 -  if (cursor != NULL)
 -    {
 -      glyph = cursor;
 -      x = cursor_x;
 -    }
 -  else if (row->ends_in_ellipsis_p && glyph == end)
 -    {
 -      /* Scan back over the ellipsis glyphs, decrementing positions.  */
 -      while (glyph > row->glyphs[TEXT_AREA]
 -           && (glyph - 1)->charpos == last_pos)
 -      glyph--, x -= glyph->pixel_width;
 -      /* That loop always goes one position too far, including the
 -       glyph before the ellipsis.  So scan forward over that one.  */
 -      x += glyph->pixel_width;
 -      glyph++;
 -    }
 -  else if (string_start
 -         && (glyph == end || !BUFFERP (glyph->object) || last_pos > pt_old))
 -    {
 -      /* We may have skipped over point because the previous glyphs
 -       are from string.  As there's no easy way to know the
 -       character position of the current glyph, find the correct
 -       glyph on point by scanning from string_start again.  */
 -      Lisp_Object limit;
 -      Lisp_Object string;
 -      struct glyph *stop = glyph;
 -      int pos;
 -
 -      limit = make_number (pt_old + 1);
 -      glyph = string_start;
 -      x = string_start_x;
 -      string = glyph->object;
 -      pos = string_buffer_position (w, string, string_before_pos);
 -      /* If POS == 0, STRING is from overlay.  We skip such glyphs
 -       because we always put the cursor after overlay strings.  */
 -      while (pos == 0 && glyph < stop)
 +      else
        {
 -        string = glyph->object;
 -        SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
 -        if (glyph < stop)
 -          pos = string_buffer_position (w, glyph->object, string_before_pos);
 -      }
 +        struct glyph *g;
  
 -      while (glyph < stop)
 -      {
 -        pos = XINT (Fnext_single_char_property_change
 -                    (make_number (pos), Qdisplay, Qnil, limit));
 -        if (pos > pt_old)
 -          break;
 -        /* Skip glyphs from the same string.  */
 -        string = glyph->object;
 -        SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
 -        /* Skip glyphs from an overlay.  */
 -        while (glyph < stop
 -               && ! string_buffer_position (w, glyph->object, pos))
 +        /* If the glyph row is reversed, we need to process it from back
 +           to front, so swap the edge pointers.  */
 +        glyphs_end = end = glyph - 1;
 +        glyph += row->used[TEXT_AREA] - 1;
 +
 +        while (glyph > end + 1
 +               && INTEGERP (glyph->object)
 +               && glyph->charpos < 0)
            {
 -            string = glyph->object;
 -            SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
 +            --glyph;
 +            x -= glyph->pixel_width;
            }
 -      }
 -
 -      /* If we reached the end of the line, and END was from a string,
 -       the cursor is not on this line.  */
 -      if (glyph == end && row->continued_p)
 -      return 0;
 -    }
 +        if (INTEGERP (glyph->object) && glyph->charpos < 0)
 +          --glyph;
 +        /* By default, in reversed rows we put the cursor on the
 +           rightmost (first in the reading order) glyph.  */
 +        for (g = end + 1; g < glyph; g++)
 +          x += g->pixel_width;
 +        while (end < glyph
 +               && INTEGERP ((end + 1)->object)
 +               && (end + 1)->charpos <= 0)
 +          ++end;
 +        glyph_before = glyph + 1;
 +        glyph_after = end;
 +      }
 +    }
 +  else if (row->reversed_p)
 +    {
 +      /* In R2L rows that don't display text, put the cursor on the
 +       rightmost glyph.  Case in point: an empty last line that is
 +       part of an R2L paragraph.  */
 +      cursor = end - 1;
 +      /* Avoid placing the cursor on the last glyph of the row, where
 +       on terminal frames we hold the vertical border between
 +       adjacent windows.  */
 +      if (!FRAME_WINDOW_P (WINDOW_XFRAME (w))
 +        && !WINDOW_RIGHTMOST_P (w)
 +        && cursor == row->glyphs[LAST_AREA] - 1)
 +      cursor--;
 +      x = -1; /* will be computed below, at label compute_x */
 +    }
 +
 +  /* Step 1: Try to find the glyph whose character position
 +     corresponds to point.  If that's not possible, find 2 glyphs
 +     whose character positions are the closest to point, one before
 +     point, the other after it.  */
 +  if (!row->reversed_p)
 +    while (/* not marched to end of glyph row */
 +         glyph < end
 +         /* glyph was not inserted by redisplay for internal purposes */
 +         && !INTEGERP (glyph->object))
 +      {
 +      if (BUFFERP (glyph->object))
 +        {
 +          EMACS_INT dpos = glyph->charpos - pt_old;
  
 -  w->cursor.hpos = glyph - row->glyphs[TEXT_AREA];
 -  w->cursor.x = x;
 -  w->cursor.vpos = MATRIX_ROW_VPOS (row, matrix) + dvpos;
 -  w->cursor.y = row->y + dy;
 +          if (glyph->charpos > bpos_max)
 +            bpos_max = glyph->charpos;
 +          if (glyph->charpos < bpos_min)
 +            bpos_min = glyph->charpos;
 +          if (!glyph->avoid_cursor_p)
 +            {
 +              /* If we hit point, we've found the glyph on which to
 +                 display the cursor.  */
 +              if (dpos == 0)
 +                {
 +                  match_with_avoid_cursor = 0;
 +                  break;
 +                }
 +              /* See if we've found a better approximation to
 +                 POS_BEFORE or to POS_AFTER.  Note that we want the
 +                 first (leftmost) glyph of all those that are the
 +                 closest from below, and the last (rightmost) of all
 +                 those from above.  */
 +              if (0 > dpos && dpos > pos_before - pt_old)
 +                {
 +                  pos_before = glyph->charpos;
 +                  glyph_before = glyph;
 +                }
 +              else if (0 < dpos && dpos <= pos_after - pt_old)
 +                {
 +                  pos_after = glyph->charpos;
 +                  glyph_after = glyph;
 +                }
 +            }
 +          else if (dpos == 0)
 +            match_with_avoid_cursor = 1;
 +        }
 +      else if (STRINGP (glyph->object))
 +        {
 +          Lisp_Object chprop;
 +          EMACS_INT glyph_pos = glyph->charpos;
  
 -  if (w == XWINDOW (selected_window))
 -    {
 -      if (!row->continued_p
 -        && !MATRIX_ROW_CONTINUATION_LINE_P (row)
 -        && row->x == 0)
 -      {
 -        this_line_buffer = XBUFFER (w->buffer);
 +          chprop = Fget_char_property (make_number (glyph_pos), Qcursor,
 +                                       glyph->object);
 +          if (INTEGERP (chprop))
 +            {
 +              bpos_covered = bpos_max + XINT (chprop);
 +              /* If the `cursor' property covers buffer positions up
 +                 to and including point, we should display cursor on
 +                 this glyph.  Note that overlays and text properties
 +                 with string values stop bidi reordering, so every
 +                 buffer position to the left of the string is always
 +                 smaller than any position to the right of the
 +                 string.  Therefore, if a `cursor' property on one
 +                 of the string's characters has an integer value, we
 +                 will break out of the loop below _before_ we get to
 +                 the position match above.  IOW, integer values of
 +                 the `cursor' property override the "exact match for
 +                 point" strategy of positioning the cursor.  */
 +              /* Implementation note: bpos_max == pt_old when, e.g.,
 +                 we are in an empty line, where bpos_max is set to
 +                 MATRIX_ROW_START_CHARPOS, see above.  */
 +              if (bpos_max <= pt_old && bpos_covered >= pt_old)
 +                {
 +                  cursor = glyph;
 +                  break;
 +                }
 +            }
  
 -        CHARPOS (this_line_start_pos)
 -          = MATRIX_ROW_START_CHARPOS (row) + delta;
 -        BYTEPOS (this_line_start_pos)
 -          = MATRIX_ROW_START_BYTEPOS (row) + delta_bytes;
 +          string_seen = 1;
 +        }
 +      x += glyph->pixel_width;
 +      ++glyph;
 +      }
 +  else if (glyph > end)       /* row is reversed */
 +    while (!INTEGERP (glyph->object))
 +      {
 +      if (BUFFERP (glyph->object))
 +        {
 +          EMACS_INT dpos = glyph->charpos - pt_old;
 +
 +          if (glyph->charpos > bpos_max)
 +            bpos_max = glyph->charpos;
 +          if (glyph->charpos < bpos_min)
 +            bpos_min = glyph->charpos;
 +          if (!glyph->avoid_cursor_p)
 +            {
 +              if (dpos == 0)
 +                {
 +                  match_with_avoid_cursor = 0;
 +                  break;
 +                }
 +              if (0 > dpos && dpos > pos_before - pt_old)
 +                {
 +                  pos_before = glyph->charpos;
 +                  glyph_before = glyph;
 +                }
 +              else if (0 < dpos && dpos <= pos_after - pt_old)
 +                {
 +                  pos_after = glyph->charpos;
 +                  glyph_after = glyph;
 +                }
 +            }
 +          else if (dpos == 0)
 +            match_with_avoid_cursor = 1;
 +        }
 +      else if (STRINGP (glyph->object))
 +        {
 +          Lisp_Object chprop;
 +          EMACS_INT glyph_pos = glyph->charpos;
 +
 +          chprop = Fget_char_property (make_number (glyph_pos), Qcursor,
 +                                       glyph->object);
 +          if (INTEGERP (chprop))
 +            {
 +              bpos_covered = bpos_max + XINT (chprop);
 +              /* If the `cursor' property covers buffer positions up
 +                 to and including point, we should display cursor on
 +                 this glyph.  */
 +              if (bpos_max <= pt_old && bpos_covered >= pt_old)
 +                {
 +                  cursor = glyph;
 +                  break;
 +                }
 +            }
 +          string_seen = 1;
 +        }
 +      --glyph;
 +      if (glyph == glyphs_end) /* don't dereference outside TEXT_AREA */
 +        {
 +          x--;                /* can't use any pixel_width */
 +          break;
 +        }
 +      x -= glyph->pixel_width;
 +    }
 +
 +  /* Step 2: If we didn't find an exact match for point, we need to
 +     look for a proper place to put the cursor among glyphs between
 +     GLYPH_BEFORE and GLYPH_AFTER.  */
 +  if (!((row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)
 +      && BUFFERP (glyph->object) && glyph->charpos == pt_old)
 +      && bpos_covered < pt_old)
 +    {
 +      /* An empty line has a single glyph whose OBJECT is zero and
 +       whose CHARPOS is the position of a newline on that line.
 +       Note that on a TTY, there are more glyphs after that, which
 +       were produced by extend_face_to_end_of_line, but their
 +       CHARPOS is zero or negative.  */
 +      int empty_line_p =
 +      (row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)
 +      && INTEGERP (glyph->object) && glyph->charpos > 0;
 +
 +      if (row->ends_in_ellipsis_p && pos_after == last_pos)
 +      {
 +        EMACS_INT ellipsis_pos;
 +
 +        /* Scan back over the ellipsis glyphs.  */
 +        if (!row->reversed_p)
 +          {
 +            ellipsis_pos = (glyph - 1)->charpos;
 +            while (glyph > row->glyphs[TEXT_AREA]
 +                   && (glyph - 1)->charpos == ellipsis_pos)
 +              glyph--, x -= glyph->pixel_width;
 +            /* That loop always goes one position too far, including
 +               the glyph before the ellipsis.  So scan forward over
 +               that one.  */
 +            x += glyph->pixel_width;
 +            glyph++;
 +          }
 +        else  /* row is reversed */
 +          {
 +            ellipsis_pos = (glyph + 1)->charpos;
 +            while (glyph < row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1
 +                   && (glyph + 1)->charpos == ellipsis_pos)
 +              glyph++, x += glyph->pixel_width;
 +            x -= glyph->pixel_width;
 +            glyph--;
 +          }
 +      }
 +      else if (match_with_avoid_cursor
 +             /* A truncated row may not include PT among its
 +                character positions.  Setting the cursor inside the
 +                scroll margin will trigger recalculation of hscroll
 +                in hscroll_window_tree.  */
 +             || (row->truncated_on_left_p && pt_old < bpos_min)
 +             || (row->truncated_on_right_p && pt_old > bpos_max)
 +             /* Zero-width characters produce no glyphs.  */
 +             || (!string_seen
 +                 && !empty_line_p
 +                 && (row->reversed_p
 +                     ? glyph_after > glyphs_end
 +                     : glyph_after < glyphs_end)))
 +      {
 +        cursor = glyph_after;
 +        x = -1;
 +      }
 +      else if (string_seen)
 +      {
 +        int incr = row->reversed_p ? -1 : +1;
 +
 +        /* Need to find the glyph that came out of a string which is
 +           present at point.  That glyph is somewhere between
 +           GLYPH_BEFORE and GLYPH_AFTER, and it came from a string
 +           positioned between POS_BEFORE and POS_AFTER in the
 +           buffer.  */
 +        struct glyph *stop = glyph_after;
 +        EMACS_INT pos = pos_before;
 +
 +        x = -1;
 +        for (glyph = glyph_before + incr;
 +             row->reversed_p ? glyph > stop : glyph < stop; )
 +          {
 +
 +            /* Any glyphs that come from the buffer are here because
 +               of bidi reordering.  Skip them, and only pay
 +               attention to glyphs that came from some string.  */
 +            if (STRINGP (glyph->object))
 +              {
 +                Lisp_Object str;
 +                EMACS_INT tem;
 +
 +                str = glyph->object;
 +                tem = string_buffer_position_lim (w, str, pos, pos_after, 0);
 +                if (tem == 0  /* from overlay */
 +                    || pos <= tem)
 +                  {
 +                    /* If the string from which this glyph came is
 +                       found in the buffer at point, then we've
 +                       found the glyph we've been looking for.  If
 +                       it comes from an overlay (tem == 0), and it
 +                       has the `cursor' property on one of its
 +                       glyphs, record that glyph as a candidate for
 +                       displaying the cursor.  (As in the
 +                       unidirectional version, we will display the
 +                       cursor on the last candidate we find.)  */
 +                    if (tem == 0 || tem == pt_old)
 +                      {
 +                        /* The glyphs from this string could have
 +                           been reordered.  Find the one with the
 +                           smallest string position.  Or there could
 +                           be a character in the string with the
 +                           `cursor' property, which means display
 +                           cursor on that character's glyph.  */
 +                        EMACS_INT strpos = glyph->charpos;
 +
 +                        if (tem)
 +                          cursor = glyph;
 +                        for ( ;
 +                             (row->reversed_p ? glyph > stop : glyph < stop)
 +                               && EQ (glyph->object, str);
 +                             glyph += incr)
 +                          {
 +                            Lisp_Object cprop;
 +                            EMACS_INT gpos = glyph->charpos;
 +
 +                            cprop = Fget_char_property (make_number (gpos),
 +                                                        Qcursor,
 +                                                        glyph->object);
 +                            if (!NILP (cprop))
 +                              {
 +                                cursor = glyph;
 +                                break;
 +                              }
 +                            if (tem && glyph->charpos < strpos)
 +                              {
 +                                strpos = glyph->charpos;
 +                                cursor = glyph;
 +                              }
 +                          }
 +
 +                        if (tem == pt_old)
 +                          goto compute_x;
 +                      }
 +                    if (tem)
 +                      pos = tem + 1; /* don't find previous instances */
 +                  }
 +                /* This string is not what we want; skip all of the
 +                   glyphs that came from it.  */
 +                while ((row->reversed_p ? glyph > stop : glyph < stop)
 +                       && EQ (glyph->object, str))
 +                  glyph += incr;
 +              }
 +            else
 +              glyph += incr;
 +          }
 +
 +        /* If we reached the end of the line, and END was from a string,
 +           the cursor is not on this line.  */
 +        if (cursor == NULL
 +            && (row->reversed_p ? glyph <= end : glyph >= end)
 +            && STRINGP (end->object)
 +            && row->continued_p)
 +          return 0;
 +      }
 +    }
 +
 + compute_x:
 +  if (cursor != NULL)
 +    glyph = cursor;
 +  if (x < 0)
 +    {
 +      struct glyph *g;
 +
 +      /* Need to compute x that corresponds to GLYPH.  */
 +      for (g = row->glyphs[TEXT_AREA], x = row->x; g < glyph; g++)
 +      {
 +        if (g >= row->glyphs[TEXT_AREA] + row->used[TEXT_AREA])
 +          abort ();
 +        x += g->pixel_width;
 +      }
 +    }
 +
 +  /* ROW could be part of a continued line, which, under bidi
 +     reordering, might have other rows whose start and end charpos
 +     occlude point.  Only set w->cursor if we found a better
 +     approximation to the cursor position than we have from previously
 +     examined candidate rows belonging to the same continued line.  */
 +  if (/* we already have a candidate row */
 +      w->cursor.vpos >= 0
 +      /* that candidate is not the row we are processing */
 +      && MATRIX_ROW (matrix, w->cursor.vpos) != row
 +      /* the row we are processing is part of a continued line */
 +      && (row->continued_p || MATRIX_ROW_CONTINUATION_LINE_P (row))
 +      /* Make sure cursor.vpos specifies a row whose start and end
 +       charpos occlude point.  This is because some callers of this
 +       function leave cursor.vpos at the row where the cursor was
 +       displayed during the last redisplay cycle.  */
 +      && MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)) <= pt_old
 +      && pt_old < MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)))
 +    {
 +      struct glyph *g1 =
 +      MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos;
 +
 +      /* Don't consider glyphs that are outside TEXT_AREA.  */
 +      if (!(row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end))
 +      return 0;
 +      /* Keep the candidate whose buffer position is the closest to
 +       point.  */
 +      if (/* previous candidate is a glyph in TEXT_AREA of that row */
 +        w->cursor.hpos >= 0
 +        && w->cursor.hpos < MATRIX_ROW_USED (matrix, w->cursor.vpos)
 +        && BUFFERP (g1->object)
 +        && (g1->charpos == pt_old /* an exact match always wins */
 +            || (BUFFERP (glyph->object)
 +                && eabs (g1->charpos - pt_old)
 +                 < eabs (glyph->charpos - pt_old))))
 +      return 0;
 +      /* If this candidate gives an exact match, use that.  */
 +      if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old)
 +        /* Otherwise, keep the candidate that comes from a row
 +           spanning less buffer positions.  This may win when one or
 +           both candidate positions are on glyphs that came from
 +           display strings, for which we cannot compare buffer
 +           positions.  */
 +        && MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))
 +           - MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))
 +           < MATRIX_ROW_END_CHARPOS (row) - MATRIX_ROW_START_CHARPOS (row))
 +      return 0;
 +    }
 +  w->cursor.hpos = glyph - row->glyphs[TEXT_AREA];
 +  w->cursor.x = x;
 +  w->cursor.vpos = MATRIX_ROW_VPOS (row, matrix) + dvpos;
 +  w->cursor.y = row->y + dy;
 +
 +  if (w == XWINDOW (selected_window))
 +    {
 +      if (!row->continued_p
 +        && !MATRIX_ROW_CONTINUATION_LINE_P (row)
 +        && row->x == 0)
 +      {
 +        this_line_buffer = XBUFFER (w->buffer);
 +
 +        CHARPOS (this_line_start_pos)
 +          = MATRIX_ROW_START_CHARPOS (row) + delta;
 +        BYTEPOS (this_line_start_pos)
 +          = MATRIX_ROW_START_BYTEPOS (row) + delta_bytes;
  
          CHARPOS (this_line_end_pos)
            = Z - (MATRIX_ROW_END_CHARPOS (row) + delta);
     We assume that the window's buffer is really current.  */
  
  static INLINE struct text_pos
 -run_window_scroll_functions (window, startp)
 -     Lisp_Object window;
 -     struct text_pos startp;
 +run_window_scroll_functions (Lisp_Object window, struct text_pos startp)
  {
    struct window *w = XWINDOW (window);
    SET_MARKER_FROM_TEXT_POS (w->start, startp);
     as if point had gone off the screen.  */
  
  static int
 -cursor_row_fully_visible_p (w, force_p, current_matrix_p)
 -     struct window *w;
 -     int force_p;
 -     int current_matrix_p;
 +cursor_row_fully_visible_p (struct window *w, int force_p, int current_matrix_p)
  {
    struct glyph_matrix *matrix;
    struct glyph_row *row;
  
  /* Try scrolling PT into view in window WINDOW.  JUST_THIS_ONE_P
     non-zero means only WINDOW is redisplayed in redisplay_internal.
 -   TEMP_SCROLL_STEP has the same meaning as scroll_step, and is used
 +   TEMP_SCROLL_STEP has the same meaning as emacs_scroll_step, and is used
     in redisplay_window to bring a partially visible line into view in
     the case that only the cursor has moved.
  
  };
  
  static int
 -try_scrolling (window, just_this_one_p, scroll_conservatively,
 -             scroll_step, temp_scroll_step, last_line_misfit)
 -     Lisp_Object window;
 -     int just_this_one_p;
 -     EMACS_INT scroll_conservatively, scroll_step;
 -     int temp_scroll_step;
 -     int last_line_misfit;
 +try_scrolling (Lisp_Object window, int just_this_one_p,
 +             EMACS_INT arg_scroll_conservatively, EMACS_INT scroll_step,
 +             int temp_scroll_step, int last_line_misfit)
  {
    struct window *w = XWINDOW (window);
    struct frame *f = XFRAME (w->frame);
    else
      this_scroll_margin = 0;
  
 -  /* Force scroll_conservatively to have a reasonable value, to avoid
 +  /* Force arg_scroll_conservatively to have a reasonable value, to avoid
       overflow while computing how much to scroll.  Note that the user
       can supply scroll-conservatively equal to `most-positive-fixnum',
       which can be larger than INT_MAX.  */
 -  if (scroll_conservatively > scroll_limit)
 +  if (arg_scroll_conservatively > scroll_limit)
      {
 -      scroll_conservatively = scroll_limit;
 +      arg_scroll_conservatively = scroll_limit;
        scroll_max = INT_MAX;
      }
 -  else if (scroll_step || scroll_conservatively || temp_scroll_step)
 +  else if (scroll_step || arg_scroll_conservatively || temp_scroll_step)
      /* Compute how much we should try to scroll maximally to bring
         point into view.  */
      scroll_max = (max (scroll_step,
 -                     max (scroll_conservatively, temp_scroll_step))
 +                     max (arg_scroll_conservatively, temp_scroll_step))
                  * FRAME_LINE_HEIGHT (f));
 -  else if (NUMBERP (current_buffer->scroll_down_aggressively)
 -         || NUMBERP (current_buffer->scroll_up_aggressively))
 +  else if (NUMBERP (B_ (current_buffer, scroll_down_aggressively))
 +         || NUMBERP (B_ (current_buffer, scroll_up_aggressively)))
      /* We're trying to scroll because of aggressive scrolling but no
         scroll_step is set.  Choose an arbitrary one.  */
      scroll_max = 10 * FRAME_LINE_HEIGHT (f);
        if (PT > CHARPOS (it.current.pos))
        {
          int y0 = line_bottom_y (&it);
 -
 -        /* Compute the distance from the scroll margin to PT
 -           (including the height of the cursor line).  Moving the
 -           iterator unconditionally to PT can be slow if PT is far
 -           away, so stop 10 lines past the window bottom (is there a
 -           way to do the right thing quickly?).  */
 -        move_it_to (&it, PT, -1,
 -                    it.last_visible_y + 10 * FRAME_LINE_HEIGHT (f),
 +        /* Compute how many pixels below window bottom to stop searching
 +           for PT.  This avoids costly search for PT that is far away if
 +           the user limited scrolling by a small number of lines, but
 +           always finds PT if arg_scroll_conservatively is set to a large
 +           number, such as most-positive-fixnum.  */
 +        int slack = max (scroll_max, 10 * FRAME_LINE_HEIGHT (f));
 +        int y_to_move =
 +          slack >= INT_MAX - it.last_visible_y
 +          ? INT_MAX
 +          : it.last_visible_y + slack;
 +
 +        /* Compute the distance from the scroll margin to PT or to
 +           the scroll limit, whichever comes first.  This should
 +           include the height of the cursor line, to make that line
 +           fully visible.  */
 +        move_it_to (&it, PT, -1, y_to_move,
                      -1, MOVE_TO_POS | MOVE_TO_Y);
          dy = line_bottom_y (&it) - y0;
  
         window start down.  If scrolling conservatively, move it just
         enough down to make point visible.  If scroll_step is set,
         move it down by scroll_step.  */
 -      if (scroll_conservatively)
 +      if (arg_scroll_conservatively)
        amount_to_scroll
          = min (max (dy, FRAME_LINE_HEIGHT (f)),
 -               FRAME_LINE_HEIGHT (f) * scroll_conservatively);
 +               FRAME_LINE_HEIGHT (f) * arg_scroll_conservatively);
        else if (scroll_step || temp_scroll_step)
        amount_to_scroll = scroll_max;
        else
        {
 -        aggressive = current_buffer->scroll_up_aggressively;
 +        aggressive = B_ (current_buffer, scroll_up_aggressively);
          height = WINDOW_BOX_TEXT_HEIGHT (w);
          if (NUMBERP (aggressive))
            {
        return SCROLLING_FAILED;
  
        start_display (&it, w, startp);
 -      move_it_vertically (&it, amount_to_scroll);
 +      if (scroll_max < INT_MAX)
 +      move_it_vertically (&it, amount_to_scroll);
 +      else
 +      {
 +        /* Extra precision for users who set scroll-conservatively
 +           to most-positive-fixnum: make sure the amount we scroll
 +           the window start is never less than amount_to_scroll,
 +           which was computed as distance from window bottom to
 +           point.  This matters when lines at window top and lines
 +           below window bottom have different height.  */
 +        struct it it1 = it;
 +        /* We use a temporary it1 because line_bottom_y can modify
 +           its argument, if it moves one line down; see there.  */
 +        int start_y = line_bottom_y (&it1);
 +
 +        do {
 +          move_it_by_lines (&it, 1, 1);
 +          it1 = it;
 +        } while (line_bottom_y (&it1) - start_y < amount_to_scroll);
 +      }
  
        /* If STARTP is unchanged, move it down another screen line.  */
        if (CHARPOS (it.current.pos) == CHARPOS (startp))
          /* Compute new window start.  */
          start_display (&it, w, startp);
  
 -        if (scroll_conservatively)
 +        if (arg_scroll_conservatively)
            amount_to_scroll
              = max (dy, FRAME_LINE_HEIGHT (f) * max (scroll_step, temp_scroll_step));
          else if (scroll_step || temp_scroll_step)
            amount_to_scroll = scroll_max;
          else
            {
 -            aggressive = current_buffer->scroll_down_aggressively;
 +            aggressive = B_ (current_buffer, scroll_down_aggressively);
              height = WINDOW_BOX_TEXT_HEIGHT (w);
              if (NUMBERP (aggressive))
                {
     screen line with the minimum distance from the old start W->start.  */
  
  static int
 -compute_window_start_on_continuation_line (w)
 -     struct window *w;
 +compute_window_start_on_continuation_line (struct window *w)
  {
    struct text_pos pos, start_pos;
    int window_start_changed_p = 0;
  };
  
  static int
 -try_cursor_movement (window, startp, scroll_step)
 -     Lisp_Object window;
 -     struct text_pos startp;
 -     int *scroll_step;
 +try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_step)
  {
    struct window *w = XWINDOW (window);
    struct frame *f = XFRAME (w->frame);
           region exists, cursor movement has to do more than just
           set the cursor.  */
        && !(!NILP (Vtransient_mark_mode)
 -         && !NILP (current_buffer->mark_active))
 +         && !NILP (B_ (current_buffer, mark_active)))
        && NILP (w->region_showing)
        && NILP (Vshow_trailing_whitespace)
        /* Right after splitting windows, last_point may be nil.  */
  
        if (rc == CURSOR_MOVEMENT_CANNOT_BE_USED)
        {
 -        int scroll_p = 0;
 +        int scroll_p = 0, must_scroll = 0;
          int last_y = window_text_bottom_y (w) - this_scroll_margin;
  
          if (PT > XFASTINT (w->last_point))
                  ++row;
                }
  
 -            /* The end position of a row equals the start position
 -               of the next row.  If PT is there, we would rather
 -               display it in the next line.  */
 +            /* If the end position of a row equals the start
 +               position of the next row, and PT is at that position,
 +               we would rather display cursor in the next line.  */
              while (MATRIX_ROW_BOTTOM_Y (row) < last_y
                     && MATRIX_ROW_END_CHARPOS (row) == PT
 +                   && row < w->current_matrix->rows
 +                              + w->current_matrix->nrows - 1
 +                   && MATRIX_ROW_START_CHARPOS (row+1) == PT
                     && !cursor_row_p (w, row))
                ++row;
  
            {
              /* if PT is not in the glyph row, give up.  */
              rc = CURSOR_MOVEMENT_MUST_SCROLL;
 +            must_scroll = 1;
            }
          else if (rc != CURSOR_MOVEMENT_SUCCESS
 -                 && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
 -                 && make_cursor_line_fully_visible_p)
 +                 && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)))
 +          {
 +            /* If rows are bidi-reordered and point moved, back up
 +               until we find a row that does not belong to a
 +               continuation line.  This is because we must consider
 +               all rows of a continued line as candidates for the
 +               new cursor positioning, since row start and end
 +               positions change non-linearly with vertical position
 +               in such rows.  */
 +            /* FIXME: Revisit this when glyph ``spilling'' in
 +               continuation lines' rows is implemented for
 +               bidi-reordered rows.  */
 +            while (MATRIX_ROW_CONTINUATION_LINE_P (row))
 +              {
 +                xassert (row->enabled_p);
 +                --row;
 +                /* If we hit the beginning of the displayed portion
 +                   without finding the first row of a continued
 +                   line, give up.  */
 +                if (row <= w->current_matrix->rows)
 +                  {
 +                    rc = CURSOR_MOVEMENT_MUST_SCROLL;
 +                    break;
 +                  }
 +
 +              }
 +          }
 +        if (must_scroll)
 +          ;
 +        else if (rc != CURSOR_MOVEMENT_SUCCESS
 +            && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
 +            && make_cursor_line_fully_visible_p)
            {
              if (PT == MATRIX_ROW_END_CHARPOS (row)
                  && !row->ends_at_zv_p
            }
          else if (scroll_p)
            rc = CURSOR_MOVEMENT_MUST_SCROLL;
 +        else if (rc != CURSOR_MOVEMENT_SUCCESS
 +                 && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)))
 +          {
 +            /* With bidi-reordered rows, there could be more than
 +               one candidate row whose start and end positions
 +               occlude point.  We need to let set_cursor_from_row
 +               find the best candidate.  */
 +            /* FIXME: Revisit this when glyph ``spilling'' in
 +               continuation lines' rows is implemented for
 +               bidi-reordered rows.  */
 +            int rv = 0;
 +
 +            do
 +              {
 +                if (MATRIX_ROW_START_CHARPOS (row) <= PT
 +                    && PT <= MATRIX_ROW_END_CHARPOS (row)
 +                    && cursor_row_p (w, row))
 +                  rv |= set_cursor_from_row (w, row, w->current_matrix,
 +                                             0, 0, 0, 0);
 +                /* As soon as we've found the first suitable row
 +                   whose ends_at_zv_p flag is set, we are done.  */
 +                if (rv
 +                    && MATRIX_ROW (w->current_matrix, w->cursor.vpos)->ends_at_zv_p)
 +                  {
 +                    rc = CURSOR_MOVEMENT_SUCCESS;
 +                    break;
 +                  }
 +                ++row;
 +              }
 +            while ((MATRIX_ROW_CONTINUATION_LINE_P (row)
 +                    && MATRIX_ROW_BOTTOM_Y (row) <= last_y)
 +                   || (MATRIX_ROW_START_CHARPOS (row) == PT
 +                       && MATRIX_ROW_BOTTOM_Y (row) < last_y));
 +            /* If we didn't find any candidate rows, or exited the
 +               loop before all the candidates were examined, signal
 +               to the caller that this method failed.  */
 +            if (rc != CURSOR_MOVEMENT_SUCCESS
 +                && (!rv || MATRIX_ROW_CONTINUATION_LINE_P (row)))
 +              rc = CURSOR_MOVEMENT_MUST_SCROLL;
 +            else if (rv)
 +              rc = CURSOR_MOVEMENT_SUCCESS;
 +          }
          else
            {
              do
  }
  
  void
 -set_vertical_scroll_bar (w)
 -     struct window *w;
 +set_vertical_scroll_bar (struct window *w)
  {
 -  int start, end, whole;
 +  EMACS_INT start, end, whole;
  
    /* Calculate the start and end positions for the current window.
       At some point, it would be nice to choose between scrollbars
     retry.  */
  
  static void
 -redisplay_window (window, just_this_one_p)
 -     Lisp_Object window;
 -     int just_this_one_p;
 +redisplay_window (Lisp_Object window, int just_this_one_p)
  {
    struct window *w = XWINDOW (window);
    struct frame *f = XFRAME (w->frame);
    int rc;
    int centering_position = -1;
    int last_line_misfit = 0;
 -  int beg_unchanged, end_unchanged;
 +  EMACS_INT beg_unchanged, end_unchanged;
  
    SET_TEXT_POS (lpoint, PT, PT_BYTE);
    opoint = lpoint;
       window, set up appropriate value.  */
    if (!EQ (window, selected_window))
      {
 -      int new_pt = XMARKER (w->pointm)->charpos;
 -      int new_pt_byte = marker_byte_position (w->pointm);
 +      EMACS_INT new_pt = XMARKER (w->pointm)->charpos;
 +      EMACS_INT new_pt_byte = marker_byte_position (w->pointm);
        if (new_pt < BEGV)
        {
          new_pt = BEGV;
        struct Lisp_Char_Table *disptab = buffer_display_table ();
  
        if (! disptab_matches_widthtab (disptab,
 -                                      XVECTOR (current_buffer->width_table)))
 +                                      XVECTOR (B_ (current_buffer, width_table))))
          {
            invalidate_region_cache (current_buffer,
                                     current_buffer->width_run_cache,
          /* If we are highlighting the region, then we just changed
             the region, so redisplay to show it.  */
          if (!NILP (Vtransient_mark_mode)
 -            && !NILP (current_buffer->mark_active))
 +            && !NILP (B_ (current_buffer, mark_active)))
            {
              clear_glyph_matrix (w->desired_matrix);
              if (!try_window (window, startp, 0))
  
    /* Try to scroll by specified few lines.  */
    if ((scroll_conservatively
 -       || scroll_step
 +       || emacs_scroll_step
         || temp_scroll_step
 -       || NUMBERP (current_buffer->scroll_up_aggressively)
 -       || NUMBERP (current_buffer->scroll_down_aggressively))
 +       || NUMBERP (B_ (current_buffer, scroll_up_aggressively))
 +       || NUMBERP (B_ (current_buffer, scroll_down_aggressively)))
        && !current_buffer->clip_changed
        && CHARPOS (startp) >= BEGV
        && CHARPOS (startp) <= ZV)
         successful, 0 if not successful.  */
        int rc = try_scrolling (window, just_this_one_p,
                              scroll_conservatively,
 -                            scroll_step,
 +                            emacs_scroll_step,
                              temp_scroll_step, last_line_misfit);
        switch (rc)
        {
  
            if (redisplay_tool_bar_p && redisplay_tool_bar (f))
            {
 -            extern int ignore_mouse_drag_p;
              ignore_mouse_drag_p = 1;
            }
          }
     set in FLAGS.)  */
  
  int
 -try_window (window, pos, flags)
 -     Lisp_Object window;
 -     struct text_pos pos;
 -     int flags;
 +try_window (Lisp_Object window, struct text_pos pos, int flags)
  {
    struct window *w = XWINDOW (window);
    struct it it;
     W->start is the new window start.  */
  
  static int
 -try_window_reusing_current_matrix (w)
 -     struct window *w;
 +try_window_reusing_current_matrix (struct window *w)
  {
    struct frame *f = XFRAME (w->frame);
    struct glyph_row *row, *bottom_row;
  
    /* Can't do this if region may have changed.  */
    if ((!NILP (Vtransient_mark_mode)
 -       && !NILP (current_buffer->mark_active))
 +       && !NILP (B_ (current_buffer, mark_active)))
        || !NILP (w->region_showing)
        || !NILP (Vshow_trailing_whitespace))
      return 0;
    /* The variable new_start now holds the new window start.  The old
       start `start' can be determined from the current matrix.  */
    SET_TEXT_POS_FROM_MARKER (new_start, w->start);
 -  start = start_row->start.pos;
 +  start = start_row->minpos;
    start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix);
  
    /* Clear the desired matrix for the display below.  */
            {
              /* Advance to the next row as the "start".  */
              start_row++;
 -            start = start_row->start.pos;
 +            start = start_row->minpos;
              /* If there are no more rows to try, or just one, give up.  */
              if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1
                  || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)
              struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
              struct glyph *end = glyph + row->used[TEXT_AREA];
  
 -            for (; glyph < end
 -                   && (!BUFFERP (glyph->object)
 -                       || glyph->charpos < PT);
 -                 glyph++)
 +            /* Can't use this optimization with bidi-reordered glyph
 +               rows, unless cursor is already at point. */
 +            if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)))
                {
 -                w->cursor.hpos++;
 -                w->cursor.x += glyph->pixel_width;
 +                if (!(w->cursor.hpos >= 0
 +                      && w->cursor.hpos < row->used[TEXT_AREA]
 +                      && BUFFERP (glyph->object)
 +                      && glyph->charpos == PT))
 +                  return 0;
                }
 +            else
 +              for (; glyph < end
 +                     && (!BUFFERP (glyph->object)
 +                         || glyph->charpos < PT);
 +                   glyph++)
 +                {
 +                  w->cursor.hpos++;
 +                  w->cursor.x += glyph->pixel_width;
 +                }
            }
        }
  
     Window redisplay reusing current matrix when buffer has changed
   ************************************************************************/
  
 -static struct glyph_row *find_last_unchanged_at_beg_row P_ ((struct window *));
 -static struct glyph_row *find_first_unchanged_at_end_row P_ ((struct window *,
 -                                                           int *, int *));
 +static struct glyph_row *find_last_unchanged_at_beg_row (struct window *);
 +static struct glyph_row *find_first_unchanged_at_end_row (struct window *,
 +                                                          EMACS_INT *, EMACS_INT *);
  static struct glyph_row *
 -find_last_row_displaying_text P_ ((struct glyph_matrix *, struct it *,
 -                                 struct glyph_row *));
 +find_last_row_displaying_text (struct glyph_matrix *, struct it *,
 +                               struct glyph_row *);
  
  
  /* Return the last row in MATRIX displaying text.  If row START is
     a pointer to the row found.  */
  
  static struct glyph_row *
 -find_last_row_displaying_text (matrix, it, start)
 -     struct glyph_matrix *matrix;
 -     struct it *it;
 -     struct glyph_row *start;
 +find_last_row_displaying_text (struct glyph_matrix *matrix, struct it *it,
 +                             struct glyph_row *start)
  {
    struct glyph_row *row, *row_found;
  
     when the current matrix was built.  */
  
  static struct glyph_row *
 -find_last_unchanged_at_beg_row (w)
 -     struct window *w;
 +find_last_unchanged_at_beg_row (struct window *w)
  {
 -  int first_changed_pos = BEG + BEG_UNCHANGED;
 +  EMACS_INT first_changed_pos = BEG + BEG_UNCHANGED;
    struct glyph_row *row;
    struct glyph_row *row_found = NULL;
    int yb = window_text_bottom_y (w);
     changes.  */
  
  static struct glyph_row *
 -find_first_unchanged_at_end_row (w, delta, delta_bytes)
 -     struct window *w;
 -     int *delta, *delta_bytes;
 +find_first_unchanged_at_end_row (struct window *w,
 +                               EMACS_INT *delta, EMACS_INT *delta_bytes)
  {
    struct glyph_row *row;
    struct glyph_row *row_found = NULL;
         corresponds to window_end_pos.  This allows us to translate
         buffer positions in the current matrix to current buffer
         positions for characters not in changed text.  */
 -      int Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos);
 -      int Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
 -      int last_unchanged_pos, last_unchanged_pos_old;
 +      EMACS_INT Z_old =
 +      MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos);
 +      EMACS_INT Z_BYTE_old =
 +      MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
 +      EMACS_INT last_unchanged_pos, last_unchanged_pos_old;
        struct glyph_row *first_text_row
        = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
  
     try_window_reusing_current_matrix.  */
  
  static void
 -sync_frame_with_window_matrix_rows (w)
 -     struct window *w;
 +sync_frame_with_window_matrix_rows (struct window *w)
  {
    struct frame *f = XFRAME (w->frame);
    struct glyph_row *window_row, *window_row_end, *frame_row;
     containing CHARPOS or null.  */
  
  struct glyph_row *
 -row_containing_pos (w, charpos, start, end, dy)
 -     struct window *w;
 -     int charpos;
 -     struct glyph_row *start, *end;
 -     int dy;
 +row_containing_pos (struct window *w, EMACS_INT charpos,
 +                  struct glyph_row *start, struct glyph_row *end, int dy)
  {
    struct glyph_row *row = start;
 +  struct glyph_row *best_row = NULL;
 +  EMACS_INT mindif = BUF_ZV (XBUFFER (w->buffer)) + 1;
    int last_y;
  
    /* If we happen to start on a header-line, skip that.  */
                 && !row->ends_at_zv_p
                 && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)))
          && charpos >= MATRIX_ROW_START_CHARPOS (row))
 -      return row;
 +      {
 +        struct glyph *g;
 +
 +        if (NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))
 +            || (!best_row && !row->continued_p))
 +          return row;
 +        /* In bidi-reordered rows, there could be several rows
 +           occluding point, all of them belonging to the same
 +           continued line.  We need to find the row which fits
 +           CHARPOS the best.  */
 +        for (g = row->glyphs[TEXT_AREA];
 +             g < row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
 +             g++)
 +          {
 +            if (!STRINGP (g->object))
 +              {
 +                if (g->charpos > 0 && eabs (g->charpos - charpos) < mindif)
 +                  {
 +                    mindif = eabs (g->charpos - charpos);
 +                    best_row = row;
 +                    /* Exact match always wins.  */
 +                    if (mindif == 0)
 +                      return best_row;
 +                  }
 +              }
 +          }
 +      }
 +      else if (best_row && !row->continued_p)
 +      return best_row;
        ++row;
      }
  }
     7. Update W's window end information.  */
  
  static int
 -try_window_id (w)
 -     struct window *w;
 +try_window_id (struct window *w)
  {
    struct frame *f = XFRAME (w->frame);
    struct glyph_matrix *current_matrix = w->current_matrix;
    struct glyph_row *bottom_row;
    int bottom_vpos;
    struct it it;
 -  int delta = 0, delta_bytes = 0, stop_pos, dvpos, dy;
 +  EMACS_INT delta = 0, delta_bytes = 0, stop_pos;
 +  int dvpos, dy;
    struct text_pos start_pos;
    struct run run;
    int first_unchanged_at_end_vpos = 0;
    struct glyph_row *last_text_row, *last_text_row_at_end;
    struct text_pos start;
 -  int first_changed_charpos, last_changed_charpos;
 +  EMACS_INT first_changed_charpos, last_changed_charpos;
  
  #if GLYPH_DEBUG
    if (inhibit_try_window_id)
    /* Can't use this if highlighting a region because a cursor movement
       will do more than just set the cursor.  */
    if (!NILP (Vtransient_mark_mode)
 -      && !NILP (current_buffer->mark_active))
 +      && !NILP (B_ (current_buffer, mark_active)))
      GIVE_UP (9);
  
    /* Likewise if highlighting trailing whitespace.  */
       wrapped line can change the wrap position, altering the line
       above it.  It might be worthwhile to handle this more
       intelligently, but for now just redisplay from scratch.  */
 -  if (!NILP (XBUFFER (w->buffer)->word_wrap))
 +  if (!NILP (B_ (XBUFFER (w->buffer), word_wrap)))
      GIVE_UP (21);
  
 +  /* Under bidi reordering, adding or deleting a character in the
 +     beginning of a paragraph, before the first strong directional
 +     character, can change the base direction of the paragraph (unless
 +     the buffer specifies a fixed paragraph direction), which will
 +     require to redisplay the whole paragraph.  It might be worthwhile
 +     to find the paragraph limits and widen the range of redisplayed
 +     lines to that, but for now just give up this optimization and
 +     redisplay from scratch.  */
 +  if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))
 +      && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction)))
 +    GIVE_UP (22);
 +
    /* Make sure beg_unchanged and end_unchanged are up to date.  Do it
       only if buffer has really changed.  The reason is that the gap is
       initially at Z for freshly visited files.  The code below would
          || (last_changed_charpos < CHARPOS (start) - 1
              && FETCH_BYTE (BYTEPOS (start) - 1) == '\n')))
      {
 -      int Z_old, delta, Z_BYTE_old, delta_bytes;
 +      EMACS_INT Z_old, delta, Z_BYTE_old, delta_bytes;
        struct glyph_row *r0;
  
        /* Compute how many chars/bytes have been added to or removed
         as is, without changing glyph positions since no text has
         been added/removed in front of the window end.  */
        r0 = MATRIX_FIRST_TEXT_ROW (current_matrix);
 -      if (TEXT_POS_EQUAL_P (start, r0->start.pos)
 +      if (TEXT_POS_EQUAL_P (start, r0->minpos)
          /* PT must not be in a partially visible line.  */
          && !(PT >= MATRIX_ROW_START_CHARPOS (row)
               && MATRIX_ROW_BOTTOM_Y (row) > window_text_bottom_y (w)))
        {
          /* We have to compute the window end anew since text
 -           can have been added/removed after it.  */
 +           could have been added/removed after it.  */
          w->window_end_pos
            = make_number (Z - MATRIX_ROW_END_CHARPOS (row));
          w->window_end_bytepos
       start is not in changed text, otherwise positions would not be
       comparable.  */
    row = MATRIX_FIRST_TEXT_ROW (current_matrix);
 -  if (!TEXT_POS_EQUAL_P (start, row->start.pos))
 +  if (!TEXT_POS_EQUAL_P (start, row->minpos))
      GIVE_UP (16);
  
    /* Give up if the window ends in strings.  Overlay strings
                     + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0)
                     + window_internal_height (w));
  
 +#if defined (HAVE_GPM) || defined (MSDOS)
 +        x_clear_window_mouse_face (w);
 +#endif
          /* Perform the operation on the screen.  */
          if (dvpos > 0)
            {
  
  #if GLYPH_DEBUG
  
 -void dump_glyph_row P_ ((struct glyph_row *, int, int));
 -void dump_glyph_matrix P_ ((struct glyph_matrix *, int));
 -void dump_glyph P_ ((struct glyph_row *, struct glyph *, int));
 +void dump_glyph_row (struct glyph_row *, int, int);
 +void dump_glyph_matrix (struct glyph_matrix *, int);
 +void dump_glyph (struct glyph_row *, struct glyph *, int);
  
  
  /* Dump the contents of glyph matrix MATRIX on stderr.
@@@ -16176,7 -15615,7 +16193,7 @@@ dump_glyph (row, glyph, area
        if (glyph->u.cmp.automatic)
        fprintf (stderr,
                 "[%d-%d]",
 -               glyph->u.cmp.from, glyph->u.cmp.to);
 +               glyph->slice.cmp.from, glyph->slice.cmp.to);
        fprintf (stderr, " . %4d %1.1d%1.1d\n",
               glyph->face_id,
               glyph->left_box_line_p,
@@@ -16288,7 -15727,8 +16305,7 @@@ DEFUN ("dump-glyph-matrix", Fdump_glyph
  Shows contents of glyph row structures.  With non-nil
  parameter GLYPHS, dump glyphs as well.  If GLYPHS is 1 show
  glyphs in short form, otherwise show glyphs in long form.  */)
 -     (glyphs)
 -     Lisp_Object glyphs;
 +  (Lisp_Object glyphs)
  {
    struct window *w = XWINDOW (selected_window);
    struct buffer *buffer = XBUFFER (w->buffer);
  
  DEFUN ("dump-frame-glyph-matrix", Fdump_frame_glyph_matrix,
         Sdump_frame_glyph_matrix, 0, 0, "", doc: /* */)
 -     ()
 +  (void)
  {
    struct frame *f = XFRAME (selected_frame);
    dump_glyph_matrix (f->current_matrix, 1);
@@@ -16319,7 -15759,8 +16336,7 @@@ DEFUN ("dump-glyph-row", Fdump_glyph_ro
  GLYPH 0 means don't dump glyphs.
  GLYPH 1 means dump glyphs in short form.
  GLYPH > 1 or omitted means dump glyphs in long form.  */)
 -     (row, glyphs)
 -     Lisp_Object row, glyphs;
 +  (Lisp_Object row, Lisp_Object glyphs)
  {
    struct glyph_matrix *matrix;
    int vpos;
@@@ -16340,7 -15781,8 +16357,7 @@@ DEFUN ("dump-tool-bar-row", Fdump_tool_
  GLYPH 0 means don't dump glyphs.
  GLYPH 1 means dump glyphs in short form.
  GLYPH > 1 or omitted means dump glyphs in long form.  */)
 -     (row, glyphs)
 -     Lisp_Object row, glyphs;
 +  (Lisp_Object row, Lisp_Object glyphs)
  {
    struct frame *sf = SELECTED_FRAME ();
    struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix;
  DEFUN ("trace-redisplay", Ftrace_redisplay, Strace_redisplay, 0, 1, "P",
         doc: /* Toggle tracing of redisplay.
  With ARG, turn tracing on if and only if ARG is positive.  */)
 -     (arg)
 -     Lisp_Object arg;
 +  (Lisp_Object arg)
  {
    if (NILP (arg))
      trace_redisplay_p = !trace_redisplay_p;
  DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strace_to_stderr, 1, MANY, "",
         doc: /* Like `format', but print result to stderr.
  usage: (trace-to-stderr STRING &rest OBJECTS)  */)
 -     (nargs, args)
 -     int nargs;
 -     Lisp_Object *args;
 +  (int nargs, Lisp_Object *args)
  {
    Lisp_Object s = Fformat (nargs, args);
    fprintf (stderr, "%s", SDATA (s));
     Used for non-window-redisplay windows, and for windows w/o left fringe.  */
  
  static struct glyph_row *
 -get_overlay_arrow_glyph_row (w, overlay_arrow_string)
 -     struct window *w;
 -     Lisp_Object overlay_arrow_string;
 +get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string)
  {
    struct frame *f = XFRAME (WINDOW_FRAME (w));
    struct buffer *buffer = XBUFFER (w->buffer);
    it.glyph_row->used[TEXT_AREA] = 0;
    SET_TEXT_POS (it.position, 0, 0);
  
 -  multibyte_p = !NILP (buffer->enable_multibyte_characters);
 +  multibyte_p = !NILP (B_ (buffer, enable_multibyte_characters));
    p = arrow_string;
    while (p < arrow_end)
      {
     produce_special_glyphs.  */
  
  static void
 -insert_left_trunc_glyphs (it)
 -     struct it *it;
 +insert_left_trunc_glyphs (struct it *it)
  {
    struct it truncate_it;
    struct glyph *from, *end, *to, *toend;
    produce_special_glyphs (&truncate_it, IT_TRUNCATION);
  
    /* Overwrite glyphs from IT with truncation glyphs.  */
 -  from = truncate_it.glyph_row->glyphs[TEXT_AREA];
 -  end = from + truncate_it.glyph_row->used[TEXT_AREA];
 -  to = it->glyph_row->glyphs[TEXT_AREA];
 -  toend = to + it->glyph_row->used[TEXT_AREA];
 -
 -  while (from < end)
 -    *to++ = *from++;
 -
 -  /* There may be padding glyphs left over.  Overwrite them too.  */
 -  while (to < toend && CHAR_GLYPH_PADDING_P (*to))
 +  if (!it->glyph_row->reversed_p)
      {
        from = truncate_it.glyph_row->glyphs[TEXT_AREA];
 +      end = from + truncate_it.glyph_row->used[TEXT_AREA];
 +      to = it->glyph_row->glyphs[TEXT_AREA];
 +      toend = to + it->glyph_row->used[TEXT_AREA];
 +
        while (from < end)
        *to++ = *from++;
 +
 +      /* There may be padding glyphs left over.  Overwrite them too.  */
 +      while (to < toend && CHAR_GLYPH_PADDING_P (*to))
 +      {
 +        from = truncate_it.glyph_row->glyphs[TEXT_AREA];
 +        while (from < end)
 +          *to++ = *from++;
 +      }
 +
 +      if (to > toend)
 +      it->glyph_row->used[TEXT_AREA] = to - it->glyph_row->glyphs[TEXT_AREA];
      }
 +  else
 +    {
 +      /* In R2L rows, overwrite the last (rightmost) glyphs, and do
 +       that back to front.  */
 +      end = truncate_it.glyph_row->glyphs[TEXT_AREA];
 +      from = end + truncate_it.glyph_row->used[TEXT_AREA] - 1;
 +      toend = it->glyph_row->glyphs[TEXT_AREA];
 +      to = toend + it->glyph_row->used[TEXT_AREA] - 1;
 +
 +      while (from >= end && to >= toend)
 +      *to-- = *from--;
 +      while (to >= toend && CHAR_GLYPH_PADDING_P (*to))
 +      {
 +        from =
 +          truncate_it.glyph_row->glyphs[TEXT_AREA]
 +          + truncate_it.glyph_row->used[TEXT_AREA] - 1;
 +        while (from >= end && to >= toend)
 +          *to-- = *from--;
 +      }
 +      if (from >= end)
 +      {
 +        /* Need to free some room before prepending additional
 +           glyphs.  */
 +        int move_by = from - end + 1;
 +        struct glyph *g0 = it->glyph_row->glyphs[TEXT_AREA];
 +        struct glyph *g = g0 + it->glyph_row->used[TEXT_AREA] - 1;
  
 -  if (to > toend)
 -    it->glyph_row->used[TEXT_AREA] = to - it->glyph_row->glyphs[TEXT_AREA];
 +        for ( ; g >= g0; g--)
 +          g[move_by] = *g;
 +        while (from >= end)
 +          *to-- = *from--;
 +        it->glyph_row->used[TEXT_AREA] += move_by;
 +      }
 +    }
  }
  
  
     must not be zero.  */
  
  static void
 -compute_line_metrics (it)
 -     struct it *it;
 +compute_line_metrics (struct it *it)
  {
    struct glyph_row *row = it->glyph_row;
    int area, i;
     end of the line if the row ends in italic text.  */
  
  static int
 -append_space_for_newline (it, default_face_p)
 -     struct it *it;
 -     int default_face_p;
 +append_space_for_newline (struct it *it, int default_face_p)
  {
    if (FRAME_WINDOW_P (it->f))
      {
          saved_pos = it->position;
  
          it->what = IT_CHARACTER;
 -        bzero (&it->position, sizeof it->position);
 +        memset (&it->position, 0, sizeof it->position);
          it->object = make_number (0);
          it->c = it->char_to_display = ' ';
          it->len = 1;
  
  
  /* Extend the face of the last glyph in the text area of IT->glyph_row
 -   to the end of the display line.  Called from display_line.
 -   If the glyph row is empty, add a space glyph to it so that we
 -   know the face to draw.  Set the glyph row flag fill_line_p.  */
 +   to the end of the display line.  Called from display_line.  If the
 +   glyph row is empty, add a space glyph to it so that we know the
 +   face to draw.  Set the glyph row flag fill_line_p.  If the glyph
 +   row is R2L, prepend a stretch glyph to cover the empty space to the
 +   left of the leftmost glyph.  */
  
  static void
 -extend_face_to_end_of_line (it)
 -     struct it *it;
 +extend_face_to_end_of_line (struct it *it)
  {
    struct face *face;
    struct frame *f = it->f;
  
 -  /* If line is already filled, do nothing.  */
 -  if (it->current_x >= it->last_visible_x)
 +  /* If line is already filled, do nothing.  Non window-system frames
 +     get a grace of one more ``pixel'' because their characters are
 +     1-``pixel'' wide, so they hit the equality too early.  This grace
 +     is needed only for R2L rows that are not continued, to produce
 +     one extra blank where we could display the cursor.  */
 +  if (it->current_x >= it->last_visible_x
 +      + (!FRAME_WINDOW_P (f)
 +       && it->glyph_row->reversed_p
 +       && !it->glyph_row->continued_p))
      return;
  
    /* Face extension extends the background and box of IT->face_id
       to the end of the line.  If the background equals the background
       of the frame, we don't have to do anything.  */
    if (it->face_before_selective_p)
 -    face = FACE_FROM_ID (it->f, it->saved_face_id);
 +    face = FACE_FROM_ID (f, it->saved_face_id);
    else
      face = FACE_FROM_ID (f, it->face_id);
  
        && it->glyph_row->displays_text_p
        && face->box == FACE_NO_BOX
        && face->background == FRAME_BACKGROUND_PIXEL (f)
 -      && !face->stipple)
 +      && !face->stipple
 +      && !it->glyph_row->reversed_p)
      return;
  
    /* Set the glyph row flag indicating that the face of the last glyph
          it->glyph_row->glyphs[TEXT_AREA][0].face_id = it->face_id;
          it->glyph_row->used[TEXT_AREA] = 1;
        }
 +#ifdef HAVE_WINDOW_SYSTEM
 +      if (it->glyph_row->reversed_p)
 +      {
 +        /* Prepend a stretch glyph to the row, such that the
 +           rightmost glyph will be drawn flushed all the way to the
 +           right margin of the window.  The stretch glyph that will
 +           occupy the empty space, if any, to the left of the
 +           glyphs.  */
 +        struct font *font = face->font ? face->font : FRAME_FONT (f);
 +        struct glyph *row_start = it->glyph_row->glyphs[TEXT_AREA];
 +        struct glyph *row_end = row_start + it->glyph_row->used[TEXT_AREA];
 +        struct glyph *g;
 +        int row_width, stretch_ascent, stretch_width;
 +        struct text_pos saved_pos;
 +        int saved_face_id, saved_avoid_cursor;
 +
 +        for (row_width = 0, g = row_start; g < row_end; g++)
 +          row_width += g->pixel_width;
 +        stretch_width = window_box_width (it->w, TEXT_AREA) - row_width;
 +        if (stretch_width > 0)
 +          {
 +            stretch_ascent =
 +              (((it->ascent + it->descent)
 +                * FONT_BASE (font)) / FONT_HEIGHT (font));
 +            saved_pos = it->position;
 +            memset (&it->position, 0, sizeof it->position);
 +            saved_avoid_cursor = it->avoid_cursor_p;
 +            it->avoid_cursor_p = 1;
 +            saved_face_id = it->face_id;
 +            /* The last row's stretch glyph should get the default
 +               face, to avoid painting the rest of the window with
 +               the region face, if the region ends at ZV.  */
 +            if (it->glyph_row->ends_at_zv_p)
 +              it->face_id = DEFAULT_FACE_ID;
 +            else
 +              it->face_id = face->id;
 +            append_stretch_glyph (it, make_number (0), stretch_width,
 +                                  it->ascent + it->descent, stretch_ascent);
 +            it->position = saved_pos;
 +            it->avoid_cursor_p = saved_avoid_cursor;
 +            it->face_id = saved_face_id;
 +          }
 +      }
 +#endif        /* HAVE_WINDOW_SYSTEM */
      }
    else
      {
        saved_pos = it->position;
  
        it->what = IT_CHARACTER;
 -      bzero (&it->position, sizeof it->position);
 +      memset (&it->position, 0, sizeof it->position);
        it->object = make_number (0);
        it->c = it->char_to_display = ' ';
        it->len = 1;
 -      it->face_id = face->id;
 +      /* The last row's blank glyphs should get the default face, to
 +       avoid painting the rest of the window with the region face,
 +       if the region ends at ZV.  */
 +      if (it->glyph_row->ends_at_zv_p)
 +      it->face_id = DEFAULT_FACE_ID;
 +      else
 +      it->face_id = face->id;
  
        PRODUCE_GLYPHS (it);
  
     trailing whitespace.  */
  
  static int
 -trailing_whitespace_p (charpos)
 -     int charpos;
 +trailing_whitespace_p (EMACS_INT charpos)
  {
 -  int bytepos = CHAR_TO_BYTE (charpos);
 +  EMACS_INT bytepos = CHAR_TO_BYTE (charpos);
    int c = 0;
  
    while (bytepos < ZV_BYTE
  /* Highlight trailing whitespace, if any, in ROW.  */
  
  void
 -highlight_trailing_whitespace (f, row)
 -     struct frame *f;
 -     struct glyph_row *row;
 +highlight_trailing_whitespace (struct frame *f, struct glyph_row *row)
  {
    int used = row->used[TEXT_AREA];
  
        struct glyph *start = row->glyphs[TEXT_AREA];
        struct glyph *glyph = start + used - 1;
  
 +      if (row->reversed_p)
 +      {
 +        /* Right-to-left rows need to be processed in the opposite
 +           direction, so swap the edge pointers. */
 +        glyph = start;
 +        start = row->glyphs[TEXT_AREA] + used - 1;
 +      }
 +
        /* Skip over glyphs inserted to display the cursor at the
         end of a line, for extending the face of the last glyph
         to the end of the line on terminals, and for truncation
         and continuation glyphs.  */
 -      while (glyph >= start
 -           && glyph->type == CHAR_GLYPH
 -           && INTEGERP (glyph->object))
 -      --glyph;
 +      if (!row->reversed_p)
 +      {
 +        while (glyph >= start
 +               && glyph->type == CHAR_GLYPH
 +               && INTEGERP (glyph->object))
 +          --glyph;
 +      }
 +      else
 +      {
 +        while (glyph <= start
 +               && glyph->type == CHAR_GLYPH
 +               && INTEGERP (glyph->object))
 +          ++glyph;
 +      }
  
        /* If last glyph is a space or stretch, and it's trailing
         whitespace, set the face of all trailing whitespace glyphs in
         IT->glyph_row to `trailing-whitespace'.  */
 -      if (glyph >= start
 +      if ((row->reversed_p ? glyph <= start : glyph >= start)
          && BUFFERP (glyph->object)
          && (glyph->type == STRETCH_GLYPH
              || (glyph->type == CHAR_GLYPH
          if (face_id < 0)
            return;
  
 -        while (glyph >= start
 -               && BUFFERP (glyph->object)
 -               && (glyph->type == STRETCH_GLYPH
 -                   || (glyph->type == CHAR_GLYPH
 -                       && glyph->u.ch == ' ')))
 -          (glyph--)->face_id = face_id;
 +        if (!row->reversed_p)
 +          {
 +            while (glyph >= start
 +                   && BUFFERP (glyph->object)
 +                   && (glyph->type == STRETCH_GLYPH
 +                       || (glyph->type == CHAR_GLYPH
 +                           && glyph->u.ch == ' ')))
 +              (glyph--)->face_id = face_id;
 +          }
 +        else
 +          {
 +            while (glyph <= start
 +                   && BUFFERP (glyph->object)
 +                   && (glyph->type == STRETCH_GLYPH
 +                       || (glyph->type == CHAR_GLYPH
 +                           && glyph->u.ch == ' ')))
 +              (glyph++)->face_id = face_id;
 +          }
        }
      }
  }
     used to hold the cursor.  */
  
  static int
 -cursor_row_p (w, row)
 -     struct window *w;
 -     struct glyph_row *row;
 +cursor_row_p (struct window *w, struct glyph_row *row)
  {
    int cursor_row_p = 1;
  
 -  if (PT == MATRIX_ROW_END_CHARPOS (row))
 +  if (PT == CHARPOS (row->end.pos))
      {
        /* Suppose the row ends on a string.
         Unless the row is continued, that means it ends on a newline
        {
          /* If the row ends in middle of a real character,
             and the line is continued, we want the cursor here.
 -           That's because MATRIX_ROW_END_CHARPOS would equal
 +           That's because CHARPOS (ROW->end.pos) would equal
             PT if PT is before the character.  */
          if (!row->ends_in_ellipsis_p)
            cursor_row_p = row->continued_p;
          else
          /* If the row ends in an ellipsis, then
 -           MATRIX_ROW_END_CHARPOS will equal point after the invisible text.
 -           We want that position to be displayed after the ellipsis.  */
 +           CHARPOS (ROW->end.pos) will equal point after the
 +           invisible text.  We want that position to be displayed
 +           after the ellipsis.  */
            cursor_row_p = 0;
        }
        /* If the row ends at ZV, display the cursor at the end of that
@@@ -17075,7 -16404,9 +17092,7 @@@ push_display_prop (struct it *it, Lisp_
  /* Return the character-property PROP at the current position in IT.  */
  
  static Lisp_Object
 -get_it_property (it, prop)
 -     struct it *it;
 -     Lisp_Object prop;
 +get_it_property (struct it *it, Lisp_Object prop)
  {
    Lisp_Object position;
  
@@@ -17119,107 -16450,6 +17136,107 @@@ handle_line_prefix (struct it *it
  
  \f
  
 +/* Remove N glyphs at the start of a reversed IT->glyph_row.  Called
 +   only for R2L lines from display_line, when it decides that too many
 +   glyphs were produced by PRODUCE_GLYPHS, and the line needs to be
 +   continued.  */
 +static void
 +unproduce_glyphs (struct it *it, int n)
 +{
 +  struct glyph *glyph, *end;
 +
 +  xassert (it->glyph_row);
 +  xassert (it->glyph_row->reversed_p);
 +  xassert (it->area == TEXT_AREA);
 +  xassert (n <= it->glyph_row->used[TEXT_AREA]);
 +
 +  if (n > it->glyph_row->used[TEXT_AREA])
 +    n = it->glyph_row->used[TEXT_AREA];
 +  glyph = it->glyph_row->glyphs[TEXT_AREA] + n;
 +  end = it->glyph_row->glyphs[TEXT_AREA] + it->glyph_row->used[TEXT_AREA];
 +  for ( ; glyph < end; glyph++)
 +    glyph[-n] = *glyph;
 +}
 +
 +/* Find the positions in a bidi-reordered ROW to serve as ROW->minpos
 +   and ROW->maxpos.  */
 +static void
 +find_row_edges (struct it *it, struct glyph_row *row,
 +              EMACS_INT min_pos, EMACS_INT min_bpos,
 +              EMACS_INT max_pos, EMACS_INT max_bpos)
 +{
 +  /* FIXME: Revisit this when glyph ``spilling'' in continuation
 +     lines' rows is implemented for bidi-reordered rows.  */
 +
 +  /* ROW->minpos is the value of min_pos, the minimal buffer position
 +     we have in ROW.  */
 +  if (min_pos <= ZV)
 +    SET_TEXT_POS (row->minpos, min_pos, min_bpos);
 +  else
 +    /* We didn't find _any_ valid buffer positions in any of the
 +       glyphs, so we must trust the iterator's computed positions.  */
 +      row->minpos = row->start.pos;
 +  if (max_pos <= 0)
 +    {
 +      max_pos = CHARPOS (it->current.pos);
 +      max_bpos = BYTEPOS (it->current.pos);
 +    }
 +
 +  /* Here are the various use-cases for ending the row, and the
 +     corresponding values for ROW->maxpos:
 +
 +     Line ends in a newline from buffer       eol_pos + 1
 +     Line is continued from buffer            max_pos + 1
 +     Line is truncated on right               it->current.pos
 +     Line ends in a newline from string       max_pos
 +     Line is continued from string            max_pos
 +     Line is continued from display vector    max_pos
 +     Line is entirely from a string           min_pos == max_pos
 +     Line is entirely from a display vector   min_pos == max_pos
 +     Line that ends at ZV                     ZV
 +
 +     If you discover other use-cases, please add them here as
 +     appropriate.  */
 +  if (row->ends_at_zv_p)
 +    row->maxpos = it->current.pos;
 +  else if (row->used[TEXT_AREA])
 +    {
 +      if (row->ends_in_newline_from_string_p)
 +      SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
 +      else if (CHARPOS (it->eol_pos) > 0)
 +      SET_TEXT_POS (row->maxpos,
 +                    CHARPOS (it->eol_pos) + 1, BYTEPOS (it->eol_pos) + 1);
 +      else if (row->continued_p)
 +      {
 +        /* If max_pos is different from IT's current position, it
 +           means IT->method does not belong to the display element
 +           at max_pos.  However, it also means that the display
 +           element at max_pos was displayed in its entirety on this
 +           line, which is equivalent to saying that the next line
 +           starts at the next buffer position.  */
 +        if (IT_CHARPOS (*it) == max_pos && it->method != GET_FROM_BUFFER)
 +          SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
 +        else
 +          {
 +            INC_BOTH (max_pos, max_bpos);
 +            SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
 +          }
 +      }
 +      else if (row->truncated_on_right_p)
 +      /* display_line already called reseat_at_next_visible_line_start,
 +         which puts the iterator at the beginning of the next line, in
 +         the logical order. */
 +      row->maxpos = it->current.pos;
 +      else if (max_pos == min_pos && it->method != GET_FROM_BUFFER)
 +      /* A line that is entirely from a string/image/stretch...  */
 +      row->maxpos = row->minpos;
 +      else
 +      abort ();
 +    }
 +  else
 +    row->maxpos = it->current.pos;
 +}
 +
  /* Construct the glyph row IT->glyph_row in the desired matrix of
     IT->w from text at the current position of IT.  See dispextern.h
     for an overview of struct it.  Value is non-zero if
     only.  */
  
  static int
 -display_line (it)
 -     struct it *it;
 +display_line (struct it *it)
  {
    struct glyph_row *row = it->glyph_row;
    Lisp_Object overlay_arrow_string;
    int wrap_row_used = -1, wrap_row_ascent, wrap_row_height;
    int wrap_row_phys_ascent, wrap_row_phys_height;
    int wrap_row_extra_line_spacing;
 +  EMACS_INT wrap_row_min_pos, wrap_row_min_bpos;
 +  EMACS_INT wrap_row_max_pos, wrap_row_max_bpos;
 +  int cvpos;
 +  EMACS_INT min_pos = ZV + 1, min_bpos, max_pos = 0, max_bpos;
  
    /* We always start displaying at hpos zero even if hscrolled.  */
    xassert (it->hpos == 0 && it->current_x == 0);
       if the first glyph is partially visible or if we hit a line end.  */
    if (it->current_x < it->first_visible_x)
      {
 +      SET_TEXT_POS (this_line_min_pos, ZV + 1, ZV_BYTE + 1);
        move_it_in_display_line_to (it, ZV, it->first_visible_x,
                                  MOVE_TO_POS | MOVE_TO_X);
 +      /* Record the smallest positions seen while we moved over
 +       display elements that are not visible.  This is needed by
 +       redisplay_internal for optimizing the case where the cursor
 +       stays inside the same line.  The rest of this function only
 +       considers positions that are actually displayed, so
 +       RECORD_MAX_MIN_POS will not otherwise record positions that
 +       are hscrolled to the left of the left edge of the window.  */
 +      min_pos = CHARPOS (this_line_min_pos);
 +      min_bpos = BYTEPOS (this_line_min_pos);
      }
    else
      {
    row->phys_height = it->max_phys_ascent + it->max_phys_descent;
    row->extra_line_spacing = it->max_extra_line_spacing;
  
 +/* Utility macro to record max and min buffer positions seen until now.  */
 +#define RECORD_MAX_MIN_POS(IT)                                        \
 +  do                                                          \
 +    {                                                         \
 +      if (IT_CHARPOS (*(IT)) < min_pos)                               \
 +      {                                                       \
 +        min_pos = IT_CHARPOS (*(IT));                         \
 +        min_bpos = IT_BYTEPOS (*(IT));                        \
 +      }                                                       \
 +      if (IT_CHARPOS (*(IT)) > max_pos)                               \
 +      {                                                       \
 +        max_pos = IT_CHARPOS (*(IT));                         \
 +        max_bpos = IT_BYTEPOS (*(IT));                        \
 +      }                                                       \
 +    }                                                         \
 +  while (0)
 +
    /* Loop generating characters.  The loop is left with IT on the next
       character to display.  */
    while (1)
              row->glyphs[TEXT_AREA]->charpos = -1;
              row->displays_text_p = 0;
  
 -            if (!NILP (XBUFFER (it->w->buffer)->indicate_empty_lines)
 +            if (!NILP (B_ (XBUFFER (it->w->buffer), indicate_empty_lines))
                  && (!MINI_WINDOW_P (it->w)
                      || (minibuf_level && EQ (it->window, minibuf_window))))
                row->indicate_empty_line_p = 1;
  
          it->continuation_lines_width = 0;
          row->ends_at_zv_p = 1;
 +        /* A row that displays right-to-left text must always have
 +           its last face extended all the way to the end of line,
 +           even if this row ends in ZV, because we still write to
 +           the screen left to right.  */
 +        if (row->reversed_p)
 +          extend_face_to_end_of_line (it);
          break;
        }
  
                  wrap_row_phys_ascent = row->phys_ascent;
                  wrap_row_phys_height = row->phys_height;
                  wrap_row_extra_line_spacing = row->extra_line_spacing;
 +                wrap_row_min_pos = min_pos;
 +                wrap_row_min_bpos = min_bpos;
 +                wrap_row_max_pos = max_pos;
 +                wrap_row_max_bpos = max_bpos;
                  may_wrap = 0;
                }
            }
                                         it->max_extra_line_spacing);
          if (it->current_x - it->pixel_width < it->first_visible_x)
            row->x = x - it->first_visible_x;
 +        /* Record the maximum and minimum buffer positions seen so
 +           far in glyphs that will be displayed by this row.  */
 +        if (it->bidi_p)
 +          RECORD_MAX_MIN_POS (it);
        }
        else
        {
                      it->current_x = new_x;
                      it->continuation_lines_width += new_x;
                      ++it->hpos;
 +                    /* Record the maximum and minimum buffer
 +                       positions seen so far in glyphs that will be
 +                       displayed by this row.  */
 +                    if (it->bidi_p)
 +                      RECORD_MAX_MIN_POS (it);
                      if (i == nglyphs - 1)
                        {
                          /* If line-wrap is on, check if a previous
                      /* A padding glyph that doesn't fit on this line.
                         This means the whole character doesn't fit
                         on the line.  */
 +                    if (row->reversed_p)
 +                      unproduce_glyphs (it, row->used[TEXT_AREA]
 +                                             - n_glyphs_before);
                      row->used[TEXT_AREA] = n_glyphs_before;
  
                      /* Fill the rest of the row with continuation
                  else if (wrap_row_used > 0)
                    {
                    back_to_wrap:
 +                    if (row->reversed_p)
 +                      unproduce_glyphs (it,
 +                                        row->used[TEXT_AREA] - wrap_row_used);
                      *it = wrap_it;
                      it->continuation_lines_width += wrap_x;
                      row->used[TEXT_AREA] = wrap_row_used;
                      row->phys_ascent = wrap_row_phys_ascent;
                      row->phys_height = wrap_row_phys_height;
                      row->extra_line_spacing = wrap_row_extra_line_spacing;
 +                    min_pos = wrap_row_min_pos;
 +                    min_bpos = wrap_row_min_bpos;
 +                    max_pos = wrap_row_max_pos;
 +                    max_bpos = wrap_row_max_bpos;
                      row->continued_p = 1;
                      row->ends_at_zv_p = 0;
                      row->exact_window_width_line_p = 0;
                      /* Something other than a TAB that draws past
                         the right edge of the window.  Restore
                         positions to values before the element.  */
 +                    if (row->reversed_p)
 +                      unproduce_glyphs (it, row->used[TEXT_AREA]
 +                                             - (n_glyphs_before + i));
                      row->used[TEXT_AREA] = n_glyphs_before + i;
  
                      /* Display continuation glyphs.  */
                  /* Increment number of glyphs actually displayed.  */
                  ++it->hpos;
  
 +                /* Record the maximum and minimum buffer positions
 +                   seen so far in glyphs that will be displayed by
 +                   this row.  */
 +                if (it->bidi_p)
 +                  RECORD_MAX_MIN_POS (it);
 +
                  if (x < it->first_visible_x)
                    /* Glyph is partially visible, i.e. row starts at
                       negative X position.  */
          if (used_before == 0)
            row->glyphs[TEXT_AREA]->charpos = CHARPOS (it->position);
  
 +        /* Record the position of the newline, for use in
 +           find_row_edges.  */
 +        it->eol_pos = it->current.pos;
 +
          /* Consume the line end.  This skips over invisible lines.  */
          set_iterator_to_next (it, 1);
          it->continuation_lines_width = 0;
            {
              int i, n;
  
 -            for (i = row->used[TEXT_AREA] - 1; i > 0; --i)
 -              if (!CHAR_GLYPH_PADDING_P (row->glyphs[TEXT_AREA][i]))
 -                break;
 +            if (!row->reversed_p)
 +              {
 +                for (i = row->used[TEXT_AREA] - 1; i > 0; --i)
 +                  if (!CHAR_GLYPH_PADDING_P (row->glyphs[TEXT_AREA][i]))
 +                    break;
 +              }
 +            else
 +              {
 +                for (i = 0; i < row->used[TEXT_AREA]; i++)
 +                  if (!CHAR_GLYPH_PADDING_P (row->glyphs[TEXT_AREA][i]))
 +                    break;
 +                /* Remove any padding glyphs at the front of ROW, to
 +                   make room for the truncation glyphs we will be
 +                   adding below.  The loop below always inserts at
 +                   least one truncation glyph, so also remove the
 +                   last glyph added to ROW.  */
 +                unproduce_glyphs (it, i + 1);
 +                /* Adjust i for the loop below.  */
 +                i = row->used[TEXT_AREA] - (i + 1);
 +              }
  
              for (n = row->used[TEXT_AREA]; i < n; ++i)
                {
    /* If line is not empty and hscrolled, maybe insert truncation glyphs
       at the left window margin.  */
    if (it->first_visible_x
 -      && IT_CHARPOS (*it) != MATRIX_ROW_START_CHARPOS (row))
 +      && IT_CHARPOS (*it) != CHARPOS (row->start.pos))
      {
        if (!FRAME_WINDOW_P (it->f))
        insert_left_trunc_glyphs (it);
        row->truncated_on_left_p = 1;
      }
  
 +  /* Remember the position at which this line ends.
 +
 +     BIDI Note: any code that needs MATRIX_ROW_START/END_CHARPOS
 +     cannot be before the call to find_row_edges below, since that is
 +     where these positions are determined. */
 +  row->end = it->current;
 +  if (!it->bidi_p)
 +    {
 +      row->minpos = row->start.pos;
 +      row->maxpos = row->end.pos;
 +    }
 +  else
 +    {
 +      /* ROW->minpos and ROW->maxpos must be the smallest and
 +       `1 + the largest' buffer positions in ROW.  But if ROW was
 +       bidi-reordered, these two positions can be anywhere in the
 +       row, so we must determine them now.  */
 +      find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos);
 +    }
 +
    /* If the start of this line is the overlay arrow-position, then
       mark this glyph row as the one containing the overlay arrow.
       This is clearly a mess with variable size fonts.  It would be
    /* Compute pixel dimensions of this line.  */
    compute_line_metrics (it);
  
 -  /* Remember the position at which this line ends.  */
 -  row->end = it->current;
 -
    /* Record whether this row ends inside an ellipsis.  */
    row->ends_in_ellipsis_p
      = (it->method == GET_FROM_DISPLAY_VECTOR
    it->right_user_fringe_face_id = 0;
  
    /* Maybe set the cursor.  */
 -  if (it->w->cursor.vpos < 0
 +  cvpos = it->w->cursor.vpos;
 +  if ((cvpos < 0
 +       /* In bidi-reordered rows, keep checking for proper cursor
 +        position even if one has been found already, because buffer
 +        positions in such rows change non-linearly with ROW->VPOS,
 +        when a line is continued.  One exception: when we are at ZV,
 +        display cursor on the first suitable glyph row, since all
 +        the empty rows after that also have their position set to ZV.  */
 +       /* FIXME: Revisit this when glyph ``spilling'' in continuation
 +        lines' rows is implemented for bidi-reordered rows.  */
 +       || (it->bidi_p
 +         && !MATRIX_ROW (it->w->desired_matrix, cvpos)->ends_at_zv_p))
        && PT >= MATRIX_ROW_START_CHARPOS (row)
        && PT <= MATRIX_ROW_END_CHARPOS (row)
        && cursor_row_p (it->w, row))
       row to be used.  */
    it->current_x = it->hpos = 0;
    it->current_y += row->height;
 +  SET_TEXT_POS (it->eol_pos, 0, 0);
    ++it->vpos;
    ++it->glyph_row;
 -  it->start = it->current;
 +  /* The next row should by default use the same value of the
 +     reversed_p flag as this one.  set_iterator_to_next decides when
 +     it's a new paragraph, and PRODUCE_GLYPHS recomputes the value of
 +     the flag accordingly.  */
 +  if (it->glyph_row < MATRIX_BOTTOM_TEXT_ROW (it->w->desired_matrix, it->w))
 +    it->glyph_row->reversed_p = row->reversed_p;
 +  it->start = row->end;
    return row->displays_text_p;
 +
 +#undef RECORD_MAX_MIN_POS
  }
  
 +DEFUN ("current-bidi-paragraph-direction", Fcurrent_bidi_paragraph_direction,
 +       Scurrent_bidi_paragraph_direction, 0, 1, 0,
 +       doc: /* Return paragraph direction at point in BUFFER.
 +Value is either `left-to-right' or `right-to-left'.
 +If BUFFER is omitted or nil, it defaults to the current buffer.
  
 -\f
 -/***********************************************************************
 -                             Menu Bar
 - ***********************************************************************/
 +Paragraph direction determines how the text in the paragraph is displayed.
 +In left-to-right paragraphs, text begins at the left margin of the window
 +and the reading direction is generally left to right.  In right-to-left
 +paragraphs, text begins at the right margin and is read from right to left.
  
 -/* Redisplay the menu bar in the frame for window W.
 +See also `bidi-paragraph-direction'.  */)
 +  (Lisp_Object buffer)
 +{
 +  struct buffer *buf;
 +  struct buffer *old;
  
 -   The menu bar of X frames that don't have X toolkit support is
 -   displayed in a special window W->frame->menu_bar_window.
 +  if (NILP (buffer))
 +    buf = current_buffer;
 +  else
 +    {
 +      CHECK_BUFFER (buffer);
 +      buf = XBUFFER (buffer);
 +      old = current_buffer;
 +    }
 +
 +  if (NILP (B_ (buf, bidi_display_reordering)))
 +    return Qleft_to_right;
 +  else if (!NILP (B_ (buf, bidi_paragraph_direction)))
 +    return B_ (buf, bidi_paragraph_direction);
 +  else
 +    {
 +      /* Determine the direction from buffer text.  We could try to
 +       use current_matrix if it is up to date, but this seems fast
 +       enough as it is.  */
 +      struct bidi_it itb;
 +      EMACS_INT pos = BUF_PT (buf);
 +      EMACS_INT bytepos = BUF_PT_BYTE (buf);
 +      int c;
 +
 +      if (buf != current_buffer)
 +      set_buffer_temp (buf);
 +      /* bidi_paragraph_init finds the base direction of the paragraph
 +       by searching forward from paragraph start.  We need the base
 +       direction of the current or _previous_ paragraph, so we need
 +       to make sure we are within that paragraph.  To that end, find
 +       the previous non-empty line.  */
 +      if (pos >= ZV && pos > BEGV)
 +      {
 +        pos--;
 +        bytepos = CHAR_TO_BYTE (pos);
 +      }
 +      while ((c = FETCH_BYTE (bytepos)) == '\n'
 +           || c == ' ' || c == '\t' || c == '\f')
 +      {
 +        if (bytepos <= BEGV_BYTE)
 +          break;
 +        bytepos--;
 +        pos--;
 +      }
 +      while (!CHAR_HEAD_P (FETCH_BYTE (bytepos)))
 +      bytepos--;
 +      itb.charpos = pos;
 +      itb.bytepos = bytepos;
 +      itb.first_elt = 1;
 +      itb.separator_limit = -1;
 +      itb.paragraph_dir = NEUTRAL_DIR;
 +
 +      bidi_paragraph_init (NEUTRAL_DIR, &itb, 1);
 +      if (buf != current_buffer)
 +      set_buffer_temp (old);
 +      switch (itb.paragraph_dir)
 +      {
 +      case L2R:
 +        return Qleft_to_right;
 +        break;
 +      case R2L:
 +        return Qright_to_left;
 +        break;
 +      default:
 +        abort ();
 +      }
 +    }
 +}
 +
 +
 +\f
 +/***********************************************************************
 +                             Menu Bar
 + ***********************************************************************/
 +
 +/* Redisplay the menu bar in the frame for window W.
 +
 +   The menu bar of X frames that don't have X toolkit support is
 +   displayed in a special window W->frame->menu_bar_window.
  
     The menu bar of terminal frames is treated specially as far as
     glyph matrices are concerned.  Menu bar lines are not part of
     for the menu bar.  */
  
  static void
 -display_menu_bar (w)
 -     struct window *w;
 +display_menu_bar (struct window *w)
  {
    struct frame *f = XFRAME (WINDOW_FRAME (w));
    struct it it;
     the number of windows whose mode lines were redisplayed.  */
  
  static int
 -redisplay_mode_lines (window, force)
 -     Lisp_Object window;
 -     int force;
 +redisplay_mode_lines (Lisp_Object window, int force)
  {
    int nwindows = 0;
  
     sum number of mode lines and header lines displayed.  */
  
  static int
 -display_mode_lines (w)
 -     struct window *w;
 +display_mode_lines (struct window *w)
  {
    Lisp_Object old_selected_window, old_selected_frame;
    int n = 0;
  
        /* Select mode line face based on the real selected window.  */
        display_mode_line (w, CURRENT_MODE_LINE_FACE_ID_3 (sel_w, sel_w, w),
 -                       current_buffer->mode_line_format);
 +                       B_ (current_buffer, mode_line_format));
        ++n;
      }
  
    if (WINDOW_WANTS_HEADER_LINE_P (w))
      {
        display_mode_line (w, HEADER_LINE_FACE_ID,
 -                       current_buffer->header_line_format);
 +                       B_ (current_buffer, header_line_format));
        ++n;
      }
  
     displayed.  */
  
  static int
 -display_mode_line (w, face_id, format)
 -     struct window *w;
 -     enum face_id face_id;
 -     Lisp_Object format;
 +display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format)
  {
    struct it it;
    struct face *face;
     Return the updated list.  */
  
  static Lisp_Object
 -move_elt_to_front (elt, list)
 -     Lisp_Object elt, list;
 +move_elt_to_front (Lisp_Object elt, Lisp_Object list)
  {
    register Lisp_Object tail, prev;
    register Lisp_Object tem;
     `store_mode_line_string', or `display_string'.  */
  
  static int
 -display_mode_element (it, depth, field_width, precision, elt, props, risky)
 -     struct it *it;
 -     int depth;
 -     int field_width, precision;
 -     Lisp_Object elt, props;
 -     int risky;
 +display_mode_element (struct it *it, int depth, int field_width, int precision,
 +                    Lisp_Object elt, Lisp_Object props, int risky)
  {
    int n = 0, field, prec;
    int literal = 0;
        {
        /* A string: output it and check for %-constructs within it.  */
        unsigned char c;
 -      int offset = 0;
 +      EMACS_INT offset = 0;
  
        if (SCHARS (elt) > 0
            && (!NILP (props) || risky))
              {
              case MODE_LINE_NOPROP:
              case MODE_LINE_TITLE:
 -              n += store_mode_line_noprop (SDATA (elt), -1, prec);
 +              n += store_mode_line_noprop (SSDATA (elt), -1, prec);
                break;
              case MODE_LINE_STRING:
                n += store_mode_line_string (NULL, elt, 1, 0, prec, Qnil);
               && (mode_line_target != MODE_LINE_DISPLAY
                   || it->current_x < it->last_visible_x))
          {
 -          int last_offset = offset;
 +          EMACS_INT last_offset = offset;
  
            /* Advance to end of string or next format specifier.  */
            while ((c = SREF (elt, offset++)) != '\0' && c != '%')
  
            if (offset - 1 != last_offset)
              {
 -              int nchars, nbytes;
 +              EMACS_INT nchars, nbytes;
  
                /* Output to end of string or up to '%'.  Field width
                   is length of string.  Don't output more than
                  {
                  case MODE_LINE_NOPROP:
                  case MODE_LINE_TITLE:
 -                  n += store_mode_line_noprop (SDATA (elt) + last_offset, 0, prec);
 +                  n += store_mode_line_noprop (SSDATA (elt) + last_offset, 0, prec);
                    break;
                  case MODE_LINE_STRING:
                    {
 -                    int bytepos = last_offset;
 -                    int charpos = string_byte_to_char (elt, bytepos);
 -                    int endpos = (precision <= 0
 -                                  ? string_byte_to_char (elt, offset)
 -                                  : charpos + nchars);
 +                    EMACS_INT bytepos = last_offset;
 +                    EMACS_INT charpos = string_byte_to_char (elt, bytepos);
 +                    EMACS_INT endpos = (precision <= 0
 +                                        ? string_byte_to_char (elt, offset)
 +                                        : charpos + nchars);
  
                      n += store_mode_line_string (NULL,
                                                   Fsubstring (elt, make_number (charpos),
                    break;
                  case MODE_LINE_DISPLAY:
                    {
 -                    int bytepos = last_offset;
 -                    int charpos = string_byte_to_char (elt, bytepos);
 +                    EMACS_INT bytepos = last_offset;
 +                    EMACS_INT charpos = string_byte_to_char (elt, bytepos);
  
                      if (precision <= 0)
                        nchars = string_byte_to_char (elt, offset) - charpos;
              }
            else /* c == '%' */
              {
 -              int percent_position = offset;
 +              EMACS_INT percent_position = offset;
  
                /* Get the specified minimum width.  Zero means
                   don't pad.  */
                else if (c != 0)
                  {
                    int multibyte;
 -                  int bytepos, charpos;
 -                  unsigned char *spec;
 +                  EMACS_INT bytepos, charpos;
 +                  const char *spec;
                    Lisp_Object string;
  
                    bytepos = percent_position;
   */
  
  static int
 -store_mode_line_string (string, lisp_string, copy_string, field_width, precision, props)
 -     char *string;
 -     Lisp_Object lisp_string;
 -     int copy_string;
 -     int field_width;
 -     int precision;
 -     Lisp_Object props;
 +store_mode_line_string (const char *string, Lisp_Object lisp_string, int copy_string,
 +                      int field_width, int precision, Lisp_Object props)
  {
 -  int len;
 +  EMACS_INT len;
    int n = 0;
  
    if (string != NULL)
@@@ -18886,8 -17922,8 +18903,8 @@@ properties
  Optional third and fourth args WINDOW and BUFFER specify the window
  and buffer to use as the context for the formatting (defaults
  are the selected window and the WINDOW's buffer).  */)
 -     (format, face, window, buffer)
 -     Lisp_Object format, face, window, buffer;
 +     (Lisp_Object format, Lisp_Object face,
 +      Lisp_Object window, Lisp_Object buffer)
  {
    struct it it;
    int len;
     the positive integer D to BUF using a minimal field width WIDTH.  */
  
  static void
 -pint2str (buf, width, d)
 -     register char *buf;
 -     register int width;
 -     register int d;
 +pint2str (register char *buf, register int width, register int d)
  {
    register char *p = buf;
  
@@@ -19025,7 -18064,10 +19042,7 @@@ static const char power_letter[] 
    };
  
  static void
 -pint2hrstr (buf, width, d)
 -     char *buf;
 -     int width;
 -     int d;
 +pint2hrstr (char *buf, int width, int d)
  {
    /* We aim to represent the nonnegative integer D as
       QUOTIENT.TENTHS * 10 ^ (3 * EXPONENT). */
  static unsigned char invalid_eol_type[] = "(*invalid*)";
  
  static char *
 -decode_mode_spec_coding (coding_system, buf, eol_flag)
 -     Lisp_Object coding_system;
 -     register char *buf;
 -     int eol_flag;
 +decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag)
  {
    Lisp_Object val;
 -  int multibyte = !NILP (current_buffer->enable_multibyte_characters);
 +  int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
    const unsigned char *eol_str;
    int eol_str_len;
    /* The EOL conversion we are using.  */
          eol_str = invalid_eol_type;
          eol_str_len = sizeof (invalid_eol_type) - 1;
        }
 -      bcopy (eol_str, buf, eol_str_len);
 +      memcpy (buf, eol_str, eol_str_len);
        buf += eol_str_len;
      }
  
  
  static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------";
  
 -static char *
 -decode_mode_spec (w, c, field_width, precision, string)
 -     struct window *w;
 -     register int c;
 -     int field_width, precision;
 -     Lisp_Object *string;
 +static const char *
 +decode_mode_spec (struct window *w, register int c, int field_width,
 +                int precision, Lisp_Object *string)
  {
    Lisp_Object obj;
    struct frame *f = XFRAME (WINDOW_FRAME (w));
    switch (c)
      {
      case '*':
 -      if (!NILP (b->read_only))
 +      if (!NILP (B_ (b, read_only)))
        return "%";
        if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
        return "*";
        /* This differs from %* only for a modified read-only buffer.  */
        if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
        return "*";
 -      if (!NILP (b->read_only))
 +      if (!NILP (B_ (b, read_only)))
        return "%";
        return "-";
  
        }
  
      case 'b':
 -      obj = b->name;
 +      obj = B_ (b, name);
        break;
  
      case 'c':
      case 'F':
        /* %F displays the frame name.  */
        if (!NILP (f->title))
 -      return (char *) SDATA (f->title);
 +      return SSDATA (f->title);
        if (f->explicit_name || ! FRAME_WINDOW_P (f))
 -      return (char *) SDATA (f->name);
 +      return SSDATA (f->name);
        return "Emacs";
  
      case 'f':
 -      obj = b->filename;
 +      obj = B_ (b, filename);
        break;
  
      case 'i':
        {
 -      int size = ZV - BEGV;
 +      EMACS_INT size = ZV - BEGV;
        pint2str (decode_mode_spec_buf, field_width, size);
        return decode_mode_spec_buf;
        }
  
      case 'I':
        {
 -      int size = ZV - BEGV;
 +      EMACS_INT size = ZV - BEGV;
        pint2hrstr (decode_mode_spec_buf, field_width, size);
        return decode_mode_spec_buf;
        }
  
      case 'l':
        {
 -      int startpos, startpos_byte, line, linepos, linepos_byte;
 -      int topline, nlines, junk, height;
 +      EMACS_INT startpos, startpos_byte, line, linepos, linepos_byte;
 +      int topline, nlines, height;
 +      EMACS_INT junk;
  
        /* %c and %l are ignored in `frame-title-format'.  */
        if (mode_line_target == MODE_LINE_TITLE)
        else if (nlines < height + 25 || nlines > height * 3 + 50
                 || linepos == BUF_BEGV (b))
          {
 -          int limit = BUF_BEGV (b);
 -          int limit_byte = BUF_BEGV_BYTE (b);
 -          int position;
 +          EMACS_INT limit = BUF_BEGV (b);
 +          EMACS_INT limit_byte = BUF_BEGV_BYTE (b);
 +          EMACS_INT position;
            int distance = (height * 2 + 30) * line_number_display_limit_width;
  
            if (startpos - distance > limit)
        break;
  
      case 'm':
 -      obj = b->mode_name;
 +      obj = B_ (b, mode_name);
        break;
  
      case 'n':
  
      case 'p':
        {
 -      int pos = marker_position (w->start);
 -      int total = BUF_ZV (b) - BUF_BEGV (b);
 +      EMACS_INT pos = marker_position (w->start);
 +      EMACS_INT total = BUF_ZV (b) - BUF_BEGV (b);
  
        if (XFASTINT (w->window_end_pos) <= BUF_Z (b) - BUF_ZV (b))
          {
               so get us a 2-digit number that is close.  */
            if (total == 100)
              total = 99;
 -          sprintf (decode_mode_spec_buf, "%2d%%", total);
 +          sprintf (decode_mode_spec_buf, "%2ld%%", (long)total);
            return decode_mode_spec_buf;
          }
        }
        /* Display percentage of size above the bottom of the screen.  */
      case 'P':
        {
 -      int toppos = marker_position (w->start);
 -      int botpos = BUF_Z (b) - XFASTINT (w->window_end_pos);
 -      int total = BUF_ZV (b) - BUF_BEGV (b);
 +      EMACS_INT toppos = marker_position (w->start);
 +      EMACS_INT botpos = BUF_Z (b) - XFASTINT (w->window_end_pos);
 +      EMACS_INT total = BUF_ZV (b) - BUF_BEGV (b);
  
        if (botpos >= BUF_ZV (b))
          {
            if (total == 100)
              total = 99;
            if (toppos <= BUF_BEGV (b))
 -            sprintf (decode_mode_spec_buf, "Top%2d%%", total);
 +            sprintf (decode_mode_spec_buf, "Top%2ld%%", (long)total);
            else
 -            sprintf (decode_mode_spec_buf, "%2d%%", total);
 +            sprintf (decode_mode_spec_buf, "%2ld%%", (long)total);
            return decode_mode_spec_buf;
          }
        }
        obj = Fget_buffer_process (Fcurrent_buffer ());
        if (NILP (obj))
        return "no process";
 -#ifdef subprocesses
 +#ifndef MSDOS
        obj = Fsymbol_name (Fprocess_status (obj));
  #endif
        break;
        {
        int count = inhibit_garbage_collection ();
        Lisp_Object val = call1 (intern ("file-remote-p"),
 -                               current_buffer->directory);
 +                               B_ (current_buffer, directory));
        unbind_to (count, Qnil);
  
        if (NILP (val))
                                         (FRAME_TERMINAL_CODING (f)->id),
                                         p, 0);
          }
 -      p = decode_mode_spec_coding (b->buffer_file_coding_system,
 +      p = decode_mode_spec_coding (B_ (b, buffer_file_coding_system),
                                     p, eol_flag);
  
  #if 0 /* This proves to be annoying; I think we can do without.  -- rms.  */
    if (STRINGP (obj))
      {
        *string = obj;
 -      return (char *) SDATA (obj);
 +      return SSDATA (obj);
      }
    else
      return "";
     Set *BYTE_POS_PTR to 1 if we found COUNT lines, 0 if we hit LIMIT.  */
  
  static int
 -display_count_lines (start, start_byte, limit_byte, count, byte_pos_ptr)
 -     int start, start_byte, limit_byte, count;
 -     int *byte_pos_ptr;
 +display_count_lines (EMACS_INT start, EMACS_INT start_byte,
 +                   EMACS_INT limit_byte, int count,
 +                   EMACS_INT *byte_pos_ptr)
  {
    register unsigned char *cursor;
    unsigned char *base;
  
    /* If we are not in selective display mode,
       check only for newlines.  */
 -  int selective_display = (!NILP (current_buffer->selective_display)
 -                         && !INTEGERP (current_buffer->selective_display));
 +  int selective_display = (!NILP (B_ (current_buffer, selective_display))
 +                         && !INTEGERP (B_ (current_buffer, selective_display)));
  
    if (count > 0)
      {
     Value is the number of columns displayed.  */
  
  static int
 -display_string (string, lisp_string, face_string, face_string_pos,
 -              start, it, field_width, precision, max_x, multibyte)
 -     unsigned char *string;
 -     Lisp_Object lisp_string;
 -     Lisp_Object face_string;
 -     EMACS_INT face_string_pos;
 -     EMACS_INT start;
 -     struct it *it;
 -     int field_width, precision, max_x;
 -     int multibyte;
 +display_string (const char *string, Lisp_Object lisp_string, Lisp_Object face_string,
 +              EMACS_INT face_string_pos, EMACS_INT start, struct it *it,
 +              int field_width, int precision, int max_x, int multibyte)
  {
    int hpos_at_start = it->hpos;
    int saved_face_id = it->face_id;
       with index START.  */
    reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string, start,
                    precision, field_width, multibyte);
 -  if (string && STRINGP (lisp_string)) 
 +  if (string && STRINGP (lisp_string))
      /* LISP_STRING is the one returned by decode_mode_spec.  We should
         ignore its text properties.  */
      it->stop_charpos = -1;
     and 1 if it's invisible and without an ellipsis.  */
  
  int
 -invisible_p (propval, list)
 -     register Lisp_Object propval;
 -     Lisp_Object list;
 +invisible_p (register Lisp_Object propval, Lisp_Object list)
  {
    register Lisp_Object tail, proptail;
  
@@@ -20001,7 -19057,8 +20018,7 @@@ is checked; or it can be some other val
  value of the `invisible' property of the text of interest.
  The non-nil value returned can be t for truly invisible text or something
  else if the text is replaced by an ellipsis.  */)
 -     (pos_or_prop)
 -     Lisp_Object pos_or_prop;
 +  (Lisp_Object pos_or_prop)
  {
    Lisp_Object prop
      = (NATNUMP (pos_or_prop) || MARKERP (pos_or_prop)
        : - 1)
  
  int
 -calc_pixel_width_or_height (res, it, prop, font, width_p, align_to)
 -     double *res;
 -     struct it *it;
 -     Lisp_Object prop;
 -     struct font *font;
 -     int width_p, *align_to;
 +calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
 +                          struct font *font, int width_p, int *align_to)
  {
    double pixels;
  
      {
        if (SCHARS (SYMBOL_NAME (prop)) == 2)
        {
 -        char *unit =  SDATA (SYMBOL_NAME (prop));
 +        char *unit = SSDATA (SYMBOL_NAME (prop));
  
          if (unit[0] == 'i' && unit[1] == 'n')
            pixels = 1.0;
@@@ -20305,7 -19366,7 +20322,7 @@@ dump_glyph_string (s
     face-override for drawing S.  */
  
  #ifdef HAVE_NTGUI
 -#define OPTIONAL_HDC(hdc)  hdc,
 +#define OPTIONAL_HDC(hdc)  HDC hdc,
  #define DECLARE_HDC(hdc)   HDC hdc;
  #define ALLOCATE_HDC(hdc, f) hdc = get_frame_dc ((f))
  #define RELEASE_HDC(hdc, f)  release_frame_dc ((f), (hdc))
  #endif
  
  static void
 -init_glyph_string (s, OPTIONAL_HDC (hdc) char2b, w, row, area, start, hl)
 -     struct glyph_string *s;
 -     DECLARE_HDC (hdc)
 -     XChar2b *char2b;
 -     struct window *w;
 -     struct glyph_row *row;
 -     enum glyph_row_area area;
 -     int start;
 -     enum draw_glyphs_face hl;
 +init_glyph_string (struct glyph_string *s,
 +                 OPTIONAL_HDC (hdc)
 +                 XChar2b *char2b, struct window *w, struct glyph_row *row,
 +                 enum glyph_row_area area, int start, enum draw_glyphs_face hl)
  {
 -  bzero (s, sizeof *s);
 +  memset (s, 0, sizeof *s);
    s->w = w;
    s->f = XFRAME (w->frame);
  #ifdef HAVE_NTGUI
     with head *HEAD and tail *TAIL.  Set *HEAD and *TAIL to the result.  */
  
  static INLINE void
 -append_glyph_string_lists (head, tail, h, t)
 -     struct glyph_string **head, **tail;
 -     struct glyph_string *h, *t;
 +append_glyph_string_lists (struct glyph_string **head, struct glyph_string **tail,
 +                         struct glyph_string *h, struct glyph_string *t)
  {
    if (h)
      {
     result.  */
  
  static INLINE void
 -prepend_glyph_string_lists (head, tail, h, t)
 -     struct glyph_string **head, **tail;
 -     struct glyph_string *h, *t;
 +prepend_glyph_string_lists (struct glyph_string **head, struct glyph_string **tail,
 +                          struct glyph_string *h, struct glyph_string *t)
  {
    if (h)
      {
     Set *HEAD and *TAIL to the resulting list.  */
  
  static INLINE void
 -append_glyph_string (head, tail, s)
 -     struct glyph_string **head, **tail;
 -     struct glyph_string *s;
 +append_glyph_string (struct glyph_string **head, struct glyph_string **tail,
 +                   struct glyph_string *s)
  {
    s->next = s->prev = NULL;
    append_glyph_string_lists (head, tail, s, s);
     DISPLAY_P is non-zero.  */
  
  static INLINE struct face *
 -get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p)
 -     struct frame *f;
 -     int c, face_id;
 -     XChar2b *char2b;
 -     int multibyte_p, display_p;
 +get_char_face_and_encoding (struct frame *f, int c, int face_id,
 +                          XChar2b *char2b, int multibyte_p, int display_p)
  {
    struct face *face = FACE_FROM_ID (f, face_id);
  
     a pointer to a realized face that is ready for display.  */
  
  static INLINE struct face *
 -get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
 -     struct frame *f;
 -     struct glyph *glyph;
 -     XChar2b *char2b;
 -     int *two_byte_p;
 +get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph,
 +                           XChar2b *char2b, int *two_byte_p)
  {
    struct face *face;
  
@@@ -20499,8 -19574,10 +20516,8 @@@ get_char_glyph_code (int c, struct fon
     Value is the index of a component not in S.  */
  
  static int
 -fill_composite_glyph_string (s, base_face, overlaps)
 -     struct glyph_string *s;
 -     struct face *base_face;
 -     int overlaps;
 +fill_composite_glyph_string (struct glyph_string *s, struct face *base_face,
 +                           int overlaps)
  {
    int i;
    /* For all glyphs of this composition, starting at the offset
  }
  
  static int
 -fill_gstring_glyph_string (s, face_id, start, end, overlaps)
 -     struct glyph_string *s;
 -     int face_id;
 -     int start, end, overlaps;
 +fill_gstring_glyph_string (struct glyph_string *s, int face_id,
 +                         int start, int end, int overlaps)
  {
    struct glyph *glyph, *last;
    Lisp_Object lgstring;
    glyph = s->row->glyphs[s->area] + start;
    last = s->row->glyphs[s->area] + end;
    s->cmp_id = glyph->u.cmp.id;
 -  s->cmp_from = glyph->u.cmp.from;
 -  s->cmp_to = glyph->u.cmp.to + 1;
 +  s->cmp_from = glyph->slice.cmp.from;
 +  s->cmp_to = glyph->slice.cmp.to + 1;
    s->face = FACE_FROM_ID (s->f, face_id);
    lgstring = composition_gstring_from_id (s->cmp_id);
    s->font = XFONT_OBJECT (LGSTRING_FONT (lgstring));
    while (glyph < last
         && glyph->u.cmp.automatic
         && glyph->u.cmp.id == s->cmp_id
 -       && s->cmp_to == glyph->u.cmp.from)
 -    s->cmp_to = (glyph++)->u.cmp.to + 1;
 +       && s->cmp_to == glyph->slice.cmp.from)
 +    s->cmp_to = (glyph++)->slice.cmp.to + 1;
  
    for (i = s->cmp_from; i < s->cmp_to; i++)
      {
  }
  
  
 +/* Fill glyph string S from a sequence glyphs for glyphless characters.
 +   See the comment of fill_glyph_string for arguments.
 +   Value is the index of the first glyph not in S.  */
 +
 +
 +static int
 +fill_glyphless_glyph_string (struct glyph_string *s, int face_id,
 +                           int start, int end, int overlaps)
 +{
 +  struct glyph *glyph, *last;
 +  int voffset;
 +
 +  xassert (s->first_glyph->type == GLYPHLESS_GLYPH);
 +  s->for_overlaps = overlaps;
 +  glyph = s->row->glyphs[s->area] + start;
 +  last = s->row->glyphs[s->area] + end;
 +  voffset = glyph->voffset;
 +  s->face = FACE_FROM_ID (s->f, face_id);
 +  s->font = s->face->font;
 +  s->nchars = 1;
 +  s->width = glyph->pixel_width;
 +  glyph++;
 +  while (glyph < last
 +       && glyph->type == GLYPHLESS_GLYPH
 +       && glyph->voffset == voffset
 +       && glyph->face_id == face_id)
 +    {
 +      s->nchars++;
 +      s->width += glyph->pixel_width;
 +      glyph++;
 +    }
 +  s->ybase += voffset;
 +  return glyph - s->row->glyphs[s->area];
 +}
 +
 +
  /* Fill glyph string S from a sequence of character glyphs.
  
     FACE_ID is the face id of the string.  START is the index of the
     Value is the index of the first glyph not in S.  */
  
  static int
 -fill_glyph_string (s, face_id, start, end, overlaps)
 -     struct glyph_string *s;
 -     int face_id;
 -     int start, end, overlaps;
 +fill_glyph_string (struct glyph_string *s, int face_id,
 +                 int start, int end, int overlaps)
  {
    struct glyph *glyph, *last;
    int voffset;
  /* Fill glyph string S from image glyph S->first_glyph.  */
  
  static void
 -fill_image_glyph_string (s)
 -     struct glyph_string *s;
 +fill_image_glyph_string (struct glyph_string *s)
  {
    xassert (s->first_glyph->type == IMAGE_GLYPH);
    s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id);
    xassert (s->img);
 -  s->slice = s->first_glyph->slice;
 +  s->slice = s->first_glyph->slice.img;
    s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
    s->font = s->face->font;
    s->width = s->first_glyph->pixel_width;
     Value is the index of the first glyph not in S.  */
  
  static int
 -fill_stretch_glyph_string (s, row, area, start, end)
 -     struct glyph_string *s;
 -     struct glyph_row *row;
 -     enum glyph_row_area area;
 -     int start, end;
 +fill_stretch_glyph_string (struct glyph_string *s, struct glyph_row *row,
 +                         enum glyph_row_area area, int start, int end)
  {
    struct glyph *glyph, *last;
    int voffset, face_id;
  }
  
  static struct font_metrics *
 -get_per_char_metric (f, font, char2b)
 -     struct frame *f;
 -     struct font *font;
 -     XChar2b *char2b;
 +get_per_char_metric (struct frame *f, struct font *font, XChar2b *char2b)
  {
    static struct font_metrics metrics;
    unsigned code = (XCHAR2B_BYTE1 (char2b) << 8) | XCHAR2B_BYTE2 (char2b);
     assumed to be zero.  */
  
  void
 -x_get_glyph_overhangs (glyph, f, left, right)
 -     struct glyph *glyph;
 -     struct frame *f;
 -     int *left, *right;
 +x_get_glyph_overhangs (struct glyph *glyph, struct frame *f, int *left, int *right)
  {
    *left = *right = 0;
  
          Lisp_Object gstring = composition_gstring_from_id (glyph->u.cmp.id);
          struct font_metrics metrics;
  
 -        composition_gstring_width (gstring, glyph->u.cmp.from,
 -                                   glyph->u.cmp.to + 1, &metrics);
 +        composition_gstring_width (gstring, glyph->slice.cmp.from,
 +                                   glyph->slice.cmp.to + 1, &metrics);
          if (metrics.rbearing > metrics.width)
            *right = metrics.rbearing - metrics.width;
          if (metrics.lbearing < 0)
     if no glyphs are overwritten.  */
  
  static int
 -left_overwritten (s)
 -     struct glyph_string *s;
 +left_overwritten (struct glyph_string *s)
  {
    int k;
  
     glyph in front of S overwrites S.  */
  
  static int
 -left_overwriting (s)
 -     struct glyph_string *s;
 +left_overwriting (struct glyph_string *s)
  {
    int i, k, x;
    struct glyph *glyphs = s->row->glyphs[s->area];
     no such glyph is found.  */
  
  static int
 -right_overwritten (s)
 -     struct glyph_string *s;
 +right_overwritten (struct glyph_string *s)
  {
    int k = -1;
  
     if no such glyph is found.  */
  
  static int
 -right_overwriting (s)
 -     struct glyph_string *s;
 +right_overwriting (struct glyph_string *s)
  {
    int i, k, x;
    int end = s->row->used[s->area];
     in the drawing area.  */
  
  static INLINE void
 -set_glyph_string_background_width (s, start, last_x)
 -     struct glyph_string *s;
 -     int start;
 -     int last_x;
 +set_glyph_string_background_width (struct glyph_string *s, int start, int last_x)
  {
    /* If the face of this glyph string has to be drawn to the end of
       the drawing area, set S->extends_to_end_of_line_p.  */
     BACKWARD_P non-zero means process predecessors.  */
  
  static void
 -compute_overhangs_and_x (s, x, backward_p)
 -     struct glyph_string *s;
 -     int x;
 -     int backward_p;
 +compute_overhangs_and_x (struct glyph_string *s, int x, int backward_p)
  {
    if (backward_p)
      {
    } while (0)
  
  
 +/* Add a glyph string for a sequence of glyphless character's glyphs
 +   to the list of strings between HEAD and TAIL.  The meanings of
 +   arguments are the same as those of BUILD_CHAR_GLYPH_STRINGS.  */
 +
 +#define BUILD_GLYPHLESS_GLYPH_STRING(START, END, HEAD, TAIL, HL, X, LAST_X) \
 +  do                                                                      \
 +    {                                                                     \
 +      int face_id;                                                        \
 +      XChar2b *char2b;                                                            \
 +                                                                          \
 +      face_id = (row)->glyphs[area][START].face_id;                       \
 +                                                                          \
 +      s = (struct glyph_string *) alloca (sizeof *s);                     \
 +      INIT_GLYPH_STRING (s, NULL, w, row, area, START, HL);               \
 +      append_glyph_string (&HEAD, &TAIL, s);                              \
 +      s->x = (X);                                                         \
 +      START = fill_glyphless_glyph_string (s, face_id, START, END,        \
 +                                         overlaps);                       \
 +    }                                                                     \
 +  while (0)
 +
 +
  /* Build a list of glyph strings between HEAD and TAIL for the glyphs
     of AREA of glyph row ROW on window W between indices START and END.
     HL overrides the face for drawing glyph strings, e.g. it is
              BUILD_CHAR_GLYPH_STRINGS (START, END, HEAD, TAIL,         \
                                        HL, X, LAST_X);                 \
              break;                                                    \
 -                                                                      \
 +                                                                      \
            case COMPOSITE_GLYPH:                                       \
              if (first_glyph->u.cmp.automatic)                         \
                BUILD_GSTRING_GLYPH_STRING (START, END, HEAD, TAIL,     \
                BUILD_COMPOSITE_GLYPH_STRING (START, END, HEAD, TAIL,   \
                                              HL, X, LAST_X);           \
              break;                                                    \
 -                                                                      \
 +                                                                      \
            case STRETCH_GLYPH:                                         \
              BUILD_STRETCH_GLYPH_STRING (START, END, HEAD, TAIL,       \
                                          HL, X, LAST_X);               \
              break;                                                    \
 -                                                                      \
 +                                                                      \
            case IMAGE_GLYPH:                                           \
              BUILD_IMAGE_GLYPH_STRING (START, END, HEAD, TAIL,         \
                                        HL, X, LAST_X);                 \
              break;                                                    \
 -                                                                      \
 +                                                                      \
 +          case GLYPHLESS_GLYPH:                                       \
 +            BUILD_GLYPHLESS_GLYPH_STRING (START, END, HEAD, TAIL,     \
 +                                          HL, X, LAST_X);             \
 +            break;                                                    \
 +                                                                      \
            default:                                                    \
              abort ();                                                 \
            }                                                           \
 -                                                                      \
 +                                                                      \
          if (s)                                                        \
            {                                                           \
              set_glyph_string_background_width (s, START, LAST_X);     \
     Value is the x-position reached, relative to AREA of W.  */
  
  static int
 -draw_glyphs (w, x, row, area, start, end, hl, overlaps)
 -     struct window *w;
 -     int x;
 -     struct glyph_row *row;
 -     enum glyph_row_area area;
 -     EMACS_INT start, end;
 -     enum draw_glyphs_face hl;
 -     int overlaps;
 +draw_glyphs (struct window *w, int x, struct glyph_row *row,
 +           enum glyph_row_area area, EMACS_INT start, EMACS_INT end,
 +           enum draw_glyphs_face hl, int overlaps)
  {
    struct glyph_string *head, *tail;
    struct glyph_string *s;
    if (head && !overlaps && row->contains_overlapping_glyphs_p)
      {
        struct glyph_string *h, *t;
 -      Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
 +      Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
        int mouse_beg_col, mouse_end_col, check_mouse_face = 0;
        int dummy_x = 0;
  
        {
          struct glyph_row *mouse_beg_row, *mouse_end_row;
  
 -        mouse_beg_row = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_beg_row);
 -        mouse_end_row = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_end_row);
 +        mouse_beg_row = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_beg_row);
 +        mouse_end_row = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_end_row);
  
          if (row >= mouse_beg_row && row <= mouse_end_row)
            {
              check_mouse_face = 1;
              mouse_beg_col = (row == mouse_beg_row)
 -              ? dpyinfo->mouse_face_beg_col : 0;
 +              ? hlinfo->mouse_face_beg_col : 0;
              mouse_end_col = (row == mouse_end_row)
 -              ? dpyinfo->mouse_face_end_col
 +              ? hlinfo->mouse_face_end_col
                : row->used[TEXT_AREA];
            }
        }
     Called from x_produce_glyphs when IT->glyph_row is non-null.  */
  
  static INLINE void
 -append_glyph (it)
 -     struct it *it;
 +append_glyph (struct it *it)
  {
    struct glyph *glyph;
    enum glyph_row_area area = it->area;
    glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
    if (glyph < it->glyph_row->glyphs[area + 1])
      {
 +      /* If the glyph row is reversed, we need to prepend the glyph
 +       rather than append it.  */
 +      if (it->glyph_row->reversed_p && area == TEXT_AREA)
 +      {
 +        struct glyph *g;
 +
 +        /* Make room for the additional glyph.  */
 +        for (g = glyph - 1; g >= it->glyph_row->glyphs[area]; g--)
 +          g[1] = *g;
 +        glyph = it->glyph_row->glyphs[area];
 +      }
        glyph->charpos = CHARPOS (it->position);
        glyph->object = it->object;
        if (it->pixel_width > 0)
        glyph->glyph_not_available_p = it->glyph_not_available_p;
        glyph->face_id = it->face_id;
        glyph->u.ch = it->char_to_display;
 -      glyph->slice = null_glyph_slice;
 +      glyph->slice.img = null_glyph_slice;
        glyph->font_type = FONT_TYPE_UNKNOWN;
 +      if (it->bidi_p)
 +      {
 +        glyph->resolved_level = it->bidi_it.resolved_level;
 +        if ((it->bidi_it.type & 7) != it->bidi_it.type)
 +          abort ();
 +        glyph->bidi_type = it->bidi_it.type;
 +      }
 +      else
 +      {
 +        glyph->resolved_level = 0;
 +        glyph->bidi_type = UNKNOWN_BT;
 +      }
        ++it->glyph_row->used[area];
      }
    else
     non-null.  */
  
  static INLINE void
 -append_composite_glyph (it)
 -     struct it *it;
 +append_composite_glyph (struct it *it)
  {
    struct glyph *glyph;
    enum glyph_row_area area = it->area;
    glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
    if (glyph < it->glyph_row->glyphs[area + 1])
      {
 -      glyph->charpos = CHARPOS (it->position);
 +      /* If the glyph row is reversed, we need to prepend the glyph
 +       rather than append it.  */
 +      if (it->glyph_row->reversed_p && it->area == TEXT_AREA)
 +      {
 +        struct glyph *g;
 +
 +        /* Make room for the new glyph.  */
 +        for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
 +          g[1] = *g;
 +        glyph = it->glyph_row->glyphs[it->area];
 +      }
 +      glyph->charpos = it->cmp_it.charpos;
        glyph->object = it->object;
        glyph->pixel_width = it->pixel_width;
        glyph->ascent = it->ascent;
        {
          glyph->u.cmp.automatic = 0;
          glyph->u.cmp.id = it->cmp_it.id;
 +        glyph->slice.cmp.from = glyph->slice.cmp.to = 0;
        }
        else
        {
          glyph->u.cmp.automatic = 1;
          glyph->u.cmp.id = it->cmp_it.id;
 -        glyph->u.cmp.from = it->cmp_it.from;
 -        glyph->u.cmp.to = it->cmp_it.to - 1;
 +        glyph->slice.cmp.from = it->cmp_it.from;
 +        glyph->slice.cmp.to = it->cmp_it.to - 1;
        }
        glyph->avoid_cursor_p = it->avoid_cursor_p;
        glyph->multibyte_p = it->multibyte_p;
        glyph->padding_p = 0;
        glyph->glyph_not_available_p = 0;
        glyph->face_id = it->face_id;
 -      glyph->slice = null_glyph_slice;
        glyph->font_type = FONT_TYPE_UNKNOWN;
 +      if (it->bidi_p)
 +      {
 +        glyph->resolved_level = it->bidi_it.resolved_level;
 +        if ((it->bidi_it.type & 7) != it->bidi_it.type)
 +          abort ();
 +        glyph->bidi_type = it->bidi_it.type;
 +      }
        ++it->glyph_row->used[area];
      }
    else
     IT->voffset.  */
  
  static INLINE void
 -take_vertical_position_into_account (it)
 -     struct it *it;
 +take_vertical_position_into_account (struct it *it)
  {
    if (it->voffset)
      {
     an overview of struct display_iterator.  */
  
  static void
 -produce_image_glyph (it)
 -     struct it *it;
 +produce_image_glyph (struct it *it)
  {
    struct image *img;
    struct face *face;
          glyph->glyph_not_available_p = 0;
          glyph->face_id = it->face_id;
          glyph->u.img_id = img->id;
 -        glyph->slice = slice;
 +        glyph->slice.img = slice;
          glyph->font_type = FONT_TYPE_UNKNOWN;
 +        if (it->bidi_p)
 +          {
 +            glyph->resolved_level = it->bidi_it.resolved_level;
 +            if ((it->bidi_it.type & 7) != it->bidi_it.type)
 +              abort ();
 +            glyph->bidi_type = it->bidi_it.type;
 +          }
          ++it->glyph_row->used[area];
        }
        else
     stretch.  ASCENT is the ascent of the glyph (0 <= ASCENT <= HEIGHT).  */
  
  static void
 -append_stretch_glyph (it, object, width, height, ascent)
 -     struct it *it;
 -     Lisp_Object object;
 -     int width, height;
 -     int ascent;
 +append_stretch_glyph (struct it *it, Lisp_Object object,
 +                    int width, int height, int ascent)
  {
    struct glyph *glyph;
    enum glyph_row_area area = it->area;
    glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
    if (glyph < it->glyph_row->glyphs[area + 1])
      {
 +      /* If the glyph row is reversed, we need to prepend the glyph
 +       rather than append it.  */
 +      if (it->glyph_row->reversed_p && area == TEXT_AREA)
 +      {
 +        struct glyph *g;
 +
 +        /* Make room for the additional glyph.  */
 +        for (g = glyph - 1; g >= it->glyph_row->glyphs[area]; g--)
 +          g[1] = *g;
 +        glyph = it->glyph_row->glyphs[area];
 +      }
        glyph->charpos = CHARPOS (it->position);
        glyph->object = object;
        glyph->pixel_width = width;
        glyph->face_id = it->face_id;
        glyph->u.stretch.ascent = ascent;
        glyph->u.stretch.height = height;
 -      glyph->slice = null_glyph_slice;
 +      glyph->slice.img = null_glyph_slice;
        glyph->font_type = FONT_TYPE_UNKNOWN;
 +      if (it->bidi_p)
 +      {
 +        glyph->resolved_level = it->bidi_it.resolved_level;
 +        if ((it->bidi_it.type & 7) != it->bidi_it.type)
 +          abort ();
 +        glyph->bidi_type = it->bidi_it.type;
 +      }
 +      else
 +      {
 +        glyph->resolved_level = 0;
 +        glyph->bidi_type = UNKNOWN_BT;
 +      }
        ++it->glyph_row->used[area];
      }
    else
     ASCENT must be in the range 0 <= ASCENT <= 100.  */
  
  static void
 -produce_stretch_glyph (it)
 -     struct it *it;
 +produce_stretch_glyph (struct it *it)
  {
    /* (space :width WIDTH :height HEIGHT ...)  */
    Lisp_Object prop, plist;
  
  
  static Lisp_Object
 -calc_line_height_property (it, val, font, boff, override)
 -     struct it *it;
 -     Lisp_Object val;
 -     struct font *font;
 -     int boff, override;
 +calc_line_height_property (struct it *it, Lisp_Object val, struct font *font,
 +                         int boff, int override)
  {
    Lisp_Object face_name = Qnil;
    int ascent, descent, height;
  }
  
  
 +/* Append a glyph for a glyphless character to IT->glyph_row.  FACE_ID
 +   is a face ID to be used for the glyph.  FOR_NO_FONT is nonzero if
 +   and only if this is for a character for which no font was found.
 +
 +   If the display method (it->glyphless_method) is
 +   GLYPHLESS_DISPLAY_ACRONYM or GLYPHLESS_DISPLAY_HEX_CODE, LEN is a
 +   length of the acronym or the hexadecimal string, UPPER_XOFF and
 +   UPPER_YOFF are pixel offsets for the upper part of the string,
 +   LOWER_XOFF and LOWER_YOFF are for the lower part.
 +
 +   For the other display methods, LEN through LOWER_YOFF are zero.  */
 +
 +static void
 +append_glyphless_glyph (struct it *it, int face_id, int for_no_font, int len,
 +                      short upper_xoff, short upper_yoff,
 +                      short lower_xoff, short lower_yoff)
 +{
 +  struct glyph *glyph;
 +  enum glyph_row_area area = it->area;
 +
 +  glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
 +  if (glyph < it->glyph_row->glyphs[area + 1])
 +    {
 +      /* If the glyph row is reversed, we need to prepend the glyph
 +       rather than append it.  */
 +      if (it->glyph_row->reversed_p && area == TEXT_AREA)
 +      {
 +        struct glyph *g;
 +
 +        /* Make room for the additional glyph.  */
 +        for (g = glyph - 1; g >= it->glyph_row->glyphs[area]; g--)
 +          g[1] = *g;
 +        glyph = it->glyph_row->glyphs[area];
 +      }
 +      glyph->charpos = CHARPOS (it->position);
 +      glyph->object = it->object;
 +      glyph->pixel_width = it->pixel_width;
 +      glyph->ascent = it->ascent;
 +      glyph->descent = it->descent;
 +      glyph->voffset = it->voffset;
 +      glyph->type = GLYPHLESS_GLYPH;
 +      glyph->u.glyphless.method = it->glyphless_method;
 +      glyph->u.glyphless.for_no_font = for_no_font;
 +      glyph->u.glyphless.len = len;
 +      glyph->u.glyphless.ch = it->c;
 +      glyph->slice.glyphless.upper_xoff = upper_xoff;
 +      glyph->slice.glyphless.upper_yoff = upper_yoff;
 +      glyph->slice.glyphless.lower_xoff = lower_xoff;
 +      glyph->slice.glyphless.lower_yoff = lower_yoff;
 +      glyph->avoid_cursor_p = it->avoid_cursor_p;
 +      glyph->multibyte_p = it->multibyte_p;
 +      glyph->left_box_line_p = it->start_of_box_run_p;
 +      glyph->right_box_line_p = it->end_of_box_run_p;
 +      glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent
 +                                    || it->phys_descent > it->descent);
 +      glyph->padding_p = 0;
 +      glyph->glyph_not_available_p = 0;
 +      glyph->face_id = face_id;
 +      glyph->font_type = FONT_TYPE_UNKNOWN;
 +      if (it->bidi_p)
 +      {
 +        glyph->resolved_level = it->bidi_it.resolved_level;
 +        if ((it->bidi_it.type & 7) != it->bidi_it.type)
 +          abort ();
 +        glyph->bidi_type = it->bidi_it.type;
 +      }
 +      ++it->glyph_row->used[area];
 +    }
 +  else
 +    IT_EXPAND_MATRIX_WIDTH (it, area);
 +}
 +
 +
 +/* Produce a glyph for a glyphless character for iterator IT.
 +   IT->glyphless_method specifies which method to use for displaying
 +   the character.  See the description of enum
 +   glyphless_display_method in dispextern.h for the detail.
 +
 +   FOR_NO_FONT is nonzero if and only if this is for a character for
 +   which no font was found.  ACRONYM, if non-nil, is an acronym string
 +   for the character.  */
 +
 +static void
 +produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
 +{
 +  int face_id;
 +  struct face *face;
 +  struct font *font;
 +  int base_width, base_height, width, height;
 +  short upper_xoff, upper_yoff, lower_xoff, lower_yoff;
 +  int len;
 +
 +  /* Get the metrics of the base font.  We always refer to the current
 +     ASCII face.  */
 +  face = FACE_FROM_ID (it->f, it->face_id)->ascii_face;
 +  font = face->font ? face->font : FRAME_FONT (it->f);
 +  it->ascent = FONT_BASE (font) + font->baseline_offset;
 +  it->descent = FONT_DESCENT (font) - font->baseline_offset;
 +  base_height = it->ascent + it->descent;
 +  base_width = font->average_width;
 +
 +  /* Get a face ID for the glyph by utilizing a cache (the same way as
 +     doen for `escape-glyph' in get_next_display_element).  */
 +  if (it->f == last_glyphless_glyph_frame
 +      && it->face_id == last_glyphless_glyph_face_id)
 +    {
 +      face_id = last_glyphless_glyph_merged_face_id;
 +    }
 +  else
 +    {
 +      /* Merge the `glyphless-char' face into the current face.  */
 +      face_id = merge_faces (it->f, Qglyphless_char, 0, it->face_id);
 +      last_glyphless_glyph_frame = it->f;
 +      last_glyphless_glyph_face_id = it->face_id;
 +      last_glyphless_glyph_merged_face_id = face_id;
 +    }
 +
 +  if (it->glyphless_method == GLYPHLESS_DISPLAY_THIN_SPACE)
 +    {
 +      it->pixel_width = THIN_SPACE_WIDTH;
 +      len = 0;
 +      upper_xoff = upper_yoff = lower_xoff = lower_yoff = 0;
 +    }
 +  else if (it->glyphless_method == GLYPHLESS_DISPLAY_EMPTY_BOX)
 +    {
 +      width = CHAR_WIDTH (it->c);
 +      if (width == 0)
 +      width = 1;
 +      else if (width > 4)
 +      width = 4;
 +      it->pixel_width = base_width * width;
 +      len = 0;
 +      upper_xoff = upper_yoff = lower_xoff = lower_yoff = 0;
 +    }
 +  else
 +    {
 +      char buf[7], *str;
 +      unsigned int code[6];
 +      int upper_len;
 +      int ascent, descent;
 +      struct font_metrics metrics_upper, metrics_lower;
 +
 +      face = FACE_FROM_ID (it->f, face_id);
 +      font = face->font ? face->font : FRAME_FONT (it->f);
 +      PREPARE_FACE_FOR_DISPLAY (it->f, face);
 +
 +      if (it->glyphless_method == GLYPHLESS_DISPLAY_ACRONYM)
 +      {
 +        if (! STRINGP (acronym) && CHAR_TABLE_P (Vglyphless_char_display))
 +          acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c);
 +        str = STRINGP (acronym) ? SSDATA (acronym) : "";
 +      }
 +      else
 +      {
 +        xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE);
 +        sprintf (buf, "%0*X", it->c < 0x10000 ? 4 : 6, it->c);
 +        str = buf;
 +      }
 +      for (len = 0; str[len] && ASCII_BYTE_P (str[len]); len++)
 +      code[len] = font->driver->encode_char (font, str[len]);
 +      upper_len = (len + 1) / 2;
 +      font->driver->text_extents (font, code, upper_len,
 +                                &metrics_upper);
 +      font->driver->text_extents (font, code + upper_len, len - upper_len,
 +                                &metrics_lower);
 +
 +
 +
 +      /* +4 is for vertical bars of a box plus 1-pixel spaces at both side.  */
 +      width = max (metrics_upper.width, metrics_lower.width) + 4;
 +      upper_xoff = upper_yoff = 2; /* the typical case */
 +      if (base_width >= width)
 +      {
 +        /* Align the upper to the left, the lower to the right.  */
 +        it->pixel_width = base_width;
 +        lower_xoff = base_width - 2 - metrics_lower.width;
 +      }
 +      else
 +      {
 +        /* Center the shorter one.  */
 +        it->pixel_width = width;
 +        if (metrics_upper.width >= metrics_lower.width)
 +          lower_xoff = (width - metrics_lower.width) / 2;
 +        else
 +          upper_xoff = (width - metrics_upper.width) / 2;
 +      }
 +
 +      /* +5 is for horizontal bars of a box plus 1-pixel spaces at
 +       top, bottom, and between upper and lower strings.  */
 +      height = (metrics_upper.ascent + metrics_upper.descent
 +              + metrics_lower.ascent + metrics_lower.descent) + 5;
 +      /* Center vertically.
 +       H:base_height, D:base_descent
 +       h:height, ld:lower_descent, la:lower_ascent, ud:upper_descent
 +
 +       ascent = - (D - H/2 - h/2 + 1); "+ 1" for rounding up
 +       descent = D - H/2 + h/2;
 +       lower_yoff = descent - 2 - ld;
 +       upper_yoff = lower_yoff - la - 1 - ud;  */
 +      ascent = - (it->descent - (base_height + height + 1) / 2);
 +      descent = it->descent - (base_height - height) / 2;
 +      lower_yoff = descent - 2 - metrics_lower.descent;
 +      upper_yoff = (lower_yoff - metrics_lower.ascent - 1
 +                  - metrics_upper.descent);
 +      /* Don't make the height shorter than the base height. */
 +      if (height > base_height)
 +      {
 +        it->ascent = ascent;
 +        it->descent = descent;
 +      }
 +    }
 +
 +  it->phys_ascent = it->ascent;
 +  it->phys_descent = it->descent;
 +  if (it->glyph_row)
 +    append_glyphless_glyph (it, face_id, for_no_font, len,
 +                          upper_xoff, upper_yoff,
 +                          lower_xoff, lower_yoff);
 +  it->nglyphs = 1;
 +  take_vertical_position_into_account (it);
 +}
 +
 +
  /* RIF:
     Produce glyphs/get display metrics for the display element IT is
     loaded with.  See the description of struct it in dispextern.h
     for an overview of struct it.  */
  
  void
 -x_produce_glyphs (it)
 -     struct it *it;
 +x_produce_glyphs (struct it *it)
  {
    int extra_line_spacing = it->extra_line_spacing;
  
        XChar2b char2b;
        struct face *face = FACE_FROM_ID (it->f, it->face_id);
        struct font *font = face->font;
 -      int font_not_found_p = font == NULL;
        struct font_metrics *pcm = NULL;
        int boff;                       /* baseline offset */
  
 -      if (font_not_found_p)
 -      {
 -        /* When no suitable font found, display an empty box based
 -           on the metrics of the font of the default face (or what
 -           remapped).  */
 -        struct face *no_font_face
 -          = FACE_FROM_ID (it->f,
 -                          NILP (Vface_remapping_alist) ? DEFAULT_FACE_ID
 -                          : lookup_basic_face (it->f, DEFAULT_FACE_ID));
 -        font = no_font_face->font;
 -        boff = font->baseline_offset;
 -      }
 -      else
 +      if (font == NULL)
        {
 -        boff = font->baseline_offset;
 -        if (font->vertical_centering)
 -          boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
 +        /* When no suitable font is found, display this character by
 +           the method specified in the first extra slot of
 +           Vglyphless_char_display.  */
 +        Lisp_Object acronym = lookup_glyphless_char_display (-1, it);
 +
 +        xassert (it->what == IT_GLYPHLESS);
 +        produce_glyphless_glyph (it, 1, STRINGP (acronym) ? acronym : Qnil);
 +        goto done;
        }
  
 +      boff = font->baseline_offset;
 +      if (font->vertical_centering)
 +      boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
 +
        if (it->char_to_display != '\n' && it->char_to_display != '\t')
        {
          int stretched_p;
              it->descent = FONT_DESCENT (font) - boff;
            }
  
 -        if (! font_not_found_p
 -            && get_char_glyph_code (it->char_to_display, font, &char2b))
 +        if (get_char_glyph_code (it->char_to_display, font, &char2b))
            {
              pcm = get_per_char_metric (it->f, font, &char2b);
              if (pcm->width == 0
          it->pixel_width = 0;
          it->nglyphs = 0;
  
 -        height = get_it_property(it, Qline_height);
 +        height = get_it_property (it, Qline_height);
          /* Split (line-height total-height) list */
          if (CONSP (height)
              && CONSP (XCDR (height))
              total_height = XCAR (XCDR (height));
              height = XCAR (height);
            }
 -        height = calc_line_height_property(it, height, font, boff, 1);
 +        height = calc_line_height_property (it, height, font, boff, 1);
  
          if (it->override_ascent >= 0)
            {
                it->ascent = XINT (height) - it->descent;
  
              if (!NILP (total_height))
 -              spacing = calc_line_height_property(it, total_height, font, boff, 0);
 +              spacing = calc_line_height_property (it, total_height, font, boff, 0);
              else
                {
 -                spacing = get_it_property(it, Qline_spacing);
 -                spacing = calc_line_height_property(it, spacing, font, boff, 0);
 +                spacing = get_it_property (it, Qline_spacing);
 +                spacing = calc_line_height_property (it, spacing, font, boff, 0);
                }
              if (INTEGERP (spacing))
                {
          XChar2b char2b;
          struct font_metrics *pcm;
          int font_not_found_p;
 -        int pos;
 +        EMACS_INT pos;
  
          for (glyph_len = cmp->glyph_len; glyph_len > 0; glyph_len--)
            if ((c = COMPOSITION_GLYPH (cmp, glyph_len - 1)) != '\t')
        if (it->glyph_row)
        append_composite_glyph (it);
      }
 +  else if (it->what == IT_GLYPHLESS)
 +    produce_glyphless_glyph (it, 0, Qnil);
    else if (it->what == IT_IMAGE)
      produce_image_glyph (it);
    else if (it->what == IT_STRETCH)
      produce_stretch_glyph (it);
  
 + done:
    /* Accumulate dimensions.  Note: can't assume that it->descent > 0
       because this isn't true for images with `:ascent 100'.  */
    xassert (it->ascent >= 0 && it->descent >= 0);
     row being updated.  */
  
  void
 -x_write_glyphs (start, len)
 -     struct glyph *start;
 -     int len;
 +x_write_glyphs (struct glyph *start, int len)
  {
    int x, hpos;
  
     Insert LEN glyphs from START at the nominal cursor position.  */
  
  void
 -x_insert_glyphs (start, len)
 -     struct glyph *start;
 -     int len;
 +x_insert_glyphs (struct glyph *start, int len)
  {
    struct frame *f;
    struct window *w;
     updated_window.  TO_X == -1 means clear to the end of this area.  */
  
  void
 -x_clear_end_of_line (to_x)
 -     int to_x;
 +x_clear_end_of_line (int to_x)
  {
    struct frame *f;
    struct window *w = updated_window;
     of the bar cursor.  */
  
  static enum text_cursor_kinds
 -get_specified_cursor_type (arg, width)
 -     Lisp_Object arg;
 -     int *width;
 +get_specified_cursor_type (Lisp_Object arg, int *width)
  {
    enum text_cursor_kinds type;
  
  
  /* Set the default cursor types for specified frame.  */
  void
 -set_frame_cursor_types (f, arg)
 -     struct frame *f;
 -     Lisp_Object arg;
 +set_frame_cursor_types (struct frame *f, Lisp_Object arg)
  {
    int width;
    Lisp_Object tem;
  }
  
  
 +#ifdef HAVE_WINDOW_SYSTEM
 +
  /* Return the cursor we want to be displayed in window W.  Return
     width of bar/hbar cursor through WIDTH arg.  Return with
     ACTIVE_CURSOR arg set to 1 if cursor in window W is `active'
     In all other cases, we want a hollow box cursor.  */
  
  static enum text_cursor_kinds
 -get_window_cursor_type (w, glyph, width, active_cursor)
 -     struct window *w;
 -     struct glyph *glyph;
 -     int *width;
 -     int *active_cursor;
 +get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
 +                      int *active_cursor)
  {
    struct frame *f = XFRAME (w->frame);
    struct buffer *b = XBUFFER (w->buffer);
      {
        if (w == XWINDOW (echo_area_window))
        {
 -        if (EQ (b->cursor_type, Qt) || NILP (b->cursor_type))
 +        if (EQ (B_ (b, cursor_type), Qt) || NILP (B_ (b, cursor_type)))
            {
              *width = FRAME_CURSOR_WIDTH (f);
              return FRAME_DESIRED_CURSOR (f);
            }
          else
 -          return get_specified_cursor_type (b->cursor_type, width);
 +          return get_specified_cursor_type (B_ (b, cursor_type), width);
        }
  
        *active_cursor = 0;
  
    /* Detect a nonselected window or nonselected frame.  */
    else if (w != XWINDOW (f->selected_window)
 -#ifdef HAVE_WINDOW_SYSTEM
 -         || f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame
 -#endif
 -         )
 +         || f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame)
      {
        *active_cursor = 0;
  
      }
  
    /* Never display a cursor in a window in which cursor-type is nil.  */
 -  if (NILP (b->cursor_type))
 +  if (NILP (B_ (b, cursor_type)))
      return NO_CURSOR;
  
    /* Get the normal cursor type for this window.  */
 -  if (EQ (b->cursor_type, Qt))
 +  if (EQ (B_ (b, cursor_type), Qt))
      {
        cursor_type = FRAME_DESIRED_CURSOR (f);
        *width = FRAME_CURSOR_WIDTH (f);
      }
    else
 -    cursor_type = get_specified_cursor_type (b->cursor_type, width);
 +    cursor_type = get_specified_cursor_type (B_ (b, cursor_type), width);
  
    /* Use cursor-in-non-selected-windows instead
       for non-selected window or frame.  */
    if (non_selected)
      {
 -      alt_cursor = b->cursor_in_non_selected_windows;
 +      alt_cursor = B_ (b, cursor_in_non_selected_windows);
        if (!EQ (Qt, alt_cursor))
        return get_specified_cursor_type (alt_cursor, width);
        /* t means modify the normal cursor type.  */
    /* Use normal cursor if not blinked off.  */
    if (!w->cursor_off_p)
      {
 -#ifdef HAVE_WINDOW_SYSTEM
        if (glyph != NULL && glyph->type == IMAGE_GLYPH)
        {
          if (cursor_type == FILLED_BOX_CURSOR)
              cursor_type = HOLLOW_BOX_CURSOR;
            }
        }
 -#endif
        return cursor_type;
      }
  
    /* Cursor is blinked off, so determine how to "toggle" it.  */
  
    /* First look for an entry matching the buffer's cursor-type in blink-cursor-alist.  */
 -  if ((alt_cursor = Fassoc (b->cursor_type, Vblink_cursor_alist), !NILP (alt_cursor)))
 +  if ((alt_cursor = Fassoc (B_ (b, cursor_type), Vblink_cursor_alist), !NILP (alt_cursor)))
      return get_specified_cursor_type (XCDR (alt_cursor), width);
  
    /* Then see if frame has specified a specific blink off cursor type.  */
  }
  
  
 -#ifdef HAVE_WINDOW_SYSTEM
 -
  /* Notice when the text cursor of window W has been completely
     overwritten by a drawing operation that outputs glyphs in AREA
     starting at X0 and ending at X1 in the line starting at Y0 and
     are window-relative.  */
  
  static void
 -notice_overwritten_cursor (w, area, x0, x1, y0, y1)
 -     struct window *w;
 -     enum glyph_row_area area;
 -     int x0, y0, x1, y1;
 +notice_overwritten_cursor (struct window *w, enum glyph_row_area area,
 +                         int x0, int x1, int y0, int y1)
  {
    int cx0, cx1, cy0, cy1;
    struct glyph_row *row;
    if (row->cursor_in_fringe_p)
      {
        row->cursor_in_fringe_p = 0;
 -      draw_fringe_bitmap (w, row, 0);
 +      draw_fringe_bitmap (w, row, row->reversed_p);
        w->phys_cursor_on_p = 0;
        return;
      }
     with respect to the overlapping part OVERLAPS.  */
  
  void
 -x_fix_overlapping_area (w, row, area, overlaps)
 -     struct window *w;
 -     struct glyph_row *row;
 -     enum glyph_row_area area;
 -     int overlaps;
 +x_fix_overlapping_area (struct window *w, struct glyph_row *row,
 +                      enum glyph_row_area area, int overlaps)
  {
    int i, x;
  
     comment of draw_glyphs for the meaning of HL.  */
  
  void
 -draw_phys_cursor_glyph (w, row, hl)
 -     struct window *w;
 -     struct glyph_row *row;
 -     enum draw_glyphs_face hl;
 +draw_phys_cursor_glyph (struct window *w, struct glyph_row *row,
 +                      enum draw_glyphs_face hl)
  {
    /* If cursor hpos is out of bounds, don't draw garbage.  This can
       happen in mini-buffer windows when switching between echo area
       glyphs and mini-buffer.  */
 -  if (w->phys_cursor.hpos < row->used[TEXT_AREA])
 +  if ((row->reversed_p
 +       ? (w->phys_cursor.hpos >= 0)
 +       : (w->phys_cursor.hpos < row->used[TEXT_AREA])))
      {
        int on_p = w->phys_cursor_on_p;
        int x1;
     Erase the image of a cursor of window W from the screen.  */
  
  void
 -erase_phys_cursor (w)
 -     struct window *w;
 +erase_phys_cursor (struct window *w)
  {
    struct frame *f = XFRAME (w->frame);
 -  Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
 +  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
    int hpos = w->phys_cursor.hpos;
    int vpos = w->phys_cursor.vpos;
    int mouse_face_here_p = 0;
    if (cursor_row->cursor_in_fringe_p)
      {
        cursor_row->cursor_in_fringe_p = 0;
 -      draw_fringe_bitmap (w, cursor_row, 0);
 +      draw_fringe_bitmap (w, cursor_row, cursor_row->reversed_p);
        goto mark_cursor_off;
      }
  
       should have cleared the cursor.  Note that we wouldn't be
       able to erase the cursor in this case because we don't have a
       cursor glyph at hand.  */
 -  if (w->phys_cursor.hpos >= cursor_row->used[TEXT_AREA])
 +  if ((cursor_row->reversed_p
 +       ? (w->phys_cursor.hpos < 0)
 +       : (w->phys_cursor.hpos >= cursor_row->used[TEXT_AREA])))
      goto mark_cursor_off;
  
    /* If the cursor is in the mouse face area, redisplay that when
       we clear the cursor.  */
 -  if (! NILP (dpyinfo->mouse_face_window)
 -      && w == XWINDOW (dpyinfo->mouse_face_window)
 -      && (vpos > dpyinfo->mouse_face_beg_row
 -        || (vpos == dpyinfo->mouse_face_beg_row
 -            && hpos >= dpyinfo->mouse_face_beg_col))
 -      && (vpos < dpyinfo->mouse_face_end_row
 -        || (vpos == dpyinfo->mouse_face_end_row
 -            && hpos < dpyinfo->mouse_face_end_col))
 +  if (! NILP (hlinfo->mouse_face_window)
 +      && coords_in_mouse_face_p (w, hpos, vpos)
        /* Don't redraw the cursor's spot in mouse face if it is at the
         end of a line (on a newline).  The cursor appears there, but
         mouse highlighting does not.  */
 -      && cursor_row->used[TEXT_AREA] > hpos)
 +      && cursor_row->used[TEXT_AREA] > hpos && hpos >= 0)
      mouse_face_here_p = 1;
  
    /* Maybe clear the display under the cursor.  */
     where to put the cursor is specified by HPOS, VPOS, X and Y.  */
  
  void
 -display_and_set_cursor (w, on, hpos, vpos, x, y)
 -     struct window *w;
 -     int on, hpos, vpos, x, y;
 +display_and_set_cursor (struct window *w, int on,
 +                      int hpos, int vpos, int x, int y)
  {
    struct frame *f = XFRAME (w->frame);
    int new_cursor_type;
  
    glyph = NULL;
    if (!glyph_row->exact_window_width_line_p
 -      || hpos < glyph_row->used[TEXT_AREA])
 +      || (0 <= hpos && hpos < glyph_row->used[TEXT_AREA]))
      glyph = glyph_row->glyphs[TEXT_AREA] + hpos;
  
    xassert (interrupt_input_blocked);
     of ON.  */
  
  void
 -update_window_cursor (w, on)
 -     struct window *w;
 -     int on;
 +update_window_cursor (struct window *w, int on)
  {
    /* Don't update cursor in windows whose frame is in the process
       of being deleted.  */
     in the window tree rooted at W.  */
  
  static void
 -update_cursor_in_window_tree (w, on_p)
 -     struct window *w;
 -     int on_p;
 +update_cursor_in_window_tree (struct window *w, int on_p)
  {
    while (w)
      {
     Don't change the cursor's position.  */
  
  void
 -x_update_cursor (f, on_p)
 -     struct frame *f;
 -     int on_p;
 +x_update_cursor (struct frame *f, int on_p)
  {
    update_cursor_in_window_tree (XWINDOW (f->root_window), on_p);
  }
     is about to be rewritten.  */
  
  void
 -x_clear_cursor (w)
 -     struct window *w;
 +x_clear_cursor (struct window *w)
  {
    if (FRAME_VISIBLE_P (XFRAME (w->frame)) && w->phys_cursor_on_p)
      update_window_cursor (w, 0);
  }
  
 +#endif /* HAVE_WINDOW_SYSTEM */
  
 -/* EXPORT:
 +/* Implementation of draw_row_with_mouse_face for GUI sessions, GPM,
 +   and MSDOS.  */
 +void
 +draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
 +                        int start_hpos, int end_hpos,
 +                        enum draw_glyphs_face draw)
 +{
 +#ifdef HAVE_WINDOW_SYSTEM
 +  if (FRAME_WINDOW_P (XFRAME (w->frame)))
 +    {
 +      draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0);
 +      return;
 +    }
 +#endif
 +#if defined (HAVE_GPM) || defined (MSDOS)
 +  tty_draw_row_with_mouse_face (w, row, start_hpos, end_hpos, draw);
 +#endif
 +}
 +
 +/* EXPORT:
     Display the active region described by mouse_face_* according to DRAW.  */
  
  void
 -show_mouse_face (dpyinfo, draw)
 -     Display_Info *dpyinfo;
 -     enum draw_glyphs_face draw;
 +show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
  {
 -  struct window *w = XWINDOW (dpyinfo->mouse_face_window);
 +  struct window *w = XWINDOW (hlinfo->mouse_face_window);
    struct frame *f = XFRAME (WINDOW_FRAME (w));
  
    if (/* If window is in the process of being destroyed, don't bother
         to do anything.  */
        w->current_matrix != NULL
        /* Don't update mouse highlight if hidden */
 -      && (draw != DRAW_MOUSE_FACE || !dpyinfo->mouse_face_hidden)
 +      && (draw != DRAW_MOUSE_FACE || !hlinfo->mouse_face_hidden)
        /* Recognize when we are called to operate on rows that don't exist
         anymore.  This can happen when a window is split.  */
 -      && dpyinfo->mouse_face_end_row < w->current_matrix->nrows)
 +      && hlinfo->mouse_face_end_row < w->current_matrix->nrows)
      {
        int phys_cursor_on_p = w->phys_cursor_on_p;
        struct glyph_row *row, *first, *last;
  
 -      first = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_beg_row);
 -      last = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_end_row);
 +      first = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_beg_row);
 +      last = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_end_row);
  
        for (row = first; row <= last && row->enabled_p; ++row)
        {
          /* For all but the first row, the highlight starts at column 0.  */
          if (row == first)
            {
 -            start_hpos = dpyinfo->mouse_face_beg_col;
 -            start_x = dpyinfo->mouse_face_beg_x;
 +            /* R2L rows have BEG and END in reversed order, but the
 +               screen drawing geometry is always left to right.  So
 +               we need to mirror the beginning and end of the
 +               highlighted area in R2L rows.  */
 +            if (!row->reversed_p)
 +              {
 +                start_hpos = hlinfo->mouse_face_beg_col;
 +                start_x = hlinfo->mouse_face_beg_x;
 +              }
 +            else if (row == last)
 +              {
 +                start_hpos = hlinfo->mouse_face_end_col;
 +                start_x = hlinfo->mouse_face_end_x;
 +              }
 +            else
 +              {
 +                start_hpos = 0;
 +                start_x = 0;
 +              }
 +          }
 +        else if (row->reversed_p && row == last)
 +          {
 +            start_hpos = hlinfo->mouse_face_end_col;
 +            start_x = hlinfo->mouse_face_end_x;
            }
          else
            {
            }
  
          if (row == last)
 -          end_hpos = dpyinfo->mouse_face_end_col;
 +          {
 +            if (!row->reversed_p)
 +              end_hpos = hlinfo->mouse_face_end_col;
 +            else if (row == first)
 +              end_hpos = hlinfo->mouse_face_beg_col;
 +            else
 +              {
 +                end_hpos = row->used[TEXT_AREA];
 +                if (draw == DRAW_NORMAL_TEXT)
 +                  row->fill_line_p = 1; /* Clear to end of line */
 +              }
 +          }
 +        else if (row->reversed_p && row == first)
 +          end_hpos = hlinfo->mouse_face_beg_col;
          else
            {
              end_hpos = row->used[TEXT_AREA];
  
          if (end_hpos > start_hpos)
            {
 -            draw_glyphs (w, start_x, row, TEXT_AREA,
 -                         start_hpos, end_hpos,
 -                         draw, 0);
 +            draw_row_with_mouse_face (w, start_x, row,
 +                                      start_hpos, end_hpos, draw);
  
              row->mouse_face_p
                = draw == DRAW_MOUSE_FACE || draw == DRAW_IMAGE_RAISED;
            }
        }
  
 +#ifdef HAVE_WINDOW_SYSTEM
        /* When we've written over the cursor, arrange for it to
         be displayed again.  */
 -      if (phys_cursor_on_p && !w->phys_cursor_on_p)
 +      if (FRAME_WINDOW_P (f)
 +        && phys_cursor_on_p && !w->phys_cursor_on_p)
        {
          BLOCK_INPUT;
          display_and_set_cursor (w, 1,
                                  w->phys_cursor.x, w->phys_cursor.y);
          UNBLOCK_INPUT;
        }
 +#endif        /* HAVE_WINDOW_SYSTEM */
      }
  
 +#ifdef HAVE_WINDOW_SYSTEM
    /* Change the mouse cursor.  */
 -  if (draw == DRAW_NORMAL_TEXT && !EQ (dpyinfo->mouse_face_window, f->tool_bar_window))
 -    FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
 -  else if (draw == DRAW_MOUSE_FACE)
 -    FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
 -  else
 -    FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor);
 +  if (FRAME_WINDOW_P (f))
 +    {
 +      if (draw == DRAW_NORMAL_TEXT
 +        && !EQ (hlinfo->mouse_face_window, f->tool_bar_window))
 +      FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
 +      else if (draw == DRAW_MOUSE_FACE)
 +      FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
 +      else
 +      FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor);
 +    }
 +#endif        /* HAVE_WINDOW_SYSTEM */
  }
  
  /* EXPORT:
     face was actually drawn unhighlighted.  */
  
  int
 -clear_mouse_face (dpyinfo)
 -     Display_Info *dpyinfo;
 +clear_mouse_face (Mouse_HLInfo *hlinfo)
  {
    int cleared = 0;
  
 -  if (!dpyinfo->mouse_face_hidden && !NILP (dpyinfo->mouse_face_window))
 +  if (!hlinfo->mouse_face_hidden && !NILP (hlinfo->mouse_face_window))
      {
 -      show_mouse_face (dpyinfo, DRAW_NORMAL_TEXT);
 +      show_mouse_face (hlinfo, DRAW_NORMAL_TEXT);
        cleared = 1;
      }
  
 -  dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
 -  dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
 -  dpyinfo->mouse_face_window = Qnil;
 -  dpyinfo->mouse_face_overlay = Qnil;
 +  hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
 +  hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
 +  hlinfo->mouse_face_window = Qnil;
 +  hlinfo->mouse_face_overlay = Qnil;
    return cleared;
  }
  
 +/* Return non-zero if the coordinates HPOS and VPOS on windows W are
 +   within the mouse face on that window.  */
 +static int
 +coords_in_mouse_face_p (struct window *w, int hpos, int vpos)
 +{
 +  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
 +
 +  /* Quickly resolve the easy cases.  */
 +  if (!(WINDOWP (hlinfo->mouse_face_window)
 +      && XWINDOW (hlinfo->mouse_face_window) == w))
 +    return 0;
 +  if (vpos < hlinfo->mouse_face_beg_row
 +      || vpos > hlinfo->mouse_face_end_row)
 +    return 0;
 +  if (vpos > hlinfo->mouse_face_beg_row
 +      && vpos < hlinfo->mouse_face_end_row)
 +    return 1;
 +
 +  if (!MATRIX_ROW (w->current_matrix, vpos)->reversed_p)
 +    {
 +      if (hlinfo->mouse_face_beg_row == hlinfo->mouse_face_end_row)
 +      {
 +        if (hlinfo->mouse_face_beg_col <= hpos && hpos < hlinfo->mouse_face_end_col)
 +          return 1;
 +      }
 +      else if ((vpos == hlinfo->mouse_face_beg_row
 +              && hpos >= hlinfo->mouse_face_beg_col)
 +             || (vpos == hlinfo->mouse_face_end_row
 +                 && hpos < hlinfo->mouse_face_end_col))
 +      return 1;
 +    }
 +  else
 +    {
 +       if (hlinfo->mouse_face_beg_row == hlinfo->mouse_face_end_row)
 +      {
 +        if (hlinfo->mouse_face_end_col < hpos && hpos <= hlinfo->mouse_face_beg_col)
 +          return 1;
 +      }
 +      else if ((vpos == hlinfo->mouse_face_beg_row
 +              && hpos <= hlinfo->mouse_face_beg_col)
 +             || (vpos == hlinfo->mouse_face_end_row
 +                 && hpos > hlinfo->mouse_face_end_col))
 +      return 1;
 +    }
 +  return 0;
 +}
 +
  
  /* EXPORT:
     Non-zero if physical cursor of window W is within mouse face.  */
  
  int
 -cursor_in_mouse_face_p (w)
 -     struct window *w;
 +cursor_in_mouse_face_p (struct window *w)
  {
 -  Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame));
 -  int in_mouse_face = 0;
 +  return coords_in_mouse_face_p (w, w->phys_cursor.hpos, w->phys_cursor.vpos);
 +}
  
 -  if (WINDOWP (dpyinfo->mouse_face_window)
 -      && XWINDOW (dpyinfo->mouse_face_window) == w)
 -    {
 -      int hpos = w->phys_cursor.hpos;
 -      int vpos = w->phys_cursor.vpos;
  
 -      if (vpos >= dpyinfo->mouse_face_beg_row
 -        && vpos <= dpyinfo->mouse_face_end_row
 -        && (vpos > dpyinfo->mouse_face_beg_row
 -            || hpos >= dpyinfo->mouse_face_beg_col)
 -        && (vpos < dpyinfo->mouse_face_end_row
 -            || hpos < dpyinfo->mouse_face_end_col
 -            || dpyinfo->mouse_face_past_end))
 -      in_mouse_face = 1;
 -    }
 +\f
 +/* Find the glyph rows START_ROW and END_ROW of window W that display
 +   characters between buffer positions START_CHARPOS and END_CHARPOS
 +   (excluding END_CHARPOS).  This is similar to row_containing_pos,
 +   but is more accurate when bidi reordering makes buffer positions
 +   change non-linearly with glyph rows.  */
 +static void
 +rows_from_pos_range (struct window *w,
 +                   EMACS_INT start_charpos, EMACS_INT end_charpos,
 +                   struct glyph_row **start, struct glyph_row **end)
 +{
 +  struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
 +  int last_y = window_text_bottom_y (w);
 +  struct glyph_row *row;
  
 -  return in_mouse_face;
 -}
 +  *start = NULL;
 +  *end = NULL;
 +
 +  while (!first->enabled_p
 +       && first < MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w))
 +    first++;
 +
 +  /* Find the START row.  */
 +  for (row = first;
 +       row->enabled_p && MATRIX_ROW_BOTTOM_Y (row) <= last_y;
 +       row++)
 +    {
 +      /* A row can potentially be the START row if the range of the
 +       characters it displays intersects the range
 +       [START_CHARPOS..END_CHARPOS).  */
 +      if (! ((start_charpos < MATRIX_ROW_START_CHARPOS (row)
 +            && end_charpos < MATRIX_ROW_START_CHARPOS (row))
 +           /* See the commentary in row_containing_pos, for the
 +              explanation of the complicated way to check whether
 +              some position is beyond the end of the characters
 +              displayed by a row.  */
 +           || ((start_charpos > MATRIX_ROW_END_CHARPOS (row)
 +                || (start_charpos == MATRIX_ROW_END_CHARPOS (row)
 +                    && !row->ends_at_zv_p
 +                    && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)))
 +               && (end_charpos > MATRIX_ROW_END_CHARPOS (row)
 +                   || (end_charpos == MATRIX_ROW_END_CHARPOS (row)
 +                       && !row->ends_at_zv_p
 +                       && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))))))
 +      {
 +        /* Found a candidate row.  Now make sure at least one of the
 +           glyphs it displays has a charpos from the range
 +           [START_CHARPOS..END_CHARPOS).
 +
 +           This is not obvious because bidi reordering could make
 +           buffer positions of a row be 1,2,3,102,101,100, and if we
 +           want to highlight characters in [50..60), we don't want
 +           this row, even though [50..60) does intersect [1..103),
 +           the range of character positions given by the row's start
 +           and end positions.  */
 +        struct glyph *g = row->glyphs[TEXT_AREA];
 +        struct glyph *e = g + row->used[TEXT_AREA];
 +
 +        while (g < e)
 +          {
 +            if (BUFFERP (g->object)
 +                && start_charpos <= g->charpos && g->charpos < end_charpos)
 +              *start = row;
 +            g++;
 +          }
 +        if (*start)
 +          break;
 +      }
 +    }
  
 +  /* Find the END row.  */
 +  if (!*start
 +      /* If the last row is partially visible, start looking for END
 +       from that row, instead of starting from FIRST.  */
 +      && !(row->enabled_p
 +         && row->y < last_y && MATRIX_ROW_BOTTOM_Y (row) > last_y))
 +    row = first;
 +  for ( ; row->enabled_p && MATRIX_ROW_BOTTOM_Y (row) <= last_y; row++)
 +    {
 +      struct glyph_row *next = row + 1;
 +
 +      if (!next->enabled_p
 +        || next >= MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w)
 +        /* The first row >= START whose range of displayed characters
 +           does NOT intersect the range [START_CHARPOS..END_CHARPOS]
 +           is the row END + 1.  */
 +        || (start_charpos < MATRIX_ROW_START_CHARPOS (next)
 +            && end_charpos < MATRIX_ROW_START_CHARPOS (next))
 +        || ((start_charpos > MATRIX_ROW_END_CHARPOS (next)
 +             || (start_charpos == MATRIX_ROW_END_CHARPOS (next)
 +                 && !next->ends_at_zv_p
 +                 && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (next)))
 +            && (end_charpos > MATRIX_ROW_END_CHARPOS (next)
 +                || (end_charpos == MATRIX_ROW_END_CHARPOS (next)
 +                    && !next->ends_at_zv_p
 +                    && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (next)))))
 +      {
 +        *end = row;
 +        break;
 +      }
 +      else
 +      {
 +        /* If the next row's edges intersect [START_CHARPOS..END_CHARPOS],
 +           but none of the characters it displays are in the range, it is
 +           also END + 1. */
 +        struct glyph *g = next->glyphs[TEXT_AREA];
 +        struct glyph *e = g + next->used[TEXT_AREA];
  
 +        while (g < e)
 +          {
 +            if (BUFFERP (g->object)
 +                && start_charpos <= g->charpos && g->charpos < end_charpos)
 +              break;
 +            g++;
 +          }
 +        if (g == e)
 +          {
 +            *end = row;
 +            break;
 +          }
 +      }
 +    }
 +}
  
 -\f
 -/* This function sets the mouse_face_* elements of DPYINFO, assuming
 +/* This function sets the mouse_face_* elements of HLINFO, assuming
     the mouse cursor is on a glyph with buffer charpos MOUSE_CHARPOS in
     window WINDOW.  START_CHARPOS and END_CHARPOS are buffer positions
     for the overlay or run of text properties specifying the mouse
  
  static void
  mouse_face_from_buffer_pos (Lisp_Object window,
 -                          Display_Info *dpyinfo,
 +                          Mouse_HLInfo *hlinfo,
                            EMACS_INT mouse_charpos,
                            EMACS_INT start_charpos,
                            EMACS_INT end_charpos,
  {
    struct window *w = XWINDOW (window);
    struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
 -  struct glyph_row *row;
 +  struct glyph_row *r1, *r2;
    struct glyph *glyph, *end;
 -  EMACS_INT ignore;
 +  EMACS_INT ignore, pos;
    int x;
  
    xassert (NILP (display_string) || STRINGP (display_string));
    xassert (NILP (before_string) || STRINGP (before_string));
    xassert (NILP (after_string) || STRINGP (after_string));
  
 -  /* Find the first highlighted glyph.  */
 -  if (start_charpos < MATRIX_ROW_START_CHARPOS (first))
 +  /* Find the rows corresponding to START_CHARPOS and END_CHARPOS.  */
 +  rows_from_pos_range (w, start_charpos, end_charpos, &r1, &r2);
 +  if (r1 == NULL)
 +    r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
 +  /* If the before-string or display-string contains newlines,
 +     rows_from_pos_range skips to its last row.  Move back.  */
 +  if (!NILP (before_string) || !NILP (display_string))
 +    {
 +      struct glyph_row *prev;
 +      while ((prev = r1 - 1, prev >= first)
 +           && MATRIX_ROW_END_CHARPOS (prev) == start_charpos
 +           && prev->used[TEXT_AREA] > 0)
 +      {
 +        struct glyph *beg = prev->glyphs[TEXT_AREA];
 +        glyph = beg + prev->used[TEXT_AREA];
 +        while (--glyph >= beg && INTEGERP (glyph->object));
 +        if (glyph < beg
 +            || !(EQ (glyph->object, before_string)
 +                 || EQ (glyph->object, display_string)))
 +          break;
 +        r1 = prev;
 +      }
 +    }
 +  if (r2 == NULL)
      {
 -      dpyinfo->mouse_face_beg_col = 0;
 -      dpyinfo->mouse_face_beg_row = MATRIX_ROW_VPOS (first, w->current_matrix);
 -      dpyinfo->mouse_face_beg_x = first->x;
 -      dpyinfo->mouse_face_beg_y = first->y;
 +      r2 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
 +      hlinfo->mouse_face_past_end = 1;
      }
 -  else
 +  else if (!NILP (after_string))
      {
 -      row = row_containing_pos (w, start_charpos, first, NULL, 0);
 -      if (row == NULL)
 -      row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
 -
 -      /* If the before-string or display-string contains newlines,
 -       row_containing_pos skips to its last row.  Move back.  */
 -      if (!NILP (before_string) || !NILP (display_string))
 -      {
 -        struct glyph_row *prev;
 -        while ((prev = row - 1, prev >= first)
 -               && MATRIX_ROW_END_CHARPOS (prev) == start_charpos
 -               && prev->used[TEXT_AREA] > 0)
 -          {
 -            struct glyph *beg = prev->glyphs[TEXT_AREA];
 -            glyph = beg + prev->used[TEXT_AREA];
 -            while (--glyph >= beg && INTEGERP (glyph->object));
 -            if (glyph < beg
 -                || !(EQ (glyph->object, before_string)
 -                     || EQ (glyph->object, display_string)))
 -              break;
 -            row = prev;
 -          }
 -      }
 +      /* If the after-string has newlines, advance to its last row.  */
 +      struct glyph_row *next;
 +      struct glyph_row *last
 +      = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
  
 -      glyph = row->glyphs[TEXT_AREA];
 -      end = glyph + row->used[TEXT_AREA];
 -      x = row->x;
 -      dpyinfo->mouse_face_beg_y = row->y;
 -      dpyinfo->mouse_face_beg_row = MATRIX_ROW_VPOS (row, w->current_matrix);
 +      for (next = r2 + 1;
 +         next <= last
 +           && next->used[TEXT_AREA] > 0
 +           && EQ (next->glyphs[TEXT_AREA]->object, after_string);
 +         ++next)
 +      r2 = next;
 +    }
 +  /* The rest of the display engine assumes that mouse_face_beg_row is
 +     either above below mouse_face_end_row or identical to it.  But
 +     with bidi-reordered continued lines, the row for START_CHARPOS
 +     could be below the row for END_CHARPOS.  If so, swap the rows and
 +     store them in correct order.  */
 +  if (r1->y > r2->y)
 +    {
 +      struct glyph_row *tem = r2;
 +
 +      r2 = r1;
 +      r1 = tem;
 +    }
 +
 +  hlinfo->mouse_face_beg_y = r1->y;
 +  hlinfo->mouse_face_beg_row = MATRIX_ROW_VPOS (r1, w->current_matrix);
 +  hlinfo->mouse_face_end_y = r2->y;
 +  hlinfo->mouse_face_end_row = MATRIX_ROW_VPOS (r2, w->current_matrix);
 +
 +  /* For a bidi-reordered row, the positions of BEFORE_STRING,
 +     AFTER_STRING, DISPLAY_STRING, START_CHARPOS, and END_CHARPOS
 +     could be anywhere in the row and in any order.  The strategy
 +     below is to find the leftmost and the rightmost glyph that
 +     belongs to either of these 3 strings, or whose position is
 +     between START_CHARPOS and END_CHARPOS, and highlight all the
 +     glyphs between those two.  This may cover more than just the text
 +     between START_CHARPOS and END_CHARPOS if the range of characters
 +     strides the bidi level boundary, e.g. if the beginning is in R2L
 +     text while the end is in L2R text or vice versa.  */
 +  if (!r1->reversed_p)
 +    {
 +      /* This row is in a left to right paragraph.  Scan it left to
 +       right.  */
 +      glyph = r1->glyphs[TEXT_AREA];
 +      end = glyph + r1->used[TEXT_AREA];
 +      x = r1->x;
  
        /* Skip truncation glyphs at the start of the glyph row.  */
 -      if (row->displays_text_p)
 +      if (r1->displays_text_p)
        for (; glyph < end
               && INTEGERP (glyph->object)
               && glyph->charpos < 0;
             ++glyph)
          x += glyph->pixel_width;
  
 -      /* Scan the glyph row, stopping before BEFORE_STRING or
 -       DISPLAY_STRING or START_CHARPOS.  */
 +      /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING,
 +       or DISPLAY_STRING, and the first glyph from buffer whose
 +       position is between START_CHARPOS and END_CHARPOS.  */
        for (; glyph < end
             && !INTEGERP (glyph->object)
 -           && !EQ (glyph->object, before_string)
             && !EQ (glyph->object, display_string)
             && !(BUFFERP (glyph->object)
 -                && glyph->charpos >= start_charpos);
 +                && (glyph->charpos >= start_charpos
 +                    && glyph->charpos < end_charpos));
           ++glyph)
 -      x += glyph->pixel_width;
 -
 -      dpyinfo->mouse_face_beg_x = x;
 -      dpyinfo->mouse_face_beg_col = glyph - row->glyphs[TEXT_AREA];
 -    }
 -
 -  /* Find the last highlighted glyph.  */
 -  row = row_containing_pos (w, end_charpos, first, NULL, 0);
 -  if (row == NULL)
 -    {
 -      row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
 -      dpyinfo->mouse_face_past_end = 1;
 +      {
 +        /* BEFORE_STRING or AFTER_STRING are only relevant if they
 +           are present at buffer positions between START_CHARPOS and
 +           END_CHARPOS, or if they come from an overlay.  */
 +        if (EQ (glyph->object, before_string))
 +          {
 +            pos = string_buffer_position (w, before_string,
 +                                          start_charpos);
 +            /* If pos == 0, it means before_string came from an
 +               overlay, not from a buffer position.  */
 +            if (!pos || (pos >= start_charpos && pos < end_charpos))
 +              break;
 +          }
 +        else if (EQ (glyph->object, after_string))
 +          {
 +            pos = string_buffer_position (w, after_string, end_charpos);
 +            if (!pos || (pos >= start_charpos && pos < end_charpos))
 +              break;
 +          }
 +        x += glyph->pixel_width;
 +      }
 +      hlinfo->mouse_face_beg_x = x;
 +      hlinfo->mouse_face_beg_col = glyph - r1->glyphs[TEXT_AREA];
      }
 -  else if (!NILP (after_string))
 +  else
      {
 -      /* If the after-string has newlines, advance to its last row.  */
 -      struct glyph_row *next;
 -      struct glyph_row *last
 -      = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
 +      /* This row is in a right to left paragraph.  Scan it right to
 +       left.  */
 +      struct glyph *g;
  
 -      for (next = row + 1;
 -         next <= last
 -           && next->used[TEXT_AREA] > 0
 -           && EQ (next->glyphs[TEXT_AREA]->object, after_string);
 -         ++next)
 -      row = next;
 -    }
 +      end = r1->glyphs[TEXT_AREA] - 1;
 +      glyph = end + r1->used[TEXT_AREA];
 +
 +      /* Skip truncation glyphs at the start of the glyph row.  */
 +      if (r1->displays_text_p)
 +      for (; glyph > end
 +             && INTEGERP (glyph->object)
 +             && glyph->charpos < 0;
 +           --glyph)
 +        ;
  
 -  glyph = row->glyphs[TEXT_AREA];
 -  end = glyph + row->used[TEXT_AREA];
 -  x = row->x;
 -  dpyinfo->mouse_face_end_y = row->y;
 -  dpyinfo->mouse_face_end_row = MATRIX_ROW_VPOS (row, w->current_matrix);
 +      /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING,
 +       or DISPLAY_STRING, and the first glyph from buffer whose
 +       position is between START_CHARPOS and END_CHARPOS.  */
 +      for (; glyph > end
 +           && !INTEGERP (glyph->object)
 +           && !EQ (glyph->object, display_string)
 +           && !(BUFFERP (glyph->object)
 +                && (glyph->charpos >= start_charpos
 +                    && glyph->charpos < end_charpos));
 +         --glyph)
 +      {
 +        /* BEFORE_STRING or AFTER_STRING are only relevant if they
 +           are present at buffer positions between START_CHARPOS and
 +           END_CHARPOS, or if they come from an overlay.  */
 +        if (EQ (glyph->object, before_string))
 +          {
 +            pos = string_buffer_position (w, before_string, start_charpos);
 +            /* If pos == 0, it means before_string came from an
 +               overlay, not from a buffer position.  */
 +            if (!pos || (pos >= start_charpos && pos < end_charpos))
 +              break;
 +          }
 +        else if (EQ (glyph->object, after_string))
 +          {
 +            pos = string_buffer_position (w, after_string, end_charpos);
 +            if (!pos || (pos >= start_charpos && pos < end_charpos))
 +              break;
 +          }
 +      }
  
 -  /* Skip truncation glyphs at the start of the row.  */
 -  if (row->displays_text_p)
 -    for (; glyph < end
 -         && INTEGERP (glyph->object)
 -         && glyph->charpos < 0;
 -       ++glyph)
 -      x += glyph->pixel_width;
 -
 -  /* Scan the glyph row, stopping at END_CHARPOS or when we encounter
 -     AFTER_STRING.  */
 -  for (; glyph < end
 -       && !INTEGERP (glyph->object)
 -       && !EQ (glyph->object, after_string)
 -       && !(BUFFERP (glyph->object) && glyph->charpos >= end_charpos);
 -       ++glyph)
 -    x += glyph->pixel_width;
 +      glyph++; /* first glyph to the right of the highlighted area */
 +      for (g = r1->glyphs[TEXT_AREA], x = r1->x; g < glyph; g++)
 +      x += g->pixel_width;
 +      hlinfo->mouse_face_beg_x = x;
 +      hlinfo->mouse_face_beg_col = glyph - r1->glyphs[TEXT_AREA];
 +    }
  
 -  /* If we found AFTER_STRING, consume it and stop.  */
 -  if (EQ (glyph->object, after_string))
 +  /* If the highlight ends in a different row, compute GLYPH and END
 +     for the end row.  Otherwise, reuse the values computed above for
 +     the row where the highlight begins.  */
 +  if (r2 != r1)
      {
 -      for (; EQ (glyph->object, after_string) && glyph < end; ++glyph)
 +      if (!r2->reversed_p)
 +      {
 +        glyph = r2->glyphs[TEXT_AREA];
 +        end = glyph + r2->used[TEXT_AREA];
 +        x = r2->x;
 +      }
 +      else
 +      {
 +        end = r2->glyphs[TEXT_AREA] - 1;
 +        glyph = end + r2->used[TEXT_AREA];
 +      }
 +    }
 +
 +  if (!r2->reversed_p)
 +    {
 +      /* Skip truncation and continuation glyphs near the end of the
 +       row, and also blanks and stretch glyphs inserted by
 +       extend_face_to_end_of_line.  */
 +      while (end > glyph
 +           && INTEGERP ((end - 1)->object)
 +           && (end - 1)->charpos <= 0)
 +      --end;
 +      /* Scan the rest of the glyph row from the end, looking for the
 +       first glyph that comes from BEFORE_STRING, AFTER_STRING, or
 +       DISPLAY_STRING, or whose position is between START_CHARPOS
 +       and END_CHARPOS */
 +      for (--end;
 +           end > glyph
 +           && !INTEGERP (end->object)
 +           && !EQ (end->object, display_string)
 +           && !(BUFFERP (end->object)
 +                && (end->charpos >= start_charpos
 +                    && end->charpos < end_charpos));
 +         --end)
 +      {
 +        /* BEFORE_STRING or AFTER_STRING are only relevant if they
 +           are present at buffer positions between START_CHARPOS and
 +           END_CHARPOS, or if they come from an overlay.  */
 +        if (EQ (end->object, before_string))
 +          {
 +            pos = string_buffer_position (w, before_string, start_charpos);
 +            if (!pos || (pos >= start_charpos && pos < end_charpos))
 +              break;
 +          }
 +        else if (EQ (end->object, after_string))
 +          {
 +            pos = string_buffer_position (w, after_string, end_charpos);
 +            if (!pos || (pos >= start_charpos && pos < end_charpos))
 +              break;
 +          }
 +      }
 +      /* Find the X coordinate of the last glyph to be highlighted.  */
 +      for (; glyph <= end; ++glyph)
        x += glyph->pixel_width;
 +
 +      hlinfo->mouse_face_end_x = x;
 +      hlinfo->mouse_face_end_col = glyph - r2->glyphs[TEXT_AREA];
      }
    else
      {
 -      /* If there's no after-string, we must check if we overshot,
 -       which might be the case if we stopped after a string glyph.
 -       That glyph may belong to a before-string or display-string
 -       associated with the end position, which must not be
 -       highlighted.  */
 -      Lisp_Object prev_object;
 -      int pos;
 -
 -      while (glyph > row->glyphs[TEXT_AREA])
 -      {
 -        prev_object = (glyph - 1)->object;
 -        if (!STRINGP (prev_object) || EQ (prev_object, display_string))
 -          break;
 -
 -        pos = string_buffer_position (w, prev_object, end_charpos);
 -        if (pos && pos < end_charpos)
 -          break;
 -
 -        for (; glyph > row->glyphs[TEXT_AREA]
 -               && EQ ((glyph - 1)->object, prev_object);
 -             --glyph)
 -          x -= (glyph - 1)->pixel_width;
 +      /* Skip truncation and continuation glyphs near the end of the
 +       row, and also blanks and stretch glyphs inserted by
 +       extend_face_to_end_of_line.  */
 +      x = r2->x;
 +      end++;
 +      while (end < glyph
 +           && INTEGERP (end->object)
 +           && end->charpos <= 0)
 +      {
 +        x += end->pixel_width;
 +        ++end;
 +      }
 +      /* Scan the rest of the glyph row from the end, looking for the
 +       first glyph that comes from BEFORE_STRING, AFTER_STRING, or
 +       DISPLAY_STRING, or whose position is between START_CHARPOS
 +       and END_CHARPOS */
 +      for ( ;
 +           end < glyph
 +           && !INTEGERP (end->object)
 +           && !EQ (end->object, display_string)
 +           && !(BUFFERP (end->object)
 +                && (end->charpos >= start_charpos
 +                    && end->charpos < end_charpos));
 +         ++end)
 +      {
 +        /* BEFORE_STRING or AFTER_STRING are only relevant if they
 +           are present at buffer positions between START_CHARPOS and
 +           END_CHARPOS, or if they come from an overlay.  */
 +        if (EQ (end->object, before_string))
 +          {
 +            pos = string_buffer_position (w, before_string, start_charpos);
 +            if (!pos || (pos >= start_charpos && pos < end_charpos))
 +              break;
 +          }
 +        else if (EQ (end->object, after_string))
 +          {
 +            pos = string_buffer_position (w, after_string, end_charpos);
 +            if (!pos || (pos >= start_charpos && pos < end_charpos))
 +              break;
 +          }
 +        x += end->pixel_width;
        }
 +      hlinfo->mouse_face_end_x = x;
 +      hlinfo->mouse_face_end_col = end - r2->glyphs[TEXT_AREA];
      }
  
 -  dpyinfo->mouse_face_end_x = x;
 -  dpyinfo->mouse_face_end_col = glyph - row->glyphs[TEXT_AREA];
 -  dpyinfo->mouse_face_window = window;
 -  dpyinfo->mouse_face_face_id
 +  hlinfo->mouse_face_window = window;
 +  hlinfo->mouse_face_face_id
      = face_at_buffer_position (w, mouse_charpos, 0, 0, &ignore,
                               mouse_charpos + 1,
 -                             !dpyinfo->mouse_face_hidden, -1);
 -  show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
 +                             !hlinfo->mouse_face_hidden, -1);
 +  show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
  }
  
 +/* The following function is not used anymore (replaced with
 +   mouse_face_from_string_pos), but I leave it here for the time
 +   being, in case someone would.  */
 +
 +#if 0 /* not used */
  
  /* Find the position of the glyph for position POS in OBJECT in
     window W's current matrix, and return in *X, *Y the pixel
     Value is non-zero if a glyph was found.  */
  
  static int
 -fast_find_string_pos (w, pos, object, hpos, vpos, x, y, right_p)
 -     struct window *w;
 -     EMACS_INT pos;
 -     Lisp_Object object;
 -     int *hpos, *vpos, *x, *y;
 -     int right_p;
 +fast_find_string_pos (struct window *w, EMACS_INT pos, Lisp_Object object,
 +                    int *hpos, int *vpos, int *x, int *y, int right_p)
  {
    int yb = window_text_bottom_y (w);
    struct glyph_row *r;
  
    return best_glyph != NULL;
  }
 +#endif        /* not used */
 +
 +/* Find the positions of the first and the last glyphs in window W's
 +   current matrix that occlude positions [STARTPOS..ENDPOS] in OBJECT
 +   (assumed to be a string), and return in HLINFO's mouse_face_*
 +   members the pixel and column/row coordinates of those glyphs.  */
 +
 +static void
 +mouse_face_from_string_pos (struct window *w, Mouse_HLInfo *hlinfo,
 +                          Lisp_Object object,
 +                          EMACS_INT startpos, EMACS_INT endpos)
 +{
 +  int yb = window_text_bottom_y (w);
 +  struct glyph_row *r;
 +  struct glyph *g, *e;
 +  int gx;
 +  int found = 0;
 +
 +  /* Find the glyph row with at least one position in the range
 +     [STARTPOS..ENDPOS], and the first glyph in that row whose
 +     position belongs to that range.  */
 +  for (r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
 +       r->enabled_p && r->y < yb;
 +       ++r)
 +    {
 +      if (!r->reversed_p)
 +      {
 +        g = r->glyphs[TEXT_AREA];
 +        e = g + r->used[TEXT_AREA];
 +        for (gx = r->x; g < e; gx += g->pixel_width, ++g)
 +          if (EQ (g->object, object)
 +              && startpos <= g->charpos && g->charpos <= endpos)
 +            {
 +              hlinfo->mouse_face_beg_row = r - w->current_matrix->rows;
 +              hlinfo->mouse_face_beg_y = r->y;
 +              hlinfo->mouse_face_beg_col = g - r->glyphs[TEXT_AREA];
 +              hlinfo->mouse_face_beg_x = gx;
 +              found = 1;
 +              break;
 +            }
 +      }
 +      else
 +      {
 +        struct glyph *g1;
 +
 +        e = r->glyphs[TEXT_AREA];
 +        g = e + r->used[TEXT_AREA];
 +        for ( ; g > e; --g)
 +          if (EQ ((g-1)->object, object)
 +              && startpos <= (g-1)->charpos && (g-1)->charpos <= endpos)
 +            {
 +              hlinfo->mouse_face_beg_row = r - w->current_matrix->rows;
 +              hlinfo->mouse_face_beg_y = r->y;
 +              hlinfo->mouse_face_beg_col = g - r->glyphs[TEXT_AREA];
 +              for (gx = r->x, g1 = r->glyphs[TEXT_AREA]; g1 < g; ++g1)
 +                gx += g1->pixel_width;
 +              hlinfo->mouse_face_beg_x = gx;
 +              found = 1;
 +              break;
 +            }
 +      }
 +      if (found)
 +      break;
 +    }
 +
 +  if (!found)
 +    return;
 +
 +  /* Starting with the next row, look for the first row which does NOT
 +     include any glyphs whose positions are in the range.  */
 +  for (++r; r->enabled_p && r->y < yb; ++r)
 +    {
 +      g = r->glyphs[TEXT_AREA];
 +      e = g + r->used[TEXT_AREA];
 +      found = 0;
 +      for ( ; g < e; ++g)
 +      if (EQ (g->object, object)
 +          && startpos <= g->charpos && g->charpos <= endpos)
 +        {
 +          found = 1;
 +          break;
 +        }
 +      if (!found)
 +      break;
 +    }
 +
 +  /* The highlighted region ends on the previous row.  */
 +  r--;
 +
 +  /* Set the end row and its vertical pixel coordinate.  */
 +  hlinfo->mouse_face_end_row = r - w->current_matrix->rows;
 +  hlinfo->mouse_face_end_y = r->y;
 +
 +  /* Compute and set the end column and the end column's horizontal
 +     pixel coordinate.  */
 +  if (!r->reversed_p)
 +    {
 +      g = r->glyphs[TEXT_AREA];
 +      e = g + r->used[TEXT_AREA];
 +      for ( ; e > g; --e)
 +      if (EQ ((e-1)->object, object)
 +          && startpos <= (e-1)->charpos && (e-1)->charpos <= endpos)
 +        break;
 +      hlinfo->mouse_face_end_col = e - g;
 +
 +      for (gx = r->x; g < e; ++g)
 +      gx += g->pixel_width;
 +      hlinfo->mouse_face_end_x = gx;
 +    }
 +  else
 +    {
 +      e = r->glyphs[TEXT_AREA];
 +      g = e + r->used[TEXT_AREA];
 +      for (gx = r->x ; e < g; ++e)
 +      {
 +        if (EQ (e->object, object)
 +            && startpos <= e->charpos && e->charpos <= endpos)
 +          break;
 +        gx += e->pixel_width;
 +      }
 +      hlinfo->mouse_face_end_col = e - r->glyphs[TEXT_AREA];
 +      hlinfo->mouse_face_end_x = gx;
 +    }
 +}
  
 +#ifdef HAVE_WINDOW_SYSTEM
  
  /* See if position X, Y is within a hot-spot of an image.  */
  
  static int
 -on_hot_spot_p (hot_spot, x, y)
 -     Lisp_Object hot_spot;
 -     int x, y;
 +on_hot_spot_p (Lisp_Object hot_spot, int x, int y)
  {
    if (!CONSP (hot_spot))
      return 0;
  }
  
  Lisp_Object
 -find_hot_spot (map, x, y)
 -     Lisp_Object map;
 -     int x, y;
 +find_hot_spot (Lisp_Object map, int x, int y)
  {
    while (CONSP (map))
      {
@@@ -24834,7 -23159,9 +24851,7 @@@ and the radius of the circle; r may be 
  A polygon is a cons (poly . [x0 y0 x1 y1 ...]) where each pair in the
  vector describes one corner in the polygon.
  Returns the alist element for the first matching AREA in MAP.  */)
 -     (map, x, y)
 -     Lisp_Object map;
 -     Lisp_Object x, y;
 +  (Lisp_Object map, Lisp_Object x, Lisp_Object y)
  {
    if (NILP (map))
      return Qnil;
  
  /* Display frame CURSOR, optionally using shape defined by POINTER.  */
  static void
 -define_frame_cursor1 (f, cursor, pointer)
 -     struct frame *f;
 -     Cursor cursor;
 -     Lisp_Object pointer;
 +define_frame_cursor1 (struct frame *f, Cursor cursor, Lisp_Object pointer)
  {
    /* Do not change cursor shape while dragging mouse.  */
    if (!NILP (do_mouse_tracking))
      FRAME_RIF (f)->define_frame_cursor (f, cursor);
  }
  
 +#endif        /* HAVE_WINDOW_SYSTEM */
 +
  /* Take proper action when mouse has moved to the mode or header line
     or marginal area AREA of window W, x-position X and y-position Y.
     X is relative to the start of the text display area of W, so the
     position relative to the start of the mode line.  */
  
  static void
 -note_mode_line_or_margin_highlight (window, x, y, area)
 -     Lisp_Object window;
 -     int x, y;
 -     enum window_part area;
 +note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
 +                                  enum window_part area)
  {
    struct window *w = XWINDOW (window);
    struct frame *f = XFRAME (w->frame);
 -  Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
 -  Cursor cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
 +  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
 +#ifdef HAVE_WINDOW_SYSTEM
 +  Display_Info *dpyinfo;
 +#endif
 +  Cursor cursor = No_Cursor;
    Lisp_Object pointer = Qnil;
 -  int charpos, dx, dy, width, height;
 +  int dx, dy, width, height;
 +  EMACS_INT charpos;
    Lisp_Object string, object = Qnil;
    Lisp_Object pos, help;
  
        int x0;
        struct glyph *end;
  
 +      /* Kludge alert: mode_line_string takes X/Y in pixels, but
 +       returns them in row/column units!  */
        string = mode_line_string (w, area, &x, &y, &charpos,
                                 &object, &dx, &dy, &width, &height);
  
             ? MATRIX_MODE_LINE_ROW (w->current_matrix)
             : MATRIX_HEADER_LINE_ROW (w->current_matrix));
  
 -      /* Find glyph */
 +      /* Find the glyph under the mouse pointer.  */
        if (row->mode_line_p && row->enabled_p)
        {
          glyph = row_start_glyph = row->glyphs[TEXT_AREA];
    else
      {
        x -= WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w);
 +      /* Kludge alert: marginal_area_string takes X/Y in pixels, but
 +       returns them in row/column units!  */
        string = marginal_area_string (w, area, &x, &y, &charpos,
                                     &object, &dx, &dy, &width, &height);
      }
  
    help = Qnil;
  
 +#ifdef HAVE_WINDOW_SYSTEM
    if (IMAGEP (object))
      {
        Lisp_Object image_map, hotspot;
        if (NILP (pointer))
        pointer = Fplist_get (XCDR (object), QCpointer);
      }
 +#endif        /* HAVE_WINDOW_SYSTEM */
  
    if (STRINGP (string))
      {
            }
        }
  
 -      if (NILP (pointer))
 -      pointer = Fget_text_property (pos, Qpointer, string);
 -
 -     /* Change the mouse pointer according to what is under X/Y.  */
 -      if (NILP (pointer) && ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE)))
 +#ifdef HAVE_WINDOW_SYSTEM
 +      if (FRAME_WINDOW_P (f))
        {
 -        Lisp_Object map;
 -        map = Fget_text_property (pos, Qlocal_map, string);
 -        if (!KEYMAPP (map))
 -          map = Fget_text_property (pos, Qkeymap, string);
 -        if (!KEYMAPP (map))
 -          cursor = dpyinfo->vertical_scroll_bar_cursor;
 +        dpyinfo = FRAME_X_DISPLAY_INFO (f);
 +        cursor  = FRAME_X_OUTPUT (f)->nontext_cursor;
 +        if (NILP (pointer))
 +          pointer = Fget_text_property (pos, Qpointer, string);
 +
 +        /* Change the mouse pointer according to what is under X/Y.  */
 +        if (NILP (pointer)
 +            && ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE)))
 +          {
 +            Lisp_Object map;
 +            map = Fget_text_property (pos, Qlocal_map, string);
 +            if (!KEYMAPP (map))
 +              map = Fget_text_property (pos, Qkeymap, string);
 +            if (!KEYMAPP (map))
 +              cursor = dpyinfo->vertical_scroll_bar_cursor;
 +          }
        }
 +#endif
  
       /* Change the mouse face according to what is under X/Y.  */
        mouse_face = Fget_text_property (pos, Qmouse_face, string);
          int gpos;
          int gseq_length;
          int total_pixel_width;
 -        EMACS_INT ignore;
 +        EMACS_INT begpos, endpos, ignore;
  
          int vpos, hpos;
  
          b = Fprevious_single_property_change (make_number (charpos + 1),
                                                Qmouse_face, string, Qnil);
          if (NILP (b))
 -          b = make_number (0);
 +          begpos = 0;
 +        else
 +          begpos = XINT (b);
  
          e = Fnext_single_property_change (pos, Qmouse_face, string, Qnil);
          if (NILP (e))
 -          e = make_number (SCHARS (string));
 -
 -        /* Calculate the position(glyph position: GPOS) of GLYPH in
 -           displayed string. GPOS is different from CHARPOS.
 -
 -           CHARPOS is the position of glyph in internal string
 -           object. A mode line string format has structures which
 -           is converted to a flatten by emacs lisp interpreter.
 -           The internal string is an element of the structures.
 -           The displayed string is the flatten string. */
 -        gpos = 0;
 -        if (glyph > row_start_glyph)
 -          {
 -            tmp_glyph = glyph - 1;
 -            while (tmp_glyph >= row_start_glyph
 -                   && tmp_glyph->charpos >= XINT (b)
 -                   && EQ (tmp_glyph->object, glyph->object))
 -              {
 -                tmp_glyph--;
 -                gpos++;
 -              }
 -          }
 -
 -        /* Calculate the lenght(glyph sequence length: GSEQ_LENGTH) of
 -           displayed string holding GLYPH.
 -
 -           GSEQ_LENGTH is different from SCHARS (STRING).
 -           SCHARS (STRING) returns the length of the internal string. */
 -        for (tmp_glyph = glyph, gseq_length = gpos;
 -             tmp_glyph->charpos < XINT (e);
 -             tmp_glyph++, gseq_length++)
 -            {
 -              if (!EQ (tmp_glyph->object, glyph->object))
 -                break;
 -            }
 -
 +          endpos = SCHARS (string);
 +        else
 +          endpos = XINT (e);
 +
 +        /* Calculate the glyph position GPOS of GLYPH in the
 +           displayed string, relative to the beginning of the
 +           highlighted part of the string.
 +
 +           Note: GPOS is different from CHARPOS.  CHARPOS is the
 +           position of GLYPH in the internal string object.  A mode
 +           line string format has structures which are converted to
 +           a flattened string by the Emacs Lisp interpreter.  The
 +           internal string is an element of those structures.  The
 +           displayed string is the flattened string.  */
 +        tmp_glyph = row_start_glyph;
 +        while (tmp_glyph < glyph
 +               && (!(EQ (tmp_glyph->object, glyph->object)
 +                     && begpos <= tmp_glyph->charpos
 +                     && tmp_glyph->charpos < endpos)))
 +          tmp_glyph++;
 +        gpos = glyph - tmp_glyph;
 +
 +        /* Calculate the length GSEQ_LENGTH of the glyph sequence of
 +           the highlighted part of the displayed string to which
 +           GLYPH belongs.  Note: GSEQ_LENGTH is different from
 +           SCHARS (STRING), because the latter returns the length of
 +           the internal string.  */
 +        for (tmp_glyph = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1;
 +             tmp_glyph > glyph
 +               && (!(EQ (tmp_glyph->object, glyph->object)
 +                     && begpos <= tmp_glyph->charpos
 +                     && tmp_glyph->charpos < endpos));
 +             tmp_glyph--)
 +          ;
 +        gseq_length = gpos + (tmp_glyph - glyph) + 1;
 +
 +        /* Calculate the total pixel width of all the glyphs between
 +           the beginning of the highlighted area and GLYPH.  */
          total_pixel_width = 0;
          for (tmp_glyph = glyph - gpos; tmp_glyph != glyph; tmp_glyph++)
            total_pixel_width += tmp_glyph->pixel_width;
  
 -        /* Pre calculation of re-rendering position */
 -        vpos = (x - gpos);
 -        hpos = (area == ON_MODE_LINE
 +        /* Pre calculation of re-rendering position.  Note: X is in
 +           column units here, after the call to mode_line_string or
 +           marginal_area_string.  */
 +        hpos = x - gpos;
 +        vpos = (area == ON_MODE_LINE
                  ? (w->current_matrix)->nrows - 1
                  : 0);
  
 -        /* If the re-rendering position is included in the last
 -           re-rendering area, we should do nothing. */
 -        if ( EQ (window, dpyinfo->mouse_face_window)
 -             && dpyinfo->mouse_face_beg_col <= vpos
 -             && vpos < dpyinfo->mouse_face_end_col
 -             && dpyinfo->mouse_face_beg_row == hpos )
 +        /* If GLYPH's position is included in the region that is
 +           already drawn in mouse face, we have nothing to do.  */
 +        if ( EQ (window, hlinfo->mouse_face_window)
 +             && (!row->reversed_p
 +                 ? (hlinfo->mouse_face_beg_col <= hpos
 +                    && hpos < hlinfo->mouse_face_end_col)
 +                 /* In R2L rows we swap BEG and END, see below.  */
 +                 : (hlinfo->mouse_face_end_col <= hpos
 +                    && hpos < hlinfo->mouse_face_beg_col))
 +             && hlinfo->mouse_face_beg_row == vpos )
            return;
  
 -        if (clear_mouse_face (dpyinfo))
 +        if (clear_mouse_face (hlinfo))
            cursor = No_Cursor;
  
 -        dpyinfo->mouse_face_beg_col = vpos;
 -        dpyinfo->mouse_face_beg_row = hpos;
 -
 -        dpyinfo->mouse_face_beg_x   = original_x_pixel - (total_pixel_width + dx);
 -        dpyinfo->mouse_face_beg_y   = 0;
 -
 -        dpyinfo->mouse_face_end_col = vpos + gseq_length;
 -        dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_beg_row;
 -
 -        dpyinfo->mouse_face_end_x   = 0;
 -        dpyinfo->mouse_face_end_y   = 0;
 -
 -        dpyinfo->mouse_face_past_end = 0;
 -        dpyinfo->mouse_face_window  = window;
 +        if (!row->reversed_p)
 +          {
 +            hlinfo->mouse_face_beg_col = hpos;
 +            hlinfo->mouse_face_beg_x   = original_x_pixel
 +                                          - (total_pixel_width + dx);
 +            hlinfo->mouse_face_end_col = hpos + gseq_length;
 +            hlinfo->mouse_face_end_x   = 0;
 +          }
 +        else
 +          {
 +            /* In R2L rows, show_mouse_face expects BEG and END
 +               coordinates to be swapped.  */
 +            hlinfo->mouse_face_end_col = hpos;
 +            hlinfo->mouse_face_end_x   = original_x_pixel
 +                                          - (total_pixel_width + dx);
 +            hlinfo->mouse_face_beg_col = hpos + gseq_length;
 +            hlinfo->mouse_face_beg_x   = 0;
 +          }
  
 -        dpyinfo->mouse_face_face_id = face_at_string_position (w, string,
 -                                                               charpos,
 -                                                               0, 0, 0, &ignore,
 -                                                               glyph->face_id, 1);
 -        show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
 +        hlinfo->mouse_face_beg_row  = vpos;
 +        hlinfo->mouse_face_end_row  = hlinfo->mouse_face_beg_row;
 +        hlinfo->mouse_face_beg_y    = 0;
 +        hlinfo->mouse_face_end_y    = 0;
 +        hlinfo->mouse_face_past_end = 0;
 +        hlinfo->mouse_face_window   = window;
 +
 +        hlinfo->mouse_face_face_id = face_at_string_position (w, string,
 +                                                              charpos,
 +                                                              0, 0, 0,
 +                                                              &ignore,
 +                                                              glyph->face_id,
 +                                                              1);
 +        show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
  
          if (NILP (pointer))
            pointer = Qhand;
        }
        else if ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE))
 -      clear_mouse_face (dpyinfo);
 +      clear_mouse_face (hlinfo);
      }
 -  define_frame_cursor1 (f, cursor, pointer);
 +#ifdef HAVE_WINDOW_SYSTEM
 +  if (FRAME_WINDOW_P (f))
 +    define_frame_cursor1 (f, cursor, pointer);
 +#endif
  }
  
  
     X and Y can be negative or out of range.  */
  
  void
 -note_mouse_highlight (f, x, y)
 -     struct frame *f;
 -     int x, y;
 +note_mouse_highlight (struct frame *f, int x, int y)
  {
 -  Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
 +  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
    enum window_part part;
    Lisp_Object window;
    struct window *w;
    struct buffer *b;
  
    /* When a menu is active, don't highlight because this looks odd.  */
 -#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS)
 +#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) || defined (MSDOS)
    if (popup_activated ())
      return;
  #endif
        || f->pointer_invisible)
      return;
  
 -  dpyinfo->mouse_face_mouse_x = x;
 -  dpyinfo->mouse_face_mouse_y = y;
 -  dpyinfo->mouse_face_mouse_frame = f;
 +  hlinfo->mouse_face_mouse_x = x;
 +  hlinfo->mouse_face_mouse_y = y;
 +  hlinfo->mouse_face_mouse_frame = f;
  
 -  if (dpyinfo->mouse_face_defer)
 +  if (hlinfo->mouse_face_defer)
      return;
  
    if (gc_in_progress)
      {
 -      dpyinfo->mouse_face_deferred_gc = 1;
 +      hlinfo->mouse_face_deferred_gc = 1;
        return;
      }
  
    /* Which window is that in?  */
 -  window = window_from_coordinates (f, x, y, &part, 0, 0, 1);
 +  window = window_from_coordinates (f, x, y, &part, 1);
  
    /* If we were displaying active text in another window, clear that.
       Also clear if we move out of text area in same window.  */
 -  if (! EQ (window, dpyinfo->mouse_face_window)
 +  if (! EQ (window, hlinfo->mouse_face_window)
        || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE
 -        && !NILP (dpyinfo->mouse_face_window)))
 -    clear_mouse_face (dpyinfo);
 +        && !NILP (hlinfo->mouse_face_window)))
 +    clear_mouse_face (hlinfo);
  
    /* Not on a window -> return.  */
    if (!WINDOWP (window))
    w = XWINDOW (window);
    frame_to_window_pixel_xy (w, &x, &y);
  
 +#ifdef HAVE_WINDOW_SYSTEM
    /* Handle tool-bar window differently since it doesn't display a
       buffer.  */
    if (EQ (window, f->tool_bar_window))
        note_tool_bar_highlight (f, x, y);
        return;
      }
 +#endif
  
    /* Mouse is on the mode, header line or margin?  */
    if (part == ON_MODE_LINE || part == ON_HEADER_LINE
        return;
      }
  
 +#ifdef HAVE_WINDOW_SYSTEM
    if (part == ON_VERTICAL_BORDER)
      {
        cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
      cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
    else
      cursor = FRAME_X_OUTPUT (f)->text_cursor;
 +#endif
  
    /* Are we in a window whose display is up to date?
       And verify the buffer's text has not changed.  */
        && XFASTINT (w->last_modified) == BUF_MODIFF (b)
        && XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b))
      {
 -      int hpos, vpos, pos, i, dx, dy, area;
 +      int hpos, vpos, i, dx, dy, area;
 +      EMACS_INT pos;
        struct glyph *glyph;
        Lisp_Object object;
        Lisp_Object mouse_face = Qnil, overlay = Qnil, position;
        Lisp_Object *overlay_vec = NULL;
        int noverlays;
        struct buffer *obuf;
 -      int obegv, ozv, same_region;
 +      EMACS_INT obegv, ozv;
 +      int same_region;
  
        /* Find the glyph under X/Y.  */
        glyph = x_y_to_hpos_vpos (w, x, y, &hpos, &vpos, &dx, &dy, &area);
  
 +#ifdef HAVE_WINDOW_SYSTEM
        /* Look for :pointer property on image.  */
        if (glyph != NULL && glyph->type == IMAGE_GLYPH)
        {
              if ((image_map = Fplist_get (XCDR (img->spec), QCmap),
                   !NILP (image_map))
                  && (hotspot = find_hot_spot (image_map,
 -                                             glyph->slice.x + dx,
 -                                             glyph->slice.y + dy),
 +                                             glyph->slice.img.x + dx,
 +                                             glyph->slice.img.y + dy),
                      CONSP (hotspot))
                  && (hotspot = XCDR (hotspot), CONSP (hotspot)))
                {
                pointer = Fplist_get (XCDR (img->spec), QCpointer);
            }
        }
 +#endif        /* HAVE_WINDOW_SYSTEM */
  
        /* Clear mouse face if X/Y not over text.  */
        if (glyph == NULL
          || area != TEXT_AREA
 -        || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p)
 -      {
 -        if (clear_mouse_face (dpyinfo))
 +        || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p
 +        /* Glyph's OBJECT is an integer for glyphs inserted by the
 +           display engine for its internal purposes, like truncation
 +           and continuation glyphs and blanks beyond the end of
 +           line's text on text terminals.  If we are over such a
 +           glyph, we are not over any text.  */
 +        || INTEGERP (glyph->object)
 +        /* R2L rows have a stretch glyph at their front, which
 +           stands for no text, whereas L2R rows have no glyphs at
 +           all beyond the end of text.  Treat such stretch glyphs
 +           like we do with NULL glyphs in L2R rows.  */
 +        || (MATRIX_ROW (w->current_matrix, vpos)->reversed_p
 +            && glyph == MATRIX_ROW (w->current_matrix, vpos)->glyphs[TEXT_AREA]
 +            && glyph->type == STRETCH_GLYPH
 +            && glyph->avoid_cursor_p))
 +      {
 +        if (clear_mouse_face (hlinfo))
            cursor = No_Cursor;
 -        if (NILP (pointer))
 +#ifdef HAVE_WINDOW_SYSTEM
 +        if (FRAME_WINDOW_P (f) && NILP (pointer))
            {
              if (area != TEXT_AREA)
                cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
              else
                pointer = Vvoid_text_area_pointer;
            }
 +#endif
          goto set_cursor;
        }
  
        else
        noverlays = 0;
  
 -      same_region = (EQ (window, dpyinfo->mouse_face_window)
 -                   && vpos >= dpyinfo->mouse_face_beg_row
 -                   && vpos <= dpyinfo->mouse_face_end_row
 -                   && (vpos > dpyinfo->mouse_face_beg_row
 -                       || hpos >= dpyinfo->mouse_face_beg_col)
 -                   && (vpos < dpyinfo->mouse_face_end_row
 -                       || hpos < dpyinfo->mouse_face_end_col
 -                       || dpyinfo->mouse_face_past_end));
 +      same_region = coords_in_mouse_face_p (w, hpos, vpos);
  
        if (same_region)
        cursor = No_Cursor;
             the one we are currently highlighting, we have to
             check if we enter the overlapping overlay, and then
             highlight only that.  */
 -        || (OVERLAYP (dpyinfo->mouse_face_overlay)
 -            && mouse_face_overlay_overlaps (dpyinfo->mouse_face_overlay)))
 +        || (OVERLAYP (hlinfo->mouse_face_overlay)
 +            && mouse_face_overlay_overlaps (hlinfo->mouse_face_overlay)))
        {
          /* Find the highest priority overlay with a mouse-face.  */
          overlay = Qnil;
  
          /* If we're highlighting the same overlay as before, there's
             no need to do that again.  */
 -        if (!NILP (overlay) && EQ (overlay, dpyinfo->mouse_face_overlay))
 +        if (!NILP (overlay) && EQ (overlay, hlinfo->mouse_face_overlay))
            goto check_help_echo;
 -        dpyinfo->mouse_face_overlay = overlay;
 +        hlinfo->mouse_face_overlay = overlay;
  
          /* Clear the display of the old active region, if any.  */
 -        if (clear_mouse_face (dpyinfo))
 +        if (clear_mouse_face (hlinfo))
            cursor = No_Cursor;
  
          /* If no overlay applies, get a text property.  */
                b = make_number (0);
              if (NILP (e))
                e = make_number (SCHARS (object) - 1);
 -
 -            fast_find_string_pos (w, XINT (b), object,
 -                                  &dpyinfo->mouse_face_beg_col,
 -                                  &dpyinfo->mouse_face_beg_row,
 -                                  &dpyinfo->mouse_face_beg_x,
 -                                  &dpyinfo->mouse_face_beg_y, 0);
 -            fast_find_string_pos (w, XINT (e), object,
 -                                  &dpyinfo->mouse_face_end_col,
 -                                  &dpyinfo->mouse_face_end_row,
 -                                  &dpyinfo->mouse_face_end_x,
 -                                  &dpyinfo->mouse_face_end_y, 1);
 -            dpyinfo->mouse_face_past_end = 0;
 -            dpyinfo->mouse_face_window = window;
 -            dpyinfo->mouse_face_face_id
 +            mouse_face_from_string_pos (w, hlinfo, object,
 +                                        XINT (b), XINT (e));
 +            hlinfo->mouse_face_past_end = 0;
 +            hlinfo->mouse_face_window = window;
 +            hlinfo->mouse_face_face_id
                = face_at_string_position (w, object, pos, 0, 0, 0, &ignore,
                                           glyph->face_id, 1);
 -            show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
 +            show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
              cursor = No_Cursor;
            }
          else
                  /* If we are on a display string with no mouse-face,
                     check if the text under it has one.  */
                  struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos);
 -                int start = MATRIX_ROW_START_CHARPOS (r);
 +                EMACS_INT start = MATRIX_ROW_START_CHARPOS (r);
                  pos = string_buffer_position (w, object, start);
                  if (pos > 0)
                    {
                {
                  Lisp_Object before, after;
                  Lisp_Object before_string, after_string;
 +                /* To correctly find the limits of mouse highlight
 +                   in a bidi-reordered buffer, we must not use the
 +                   optimization of limiting the search in
 +                   previous-single-property-change and
 +                   next-single-property-change, because
 +                   rows_from_pos_range needs the real start and end
 +                   positions to DTRT in this case.  That's because
 +                   the first row visible in a window does not
 +                   necessarily display the character whose position
 +                   is the smallest.  */
 +                Lisp_Object lim1 =
 +                  NILP (B_ (XBUFFER (buffer), bidi_display_reordering))
 +                  ? Fmarker_position (w->start)
 +                  : Qnil;
 +                Lisp_Object lim2 =
 +                  NILP (B_ (XBUFFER (buffer), bidi_display_reordering))
 +                  ? make_number (BUF_Z (XBUFFER (buffer))
 +                                 - XFASTINT (w->window_end_pos))
 +                  : Qnil;
  
                  if (NILP (overlay))
                    {
                      /* Handle the text property case.  */
                      before = Fprevious_single_property_change
 -                      (make_number (pos + 1), Qmouse_face, buffer,
 -                       Fmarker_position (w->start));
 +                      (make_number (pos + 1), Qmouse_face, buffer, lim1);
                      after = Fnext_single_property_change
 -                      (make_number (pos), Qmouse_face, buffer,
 -                       make_number (BUF_Z (XBUFFER (buffer))
 -                                    - XFASTINT (w->window_end_pos)));
 +                      (make_number (pos), Qmouse_face, buffer, lim2);
                      before_string = after_string = Qnil;
                    }
                  else
                      if (!STRINGP (after_string))  after_string = Qnil;
                    }
  
 -                mouse_face_from_buffer_pos (window, dpyinfo, pos,
 +                mouse_face_from_buffer_pos (window, hlinfo, pos,
                                              XFASTINT (before),
                                              XFASTINT (after),
                                              before_string, after_string,
        else
          {
            Lisp_Object object = glyph->object;
 -          int charpos = glyph->charpos;
 +          EMACS_INT charpos = glyph->charpos;
  
            /* Try text properties.  */
            if (STRINGP (object)
                       see if the buffer text ``under'' it does.  */
                    struct glyph_row *r
                      = MATRIX_ROW (w->current_matrix, vpos);
 -                  int start = MATRIX_ROW_START_CHARPOS (r);
 -                  int pos = string_buffer_position (w, object, start);
 +                  EMACS_INT start = MATRIX_ROW_START_CHARPOS (r);
 +                  EMACS_INT pos = string_buffer_position (w, object, start);
                    if (pos > 0)
                      {
                        help = Fget_char_property (make_number (pos),
          }
        }
  
 +#ifdef HAVE_WINDOW_SYSTEM
        /* Look for a `pointer' property.  */
 -      if (NILP (pointer))
 +      if (FRAME_WINDOW_P (f) && NILP (pointer))
        {
          /* Check overlays first.  */
          for (i = noverlays - 1; i >= 0 && NILP (pointer); --i)
          if (NILP (pointer))
            {
              Lisp_Object object = glyph->object;
 -            int charpos = glyph->charpos;
 +            EMACS_INT charpos = glyph->charpos;
  
              /* Try text properties.  */
              if (STRINGP (object)
                         see if the buffer text ``under'' it does.  */
                      struct glyph_row *r
                        = MATRIX_ROW (w->current_matrix, vpos);
 -                    int start = MATRIX_ROW_START_CHARPOS (r);
 -                    int pos = string_buffer_position (w, object, start);
 +                    EMACS_INT start = MATRIX_ROW_START_CHARPOS (r);
 +                    EMACS_INT pos = string_buffer_position (w, object,
 +                                                            start);
                      if (pos > 0)
                        pointer = Fget_char_property (make_number (pos),
                                                      Qpointer, w->buffer);
                                              Qpointer, object);
            }
        }
 +#endif        /* HAVE_WINDOW_SYSTEM */
  
        BEGV = obegv;
        ZV = ozv;
  
   set_cursor:
  
 -  define_frame_cursor1 (f, cursor, pointer);
 +#ifdef HAVE_WINDOW_SYSTEM
 +  if (FRAME_WINDOW_P (f))
 +    define_frame_cursor1 (f, cursor, pointer);
 +#else
 +  /* This is here to prevent a compiler error, about "label at end of
 +     compound statement".  */
 +  return;
 +#endif
  }
  
  
     functions to ensure the mouse-highlight is off.  */
  
  void
 -x_clear_window_mouse_face (w)
 -     struct window *w;
 +x_clear_window_mouse_face (struct window *w)
  {
 -  Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame));
 +  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
    Lisp_Object window;
  
    BLOCK_INPUT;
    XSETWINDOW (window, w);
 -  if (EQ (window, dpyinfo->mouse_face_window))
 -    clear_mouse_face (dpyinfo);
 +  if (EQ (window, hlinfo->mouse_face_window))
 +    clear_mouse_face (hlinfo);
    UNBLOCK_INPUT;
  }
  
     This is used when the size of F is changed.  */
  
  void
 -cancel_mouse_face (f)
 -     struct frame *f;
 +cancel_mouse_face (struct frame *f)
  {
    Lisp_Object window;
 -  Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
 +  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
  
 -  window = dpyinfo->mouse_face_window;
 +  window = hlinfo->mouse_face_window;
    if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f)
      {
 -      dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
 -      dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
 -      dpyinfo->mouse_face_window = Qnil;
 +      hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
 +      hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
 +      hlinfo->mouse_face_window = Qnil;
      }
  }
  
  
 -#endif /* HAVE_WINDOW_SYSTEM */
 -
  \f
  /***********************************************************************
                           Exposure Events
     which intersects rectangle R.  R is in window-relative coordinates.  */
  
  static void
 -expose_area (w, row, r, area)
 -     struct window *w;
 -     struct glyph_row *row;
 -     XRectangle *r;
 -     enum glyph_row_area area;
 +expose_area (struct window *w, struct glyph_row *row, XRectangle *r,
 +           enum glyph_row_area area)
  {
    struct glyph *first = row->glyphs[area];
    struct glyph *end = row->glyphs[area] + row->used[area];
     non-zero if mouse-face was overwritten.  */
  
  static int
 -expose_line (w, row, r)
 -     struct window *w;
 -     struct glyph_row *row;
 -     XRectangle *r;
 +expose_line (struct window *w, struct glyph_row *row, XRectangle *r)
  {
    xassert (row->enabled_p);
  
     LAST_OVERLAPPING_ROW is the last such row.  */
  
  static void
 -expose_overlaps (w, first_overlapping_row, last_overlapping_row, r)
 -     struct window *w;
 -     struct glyph_row *first_overlapping_row;
 -     struct glyph_row *last_overlapping_row;
 -     XRectangle *r;
 +expose_overlaps (struct window *w,
 +               struct glyph_row *first_overlapping_row,
 +               struct glyph_row *last_overlapping_row,
 +               XRectangle *r)
  {
    struct glyph_row *row;
  
  /* Return non-zero if W's cursor intersects rectangle R.  */
  
  static int
 -phys_cursor_in_rect_p (w, r)
 -     struct window *w;
 -     XRectangle *r;
 +phys_cursor_in_rect_p (struct window *w, XRectangle *r)
  {
    XRectangle cr, result;
    struct glyph *cursor_glyph;
     have vertical scroll bars.  */
  
  void
 -x_draw_vertical_border (w)
 -     struct window *w;
 +x_draw_vertical_border (struct window *w)
  {
    struct frame *f = XFRAME (WINDOW_FRAME (w));
  
     mouse-face.  */
  
  static int
 -expose_window (w, fr)
 -     struct window *w;
 -     XRectangle *fr;
 +expose_window (struct window *w, XRectangle *fr)
  {
    struct frame *f = XFRAME (w->frame);
    XRectangle wr, r;
     non-zero if the exposure overwrites mouse-face.  */
  
  static int
 -expose_window_tree (w, r)
 -     struct window *w;
 -     XRectangle *r;
 +expose_window_tree (struct window *w, XRectangle *r)
  {
    struct frame *f = XFRAME (w->frame);
    int mouse_face_overwritten_p = 0;
     the entire frame.  */
  
  void
 -expose_frame (f, x, y, w, h)
 -     struct frame *f;
 -     int x, y, w, h;
 +expose_frame (struct frame *f, int x, int y, int w, int h)
  {
    XRectangle r;
    int mouse_face_overwritten_p = 0;
       focus-follows-mouse with delayed raise.  --jason 2001-10-12  */
    if (mouse_face_overwritten_p && !FRAME_GARBAGED_P (f))
      {
 -      Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
 -      if (f == dpyinfo->mouse_face_mouse_frame)
 +      Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
 +      if (f == hlinfo->mouse_face_mouse_frame)
        {
 -        int x = dpyinfo->mouse_face_mouse_x;
 -        int y = dpyinfo->mouse_face_mouse_y;
 -        clear_mouse_face (dpyinfo);
 +        int x = hlinfo->mouse_face_mouse_x;
 +        int y = hlinfo->mouse_face_mouse_y;
 +        clear_mouse_face (hlinfo);
          note_mouse_highlight (f, x, y);
        }
      }
     empty.  */
  
  int
 -x_intersect_rectangles (r1, r2, result)
 -     XRectangle *r1, *r2, *result;
 +x_intersect_rectangles (XRectangle *r1, XRectangle *r2, XRectangle *result)
  {
    XRectangle *left, *right;
    XRectangle *upper, *lower;
   ***********************************************************************/
  
  void
 -syms_of_xdisp ()
 +syms_of_xdisp (void)
  {
    Vwith_echo_area_save_vector = Qnil;
    staticpro (&Vwith_echo_area_save_vector);
  #endif
    defsubr (&Sformat_mode_line);
    defsubr (&Sinvisible_p);
 +  defsubr (&Scurrent_bidi_paragraph_direction);
  
    staticpro (&Qmenu_bar_update_hook);
    Qmenu_bar_update_hook = intern_c_string ("menu-bar-update-hook");
    staticpro (&Qnobreak_space);
    Qimage = intern_c_string ("image");
    staticpro (&Qimage);
 +  Qtext = intern_c_string ("text");
 +  staticpro (&Qtext);
 +  Qboth = intern_c_string ("both");
 +  staticpro (&Qboth);
 +  Qboth_horiz = intern_c_string ("both-horiz");
 +  staticpro (&Qboth_horiz);
 +  Qtext_image_horiz = intern_c_string ("text-image-horiz");
 +  staticpro (&Qtext_image_horiz);
    QCmap = intern_c_string (":map");
    staticpro (&QCmap);
    QCpointer = intern_c_string (":pointer");
    staticpro (&Qarrow);
    Qtext = intern_c_string ("text");
    staticpro (&Qtext);
 -  Qrisky_local_variable = intern_c_string ("risky-local-variable");
 -  staticpro (&Qrisky_local_variable);
    Qinhibit_free_realized_faces = intern_c_string ("inhibit-free-realized-faces");
    staticpro (&Qinhibit_free_realized_faces);
  
    staticpro (&previous_help_echo_string);
    help_echo_pos = -1;
  
 +  Qright_to_left = intern_c_string ("right-to-left");
 +  staticpro (&Qright_to_left);
 +  Qleft_to_right = intern_c_string ("left-to-right");
 +  staticpro (&Qleft_to_right);
 +
  #ifdef HAVE_WINDOW_SYSTEM
 -  DEFVAR_BOOL ("x-stretch-cursor", &x_stretch_cursor_p,
 +  DEFVAR_BOOL ("x-stretch-cursor", x_stretch_cursor_p,
      doc: /* *Non-nil means draw block cursor as wide as the glyph under it.
  For example, if a block cursor is over a tab, it will be drawn as
  wide as that tab on the display.  */);
    x_stretch_cursor_p = 0;
  #endif
  
 -  DEFVAR_LISP ("show-trailing-whitespace", &Vshow_trailing_whitespace,
 +  DEFVAR_LISP ("show-trailing-whitespace", Vshow_trailing_whitespace,
      doc: /* *Non-nil means highlight trailing whitespace.
  The face used for trailing whitespace is `trailing-whitespace'.  */);
    Vshow_trailing_whitespace = Qnil;
  
 -  DEFVAR_LISP ("nobreak-char-display", &Vnobreak_char_display,
 +  DEFVAR_LISP ("nobreak-char-display", Vnobreak_char_display,
      doc: /* *Control highlighting of nobreak space and soft hyphen.
  A value of t means highlight the character itself (for nobreak space,
  use face `nobreak-space').
@@@ -26463,47 -24726,47 +26480,47 @@@ Other values mean display the escape gl
  space or ordinary hyphen.  */);
    Vnobreak_char_display = Qt;
  
 -  DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer,
 +  DEFVAR_LISP ("void-text-area-pointer", Vvoid_text_area_pointer,
      doc: /* *The pointer shape to show in void text areas.
  A value of nil means to show the text pointer.  Other options are `arrow',
  `text', `hand', `vdrag', `hdrag', `modeline', and `hourglass'.  */);
    Vvoid_text_area_pointer = Qarrow;
  
 -  DEFVAR_LISP ("inhibit-redisplay", &Vinhibit_redisplay,
 +  DEFVAR_LISP ("inhibit-redisplay", Vinhibit_redisplay,
      doc: /* Non-nil means don't actually do any redisplay.
  This is used for internal purposes.  */);
    Vinhibit_redisplay = Qnil;
  
 -  DEFVAR_LISP ("global-mode-string", &Vglobal_mode_string,
 +  DEFVAR_LISP ("global-mode-string", Vglobal_mode_string,
      doc: /* String (or mode line construct) included (normally) in `mode-line-format'.  */);
    Vglobal_mode_string = Qnil;
  
 -  DEFVAR_LISP ("overlay-arrow-position", &Voverlay_arrow_position,
 +  DEFVAR_LISP ("overlay-arrow-position", Voverlay_arrow_position,
      doc: /* Marker for where to display an arrow on top of the buffer text.
  This must be the beginning of a line in order to work.
  See also `overlay-arrow-string'.  */);
    Voverlay_arrow_position = Qnil;
  
 -  DEFVAR_LISP ("overlay-arrow-string", &Voverlay_arrow_string,
 +  DEFVAR_LISP ("overlay-arrow-string", Voverlay_arrow_string,
      doc: /* String to display as an arrow in non-window frames.
  See also `overlay-arrow-position'.  */);
    Voverlay_arrow_string = make_pure_c_string ("=>");
  
 -  DEFVAR_LISP ("overlay-arrow-variable-list", &Voverlay_arrow_variable_list,
 +  DEFVAR_LISP ("overlay-arrow-variable-list", Voverlay_arrow_variable_list,
      doc: /* List of variables (symbols) which hold markers for overlay arrows.
  The symbols on this list are examined during redisplay to determine
  where to display overlay arrows.  */);
    Voverlay_arrow_variable_list
      = Fcons (intern_c_string ("overlay-arrow-position"), Qnil);
  
 -  DEFVAR_INT ("scroll-step", &scroll_step,
 +  DEFVAR_INT ("scroll-step", emacs_scroll_step,
      doc: /* *The number of lines to try scrolling a window by when point moves out.
  If that fails to bring point back on frame, point is centered instead.
  If this is zero, point is always centered after it moves off frame.
  If you want scrolling to always be a line at a time, you should set
  `scroll-conservatively' to a large value rather than set this to 1.  */);
  
 -  DEFVAR_INT ("scroll-conservatively", &scroll_conservatively,
 +  DEFVAR_INT ("scroll-conservatively", scroll_conservatively,
      doc: /* *Scroll up to this many lines, to bring point back on screen.
  If point moves off-screen, redisplay will scroll by up to
  `scroll-conservatively' lines in order to bring point just barely
@@@ -26513,23 -24776,23 +26530,23 @@@ recenters point as usual
  A value of zero means always recenter point if it moves off screen.  */);
    scroll_conservatively = 0;
  
 -  DEFVAR_INT ("scroll-margin", &scroll_margin,
 +  DEFVAR_INT ("scroll-margin", scroll_margin,
      doc: /* *Number of lines of margin at the top and bottom of a window.
  Recenter the window whenever point gets within this many lines
  of the top or bottom of the window.  */);
    scroll_margin = 0;
  
 -  DEFVAR_LISP ("display-pixels-per-inch",  &Vdisplay_pixels_per_inch,
 +  DEFVAR_LISP ("display-pixels-per-inch",  Vdisplay_pixels_per_inch,
      doc: /* Pixels per inch value for non-window system displays.
  Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI).  */);
    Vdisplay_pixels_per_inch = make_float (72.0);
  
  #if GLYPH_DEBUG
 -  DEFVAR_INT ("debug-end-pos", &debug_end_pos, doc: /* Don't ask.  */);
 +  DEFVAR_INT ("debug-end-pos", debug_end_pos, doc: /* Don't ask.  */);
  #endif
  
    DEFVAR_LISP ("truncate-partial-width-windows",
 -             &Vtruncate_partial_width_windows,
 +             Vtruncate_partial_width_windows,
      doc: /* Non-nil means truncate lines in windows narrower than the frame.
  For an integer value, truncate lines in each window narrower than the
  full frame width, provided the window width is less than that integer;
@@@ -26543,36 -24806,36 +26560,36 @@@ A value of nil means to respect the val
  If `word-wrap' is enabled, you might want to reduce this.  */);
    Vtruncate_partial_width_windows = make_number (50);
  
 -  DEFVAR_BOOL ("mode-line-inverse-video", &mode_line_inverse_video,
 +  DEFVAR_BOOL ("mode-line-inverse-video", mode_line_inverse_video,
      doc: /* When nil, display the mode-line/header-line/menu-bar in the default face.
  Any other value means to use the appropriate face, `mode-line',
  `header-line', or `menu' respectively.  */);
    mode_line_inverse_video = 1;
  
 -  DEFVAR_LISP ("line-number-display-limit", &Vline_number_display_limit,
 +  DEFVAR_LISP ("line-number-display-limit", Vline_number_display_limit,
      doc: /* *Maximum buffer size for which line number should be displayed.
  If the buffer is bigger than this, the line number does not appear
  in the mode line.  A value of nil means no limit.  */);
    Vline_number_display_limit = Qnil;
  
    DEFVAR_INT ("line-number-display-limit-width",
 -            &line_number_display_limit_width,
 +            line_number_display_limit_width,
      doc: /* *Maximum line width (in characters) for line number display.
  If the average length of the lines near point is bigger than this, then the
  line number may be omitted from the mode line.  */);
    line_number_display_limit_width = 200;
  
 -  DEFVAR_BOOL ("highlight-nonselected-windows", &highlight_nonselected_windows,
 +  DEFVAR_BOOL ("highlight-nonselected-windows", highlight_nonselected_windows,
      doc: /* *Non-nil means highlight region even in nonselected windows.  */);
    highlight_nonselected_windows = 0;
  
 -  DEFVAR_BOOL ("multiple-frames", &multiple_frames,
 +  DEFVAR_BOOL ("multiple-frames", multiple_frames,
      doc: /* Non-nil if more than one frame is visible on this display.
  Minibuffer-only frames don't count, but iconified frames do.
  This variable is not guaranteed to be accurate except while processing
  `frame-title-format' and `icon-title-format'.  */);
  
 -  DEFVAR_LISP ("frame-title-format", &Vframe_title_format,
 +  DEFVAR_LISP ("frame-title-format", Vframe_title_format,
      doc: /* Template for displaying the title bar of visible frames.
  \(Assuming the window manager supports this feature.)
  
@@@ -26580,7 -24843,7 +26597,7 @@@ This variable has the same structure a
  the %c and %l constructs are ignored.  It is used only on frames for
  which no explicit name has been set \(see `modify-frame-parameters').  */);
  
 -  DEFVAR_LISP ("icon-title-format", &Vicon_title_format,
 +  DEFVAR_LISP ("icon-title-format", Vicon_title_format,
      doc: /* Template for displaying the title bar of an iconified frame.
  \(Assuming the window manager supports this feature.)
  This variable has the same structure as `mode-line-format' (which see),
@@@ -26597,13 -24860,13 +26614,13 @@@ and is used only on frames for which n
                                                                                   Qnil)))),
                                       Qnil)));
  
 -  DEFVAR_LISP ("message-log-max", &Vmessage_log_max,
 +  DEFVAR_LISP ("message-log-max", Vmessage_log_max,
      doc: /* Maximum number of lines to keep in the message log buffer.
  If nil, disable message logging.  If t, log messages but don't truncate
  the buffer when it becomes large.  */);
    Vmessage_log_max = make_number (100);
  
 -  DEFVAR_LISP ("window-size-change-functions", &Vwindow_size_change_functions,
 +  DEFVAR_LISP ("window-size-change-functions", Vwindow_size_change_functions,
      doc: /* Functions called before redisplay, if window sizes have changed.
  The value should be a list of functions that take one argument.
  Just before redisplay, for each frame, if any of its windows have changed
@@@ -26611,7 -24874,7 +26628,7 @@@ size since the last redisplay, or have 
  all the functions in the list are called, with the frame as argument.  */);
    Vwindow_size_change_functions = Qnil;
  
 -  DEFVAR_LISP ("window-scroll-functions", &Vwindow_scroll_functions,
 +  DEFVAR_LISP ("window-scroll-functions", Vwindow_scroll_functions,
      doc: /* List of functions to call before redisplaying a window with scrolling.
  Each function is called with two arguments, the window and its new
  display-start position.  Note that these functions are also called by
@@@ -26620,17 -24883,17 +26637,17 @@@ valid when these functions are called
    Vwindow_scroll_functions = Qnil;
  
    DEFVAR_LISP ("window-text-change-functions",
 -             &Vwindow_text_change_functions,
 +             Vwindow_text_change_functions,
      doc: /* Functions to call in redisplay when text in the window might change.  */);
    Vwindow_text_change_functions = Qnil;
  
 -  DEFVAR_LISP ("redisplay-end-trigger-functions", &Vredisplay_end_trigger_functions,
 +  DEFVAR_LISP ("redisplay-end-trigger-functions", Vredisplay_end_trigger_functions,
      doc: /* Functions called when redisplay of a window reaches the end trigger.
  Each function is called with two arguments, the window and the end trigger value.
  See `set-window-redisplay-end-trigger'.  */);
    Vredisplay_end_trigger_functions = Qnil;
  
 -  DEFVAR_LISP ("mouse-autoselect-window", &Vmouse_autoselect_window,
 +  DEFVAR_LISP ("mouse-autoselect-window", Vmouse_autoselect_window,
       doc: /* *Non-nil means autoselect window with mouse pointer.
  If nil, do not autoselect windows.
  A positive number means delay autoselection by that many seconds: a
@@@ -26650,7 -24913,7 +26667,7 @@@ When customizing this variable make sur
  `focus-follows-mouse' matches the behavior of your window manager.  */);
    Vmouse_autoselect_window = Qnil;
  
 -  DEFVAR_LISP ("auto-resize-tool-bars", &Vauto_resize_tool_bars,
 +  DEFVAR_LISP ("auto-resize-tool-bars", Vauto_resize_tool_bars,
      doc: /* *Non-nil means automatically resize tool-bars.
  This dynamically changes the tool-bar's height to the minimum height
  that is needed to make all tool-bar items visible.
@@@ -26658,15 -24921,15 +26675,15 @@@ If value is `grow-only', the tool-bar'
  automatically; to decrease the tool-bar height, use \\[recenter].  */);
    Vauto_resize_tool_bars = Qt;
  
 -  DEFVAR_BOOL ("auto-raise-tool-bar-buttons", &auto_raise_tool_bar_buttons_p,
 +  DEFVAR_BOOL ("auto-raise-tool-bar-buttons", auto_raise_tool_bar_buttons_p,
      doc: /* *Non-nil means raise tool-bar buttons when the mouse moves over them.  */);
    auto_raise_tool_bar_buttons_p = 1;
  
 -  DEFVAR_BOOL ("make-cursor-line-fully-visible", &make_cursor_line_fully_visible_p,
 +  DEFVAR_BOOL ("make-cursor-line-fully-visible", make_cursor_line_fully_visible_p,
      doc: /* *Non-nil means to scroll (recenter) cursor line if it is not fully visible.  */);
    make_cursor_line_fully_visible_p = 1;
  
 -  DEFVAR_LISP ("tool-bar-border", &Vtool_bar_border,
 +  DEFVAR_LISP ("tool-bar-border", Vtool_bar_border,
      doc: /* *Border below tool-bar in pixels.
  If an integer, use it as the height of the border.
  If it is one of `internal-border-width' or `border-width', use the
@@@ -26674,7 -24937,7 +26691,7 @@@ value of the corresponding frame parame
  Otherwise, no border is added below the tool-bar.  */);
    Vtool_bar_border = Qinternal_border_width;
  
 -  DEFVAR_LISP ("tool-bar-button-margin", &Vtool_bar_button_margin,
 +  DEFVAR_LISP ("tool-bar-button-margin", Vtool_bar_button_margin,
      doc: /* *Margin around tool-bar buttons in pixels.
  If an integer, use that for both horizontal and vertical margins.
  Otherwise, value should be a pair of integers `(HORZ . VERT)' with
@@@ -26682,28 -24945,11 +26699,28 @@@ HORZ specifying the horizontal margin, 
  vertical margin.  */);
    Vtool_bar_button_margin = make_number (DEFAULT_TOOL_BAR_BUTTON_MARGIN);
  
 -  DEFVAR_INT ("tool-bar-button-relief", &tool_bar_button_relief,
 +  DEFVAR_INT ("tool-bar-button-relief", tool_bar_button_relief,
      doc: /* *Relief thickness of tool-bar buttons.  */);
    tool_bar_button_relief = DEFAULT_TOOL_BAR_BUTTON_RELIEF;
  
 -  DEFVAR_LISP ("fontification-functions", &Vfontification_functions,
 +  DEFVAR_LISP ("tool-bar-style", Vtool_bar_style,
 +    doc: /* Tool bar style to use.
 +It can be one of
 + image            - show images only
 + text             - show text only
 + both             - show both, text below image
 + both-horiz       - show text to the right of the image
 + text-image-horiz - show text to the left of the image
 + any other        - use system default or image if no system default.  */);
 +  Vtool_bar_style = Qnil;
 +
 +  DEFVAR_INT ("tool-bar-max-label-size", tool_bar_max_label_size,
 +    doc: /* *Maximum number of characters a label can have to be shown.
 +The tool bar style must also show labels for this to have any effect, see
 +`tool-bar-style'.  */);
 +  tool_bar_max_label_size = DEFAULT_TOOL_BAR_LABEL_SIZE;
 +
 +  DEFVAR_LISP ("fontification-functions", Vfontification_functions,
      doc: /* List of functions to call to fontify regions of text.
  Each function is called with one argument POS.  Functions must
  fontify a region starting at POS in the current buffer, and give
@@@ -26712,7 -24958,7 +26729,7 @@@ fontified regions the property `fontifi
    Fmake_variable_buffer_local (Qfontification_functions);
  
    DEFVAR_BOOL ("unibyte-display-via-language-environment",
 -               &unibyte_display_via_language_environment,
 +               unibyte_display_via_language_environment,
      doc: /* *Non-nil means display unibyte text according to language environment.
  Specifically, this means that raw bytes in the range 160-255 decimal
  are displayed by converting them to the equivalent multibyte characters
@@@ -26723,13 -24969,13 +26740,13 @@@ Note that this variable affects only ho
  but does not change the fact they are interpreted as raw bytes.  */);
    unibyte_display_via_language_environment = 0;
  
 -  DEFVAR_LISP ("max-mini-window-height", &Vmax_mini_window_height,
 +  DEFVAR_LISP ("max-mini-window-height", Vmax_mini_window_height,
      doc: /* *Maximum height for resizing mini-windows.
  If a float, it specifies a fraction of the mini-window frame's height.
  If an integer, it specifies a number of lines.  */);
    Vmax_mini_window_height = make_float (0.25);
  
 -  DEFVAR_LISP ("resize-mini-windows", &Vresize_mini_windows,
 +  DEFVAR_LISP ("resize-mini-windows", Vresize_mini_windows,
      doc: /* *How to resize mini-windows.
  A value of nil means don't automatically resize mini-windows.
  A value of t means resize them to fit the text displayed in them.
@@@ -26738,7 -24984,7 +26755,7 @@@ only, until their display becomes empty
  go back to their normal size.  */);
    Vresize_mini_windows = Qgrow_only;
  
 -  DEFVAR_LISP ("blink-cursor-alist", &Vblink_cursor_alist,
 +  DEFVAR_LISP ("blink-cursor-alist", Vblink_cursor_alist,
      doc: /* Alist specifying how to blink the cursor off.
  Each element has the form (ON-STATE . OFF-STATE).  Whenever the
  `cursor-type' frame-parameter or variable equals ON-STATE,
@@@ -26750,20 -24996,18 +26767,20 @@@ If a frame's ON-STATE has no entry in t
  the frame's other specifications determine how to blink the cursor off.  */);
    Vblink_cursor_alist = Qnil;
  
 -  DEFVAR_BOOL ("auto-hscroll-mode", &automatic_hscrolling_p,
 -    doc: /* *Non-nil means scroll the display automatically to make point visible.  */);
 +  DEFVAR_BOOL ("auto-hscroll-mode", automatic_hscrolling_p,
 +    doc: /* Allow or disallow automatic horizontal scrolling of windows.
 +If non-nil, windows are automatically scrolled horizontally to make
 +point visible.  */);
    automatic_hscrolling_p = 1;
    Qauto_hscroll_mode = intern_c_string ("auto-hscroll-mode");
    staticpro (&Qauto_hscroll_mode);
  
 -  DEFVAR_INT ("hscroll-margin", &hscroll_margin,
 +  DEFVAR_INT ("hscroll-margin", hscroll_margin,
      doc: /* *How many columns away from the window edge point is allowed to get
  before automatic hscrolling will horizontally scroll the window.  */);
    hscroll_margin = 5;
  
 -  DEFVAR_LISP ("hscroll-step", &Vhscroll_step,
 +  DEFVAR_LISP ("hscroll-step", Vhscroll_step,
      doc: /* *How many columns to scroll the window when point gets too close to the edge.
  When point is less than `hscroll-margin' columns from the window
  edge, automatic hscrolling will scroll the window by the amount of columns
@@@ -26781,28 -25025,28 +26798,28 @@@ Note that the lower bound for automati
  and `scroll-right' overrides this variable's effect.  */);
    Vhscroll_step = make_number (0);
  
 -  DEFVAR_BOOL ("message-truncate-lines", &message_truncate_lines,
 +  DEFVAR_BOOL ("message-truncate-lines", message_truncate_lines,
      doc: /* If non-nil, messages are truncated instead of resizing the echo area.
  Bind this around calls to `message' to let it take effect.  */);
    message_truncate_lines = 0;
  
 -  DEFVAR_LISP ("menu-bar-update-hook",  &Vmenu_bar_update_hook,
 +  DEFVAR_LISP ("menu-bar-update-hook",  Vmenu_bar_update_hook,
      doc: /* Normal hook run to update the menu bar definitions.
  Redisplay runs this hook before it redisplays the menu bar.
  This is used to update submenus such as Buffers,
  whose contents depend on various data.  */);
    Vmenu_bar_update_hook = Qnil;
  
 -  DEFVAR_LISP ("menu-updating-frame", &Vmenu_updating_frame,
 +  DEFVAR_LISP ("menu-updating-frame", Vmenu_updating_frame,
               doc: /* Frame for which we are updating a menu.
  The enable predicate for a menu binding should check this variable.  */);
    Vmenu_updating_frame = Qnil;
  
 -  DEFVAR_BOOL ("inhibit-menubar-update", &inhibit_menubar_update,
 +  DEFVAR_BOOL ("inhibit-menubar-update", inhibit_menubar_update,
      doc: /* Non-nil means don't update menu bars.  Internal use only.  */);
    inhibit_menubar_update = 0;
  
 -  DEFVAR_LISP ("wrap-prefix", &Vwrap_prefix,
 +  DEFVAR_LISP ("wrap-prefix", Vwrap_prefix,
      doc: /* Prefix prepended to all continuation lines at display time.
  The value may be a string, an image, or a stretch-glyph; it is
  interpreted in the same way as the value of a `display' text property.
@@@ -26816,7 -25060,7 +26833,7 @@@ To add a prefix to non-continuation lin
    Qwrap_prefix = intern_c_string ("wrap-prefix");
    Fmake_variable_buffer_local (Qwrap_prefix);
  
 -  DEFVAR_LISP ("line-prefix", &Vline_prefix,
 +  DEFVAR_LISP ("line-prefix", Vline_prefix,
      doc: /* Prefix prepended to all non-continuation lines at display time.
  The value may be a string, an image, or a stretch-glyph; it is
  interpreted in the same way as the value of a `display' text property.
@@@ -26830,36 -25074,36 +26847,36 @@@ To add a prefix to continuation lines, 
    Qline_prefix = intern_c_string ("line-prefix");
    Fmake_variable_buffer_local (Qline_prefix);
  
 -  DEFVAR_BOOL ("inhibit-eval-during-redisplay", &inhibit_eval_during_redisplay,
 +  DEFVAR_BOOL ("inhibit-eval-during-redisplay", inhibit_eval_during_redisplay,
      doc: /* Non-nil means don't eval Lisp during redisplay.  */);
    inhibit_eval_during_redisplay = 0;
  
 -  DEFVAR_BOOL ("inhibit-free-realized-faces", &inhibit_free_realized_faces,
 +  DEFVAR_BOOL ("inhibit-free-realized-faces", inhibit_free_realized_faces,
      doc: /* Non-nil means don't free realized faces.  Internal use only.  */);
    inhibit_free_realized_faces = 0;
  
  #if GLYPH_DEBUG
 -  DEFVAR_BOOL ("inhibit-try-window-id", &inhibit_try_window_id,
 +  DEFVAR_BOOL ("inhibit-try-window-id", inhibit_try_window_id,
               doc: /* Inhibit try_window_id display optimization.  */);
    inhibit_try_window_id = 0;
  
 -  DEFVAR_BOOL ("inhibit-try-window-reusing", &inhibit_try_window_reusing,
 +  DEFVAR_BOOL ("inhibit-try-window-reusing", inhibit_try_window_reusing,
               doc: /* Inhibit try_window_reusing display optimization.  */);
    inhibit_try_window_reusing = 0;
  
 -  DEFVAR_BOOL ("inhibit-try-cursor-movement", &inhibit_try_cursor_movement,
 +  DEFVAR_BOOL ("inhibit-try-cursor-movement", inhibit_try_cursor_movement,
               doc: /* Inhibit try_cursor_movement display optimization.  */);
    inhibit_try_cursor_movement = 0;
  #endif /* GLYPH_DEBUG */
  
 -  DEFVAR_INT ("overline-margin", &overline_margin,
 +  DEFVAR_INT ("overline-margin", overline_margin,
               doc: /* *Space between overline and text, in pixels.
  The default value is 2: the height of the overline (1 pixel) plus 1 pixel
  margin to the caracter height.  */);
    overline_margin = 2;
  
    DEFVAR_INT ("underline-minimum-offset",
 -             &underline_minimum_offset,
 +             underline_minimum_offset,
       doc: /* Minimum distance between baseline and underline.
  This can improve legibility of underlined text at small font sizes,
  particularly when using variable `x-use-underline-position-properties'
@@@ -26867,54 -25111,24 +26884,54 @@@ with fonts that specify an UNDERLINE_PO
  baseline.  The default value is 1.  */);
    underline_minimum_offset = 1;
  
 -  DEFVAR_BOOL ("display-hourglass", &display_hourglass_p,
 -             doc: /* Non-zero means Emacs displays an hourglass pointer on window systems.  */);
 +  DEFVAR_BOOL ("display-hourglass", display_hourglass_p,
 +             doc: /* Non-nil means show an hourglass pointer, when Emacs is busy.
 +This feature only works when on a window system that can change
 +cursor shapes.  */);
    display_hourglass_p = 1;
  
 -  DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay,
 -             doc: /* *Seconds to wait before displaying an hourglass pointer.
 -Value must be an integer or float.  */);
 +  DEFVAR_LISP ("hourglass-delay", Vhourglass_delay,
 +             doc: /* *Seconds to wait before displaying an hourglass pointer when Emacs is busy.  */);
    Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY);
  
    hourglass_atimer = NULL;
    hourglass_shown_p = 0;
 +
 +  DEFSYM (Qglyphless_char, "glyphless-char");
 +  DEFSYM (Qhex_code, "hex-code");
 +  DEFSYM (Qempty_box, "empty-box");
 +  DEFSYM (Qthin_space, "thin-space");
 +  DEFSYM (Qzero_width, "zero-width");
 +
 +  DEFSYM (Qglyphless_char_display, "glyphless-char-display");
 +  /* Intern this now in case it isn't already done.
 +     Setting this variable twice is harmless.
 +     But don't staticpro it here--that is done in alloc.c.  */
 +  Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots");
 +  Fput (Qglyphless_char_display, Qchar_table_extra_slots, make_number (1));
 +
 +  DEFVAR_LISP ("glyphless-char-display", Vglyphless_char_display,
 +             doc: /* Char-table to control displaying of glyphless characters.
 +Each element, if non-nil, is an ASCII acronym string (displayed in a box)
 +or one of these symbols:
 +  hex-code:   display the hexadecimal code of a character in a box
 +  empty-box:  display as an empty box
 +  thin-space: display as 1-pixel width space
 +  zero-width: don't display
 +
 +It has one extra slot to control the display of a character for which
 +no font is found.  The value of the slot is `hex-code' or `empty-box'.
 +The default is `empty-box'.  */);
 +  Vglyphless_char_display = Fmake_char_table (Qglyphless_char_display, Qnil);
 +  Fset_char_table_extra_slot (Vglyphless_char_display, make_number (0),
 +                            Qempty_box);
  }
  
  
  /* Initialize this module when Emacs starts.  */
  
  void
 -init_xdisp ()
 +init_xdisp (void)
  {
    Lisp_Object root_window;
    struct window *mini_w;
  
  /* Return non-zero if houglass timer has been started or hourglass is shown.  */
  int
 -hourglass_started ()
 +hourglass_started (void)
  {
    return hourglass_shown_p || hourglass_atimer != NULL;
  }
  
  /* Cancel a currently active hourglass timer, and start a new one.  */
  void
 -start_hourglass ()
 +start_hourglass (void)
  {
  #if defined (HAVE_WINDOW_SYSTEM)
    EMACS_TIME delay;
  /* Cancel the hourglass cursor timer if active, hide a busy cursor if
     shown.  */
  void
 -cancel_hourglass ()
 +cancel_hourglass (void)
  {
  #if defined (HAVE_WINDOW_SYSTEM)
    if (hourglass_atimer)
  #endif
  }
  #endif /* ! WINDOWSNT  */
 -
 -/* arch-tag: eacc864d-bb6a-4b74-894a-1a4399a1358b
 -   (do not change this comment) */