summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <dominik@nb-dominik2.science.uva.nl>2008-01-31 11:32:08 +0100
committerCarsten Dominik <dominik@nb-dominik2.science.uva.nl>2008-01-31 11:32:08 +0100
commit8fd900c6842d6f8d216ae6989b34c8de4a874e79 (patch)
tree59a412ffd3ca8c5e2f6cacb5605f0b6fd683f36f
parent2ff8fc1133b28c23d983d8eb6a2440a8b707c750 (diff)
downloadorg-mode-8fd900c6842d6f8d216ae6989b34c8de4a874e79.tar.gz
Release 4.40release_4.40
-rw-r--r--README11
-rw-r--r--org1353
-rw-r--r--org-publish.el154
-rw-r--r--org.el1925
-rw-r--r--org.pdfbin539670 -> 559272 bytes
-rw-r--r--org.texi904
-rw-r--r--orgcard.pdfbin57895 -> 57605 bytes
-rw-r--r--orgcard.tex178
-rw-r--r--xemacs/README9
-rw-r--r--xemacs/noutline.el1051
-rw-r--r--xemacs/ps-print-invisible.el225
11 files changed, 4304 insertions, 1506 deletions
diff --git a/README b/README
index 2c350f1..6ceba5f 100644
--- a/README
+++ b/README
@@ -1,4 +1,11 @@
-The is a distribution of org-mode
+The is a distribution of Org-mode, a plain text notes and project planning
+tool for Emacs.
-The homepage of org-mode is at http://www.astro.uva.nl/~domnik/Tools/org/
+The homepage of Org-mode is at http://www.astro.uva.nl/~domnik/Tools/org/
+The manual is in the file org.pdf, it includes a section about installation.
+
+The xemacs directory contains special code for XEmacs users, in particular
+a port of the GNU Emacs outline.el to XEmacs. Org-mode does not work
+under XEmacs without this file installed. It did until version 4.37,
+but no longer.
diff --git a/org b/org
index b25cf9d..2efd1c2 100644
--- a/org
+++ b/org
@@ -5,7 +5,7 @@ START-INFO-DIR-ENTRY
* Org Mode: (org). outline-based notes management and organizer
END-INFO-DIR-ENTRY
- This manual is for Org-mode (version 4.37).
+ This manual is for Org-mode (version 4.40).
Copyright (C) 2004, 2005, 2006 Free Software Foundation
@@ -27,7 +27,7 @@ File: org, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
Org Mode Manual
***************
-This manual is for Org-mode (version 4.37).
+This manual is for Org-mode (version 4.40).
Copyright (C) 2004, 2005, 2006 Free Software Foundation
@@ -53,9 +53,12 @@ This manual is for Org-mode (version 4.37).
* Timestamps:: Assign date and time to items
* Tags:: Tagging headlines and matching sets of tags
* Agenda views:: Collecting information into views
+* Embedded LaTeX:: LaTeX fragments and formulas
* Exporting:: Sharing and publishing of notes
* Publishing:: Create a web site of linked Org-mode files
* Miscellaneous:: All the rest which did not fit elsewhere
+* Extensions and Hacking:: It is possible to write add-on code
+* History and Acknowledgments:: How Org-mode came into being
* Index:: The fast road to specific information
* Key Index:: Key bindings and where they are described
@@ -64,7 +67,7 @@ This manual is for Org-mode (version 4.37).
Introduction
* Summary:: Brief summary of what Org-mode does
-* Installation and activation:: How to install Org-mode
+* Installation:: How to install Org-mode
* Feedback:: Bug reports, ideas, patches etc.
Document Structure
@@ -78,6 +81,11 @@ Document Structure
* Sparse trees:: Matches embedded in context
* Plain lists:: Editing hand-formatted lists
+Archiving
+
+* ARCHIVE tag:: Marking a tree as inactive
+* Moving subtrees:: Moving a tree to an archive file
+
Tables
* Built-in table editor:: Simple tables
@@ -131,7 +139,7 @@ Timestamps
Progress Logging
-* Closing items:: When was this entry makred DONE?
+* Closing items:: When was this entry marked DONE?
* Clocking work time:: When exactly did you work on this item?
Tags
@@ -157,6 +165,14 @@ The weekly/daily agenda
* Calendar/Diary integration:: Integrating Anniversaries and more
* Sorting of agenda items:: The order of things
+Embedded LaTeX
+
+* Math symbols:: TeX macros for symbols and Greek letters
+* Subscripts and Superscripts:: Simple syntax for raising/lowering text
+* LaTeX fragments:: Complex formulas made easy
+* Processing LaTeX fragments:: Previewing LaTeX processing
+* CDLaTeX mode:: Speed up entering of formulas
+
Exporting
* ASCII export:: Exporting to plain ASCII
@@ -180,7 +196,7 @@ Publishing
Configuration
* Project alist:: The central configuration variable
-* File sources and destinations:: From here to there
+* Sources and destinations:: From here to there
* Selecting files:: What files are part of the project?
* Publishing action:: Setting the function doing the publishing
* Publishing options:: Tweaking HTML export
@@ -196,21 +212,23 @@ Miscellaneous
* Completion:: M-TAB knows what you need
* Customization:: Adapting Org-mode to your taste
-* Summary of in-buffer settings:: Using special lines to set options
+* In-buffer settings:: Overview of the #+KEYWORDS
* The very busy C-c C-c key:: When in doubt, press C-c C-c
* Clean view:: Getting rid of leading stars in the outline
* TTY keys:: Using Org-mode on a tty
-* FAQ:: Frequently asked questions
* Interaction:: Other Emacs packages
* Bugs:: Things which do not work perfectly
-* Acknowledgments:: These people provided feedback and more
Interaction with other packages
-* Extensions:: Third-party extensions for Org-mode
* Cooperation:: Packages Org-mode cooperates with
* Conflicts:: Packages that lead to conflicts
+Extensions, Hooks and Hacking
+
+* Extensions:: Existing 3rd-part extensions
+* Dynamic blocks:: Automatically filled blocks
+

File: org, Node: Introduction, Next: Document structure, Prev: Top, Up: Top
@@ -220,11 +238,11 @@ File: org, Node: Introduction, Next: Document structure, Prev: Top, Up: Top
* Menu:
* Summary:: Brief summary of what Org-mode does
-* Installation and activation:: How to install Org-mode
+* Installation:: How to install Org-mode
* Feedback:: Bug reports, ideas, patches etc.

-File: org, Node: Summary, Next: Installation and activation, Prev: Introduction, Up: Introduction
+File: org, Node: Summary, Next: Installation, Prev: Introduction, Up: Introduction
1.1 Summary
===========
@@ -265,12 +283,12 @@ example:
activating the minor Orgtbl-mode.
There is a website for Org-mode which provides links to the newest
-version of Org-mode, as well as additional information, screen shots
-and example files. This page is located at
+version of Org-mode, as well as additional information, frequently asked
+questions (FAQ), links to tutorials etc. This page is located at
`http://www.astro.uva.nl/~dominik/Tools/org/'.

-File: org, Node: Installation and activation, Next: Feedback, Prev: Summary, Up: Introduction
+File: org, Node: Installation, Next: Feedback, Prev: Summary, Up: Introduction
1.2 Installation and Activation
===============================
@@ -299,6 +317,10 @@ them together with `org-install.el' on your load path. Then add to
;; This line only if org-mode is not part of the X/Emacs distribution.
(require 'org-install)
+ If you use Org-mode with XEmacs, you also need to install the file
+`noutline.el' from the `xemacs' subdirectory of the Org-mode
+distribution.
+
With this setup, all files with extension `.org' will be put into
Org-mode. As an alternative, make the first line of a file look like
this:
@@ -309,7 +331,7 @@ which will select Org-mode for this buffer no matter what the file's
name is. See also the variable `org-insert-mode-line-in-empty-file'.

-File: org, Node: Feedback, Prev: Installation and activation, Up: Introduction
+File: org, Node: Feedback, Prev: Installation, Up: Introduction
1.3 Feedback
============
@@ -534,18 +556,80 @@ File: org, Node: Archiving, Next: Sparse trees, Prev: Structure editing, Up:
=============
When a project represented by a (sub)tree is finished, you may want to
-move the tree to an archive place, either in the same file under a
-special top-level heading, or even to a different file.
+move the tree out of the way and to stop it from contributing to the
+agenda. Org-mode knows two ways of archiving. You can mark a tree with
+the ARCHIVE tag, or you can move an entire (sub)tree to a different
+location.
+
+* Menu:
+
+* ARCHIVE tag:: Marking a tree as inactive
+* Moving subtrees:: Moving a tree to an archive file
+
+
+File: org, Node: ARCHIVE tag, Next: Moving subtrees, Prev: Archiving, Up: Archiving
+
+2.6.1 The ARCHIVE tag
+---------------------
+
+A headline that is marked with the ARCHIVE tag (*note Tags::) stays at
+its location in the outline tree, but behaves in the following way:
+ - It does not open when you attempt to do so with a visibility
+ cycling command (*note Visibility cycling::). You can still open
+ it with a normal outline command like `show-all'. Or you can
+ modify the option `org-cycle-open-archived-trees'.
+
+ - During sparse tree construction (*note Sparse trees::), matches in
+ archived subtrees are not exposed, unless you configure the option
+ `org-sparse-tree-open-archived-trees'.
+
+ - During agenda view construction (*note Agenda views::), the
+ content of archived trees is ignored unless you configure the
+ option `org-agenda-skip-archived-trees'.
+
+ - Archived trees are not exported (*note Exporting::), only the
+ headline is. Configure the details using the variable
+ `org-export-with-archived-trees'.
+
+ The following commands allow to set or clear the ARCHIVE tag:
+
+`C-c C-x C-a'
+ Toggle the ARCHIVE tag for the current headline. When the tag is
+ set, the headline changes to a shadowish face, and the subtree
+ below it is hidden.
+
+`C-u C-c C-x C-a'
+ Check if any direct children of the current headline should be
+ archived. To do this, each subtree is checked for open TODO
+ entries. If none are found, the command offers to set the ARCHIVE
+ tag for the child. If the cursor is _not_ on a headline when this
+ command is invoked, the level 1 trees will be checked.
+
+
+File: org, Node: Moving subtrees, Prev: ARCHIVE tag, Up: Archiving
+
+2.6.2 Moving subtrees
+---------------------
+
+Once an entire project is finished, you may want to move it to a
+different location, either in the current file, or even in a different
+file, the archive file.
+
`C-c $'
Archive the subtree starting at the cursor position to the location
- given by `org-archive-location'.
+ given by `org-archive-location'.
+
+`C-u C-c $'
+ Check if any direct children of the current headline could be
+ moved to the archive. To do this, each subtree is checked for
+ open TODO entries. If none are found, the command offers to move
+ it to the archive location. If the cursor is _not_ on a headline
+ when this command is invoked, the level 1 trees will be checked.
- The default archive is a file in the same directory as the current
-file, with the name derived by appending `_archive' to the current file
-name. For information and examples on how to change this, see the
-documentation string of the variable `org-archive-location'. If you
-are also using the Org-mode agenda, archiving to a different file is a
-good way to keep archived trees from contributing agenda items.
+ The default archive location is a file in the same directory as the
+current file, with the name derived by appending `_archive' to the
+current file name. For information and examples on how to change this,
+see the documentation string of the variable `org-archive-location'.

File: org, Node: Sparse trees, Next: Plain lists, Prev: Archiving, Up: Document structure
@@ -1497,15 +1581,14 @@ insert it into an org-mode file, and to follow the link.
not working correctly or accurately enough, you can write custom
functions to select the search string and to do the search for
particular file types - see *Note Custom searches::. The key
- binding `C-c l' is only a suggestion - see *Note Installation and
- activation::.
+ binding `C-c l' is only a suggestion - see *Note Installation::.
`C-c C-l'
Insert a link. This prompts for a link to be inserted into the
buffer. You can just type a link, using text for an internal
link, or one of the link type prefixes mentioned in the examples
above. Through completion, all links stored during the current
- session can be accessed. The link will be inserted into the
+ session can be accessed(1). The link will be inserted into the
buffer, along with a descriptive text. Note that you don't have
to use this command to insert a link. Links in Org-mode are plain
text, and you can type or paste them straight into the buffer. By
@@ -1539,10 +1622,10 @@ insert it into an org-mode file, and to follow the link.
corresponding search. When the cursor is on a TAG list in a
headline, it creates the corresponding TAGS view. If the cursor
is on a time stamp, it compiles the agenda for that date.
- Furthermore, it will visit text files in `file:' links with Emacs
- and select a suitable application for non-text files.
- Classification of files is based on file extension only. See
- option `org-file-apps'. If you want to override the default
+ Furthermore, it will visit text and remote files in `file:' links
+ with Emacs and select a suitable application for local non-text
+ files. Classification of files is based on file extension only.
+ See option `org-file-apps'. If you want to override the default
application and visit the file with Emacs, use a `C-u' prefix.
`mouse-2'
@@ -1563,6 +1646,13 @@ insert it into an org-mode file, and to follow the link.
command several times in direct succession moves through a ring of
previously recorded positions.
+ ---------- Footnotes ----------
+
+ (1) After insertion of a stored link, the link will be removed from
+the list of stored links. To keep it in the list later use, use a
+triple `C-u' prefix to `C-c C-l', or configure the option
+`org-keep-stored-link-after-insertion'.
+

File: org, Node: Search options, Next: Custom searches, Prev: Handling links, Up: Hyperlinks
@@ -2009,7 +2099,7 @@ TIME STAMP WITH CLOSED KEYWORD
TIME RANGE WITH CLOCK KEYWORD
When using the clock to time the work that is being done on
- specific items, time ranges preceeded by the CLOCK keyword are
+ specific items, time ranges preceded by the CLOCK keyword are
inserted automatically into the file. The time stamps are
enclosed in square brackets instead of angular brackets. *Note
Clocking work time::.
@@ -2135,7 +2225,7 @@ stop working on an aspect of a project.
* Menu:
-* Closing items:: When was this entry makred DONE?
+* Closing items:: When was this entry marked DONE?
* Clocking work time:: When exactly did you work on this item?

@@ -2166,8 +2256,8 @@ File: org, Node: Clocking work time, Prev: Closing items, Up: Progress loggin
Org-mode allows you to clock the time you spent on specific tasks in a
project. When you start working on an item, you can start the clock.
-When you stop working on that tast, or when you makr the task done, the
-clock is stoppend and the corresponding time interval is recorded. It
+When you stop working on that task, or when you mark the task done, the
+clock is stopped and the corresponding time interval is recorded. It
also computes the total time spent on each subtree of a project.
`C-c C-x C-i'
@@ -2193,7 +2283,18 @@ also computes the total time spent on each subtree of a project.
This puts overlays at the end of each headline, showing the total
time recorded under that heading, including the time of any
subheadings. You can use visibility cycling to study the tree, but
- the overlays disappear automatically when the buffer is changed.
+ the overlays disappear automatically when the buffer is changed.
+
+`C-c C-x C-r'
+ Insert a dynamic block containing a clock report as an org-mode
+ table into the current file.
+ #+BEGIN: clocktable :maxlevel 2 :emphasize nil
+
+ #+END: clocktable
+ If such a block already exists, its content is replaced by the new
+ table. The `BEGIN' line can specify options:
+ :maxlevels Maximum level depth to which times are listed in the table.
+ :emphasize When `t', emphasize level one and level two items
The `l' key may be used in the timeline (*note Timeline::) and in
the agenda (*note Weekly/Daily agenda::) to show which tasks have been
@@ -2354,7 +2455,7 @@ selects all lines tagged `:WORK:' or `:LAPTOP:'. The string
`NIGHT'.

-File: org, Node: Agenda views, Next: Exporting, Prev: Tags, Up: Top
+File: org, Node: Agenda views, Next: Embedded LaTeX, Prev: Tags, Up: Top
8 Agenda Views
**************
@@ -2434,12 +2535,11 @@ File: org, Node: Agenda dispatcher, Next: Weekly/Daily agenda, Prev: Agenda f
=========================
The views are created through a dispatcher that should be bound to a
-global key, for example `C-c a' (*note Installation and activation::).
-In the following we will assume that `C-c a' is indeed how the
-dispatcher is accessed and list keyboard access to commands
-accordingly. After pressing `C-c a', an additional letter is required
-to execute a command. The dispatcher offers the following default
-commands:
+global key, for example `C-c a' (*note Installation::). In the
+following we will assume that `C-c a' is indeed how the dispatcher is
+accessed and list keyboard access to commands accordingly. After
+pressing `C-c a', an additional letter is required to execute a
+command. The dispatcher offers the following default commands:
`a'
Create the calendar-like agenda (*note Weekly/Daily agenda::).
@@ -2804,6 +2904,9 @@ Remote editing
`:'
Set tags for the current headline.
+`a'
+ Toggle the ARCHIVE tag for the current headline.
+
`,'
Set the priority for the current item. Org-mode prompts for the
priority character. If you reply with <SPC>, the priority cookie
@@ -2904,10 +3007,207 @@ Quit and Exit

-File: org, Node: Exporting, Next: Publishing, Prev: Agenda views, Up: Top
+File: org, Node: Embedded LaTeX, Next: Exporting, Prev: Agenda views, Up: Top
-9 Exporting
-***********
+9 Embedded LaTeX
+****************
+
+Plain ASCII is normally sufficient for almost all note taking. One
+exception, however, are scientific notes which need to be able to
+contain mathematical symbols and the occasional formula. LaTeX(1) is
+widely used to typeset scientific documents. Org-mode supports
+embedding LaTeX code into its files, because many academics are used to
+read LaTeX source code, and because it can be readily processed into
+images for HTML production.
+
+ It is not necessary to mark LaTeX macros and code in any special way.
+If you observe a few conventions, Org-mode knows how to find it and what
+to do with it.
+
+* Menu:
+
+* Math symbols:: TeX macros for symbols and Greek letters
+* Subscripts and Superscripts:: Simple syntax for raising/lowering text
+* LaTeX fragments:: Complex formulas made easy
+* Processing LaTeX fragments:: Previewing LaTeX processing
+* CDLaTeX mode:: Speed up entering of formulas
+
+ ---------- Footnotes ----------
+
+ (1) LaTeX is a macro system based on Donald E. Knuth's TeX system.
+Many of the features described here as "LaTeX" are really from TeX, but
+for simplicity I am blurring this distinction.
+
+
+File: org, Node: Math symbols, Next: Subscripts and Superscripts, Prev: Embedded LaTeX, Up: Embedded LaTeX
+
+9.1 Math symbols
+================
+
+You can use LaTeX macros to insert special symbols like `\alpha' to
+indicate the Greek letter, or `\to' to indicate an arrow. Completion
+for these macros is available, just type `\' and maybe a few letters,
+and press `M-<TAB>' to see possible completions. Unlike LaTeX code,
+Org-mode allows these macros to be present without surrounding math
+delimiters, for example:
+
+ Angles are written as Greek letters \alpha, \beta and \gamma.
+
+ During HTML export (*note HTML export::), these symbols are
+translated into the proper syntax for HTML, for the above examples this
+is `&alpha;' and `&rarr;', respectively.
+
+
+File: org, Node: Subscripts and Superscripts, Next: LaTeX fragments, Prev: Math symbols, Up: Embedded LaTeX
+
+9.2 Subscripts and Superscripts
+===============================
+
+Just like in LaTeX, `^' and `_' are used to indicate super- and
+subscripts. Again, these can be used without embedding them in
+math-mode delimiters. To increase the readability of ASCII text, it is
+not necessary (but OK) to surround multi-character sub- and superscripts
+with curly braces. For example
+
+ The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
+ the sun is R_{sun} = 6.96 x 10^8 m.
+
+ To avoid interpretation as raised or lowered text, you can quote `^'
+and `_' with a backslash: `\_' and `\^'.
+
+ During HTML export (*note HTML export::), subscript and superscripts
+are surrounded with `<sub>' and `<sup>' tags, respectively.
+
+
+File: org, Node: LaTeX fragments, Next: Processing LaTeX fragments, Prev: Subscripts and Superscripts, Up: Embedded LaTeX
+
+9.3 LaTeX fragments
+===================
+
+With symbols, sub- and superscripts, HTML is pretty much at its end when
+it comes to representing mathematical formulas. More complex
+expressions need a dedicated formula processor. To this end, Org-mode
+can contain arbitrary LaTeX fragments. It provides commands to preview
+the typeset result of these fragments, and upon export to HTML, all
+fragments will be converted to images and inlined into the HTML
+document. For this to work you need to be on a system with a working
+LaTeX installation. You also need the `dvipng' program, available at
+`http://sourceforge.net/projects/dvipng/'.
+
+ LaTeX fragments don't need any special marking at all. The following
+snippets will be identified as LaTeX source code:
+ * Environments of any kind. The only requirement is that the
+ `\begin' statement appears on a new line, preceded by only
+ whitespace.
+
+ * Text within the usual LaTeX math delimiters. To avoid conflicts
+ with currency specifications, single `$' characters are only
+ recognized as math delimiters if the enclosed text contains at
+ most two line breaks, is directly attached to the `$' characters
+ with no whitespace in between, and if the closing `$' is followed
+ by whitespace or punctuation. For the other delimiters, there is
+ no such restriction, so when in doubt, use `\(...\)' as inline
+ math delimiters.
+
+For example:
+
+ \begin{equation} % arbitrary environments,
+ x=\sqrt{b} % even tables, figures
+ \end{equation} % etc
+
+ If $a^2=b$ and \( b=2 \), then the solution must be
+ either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].
+
+If you need any of the delimiter ASCII sequences for other purposes, you
+can configure the option `org-format-latex-options' to deselect the
+ones you do not wish to have interpreted by the LaTeX converter.
+
+
+File: org, Node: Processing LaTeX fragments, Next: CDLaTeX mode, Prev: LaTeX fragments, Up: Embedded LaTeX
+
+9.4 Processing LaTeX fragments
+==============================
+
+LaTeX fragments can be processed to produce a preview images of the
+typeset expressions:
+
+`C-c C-x C-l'
+ Produce a preview image of the LaTeX fragment at point and overlay
+ it over the source code. If there is no fragment at point,
+ process all fragments in the current entry (between two
+ headlines). When called with a prefix argument, process the
+ entire subtree. When called with two prefix arguments, or when
+ the cursor is before the first headline, process the entire buffer.
+
+`C-c C-c'
+ Remove the overlay preview images.
+
+ During HTML export (*note HTML export::), all LaTeX fragments are
+converted into images and inlined into the document if the following
+setting is active:
+
+ (setq org-export-with-LaTeX-fragments t)
+
+
+File: org, Node: CDLaTeX mode, Prev: Processing LaTeX fragments, Up: Embedded LaTeX
+
+9.5 Using CDLaTeX to enter math
+===============================
+
+CDLaTeX-mode is a minor mode that is normally used in combination with a
+major LaTeX mode like AUCTeX in order to speed-up insertion of
+environments and math templates. Inside Org-mode, you can make use of
+some of the features of cdlatex-mode. You need to install `cdlatex.el'
+and `texmathp.el' (the latter comes also with AUCTeX) from
+`http://www.astro.uva.nl/~dominik/Tools/cdlatex'. Don't turn
+cdlatex-mode itself under Org-mode, but use the light version
+`org-cdlatex-mode' that comes as part of Org-mode. Turn it on for the
+current buffer with `M-x org-cdlatex-mode', or for all Org-mode files
+with
+
+ (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
+
+ When this mode is enabled, the following features are present (for
+more details see the documentation of cdlatex-mode):
+ * Environment templates can be inserted with `C-c {'.
+
+ * The <TAB> key will do template expansion if the cursor is inside a
+ LaTeX fragment(1). For example, <TAB> will expand `fr' to
+ `\frac{}{}' and position the cursor correctly inside the first
+ brace. Another <TAB> will get you into the second brace. Even
+ outside fragments, <TAB> will expand environment abbreviations at
+ the beginning of a line. For example, if you write `equ' at the
+ beginning of a line and press <TAB>, this abbreviation will be
+ expanded to an `equation' environment. To get a list of all
+ abbreviations, type `M-x cdlatex-command-help'.
+
+ * Pressing `_' and `^' inside a LaTeX fragment will insert these
+ characters together with a pair of braces. If you use <TAB> to
+ move out of the braces, and if the braces surround only a single
+ character or macro, they are removed again (depending on the
+ variable `cdlatex-simplify-sub-super-scripts').
+
+ * Pressing the backquote ``' followed by a character inserts math
+ macros, also outside LaTeX fragments. If you wait more than 1.5
+ seconds after the backquote, a help window will pop up.
+
+ * Pressing the normal quote `'' followed by another character
+ modifies the symbol before point with an accent or a font. If you
+ wait more than 1.5 seconds after the backquote, a help window will
+ pop up. Character modification will work only inside LaTeX
+ fragments, outside the quote is normal.
+
+ ---------- Footnotes ----------
+
+ (1) Org-mode has a method to test if the cursor is inside such a
+fragment, see the documentation of the function
+`org-inside-LaTeX-fragment-p'.
+
+
+File: org, Node: Exporting, Next: Publishing, Prev: Embedded LaTeX, Up: Top
+
+10 Exporting
+************
Org-mode documents can be exported into a variety of other formats. For
printing and sharing of notes, ASCII export produces a readable and
@@ -2933,8 +3233,8 @@ output produced. *Note Text interpretation::, for more details.

File: org, Node: ASCII export, Next: HTML export, Prev: Exporting, Up: Exporting
-9.1 ASCII export
-================
+10.1 ASCII export
+=================
ASCII export produces a simple and very readable version of an Org-mode
file.
@@ -2959,16 +3259,16 @@ example,
creates only top level headlines and does the rest as items. When
headlines are converted to items, the indentation of the text following
the headline is changed to fit nicely under the item. This is done with
-the assumption that the first bodyline indicates the base indenation of
-the body text. Any indenation larger than this is adjusted to preserve
+the assumption that the first bodyline indicates the base indentation of
+the body text. Any indentation larger than this is adjusted to preserve
the layout relative to the first line. Should there be lines with less
indentation than the first, these are left alone.

File: org, Node: HTML export, Next: XOXO export, Prev: ASCII export, Up: Exporting
-9.2 HTML export
-===============
+10.2 HTML export
+================
Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive
HTML formatting, in ways similar to John Grubers _markdown_ language,
@@ -3041,8 +3341,8 @@ section in the buffer.

File: org, Node: XOXO export, Next: iCalendar export, Prev: HTML export, Up: Exporting
-9.3 XOXO export
-===============
+10.3 XOXO export
+================
Org-mode contains an exporter that produces XOXO-style output.
Currently, this exporter only handles the general outline structure and
@@ -3057,8 +3357,8 @@ does not interpret any additional Org-mode features.

File: org, Node: iCalendar export, Next: Text interpretation, Prev: XOXO export, Up: Exporting
-9.4 iCalendar export
-====================
+10.4 iCalendar export
+=====================
Some people like to use Org-mode for keeping track of projects, but
still prefer a standard calendar application for anniversaries and
@@ -3102,8 +3402,8 @@ this:

File: org, Node: Text interpretation, Prev: iCalendar export, Up: Exporting
-9.5 Text interpretation by the exporter
-=======================================
+10.5 Text interpretation by the exporter
+========================================
The exporter backends interpret additional structure in the Org-mode
file in order to produce better output.
@@ -3117,8 +3417,8 @@ file in order to produce better output.

File: org, Node: Comment lines, Next: Enhancing text, Prev: Text interpretation, Up: Text interpretation
-9.5.1 Comment lines
--------------------
+10.5.1 Comment lines
+--------------------
Lines starting with `#' in column zero are treated as comments and will
never be exported. Also entire subtrees starting with the word
@@ -3131,8 +3431,8 @@ headline will not be exported either.

File: org, Node: Enhancing text, Next: Export options, Prev: Comment lines, Up: Text interpretation
-9.5.2 Enhancing text for export
--------------------------------
+10.5.2 Enhancing text for export
+--------------------------------
Some of the export backends of Org-mode allow for sophisticated text
formatting, this is true in particular for the HTML backend. Org-mode
@@ -3143,16 +3443,11 @@ formatted output.
enumerator will be recognized and transformed if the backend
supports lists. See *Note Plain lists::.
- * You can make words *bold*, /italic/, and _underlined_
-
- * Simple TeX-like math constructs are interpreted:
+ * You can make words *bold*, /italic/, _underlined_, `=code=', and
+ `+strikethrough+'.
- - `10^22' and `J_n' are super- and subscripts. You can quote
- `^' and `_' with a backslash: `\_' and `\^'
-
- - `\alpha' indicates a Greek letter, `\to' an arrow. You can
- use completion for these macros, just type `\' and maybe a few
- letters, and press `M-<TAB>' to see possible completions.
+ * Many TeX macros and entire LaTeX fragments are converted into HTML
+ entities or images (*note Embedded LaTeX::).
* Tables are transformed into native tables under the exporter, if
the export backend supports this. Data fields before the first
@@ -3176,8 +3471,8 @@ which explains how to set export options with special lines in a buffer.

File: org, Node: Export options, Prev: Enhancing text, Up: Text interpretation
-9.5.3 Export options
---------------------
+10.5.3 Export options
+---------------------
The exporter recognizes special lines in the buffer which provide
additional information. These lines may be put anywhere in the file.
@@ -3195,7 +3490,7 @@ Completion::).
#+LANGUAGE: language for HTML, e.g. `en' (`org-export-default-language')
#+TEXT: Some descriptive text to be inserted at the beginning.
#+TEXT: Several lines may be given.
- #+OPTIONS: H:2 num:t toc:t \n:nil t ::t |:t ^:t *:nil TeX:t
+ #+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:nil TeX:t LaTeX:t
The OPTIONS line is a compact form to specify export settings. Here
you can:
@@ -3208,12 +3503,13 @@ you can:
|: turn on/off tables
^: turn on/off TeX-like syntax for sub- and superscripts.
*: turn on/off emphasized text (bold, italic, underlined)
- TeX: turn on/off TeX macros
+ TeX: turn on/off simple TeX macros in plain text
+ LaTeX: turn on/off LaTeX fragments

File: org, Node: Publishing, Next: Miscellaneous, Prev: Exporting, Up: Top
-10 Publishing
+11 Publishing
*************
Org-mode includes(1) a publishing management system that allows you to
@@ -3241,7 +3537,7 @@ separately. Also make sure org.el is at least version 4.27.

File: org, Node: Configuration, Next: Sample configuration, Prev: Publishing, Up: Publishing
-10.1 Configuration
+11.1 Configuration
==================
Publishing needs significant configuration to specify files, destination
@@ -3250,7 +3546,7 @@ and many other properties of a project.
* Menu:
* Project alist:: The central configuration variable
-* File sources and destinations:: From here to there
+* Sources and destinations:: From here to there
* Selecting files:: What files are part of the project?
* Publishing action:: Setting the function doing the publishing
* Publishing options:: Tweaking HTML export
@@ -3258,9 +3554,9 @@ and many other properties of a project.
* Project page index:: Publishing a list of project files

-File: org, Node: Project alist, Next: File sources and destinations, Prev: Configuration, Up: Configuration
+File: org, Node: Project alist, Next: Sources and destinations, Prev: Configuration, Up: Configuration
-10.1.1 The variable `org-publish-project-alist'
+11.1.1 The variable `org-publish-project-alist'
-----------------------------------------------
Org-publish is configured almost entirely through setting the value of
@@ -3283,9 +3579,9 @@ which group together files requiring different publishing options. When
you publish such a "meta-project" all the components will also publish.

-File: org, Node: File sources and destinations, Next: Selecting files, Prev: Project alist, Up: Configuration
+File: org, Node: Sources and destinations, Next: Selecting files, Prev: Project alist, Up: Configuration
-10.1.2 Sources and destinations for files
+11.1.2 Sources and destinations for files
-----------------------------------------
Most properties are optional, but some should always be set. In
@@ -3297,9 +3593,9 @@ and where to put published files.
will be published.

-File: org, Node: Selecting files, Next: Publishing action, Prev: File sources and destinations, Up: Configuration
+File: org, Node: Selecting files, Next: Publishing action, Prev: Sources and destinations, Up: Configuration
-10.1.3 Selecting files
+11.1.3 Selecting files
----------------------
By default, all files with extension `.org' in the base directory are
@@ -3316,7 +3612,7 @@ properties

File: org, Node: Publishing action, Next: Publishing options, Prev: Selecting files, Up: Configuration
-10.1.4 Publishing Action
+11.1.4 Publishing Action
------------------------
Publishing means that a file is copied to the destination directory and
@@ -3340,7 +3636,7 @@ provides one for attachments (files that only need to be copied):

File: org, Node: Publishing options, Next: Publishing links, Prev: Publishing action, Up: Configuration
-10.1.5 Options for the HTML exporter
+11.1.5 Options for the HTML exporter
------------------------------------
The property list can be used to set many export options for the HTML
@@ -3353,9 +3649,11 @@ respective variable for details.
`:headline-levels' `org-export-headline-levels'
`:section-numbers' `org-export-with-section-numbers'
`:table-of-contents' `org-export-with-toc'
+`:archived-trees' `org-export-with-archived-trees'
`:emphasize' `org-export-with-emphasize'
`:sub-superscript' `org-export-with-sub-superscripts'
`:TeX-macros' `org-export-with-TeX-macros'
+`:LaTeX-fragments' `org-export-with-LaTeX-fragments'
`:fixed-width' `org-export-with-fixed-width'
`:timestamps' `org-export-with-timestamps'
.
@@ -3384,7 +3682,7 @@ however, override everything.

File: org, Node: Publishing links, Next: Project page index, Prev: Publishing options, Up: Configuration
-10.1.6 Links between published files
+11.1.6 Links between published files
------------------------------------
To create a link from one Org-mode file to another, you would use
@@ -3399,10 +3697,24 @@ careful with relative pathnames, and provided you have also configured
org-publish to upload the related files, these links will work too.
*Note Complex example:: for an example of this usage.
+ Sometime an Org-mode file to be published may contain links that are
+only valid in your production environment, but not in the publishing
+location. In this case, use the property
+
+`:link-validation-function' Function to validate links
+
+to define a function for checking link validity. This function must
+accept two arguments, the file name and a directory relative to which
+the file name is interpreted in the production environment. If this
+function returns `nil', then the HTML generator will only insert a
+description into the HTML file, but no link. One option for this
+function is `org-publish-validate-link' which checks if the given file
+is part of any project in `org-publish-project-alist'.
+

File: org, Node: Project page index, Prev: Publishing links, Up: Configuration
-10.1.7 Project page index
+11.1.7 Project page index
-------------------------
The following properties may be used to control publishing of an index
@@ -3420,7 +3732,7 @@ of files or summary page for a given project.

File: org, Node: Sample configuration, Next: Triggering publication, Prev: Configuration, Up: Publishing
-10.2 Sample configuration
+11.2 Sample configuration
=========================
Below we provide two example configurations. The first one is a simple
@@ -3435,7 +3747,7 @@ more complex, with a multi-component project.

File: org, Node: Simple example, Next: Complex example, Prev: Sample configuration, Up: Sample configuration
-10.2.1 Example: simple publishing configuration
+11.2.1 Example: simple publishing configuration
-----------------------------------------------
This example publishes a set of Org-mode files to the `public_html'
@@ -3454,7 +3766,7 @@ directory on the local machine.

File: org, Node: Complex example, Prev: Simple example, Up: Sample configuration
-10.2.2 Example: complex publishing configuration
+11.2.2 Example: complex publishing configuration
------------------------------------------------
This more complicated example publishes an entire website, including
@@ -3502,7 +3814,7 @@ right place on the webserver, and publishing images to it.

File: org, Node: Triggering publication, Prev: Sample configuration, Up: Publishing
-10.3 Triggering publication
+11.3 Triggering publication
===========================
Once org-publish is properly configured, you can publish with the
@@ -3525,28 +3837,26 @@ functions normally only publish changed files. You can override this and
force publishing of all files by giving a prefix argument.

-File: org, Node: Miscellaneous, Next: Index, Prev: Publishing, Up: Top
+File: org, Node: Miscellaneous, Next: Extensions and Hacking, Prev: Publishing, Up: Top
-11 Miscellaneous
+12 Miscellaneous
****************
* Menu:
* Completion:: M-TAB knows what you need
* Customization:: Adapting Org-mode to your taste
-* Summary of in-buffer settings:: Using special lines to set options
+* In-buffer settings:: Overview of the #+KEYWORDS
* The very busy C-c C-c key:: When in doubt, press C-c C-c
* Clean view:: Getting rid of leading stars in the outline
* TTY keys:: Using Org-mode on a tty
-* FAQ:: Frequently asked questions
* Interaction:: Other Emacs packages
* Bugs:: Things which do not work perfectly
-* Acknowledgments:: These people provided feedback and more

File: org, Node: Completion, Next: Customization, Prev: Miscellaneous, Up: Miscellaneous
-11.1 Completion
+12.1 Completion
===============
Org-mode supports in-buffer completion. This type of completion does
@@ -3572,9 +3882,9 @@ buffer and use the key to complete text right there.
* Elsewhere, complete dictionary words using ispell.

-File: org, Node: Customization, Next: Summary of in-buffer settings, Prev: Completion, Up: Miscellaneous
+File: org, Node: Customization, Next: In-buffer settings, Prev: Completion, Up: Miscellaneous
-11.2 Customization
+12.2 Customization
==================
There are more than 100 variables that can be used to customize
@@ -3583,12 +3893,12 @@ describing the variables here. A structured overview of customization
variables is available with `M-x org-customize'. Or select `Browse Org
Group' from the `Org->Customization' menu. Many settings can also be
activated on a per-file basis, by putting special lines into the buffer
-(*note Summary of in-buffer settings::).
+(*note In-buffer settings::).

-File: org, Node: Summary of in-buffer settings, Next: The very busy C-c C-c key, Prev: Customization, Up: Miscellaneous
+File: org, Node: In-buffer settings, Next: The very busy C-c C-c key, Prev: Customization, Up: Miscellaneous
-11.3 Summary of in-buffer settings
+12.3 Summary of in-buffer settings
==================================
Org-mode uses special lines in the buffer to define settings on a
@@ -3654,9 +3964,9 @@ file is visited again in a new Emacs session.
details see *Note Export options::.

-File: org, Node: The very busy C-c C-c key, Next: Clean view, Prev: Summary of in-buffer settings, Up: Miscellaneous
+File: org, Node: The very busy C-c C-c key, Next: Clean view, Prev: In-buffer settings, Up: Miscellaneous
-11.4 The very busy C-c C-c key
+12.4 The very busy C-c C-c key
==============================
The key `C-c C-c' has many purposes in org-mode, which are all
@@ -3666,6 +3976,9 @@ circumstances it means something like _Hey Org-mode, look here and
update according to what you see here_. Here is a summary of what this
means in different contexts.
+ - If there are highlights in the buffer from the creation of a sparse
+ tree, or from clock display, remove these highlights.
+
- If the cursor is in one of the special `#+KEYWORD' lines, this
triggers scanning the buffer for these lines and updating the
information.
@@ -3695,7 +4008,7 @@ means in different contexts.

File: org, Node: Clean view, Next: TTY keys, Prev: The very busy C-c C-c key, Up: Miscellaneous
-11.5 A cleaner outline view
+12.5 A cleaner outline view
===========================
Some people find it noisy and distracting that the Org-mode headlines
@@ -3775,9 +4088,9 @@ RET' in that file. The reverse operation is `M-x
org-convert-to-oddeven-levels'.

-File: org, Node: TTY keys, Next: FAQ, Prev: Clean view, Up: Miscellaneous
+File: org, Node: TTY keys, Next: Interaction, Prev: Clean view, Up: Miscellaneous
-11.6 Using org-mode on a tty
+12.6 Using org-mode on a tty
============================
Org-mode uses a number of keys that are not accessible on a tty. This
@@ -3817,178 +4130,9 @@ Default Alternative 1 Alternative 2
<down>'

-File: org, Node: FAQ, Next: Interaction, Prev: TTY keys, Up: Miscellaneous
-
-11.7 Frequently asked questions
-===============================
-
- 1. When I try to use Org-mode, I always get `(wrong-type-argument
- keymapp nil)'.
- This is a conflict with an outdated version of the `allout.el'.
- See *Note Conflicts::.
-
- 2. Org-mode seems to be a useful default mode for the various
- `README' files I have scattered through my directories. How do I
- turn it on for all `README' files?
-
- (add-to-list 'auto-mode-alist '("README$" . org-mode))
-
- 3. I would like to use editing features of org-mode in other modes,
- is this possible?
- Not really. For tables there is `orgtbl-mode' which implements the
- table editor as a minor mode. For other features you need to
- switch to Org-mode temporarily, or prepare text in a different
- buffer.
-
- 4. Can I get the visibility-cycling features in outline-mode and
- outline-minor-mode?
- Yes, these functions are written in a way that they are
- independent of the outline setup. The following setup provides
- standard Org-mode functionality in outline-mode on <TAB> and
- `S-<TAB>'. For outline-minor-mode, we use `C-<TAB>' instead of
- <TAB>, because <TAB> usually has mode-specific tasks.
- (add-hook 'outline-minor-mode-hook
- (lambda ()
- (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
- (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
- (add-hook 'outline-mode-hook
- (lambda ()
- (define-key outline-mode-map [(tab)] 'org-cycle)
- (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
-
- Or check out `outline-magic.el', which does this and also provides
- promotion and demotion functionality. `outline-magic.el' is
- available at `http://www.astro.uva.nl/~dominik/Tools/OutlineMagic'.
-
- 5. Some of my links stopped working after I upgraded to a version
- 4.20 or later. Why is this, and how can I fix it?
- These must be links in plain text, containing white space, such as
- `bbdb:Richard Stallman'. You need to protect these links by
- putting double brackets around them, like `[[bbdb:Richard
- Stallman]]'.
-
- 6. I see that Org-mode now creates links using the double bracket
- convention that hides the link part and the brackets, only showing
- the description part. How can I convert my old links to this new
- format?
- Execute once in each Org-mode file: `M-x org-upgrade-old-links'.
- This replaces angular brackets with the new link format.
-
- 7. I don't care if you find the new bracket links great, I am
- attached to the old style using angular brackets and no hiding of
- the link text. Please give them back to me, don't tell me it is
- not possible!
- Would I let you down like that? If you must, you can do this
-
- (setq org-link-style 'plain
- org-link-format "<%s>")
-
- 8. When I am executing shell/elisp links I always get a confirmation
- prompt and need to type `yes <RET>', that's 4 key presses! Can I
- get rid of this?
- The confirmation is there to protect you from unwantingly execute
- potentially dangerous commands. For example, imagine a link
- `[[shell:rm -rf ~/*][Google Search]]'. In an Org-mode buffer, this
- command would look like `Google Search', but really it would remove
- your home directory. If you wish, you can make it easier to
- respond to the query by setting `org-confirm-shell-link-function'
- and/or `org-confirm-elisp-link-function' to `y-or-n-p'. Then a
- single `y' keypress will be enough to confirm those links. It is
- also possible to turn off this check entirely, but I do not
- recommend to do this. Be warned.
-
- 9. All these stars are driving me mad, I just find the Emacs outlines
- unreadable. Can't you just put white space and a single star as a
- starter for headlines?
- See *Note Clean view::.
-
- 10. I would like to have two windows on the same Org-mode file, but
- with different outline visibility. Is that possible?
- In GNU Emacs, you may use _indirect buffers_ which do exactly this.
- See the documentation on the command `make-indirect-buffer'. In
- XEmacs, this is currently not possible because of the different
- outline implementation.
-
- 11. When I export my TODO list, every TODO item becomes a separate
- section. How do I enforce these items to be exported as an
- itemized list?
- If you plan to use ASCII or HTML export, make sure things you want
- to be exported as item lists are level 4 at least, even if that
- does mean there is a level jump. For example:
-
- * Todays top priorities
- **** TODO write a letter to xyz
- **** TODO Finish the paper
- **** Pick up kids at the school
-
- Alternatively, if you need a specific value for the heading/item
- transition in a particular file, use the `+OPTIONS' line to
- configure the `H' switch.
-
- +OPTIONS: H:2; ...
-
- 12. I would like to export only a subtree of my file to HTML. How?
- If you want to export a subtree, mark the subtree as region and
- then export. Marking can be done with `C-c @ C-x C-x', for
- example.
-
- 13. Org-mode takes over the S-cursor keys. I also want to use
- CUA-mode, is there a way to fix this conflict?
- Yes, see *Note Conflicts::.
-
- 14. One of my table columns has started to fill up with `#ERROR'.
- What is going on?
- Org-mode tried to compute the column from other fields using a
- formula stored in the `#+TBLFM:' line just below the table, and
- the evaluation of the formula fails. Fix the fields used in the
- formula, or fix the formula, or remove it!
-
- 15. When I am in the last column of a table and just above a
- horizontal line in the table, pressing TAB creates a new table line
- before the horizontal line. How can I quickly move to the line
- below the horizontal line instead?
- Press <down> (to get on the separator line) and then <TAB>. Or
- configure the variable `org-table-tab-jumps-over-hlines'.
-
- 16. How can I change the indentation of an entire table without fixing
- every line by hand?
- The indentation of a table is set by the first line. So just fix
- the indentation of the first line and realign with <TAB>.
-
- 17. Is it possible to include entries from org-mode files into my
- emacs diary?
- Since the org-mode agenda is much more powerful and can contain the
- diary (*note Calendar/Diary integration::), you should think twice
- before deciding to do this. Integrating Org-mode information into
- the diary is, however, possible. You need to turn on _fancy diary
- display_ by setting in `.emacs':
-
- (add-hook 'diary-display-hook 'fancy-diary-display)
-
- Then include the following line into your `~/diary' file, in order
- to get the entries from all files listed in the variable
- `org-agenda-files':
-
- &%%(org-diary)
- You may also select specific files with
-
- &%%(org-diary) ~/path/to/some/org-file.org
- &%%(org-diary) ~/path/to/another/org-file.org
-
- If you now launch the calendar and press `d' to display a diary,
- the headlines of entries containing a timestamp, date range,
- schedule, or deadline referring to the selected date will be
- listed. Just like Org-mode's agenda view, the diary for _today_
- contains additional entries for overdue deadlines and scheduled
- items. See also the documentation of the `org-diary' function.
- Under XEmacs, it is not possible to jump back from the diary to
- the org, this works only in the agenda buffer.
-
-
-
-File: org, Node: Interaction, Next: Bugs, Prev: FAQ, Up: Miscellaneous
+File: org, Node: Interaction, Next: Bugs, Prev: TTY keys, Up: Miscellaneous
-11.8 Interaction with other packages
+12.7 Interaction with other packages
====================================
Org-mode lives in the world of GNU Emacs and interacts in various ways
@@ -3996,40 +4140,13 @@ with other code out there.
* Menu:
-* Extensions:: Third-party extensions for Org-mode
* Cooperation:: Packages Org-mode cooperates with
* Conflicts:: Packages that lead to conflicts

-File: org, Node: Extensions, Next: Cooperation, Prev: Interaction, Up: Interaction
-
-11.8.1 Third-party extensions for Org-mode
-------------------------------------------
-
-The following extensions for Org-mode have been written by other people:
-
-`org-mouse.el' by Piotr Zielinski
- This package implements extended mouse functionality for Org-mode.
- It allows you to cycle visibility and to edit the document
- structure with the mouse. Best of all, it provides a
- context-sensitive menu on <mouse-3> that changes depending on the
- context of a mouse-click. `org-mouse.el' is freely available at
- `http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el'.
-
-`org-publish.el' by David O'Toole
- This package provides facilities for publishing related sets of
- Org-mode files together with linked files like images as a
- webpages. It is highly configurable and can be used for other
- publishing purposes as well. As of Org-mode version 4.30,
- `org-publish.el' is part of the Org-mode distribution. It is not
- yet part of Emacs, however, due to a pending copyright assignment.
- In the mean time, `org-publish.el' can be downloaded from David's
- site: `http://dto.freeshell.org/e/org-publish.el'.
-
-
-File: org, Node: Cooperation, Next: Conflicts, Prev: Extensions, Up: Interaction
+File: org, Node: Cooperation, Next: Conflicts, Prev: Interaction, Up: Interaction
-11.8.2 Packages that Org-mode cooperates with
+12.7.1 Packages that Org-mode cooperates with
---------------------------------------------
`calc.el' by Dave Gillespie
@@ -4054,6 +4171,11 @@ File: org, Node: Cooperation, Next: Conflicts, Prev: Extensions, Up: Interac
setup. See the installation instructions in the file
`constants.el'.
+`cdlatex.el' by Carsten Dominik
+ Org-mode can make use of the cdlatex package to efficiently enter
+ LaTeX fragments into Org-mode files. `cdlatex.el' is not part of
+ Emacs, find it on the web.
+
`remember.el' by John Wiegley
Org mode cooperates with remember, see *Note Remember::.
`Remember.el' is not part of Emacs, find it on the web.
@@ -4065,7 +4187,7 @@ File: org, Node: Cooperation, Next: Conflicts, Prev: Extensions, Up: Interac

File: org, Node: Conflicts, Prev: Cooperation, Up: Interaction
-11.8.3 Packages that lead to conflicts with Org-mode
+12.7.2 Packages that lead to conflicts with Org-mode
----------------------------------------------------
`allout.el' by Ken Manheimer
@@ -4099,9 +4221,9 @@ File: org, Node: Conflicts, Prev: Cooperation, Up: Interaction
in the paragraph above about CUA mode also applies here.

-File: org, Node: Bugs, Next: Acknowledgments, Prev: Interaction, Up: Miscellaneous
+File: org, Node: Bugs, Prev: Interaction, Up: Miscellaneous
-11.9 Bugs
+12.8 Bugs
=========
Here is a list of things that should work differently, but which I have
@@ -4126,10 +4248,6 @@ found too hard to fix.
open the file), it does so silently. No error message is
displayed.
- * Plain list items should be able to hold a TODO item.
- Unfortunately this has so many technical problems that I will only
- consider this change for the next major release (5.0).
-
* The remote-editing commands in the agenda buffer cannot be undone
with `undo' called from within the agenda buffer. But you can go
to the corresponding buffer (using <TAB> or <RET> and execute
@@ -4139,22 +4257,138 @@ found too hard to fix.
If a formula uses _calculated_ fields further down the row,
multiple recalculation may be needed to get all fields consistent.
- * Several words in a row may *be made bold*, but this does not work
- if the string is distributed over two lines.
+ * A single letter cannot be made bold, for example `*a*'.
* The exporters work well, but could be made more efficient.

-File: org, Node: Acknowledgments, Prev: Bugs, Up: Miscellaneous
+File: org, Node: Extensions and Hacking, Next: History and Acknowledgments, Prev: Miscellaneous, Up: Top
-11.10 Acknowledgments
-=====================
+Appendix A Extensions, Hooks and Hacking
+****************************************
+
+This appendix lists extensions for Org-mode written by other authors.
+It also covers some aspects where users can easily extend the
+functionality of Org-mode.
+
+* Menu:
+
+* Extensions:: Existing 3rd-part extensions
+* Dynamic blocks:: Automatically filled blocks
+
+
+File: org, Node: Extensions, Next: Dynamic blocks, Prev: Extensions and Hacking, Up: Extensions and Hacking
+
+A.1 Third-party extensions for Org-mode
+=======================================
+
+The following extensions for Org-mode have been written by other people:
+
+`org-mouse.el' by Piotr Zielinski
+ This package implements extended mouse functionality for Org-mode.
+ It allows you to cycle visibility and to edit the document
+ structure with the mouse. Best of all, it provides a
+ context-sensitive menu on <mouse-3> that changes depending on the
+ context of a mouse-click. `org-mouse.el' is freely available at
+ `http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el'.
+
+`org-publish.el' by David O'Toole
+ This package provides facilities for publishing related sets of
+ Org-mode files together with linked files like images as a
+ webpages. It is highly configurable and can be used for other
+ publishing purposes as well. As of Org-mode version 4.30,
+ `org-publish.el' is part of the Org-mode distribution. It is not
+ yet part of Emacs, however, a delay caused by the preparations for
+ the 22.1 release. In the mean time, `org-publish.el' can be
+ downloaded from David's site:
+ `http://dto.freeshell.org/e/org-publish.el'.
+
+`org-blog.el' by David O'Toole
+ A blogging plug-in for `org-publish.el'.
+ `http://dto.freeshell.org/notebook/OrgMode.html'.
+
+`org-blogging.el' by Bastien Guerry
+ Publish Org-mode files as blogs.
+ `http://www.cognition.ens.fr/~guerry/org-blogging.html'.
+
+
+File: org, Node: Dynamic blocks, Prev: Extensions, Up: Extensions and Hacking
+
+A.2 Dynamic blocks
+==================
+
+Org-mode documents can contain _dynamic blocks_. These are specially
+marked regions that are updates by some user-written function. A good
+example for such a block is the clock table inserted by the command
+`C-c C-x C-r' (*note Clocking work time::).
+
+ Dynamic block are enclosed by a BEGIN-END structure that assigns a
+name to the block and can also specify parameters for the function
+producing the content of the block.
+
+ #+BEGIN: myblock :parameter1 value1 :parameter2 value2 .....
+
+ #+END:
+
+ Dynamic blocks are updated with the following commands
+
+`C-c C-x C-u'
+ Update dynamic block at point.
-Org-mode was created by Carsten Dominik, who still maintains it at the
-Org-mode homepage `http://www.astro.uva.nl/~dominik/Tools/org/'. The
-following people (in alphabetic order) have helped the development
-along with ideas, suggestions and patches. Many thanks to all of you,
-Org-mode would not be what it is without your input.
+`C-u C-c C-x C-u'
+ Update all dynamic blocks in the current file.
+
+ Updating a dynamic block means to remove all the text between BEGIN
+and END, parse the BEGIN line for parameters and then call the specific
+writer function for this block to insert the new content. For a block
+with name `myblock', the writer function is `org-dblock-write:myblock'
+with as only parameter a property list with the parameters given in the
+begin line. Here is a trivial example of a block that keeps track of
+when the block update function was last run:
+
+ #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
+
+ #+END:
+
+The corresponding block writer function could look like this:
+
+ (defun org-dblock-write:date-and-time (params)
+ (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
+ (insert "Last block update at: "
+ (format-time-string fmt (current-time)))))
+
+ If you want to make sure that all dynamic blocks are always
+up-to-date, you could add the function `org-update-all-dblocks' to a
+hook, for example `before-save-hook'. `org-update-all-dblocks' is
+written in a way that is does nothing in buffers that are not in
+Org-mode.
+
+
+File: org, Node: History and Acknowledgments, Next: Index, Prev: Extensions and Hacking, Up: Top
+
+Appendix B History and Acknowledgments
+**************************************
+
+The beginnings of Org-mode go back to 2003. It was borne out of
+frustration over the user interface of the emacs outline-mode. All I
+wanted was to make working with an outline tree possible without having
+to remember more than 10 commands just for hiding and unhiding parts of
+the outline tree, and to allow to restructure a tree easily. Visibility
+cycling and structure editing were originally implemented in the package
+`outline-magic.el', but quickly moved to the more general `org.el'.
+TODO entries, basic time stamps, and table support were added next, and
+highlight the two main goals that Org-mode still has today: To create
+a new, outline-based, plain text mode with innovative and intuitive
+editing features, and to incorporate project planning functionality
+directly into a notes file.
+
+ Since the first release, hundreds of emails to me or on
+`emacs-orgmode@gnu.org' have provided a constant stream of bug reports,
+feedback, new ideas, and sometimes even patches and add-on code. Many
+thanks to everyone who has helped to improve this package. I am trying
+to keep here a list of the people who had significant influence in
+shaping one or more aspects of Org-mode. The list may not be complete,
+if I have forgotten someone, please accept my apologies and let me know.
* Thomas Baumann contributed the code for links to the MH-E email
system.
@@ -4167,8 +4401,9 @@ Org-mode would not be what it is without your input.
* Pavel Chalmoviansky influenced the agenda treatment of items with
specified time.
- * Gregory Chenov patched support for lisp forms into table
- calculations and improved XEmacs compatibility.
+ * Gregory Chernov patched support for lisp forms into table
+ calculations and improved XEmacs compatibility, in particular by
+ porting `nouline.el' to XEmacs.
* Sacha Chua suggested to copy some linking code from Planner.
@@ -4180,9 +4415,15 @@ Org-mode would not be what it is without your input.
* Nic Ferrier contributed mailcap and XOXO support.
+ * Niels Giessen had the idea to automatically archive DONE trees.
+
+ * Bastien Guerry provoded extensive feedback.
+
* Kai Grossjohann pointed out key-binding conflicts caused by
Org-mode.
+ * Leon Liu asked for embedded LaTeX and tested it.
+
* Stefan Monnier provided a patch to keep the Emacs-Lisp compiler
happy.
@@ -4217,6 +4458,9 @@ Org-mode would not be what it is without your input.
* Linking to VM/BBDB/GNUS was inspired by Tom Shannon's
`organizer-mode.el'.
+ * Daniel Sinder came up with the idea of internal archiving by
+ locking subtrees.
+
* David O'Toole wrote `org-publish.el' and drafted the manual
chapter about publishing.
@@ -4246,15 +4490,17 @@ Org-mode would not be what it is without your input.
links with mouse-1.

-File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
+File: org, Node: Index, Next: Key Index, Prev: History and Acknowledgments, Up: Top
-12 Index
-********
+Index
+*****
* Menu:
-* acknowledgments: Acknowledgments. (line 6)
+* acknowledgments: History and Acknowledgments.
+ (line 6)
+* action, for publishing: Publishing action. (line 6)
* active region <1>: HTML export. (line 10)
* active region <2>: ASCII export. (line 9)
* active region <3>: Built-in table editor.
@@ -4263,19 +4509,17 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* agenda: Weekly/Daily agenda. (line 6)
* agenda commands, custom: Agenda dispatcher. (line 6)
* agenda dispatcher: Agenda dispatcher. (line 6)
-* agenda files, removing buffers: Agenda commands. (line 205)
+* agenda files, removing buffers: Agenda commands. (line 208)
* agenda views: Agenda views. (line 6)
* agenda, for single file: Timeline. (line 6)
* allout.el: Conflicts. (line 6)
-* allout.el, conflict with: FAQ. (line 8)
* angular brackets, around links: External links. (line 38)
* applescript, for calendar update: iCalendar export. (line 38)
-* archive locations: Archiving. (line 13)
+* archive locations: Moving subtrees. (line 21)
* archiving: Archiving. (line 6)
* ASCII export: ASCII export. (line 6)
* author: Feedback. (line 6)
-* autoload: Installation and activation.
- (line 6)
+* autoload: Installation. (line 6)
* BBDB links: External links. (line 6)
* bold text: Enhancing text. (line 15)
* bug reports: Feedback. (line 6)
@@ -4292,6 +4536,7 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* CamelCase links: Internal links. (line 6)
* CamelCase links, completion of: CamelCase links. (line 6)
* category: Categories. (line 6)
+* cdlatex.el: Cooperation. (line 29)
* checkboxes: Plain lists. (line 36)
* children, subtree visibility state: Visibility cycling. (line 10)
* clean outline view: Clean view. (line 6)
@@ -4303,15 +4548,14 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* completion, of CamelCase links <1>: Completion. (line 6)
* completion, of CamelCase links: CamelCase links. (line 6)
* completion, of dictionary words: Completion. (line 6)
-* completion, of file names: Handling links. (line 44)
-* completion, of links: Handling links. (line 28)
+* completion, of file names: Handling links. (line 43)
+* completion, of links: Handling links. (line 27)
* completion, of option keywords <1>: Completion. (line 6)
* completion, of option keywords: Export options. (line 6)
* Completion, of option keywords: Per file keywords. (line 17)
* completion, of tags <1>: Completion. (line 6)
* completion, of tags: Setting tags. (line 11)
-* completion, of TeX symbols <1>: Completion. (line 6)
-* completion, of TeX symbols: Enhancing text. (line 19)
+* completion, of TeX symbols: Completion. (line 6)
* completion, of TODO keywords <1>: Completion. (line 6)
* completion, of TODO keywords: Workflow states. (line 12)
* constants, in calculations: Formula syntax. (line 26)
@@ -4326,16 +4570,17 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* cutting, of subtrees: Structure editing. (line 6)
* cycling, of TODO states: TODO basics. (line 13)
* cycling, visibility: Visibility cycling. (line 6)
-* dangerous commands: FAQ. (line 70)
* date stamps: Time stamps. (line 6)
* date, reading in minibuffer: Creating timestamps. (line 71)
* DEADLINE keyword: Time stamps. (line 43)
* deadlines: Time stamps. (line 6)
* demotion, of subtrees: Structure editing. (line 6)
-* diary entries, creating from agenda: Agenda commands. (line 173)
+* diary entries, creating from agenda: Agenda commands. (line 176)
* diary integration: Calendar/Diary integration.
(line 6)
* dictionary word completion: Completion. (line 6)
+* directories, for publishing: Sources and destinations.
+ (line 6)
* dispatching agenda commands: Agenda dispatcher. (line 6)
* document structure: Document structure. (line 6)
* DONE, final TODO keyword: Per file keywords. (line 20)
@@ -4347,23 +4592,23 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* enhancing text: Enhancing text. (line 6)
* evaluate time range: Creating timestamps. (line 66)
* exporting: Exporting. (line 6)
-* exporting a subtree: FAQ. (line 112)
* exporting, not: Comment lines. (line 6)
* extended TODO keywords: TODO extensions. (line 6)
+* external archiving: Moving subtrees. (line 6)
* external links: External links. (line 6)
* external links, in HTML export: HTML export. (line 35)
-* FAQ: FAQ. (line 6)
+* FAQ: Summary. (line 41)
* feedback: Feedback. (line 6)
* file links: External links. (line 6)
* file links, searching: Search options. (line 6)
-* file name completion: Handling links. (line 44)
+* file name completion: Handling links. (line 43)
* files, adding to agenda list: Agenda files. (line 12)
-* filing subtrees: Archiving. (line 6)
-* fixed width: Enhancing text. (line 30)
+* files, selecting for publishing: Selecting files. (line 6)
+* fixed width: Enhancing text. (line 25)
* fixed-width sections: Export options. (line 25)
* folded, subtree visibility state: Visibility cycling. (line 10)
* folding, sparse trees: Sparse trees. (line 6)
-* following links: Handling links. (line 59)
+* following links: Handling links. (line 58)
* format specifier: Formula syntax. (line 34)
* format, of links: Link format. (line 6)
* formula editing: Editing/debugging formulas.
@@ -4375,8 +4620,7 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* formula, in tables: Built-in table editor.
(line 135)
* global cycling: Visibility cycling. (line 22)
-* global keybindings: Installation and activation.
- (line 6)
+* global keybindings: Installation. (line 6)
* global TODO list: Global TODO list. (line 6)
* global visibility states: Visibility cycling. (line 22)
* GNUS links: External links. (line 6)
@@ -4390,43 +4634,44 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* headlines: Headlines. (line 6)
* hide text: Visibility cycling. (line 6)
* hiding leading stars: Clean view. (line 6)
+* history: History and Acknowledgments.
+ (line 6)
* HTML export: HTML export. (line 6)
* hyperlinks: Hyperlinks. (line 6)
* iCalendar export: iCalendar export. (line 6)
-* in-buffer settings: Summary of in-buffer settings.
- (line 6)
-* indentation, of tables: FAQ. (line 136)
-* indirect buffers: FAQ. (line 88)
+* in-buffer settings: In-buffer settings. (line 6)
+* index, of published pages: Project page index. (line 6)
* Info links: External links. (line 6)
* inheritance, of tags: Tag inheritance. (line 6)
-* inserting links: Handling links. (line 28)
-* installation: Installation and activation.
- (line 6)
+* inserting links: Handling links. (line 27)
+* installation: Installation. (line 6)
+* internal archiving: ARCHIVE tag. (line 6)
* internal links: Internal links. (line 6)
* internal links, in HTML export: HTML export. (line 35)
* introduction: Introduction. (line 6)
* italic text: Enhancing text. (line 15)
* jumping, to headlines: Motion. (line 6)
-* keybindings, global: Installation and activation.
- (line 6)
-* keymapp nil error: FAQ. (line 6)
+* keybindings, global: Installation. (line 6)
* keyword options: Per file keywords. (line 6)
+* LaTeX fragments: Export options. (line 25)
+* LaTeX fragments, export: Enhancing text. (line 18)
+* LaTeX interpretation: Embedded LaTeX. (line 6)
* linebreak preservation: Export options. (line 25)
-* linebreak, forced: Enhancing text. (line 37)
-* link completion: Handling links. (line 28)
+* linebreak, forced: Enhancing text. (line 32)
+* link completion: Handling links. (line 27)
* link format: Link format. (line 6)
* links, external: External links. (line 6)
* links, in HTML export: HTML export. (line 35)
* links, internal: Internal links. (line 6)
-* links, returning to: Handling links. (line 85)
+* links, publishing: Publishing links. (line 6)
+* links, returning to: Handling links. (line 84)
* Lisp forms, as table formulas: Lisp formulas. (line 6)
* lists, hand-formatted: Enhancing text. (line 11)
* lists, ordered: Plain lists. (line 6)
* lists, plain: Plain lists. (line 6)
* logging, of progress: Progress logging. (line 6)
* maintainer: Feedback. (line 6)
-* make-indirect-buffer: FAQ. (line 88)
-* mark ring: Handling links. (line 81)
+* mark ring: Handling links. (line 80)
* marking characters, tables: Advanced features. (line 34)
* matching, of tags: Matching headline tags.
(line 6)
@@ -4444,11 +4689,14 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* option keyword completion: Completion. (line 6)
* options, for customization: Customization. (line 6)
* options, for export: Export options. (line 6)
+* options, for publishing: Publishing options. (line 6)
* ordered lists: Plain lists. (line 6)
* org-agenda, command: Weekly/Daily agenda. (line 9)
-* org-mode, turning on: Installation and activation.
- (line 30)
+* org-blog.el: Extensions. (line 25)
+* org-blogging.el: Extensions. (line 29)
+* org-mode, turning on: Installation. (line 34)
* org-mouse.el: Extensions. (line 8)
+* org-publish-project-alist: Project alist. (line 6)
* org-publish.el: Extensions. (line 14)
* orgtbl-mode: orgtbl-mode. (line 6)
* outline tree: Headlines. (line 6)
@@ -4465,7 +4713,9 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* priorities, of agenda items: Sorting of agenda items.
(line 6)
* progress logging: Progress logging. (line 6)
+* projects, for publishing: Project alist. (line 6)
* promotion, of subtrees: Structure editing. (line 6)
+* publishing: Publishing. (line 6)
* quoted HTML tags: Export options. (line 25)
* ranges, time: Time stamps. (line 6)
* recomputing table fields: Column formulas. (line 27)
@@ -4474,7 +4724,7 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* region, active <3>: Built-in table editor.
(line 165)
* region, active: Structure editing. (line 51)
-* remember.el <1>: Cooperation. (line 29)
+* remember.el <1>: Cooperation. (line 34)
* remember.el: Remember. (line 6)
* richer text: Enhancing text. (line 6)
* RMAIL links: External links. (line 6)
@@ -4484,7 +4734,6 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* section-numbers: Export options. (line 25)
* setting tags: Setting tags. (line 6)
* SHELL links: External links. (line 6)
-* shell links, confirmation: FAQ. (line 70)
* show all, command: Visibility cycling. (line 31)
* show all, global visibility state: Visibility cycling. (line 22)
* show hidden text: Visibility cycling. (line 6)
@@ -4495,8 +4744,7 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
* sparse tree, for TODO: TODO basics. (line 26)
* sparse tree, tag based: Tags. (line 6)
* sparse trees: Sparse trees. (line 6)
-* special keywords: Summary of in-buffer settings.
- (line 6)
+* special keywords: In-buffer settings. (line 6)
* spreadsheet capabilities: Table calculations. (line 6)
* storing links: Handling links. (line 9)
* structure editing: Structure editing. (line 6)
@@ -4512,22 +4760,24 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top
(line 6)
* table editor, table.el: table.el. (line 6)
* table of contents: Export options. (line 25)
-* table.el <1>: Cooperation. (line 30)
+* table.el <1>: Cooperation. (line 35)
* table.el: table.el. (line 6)
* tables <1>: Export options. (line 25)
* tables: Tables. (line 6)
-* tables, export: Enhancing text. (line 26)
+* tables, export: Enhancing text. (line 21)
* tag completion: Completion. (line 6)
* tag searches: Tag searches. (line 6)
* tags: Tags. (line 6)
* tags view: Matching headline tags.
(line 6)
* templates, for remember: Remember. (line 23)
-* TeX interpretation: Enhancing text. (line 17)
+* TeX interpretation: Embedded LaTeX. (line 6)
* TeX macros: Export options. (line 25)
+* TeX macros, export: Enhancing text. (line 18)
* TeX symbol completion: Completion. (line 6)
* TeX-like syntax for sub- and superscripts: Export options. (line 25)
-* thanks: Acknowledgments. (line 6)
+* thanks: History and Acknowledgments.
+ (line 6)
* time stamps: Time stamps. (line 6)
* time, reading in minibuffer: Creating timestamps. (line 71)
* time-sorted view: Timeline. (line 6)
@@ -4565,15 +4815,16 @@ File: org, Node: Index, Next: Key Index, Prev: Miscellaneous, Up: Top

File: org, Node: Key Index, Prev: Index, Up: Top
-13 Key Index
-************
+3 Key Index
+***********
* Menu:
-* +: Agenda commands. (line 120)
-* ,: Agenda commands. (line 112)
-* -: Agenda commands. (line 126)
+* ': CDLaTeX mode. (line 43)
+* +: Agenda commands. (line 123)
+* ,: Agenda commands. (line 115)
+* -: Agenda commands. (line 129)
* .: Agenda commands. (line 91)
* :: Agenda commands. (line 109)
* <: Creating timestamps. (line 78)
@@ -4584,22 +4835,27 @@ File: org, Node: Key Index, Prev: Index, Up: Top
(line 64)
* <right>: Agenda commands. (line 83)
* <SPC>: Agenda commands. (line 28)
-* <TAB> <1>: Agenda commands. (line 35)
-* <TAB> <2>: Built-in table editor.
+* <TAB> <1>: CDLaTeX mode. (line 23)
+* <TAB> <2>: Agenda commands. (line 35)
+* <TAB> <3>: Built-in table editor.
(line 57)
-* <TAB> <3>: Plain lists. (line 48)
+* <TAB> <4>: Plain lists. (line 48)
* <TAB>: Visibility cycling. (line 10)
-* > <1>: Agenda commands. (line 148)
+* > <1>: Agenda commands. (line 151)
* >: Creating timestamps. (line 79)
-* C: Agenda commands. (line 188)
-* c: Agenda commands. (line 166)
+* ^: CDLaTeX mode. (line 33)
+* _: CDLaTeX mode. (line 33)
+* `: CDLaTeX mode. (line 39)
+* a: Agenda commands. (line 112)
+* C: Agenda commands. (line 191)
+* c: Agenda commands. (line 169)
* C-#: Built-in table editor.
(line 155)
* C-,: Agenda files. (line 18)
* C-c !: Creating timestamps. (line 21)
-* C-c $: Archiving. (line 9)
-* C-c %: Handling links. (line 81)
-* C-c &: Handling links. (line 85)
+* C-c $: Moving subtrees. (line 10)
+* C-c %: Handling links. (line 80)
+* C-c &: Handling links. (line 84)
* C-c ' <1>: Editing/debugging formulas.
(line 20)
* C-c ': Built-in table editor.
@@ -4613,7 +4869,7 @@ File: org, Node: Key Index, Prev: Index, Up: Top
(line 92)
* C-c .: Creating timestamps. (line 10)
* C-c /: Sparse trees. (line 15)
-* C-c :: Enhancing text. (line 34)
+* C-c :: Enhancing text. (line 29)
* C-c ;: Comment lines. (line 11)
* C-c <: Creating timestamps. (line 25)
* C-c <TAB>: Built-in table editor.
@@ -4633,7 +4889,7 @@ File: org, Node: Key Index, Prev: Index, Up: Top
* C-c `: Built-in table editor.
(line 181)
* C-c a a: Weekly/Daily agenda. (line 9)
-* C-c a C: Agenda dispatcher. (line 30)
+* C-c a C: Agenda dispatcher. (line 29)
* C-c a M: Matching headline tags.
(line 15)
* C-c a m: Matching headline tags.
@@ -4647,28 +4903,30 @@ File: org, Node: Key Index, Prev: Index, Up: Top
* C-c C-b: Motion. (line 15)
* C-c C-c <1>: The very busy C-c C-c key.
(line 6)
-* C-c C-c <2>: Setting tags. (line 10)
-* C-c C-c <3>: table.el. (line 6)
-* C-c C-c <4>: Editing/debugging formulas.
+* C-c C-c <2>: Processing LaTeX fragments.
+ (line 15)
+* C-c C-c <3>: Setting tags. (line 10)
+* C-c C-c <4>: table.el. (line 6)
+* C-c C-c <5>: Editing/debugging formulas.
(line 16)
-* C-c C-c <5>: Built-in table editor.
+* C-c C-c <6>: Built-in table editor.
(line 54)
* C-c C-c: Plain lists. (line 85)
-* C-c C-d <1>: Agenda commands. (line 133)
+* C-c C-d <1>: Agenda commands. (line 136)
* C-c C-d: Creating timestamps. (line 37)
* C-c C-f: Motion. (line 12)
* C-c C-j: Motion. (line 21)
-* C-c C-l: Handling links. (line 28)
+* C-c C-l: Handling links. (line 27)
* C-c C-n: Motion. (line 8)
* C-c C-o <1>: Creating timestamps. (line 33)
-* C-c C-o: Handling links. (line 59)
+* C-c C-o: Handling links. (line 58)
* C-c C-p: Motion. (line 9)
* C-c C-q <1>: Editing/debugging formulas.
(line 20)
* C-c C-q: Built-in table editor.
(line 119)
* C-c C-r: Timeline. (line 13)
-* C-c C-s <1>: Agenda commands. (line 130)
+* C-c C-s <1>: Agenda commands. (line 133)
* C-c C-s: Creating timestamps. (line 48)
* C-c C-t <1>: Clocking work time. (line 20)
* C-c C-t: TODO basics. (line 13)
@@ -4678,12 +4936,17 @@ File: org, Node: Key Index, Prev: Index, Up: Top
* C-c C-x a: ASCII export. (line 9)
* C-c C-x b: HTML export. (line 11)
* C-c C-x c: iCalendar export. (line 20)
-* C-c C-x C-c: Agenda commands. (line 195)
+* C-c C-x C-a: ARCHIVE tag. (line 27)
+* C-c C-x C-c: Agenda commands. (line 198)
* C-c C-x C-d: Clocking work time. (line 28)
* C-c C-x C-i <1>: iCalendar export. (line 15)
* C-c C-x C-i: Clocking work time. (line 12)
* C-c C-x C-k: Structure editing. (line 36)
+* C-c C-x C-l: Processing LaTeX fragments.
+ (line 9)
* C-c C-x C-o: Clocking work time. (line 14)
+* C-c C-x C-r: Clocking work time. (line 35)
+* C-c C-x C-u: Dynamic blocks. (line 21)
* C-c C-x C-w <1>: Built-in table editor.
(line 108)
* C-c C-x C-w: Structure editing. (line 36)
@@ -4705,23 +4968,27 @@ File: org, Node: Key Index, Prev: Index, Up: Top
* C-c C-x v h: HTML export. (line 14)
* C-c C-y: Creating timestamps. (line 66)
* C-c l: Handling links. (line 9)
+* C-c {: CDLaTeX mode. (line 21)
* C-c |: Built-in table editor.
(line 40)
* C-c ~: table.el. (line 18)
+* C-u C-c $: Moving subtrees. (line 12)
* C-u C-c .: Creating timestamps. (line 16)
* C-u C-c =: Built-in table editor.
(line 139)
-* C-u C-c C-l: Handling links. (line 44)
+* C-u C-c C-l: Handling links. (line 43)
+* C-u C-c C-x C-a: ARCHIVE tag. (line 30)
+* C-u C-c C-x C-u: Dynamic blocks. (line 22)
* D: Agenda commands. (line 68)
* d: Agenda commands. (line 65)
* f: Agenda commands. (line 44)
* g: Agenda commands. (line 72)
-* H: Agenda commands. (line 192)
-* i: Agenda commands. (line 173)
-* I: Agenda commands. (line 153)
+* H: Agenda commands. (line 195)
+* i: Agenda commands. (line 176)
+* I: Agenda commands. (line 156)
* l: Agenda commands. (line 51)
* L: Agenda commands. (line 32)
-* M: Agenda commands. (line 179)
+* M: Agenda commands. (line 182)
* M-<down>: Built-in table editor.
(line 82)
* M-<left> <1>: Built-in table editor.
@@ -4759,167 +5026,179 @@ File: org, Node: Key Index, Prev: Index, Up: Top
* M-S-<up>: Structure editing. (line 30)
* mouse-1 <1>: Agenda commands. (line 35)
* mouse-1 <2>: Creating timestamps. (line 82)
-* mouse-1: Handling links. (line 73)
+* mouse-1: Handling links. (line 72)
* mouse-2 <1>: Agenda commands. (line 35)
-* mouse-2: Handling links. (line 73)
+* mouse-2: Handling links. (line 72)
* mouse-3 <1>: Agenda commands. (line 28)
-* mouse-3: Handling links. (line 78)
+* mouse-3: Handling links. (line 77)
* n: Agenda commands. (line 19)
-* O: Agenda commands. (line 155)
+* O: Agenda commands. (line 158)
* o: Agenda commands. (line 59)
-* P: Agenda commands. (line 117)
+* P: Agenda commands. (line 120)
* p: Agenda commands. (line 20)
-* q: Agenda commands. (line 202)
+* q: Agenda commands. (line 205)
* r <1>: Agenda commands. (line 76)
* r: Global TODO list. (line 20)
-* S: Agenda commands. (line 183)
-* S-<down> <1>: Agenda commands. (line 126)
+* S: Agenda commands. (line 186)
+* S-<down> <1>: Agenda commands. (line 129)
* S-<down> <2>: Creating timestamps. (line 58)
* S-<down> <3>: Priorities. (line 25)
* S-<down>: Plain lists. (line 66)
-* S-<left> <1>: Agenda commands. (line 144)
+* S-<left> <1>: Agenda commands. (line 147)
* S-<left> <2>: Creating timestamps. (line 53)
* S-<left>: TODO basics. (line 20)
* S-<RET>: Built-in table editor.
(line 170)
-* S-<right> <1>: Agenda commands. (line 136)
+* S-<right> <1>: Agenda commands. (line 139)
* S-<right> <2>: Creating timestamps. (line 53)
* S-<right>: TODO basics. (line 20)
* S-<TAB> <1>: Built-in table editor.
(line 61)
* S-<TAB>: Visibility cycling. (line 22)
-* S-<up> <1>: Agenda commands. (line 120)
+* S-<up> <1>: Agenda commands. (line 123)
* S-<up> <2>: Creating timestamps. (line 58)
* S-<up> <3>: Priorities. (line 25)
* S-<up>: Plain lists. (line 66)
* T: Agenda commands. (line 104)
* t: Agenda commands. (line 100)
* w: Agenda commands. (line 62)
-* x: Agenda commands. (line 205)
-* X: Agenda commands. (line 158)
+* x: Agenda commands. (line 208)
+* X: Agenda commands. (line 161)

Tag Table:
Node: Top959
-Node: Introduction8845
-Node: Summary9159
-Node: Installation and activation11415
-Node: Feedback13073
-Node: Document structure13859
-Node: Outlines14625
-Node: Headlines15285
-Node: Visibility cycling15908
-Ref: Visibility cycling-Footnote-117383
-Ref: Visibility cycling-Footnote-217441
-Node: Motion17491
-Node: Structure editing18275
-Node: Archiving20384
-Node: Sparse trees21244
-Ref: Sparse trees-Footnote-123223
-Ref: Sparse trees-Footnote-223315
-Node: Plain lists23430
-Ref: Plain lists-Footnote-127328
-Node: Tables27685
-Node: Built-in table editor28233
-Node: Narrow columns35840
-Ref: Narrow columns-Footnote-137779
-Node: Table calculations37825
-Node: Formula syntax39145
-Ref: Formula syntax-Footnote-142050
-Node: Lisp formulas42350
-Node: Column formulas43139
-Node: Advanced features44901
-Node: Named-field formulas48155
-Node: Editing/debugging formulas48795
-Node: Appetizer50553
-Node: orgtbl-mode51656
-Node: table.el52147
-Node: Hyperlinks53124
-Node: Link format53829
-Node: Internal links55122
-Ref: Internal links-Footnote-157111
-Node: Radio targets57243
-Node: CamelCase links57958
-Node: External links58456
-Node: Handling links60587
-Node: Search options65137
-Ref: Search options-Footnote-166911
-Node: Custom searches66992
-Node: Remember68040
-Node: TODO items71730
-Node: TODO basics72594
-Node: TODO extensions74121
-Node: Workflow states74916
-Node: TODO types75784
-Ref: TODO types-Footnote-177442
-Node: Per file keywords77524
-Ref: Per file keywords-Footnote-178978
-Node: Priorities79206
-Node: Timestamps80422
-Node: Time stamps80812
-Node: Creating timestamps83910
-Node: Progress logging87256
-Node: Closing items87786
-Node: Clocking work time88581
-Node: Tags90266
-Node: Tag inheritance91028
-Node: Setting tags91965
-Ref: Setting tags-Footnote-195095
-Ref: Setting tags-Footnote-295207
-Node: Tag searches95287
-Node: Agenda views96496
-Node: Agenda files98035
-Ref: Agenda files-Footnote-198995
-Ref: Agenda files-Footnote-299144
-Node: Agenda dispatcher99336
-Node: Weekly/Daily agenda101466
-Node: Categories102601
-Node: Time-of-day specifications103249
-Node: Calendar/Diary integration105225
-Node: Sorting of agenda items106602
-Node: Global TODO list107434
-Node: Matching headline tags108795
-Node: Timeline109738
-Node: Agenda commands110611
-Node: Exporting116330
-Node: ASCII export117463
-Node: HTML export118749
-Node: XOXO export121583
-Node: iCalendar export122022
-Node: Text interpretation123845
-Node: Comment lines124322
-Node: Enhancing text124791
-Node: Export options126715
-Node: Publishing128317
-Ref: Publishing-Footnote-1129113
-Node: Configuration129309
-Node: Project alist130030
-Node: File sources and destinations131101
-Node: Selecting files131653
-Node: Publishing action132406
-Node: Publishing options133521
-Node: Publishing links135560
-Node: Project page index136363
-Node: Sample configuration137141
-Node: Simple example137633
-Node: Complex example138306
-Node: Triggering publication140382
-Node: Miscellaneous141038
-Node: Completion141797
-Node: Customization142793
-Node: Summary of in-buffer settings143400
-Node: The very busy C-c C-c key146642
-Node: Clean view148157
-Node: TTY keys150734
-Node: FAQ152335
-Node: Interaction160133
-Node: Extensions160593
-Node: Cooperation161845
-Node: Conflicts163539
-Node: Bugs165131
-Node: Acknowledgments167029
-Node: Index170467
-Node: Key Index192859
+Node: Introduction9455
+Node: Summary9768
+Node: Installation12035
+Node: Feedback13824
+Node: Document structure14595
+Node: Outlines15361
+Node: Headlines16021
+Node: Visibility cycling16644
+Ref: Visibility cycling-Footnote-118119
+Ref: Visibility cycling-Footnote-218177
+Node: Motion18227
+Node: Structure editing19011
+Node: Archiving21120
+Node: ARCHIVE tag21678
+Node: Moving subtrees23353
+Node: Sparse trees24394
+Ref: Sparse trees-Footnote-126373
+Ref: Sparse trees-Footnote-226465
+Node: Plain lists26580
+Ref: Plain lists-Footnote-130478
+Node: Tables30835
+Node: Built-in table editor31383
+Node: Narrow columns38990
+Ref: Narrow columns-Footnote-140929
+Node: Table calculations40975
+Node: Formula syntax42295
+Ref: Formula syntax-Footnote-145200
+Node: Lisp formulas45500
+Node: Column formulas46289
+Node: Advanced features48051
+Node: Named-field formulas51305
+Node: Editing/debugging formulas51945
+Node: Appetizer53703
+Node: orgtbl-mode54806
+Node: table.el55297
+Node: Hyperlinks56274
+Node: Link format56979
+Node: Internal links58272
+Ref: Internal links-Footnote-160261
+Node: Radio targets60393
+Node: CamelCase links61108
+Node: External links61606
+Node: Handling links63737
+Ref: Handling links-Footnote-168323
+Node: Search options68560
+Ref: Search options-Footnote-170334
+Node: Custom searches70415
+Node: Remember71463
+Node: TODO items75153
+Node: TODO basics76017
+Node: TODO extensions77544
+Node: Workflow states78339
+Node: TODO types79207
+Ref: TODO types-Footnote-180865
+Node: Per file keywords80947
+Ref: Per file keywords-Footnote-182401
+Node: Priorities82629
+Node: Timestamps83845
+Node: Time stamps84235
+Node: Creating timestamps87332
+Node: Progress logging90678
+Node: Closing items91208
+Node: Clocking work time92003
+Node: Tags94172
+Node: Tag inheritance94934
+Node: Setting tags95871
+Ref: Setting tags-Footnote-199001
+Ref: Setting tags-Footnote-299113
+Node: Tag searches99193
+Node: Agenda views100402
+Node: Agenda files101946
+Ref: Agenda files-Footnote-1102906
+Ref: Agenda files-Footnote-2103055
+Node: Agenda dispatcher103247
+Node: Weekly/Daily agenda105363
+Node: Categories106498
+Node: Time-of-day specifications107146
+Node: Calendar/Diary integration109122
+Node: Sorting of agenda items110499
+Node: Global TODO list111331
+Node: Matching headline tags112692
+Node: Timeline113635
+Node: Agenda commands114508
+Node: Embedded LaTeX120286
+Ref: Embedded LaTeX-Footnote-1121378
+Node: Math symbols121568
+Node: Subscripts and Superscripts122333
+Node: LaTeX fragments123177
+Node: Processing LaTeX fragments125246
+Node: CDLaTeX mode126192
+Ref: CDLaTeX mode-Footnote-1128676
+Node: Exporting128824
+Node: ASCII export129961
+Node: HTML export131251
+Node: XOXO export134087
+Node: iCalendar export134528
+Node: Text interpretation136353
+Node: Comment lines136832
+Node: Enhancing text137303
+Node: Export options138995
+Node: Publishing140662
+Ref: Publishing-Footnote-1141458
+Node: Configuration141654
+Node: Project alist142372
+Node: Sources and destinations143438
+Node: Selecting files143985
+Node: Publishing action144733
+Node: Publishing options145848
+Node: Publishing links148000
+Node: Project page index149513
+Node: Sample configuration150291
+Node: Simple example150783
+Node: Complex example151456
+Node: Triggering publication153532
+Node: Miscellaneous154188
+Node: Completion154822
+Node: Customization155818
+Node: In-buffer settings156403
+Node: The very busy C-c C-c key159634
+Node: Clean view161271
+Node: TTY keys163848
+Node: Interaction165457
+Node: Cooperation165854
+Node: Conflicts167756
+Node: Bugs169348
+Node: Extensions and Hacking170971
+Node: Extensions171457
+Node: Dynamic blocks173027
+Node: History and Acknowledgments174945
+Node: Index179726
+Node: Key Index202566

End Tag Table
diff --git a/org-publish.el b/org-publish.el
index cabea06..ad0ace3 100644
--- a/org-publish.el
+++ b/org-publish.el
@@ -1,12 +1,12 @@
;;; org-publish.el --- publish related org-mode files as a website
-;; Copyright (C) 2006 David O'Toole
+;; Copyright (C) 2006 Free Software Foundation, Inc.
;; Author: David O'Toole <dto@gnu.org>
;; Keywords: hypermedia, outlines
-;; Version:
+;; Version:
-;; $Id: org-publish.el,v 1.67 2006/05/30 10:44:31 dto Exp dto $
+;; $Id: org-publish.el,v 1.73 2006/06/15 12:43:48 dto Exp $
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -23,8 +23,6 @@
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
-;; This file is NOT part of GNU Emacs.
-
;;; Commentary:
;; Requires at least version 4.27 of org.el
@@ -39,7 +37,7 @@
;; to allow configurable publishing of related sets of files as a
;; complete website.
;;
-;; org-publish.el can do the following:
+;; org-publish.el can do the following:
;;
;; + Publish all one's org-files to html
;; + Upload html, images, attachments and other files to a web server
@@ -51,7 +49,7 @@
;; Special thanks to the org-mode maintainer Carsten Dominik for his
;; ideas, enthusiasm, and cooperation.
-;;; Installation:
+;;; Installation:
;; Put org-publish.el in your load path, byte-compile it, and then add
;; the following lines to your emacs initialization file:
@@ -65,13 +63,13 @@
;; already in the file org-install.el, and hence don't need to be put
;; in your emacs initialization file in this case.
-;;; Usage:
+;;; Usage:
;;
;; The program's main configuration variable is
;; `org-publish-project-alist'. See below for example configurations
;; with commentary.
-;; The main interactive functions are:
+;; The main interactive functions are:
;;
;; M-x org-publish
;; M-x org-publish-all
@@ -81,7 +79,7 @@
;;;; Simple example configuration:
;; (setq org-publish-project-alist
-;; (list
+;; (list
;; '("org" . (:base-directory "~/org/"
;; :base-extension "org"
;; :publishing-directory "~/public_html"
@@ -103,10 +101,10 @@
;; following example configuration to your specific paths, run M-x
;; org-publish-all, and it should publish the files to the correct
;; directories on the web server, transforming the *.org files into
-;; HTML, and leaving other files alone.
+;; HTML, and leaving other files alone.
;; (setq org-publish-project-alist
-;; (list
+;; (list
;; '("orgfiles" :base-directory "~/org/"
;; :base-extension "org"
;; :publishing-directory "/ssh:user@host:~/html/notebook/"
@@ -118,12 +116,12 @@
;; :style "<link rel=stylesheet href=\"../other/mystyle.css\" type=\"text/css\">"
;; :auto-preamble t
;; :auto-postamble nil)
-;;
+;;
;; ("images" :base-directory "~/images/"
;; :base-extension "jpg\\|gif\\|png"
;; :publishing-directory "/ssh:user@host:~/html/images/"
;; :publishing-function org-publish-attachment)
-;;
+;;
;; ("other" :base-directory "~/other/"
;; :base-extension "css"
;; :publishing-directory "/ssh:user@host:~/html/other/"
@@ -140,13 +138,13 @@
;;; List of user-visible changes since version 1.27
-;; 1.65: Remove old "composite projects". They're redundant.
+;; 1.65: Remove old "composite projects". They're redundant.
;; 1.64: Allow meta-projects with :components
;; 1.57: Timestamps flag is now called "org-publish-use-timestamps-flag"
;; 1.52: Properly set default for :index-filename
;; 1.48: Composite projects allowed.
;; :include keyword allowed.
-;; 1.43: Index no longer includes itself in the index.
+;; 1.43: Index no longer includes itself in the index.
;; 1.42: Fix "function definition is void" error
;; when :publishing-function not set in org-publish-current-file.
;; 1.41: Fixed bug where index isn't published on first try.
@@ -158,7 +156,7 @@
;;; Code:
-(eval-when-compile
+(eval-when-compile
(require 'cl))
(defgroup org-publish nil
@@ -167,16 +165,16 @@
:group 'org)
-(defcustom org-publish-project-alist nil
+(defcustom org-publish-project-alist nil
"Association list to control publishing behavior.
Each element of the alist is a publishing 'project.' The CAR of
each element is a string, uniquely identifying the project. The
-CDR of each element is in one of the following forms:
+CDR of each element is in one of the following forms:
(:property value :property value ... )
OR,
-
+
(:components (\"project-1\" \"project-2\" ...))
When the CDR of an element of org-publish-project-alist is in
@@ -191,7 +189,7 @@ setting overrides the value of the corresponding user variable
override everything.
Most properties are optional, but some should always be set:
-
+
:base-directory Directory containing publishing source files
:base-extension Extension (without the dot!) of source files.
This can be a regular expression.
@@ -207,7 +205,7 @@ value may be a list of filenames to include. The filenames are
considered relative to the publishing directory.
When both :include and :exclude properties are given values, the
-exclusion step happens first.
+exclusion step happens first.
One special property controls which back-end function to use for
publishing files in the project. This can be used to extend the
@@ -249,29 +247,29 @@ learn more about their use and default values.
The following properties may be used to control publishing of an
index of files or summary page for a given project.
- :auto-index Whether to publish an index during
+ :auto-index Whether to publish an index during
org-publish-current-project or org-publish-all.
:index-filename Filename for output of index. Defaults
to 'index.org' (which becomes 'index.html')
:index-title Title of index page. Defaults to name of file.
:index-function Plugin function to use for generation of index.
- Defaults to 'org-publish-org-index', which
+ Defaults to 'org-publish-org-index', which
generates a plain list of links to all files
- in the project.
+ in the project.
"
:group 'org-publish
:type 'alist)
(defcustom org-publish-use-timestamps-flag t
- "When non-nil, use timestamp checking to publish only changed files.
+ "When non-nil, use timestamp checking to publish only changed files.
When nil, do no timestamp checking and always publish all
files."
:group 'org-publish
:type 'boolean)
-(defcustom org-publish-timestamp-directory "~/.org-timestamps/"
+(defcustom org-publish-timestamp-directory "~/.org-timestamps/"
"Name of directory in which to store publishing timestamps."
:group 'org-publish
:type 'string)
@@ -287,8 +285,8 @@ files."
(concat org-publish-timestamp-directory filename ".timestamp"))
-(defun org-publish-needed-p (filename)
- "Check whether file should be published.
+(defun org-publish-needed-p (filename)
+ "Check whether file should be published.
If org-publish-use-timestamps-flag is set to nil, this function always
returns t. Otherwise, check the timestamps folder to determine
whether file should be published."
@@ -304,7 +302,7 @@ whether file should be published."
;; check timestamp. ok if timestamp file doesn't exist
(let* ((timestamp (org-publish-timestamp-filename filename))
(rtn (file-newer-than-file-p filename timestamp)))
- (if rtn
+ (if rtn
;; handle new timestamps
(if (not (file-exists-p timestamp))
;; create file
@@ -321,11 +319,25 @@ whether file should be published."
(set-file-times timestamp)))
+;;;; A hash mapping files to project names
+
+
+(defvar org-publish-files (make-hash-table :test 'equal) "Hash
+table mapping file names to project names.")
+
+
+;;;; Checking filenames against this hash
+
+
+(defun org-publish-validate-link (link)
+ (gethash (file-truename link) org-publish-files))
+
+
;;;; Getting project information out of org-publish-project-alist
(defun org-publish-get-plists (&optional project-name)
- "Return a list of property lists for project PROJECT-NAME.
+ "Return a list of property lists for project PROJECT-NAME.
When argument is not given, return all property lists for all projects."
(let ((alist (if project-name
(list (assoc project-name org-publish-project-alist))
@@ -333,19 +345,25 @@ When argument is not given, return all property lists for all projects."
(project nil)
(plists nil)
(components nil))
+
+ ;;
+ ;;
(while (setq project (pop alist))
+ ;; what kind of project is it?
(if (setq components (plist-get (cdr project) :components))
;; meta project. annotate each plist with name of enclosing project
- (setq plists
- (append plists
- (mapcar (lambda (p)
- (plist-put p :project-name (car project)))
- (mapcan 'org-publish-get-plists components))))
+ (setq plists
+ (append plists
+ (apply 'append
+ (mapcar 'org-publish-get-plists components))))
;; normal project
- (let ((p (cdr project)))
- (setq p (plist-put p :project-name (car project)))
- (setq plists (append plists (list (cdr project)))))))
- ;;
+ (setq plists (append plists (list (cdr project)))))
+ ;;
+ (dolist (p plists)
+ (let* ((exclude (plist-get p :exclude))
+ (files (org-publish-get-base-files p exclude)))
+ (dolist (f files)
+ (puthash (file-truename f) (car project) org-publish-files)))))
plists))
@@ -371,8 +389,8 @@ matching filenames."
;; include extra files
(let ((inc nil))
(while (setq inc (pop include-list))
- (setq allfiles (cons (concat dir inc) allfiles))))
-
+ (setq allfiles (cons (expand-file-name inc dir) allfiles))))
+
allfiles))
@@ -380,14 +398,8 @@ matching filenames."
"Figure out which project a given FILENAME belongs to, if any.
Filename should contain full path. Returns name of project, or
nil if not found."
- (let ((found nil))
- (mapcar
- (lambda (plist)
- (let ((files (org-publish-get-base-files plist)))
- (if (member (expand-file-name filename) files)
- (setq found (plist-get plist :project-name)))))
- (org-publish-get-plists))
- found))
+ (org-publish-get-plists)
+ (gethash (file-truename filename) org-publish-files))
(defun org-publish-get-plist-from-filename (filename)
@@ -396,18 +408,19 @@ nil if not found."
(mapcar
(lambda (plist)
(let ((files (org-publish-get-base-files plist)))
- (if (member (expand-file-name filename) files)
- (setq found plist))))
+ (if (member (expand-file-name filename) files)
+ (setq found plist))))
(org-publish-get-plists))
found))
+
;;;; Pluggable publishing back-end functions
(defun org-publish-org-to-html (plist filename)
- "Publish an org file to HTML.
-PLIST is the property list for the given project.
+ "Publish an org file to HTML.
+PLIST is the property list for the given project.
FILENAME is the filename of the org file to be published."
(require 'org)
(let* ((arg (plist-get plist :headline-levels)))
@@ -416,14 +429,14 @@ FILENAME is the filename of the org file to be published."
(org-export-as-html arg nil plist)
;; get rid of HTML buffer
(kill-buffer (current-buffer)))))
-
+
(defun org-publish-attachment (plist filename)
"Publish a file with no transformation of any kind.
-PLIST is the property list for the given project.
+PLIST is the property list for the given project.
FILENAME is the filename of the file to be published."
;; make sure eshell/cp code is loaded
- (require 'eshell)
+ (require 'eshell)
(require 'esh-maint)
(require 'em-unix)
(let ((destination (file-name-as-directory (plist-get plist :publishing-directory))))
@@ -450,7 +463,6 @@ FILENAME is the filename of the file to be published."
If :auto-index is set, publish the index too."
(let* ((exclude-regexp (plist-get plist :exclude))
(publishing-function (or (plist-get plist :publishing-function) 'org-publish-org-to-html))
- (buf (current-buffer))
(index-p (plist-get plist :auto-index))
(index-filename (or (plist-get plist :index-filename) "index.org"))
(index-function (or (plist-get plist :index-function) 'org-publish-org-index))
@@ -463,14 +475,12 @@ FILENAME is the filename of the file to be published."
;; check timestamps
(when (org-publish-needed-p f)
(funcall publishing-function plist f)
- (org-publish-update-timestamp f))))
- ;; back to original buffer
- (switch-to-buffer buf)))
+ (org-publish-update-timestamp f))))))
(defun org-publish-org-index (plist &optional index-filename)
- "Create an index of pages in set defined by PLIST.
-Optionally set the filename of the index with INDEX-FILENAME;
+ "Create an index of pages in set defined by PLIST.
+Optionally set the filename of the index with INDEX-FILENAME;
default is 'index.org'."
(let* ((dir (file-name-as-directory (plist-get plist :base-directory)))
(exclude-regexp (plist-get plist :exclude))
@@ -483,7 +493,7 @@ default is 'index.org'."
;; if buffer is already open, kill it to prevent error message
(if index-buffer
(kill-buffer index-buffer))
- (with-temp-buffer
+ (with-temp-buffer
(while (setq f (pop files))
(let ((fn (file-name-nondirectory f)))
(unless (string= fn ifn) ;; index shouldn't index itself
@@ -497,19 +507,21 @@ default is 'index.org'."
;(defun org-publish-meta-index (meta-plist &optional index-filename)
; "Create an index for a metaproject."
; (let* ((plists (
-
-
+
+
;;;; Interactive publishing functions
;;;###autoload
(defun org-publish (project-name &optional force)
"Publish the project PROJECT-NAME."
- (interactive "sProject name: \nP")
+ (interactive (list (completing-read "Project name: " org-publish-project-alist
+ nil t)
+ current-prefix-arg))
(let ((org-publish-use-timestamps-flag (if force nil t))
(plists (org-publish-get-plists project-name)))
(mapcar 'org-publish-plist plists)))
-
+
;;;###autoload
(defun org-publish-current-project (&optional force)
@@ -521,14 +533,14 @@ With prefix argument, force publishing all files in project."
(if (not project-name)
(error (format "File %s is not part of any known project." (buffer-file-name))))
(org-publish project-name)))
-
-;;;###autoload
+
+;;;###autoload
(defun org-publish-current-file (&optional force)
"Publish the current file.
With prefix argument, force publish the file."
(interactive "P")
- (let ((org-publish-use-timestamps-flag
+ (let ((org-publish-use-timestamps-flag
(if force nil t)))
(org-publish-file (buffer-file-name))))
diff --git a/org.el b/org.el
index 8d352a4..a1ff47d 100644
--- a/org.el
+++ b/org.el
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <dominik at science dot uva dot nl>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
-;; Version: 4.36b
+;; Version: 4.40
;;
;; This file is part of GNU Emacs.
;;
@@ -90,6 +90,24 @@
;;
;; Recent changes
;; --------------
+;; Version 4.40
+;; - Bug fixes.
+;;
+;; Version 4.39
+;; - Special tag ARCHIVE keeps a subtree closed and away from agenda lists.
+;; - LaTeX code in Org-mode files can be converted to images for HTML.
+;; - Bug fixes.
+;; - CDLaTeX-mode features can be used in Org-mode to help inserting
+;; LaTeX environment and math.
+;;
+;; Version 4.38
+;; - noutline.el is now required (important for XEmacs users only).
+;; - Dynamic blocks.
+;; - Archiving of all level 1 trees without open TODO items.
+;; - Clock reports can be inserted into the file in a special section.
+;; - FAQ removed from the manual, now only on the web.
+;; - Bug fixes.
+;;
;; Version 4.37
;; - Clock-feature for measuring time spent on specific items.
;; - Improved emphasizing allows configuration and stacking.
@@ -170,13 +188,18 @@
(eval-when-compile
(require 'cl)
(require 'calendar))
-(require 'outline)
+;; For XEmacs, noutline is not yet provided by outline.el, so arrange for
+;; the file noutline.el being loaded.
+(if (featurep 'xemacs) (condition-case nil (require 'noutline)))
+;; We require noutline, which might be provided in outline.el
+(require 'outline) (require 'noutline)
+;; Other stuff we need.
(require 'time-date)
(require 'easymenu)
;;; Customization variables
-(defvar org-version "4.36b"
+(defvar org-version "4.40"
"The version number of the file org.el.")
(defun org-version ()
(interactive)
@@ -396,7 +419,8 @@ visibility is cycled."
(const :tag "Everywhere except in headlines" t)
))
-(defcustom org-cycle-hook '(org-optimize-window-after-visibility-change)
+(defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees
+ org-optimize-window-after-visibility-change)
"Hook that is run after `org-cycle' has changed the buffer visibility.
The function(s) in this hook must accept a single argument which indicates
the new state that was set by the most recent `org-cycle' command. The
@@ -524,6 +548,38 @@ use \\[org-ctrl-c-ctrl-c] to trigger renumbering."
:tag "Org Archive"
:group 'org-structure)
+(defcustom org-archive-tag "ARCHIVE"
+ "The tag that marks a subtree as archived.
+An archived subtree does not open during visibility cycling, and does
+not contribute to the agenda listings."
+ :group 'org-archive
+ :group 'org-keywords
+ :type 'string)
+
+(defcustom org-agenda-skip-archived-trees t
+ "Non-nil means, the agenda will skip any items located in archived trees.
+An archived tree is a tree marked with the tag ARCHIVE."
+ :group 'org-archive
+ :group 'org-agenda-display
+ :type 'boolean)
+
+(defcustom org-cycle-open-archived-trees nil
+ "Non-nil means, `org-cycle' will open archived trees.
+An archived tree is a tree marked with the tag ARCHIVE.
+When nil, archived trees will stay folded. You can still open them with
+normal outline commands like `show-all', but not with the cycling commands."
+ :group 'org-archive
+ :group 'org-cycle
+ :type 'boolean)
+
+(defcustom org-sparse-tree-open-archived-trees nil
+ "Non-nil means sparse tree construction shows matches in archived trees.
+When nil, matches in these trees are highlighted, but the trees are kept in
+collapsed state."
+ :group 'org-archive
+ :group 'org-sparse-trees
+ :type 'boolean)
+
(defcustom org-archive-location "%s_archive::"
"The location where subtrees should be archived.
This string consists of two parts, separated by a double-colon.
@@ -561,12 +617,12 @@ line like
:type 'string)
(defcustom org-archive-mark-done t
- "Non-nil means, mark archived entries as DONE."
+ "Non-nil means, mark entries as DONE when they are moved to the archive file."
:group 'org-archive
:type 'boolean)
(defcustom org-archive-stamp-time t
- "Non-nil means, add a time stamp to archived entries.
+ "Non-nil means, add a time stamp to entries moved to an archive file.
The time stamp will be added directly after the TODO state keyword in the
first line, so it is probably best to use this in combinations with
`org-archive-mark-done'."
@@ -1015,12 +1071,14 @@ rather than having to type \"yes\"."
(const :tag "no confirmation (dangerous)" nil)))
(defconst org-file-apps-defaults-gnu
- '((t . mailcap))
+ '((remote . emacs)
+ (t . mailcap))
"Default file applications on a UNIX or GNU/Linux system.
See `org-file-apps'.")
(defconst org-file-apps-defaults-macosx
- '((t . "open %s")
+ '((remote . emacs)
+ (t . "open %s")
("ps" . "gv %s")
("ps.gz" . "gv %s")
("eps" . "gv %s")
@@ -1033,11 +1091,13 @@ for some files for which the OS does not have a good default.
See `org-file-apps'.")
(defconst org-file-apps-defaults-windowsnt
- (list (cons t
- (list (if (featurep 'xemacs)
- 'mswindows-shell-execute
- 'w32-shell-execute)
- "open" 'file)))
+ (list
+ '(remote . emacs)
+ (cons t
+ (list (if (featurep 'xemacs)
+ 'mswindows-shell-execute
+ 'w32-shell-execute)
+ "open" 'file)))
"Default file applications on a Windows NT system.
The system \"open\" is used for most files.
See `org-file-apps'.")
@@ -1059,6 +1119,9 @@ files and the cdr the corresponding command. Possible values for the
file identifier are
\"ext\" A string identifying an extension
`directory' Matches a directory
+ `remote' Matches a remove file, accessible through tramp or efs.
+ Remote files most likely should be visited through emacs
+ because external applications cannot handle such paths.
t Default for all remaining files
Possible values for the command are:
@@ -1077,6 +1140,7 @@ For more examples, see the system specific constants
(cons (choice :value ""
(string :tag "Extension")
(const :tag "Default for unrecognized files" t)
+ (const :tag "Remote file" remote)
(const :tag "Links to a directory" directory))
(choice :value ""
(const :tag "Visit with Emacs" emacs)
@@ -1702,6 +1766,29 @@ N days, just insert a special line indicating the size of the gap."
(const :tag "All" t)
(number :tag "at most")))
+(defgroup org-latex nil
+ "Options for embedding LaTeX code into Org-mode"
+ :tag "Org LaTeX"
+ :group 'org)
+
+(defcustom org-format-latex-options
+ '(:foreground "Black" :background "Transparent" :scale 1.0
+ :matchers ("begin" "$" "$$" "\\(" "\\["))
+ "Options for creating images from LaTeX fragments.
+This is a property list with the following properties:
+:foreground the foreground color, for example \"Black\".
+:background the background color, or \"Transparent\".
+:scale a scaling factor for the size of the images
+:matchers a list indicating which matchers should be used to
+ find LaTeX fragments. Valid members of this list are:
+ \"begin\" find environments
+ \"$\" find math expressions surrounded by $...$
+ \"$$\" find math expressions surrounded by $$....$$
+ \"\\(\" find math expressions surrounded by \\(...\\)
+ \"\\ [\" find math expressions surrounded by \\ [...\\]"
+ :group 'org-latex
+ :type 'plist)
+
(defgroup org-export nil
"Options for exporting org-listings."
:tag "Org Export"
@@ -1800,6 +1887,19 @@ This option can also be set with the +OPTIONS line, e.g. \"\\n:t\"."
:group 'org-export-general
:type 'boolean)
+(defcustom org-export-with-archived-trees 'headline
+ "Whether subtrees with the ARCHIVE tag should be exported.
+This can have three different values
+nil Do not export, pretend this tree is not present
+t Do export the entire tree
+headline Only export the headline, but skip the tree below it."
+ :group 'org-export-general
+ :group 'org-archive
+ :type '(choice
+ (const :tag "not at all" nil)
+ (const :tag "headline only" 'headline)
+ (const :tag "entirely" t)))
+
(defcustom org-export-with-timestamps t
"Nil means, do not export time stamps and associated keywords."
:group 'org-export
@@ -1863,6 +1963,19 @@ Not all export backends support this.
This option can also be set with the +OPTIONS line, e.g. \"TeX:nil\"."
:group 'org-export-translation
+ :group 'org-latex
+ :type 'boolean)
+
+(defcustom org-export-with-LaTeX-fragments nil
+ "Non-nil means, convert LaTeX fragments to images when exporting to HTML.
+When set, the exporter will find LaTeX environments if the \\begin line is
+the first non-white thing on a line. It will also find the math delimiters
+like $a=b$ and \\( a=b \\) for inline math, $$a=b$$ and \\[ a=b \\] for
+display math.
+
+This option can also be set with the +OPTIONS line, e.g. \"LaTeX:t\"."
+ :group 'org-export-translation
+ :group 'org-latex
:type 'boolean)
(defcustom org-export-with-fixed-width t
@@ -2202,7 +2315,7 @@ stacked Non-nil means, allow stacked styles. This works only in HTML
`org-emphasis-alist') will be allowed as pre/post, aiding
inside-out matching.
Use customize to modify this, or restart emacs after changing it."
- :group 'org-fixme
+ :group 'org-font-lock
:set 'org-set-emph-re
:type '(list
(sexp :tag "Allowed chars in pre ")
@@ -2216,19 +2329,23 @@ Use customize to modify this, or restart emacs after changing it."
'(("*" bold "<b>" "</b>")
("/" italic "<i>" "</i>")
("_" underline "<u>" "</u>")
- ("=" shadow "<code>" "</code>"))
+ ("=" shadow "<code>" "</code>")
+ ("+" (:strike-through t) "<del>" "</del>")
+)
"Special syntax for emphasised text.
Text starting and ending with a special character will be emphasized, for
example *bold*, _underlined_ and /italic/. This variable sets the marker
characters, the face to bbe used by font-lock for highlighting in Org-mode
emacs buffers, and the HTML tags to be used for this.
Use customize to modify this, or restart emacs after changing it."
- :group 'org-fixme
+ :group 'org-font-lock
:set 'org-set-emph-re
:type '(repeat
(list
(string :tag "Marker character")
- (face :tag "Font-lock-face")
+ (choice
+ (face :tag "Font-lock-face")
+ (plist :tag "Face property list"))
(string :tag "HTML start tag")
(string :tag "HTML end tag"))))
@@ -2370,6 +2487,19 @@ color of the frame."
This face is only used if `org-fontify-done-headline' is set."
:group 'org-faces)
+(defface org-archived ; similar to shadow
+ (org-compatible-face
+ '((((class color grayscale) (min-colors 88) (background light))
+ (:foreground "grey50"))
+ (((class color grayscale) (min-colors 88) (background dark))
+ (:foreground "grey70"))
+ (((class color) (min-colors 8) (background light))
+ (:foreground "green"))
+ (((class color) (min-colors 8) (background dark))
+ (:foreground "yellow"))))
+ "Face for headline with the ARCHIVE tag."
+ :group 'org-faces)
+
(defface org-link
'((((class color) (background light)) (:foreground "Purple" :underline t))
(((class color) (background dark)) (:foreground "Cyan" :underline t))
@@ -2608,7 +2738,7 @@ Also put tags into group 4 if tags are present.")
(and arch (set (make-local-variable 'org-archive-location) arch))
(and int (set (make-local-variable 'org-todo-interpretation) int))
(when tags
- (let (e tg c tgs)
+ (let (e tgs)
(while (setq e (pop tags))
(cond
((equal e "{") (push '(:startgroup) tgs))
@@ -2690,6 +2820,8 @@ Also put tags into group 4 if tags are present.")
(defvar org-goto-start-pos) ; dynamically scoped parameter
(defvar org-time-was-given) ; dynamically scoped parameter
(defvar org-ts-what) ; dynamically scoped parameter
+(defvar org-current-export-file) ; dynamically scoped parameter
+(defvar org-current-export-dir) ; dynamically scoped parameter
(defvar mark-active) ; Emacs only, not available in XEmacs.
(defvar timecnt) ; dynamically scoped parameter
(defvar levels-open) ; dynamically scoped parameter
@@ -2708,6 +2840,7 @@ Also put tags into group 4 if tags are present.")
(defvar gnus-group-name) ; from gnus
(defvar gnus-article-current) ; from gnus
(defvar w3m-current-url) ; from w3m
+(defvar w3m-current-title) ; from w3m
(defvar mh-progs) ; from MH-E
(defvar mh-current-folder) ; from MH-E
(defvar mh-show-folder-buffer) ; from MH-E
@@ -2723,6 +2856,8 @@ Also put tags into group 4 if tags are present.")
(defvar orgtbl-mode) ; defined later in this file
(defvar Info-current-file) ; from info.el
(defvar Info-current-node) ; from info.el
+(defvar texmathp-why) ; from texmathp.el
+(defvar org-latex-regexps)
;;; Define the mode
@@ -2823,8 +2958,10 @@ The following commands are available:
(insert " -*- mode: org -*-\n\n"))
(unless org-inhibit-startup
- (if org-startup-align-all-tables
- (org-table-map-tables 'org-table-align))
+ (when org-startup-align-all-tables
+ (let ((bmp (buffer-modified-p)))
+ (org-table-map-tables 'org-table-align)
+ (set-buffer-modified-p bmp)))
(if org-startup-with-deadline-check
(call-interactively 'org-check-deadlines)
(cond
@@ -3177,6 +3314,7 @@ between words."
'("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t))
(if org-format-transports-properties-p
'("| *\\(<[0-9]+>\\) *" (1 'org-formula t)))
+ '("^\\*+ \\(.*:ARCHIVE:.*\\)" (1 'org-archived prepend))
)))
(setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords))
;; Now set the full font-lock-keywords
@@ -3253,7 +3391,11 @@ between words."
outline-regexp))
(bob-special (and org-cycle-global-at-bob (bobp)
(not (looking-at outline-regexp))))
- (org-cycle-hook (if bob-special nil org-cycle-hook))
+ (org-cycle-hook
+ (if bob-special
+ (delq 'org-optimize-window-after-visibility-change
+ (copy-sequence org-cycle-hook))
+ org-cycle-hook))
(pos (point)))
(if (or bob-special (equal arg '(4)))
@@ -3271,7 +3413,7 @@ between words."
(call-interactively 'org-table-next-field)))))
((eq arg t) ;; Global cycling
-
+
(cond
((and (eq last-command this-command)
(eq org-cycle-global-status 'overview))
@@ -3350,6 +3492,9 @@ between words."
;; TAB emulation
(buffer-read-only (org-back-to-heading))
+
+ ((org-try-cdlatex-tab))
+
((if (and (memq org-cycle-emulate-tab '(white whitestart))
(save-excursion (beginning-of-line 1) (looking-at "[ \t]*"))
(or (and (eq org-cycle-emulate-tab 'white)
@@ -3617,10 +3762,8 @@ Return t when things worked, nil when we are not in an item."
t)
(error nil)))
(let* ((bul (match-string 0))
- (end (match-end 0))
(eow (save-excursion (beginning-of-line 1) (looking-at "[ \t]*")
(match-end 0)))
- (eowcol (save-excursion (goto-char eow) (current-column)))
pos)
(cond
((and (org-at-item-p) (<= (point) eow))
@@ -3722,9 +3865,7 @@ in the region."
(replace-match up-head nil t)
;; Fixup tag positioning
(and org-auto-align-tags (org-set-tags nil t))
- (if org-adapt-indentation
- (org-fixup-indentation (if (> diff 1) "^ " "^ ") ""
- (if (> diff 1) "^ ? ?\\S-" "^ ?\\S-")))))
+ (if org-adapt-indentation (org-fixup-indentation (- diff)))))
(defun org-demote ()
"Demote the current heading lower down the tree.
@@ -3737,8 +3878,7 @@ in the region."
(replace-match down-head nil t)
;; Fixup tag positioning
(and org-auto-align-tags (org-set-tags nil t))
- (if org-adapt-indentation
- (org-fixup-indentation "^ " (if (> diff 1) " " " ") "^\\S-"))))
+ (if org-adapt-indentation (org-fixup-indentation diff))))
(defun org-map-tree (fun)
"Call FUN for every heading underneath the current one."
@@ -3767,20 +3907,23 @@ in the region."
(not (eobp)))
(funcall fun)))))
-;; FIXME: this does not work well with Tabulators. This has to be re-written entirely.
-(defun org-fixup-indentation (from to prohibit)
- "Change the indentation in the current entry by re-replacing FROM with TO.
-However, if the regexp PROHIBIT matches at all, don't do anything.
-This is being used to change indentation along with the length of the
-heading marker. But if there are any lines which are not indented, nothing
-is changed at all."
+(defun org-fixup-indentation (diff)
+ "Change the indentation in the current entry by DIFF
+However, if any line in the current entry has no indentation, or if it
+would end up with no indentation after the change, nothing at all is done."
(save-excursion
(let ((end (save-excursion (outline-next-heading)
- (point-marker))))
+ (point-marker)))
+ (prohibit (if (> diff 0)
+ "^\\S-"
+ (concat "^ \\{0," (int-to-string (- diff)) "\\}\\S-")))
+ col)
(unless (save-excursion (re-search-forward prohibit end t))
- (while (re-search-forward from end t)
- (replace-match to)
- (beginning-of-line 2)))
+ (while (re-search-forward "^[ \t]+" end t)
+ (goto-char (match-end 0))
+ (setq col (current-column))
+ (if (< diff 0) (replace-match ""))
+ (indent-to (+ diff col))))
(move-marker end nil))))
;;; Vertical tree motion, cutting and pasting of subtrees
@@ -3984,6 +4127,14 @@ If optional TXT is given, check this string instead of the current kill."
(throw 'exit nil)))
t))))
+(defun org-narrow-to-subtree ()
+ "Narrow buffer to the current subtree."
+ (interactive)
+ (save-excursion
+ (narrow-to-region
+ (progn (org-back-to-heading) (point))
+ (progn (org-end-of-subtree t) (point)))))
+
;;; Plain list items
(defun org-at-item-p ()
@@ -4101,12 +4252,10 @@ If the cursor is not in an item, throw an error."
"Move to the beginning of the next item in the current plain list.
Error if not at a plain list, or if this is the last item in the list."
(interactive)
- (let (beg end ind ind1 (pos (point)) txt)
+ (let (ind ind1 (pos (point)))
(org-beginning-of-item)
- (setq beg (point))
(setq ind (org-get-indentation))
(org-end-of-item)
- (setq end (point))
(setq ind1 (org-get-indentation))
(unless (and (org-at-item-p) (= ind ind1))
(goto-char pos)
@@ -4116,7 +4265,7 @@ Error if not at a plain list, or if this is the last item in the list."
"Move to the beginning of the previous item in the current plain list.
Error if not at a plain list, or if this is the last item in the list."
(interactive)
- (let (beg end ind ind1 (pos (point)) txt)
+ (let (beg ind (pos (point)))
(org-beginning-of-item)
(setq beg (point))
(setq ind (org-get-indentation))
@@ -4126,7 +4275,7 @@ Error if not at a plain list, or if this is the last item in the list."
(beginning-of-line 0)
(if (looking-at "[ \t]*$")
nil
- (if (<= (setq ind1 (org-get-indentation)) ind)
+ (if (<= (org-get-indentation) ind)
(throw 'exit t)))))
(condition-case nil
(org-beginning-of-item)
@@ -4292,103 +4441,391 @@ with something like \"1.\" or \"2)\"."
;;; Archiving
-(defun org-archive-subtree ()
+(defun org-archive-subtree (&optional find-done)
"Move the current subtree to the archive.
The archive can be a certain top-level heading in the current file, or in
a different file. The tree will be moved to that location, the subtree
-heading be marked DONE, and the current time will be added."
- (interactive)
- ;; Save all relevant TODO keyword-relatex variables
- (let ((tr-org-todo-line-regexp org-todo-line-regexp) ; keep despite compiler
- (tr-org-todo-keywords org-todo-keywords)
- (tr-org-todo-interpretation org-todo-interpretation)
- (tr-org-done-string org-done-string)
- (tr-org-todo-regexp org-todo-regexp)
- (tr-org-todo-line-regexp org-todo-line-regexp)
- (this-buffer (current-buffer))
- file heading buffer level newfile-p)
- (if (string-match "\\(.*\\)::\\(.*\\)" org-archive-location)
+heading be marked DONE, and the current time will be added.
+
+When called with prefix argument FIND-DONE, find whole trees without any
+open TODO items and archive them (after getting confirmation from the user).
+If the cursor is not at a headline when this comand is called, try all level
+1 trees. If the cursor is on a headline, only try the direct children of
+this heading. "
+ (interactive "P")
+ (if find-done
+ (org-archive-all-done)
+ ;; Save all relevant TODO keyword-relatex variables
+
+ (let ((tr-org-todo-line-regexp org-todo-line-regexp) ; keep despite compiler
+ (tr-org-todo-keywords org-todo-keywords)
+ (tr-org-todo-interpretation org-todo-interpretation)
+ (tr-org-done-string org-done-string)
+ (tr-org-todo-regexp org-todo-regexp)
+ (tr-org-todo-line-regexp org-todo-line-regexp)
+ (this-buffer (current-buffer))
+ file heading buffer level newfile-p)
+ (if (string-match "\\(.*\\)::\\(.*\\)" org-archive-location)
+ (progn
+ (setq file (format (match-string 1 org-archive-location)
+ (file-name-nondirectory buffer-file-name))
+ heading (match-string 2 org-archive-location)))
+ (error "Invalid `org-archive-location'"))
+ (if (> (length file) 0)
+ (setq newfile-p (not (file-exists-p file))
+ buffer (find-file-noselect file))
+ (setq buffer (current-buffer)))
+ (unless buffer
+ (error "Cannot access file \"%s\"" file))
+ (if (and (> (length heading) 0)
+ (string-match "^\\*+" heading))
+ (setq level (match-end 0))
+ (setq heading nil level 0))
+ (save-excursion
+ ;; We first only copy, in case something goes wrong
+ ;; we need to protect this-command, to avoid kill-region sets it,
+ ;; which would lead to duplication of subtrees
+ (let (this-command) (org-copy-subtree))
+ (set-buffer buffer)
+ ;; Enforce org-mode for the archive buffer
+ (if (not (eq major-mode 'org-mode))
+ ;; Force the mode for future visits.
+ (let ((org-insert-mode-line-in-empty-file t))
+ (call-interactively 'org-mode)))
+ (when newfile-p
+ (goto-char (point-max))
+ (insert (format "\nArchived entries from file %s\n\n"
+ (buffer-file-name this-buffer))))
+ ;; Force the TODO keywords of the original buffer
+ (let ((org-todo-line-regexp tr-org-todo-line-regexp)
+ (org-todo-keywords tr-org-todo-keywords)
+ (org-todo-interpretation tr-org-todo-interpretation)
+ (org-done-string tr-org-done-string)
+ (org-todo-regexp tr-org-todo-regexp)
+ (org-todo-line-regexp tr-org-todo-line-regexp))
+ (goto-char (point-min))
+ (if heading
+ (progn
+ (if (re-search-forward
+ (concat "\\(^\\|\r\\)"
+ (regexp-quote heading) "[ \t]*\\($\\|\r\\)")
+ nil t)
+ (goto-char (match-end 0))
+ ;; Heading not found, just insert it at the end
+ (goto-char (point-max))
+ (or (bolp) (insert "\n"))
+ (insert "\n" heading "\n")
+ (end-of-line 0))
+ ;; Make the subtree visible
+ (show-subtree)
+ (org-end-of-subtree t)
+ (skip-chars-backward " \t\r\n]")
+ (and (looking-at "[ \t\r\n]*")
+ (replace-match "\n\n")))
+ ;; No specific heading, just go to end of file.
+ (goto-char (point-max)) (insert "\n"))
+ ;; Paste
+ (org-paste-subtree (1+ level))
+ ;; Mark the entry as done, i.e. set to last work in org-todo-keywords
+ (if org-archive-mark-done
+ (org-todo (length org-todo-keywords)))
+ ;; Move cursor to right after the TODO keyword
+ (when org-archive-stamp-time
+ (beginning-of-line 1)
+ (looking-at org-todo-line-regexp)
+ (goto-char (or (match-end 2) (match-beginning 3)))
+ (insert "(" (format-time-string (cdr org-time-stamp-formats)
+ (org-current-time))
+ ")"))
+ ;; Save the buffer, if it is not the same buffer.
+ (if (not (eq this-buffer buffer)) (save-buffer))))
+ ;; Here we are back in the original buffer. Everything seems to have
+ ;; worked. So now cut the tree and finish up.
+ (let (this-command) (org-cut-subtree))
+ (if (and (not (eobp)) (looking-at "[ \t]*$")) (kill-line))
+ (message "Subtree archived %s"
+ (if (eq this-buffer buffer)
+ (concat "under heading: " heading)
+ (concat "in file: " (abbreviate-file-name file)))))))
+
+(defun org-archive-all-done (&optional tag)
+ "Archive sublevels of the current tree without open TODO items.
+If the cursor is not on a headline, try all level 1 trees. If
+it is on a headline, try all direct children.
+When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
+ (let ((re (concat "^\\*+ +" org-not-done-regexp)) re1
+ (rea (concat ".*:" org-archive-tag ":"))
+ (begm (make-marker))
+ (endm (make-marker))
+ (question (if tag "Set ARCHIVE tag (no open TODO items)? "
+ "Move subtree to archive (no open TODO items)? "))
+ beg end (cntarch 0))
+ (if (org-on-heading-p)
(progn
- (setq file (format (match-string 1 org-archive-location)
- (file-name-nondirectory buffer-file-name))
- heading (match-string 2 org-archive-location)))
- (error "Invalid `org-archive-location'"))
- (if (> (length file) 0)
- (setq newfile-p (not (file-exists-p file))
- buffer (find-file-noselect file))
- (setq buffer (current-buffer)))
- (unless buffer
- (error "Cannot access file \"%s\"" file))
- (if (and (> (length heading) 0)
- (string-match "^\\*+" heading))
- (setq level (match-end 0))
- (setq heading nil level 0))
+ (setq re1 (concat "^" (regexp-quote
+ (make-string
+ (1+ (- (match-end 0) (match-beginning 0)))
+ ?*))
+ " "))
+ (move-marker begm (point))
+ (move-marker endm (org-end-of-subtree)))
+ (setq re1 "^* ")
+ (move-marker begm (point-min))
+ (move-marker endm (point-max)))
(save-excursion
- ;; We first only copy, in case something goes wrong
- ;; we need to protect this-command, to avoid kill-region sets it,
- ;; which would lead to duplication of subtrees
- (let (this-command) (org-copy-subtree))
- (set-buffer buffer)
- ;; Enforce org-mode for the archive buffer
- (if (not (eq major-mode 'org-mode))
- ;; Force the mode for future visits.
- (let ((org-insert-mode-line-in-empty-file t))
- (call-interactively 'org-mode)))
- (when newfile-p
- (goto-char (point-max))
- (insert (format "\nArchived entries from file %s\n\n"
- (buffer-file-name this-buffer))))
- ;; Force the TODO keywords of the original buffer
- (let ((org-todo-line-regexp tr-org-todo-line-regexp)
- (org-todo-keywords tr-org-todo-keywords)
- (org-todo-interpretation tr-org-todo-interpretation)
- (org-done-string tr-org-done-string)
- (org-todo-regexp tr-org-todo-regexp)
- (org-todo-line-regexp tr-org-todo-line-regexp))
- (goto-char (point-min))
- (if heading
- (progn
- (if (re-search-forward
- (concat "\\(^\\|\r\\)"
- (regexp-quote heading) "[ \t]*\\($\\|\r\\)")
- nil t)
- (goto-char (match-end 0))
- ;; Heading not found, just insert it at the end
- (goto-char (point-max))
- (or (bolp) (insert "\n"))
- (insert "\n" heading "\n")
- (end-of-line 0))
- ;; Make the subtree visible
- (show-subtree)
- (org-end-of-subtree t)
- (skip-chars-backward " \t\r\n]")
- (and (looking-at "[ \t\r\n]*")
- (replace-match "\n\n")))
- ;; No specific heading, just go to end of file.
- (goto-char (point-max)) (insert "\n"))
- ;; Paste
- (org-paste-subtree (1+ level))
- ;; Mark the entry as done, i.e. set to last work in org-todo-keywords
- (if org-archive-mark-done
- (org-todo (length org-todo-keywords)))
- ;; Move cursor to right after the TODO keyword
- (when org-archive-stamp-time
- (beginning-of-line 1)
- (looking-at org-todo-line-regexp)
- (goto-char (or (match-end 2) (match-beginning 3)))
- (insert "(" (format-time-string (cdr org-time-stamp-formats)
- (org-current-time))
- ")"))
- ;; Save the buffer, if it is not the same buffer.
- (if (not (eq this-buffer buffer)) (save-buffer))))
- ;; Here we are back in the original buffer. Everything seems to have
- ;; worked. So now cut the tree and finish up.
- (let (this-command) (org-cut-subtree))
- (if (and (not (eobp)) (looking-at "[ \t]*$")) (kill-line))
- (message "Subtree archived %s"
- (if (eq this-buffer buffer)
- (concat "under heading: " heading)
- (concat "in file: " (abbreviate-file-name file))))))
+ (goto-char begm)
+ (while (re-search-forward re1 endm t)
+ beg (match-beginning 0)
+ end (save-excursion (org-end-of-subtree t) (point)))
+ (goto-char beg)
+ (if (re-search-forward re end t)
+ (goto-char end)
+ (goto-char beg)
+ (if (and (or (not tag) (not (looking-at rea)))
+ (y-or-n-p question))
+ (progn
+ (if tag
+ (org-toggle-tag org-archive-tag 'on)
+ (org-archive-subtree))
+ (setq cntarch (1+ cntarch)))
+ (goto-char end))))
+ (message "%d trees archived" cntarch)))
+
+
+(defun org-cycle-hide-archived-subtrees (state)
+ "Re-hide all archived subtrees after a visibility state change."
+ (when (and (not org-cycle-open-archived-trees)
+ (not (memq state '(overview folded))))
+ (save-excursion
+ (let* ((globalp (memq state '(contents all)))
+ (beg (if globalp (point-min) (point)))
+ (end (if globalp (point-max) (org-end-of-subtree))))
+ (org-hide-archived-subtrees beg end)))))
+
+(defun org-hide-archived-subtrees (beg end)
+ "Re-hide all archived subtrees after a visibility state change."
+ (save-excursion
+ (let* ((re (concat ":" org-archive-tag ":")))
+ (goto-char beg)
+ (while (re-search-forward re end t)
+ (and (org-on-heading-p) (hide-subtree))
+ (org-end-of-subtree)))))
+
+(defun org-toggle-tag (tag &optional onoff)
+ "Toggle the tag TAG for the current line.
+If ONOFF is `on' or `off', don't toggle but set to this state."
+ (unless (org-on-heading-p) (error "Not on headling"))
+ (let (res current)
+ (save-excursion
+ (beginning-of-line)
+ (if (re-search-forward "[ \t]:\\([a-zA-Z0-9_@:]+\\):[ \t]*$"
+ (point-at-eol) t)
+ (progn
+ (setq current (match-string 1))
+ (replace-match ""))
+ (setq current ""))
+ (setq current (nreverse (org-split-string current ":")))
+ (cond
+ ((eq onoff 'on)
+ (setq res t)
+ (or (member tag current) (push tag current)))
+ ((eq onoff 'off)
+ (or (not (member tag current)) (setq current (delete tag current))))
+ (t (if (member tag current)
+ (setq current (delete tag current))
+ (setq res t)
+ (push tag current))))
+ (end-of-line 1)
+ (when current
+ (insert " :" (mapconcat 'identity (nreverse current) ":") ":"))
+ (org-set-tags nil t))
+ res))
+
+(defun org-toggle-archive-tag (&optional arg)
+ "Toggle the archive tag for the current headline.
+With prefix ARG, check all children of current headline and offer tagging
+the children that do not contain any open TODO items."
+ (interactive "P")
+ (if arg
+ (org-archive-all-done 'tag)
+ (let (set)
+ (save-excursion
+ (org-back-to-heading t)
+ (setq set (org-toggle-tag org-archive-tag))
+ (when set (hide-subtree)))
+ (and set (beginning-of-line 1))
+ (message "Subtree %s" (if set "archived" "unarchived")))))
+
+(defun org-prepare-agenda-buffers (files)
+ "Create buffers for all agenda files, protect archived trees and comments."
+ (let ((pa '(:org-archived t))
+ (pc '(:org-comment t))
+ (pall '(:org-archived t :org-comment t))
+ (rea (concat ":" org-archive-tag ":"))
+ file re)
+ (save-excursion
+ (while (setq file (pop files))
+ (org-check-agenda-file file)
+ (set-buffer (org-get-agenda-file-buffer file))
+ (widen)
+ (save-excursion
+ (remove-text-properties (point-min) (point-max) pall)
+ (when org-agenda-skip-archived-trees
+ (goto-char (point-min))
+ (while (re-search-forward rea nil t)
+ (if (org-on-heading-p)
+ (add-text-properties (point-at-bol) (org-end-of-subtree) pa))))
+ (goto-char (point-min))
+ (setq re (concat "^\\*+ +" org-comment-string "\\>"))
+ (while (re-search-forward re nil t)
+ (add-text-properties
+ (match-beginning 0) (org-end-of-subtree) pc)))))))
+
+(defun org-agenda-skip ()
+ "Throw to `:skip' in places that should be skipped."
+ (let ((p (point-at-bol)))
+ (and org-agenda-skip-archived-trees
+ (get-text-property p :org-archived)
+ (org-end-of-subtree)
+ (throw :skip t))
+ (and (get-text-property p :org-comment)
+ (org-end-of-subtree)
+ (throw :skip t))
+ (if (equal (char-after p) ?#) (throw :skip t))))
+
+(defun org-agenda-toggle-archive-tag ()
+ "Toggle the archive tag for the current entry."
+ (interactive)
+ (org-agenda-check-no-diary)
+ (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed
+ (let* ((hdmarker (or (get-text-property (point) 'org-hd-marker)
+ (org-agenda-error)))
+ (buffer (marker-buffer hdmarker))
+ (pos (marker-position hdmarker))
+ (buffer-read-only nil)
+ newhead)
+ (with-current-buffer buffer
+ (widen)
+ (goto-char pos)
+ (org-show-hidden-entry)
+ (save-excursion
+ (and (outline-next-heading)
+ (org-flag-heading nil))) ; show the next heading
+ (call-interactively 'org-toggle-archive-tag)
+ (end-of-line 1)
+ (setq newhead (org-get-heading)))
+ (org-agenda-change-all-lines newhead hdmarker)
+ (beginning-of-line 1)))
+
+;;; Dynamic blocks
+
+(defun org-find-dblock (name)
+ "Find the first dynamic block with name NAME in the buffer.
+If not found, stay at current position and return nil."
+ (let (pos)
+ (save-excursion
+ (goto-char (point-min))
+ (setq pos (and (re-search-forward (concat "^#\\+BEGIN:[ \t]+" name "\\>")
+ nil t)
+ (match-beginning 0))))
+ (if pos (goto-char pos))
+ pos))
+
+(defconst org-dblock-start-re
+ "^#\\+BEGIN:[ \t]+\\(\\S-+\\)[ \t]+\\(.*\\)"
+ "Matches the startline of a dynamic block, with parameters.")
+
+(defconst org-dblock-end-re "^#\\+END\\([: \t\r\n]\\|$\\)"
+ "Matches the end of a dyhamic block.")
+
+(defun org-create-dblock (plist)
+ "Create a dynamic block section, with parameters taken from PLIST.
+PLIST must containe a :name entry which is used as name of the block."
+ (unless (bolp) (newline))
+ (let ((name (plist-get plist :name)))
+ (insert "#+BEGIN: " name)
+ (while plist
+ (if (eq (car plist) :name)
+ (setq plist (cddr plist))
+ (insert " " (prin1-to-string (pop plist)))))
+ (insert "\n\n#+END:\n")
+ (beginning-of-line -2)))
+
+(defun org-prepare-dblock ()
+ "Prepare dynamic block for refresh.
+This empties the block, puts the cursor at the insert position and returns
+the property list including an extra property :name with the block name."
+ (unless (looking-at org-dblock-start-re)
+ (error "Not at a dynamic block"))
+ (let* ((begdel (1+ (match-end 0)))
+ (name (match-string 1))
+ (params (append (list :name name)
+ (read (concat "(" (match-string 2) ")")))))
+ (unless (re-search-forward org-dblock-end-re nil t)
+ (error "Dynamic block not terminated"))
+ (delete-region begdel (match-beginning 0))
+ (goto-char begdel)
+ (open-line 1)
+ params))
+
+(defun org-map-dblocks (&optional command)
+ "Apply COMMAND to all dynamic blocks in the current buffer.
+If COMMAND is not given, use `org-update-dblock'."
+ (let ((cmd (or command 'org-update-dblock))
+ pos)
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward org-dblock-start-re nil t)
+ (goto-char (setq pos (match-beginning 0)))
+ (condition-case nil
+ (funcall cmd)
+ (error (message "Error during update of dynamic block")))
+ (goto-char pos)
+ (unless (re-search-forward org-dblock-end-re nil t)
+ (error "Dynamic block not terminated"))))))
+
+(defun org-dblock-update (&optional arg)
+ "User command for updating dynamic blocks.
+Update the dynamic block at point. With prefix ARG, update all dynamic
+blocks in the buffer."
+ (interactive "P")
+ (if arg
+ (org-update-all-dblocks)
+ (or (looking-at org-dblock-start-re)
+ (org-beginning-of-dblock))
+ (org-update-dblock)))
+
+(defun org-update-dblock ()
+ "Update the dynamic block at point
+This means to empty the block, parse for parameters and then call
+the correct writing function."
+ (let* ((pos (point))
+ (params (org-prepare-dblock))
+ (name (plist-get params :name))
+ (cmd (intern (concat "org-dblock-write:" name))))
+ (funcall cmd params)
+ (goto-char pos)))
+
+(defun org-beginning-of-dblock ()
+ "Find the beginning of the dynamic block at point.
+Error if there is no scuh block at point."
+ (let ((pos (point))
+ beg)
+ (end-of-line 1)
+ (if (and (re-search-backward org-dblock-start-re nil t)
+ (setq beg (match-beginning 0))
+ (re-search-forward org-dblock-end-re nil t)
+ (> (match-end 0) pos))
+ (goto-char beg)
+ (goto-char pos)
+ (error "Not in a dynamic block"))))
+
+(defun org-update-all-dblocks ()
+ "Update all dynamic blocks in the buffer.
+This function can be used in a hook."
+ (when (eq major-mode 'org-mode)
+ (org-map-dblocks 'org-update-dblock)))
+
;;; Completion
@@ -4662,9 +5099,8 @@ be removed."
(format-time-string (car org-time-stamp-formats) time))
(setq what nil))
(save-excursion
- (let (beg end col list elt (buffer-invisibility-spec nil) ts)
+ (let (col list elt (buffer-invisibility-spec nil) ts)
(org-back-to-heading t)
- (setq beg (point))
(looking-at (concat outline-regexp "\\( *\\)[^\r\n]*"))
(goto-char (match-end 1))
(setq col (current-column))
@@ -4734,6 +5170,8 @@ that the match should indeed be shown."
(org-show-hierarchy-above))))
(org-add-hook 'before-change-functions 'org-remove-occur-highlights
nil 'local)
+ (unless org-sparse-tree-open-archived-trees
+ (org-hide-archived-subtrees (point-min) (point-max)))
(run-hooks 'org-occur-hook)
(if (interactive-p)
(message "%d match(es) for regexp %s" cnt regexp))
@@ -4775,24 +5213,33 @@ that the match should indeed be shown."
(if (featurep 'xemacs)
(set-extent-property ovl prop value)
(overlay-put ovl prop value)))
+(defun org-overlays-at (pos)
+ (if (featurep 'xemacs) (extents-at pos) (overlays-at pos)))
+(defun org-overlay-start (o)
+ (if (featurep 'xemacs) (extent-start-position o) (overlay-start o)))
+(defun org-overlay-end (o)
+ (if (featurep 'xemacs) (extent-end-position o) (overlay-end o)))
(defvar org-occur-highlights nil)
+(make-variable-buffer-local 'org-occur-highlights)
(defun org-highlight-new-match (beg end)
"Highlight from BEG to END and mark the highlight is an occur headline."
(let ((ov (org-make-overlay beg end)))
(org-overlay-put ov 'face 'secondary-selection)
(push ov org-occur-highlights)))
+(defvar org-inhibit-highlight-removal nil)
(defun org-remove-occur-highlights (&optional beg end noremove)
"Remove the occur highlights from the buffer.
BEG and END are ignored. If NOREMOVE is nil, remove this function
from the `before-change-functions' in the current buffer."
(interactive)
- (mapc 'org-delete-overlay org-occur-highlights)
- (setq org-occur-highlights nil)
- (unless noremove
- (remove-hook 'before-change-functions
- 'org-remove-occur-highlights 'local)))
+ (unless org-inhibit-highlight-removal
+ (mapc 'org-delete-overlay org-occur-highlights)
+ (setq org-occur-highlights nil)
+ (unless noremove
+ (remove-hook 'before-change-functions
+ 'org-remove-occur-highlights 'local))))
;;; Priorities
@@ -5449,15 +5896,16 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
"Sum the times for each subtree.
Puts the resulting times in minutes as a text property on each headline."
(interactive)
- (remove-text-properties (point-min) (point-max) '(:org-clock-minutes t))
- (let* ((re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*"
+ (let* ((bmp (buffer-modified-p))
+ (re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*"
org-clock-string
".*=>[ \t]*\\([0-9]+\\):\\([0-9]+\\)[ \t]*$"))
(lmax 30)
(ltimes (make-vector lmax 0))
(t1 0)
(level 0)
- (lastlevel 0) time)
+ time)
+ (remove-text-properties (point-min) (point-max) '(:org-clock-minutes t))
(save-excursion
(goto-char (point-max))
(while (re-search-backward re nil t)
@@ -5475,7 +5923,8 @@ Puts the resulting times in minutes as a text property on each headline."
(aset ltimes l 0))
(goto-char (match-beginning 0))
(put-text-property (point) (point-at-eol) :org-clock-minutes time))))
- (setq org-clock-file-total-minutes (aref ltimes 0)))))
+ (setq org-clock-file-total-minutes (aref ltimes 0)))
+ (set-buffer-modified-p bmp)))
(defun org-clock-display (&optional total-only)
"Show subtree times in the entire buffer.
@@ -5500,6 +5949,8 @@ in the echo area."
(message "Total file time: %d:%02d (%d hours and %d minutes)" h m h m)))
(defvar org-clock-overlays nil)
+(make-variable-buffer-local 'org-clock-overlays)
+
(defun org-put-clock-overlay (time &optional level)
"Put an overlays on the current line, displaying TIME.
If LEVEL is given, prefix time with a corresponding number of stars.
@@ -5510,11 +5961,11 @@ will be easy to remove."
(off 0)
ov tx)
(move-to-column c)
- (if (eolp) (setq off 1))
(unless (eolp) (skip-chars-backward "^ \t"))
(skip-chars-backward " \t")
- (setq ov (org-make-overlay (- (point) off) (point-at-eol))
- tx (concat (make-string (+ off (max 0 (- c (current-column)))) ?.)
+ (setq ov (org-make-overlay (1- (point)) (point-at-eol))
+ tx (concat (buffer-substring (1- (point)) (point))
+ (make-string (+ off (max 0 (- c (current-column)))) ?.)
(org-add-props (format "%s %2d:%02d%s"
(make-string l ?*) h m
(make-string (- 10 l) ?\ ))
@@ -5528,11 +5979,12 @@ will be easy to remove."
BEG and END are ignored. If NOREMOVE is nil, remove this function
from the `before-change-functions' in the current buffer."
(interactive)
- (mapc 'org-delete-overlay org-clock-overlays)
- (setq org-clock-overlays nil)
- (unless noremove
- (remove-hook 'before-change-functions
- 'org-remove-clock-overlays 'local)))
+ (unless org-inhibit-highlight-removal
+ (mapc 'org-delete-overlay org-clock-overlays)
+ (setq org-clock-overlays nil)
+ (unless noremove
+ (remove-hook 'before-change-functions
+ 'org-remove-clock-overlays 'local))))
(defun org-clock-out-if-current ()
"Clock out if the current entry contains the running clock.
@@ -5557,6 +6009,112 @@ If yes, offer to stop it and to save the buffer with the changes."
(when (y-or-n-p "Save changed buffer?")
(save-buffer))))
+(defun org-clock-report ()
+ "Create a table containing a report about clocked time.
+If the buffer contains lines
+#+BEGIN: clocktable :maxlevel 3 :emphasize nil
+
+#+END: clocktable
+then the table will be inserted between these lines, replacing whatever
+is was there before. If these lines are not in the buffer, the table
+is inserted at point, surrounded by the special lines.
+The BEGIN line can contain parameters. Allowed are:
+:maxlevel The maximum level to be included in the table. Default is 3.
+:emphasize t/nil, if levell 1 and level 2 should be bold/italic in the table."
+ (interactive)
+ (org-remove-clock-overlays)
+ (unless (org-find-dblock "clocktable")
+ (org-create-dblock (list :name "clocktable"
+ :maxlevel 2 :emphasize nil)))
+ (org-update-dblock))
+
+(defun org-dblock-write:clocktable (params)
+ "Write the standard clocktable."
+ (let ((hlchars '((1 . "*") (2 . ?/)))
+ (emph nil)
+ (ins (make-marker))
+ ipos time h m p level hlc hdl maxlevel)
+ (setq maxlevel (or (plist-get params :maxlevel) 3)
+ emph (plist-get params :emphasize))
+ (move-marker ins (point))
+ (setq ipos (point))
+ (insert-before-markers "Clock summary at ["
+ (substring
+ (format-time-string (cdr org-time-stamp-formats))
+ 1 -1)
+ "]\n|L|Headline|Time|\n")
+ (org-clock-sum)
+ (setq h (/ org-clock-file-total-minutes 60)
+ m (- org-clock-file-total-minutes (* 60 h)))
+ (insert-before-markers "|-\n|0|" "*Total file time*| "
+ (format "*%d:%02d*" h m)
+ "|\n")
+ (goto-char (point-min))
+ (while (setq p (next-single-property-change (point) :org-clock-minutes))
+ (goto-char p)
+ (when (setq time (get-text-property p :org-clock-minutes))
+ (beginning-of-line 1)
+ (when (and (looking-at "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[0-9a-zA-Z_@:]+:\\)?[ \t]*$")
+ (setq level (- (match-end 1) (match-beginning 1)))
+ (<= level maxlevel))
+ (setq hlc (if emph (or (cdr (assoc level hlchars)) "") "")
+ hdl (match-string 2)
+ h (/ time 60)
+ m (- time (* 60 h)))
+ (save-excursion
+ (goto-char ins)
+ (if (= level 1) (insert-before-markers "|-\n"))
+ (insert-before-markers
+ "| " (int-to-string level) "|" hlc hdl hlc " |"
+ (make-string (1- level) ?|)
+ hlc
+ (format "%d:%02d" h m)
+ hlc
+ " |\n")))))
+ (goto-char ins)
+ (backward-delete-char 1)
+ (goto-char ipos)
+ (skip-chars-forward "^|")
+ (org-table-align)))
+
+(defun org-collect-clock-time-entries ()
+ "Return an internal list with clocking information.
+This list has one entry for each CLOCK interval.
+FIXME: describe the elements."
+ (interactive)
+ (let ((re (concat "^[ \t]*" org-clock-string
+ " *\\[\\(.*?\\)\\]--\\[\\(.*?\\)\\]"))
+ rtn beg end next cont level title total closedp leafp
+ clockpos titlepos h m donep)
+ (save-excursion
+ (org-clock-sum)
+ (goto-char (point-min))
+ (while (re-search-forward re nil t)
+ (setq clockpos (match-beginning 0)
+ beg (match-string 1) end (match-string 2)
+ cont (match-end 0))
+ (setq beg (apply 'encode-time (org-parse-time-string beg))
+ end (apply 'encode-time (org-parse-time-string end)))
+ (org-back-to-heading t)
+ (setq donep (org-entry-is-done-p))
+ (setq titlepos (point)
+ total (or (get-text-property (1+ (point)) :org-clock-minutes) 0)
+ h (/ total 60) m (- total (* 60 h))
+ total (cons h m))
+ (looking-at "\\(\\*+\\) +\\(.*\\)")
+ (setq level (- (match-end 1) (match-beginning 1))
+ title (org-match-string-no-properties 2))
+ (save-excursion (outline-next-heading) (setq next (point)))
+ (setq closedp (re-search-forward org-closed-time-regexp next t))
+ (goto-char next)
+ (setq leafp (and (looking-at "^\\*+ ")
+ (<= (- (match-end 0) (point)) level)))
+ (push (list beg end clockpos closedp donep
+ total title titlepos level leafp)
+ rtn)
+ (goto-char cont)))
+ (nreverse rtn)))
+
;;; Agenda, and Diary Integration
;;; Define the mode
@@ -5616,6 +6174,7 @@ The following commands are available:
(define-key org-agenda-mode-map "o" 'delete-other-windows)
(define-key org-agenda-mode-map "L" 'org-agenda-recenter)
(define-key org-agenda-mode-map "t" 'org-agenda-todo)
+(define-key org-agenda-mode-map "a" 'org-agenda-toggle-archive-tag)
(define-key org-agenda-mode-map ":" 'org-agenda-set-tags)
(define-key org-agenda-mode-map "." 'org-agenda-goto-today)
(define-key org-agenda-mode-map "d" 'org-agenda-day-view)
@@ -5983,6 +6542,7 @@ dates."
(past t)
args
s e rtn d emptyp)
+ (org-prepare-agenda-buffers org-agenda-files)
(setq org-agenda-redo-command
(list 'progn
(list 'switch-to-buffer-other-window (current-buffer))
@@ -6077,6 +6637,7 @@ NDAYS defaults to `org-agenda-ndays'."
(day-numbers (list start))
(inhibit-redisplay t)
s e rtn rtnall file date d start-pos end-pos todayp nd)
+ (org-prepare-agenda-buffers files)
(setq org-agenda-redo-command
(list 'org-agenda-list (list 'quote include-all) start-day ndays t))
;; Make the list of days
@@ -6212,6 +6773,7 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
'(org-todo-list (or current-prefix-arg last-arg) t))
(setq files (org-agenda-files)
rtnall nil)
+ (org-prepare-agenda-buffers files)
(while (setq file (pop files))
(catch 'nextfile
(org-check-agenda-file file)
@@ -6820,8 +7382,11 @@ the documentation of `org-diary'."
ee txt)
(goto-char (point-min))
(while (re-search-forward regexp nil t)
- (when (not (and org-agenda-todo-ignore-scheduled
- (save-match-data (looking-at sched-re))))
+ (catch :skip
+ (and org-agenda-todo-ignore-scheduled
+ (looking-at sched-re)
+ (throw :skip nil))
+ (org-agenda-skip)
(goto-char (match-beginning 1))
(setq marker (org-agenda-new-marker (1+ (match-beginning 0)))
category (org-get-category)
@@ -6833,14 +7398,14 @@ the documentation of `org-diary'."
(- org-todo-kwd-max-priority -2
(length
(member (match-string 2) org-todo-keywords)))
- 1)))
+ 1)))
(org-add-props txt props
'org-marker marker 'org-hd-marker marker
'priority priority 'category category)
- (push txt ee))
- (if org-agenda-todo-list-sublevels
- (goto-char (match-end 1))
- (org-end-of-subtree 'invisible)))
+ (push txt ee)
+ (if org-agenda-todo-list-sublevels
+ (goto-char (match-end 1))
+ (org-end-of-subtree 'invisible))))
(nreverse ee)))
(defconst org-agenda-no-heading-message
@@ -6866,50 +7431,51 @@ the documentation of `org-diary'."
ee txt timestr tags)
(goto-char (point-min))
(while (re-search-forward regexp nil t)
- (if (not (save-match-data (org-at-date-range-p)))
- (progn
- (setq marker (org-agenda-new-marker (match-beginning 0))
- category (org-get-category (match-beginning 0))
- tmp (buffer-substring (max (point-min)
- (- (match-beginning 0)
- org-ds-keyword-length))
- (match-beginning 0))
- timestr (buffer-substring (match-beginning 0) (point-at-eol))
- deadlinep (string-match org-deadline-regexp tmp)
- scheduledp (string-match org-scheduled-regexp tmp)
- donep (org-entry-is-done-p))
- (if (string-match ">" timestr)
- ;; substring should only run to end of time stamp
- (setq timestr (substring timestr 0 (match-end 0))))
- (save-excursion
- (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
- (progn
- (goto-char (match-end 1))
- (setq hdmarker (org-agenda-new-marker)
- tags (org-get-tags-at))
- (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
- (setq txt (org-format-agenda-item
- (format "%s%s"
- (if deadlinep "Deadline: " "")
- (if scheduledp "Scheduled: " ""))
- (match-string 1) category tags timestr)))
- (setq txt org-agenda-no-heading-message))
- (setq priority (org-get-priority txt))
- (org-add-props txt props
- 'org-marker marker 'org-hd-marker hdmarker)
- (if deadlinep
- (org-add-props txt nil
- 'face (if donep 'org-done 'org-warning)
- 'undone-face 'org-warning 'done-face 'org-done
- 'category category 'priority (+ 100 priority))
- (if scheduledp
- (org-add-props txt nil
- 'face 'org-scheduled-today
- 'undone-face 'org-scheduled-today 'done-face 'org-done
- 'category category 'priority (+ 99 priority))
- (org-add-props txt nil 'priority priority 'category category)))
- (push txt ee))
- (outline-next-heading))))
+ (catch :skip
+ (and (save-match-data (org-at-date-range-p)) (throw :skip nil))
+ (org-agenda-skip)
+ (setq marker (org-agenda-new-marker (match-beginning 0))
+ category (org-get-category (match-beginning 0))
+ tmp (buffer-substring (max (point-min)
+ (- (match-beginning 0)
+ org-ds-keyword-length))
+ (match-beginning 0))
+ timestr (buffer-substring (match-beginning 0) (point-at-eol))
+ deadlinep (string-match org-deadline-regexp tmp)
+ scheduledp (string-match org-scheduled-regexp tmp)
+ donep (org-entry-is-done-p))
+ (if (string-match ">" timestr)
+ ;; substring should only run to end of time stamp
+ (setq timestr (substring timestr 0 (match-end 0))))
+ (save-excursion
+ (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
+ (progn
+ (goto-char (match-end 1))
+ (setq hdmarker (org-agenda-new-marker)
+ tags (org-get-tags-at))
+ (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
+ (setq txt (org-format-agenda-item
+ (format "%s%s"
+ (if deadlinep "Deadline: " "")
+ (if scheduledp "Scheduled: " ""))
+ (match-string 1) category tags timestr)))
+ (setq txt org-agenda-no-heading-message))
+ (setq priority (org-get-priority txt))
+ (org-add-props txt props
+ 'org-marker marker 'org-hd-marker hdmarker)
+ (if deadlinep
+ (org-add-props txt nil
+ 'face (if donep 'org-done 'org-warning)
+ 'undone-face 'org-warning 'done-face 'org-done
+ 'category category 'priority (+ 100 priority))
+ (if scheduledp
+ (org-add-props txt nil
+ 'face 'org-scheduled-today
+ 'undone-face 'org-scheduled-today 'done-face 'org-done
+ 'category category 'priority (+ 99 priority))
+ (org-add-props txt nil 'priority priority 'category category)))
+ (push txt ee))
+ (outline-next-heading)))
(nreverse ee)))
(defun org-agenda-get-closed ()
@@ -6933,35 +7499,35 @@ the documentation of `org-diary'."
ee txt timestr)
(goto-char (point-min))
(while (re-search-forward regexp nil t)
- (if (not (save-match-data (org-at-date-range-p)))
- (progn
- (setq marker (org-agenda-new-marker (match-beginning 0))
- closedp (equal (match-string 1) org-closed-string)
- category (org-get-category (match-beginning 0))
- timestr (buffer-substring (match-beginning 0) (point-at-eol))
- ;; donep (org-entry-is-done-p)
- )
- (if (string-match "\\]" timestr)
- ;; substring should only run to end of time stamp
- (setq timestr (substring timestr 0 (match-end 0))))
- (save-excursion
- (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
- (progn
- (goto-char (match-end 1))
- (setq hdmarker (org-agenda-new-marker)
- tags (org-get-tags-at))
- (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
- (setq txt (org-format-agenda-item
- (if closedp "Closed: " "Clocked: ")
- (match-string 1) category tags timestr)))
- (setq txt org-agenda-no-heading-message))
- (setq priority 100000)
- (org-add-props txt props
- 'org-marker marker 'org-hd-marker hdmarker 'face 'org-done
- 'priority priority 'category category
- 'undone-face 'org-warning 'done-face 'org-done)
- (push txt ee))
- (outline-next-heading))))
+ (catch :skip
+ (org-agenda-skip)
+ (setq marker (org-agenda-new-marker (match-beginning 0))
+ closedp (equal (match-string 1) org-closed-string)
+ category (org-get-category (match-beginning 0))
+ timestr (buffer-substring (match-beginning 0) (point-at-eol))
+ ;; donep (org-entry-is-done-p)
+ )
+ (if (string-match "\\]" timestr)
+ ;; substring should only run to end of time stamp
+ (setq timestr (substring timestr 0 (match-end 0))))
+ (save-excursion
+ (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
+ (progn
+ (goto-char (match-end 1))
+ (setq hdmarker (org-agenda-new-marker)
+ tags (org-get-tags-at))
+ (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
+ (setq txt (org-format-agenda-item
+ (if closedp "Closed: " "Clocked: ")
+ (match-string 1) category tags timestr)))
+ (setq txt org-agenda-no-heading-message))
+ (setq priority 100000)
+ (org-add-props txt props
+ 'org-marker marker 'org-hd-marker hdmarker 'face 'org-done
+ 'priority priority 'category category
+ 'undone-face 'org-warning 'done-face 'org-done)
+ (push txt ee))
+ (outline-next-heading)))
(nreverse ee)))
(defun org-agenda-get-deadlines ()
@@ -6980,41 +7546,43 @@ the documentation of `org-diary'."
ee txt head face)
(goto-char (point-min))
(while (re-search-forward regexp nil t)
- (setq pos (1- (match-beginning 1))
- d2 (time-to-days
- (org-time-string-to-time (match-string 1)))
- diff (- d2 d1))
- ;; When to show a deadline in the calendar:
- ;; If the expiration is within wdays warning time.
- ;; Past-due deadlines are only shown on the current date
- (if (and (< diff wdays) todayp (not (= diff 0)))
- (save-excursion
- (setq category (org-get-category))
- (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t)
- (progn
- (goto-char (match-end 0))
- (setq pos1 (match-end 1))
- (setq tags (org-get-tags-at pos1))
- (setq head (buffer-substring-no-properties
- (point)
- (progn (skip-chars-forward "^\r\n")
- (point))))
- (if (string-match org-looking-at-done-regexp head)
- (setq txt nil)
- (setq txt (org-format-agenda-item
- (format "In %3d d.: " diff) head category tags))))
- (setq txt org-agenda-no-heading-message))
- (when txt
- (setq face (cond ((<= diff 0) 'org-warning)
- ((<= diff 5) 'org-upcoming-deadline)
- (t nil)))
- (org-add-props txt props
- 'org-marker (org-agenda-new-marker pos)
- 'org-hd-marker (org-agenda-new-marker pos1)
- 'priority (+ (- 10 diff) (org-get-priority txt))
- 'category category
- 'face face 'undone-face face 'done-face 'org-done)
- (push txt ee)))))
+ (catch :skip
+ (org-agenda-skip)
+ (setq pos (1- (match-beginning 1))
+ d2 (time-to-days
+ (org-time-string-to-time (match-string 1)))
+ diff (- d2 d1))
+ ;; When to show a deadline in the calendar:
+ ;; If the expiration is within wdays warning time.
+ ;; Past-due deadlines are only shown on the current date
+ (if (and (< diff wdays) todayp (not (= diff 0)))
+ (save-excursion
+ (setq category (org-get-category))
+ (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t)
+ (progn
+ (goto-char (match-end 0))
+ (setq pos1 (match-end 1))
+ (setq tags (org-get-tags-at pos1))
+ (setq head (buffer-substring-no-properties
+ (point)
+ (progn (skip-chars-forward "^\r\n")
+ (point))))
+ (if (string-match org-looking-at-done-regexp head)
+ (setq txt nil)
+ (setq txt (org-format-agenda-item
+ (format "In %3d d.: " diff) head category tags))))
+ (setq txt org-agenda-no-heading-message))
+ (when txt
+ (setq face (cond ((<= diff 0) 'org-warning)
+ ((<= diff 5) 'org-upcoming-deadline)
+ (t nil)))
+ (org-add-props txt props
+ 'org-marker (org-agenda-new-marker pos)
+ 'org-hd-marker (org-agenda-new-marker pos1)
+ 'priority (+ (- 10 diff) (org-get-priority txt))
+ 'category category
+ 'face face 'undone-face face 'done-face 'org-done)
+ (push txt ee))))))
ee))
(defun org-agenda-get-scheduled ()
@@ -7035,36 +7603,38 @@ the documentation of `org-diary'."
ee txt head)
(goto-char (point-min))
(while (re-search-forward regexp nil t)
- (setq pos (1- (match-beginning 1))
- d2 (time-to-days
- (org-time-string-to-time (match-string 1)))
- diff (- d2 d1))
- ;; When to show a scheduled item in the calendar:
- ;; If it is on or past the date.
- (if (and (< diff 0) todayp)
- (save-excursion
- (setq category (org-get-category))
- (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t)
- (progn
- (goto-char (match-end 0))
- (setq pos1 (match-end 1))
- (setq tags (org-get-tags-at))
- (setq head (buffer-substring-no-properties
- (point)
- (progn (skip-chars-forward "^\r\n") (point))))
- (if (string-match org-looking-at-done-regexp head)
- (setq txt nil)
- (setq txt (org-format-agenda-item
- (format "Sched.%2dx: " (- 1 diff)) head
- category tags))))
- (setq txt org-agenda-no-heading-message))
- (when txt
- (org-add-props txt props
- 'org-marker (org-agenda-new-marker pos)
- 'org-hd-marker (org-agenda-new-marker pos1)
- 'priority (+ (- 5 diff) (org-get-priority txt))
- 'category category)
- (push txt ee)))))
+ (catch :skip
+ (org-agenda-skip)
+ (setq pos (1- (match-beginning 1))
+ d2 (time-to-days
+ (org-time-string-to-time (match-string 1)))
+ diff (- d2 d1))
+ ;; When to show a scheduled item in the calendar:
+ ;; If it is on or past the date.
+ (if (and (< diff 0) todayp)
+ (save-excursion
+ (setq category (org-get-category))
+ (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t)
+ (progn
+ (goto-char (match-end 0))
+ (setq pos1 (match-end 1))
+ (setq tags (org-get-tags-at))
+ (setq head (buffer-substring-no-properties
+ (point)
+ (progn (skip-chars-forward "^\r\n") (point))))
+ (if (string-match org-looking-at-done-regexp head)
+ (setq txt nil)
+ (setq txt (org-format-agenda-item
+ (format "Sched.%2dx: " (- 1 diff)) head
+ category tags))))
+ (setq txt org-agenda-no-heading-message))
+ (when txt
+ (org-add-props txt props
+ 'org-marker (org-agenda-new-marker pos)
+ 'org-hd-marker (org-agenda-new-marker pos1)
+ 'priority (+ (- 5 diff) (org-get-priority txt))
+ 'category category)
+ (push txt ee))))))
ee))
(defun org-agenda-get-blocks ()
@@ -7081,34 +7651,36 @@ the documentation of `org-diary'."
marker hdmarker ee txt d1 d2 s1 s2 timestr category tags)
(goto-char (point-min))
(while (re-search-forward regexp nil t)
- (setq timestr (match-string 0)
- s1 (match-string 1)
- s2 (match-string 2)
- d1 (time-to-days (org-time-string-to-time s1))
- d2 (time-to-days (org-time-string-to-time s2)))
- (if (and (> (- d0 d1) -1) (> (- d2 d0) -1))
- ;; Only allow days between the limits, because the normal
- ;; date stamps will catch the limits.
- (save-excursion
- (setq marker (org-agenda-new-marker (point)))
- (setq category (org-get-category))
- (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
- (progn
- (setq hdmarker (org-agenda-new-marker (match-end 1)))
- (goto-char (match-end 1))
- (setq tags (org-get-tags-at))
- (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
- (setq txt (org-format-agenda-item
- (format (if (= d1 d2) "" "(%d/%d): ")
- (1+ (- d0 d1)) (1+ (- d2 d1)))
- (match-string 1) category tags
- (if (= d0 d1) timestr))))
- (setq txt org-agenda-no-heading-message))
- (org-add-props txt props
- 'org-marker marker 'org-hd-marker hdmarker
- 'priority (org-get-priority txt) 'category category)
- (push txt ee)))
- (outline-next-heading))
+ (catch :skip
+ (org-agenda-skip)
+ (setq timestr (match-string 0)
+ s1 (match-string 1)
+ s2 (match-string 2)
+ d1 (time-to-days (org-time-string-to-time s1))
+ d2 (time-to-days (org-time-string-to-time s2)))
+ (if (and (> (- d0 d1) -1) (> (- d2 d0) -1))
+ ;; Only allow days between the limits, because the normal
+ ;; date stamps will catch the limits.
+ (save-excursion
+ (setq marker (org-agenda-new-marker (point)))
+ (setq category (org-get-category))
+ (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
+ (progn
+ (setq hdmarker (org-agenda-new-marker (match-end 1)))
+ (goto-char (match-end 1))
+ (setq tags (org-get-tags-at))
+ (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
+ (setq txt (org-format-agenda-item
+ (format (if (= d1 d2) "" "(%d/%d): ")
+ (1+ (- d0 d1)) (1+ (- d2 d1)))
+ (match-string 1) category tags
+ (if (= d0 d1) timestr))))
+ (setq txt org-agenda-no-heading-message))
+ (org-add-props txt props
+ 'org-marker marker 'org-hd-marker hdmarker
+ 'priority (org-get-priority txt) 'category category)
+ (push txt ee)))
+ (outline-next-heading)))
;; Sort the entries by expiration date.
(nreverse ee)))
@@ -7709,9 +8281,7 @@ be used to request time specification in the time stamp."
(org-agenda-check-no-diary)
(let* ((marker (or (get-text-property (point) 'org-marker)
(org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker))
- (hdmarker (get-text-property (point) 'org-hd-marker)))
+ (pos (marker-position marker)))
(with-current-buffer (marker-buffer marker)
(widen)
(goto-char pos)
@@ -7877,53 +8447,59 @@ are included in the output."
lspos
tags tags-list tags-alist (llast 0) rtn level category i txt
todo marker)
-
(save-excursion
(goto-char (point-min))
(when (eq action 'sparse-tree) (org-overview))
(while (re-search-forward re nil t)
- (setq todo (if (match-end 1) (match-string 2))
- tags (if (match-end 4) (match-string 4)))
- (goto-char (setq lspos (1+ (match-beginning 0))))
- (setq level (funcall outline-level)
- category (org-get-category))
- (setq i llast llast level)
- ;; remove tag lists from same and sublevels
- (while (>= i level)
- (when (setq entry (assoc i tags-alist))
- (setq tags-alist (delete entry tags-alist)))
- (setq i (1- i)))
- ;; add the nex tags
- (when tags
- (setq tags (mapcar 'downcase (org-split-string tags ":"))
- tags-alist
- (cons (cons level tags) tags-alist)))
- ;; compile tags for current headline
- (setq tags-list
- (if org-use-tag-inheritance
- (apply 'append (mapcar 'cdr tags-alist))
- tags))
- (when (and (or (not todo-only) todo)
- (eval matcher))
- ;; list this headline
- (if (eq action 'sparse-tree)
- (progn
- (org-show-hierarchy-above))
- (setq txt (org-format-agenda-item
- ""
- (concat
- (if org-tags-match-list-sublevels
- (make-string (1- level) ?.) "")
- (org-get-heading))
- category tags-list))
- (goto-char lspos)
- (setq marker (org-agenda-new-marker))
- (org-add-props txt props
- 'org-marker marker 'org-hd-marker marker 'category category)
- (push txt rtn))
- ;; if we are to skip sublevels, jump to end of subtree
- (point)
- (or org-tags-match-list-sublevels (org-end-of-subtree)))))
+ (catch :skip
+ (and (eq action 'agenda) (org-agenda-skip))
+ (setq todo (if (match-end 1) (match-string 2))
+ tags (if (match-end 4) (match-string 4)))
+ (goto-char (setq lspos (1+ (match-beginning 0))))
+ (setq level (funcall outline-level)
+ category (org-get-category))
+ (setq i llast llast level)
+ ;; remove tag lists from same and sublevels
+ (while (>= i level)
+ (when (setq entry (assoc i tags-alist))
+ (setq tags-alist (delete entry tags-alist)))
+ (setq i (1- i)))
+ ;; add the nex tags
+ (when tags
+ (setq tags (mapcar 'downcase (org-split-string tags ":"))
+ tags-alist
+ (cons (cons level tags) tags-alist)))
+ ;; compile tags for current headline
+ (setq tags-list
+ (if org-use-tag-inheritance
+ (apply 'append (mapcar 'cdr tags-alist))
+ tags))
+ (when (and (or (not todo-only) todo)
+ (eval matcher)
+ (or (not org-agenda-skip-archived-trees)
+ (not (member org-archive-tag tags-list))))
+ ;; list this headline
+ (if (eq action 'sparse-tree)
+ (progn
+ (org-show-hierarchy-above))
+ (setq txt (org-format-agenda-item
+ ""
+ (concat
+ (if org-tags-match-list-sublevels
+ (make-string (1- level) ?.) "")
+ (org-get-heading))
+ category tags-list))
+ (goto-char lspos)
+ (setq marker (org-agenda-new-marker))
+ (org-add-props txt props
+ 'org-marker marker 'org-hd-marker marker 'category category)
+ (push txt rtn))
+ ;; if we are to skip sublevels, jump to end of subtree
+ (point)
+ (or org-tags-match-list-sublevels (org-end-of-subtree))))))
+ (when (and (eq action 'sparse-tree)
+ (not org-sparse-tree-open-archived-trees))
+ (org-hide-archived-subtrees (point-min) (point-max)))
(nreverse rtn)))
(defun org-tags-sparse-tree (&optional arg match)
@@ -7994,6 +8570,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
(list 'if 'current-prefix-arg nil match) t))
(setq files (org-agenda-files)
rtnall nil)
+ (org-prepare-agenda-buffers files)
(while (setq file (pop files))
(catch 'nextfile
(org-check-agenda-file file)
@@ -8084,7 +8661,11 @@ With prefix ARG, realign all tags in headings in the current buffer."
(setq hd (match-string 1))
(delete-region (match-beginning 0) (match-end 0))
(insert-before-markers (org-trim hd) (if empty "" " ")))
- (unless (equal tags "")
+ (if (equal tags "")
+ (save-excursion
+ (beginning-of-line 1)
+ (and (re-search-forward "[ \t]+$" (point-at-eol) t)
+ (replace-match "")))
(move-to-column (max (current-column)
(if (> org-tags-column 0)
org-tags-column
@@ -8590,7 +9171,7 @@ in all files."
(defun org-search-not-link (&rest args)
"Execute `re-search-forward', but only accept matches that are not a link."
(catch 'exit
- (let ((pos (point)) p1)
+ (let (p1)
(while (apply 're-search-forward args)
(setq p1 (point))
(if (not (save-match-data
@@ -8990,24 +9571,23 @@ If the file does not exist, an error is thrown."
(setq in-emacs (or in-emacs line search))
(let* ((file (if (equal path "")
buffer-file-name
- (convert-standard-filename (org-expand-file-name path))))
- (dirp (file-directory-p file))
+ path))
+ (apps (append org-file-apps (org-default-apps)))
+ (remp (and (assq 'remote apps) (org-file-remote-p file)))
+ (dirp (if remp nil (file-directory-p file)))
(dfile (downcase file))
(old-buffer (current-buffer))
(old-pos (point))
(old-mode major-mode)
- ext cmd apps)
- (if (and (not (file-exists-p file))
- (not org-open-non-existing-files))
- (error "No such file: %s" file))
+ ext cmd)
(if (string-match "^.*\\.\\([a-zA-Z0-9]+\\.gz\\)$" dfile)
(setq ext (match-string 1 dfile))
(if (string-match "^.*\\.\\([a-zA-Z0-9]+\\)$" dfile)
(setq ext (match-string 1 dfile))))
- (setq apps (append org-file-apps (org-default-apps)))
(if in-emacs
(setq cmd 'emacs)
- (setq cmd (or (and dirp (cdr (assoc 'directory apps)))
+ (setq cmd (or (and remp (cdr (assoc 'remote apps)))
+ (and dirp (cdr (assoc 'directory apps)))
(cdr (assoc ext apps))
(cdr (assoc t apps)))))
(when (eq cmd 'mailcap)
@@ -9018,6 +9598,10 @@ If the file does not exist, an error is thrown."
(if (stringp command)
(setq cmd command)
(setq cmd 'emacs))))
+ (if (and (not (eq cmd 'emacs)) ; Emacs has not problems with non-ex files
+ (not (file-exists-p file))
+ (not org-open-non-existing-files))
+ (error "No such file: %s" file))
(cond
((and (stringp cmd) (not (string-match "^\\s-*$" cmd)))
;; Normalize use of quote, this can vary.
@@ -9028,8 +9612,9 @@ If the file does not exist, an error is thrown."
(shell-command (concat cmd " &"))))
((or (stringp cmd)
(eq cmd 'emacs))
- (unless (equal (file-truename file) (file-truename (or buffer-file-name "")))
- (funcall (cdr (assq 'file org-link-frame-setup)) file))
+; (unless (equal (file-truename file) (file-truename (or buffer-file-name "")))
+; (funcall (cdr (assq 'file org-link-frame-setup)) file))
+ (funcall (cdr (assq 'file org-link-frame-setup)) file)
(if line (goto-line line)
(if search (org-link-search search))))
((consp cmd)
@@ -9053,6 +9638,20 @@ If the file does not exist, an error is thrown."
"Replace special path abbreviations and expand the file name."
(expand-file-name path))
+(defun org-file-remote-p (file)
+ "Test whether FILE specifies a location on a remote system.
+Return non-nil if the location is indeed remote.
+
+For example, the filename \"/user@host:/foo\" specifies a location
+on the system \"/user@host:\"."
+ (cond ((fboundp 'file-remote-p)
+ (file-remote-p file))
+ ((fboundp 'tramp-handle-file-remote-p)
+ (tramp-handle-file-remote-p file))
+ ((and (boundp 'ange-ftp-name-format)
+ (string-match ange-ftp-name-format file))
+ t)
+ (t nil)))
(defvar org-insert-link-history nil
"Minibuffer history for links inserted with `org-insert-link'.")
@@ -9186,8 +9785,8 @@ For file links, arg negates `org-context-in-file-links'."
(setq cpltxt (url-view-url t)
link (org-make-link cpltxt)))
((eq major-mode 'w3m-mode)
- (setq cpltxt w3m-current-url
- link (org-make-link cpltxt)))
+ (setq cpltxt (or w3m-current-title w3m-current-url)
+ link (org-make-link w3m-current-url)))
((setq search (run-hook-with-args-until-success
'org-create-file-search-functions))
@@ -9195,6 +9794,11 @@ For file links, arg negates `org-context-in-file-links'."
"::" search))
(setq cpltxt (or description link)))
+ ((eq major-mode 'image-mode)
+ (setq cpltxt (concat "file:"
+ (abbreviate-file-name buffer-file-name))
+ link (org-make-link cpltxt)))
+
((eq major-mode 'org-mode)
;; Just link to current headline
(setq cpltxt (concat "file:"
@@ -9414,7 +10018,9 @@ subdirectory. Otherwise, the link will be the absolute path as
completed in the minibuffer (i.e. normally ~/path/to/file).
With two \\[universal-argument] prefixes, enforce an absolute path even if the file
-is in the current directory or below."
+is in the current directory or below.
+With three \\[universal-argument] prefixes, negate the meaning of
+`org-keep-stored-link-after-insertion'."
(interactive "P")
(let (link desc entry remove file (pos (point)))
(cond
@@ -9430,7 +10036,7 @@ is in the current directory or below."
(setq link (read-string "Link: "
(org-link-unescape
(org-match-string-no-properties 1)))))
- (complete-file
+ ((equal complete-file '(4))
;; Completing read for file names.
(setq file (read-file-name "File: "))
(let ((pwd (file-name-as-directory (expand-file-name ".")))
@@ -9455,7 +10061,8 @@ is in the current directory or below."
org-insert-link-history
(or (car (car org-stored-links)))))
(setq entry (assoc link org-stored-links))
- (if (not org-keep-stored-link-after-insertion)
+ (if (funcall (if (equal complete-file '(64)) 'not 'identity)
+ (not org-keep-stored-link-after-insertion))
(setq org-stored-links (delq (assoc link org-stored-links)
org-stored-links)))
(setq link (if entry (nth 1 entry) link)
@@ -9908,7 +10515,7 @@ This is being used to correctly align a single field after TAB or RET.")
(linepos (+ (if (bolp) 1 0) (count-lines (point-min) (point))))
(colpos (org-table-current-column))
(winstart (window-start))
- text lines (new "") lengths l typenums ty fields maxfields i
+ lines (new "") lengths l typenums ty fields maxfields i
column
(indent "") cnt frac
rfmt hfmt
@@ -9919,7 +10526,7 @@ This is being used to correctly align a single field after TAB or RET.")
(make-string sp2 ?\ ) "%%%s%ds" (make-string sp1 ?\ ) "|"))
(hfmt1 (concat
(make-string sp2 ?-) "%s" (make-string sp1 ?-) "+"))
- emptystrings xx links narrow fmax fmin f1 len c e)
+ emptystrings links narrow fmax f1 len c e)
(untabify beg end)
(remove-text-properties beg end '(org-cwidth t display t))
;; Check if we have links
@@ -11477,10 +12084,10 @@ not overwrite the stored one."
;; Insert ranges in current column
(while (string-match "\\&[-I0-9]+" form)
(setq form (replace-match
- (save-match-data
- (org-table-get-vertical-vector (match-string 0 form)
- nil n0))
- t t form)))
+ (save-match-data
+ (org-table-get-vertical-vector (match-string 0 form)
+ nil n0))
+ t t form)))
(if lispp
(setq ev (eval (eval (read form)))
ev (if (numberp ev) (number-to-string ev) ev))
@@ -12055,9 +12662,11 @@ overwritten, and the table is not marked as requiring realignment."
(:headline-levels . org-export-headline-levels)
(:section-numbers . org-export-with-section-numbers)
(:table-of-contents . org-export-with-toc)
+ (:archived-trees . org-export-with-archived-trees)
(:emphasize . org-export-with-emphasize)
(:sub-superscript . org-export-with-sub-superscripts)
(:TeX-macros . org-export-with-TeX-macros)
+ (:LaTeX-fragments . org-export-with-LaTeX-fragments)
(:fixed-width . org-export-with-fixed-width)
(:timestamps . org-export-with-timestamps)
(:tables . org-export-with-tables)
@@ -12088,7 +12697,6 @@ overwritten, and the table is not marked as requiring realignment."
(goto-char 0)
(let ((re (org-make-options-regexp
'("TITLE" "AUTHOR" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE")))
- (text nil)
p key val text options)
(while (re-search-forward re nil t)
(setq key (org-match-string-no-properties 1)
@@ -12112,7 +12720,8 @@ overwritten, and the table is not marked as requiring realignment."
("|" . :tables)
("^" . :sub-superscript)
("*" . :emphasize)
- ("TeX" . :TeX-macros)))
+ ("TeX" . :TeX-macros)
+ ("LaTeX" . :LaTeX-fragments)))
o)
(while (setq o (pop op))
(if (string-match (concat (regexp-quote (car o))
@@ -12199,7 +12808,8 @@ ones and overrule settings in the other lists."
\[X] publish... (project will be prompted for)
\[A] publish all projects")
(cmds
- '((?v . org-export-visible)
+ '((?t . org-insert-export-options-template)
+ (?v . org-export-visible)
(?a . org-export-as-ascii)
(?h . org-export-as-html)
(?b . org-export-as-html-and-open)
@@ -12526,32 +13136,56 @@ translations. There is currently no way for users to extend this.")
(defun org-cleaned-string-for-export (string &rest parameters)
"Cleanup a buffer substring so that links can be created safely."
(interactive)
- (let* ((cb (current-buffer))
- (re-radio (and org-target-link-regexp
+ (let* ((re-radio (and org-target-link-regexp
(concat "\\([^<]\\)\\(" org-target-link-regexp "\\)")))
(re-plain-link (concat "\\([^[<]\\)" org-plain-link-re))
(re-angle-link (concat "\\([^[]\\)" org-angle-link-re))
+ (re-archive (concat ":" org-archive-tag ":"))
rtn)
(save-excursion
(set-buffer (get-buffer-create " org-mode-tmp"))
(erase-buffer)
(insert string)
- (org-mode)
+ (let ((org-inhibit-startup t)) (org-mode))
+
+ ;; Get rid of archived trees
+ (when (not (eq org-export-with-archived-trees t))
+ (goto-char (point-min))
+ (while (re-search-forward re-archive nil t)
+ (if (not (org-on-heading-p))
+ (org-end-of-subtree t)
+ (beginning-of-line 1)
+ (delete-region
+ (if org-export-with-archived-trees (1+ (point-at-eol)) (point))
+ (org-end-of-subtree)))))
+
;; Find targets in comments and move them out of comments,
;; but mark them as targets that should be invisible
(goto-char (point-min))
(while (re-search-forward "^#.*?\\(<<<?[^>\r\n]+>>>?\\).*" nil t)
(replace-match "\\1(INVISIBLE)"))
+
;; Find matches for radio targets and turn them into internal links
(goto-char (point-min))
(when re-radio
(while (re-search-forward re-radio nil t)
(replace-match "\\1[[\\2]]")))
+
;; Find all links that contain a newline and put them into a single line
(goto-char (point-min))
(while (re-search-forward "\\(\\(\\[\\|\\]\\)\\[[^]]*?\\)[ \t]*\n[ \t]*\\([^]]*\\]\\(\\[\\|\\]\\)\\)" nil t)
(replace-match "\\1 \\3")
(goto-char (match-beginning 0)))
+
+ ;; Convert LaTeX fragments to images
+ (when (memq :LaTeX-fragments parameters)
+ (org-format-latex
+ (concat "ltxpng/" (file-name-sans-extension
+ (file-name-nondirectory
+ org-current-export-file)))
+ org-current-export-dir nil "Creating LaTeX image %s"))
+ (message "Exporting...")
+
;; Normalize links: Convert angle and plain links into bracket links
(goto-char (point-min))
(while (re-search-forward re-plain-link nil t)
@@ -12565,8 +13199,9 @@ translations. There is currently no way for users to extend this.")
(concat
(match-string 1) "[[" (match-string 2) ":" (match-string 3) "]]")
t t))
+
;; Find multiline emphasis and put them into single line
- (when (assq :emph-multiline parameters)
+ (when (memq :emph-multiline parameters)
(goto-char (point-min))
(while (re-search-forward org-emph-re nil t)
(subst-char-in-region (match-beginning 0) (match-end 0) ?\n ?\ t)
@@ -12671,7 +13306,6 @@ underlined headlines. The default is 3."
(title (or (plist-get opt-plist :title)
(file-name-sans-extension
(file-name-nondirectory buffer-file-name))))
- (options nil)
(email (plist-get opt-plist :email))
(language (plist-get opt-plist :language))
(text nil)
@@ -12772,7 +13406,7 @@ underlined headlines. The default is 3."
(normal-mode)
(save-buffer)
;; remove display and invisible chars
- (let (beg end s)
+ (let (beg end)
(goto-char (point-min))
(while (setq beg (next-single-property-change (point) 'display))
(setq end (next-single-property-change beg 'display))
@@ -12849,22 +13483,27 @@ underlined headlines. The default is 3."
(defun org-export-visible (type arg)
"Create a copy of the visible part of the current buffer, and export it.
The copy is created in a temporary buffer and removed after use.
-TYPE is the final key (as a string) of the `C-c C-x' key sequence that will
-run the export command - in interactive use, the command prompts for this
-key. As a special case, if the you type SPC at the prompt, the temporary
+TYPE is the final key (as a string) that also select the export command in
+the `C-c C-e' export dispatcher.
+As a special case, if the you type SPC at the prompt, the temporary
org-mode file will not be removed but presented to you so that you can
continue to use it. The prefix arg ARG is passed through to the exporting
command."
(interactive
(list (progn
(message "Export visible: [a]SCII [h]tml [b]rowse HTML [x]OXO [ ]keep buffer")
- (char-to-string (read-char-exclusive)))
+ (read-char-exclusive))
current-prefix-arg))
- (if (not (member type '("a" "\C-a" "b" "\C-b" "h" "x" " ")))
+ (if (not (member type '(?a ?\C-a ?b ?\C-b ?h ?x ?\ )))
(error "Invalid export key"))
- ;; FIXME: do this more explicit?
- (let* ((binding (key-binding (concat "\C-c\C-x" type)))
- (keepp (equal type " "))
+ (let* ((binding (cdr (assoc type
+ '((?a . org-export-as-ascii)
+ (?\C-a . org-export-as-ascii)
+ (?b . org-export-as-html-and-open)
+ (?\C-b . org-export-as-html-and-open)
+ (?h . org-export-as-html)
+ (?x . org-export-as-xoxo)))))
+ (keepp (equal type ?\ ))
(file buffer-file-name)
(buffer (get-buffer-create "*Org Export Visible*"))
s e)
@@ -12925,7 +13564,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
#+EMAIL: %s
#+LANGUAGE: %s
#+TEXT: Some descriptive text to be emitted. Several lines OK.
-#+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s *:%s TeX:%s
+#+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s *:%s TeX:%s LaTeX:%s
#+CATEGORY: %s
#+SEQ_TODO: %s
#+TYP_TODO: %s
@@ -12944,6 +13583,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
org-export-with-sub-superscripts
org-export-with-emphasize
org-export-with-TeX-macros
+ org-export-with-LaTeX-fragments
(file-name-nondirectory buffer-file-name)
(if (equal org-todo-interpretation 'sequence)
(mapconcat 'identity org-todo-keywords " ")
@@ -13041,6 +13681,7 @@ When HIDDEN is non-nil, don't display the HTML buffer.
EXT-PLIST is a property list with external parameters overriding
org-mode's default settings, but still inferior to file-local settings."
(interactive "P")
+ (message "Exporting...")
(setq-default org-todo-line-regexp org-todo-line-regexp)
(setq-default org-deadline-line-regexp org-deadline-line-regexp)
(setq-default org-done-string org-done-string)
@@ -13049,16 +13690,24 @@ org-mode's default settings, but still inferior to file-local settings."
(org-infile-export-plist)))
(style (plist-get opt-plist :style))
+ (link-validate (plist-get opt-plist :link-validation-function))
+ valid
(odd org-odd-levels-only)
(region-p (org-region-active-p))
(region
(buffer-substring
(if region-p (region-beginning) (point-min))
(if region-p (region-end) (point-max))))
+ ;; The following two are dynamically scoped into other
+ ;; routines below.
+ (org-current-export-dir (org-export-directory :html opt-plist))
+ (org-current-export-file buffer-file-name)
(all_lines
(org-skip-comments (org-split-string
(org-cleaned-string-for-export
- region :emph-multiline)
+ region :emph-multiline
+ (if (plist-get opt-plist :LaTeX-fragments)
+ :LaTeX-fragments))
"[\r\n]")))
(lines (org-export-find-first-heading-line all_lines))
(level 0) (line "") (origline "") txt todo
@@ -13068,6 +13717,7 @@ org-mode's default settings, but still inferior to file-local settings."
(file-name-sans-extension
(file-name-nondirectory buffer-file-name))
".html"))
+ (current-dir (file-name-directory buffer-file-name))
(buffer (find-file-noselect filename))
(levels-open (make-vector org-level-max nil))
(date (format-time-string "%Y/%m/%d" (current-time)))
@@ -13314,6 +13964,10 @@ lang=\"%s\" xml:lang=\"%s\">
(if (string-match "::\\(.*\\)" filename)
(setq search (match-string 1 filename)
filename (replace-match "" t nil filename)))
+ (setq valid
+ (if (functionp link-validate)
+ (funcall link-validate filename current-dir)
+ t))
(setq file-is-image-p
(string-match (org-image-file-name-regexp) filename))
(setq thefile (if abs-p (expand-file-name filename) filename))
@@ -13339,7 +13993,8 @@ lang=\"%s\" xml:lang=\"%s\">
(and org-export-html-inline-images
(not descp))))
(concat "<img src=\"" thefile "\"/>")
- (concat "<a href=\"" thefile "\">" desc "</a>")))))
+ (concat "<a href=\"" thefile "\">" desc "</a>")))
+ (if (not valid) (setq rpl desc))))
((member type '("bbdb" "vm" "wl" "mhe" "rmail" "gnus" "shell" "info" "elisp"))
(setq rpl (concat "<i>&lt;" type ":"
(save-match-data (org-link-unescape path))
@@ -13497,7 +14152,9 @@ lang=\"%s\" xml:lang=\"%s\">
(while (re-search-forward "<li>[ \r\n\t]*</li>\n?" nil t)
(replace-match ""))
(save-buffer)
- (goto-char (point-min)))))
+ (goto-char (point-min))
+ (message "Exporting... done"))))
+
(defun org-format-table-html (lines olines)
"Find out which HTML converter to use and return the HTML code."
@@ -13650,27 +14307,31 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
(defun org-html-handle-time-stamps (s)
"Format time stamps in string S, or remove them."
- (let (r b)
- (while (string-match org-maybe-keyword-time-regexp s)
- (or b (setq b (substring s 0 (match-beginning 0))))
- (if (not org-export-with-timestamps)
- (setq r (concat r (substring s 0 (match-beginning 0)))
- s (substring s (match-end 0)))
- (setq r (concat
- r (substring s 0 (match-beginning 0))
- (if (match-end 1)
- (format "@<span class=\"timestamp-kwd\">%s @</span>"
- (match-string 1 s)))
- (format " @<span class=\"timestamp\">%s@</span>"
- (substring (match-string 3 s) 1 -1)))
- s (substring s (match-end 0)))))
- ;; Line break of line started and ended with time stamp stuff
- (if (not r)
- s
- (setq r (concat r s))
- (unless (string-match "\\S-" (concat b s))
- (setq r (concat r "@<br/>")))
- r)))
+ (catch 'exit
+ (let (r b)
+ (while (string-match org-maybe-keyword-time-regexp s)
+ ;; FIXME: is it good to never export CLOCK, or do we need control?
+ (if (and (match-end 1) (equal (match-string 1 s) org-clock-string))
+ (throw 'exit ""))
+ (or b (setq b (substring s 0 (match-beginning 0))))
+ (if (not org-export-with-timestamps)
+ (setq r (concat r (substring s 0 (match-beginning 0)))
+ s (substring s (match-end 0)))
+ (setq r (concat
+ r (substring s 0 (match-beginning 0))
+ (if (match-end 1)
+ (format "@<span class=\"timestamp-kwd\">%s @</span>"
+ (match-string 1 s)))
+ (format " @<span class=\"timestamp\">%s@</span>"
+ (substring (match-string 3 s) 1 -1)))
+ s (substring s (match-end 0)))))
+ ;; Line break if line started and ended with time stamp stuff
+ (if (not r)
+ s
+ (setq r (concat r s))
+ (unless (string-match "\\S-" (concat b s))
+ (setq r (concat r "@<br/>")))
+ r))))
(defun org-html-protect (s)
;; convert & to &amp;, < to &lt; and > to &gt;
@@ -14147,6 +14808,293 @@ a time), or the day by one (if it does not contain a time)."
(setq fmt (if have-time ":%Y%m%dT%H%M%S" ";VALUE=DATE:%Y%m%d"))
(concat keyword (format-time-string fmt time))))
+;;; LaTeX stuff
+
+(defvar org-cdlatex-mode-map (make-sparse-keymap)
+ "Keymap for the minor `org-cdlatex-mode'.")
+
+(define-key org-cdlatex-mode-map "_" 'org-cdlatex-underscore-caret)
+(define-key org-cdlatex-mode-map "^" 'org-cdlatex-underscore-caret)
+(define-key org-cdlatex-mode-map "`" 'cdlatex-math-symbol)
+(define-key org-cdlatex-mode-map "'" 'org-cdlatex-math-modify)
+(define-key org-cdlatex-mode-map "\C-c{" 'cdlatex-environment)
+
+(defvar org-cdlatex-texmathp-advice-is-done nil
+ "Flag remembering if we have applied the advice to texmathp already.")
+
+(define-minor-mode org-cdlatex-mode
+ "Toggle the minor `org-cdlatex-mode'.
+This mode supports entering LaTeX environment and math in LaTeX fragments
+in Org-mode.
+\\{org-cdlatex-mode-map}"
+ nil " OCDL" nil
+ (when org-cdlatex-mode (require 'cdlatex))
+ (unless org-cdlatex-texmathp-advice-is-done
+ (setq org-cdlatex-texmathp-advice-is-done t)
+ (defadvice texmathp (around org-math-always-on activate)
+ "Always return t in org-mode buffers.
+This is because we want to insert math symbols without dollars even outside
+the LaTeX math segments. If Orgmode thinks that point is actually inside
+en embedded LaTeX fragement, let texmathp do its job.
+\\[org-cdlatex-mode-map]"
+ (interactive)
+ (let (p)
+ (cond
+ ((not (eq major-mode 'org-mode)) ad-do-it)
+ ((eq this-command 'cdlatex-math-symbol)
+ (setq ad-return-value t
+ texmathp-why '("cdlatex-math-symbol in org-mode" . 0)))
+ (t
+ (let ((p (org-inside-LaTeX-fragment-p)))
+ (if (and p (member (car p) (plist-get org-format-latex-options :matchers)))
+ (setq ad-return-value t
+ texmathp-why '("Org-mode embedded math" . 0))
+ (if p ad-do-it)))))))))
+
+(defun turn-on-org-cdlatex ()
+ "Unconditionally turn on `org-cdlatex-mode'."
+ (org-cdlatex-mode 1))
+
+(defun org-inside-LaTeX-fragment-p ()
+ "Test if point is inside a LaTeX fragment.
+I.e. after a \\begin, \\(, \\[, $, or $$, without the corresponding closing
+sequence appearing also before point.
+Even though the matchers for math are configurable, this function assumes
+that \\begin, \\(, \\[, and $$ are always used. Only the single dollar
+delimiters are skipped when they have been removed by customization.
+The return value is nil, or a cons cell with the delimiter and
+and the position of this delimiter.
+
+This function does a reasonably good job, but can locally be fooled by
+for example currency specifications. For example it will assume being in
+inline math after \"$22.34\". The LaTeX fragment formatter will only format
+fragments that are properly closed, but during editing, we have to live
+with the uncertainty caused by missing closing delimiters. This function
+looks only before point, not after."
+ (catch 'exit
+ (let ((pos (point))
+ (dodollar (member "$" (plist-get org-format-latex-options :matchers)))
+ (lim (progn
+ (re-search-backward (concat "^\\(" paragraph-start "\\)") nil t)
+ (point)))
+ dd-on str (start 0) m re)
+ (goto-char pos)
+ (when dodollar
+ (setq str (concat (buffer-substring lim (point)) "\000 X$.")
+ re (nth 1 (assoc "$" org-latex-regexps)))
+ (while (string-match re str start)
+ (cond
+ ((= (match-end 0) (length str))
+ (throw 'exit (cons "$" (+ lim (match-beginning 0)))))
+ ((= (match-end 0) (- (length str) 5))
+ (throw 'exit nil))
+ (t (setq start (match-end 0))))))
+ (when (setq m (re-search-backward "\\(\\\\begin{[^}]*}\\|\\\\(\\|\\\\\\[\\)\\|\\(\\\\end{[^}]*}\\|\\\\)\\|\\\\\\]\\)\\|\\(\\$\\$\\)" lim t))
+ (goto-char pos)
+ (and (match-beginning 1) (throw 'exit (cons (match-string 1) m)))
+ (and (match-beginning 2) (throw 'exit nil))
+ ;; count $$
+ (while (re-search-backward "\\$\\$" lim t)
+ (setq dd-on (not dd-on)))
+ (goto-char pos)
+ (if dd-on (cons "$$" m))))))
+
+
+(defun org-try-cdlatex-tab ()
+ "Check if it makes sense to execute `cdlatex-tab', and do it if yes.
+It makes sense to do so if `org-cdlatex-mode' is active and if the cursor is
+ - inside a LaTeX fragment, or
+ - after the first word in a line, where an abbreviation expansion could
+ insert a LaTeX environment."
+ ;; FIXME: This may still need refinement.
+ (when org-cdlatex-mode
+ (cond
+ ((save-excursion
+ (skip-chars-backward "a-zA-Z0-9*")
+ (skip-chars-backward " \t")
+ (bolp))
+ (cdlatex-tab) t)
+ ((org-inside-LaTeX-fragment-p)
+ (cdlatex-tab) t)
+ (t nil))))
+
+(defun org-cdlatex-underscore-caret (&optional arg)
+ "Execute `cdlatex-sub-superscript' in LaTeX fragments.
+Revert to the normal definition outside of these fragments."
+ (interactive "P")
+ (if (org-inside-LaTeX-fragment-p)
+ (call-interactively 'cdlatex-sub-superscript)
+ (let (org-cdlatex-mode)
+ (call-interactively (key-binding (vector last-input-event))))))
+
+(defun org-cdlatex-math-modify (&optional arg)
+ "Execute `cdlatex-math-modify' in LaTeX fragments.
+Revert to the normal definition outside of these fragments."
+ (interactive "P")
+ (if (org-inside-LaTeX-fragment-p)
+ (call-interactively 'cdlatex-math-modify)
+ (let (org-cdlatex-mode)
+ (call-interactively (key-binding (vector last-input-event))))))
+
+(defvar org-latex-fragment-image-overlays nil
+ "List of overlays carrying the images of latex fragments.")
+(make-variable-buffer-local 'org-latex-fragment-image-overlays)
+
+(defun org-remove-latex-fragment-image-overlays ()
+ "Remove all overlays with LaTeX fragment images in current buffer."
+ (mapc 'org-delete-overlay org-latex-fragment-image-overlays)
+ (setq org-latex-fragment-image-overlays nil))
+
+(defun org-preview-latex-fragment (&optional subtree)
+ "Preview the LaTeX fragment at point, or all locally or globally.
+If the cursor is in a LaTeX fragment, create the image and overlay
+it over the source code. If there is no fragment at point, display
+all fragments in the current text, from one headline to the next. With
+prefix SUBTREE, display all fragments in the current subtree. With a
+double prefix `C-u C-u', or when the cursor is before the first headline,
+display all fragments in the buffer.
+The images can be removed again with \\[org-ctrl-c-ctrl-c]."
+ (interactive "P")
+ (org-remove-latex-fragment-image-overlays)
+ (save-excursion
+ (save-restriction
+ (let (beg end at msg)
+ (cond
+ ((or (equal subtree '(16))
+ (not (save-excursion
+ (re-search-backward (concat "^" outline-regexp) nil t))))
+ (setq beg (point-min) end (point-max)
+ msg "Creating images for buffer...%s"))
+ ((equal subtree '(4))
+ (org-back-to-heading)
+ (setq beg (point) end (org-end-of-subtree)
+ msg "Creating images for subtree...%s"))
+ (t
+ (if (setq at (org-inside-LaTeX-fragment-p))
+ (goto-char (max (point-min) (- (cdr at) 2)))
+ (org-back-to-heading))
+ (setq beg (point) end (progn (outline-next-heading) (point))
+ msg (if at "Creating image...%s"
+ "Creating images for entry...%s"))))
+ (message msg "")
+ (narrow-to-region beg end)
+ (org-format-latex
+ (concat "ltxpng/" (file-name-sans-extension
+ (file-name-nondirectory
+ buffer-file-name)))
+ default-directory 'overlays msg at)
+ (message msg "done. Use `C-c C-c' to remove images.")))))
+
+(defvar org-latex-regexps
+ '(("begin" "^[ \t]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)[^\000]+?\\\\end{\\2}\\)" 1 t)
+ ;; ("$" "\\([ (]\\|^\\)\\(\\(\\([$]\\)\\([^ \r\n,.$].*?\\(\n.*?\\)\\{0,5\\}[^ \r\n,.$]\\)\\4\\)\\)\\([ .,?;:'\")]\\|$\\)" 2 nil)
+ ;; \000 in the following regex is needed for org-inside-LaTeX-fragment-p
+ ("$" "\\([^$]\\)\\(\\(\\$\\([^ \r\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ \r\n,.$]\\)\\$\\)\\)\\([ .,?;:'\")\000]\\|$\\)" 2 nil)
+ ("\\(" "\\\\([^\000]*?\\\\)" 0 nil)
+ ("\\[" "\\\\\\[[^\000]*?\\\\\\]" 0 t)
+ ("$$" "\\$\\$[^\000]*?\\$\\$" 0 t))
+ "Regular expressions for matching embedded LaTeX.")
+
+(defun org-format-latex (prefix &optional dir overlays msg at)
+ "Replace LaTeX fragments with links to an image, and produce images."
+ (if (and overlays (fboundp 'clear-image-cache)) (clear-image-cache))
+ (let* ((prefixnodir (file-name-nondirectory prefix))
+ (absprefix (expand-file-name prefix dir))
+ (todir (file-name-directory absprefix))
+ (opt org-format-latex-options)
+ (matchers (plist-get opt :matchers))
+ (re-list org-latex-regexps)
+ (cnt 0) txt link beg end re e oldfiles
+ m n block linkfile movefile ov)
+ ;; Make sure the directory exists
+ (or (file-directory-p todir) (make-directory todir))
+ ;; Check if there are old images files with this prefix, and remove them
+ (setq oldfiles (directory-files
+ todir 'full
+ (concat (regexp-quote prefixnodir) "_[0-9]+\\.png$")))
+ (while oldfiles (delete-file (pop oldfiles)))
+ ;; Check the different regular expressions
+ (while (setq e (pop re-list))
+ (setq m (car e) re (nth 1 e) n (nth 2 e)
+ block (if (nth 3 e) "\n\n" ""))
+ (when (member m matchers)
+ (goto-char (point-min))
+ (while (re-search-forward re nil t)
+ (when (or (not at) (equal (cdr at) (match-beginning n)))
+ (setq txt (match-string n)
+ beg (match-beginning n) end (match-end n)
+ cnt (1+ cnt)
+ linkfile (format "%s_%04d.png" prefix cnt)
+ movefile (format "%s_%04d.png" absprefix cnt)
+ link (concat block "[[file:" linkfile "]]" block))
+ (if msg (message msg cnt))
+ (goto-char beg)
+ (org-create-formula-image
+ txt movefile opt)
+ (if overlays
+ (progn
+ (setq ov (org-make-overlay beg end))
+ (if (featurep 'xemacs)
+ (progn
+ (org-overlay-put ov 'invisible t)
+ (org-overlay-put
+ ov 'end-glyph
+ (make-glyph (vector 'png :file movefile))))
+ (org-overlay-put
+ ov 'display
+ (list 'image :type 'png :file movefile :ascent 'center)))
+ (push ov org-latex-fragment-image-overlays)
+ (goto-char end))
+ (delete-region beg end)
+ (insert link))))))))
+
+;; This function borrows from Ganesh Swami's latex2png.el
+(defun org-create-formula-image (string tofile options)
+ (let* ((tmpdir (if (featurep 'xemacs)
+ (temp-directory)
+ temporary-file-directory))
+ (texfilebase (make-temp-name
+ (expand-file-name "orgtex" tmpdir)))
+
+;(texfilebase (make-temp-file "orgtex"))
+; (dummy (delete-file texfilebase))
+ (texfile (concat texfilebase ".tex"))
+ (dvifile (concat texfilebase ".dvi"))
+ (pngfile (concat texfilebase ".png"))
+ (scale (number-to-string (* 1000 (or (plist-get options :scale) 1.0))))
+ (fg (or (plist-get options :foreground) "Black"))
+ (bg (or (plist-get options :background) "Transparent")))
+ (with-temp-file texfile
+ (insert "\\documentclass{article}
+\\usepackage{fullpage}
+\\usepackage{amssymb}
+\\usepackage[usenames]{color}
+\\usepackage{amsmath}
+\\usepackage{latexsym}
+\\usepackage[mathscr]{eucal}
+\\pagestyle{empty}
+\\begin{document}\n" string "\n\\end{document}\n"))
+ (let ((dir default-directory))
+ (condition-case nil
+ (progn
+ (cd tmpdir)
+ (call-process "latex" nil nil nil texfile))
+ (error nil))
+ (cd dir))
+ (if (not (file-exists-p dvifile))
+ (progn (message "Failed to create dvi file from %s" texfile) nil)
+ (call-process "dvipng" nil nil nil
+ "-E" "-fg" fg "-bg" bg
+ "-x" scale "-y" scale "-T" "tight"
+ "-o" pngfile
+ dvifile)
+ (if (not (file-exists-p pngfile))
+ (progn (message "Failed to create png file from %s" texfile) nil)
+ ;; Use the requested file name and clean up
+ (copy-file pngfile tofile 'replace)
+ (loop for e in '(".dvi" ".tex" ".aux" ".log" ".png") do
+ (delete-file (concat texfilebase e)))
+ pngfile))))
;;; Key bindings
@@ -14212,7 +15160,9 @@ a time), or the day by one (if it does not contain a time)."
;; All the other keys
(define-key org-mode-map "\C-c\C-a" 'show-all) ; in case allout messed up.
+(define-key org-mode-map "\C-xns" 'org-narrow-to-subtree)
(define-key org-mode-map "\C-c$" 'org-archive-subtree)
+(define-key org-mode-map "\C-c\C-x\C-a" 'org-toggle-archive-tag)
(define-key org-mode-map "\C-c\C-j" 'org-goto)
(define-key org-mode-map "\C-c\C-t" 'org-todo)
(define-key org-mode-map "\C-c\C-s" 'org-schedule)
@@ -14255,24 +15205,7 @@ a time), or the day by one (if it does not contain a time)."
(define-key org-mode-map "\C-c~" 'org-table-create-with-table.el)
(define-key org-mode-map "\C-c\C-q" 'org-table-wrap-region)
(define-key org-mode-map "\C-c\C-e" 'org-export)
-;(define-key org-mode-map "\C-c\C-xa" 'org-export-as-ascii)
-;(define-key org-mode-map "\C-c\C-x\C-a" 'org-export-as-ascii)
-;(define-key org-mode-map "\C-c\C-xv" 'org-export-visible)
-;(define-key org-mode-map "\C-c\C-x\C-v" 'org-export-visible)
-;; OPML support is only an option for the future
-;(define-key org-mode-map "\C-c\C-xo" 'org-export-as-opml)
-;(define-key org-mode-map "\C-c\C-x\C-o" 'org-export-as-opml)
-;(define-key org-mode-map "\C-c\C-xi" 'org-export-icalendar-this-file)
-;(define-key org-mode-map "\C-c\C-x\C-i" 'org-export-icalendar-all-agenda-files)
-;(define-key org-mode-map "\C-c\C-xc" 'org-export-icalendar-combine-agenda-files)
-;(define-key org-mode-map "\C-c\C-x\C-c" 'org-export-icalendar-combine-agenda-files)
-;(define-key org-mode-map "\C-c\C-xt" 'org-insert-export-options-template)
(define-key org-mode-map "\C-c:" 'org-toggle-fixed-width-section)
-;(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html)
-;(define-key org-mode-map "\C-c\C-xx" 'org-export-as-xoxo)
-;(define-key org-mode-map "\C-c\C-x\C-x" 'org-export-as-xoxo)
-;(define-key org-mode-map "\C-c\C-xb" 'org-export-as-html-and-open)
-;(define-key org-mode-map "\C-c\C-x\C-b" 'org-export-as-html-and-open)
(define-key org-mode-map "\C-c\C-x\C-k" 'org-cut-special)
(define-key org-mode-map "\C-c\C-x\C-w" 'org-cut-special)
@@ -14283,15 +15216,9 @@ a time), or the day by one (if it does not contain a time)."
(define-key org-mode-map "\C-c\C-x\C-o" 'org-clock-out)
(define-key org-mode-map "\C-c\C-x\C-x" 'org-clock-cancel)
(define-key org-mode-map "\C-c\C-x\C-d" 'org-clock-display)
-
-;(define-key org-mode-map "\C-c\C-ef" 'org-publish-current-file)
-;(define-key org-mode-map "\C-c\C-ep" 'org-publish-current-project)
-;(define-key org-mode-map "\C-c\C-ec" 'org-publish)
-;(define-key org-mode-map "\C-c\C-ea" 'org-publish-all)
-;(define-key org-mode-map "\C-c\C-e\C-f" 'org-publish-current-file)
-;(define-key org-mode-map "\C-c\C-e\C-p" 'org-publish-current-project)
-;(define-key org-mode-map "\C-c\C-e\C-c" 'org-publish)
-;(define-key org-mode-map "\C-c\C-e\C-a" 'org-publish-all)
+(define-key org-mode-map "\C-c\C-x\C-r" 'org-clock-report)
+(define-key org-mode-map "\C-c\C-x\C-u" 'org-dblock-update)
+(define-key org-mode-map "\C-c\C-x\C-l" 'org-preview-latex-fragment)
(when (featurep 'xemacs)
(define-key org-mode-map 'button3 'popup-mode-menu))
@@ -14598,12 +15525,12 @@ This command does many different things, depending on context:
(interactive "P")
(let ((org-enable-table-editor t))
(cond
- (org-clock-overlays
+ ((or org-clock-overlays org-occur-highlights
+ org-latex-fragment-image-overlays)
(org-remove-clock-overlays)
- (message "Clock overlays removed"))
- (org-occur-highlights
(org-remove-occur-highlights)
- (message "occur highlights removed"))
+ (org-remove-latex-fragment-image-overlays)
+ (message "Temporary highlights/overlays removed from current buffer"))
((and (local-variable-p 'org-finish-function (current-buffer))
(fboundp org-finish-function))
(funcall org-finish-function))
@@ -14753,10 +15680,26 @@ See the individual commands for more information."
["Demote Heading" org-metaright (not (org-at-table-p))]
["Demote Subtree" org-shiftmetaright (not (org-at-table-p))]
"--"
- ["Archive Subtree" org-archive-subtree t]
- "--"
["Convert to odd levels" org-convert-to-odd-levels t]
["Convert to odd/even levels" org-convert-to-oddeven-levels t])
+ ("Archive"
+ ["Toggle ARCHIVE tag" org-toggle-archive-tag t]
+ ["Check and Tag Children" (org-toggle-archive-tag (4))
+ :active t :keys "C-u C-c C-x C-a"]
+ ["Sparse trees open ARCHIVE trees"
+ (setq org-sparse-tree-open-archived-trees
+ (not org-sparse-tree-open-archived-trees))
+ :style toggle :selected org-sparse-tree-open-archived-trees]
+ ["Cycling opens ARCHIVE trees"
+ (setq org-cycle-open-archived-trees (not org-cycle-open-archived-trees))
+ :style toggle :selected org-cycle-open-archived-trees]
+ ["Agenda includes ARCHIVE trees"
+ (setq org-agenda-skip-archived-trees (not org-agenda-skip-archived-trees))
+ :style toggle :selected (not org-agenda-skip-archived-trees)]
+ "--"
+ ["Move Subtree to Archive" org-archive-subtree t]
+ ["Check and Move Children" (org-archive-subtree '(4))
+ :active t :keys "C-u C-c $"])
"--"
("TODO Lists"
["TODO/DONE/-" org-todo t]
@@ -14785,6 +15728,7 @@ See the individual commands for more information."
["Clock out" org-clock-out t]
["Clock cancel" org-clock-cancel t]
["Display times" org-clock-display t]
+ ["Create clock table" org-clock-report t]
"--"
["Record DONE time"
(progn (setq org-log-done (not org-log-done))
@@ -14819,6 +15763,16 @@ See the individual commands for more information."
(re-search-forward "<[a-z]+:" nil t))])
"--"
["Export/Publish" org-export t]
+ ("LaTeX"
+ ["Org CDLaTeX mode" org-cdlatex-mode :style toggle
+ :selected org-cdlatex-mode]
+ ["Insert Environment" cdlatex-environment (fboundp 'cdlatex-environment)]
+ ["Insert math symbol" cdlatex-math-symbol (fboundp 'cdlatex-math-symbol)]
+ ["Modify math symbol" org-cdlatex-math-modify
+ (org-inside-LaTeX-fragment-p)]
+ ["Export LaTeX fragments as images"
+ (setq org-export-with-LaTeX-fragments (not org-export-with-LaTeX-fragments))
+ :style toggle :selected org-export-with-LaTeX-fragments])
"--"
("Documentation"
["Show Version" org-version t]
@@ -14897,6 +15851,7 @@ contexts are:
:tags on the TAGS in a headline
:priority on the priority cookie in a headline
:item on the first line of a plain list item
+:item-bullet on the bullet/number of a plain list item
:checkbox on the checkbox in a plain list item
:table in an org-mode table
:table-special on a special filed in a table
@@ -14905,13 +15860,15 @@ contexts are:
:keyword on a keyword: SCHEDULED, DEADLINE, CLOSE,COMMENT, QUOTE.
:target on a <<target>>
:radio-target on a <<<radio-target>>>
+:latex-fragment on a LaTeX fragment
+:latex-preview on a LaTeX fragment with overlayed preview image
This function expects the position to be visible because it uses font-lock
faces as a help to recognize the following contexts: :table-special, :link,
and :keyword."
(let* ((f (get-text-property (point) 'face))
(faces (if (listp f) f (list f)))
- (p (point)) clist)
+ (p (point)) clist o)
;; First the large context
(cond
((org-on-heading-p)
@@ -14928,6 +15885,7 @@ and :keyword."
(push (org-point-in-group p 0 :priority) clist)))
((org-at-item-p)
+ (push (org-point-in-group p 2 :item-bullet) clist)
(push (list :item (point-at-bol)
(save-excursion (org-end-of-item) (point)))
clist)
@@ -14961,7 +15919,19 @@ and :keyword."
(goto-char (1- (match-beginning 0)))
(if (looking-at org-radio-target-regexp)
(push (org-point-in-group p 0 :radio-target) clist))
- (goto-char p)))
+ (goto-char p))
+ ((setq o (car (delq nil
+ (mapcar
+ (lambda (x)
+ (if (memq x org-latex-fragment-image-overlays) x))
+ (org-overlays-at (point))))))
+ (push (list :latex-fragment
+ (org-overlay-start o) (org-overlay-end o)) clist)
+ (push (list :latex-preview
+ (org-overlay-start o) (org-overlay-end o)) clist))
+ ((org-inside-LaTeX-fragment-p)
+ ;; FIXME: positions wring.
+ (push (list :latex-fragment (point) (point)) clist)))
(setq clist (nreverse (delq nil clist)))
clist))
@@ -15012,6 +15982,7 @@ return nil."
;; In the paragraph separator we include headlines, because filling
;; text in a line directly attached to a headline would otherwise
;; fill the headline as well.
+ (set (make-local-variable 'comment-start-skip) "^#+[ \t]*")
(set (make-local-variable 'paragraph-separate) "\f\\|\\*\\|[ ]*$\\|[ \t]*[:|]")
;; The paragraph starter includes hand-formatted lists.
(set (make-local-variable 'paragraph-start)
@@ -15284,7 +16255,8 @@ When ENTRY is non-nil, show the entire entry."
(forward-char -1)
(if (memq (preceding-char) '(?\n ?\^M))
;; leave blank line before heading
- (forward-char -1))))))
+ (forward-char -1)))))
+ (point))
(defun org-show-subtree ()
"Show everything after this heading at deeper levels."
@@ -15336,9 +16308,8 @@ Show the heading too, if it is currently invisible."
;;; Experimental code
-
;;; Finish up
-
+
(provide 'org)
(run-hooks 'org-load-hook)
diff --git a/org.pdf b/org.pdf
index d3bdf5d..4c36a73 100644
--- a/org.pdf
+++ b/org.pdf
Binary files differ
diff --git a/org.texi b/org.texi
index c882058..26d0f25 100644
--- a/org.texi
+++ b/org.texi
@@ -3,7 +3,7 @@
@setfilename ../info/org
@settitle Org Mode Manual
-@set VERSION 4.37
+@set VERSION 4.40
@set DATE June 2006
@dircategory Emacs
@@ -83,9 +83,12 @@ Software Foundation raise funds for GNU development.''
* Timestamps:: Assign date and time to items
* Tags:: Tagging headlines and matching sets of tags
* Agenda views:: Collecting information into views
+* Embedded LaTeX:: LaTeX fragments and formulas
* Exporting:: Sharing and publishing of notes
* Publishing:: Create a web site of linked Org-mode files
* Miscellaneous:: All the rest which did not fit elsewhere
+* Extensions and Hacking:: It is possible to write add-on code
+* History and Acknowledgments:: How Org-mode came into being
* Index:: The fast road to specific information
* Key Index:: Key bindings and where they are described
@@ -95,7 +98,7 @@ Software Foundation raise funds for GNU development.''
Introduction
* Summary:: Brief summary of what Org-mode does
-* Installation and activation:: How to install Org-mode
+* Installation:: How to install Org-mode
* Feedback:: Bug reports, ideas, patches etc.
Document Structure
@@ -109,6 +112,11 @@ Document Structure
* Sparse trees:: Matches embedded in context
* Plain lists:: Editing hand-formatted lists
+Archiving
+
+* ARCHIVE tag:: Marking a tree as inactive
+* Moving subtrees:: Moving a tree to an archive file
+
Tables
* Built-in table editor:: Simple tables
@@ -162,7 +170,7 @@ Timestamps
Progress Logging
-* Closing items:: When was this entry makred DONE?
+* Closing items:: When was this entry marked DONE?
* Clocking work time:: When exactly did you work on this item?
Tags
@@ -188,6 +196,14 @@ The weekly/daily agenda
* Calendar/Diary integration:: Integrating Anniversaries and more
* Sorting of agenda items:: The order of things
+Embedded LaTeX
+
+* Math symbols:: TeX macros for symbols and Greek letters
+* Subscripts and Superscripts:: Simple syntax for raising/lowering text
+* LaTeX fragments:: Complex formulas made easy
+* Processing LaTeX fragments:: Previewing LaTeX processing
+* CDLaTeX mode:: Speed up entering of formulas
+
Exporting
* ASCII export:: Exporting to plain ASCII
@@ -211,7 +227,7 @@ Publishing
Configuration
* Project alist:: The central configuration variable
-* File sources and destinations:: From here to there
+* Sources and destinations:: From here to there
* Selecting files:: What files are part of the project?
* Publishing action:: Setting the function doing the publishing
* Publishing options:: Tweaking HTML export
@@ -227,21 +243,23 @@ Miscellaneous
* Completion:: M-TAB knows what you need
* Customization:: Adapting Org-mode to your taste
-* Summary of in-buffer settings:: Using special lines to set options
+* In-buffer settings:: Overview of the #+KEYWORDS
* The very busy C-c C-c key:: When in doubt, press C-c C-c
* Clean view:: Getting rid of leading stars in the outline
* TTY keys:: Using Org-mode on a tty
-* FAQ:: Frequently asked questions
* Interaction:: Other Emacs packages
* Bugs:: Things which do not work perfectly
-* Acknowledgments:: These people provided feedback and more
Interaction with other packages
-* Extensions:: Third-party extensions for Org-mode
* Cooperation:: Packages Org-mode cooperates with
* Conflicts:: Packages that lead to conflicts
+Extensions, Hooks and Hacking
+
+* Extensions:: Existing 3rd-part extensions
+* Dynamic blocks:: Automatically filled blocks
+
@end detailmenu
@end menu
@@ -251,11 +269,11 @@ Interaction with other packages
@menu
* Summary:: Brief summary of what Org-mode does
-* Installation and activation:: How to install Org-mode
+* Installation:: How to install Org-mode
* Feedback:: Bug reports, ideas, patches etc.
@end menu
-@node Summary, Installation and activation, Introduction, Introduction
+@node Summary, Installation, Introduction, Introduction
@section Summary
@cindex summary
@@ -296,14 +314,15 @@ example:
The Org-mode table editor can be integrated into any major mode by
activating the minor Orgtbl-mode.
+@cindex FAQ
There is a website for Org-mode which provides links to the newest
-version of Org-mode, as well as additional information, screen shots
-and example files. This page is located at
+version of Org-mode, as well as additional information, frequently asked
+questions (FAQ), links to tutorials etc. This page is located at
@uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
@page
-@node Installation and activation, Feedback, Summary, Introduction
+@node Installation, Feedback, Summary, Introduction
@section Installation and Activation
@cindex installation
@cindex autoload
@@ -341,6 +360,10 @@ them together with @file{org-install.el} on your load path. Then add to
(require 'org-install)
@end lisp
+If you use Org-mode with XEmacs, you also need to install the file
+@file{noutline.el} from the @file{xemacs} subdirectory of the Org-mode
+distribution.
+
@cindex org-mode, turning on
With this setup, all files with extension @samp{.org} will be put into
Org-mode. As an alternative, make the first line of a file look like
@@ -354,7 +377,7 @@ MY PROJECTS -*- mode: org; -*-
the file's name is. See also the variable
@code{org-insert-mode-line-in-empty-file}.
-@node Feedback, , Installation and activation, Introduction
+@node Feedback, , Installation, Introduction
@section Feedback
@cindex feedback
@cindex bug reports
@@ -614,26 +637,89 @@ functionality.
@node Archiving, Sparse trees, Structure editing, Document structure
@section Archiving
@cindex archiving
-@cindex filing subtrees
When a project represented by a (sub)tree is finished, you may want
-to move the tree to an archive place, either in the same file under a
-special top-level heading, or even to a different file.
+to move the tree out of the way and to stop it from contributing to the
+agenda. Org-mode knows two ways of archiving. You can mark a tree with
+the ARCHIVE tag, or you can move an entire (sub)tree to a different
+location.
+
+@menu
+* ARCHIVE tag:: Marking a tree as inactive
+* Moving subtrees:: Moving a tree to an archive file
+@end menu
+
+@node ARCHIVE tag, Moving subtrees, Archiving, Archiving
+@subsection The ARCHIVE tag
+@cindex internal archiving
+
+A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
+its location in the outline tree, but behaves in the following way:
+@itemize @minus
+@item
+It does not open when you attempt to do so with a visibility cycling
+command (@pxref{Visibility cycling}). You can still open it with a
+normal outline command like @code{show-all}. Or you can modify the
+option @code{org-cycle-open-archived-trees}.
+@item
+During sparse tree construction (@pxref{Sparse trees}), matches in
+archived subtrees are not exposed, unless you configure the option
+@code{org-sparse-tree-open-archived-trees}.
+@item
+During agenda view construction (@pxref{Agenda views}), the content of
+archived trees is ignored unless you configure the option
+@code{org-agenda-skip-archived-trees}.
+@item
+Archived trees are not exported (@pxref{Exporting}), only the headline
+is. Configure the details using the variable
+@code{org-export-with-archived-trees}.
+@end itemize
+
+The following commands allow to set or clear the ARCHIVE tag:
+
+@table @kbd
+@kindex C-c C-x C-a
+@item C-c C-x C-a
+Toggle the ARCHIVE tag for the current headline. When the tag is set,
+the headline changes to a shadowish face, and the subtree below it is
+hidden.
+@kindex C-u C-c C-x C-a
+@item C-u C-c C-x C-a
+Check if any direct children of the current headline should be archived.
+To do this, each subtree is checked for open TODO entries. If none are
+found, the command offers to set the ARCHIVE tag for the child. If the
+cursor is @emph{not} on a headline when this command is invoked, the
+level 1 trees will be checked.
+@end table
+
+@node Moving subtrees, , ARCHIVE tag, Archiving
+@subsection Moving subtrees
+@cindex external archiving
+
+Once an entire project is finished, you may want to move it to a
+different location, either in the current file, or even in a different
+file, the archive file.
+
@table @kbd
@kindex C-c $
-@item @kbd{C-c $}
+@item C-c $
Archive the subtree starting at the cursor position to the location
given by @code{org-archive-location}.
+@kindex C-u C-c $
+@item C-u C-c $
+Check if any direct children of the current headline could be moved to
+the archive. To do this, each subtree is checked for open TODO entries.
+If none are found, the command offers to move it to the archive
+location. If the cursor is @emph{not} on a headline when this command
+is invoked, the level 1 trees will be checked.
@end table
@cindex archive locations
-The default archive is a file in the same directory as the current
-file, with the name derived by appending @file{_archive} to the
-current file name. For information and examples on how to change
-this, see the documentation string of the variable
-@code{org-archive-location}. If you are also using the Org-mode
-agenda, archiving to a different file is a good way to keep archived
-trees from contributing agenda items.
+The default archive location is a file in the same directory as the
+current file, with the name derived by appending @file{_archive} to the
+current file name. For information and examples on how to change this,
+see the documentation string of the variable
+@code{org-archive-location}.
@node Sparse trees, Plain lists, Archiving, Document structure
@section Sparse trees
@@ -806,6 +892,7 @@ checkbox. Otherwise, if this is an ordered list, renumber the ordered
list at the cursor.
@end table
+
@node Tables, Hyperlinks, Document structure, Top
@chapter Tables
@cindex tables
@@ -1663,8 +1750,7 @@ selected words will form the basis of the search string. If the
automatically created link is not working correctly or accurately
enough, you can write custom functions to select the search string and
to do the search for particular file types - see @ref{Custom searches}.
-The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation
-and activation}.
+The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation}.
@kindex C-c C-l
@cindex link completion
@@ -1674,7 +1760,11 @@ and activation}.
Insert a link. This prompts for a link to be inserted into the buffer.
You can just type a link, using text for an internal link, or one of the
link type prefixes mentioned in the examples above. Through completion,
-all links stored during the current session can be accessed. The link
+all links stored during the current session can be
+accessed@footnote{After insertion of a stored link, the link will be
+removed from the list of stored links. To keep it in the list later
+use, use a triple @kbd{C-u} prefix to @kbd{C-c C-l}, or configure the
+option @code{org-keep-stored-link-after-insertion}.}. The link
will be inserted into the buffer, along with a descriptive text. Note
that you don't have to use this command to insert a link. Links in
Org-mode are plain text, and you can type or paste them straight into
@@ -1711,11 +1801,11 @@ When the cursor is on an internal link, this commands runs the
corresponding search. When the cursor is on a TAG list in a headline,
it creates the corresponding TAGS view. If the cursor is on a time
stamp, it compiles the agenda for that date. Furthermore, it will visit
-text files in @samp{file:} links with Emacs and select a suitable
-application for non-text files. Classification of files is based on
-file extension only. See option @code{org-file-apps}. If you want to
-override the default application and visit the file with Emacs, use a
-@kbd{C-u} prefix.
+text and remote files in @samp{file:} links with Emacs and select a
+suitable application for local non-text files. Classification of files
+is based on file extension only. See option @code{org-file-apps}. If
+you want to override the default application and visit the file with
+Emacs, use a @kbd{C-u} prefix.
@kindex mouse-2
@kindex mouse-1
@@ -2227,10 +2317,9 @@ brackets instead of angular brackets.
@item Time range with CLOCK keyword
@cindex CLOCK keyword
When using the clock to time the work that is being done on specific
-items, time ranges preceeded by the CLOCK keyword are inserted
+items, time ranges preceded by the CLOCK keyword are inserted
automatically into the file. The time stamps are enclosed in square
brackets instead of angular brackets. @xref{Clocking work time}.
-@c FIXME: Reference needed
@end table
@node Creating timestamps, Progress logging, Time stamps, Timestamps
@@ -2376,7 +2465,7 @@ items in a project by starting and stopping a clock when you start and
stop working on an aspect of a project.
@menu
-* Closing items:: When was this entry makred DONE?
+* Closing items:: When was this entry marked DONE?
* Clocking work time:: When exactly did you work on this item?
@end menu
@@ -2405,8 +2494,8 @@ each day, giving you an overview of what has been done on a day.
Org-mode allows you to clock the time you spent on specific tasks in a
project. When you start working on an item, you can start the clock.
-When you stop working on that tast, or when you makr the task done, the
-clock is stoppend and the corresponding time interval is recorded. It
+When you stop working on that task, or when you mark the task done, the
+clock is stopped and the corresponding time interval is recorded. It
also computes the total time spent on each subtree of a project.
@table @kbd
@@ -2435,6 +2524,22 @@ puts overlays at the end of each headline, showing the total time
recorded under that heading, including the time of any subheadings. You
can use visibility cycling to study the tree, but the overlays disappear
automatically when the buffer is changed.
+@kindex C-c C-x C-r
+@item C-c C-x C-r
+Insert a dynamic block containing a clock report as an org-mode table
+into the current file.
+@example
+#+BEGIN: clocktable :maxlevel 2 :emphasize nil
+
+#+END: clocktable
+@end example
+@noindent
+If such a block already exists, its content is replaced by the new
+table. The @samp{BEGIN} line can specify options:
+@example
+:maxlevels @r{Maximum level depth to which times are listed in the table.}
+:emphasize @r{When @code{t}, emphasize level one and level two items}
+@end example
@end table
The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
@@ -2612,7 +2717,7 @@ tagged @samp{:WORK:} or @samp{:LAPTOP:}. The string
@samp{WORK|LAPTOP&NIGHT} requires that the @samp{:LAPTOP:} lines are
also tagged @samp{NIGHT}.
-@node Agenda views, Exporting, Tags, Top
+@node Agenda views, Embedded LaTeX, Tags, Top
@chapter Agenda Views
@cindex agenda views
@@ -2693,12 +2798,11 @@ to visit any of them.
@cindex custom agenda commands
@cindex agenda commands, custom
The views are created through a dispatcher that should be bound to a
-global key, for example @kbd{C-c a} (@pxref{Installation and
-activation}). In the following we will assume that @kbd{C-c a} is
-indeed how the dispatcher is accessed and list keyboard access to
-commands accordingly. After pressing @kbd{C-c a}, an additional
-letter is required to execute a command. The dispatcher offers the
-following default commands:
+global key, for example @kbd{C-c a} (@pxref{Installation}). In the
+following we will assume that @kbd{C-c a} is indeed how the dispatcher
+is accessed and list keyboard access to commands accordingly. After
+pressing @kbd{C-c a}, an additional letter is required to execute a
+command. The dispatcher offers the following default commands:
@table @kbd
@item a
Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
@@ -3092,6 +3196,10 @@ inheritance, this may be more than the tags listed in the line itself.
@item :
Set tags for the current headline.
+@kindex a
+@item a
+Toggle the ARCHIVE tag for the current headline.
+
@kindex ,
@item ,
Set the priority for the current item. Org-mode prompts for the
@@ -3208,7 +3316,206 @@ visit org files will not be removed.
@end table
-@node Exporting, Publishing, Agenda views, Top
+@node Embedded LaTeX, Exporting, Agenda views, Top
+@chapter Embedded LaTeX
+@cindex @TeX{} interpretation
+@cindex La@TeX{} interpretation
+
+Plain ASCII is normally sufficient for almost all note taking. One
+exception, however, are scientific notes which need to be able to
+contain mathematical symbols and the occasional formula.
+La@TeX{}@footnote{La@TeX{} is a macro system based on Donald E. Knuth's
+@TeX{} system. Many of the features described here as ``La@TeX{}'' are
+really from @TeX{}, but for simplicity I am blurring this distinction.}
+is widely used to typeset scientific documents. Org-mode supports
+embedding La@TeX{} code into its files, because many academics are used
+to read La@TeX{} source code, and because it can be readily processed
+into images for HTML production.
+
+It is not necessary to mark La@TeX{} macros and code in any special way.
+If you observe a few conventions, Org-mode knows how to find it and what
+to do with it.
+
+@menu
+* Math symbols:: TeX macros for symbols and Greek letters
+* Subscripts and Superscripts:: Simple syntax for raising/lowering text
+* LaTeX fragments:: Complex formulas made easy
+* Processing LaTeX fragments:: Previewing LaTeX processing
+* CDLaTeX mode:: Speed up entering of formulas
+@end menu
+
+@node Math symbols, Subscripts and Superscripts, Embedded LaTeX, Embedded LaTeX
+@section Math symbols
+
+You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
+to indicate the Greek letter, or @samp{\to} to indicate an arrow.
+Completion for these macros is available, just type @samp{\} and maybe a
+few letters, and press @kbd{M-@key{TAB}} to see possible completions.
+Unlike La@TeX{} code, Org-mode allows these macros to be present
+without surrounding math delimiters, for example:
+
+@example
+Angles are written as Greek letters \alpha, \beta and \gamma.
+@end example
+
+During HTML export (@pxref{HTML export}), these symbols are translated
+into the proper syntax for HTML, for the above examples this is
+@samp{&alpha;} and @samp{&rarr;}, respectively.
+
+@node Subscripts and Superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
+@section Subscripts and Superscripts
+
+Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
+and subscripts. Again, these can be used without embedding them in
+math-mode delimiters. To increase the readability of ASCII text, it is
+not necessary (but OK) to surround multi-character sub- and superscripts
+with curly braces. For example
+
+@example
+The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
+the sun is R_@{sun@} = 6.96 x 10^8 m.
+@end example
+
+To avoid interpretation as raised or lowered text, you can quote
+@samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
+
+During HTML export (@pxref{HTML export}), subscript and superscripts
+are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
+
+@node LaTeX fragments, Processing LaTeX fragments, Subscripts and Superscripts, Embedded LaTeX
+@section LaTeX fragments
+
+With symbols, sub- and superscripts, HTML is pretty much at its end when
+it comes to representing mathematical formulas. More complex
+expressions need a dedicated formula processor. To this end, Org-mode
+can contain arbitrary La@TeX{} fragments. It provides commands to
+preview the typeset result of these fragments, and upon export to HTML,
+all fragments will be converted to images and inlined into the HTML
+document. For this to work you need to be on a system with a working
+La@TeX{} installation. You also need the @file{dvipng} program,
+available at @url{http://sourceforge.net/projects/dvipng/}.
+
+La@TeX{} fragments don't need any special marking at all. The following
+snippets will be identified as LaTeX source code:
+@itemize @bullet
+@item
+Environments of any kind. The only requirement is that the
+@code{\begin} statement appears on a new line, preceded by only
+whitespace.
+@item
+Text within the usual La@TeX{} math delimiters. To avoid conflicts with
+currency specifications, single @samp{$} characters are only recognized
+as math delimiters if the enclosed text contains at most two line breaks,
+is directly attached to the @samp{$} characters with no whitespace in
+between, and if the closing @samp{$} is followed by whitespace or
+punctuation. For the other delimiters, there is no such restriction, so
+when in doubt, use @samp{\(...\)} as inline math delimiters.
+@end itemize
+
+@noindent For example:
+
+@example
+\begin@{equation@} % arbitrary environments,
+x=\sqrt@{b@} % even tables, figures
+\end@{equation@} % etc
+
+If $a^2=b$ and \( b=2 \), then the solution must be
+either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
+@end example
+
+@noindent
+If you need any of the delimiter ASCII sequences for other purposes, you
+can configure the option @code{org-format-latex-options} to deselect the
+ones you do not wish to have interpreted by the La@TeX{} converter.
+
+@node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
+@section Processing LaTeX fragments
+
+La@TeX{} fragments can be processed to produce a preview images of the
+typeset expressions:
+
+@table @kbd
+@kindex C-c C-x C-l
+@item C-c C-x C-l
+Produce a preview image of the La@TeX{} fragment at point and overlay it
+over the source code. If there is no fragment at point, process all
+fragments in the current entry (between two headlines). When called
+with a prefix argument, process the entire subtree. When called with
+two prefix arguments, or when the cursor is before the first headline,
+process the entire buffer.
+@kindex C-c C-c
+@item C-c C-c
+Remove the overlay preview images.
+@end table
+
+During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
+converted into images and inlined into the document if the following
+setting is active:
+
+@lisp
+(setq org-export-with-LaTeX-fragments t)
+@end lisp
+
+@node CDLaTeX mode, , Processing LaTeX fragments, Embedded LaTeX
+@section Using CDLaTeX to enter math
+
+CDLaTeX-mode is a minor mode that is normally used in combination with a
+major LaTeX mode like AUCTeX in order to speed-up insertion of
+environments and math templates. Inside Org-mode, you can make use of
+some of the features of cdlatex-mode. You need to install
+@file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
+AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
+Don't turn cdlatex-mode itself under Org-mode, but use the light
+version @code{org-cdlatex-mode} that comes as part of Org-mode. Turn it
+on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
+Org-mode files with
+
+@lisp
+(add-hook 'org-mode-hook 'turn-on-org-cdlatex)
+@end lisp
+
+When this mode is enabled, the following features are present (for more
+details see the documentation of cdlatex-mode):
+@itemize @bullet
+@kindex C-c @{
+@item
+Environment templates can be inserted with @kbd{C-c @{}.
+@item
+@kindex @key{TAB}
+The @key{TAB} key will do template expansion if the cursor is inside a
+LaTeX fragment@footnote{Org-mode has a method to test if the cursor is
+inside such a fragment, see the documentation of the function
+@code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
+expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
+correctly inside the first brace. Another @key{TAB} will get you into
+the second brace. Even outside fragments, @key{TAB} will expand
+environment abbreviations at the beginning of a line. For example, if
+you write @samp{equ} at the beginning of a line and press @key{TAB},
+this abbreviation will be expanded to an @code{equation} environment.
+To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
+@item
+@kindex _
+@kindex ^
+Pressing @kbd{_} and @kbd{^} inside a LaTeX fragment will insert these
+characters together with a pair of braces. If you use @key{TAB} to move
+out of the braces, and if the braces surround only a single character or
+macro, they are removed again (depending on the variable
+@code{cdlatex-simplify-sub-super-scripts}).
+@item
+@kindex `
+Pressing the backquote @kbd{`} followed by a character inserts math
+macros, also outside LaTeX fragments. If you wait more than 1.5 seconds
+after the backquote, a help window will pop up.
+@item
+@kindex '
+Pressing the normal quote @kbd{'} followed by another character modifies
+the symbol before point with an accent or a font. If you wait more than
+1.5 seconds after the backquote, a help window will pop up. Character
+modification will work only inside La@TeX{} fragments, outside the quote
+is normal.
+@end itemize
+
+@node Exporting, Publishing, Embedded LaTeX, Top
@chapter Exporting
@cindex exporting
@@ -3269,8 +3576,8 @@ at a different level, specify it with a prefix argument. For example,
creates only top level headlines and does the rest as items. When
headlines are converted to items, the indentation of the text following
the headline is changed to fit nicely under the item. This is done with
-the assumption that the first bodyline indicates the base indenation of
-the body text. Any indenation larger than this is adjusted to preserve
+the assumption that the first bodyline indicates the base indentation of
+the body text. Any indentation larger than this is adjusted to preserve
the layout relative to the first line. Should there be lines with less
indentation than the first, these are left alone.
@@ -3470,7 +3777,6 @@ formatting, this is true in particular for the HTML backend. Org-mode
has a number of typing conventions that allow to produce a richly
formatted output.
-
@itemize @bullet
@cindex hand-formatted lists
@@ -3484,22 +3790,14 @@ backend supports lists. See @xref{Plain lists}.
@cindex bold text
@cindex italic text
@item
-You can make words @b{*bold*}, @i{/italic/}, and _underlined_
+You can make words @b{*bold*}, @i{/italic/}, _underlined_,
+@code{=code=}, and @samp{+strikethrough+}.
-@cindex @TeX{} interpretation
+@cindex LaTeX fragments, export
+@cindex TeX macros, export
@item
-Simple @TeX{}-like math constructs are interpreted:
-
-@cindex completion, of @TeX{} symbols
-@itemize @minus
-@item
-@samp{10^22} and @samp{J_n} are super- and subscripts. You can quote
-@samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}
-@item
-@samp{\alpha} indicates a Greek letter, @samp{\to} an arrow. You can
-use completion for these macros, just type @samp{\} and maybe a few
-letters, and press @kbd{M-@key{TAB}} to see possible completions.
-@end itemize
+Many @TeX{} macros and entire La@TeX{} fragments are converted into HTML
+entities or images (@pxref{Embedded LaTeX}).
@cindex tables, export
@item
@@ -3531,6 +3829,7 @@ customization group @code{org-export-general}, and the following section
which explains how to set export options with special lines in a
buffer.
+
@node Export options, , Enhancing text, Text interpretation
@subsection Export options
@cindex options, for export
@@ -3556,7 +3855,7 @@ Insert template with export options, see example below.
#+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
#+TEXT: Some descriptive text to be inserted at the beginning.
#+TEXT: Several lines may be given.
-#+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:nil TeX:t
+#+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t *:nil TeX:t LaTeX:t
@end example
@noindent
@@ -3572,6 +3871,7 @@ you can:
@cindex @TeX{}-like syntax for sub- and superscripts
@cindex emphasized text
@cindex @TeX{} macros
+@cindex La@TeX{} fragments
@example
H: @r{set the number of headline levels for export}
num: @r{turn on/off section-numbers}
@@ -3582,11 +3882,13 @@ toc: @r{turn on/off table of contents}
|: @r{turn on/off tables}
^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts.}
*: @r{turn on/off emphasized text (bold, italic, underlined)}
-TeX: @r{turn on/off @TeX{} macros}
+TeX: @r{turn on/off simple @TeX{} macros in plain text}
+LaTeX: @r{turn on/off La@TeX{} fragments}
@end example
@node Publishing, Miscellaneous, Exporting, Top
@chapter Publishing
+@cindex publishing
Org-mode includes@footnote{@file{org-publish.el} is not yet part of
emacs, so if you are using @file{org.el} as it comes with Emacs, you
@@ -3615,7 +3917,7 @@ and many other properties of a project.
@menu
* Project alist:: The central configuration variable
-* File sources and destinations:: From here to there
+* Sources and destinations:: From here to there
* Selecting files:: What files are part of the project?
* Publishing action:: Setting the function doing the publishing
* Publishing options:: Tweaking HTML export
@@ -3623,8 +3925,10 @@ and many other properties of a project.
* Project page index:: Publishing a list of project files
@end menu
-@node Project alist, File sources and destinations, Configuration, Configuration
+@node Project alist, Sources and destinations, Configuration, Configuration
@subsection The variable @code{org-publish-project-alist}
+@cindex org-publish-project-alist
+@cindex projects, for publishing
Org-publish is configured almost entirely through setting the value of
one variable, called @code{org-publish-project-alist}.
@@ -3649,8 +3953,9 @@ project, which group together files requiring different publishing
options. When you publish such a ``meta-project'' all the components
will also publish.
-@node File sources and destinations, Selecting files, Project alist, Configuration
+@node Sources and destinations, Selecting files, Project alist, Configuration
@subsection Sources and destinations for files
+@cindex directories, for publishing
Most properties are optional, but some should always be set. In
particular, org-publish needs to know where to look for source files,
@@ -3664,8 +3969,9 @@ and where to put published files.
@end multitable
@noindent
-@node Selecting files, Publishing action, File sources and destinations, Configuration
+@node Selecting files, Publishing action, Sources and destinations, Configuration
@subsection Selecting files
+@cindex files, selecting for publishing
By default, all files with extension @file{.org} in the base directory
are considered part of the project. This can be modified by setting the
@@ -3687,6 +3993,7 @@ and @code{:exclude}.
@node Publishing action, Publishing options, Selecting files, Configuration
@subsection Publishing Action
+@cindex action, for publishing
Publishing means that a file is copied to the destination directory and
possibly transformed in the process. The default transformation is to
@@ -3711,6 +4018,7 @@ provides one for attachments (files that only need to be copied):
@node Publishing options, Publishing links, Publishing action, Configuration
@subsection Options for the HTML exporter
+@cindex options, for publishing
The property list can be used to set many export options for the HTML
exporter. In most cases, these properties correspond to user variables
@@ -3723,9 +4031,11 @@ respective variable for details.
@item @code{:headline-levels} @tab @code{org-export-headline-levels}
@item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
@item @code{:table-of-contents} @tab @code{org-export-with-toc}
+@item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
@item @code{:emphasize} @tab @code{org-export-with-emphasize}
@item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
@item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
+@item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
@item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
@item @code{:timestamps} .@tab @code{org-export-with-timestamps}
@item @code{:tags} .@tab @code{org-export-with-tags}
@@ -3752,6 +4062,7 @@ options}), however, override everything.
@node Publishing links, Project page index, Publishing options, Configuration
@subsection Links between published files
+@cindex links, publishing
To create a link from one Org-mode file to another, you would use
something like @samp{[[file:foo.org][The foo]]} or simply
@@ -3765,8 +4076,27 @@ careful with relative pathnames, and provided you have also configured
org-publish to upload the related files, these links will work
too. @ref{Complex example} for an example of this usage.
+Sometime an Org-mode file to be published may contain links that are
+only valid in your production environment, but not in the publishing
+location. In this case, use the property
+
+@multitable @columnfractions 0.4 0.6
+@item @code{:link-validation-function}
+@tab Function to validate links
+@end multitable
+
+@noindent
+to define a function for checking link validity. This function must
+accept two arguments, the file name and a directory relative to which
+the file name is interpreted in the production environment. If this
+function returns @code{nil}, then the HTML generator will only insert a
+description into the HTML file, but no link. One option for this
+function is @code{org-publish-validate-link} which checks if the given
+file is part of any project in @code{org-publish-project-alist}.
+
@node Project page index, , Publishing links, Configuration
@subsection Project page index
+@cindex index, of published pages
The following properties may be used to control publishing of an
index of files or summary page for a given project.
@@ -3891,20 +4221,18 @@ Org uses timestamps to track when a file has changed. The above
functions normally only publish changed files. You can override this and
force publishing of all files by giving a prefix argument.
-@node Miscellaneous, Index, Publishing, Top
+@node Miscellaneous, Extensions and Hacking, Publishing, Top
@chapter Miscellaneous
@menu
* Completion:: M-TAB knows what you need
* Customization:: Adapting Org-mode to your taste
-* Summary of in-buffer settings:: Using special lines to set options
+* In-buffer settings:: Overview of the #+KEYWORDS
* The very busy C-c C-c key:: When in doubt, press C-c C-c
* Clean view:: Getting rid of leading stars in the outline
* TTY keys:: Using Org-mode on a tty
-* FAQ:: Frequently asked questions
* Interaction:: Other Emacs packages
* Bugs:: Things which do not work perfectly
-* Acknowledgments:: These people provided feedback and more
@end menu
@node Completion, Customization, Miscellaneous, Miscellaneous
@@ -3950,8 +4278,7 @@ Elsewhere, complete dictionary words using ispell.
@end itemize
@end table
-
-@node Customization, Summary of in-buffer settings, Completion, Miscellaneous
+@node Customization, In-buffer settings, Completion, Miscellaneous
@section Customization
@cindex customization
@cindex options, for customization
@@ -3963,9 +4290,9 @@ describing the variables here. A structured overview of customization
variables is available with @kbd{M-x org-customize}. Or select
@code{Browse Org Group} from the @code{Org->Customization} menu. Many
settings can also be activated on a per-file basis, by putting special
-lines into the buffer (@pxref{Summary of in-buffer settings}).
+lines into the buffer (@pxref{In-buffer settings}).
-@node Summary of in-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
+@node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
@section Summary of in-buffer settings
@cindex in-buffer settings
@cindex special keywords
@@ -4035,7 +4362,7 @@ These lines provide settings for exporting files. For more details see
@ref{Export options}.
@end table
-@node The very busy C-c C-c key, Clean view, Summary of in-buffer settings, Miscellaneous
+@node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
@section The very busy C-c C-c key
@kindex C-c C-c
@@ -4043,14 +4370,13 @@ The key @kbd{C-c C-c} has many purposes in org-mode, which are all
mentioned scattered throughout this manual. One specific function of
this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
other circumstances it means something like @emph{Hey Org-mode, look
-here and update according to what you see here}. Here is a summary of what
-this means in different contexts.
+here and update according to what you see here}. Here is a summary of
+what this means in different contexts.
@itemize @minus
-@c @item
-@c If the cursor is in a headline, prompt for tags and insert them
-@c into the current line, aligned to `org-tags-column'. When called
-@c with prefix arg, realign all tags in the current buffer.
+@item
+If there are highlights in the buffer from the creation of a sparse
+tree, or from clock display, remove these highlights.
@item
If the cursor is in one of the special @code{#+KEYWORD} lines, this
triggers scanning the buffer for these lines and updating the
@@ -4180,7 +4506,7 @@ double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
RET} in that file. The reverse operation is @kbd{M-x
org-convert-to-oddeven-levels}.
-@node TTY keys, FAQ, Clean view, Miscellaneous
+@node TTY keys, Interaction, Clean view, Miscellaneous
@section Using org-mode on a tty
@cindex tty keybindings
@@ -4217,251 +4543,19 @@ rather use @kbd{C-c .} to re-insert the timestamp.
@item @kbd{S-@key{down}} @tab @kbd{C-c C-x @key{down}} @tab
@end multitable
-@node FAQ, Interaction, TTY keys, Miscellaneous
-@section Frequently asked questions
-@cindex FAQ
-
-@enumerate
-@cindex @code{keymapp nil} error
-@item @b{When I try to use Org-mode, I always get
-@code{(wrong-type-argument keymapp nil)}}.@*
-@cindex allout.el, conflict with
-This is a conflict with an outdated version of the @file{allout.el}.
-See @ref{Conflicts}.
-
-@item @b{Org-mode seems to be a useful default mode for the various
-@file{README} files I have scattered through my directories. How do I
-turn it on for all @file{README} files?}
-
-@lisp
-(add-to-list 'auto-mode-alist '("README$" . org-mode))
-@end lisp
-
-@item @b{I would like to use editing features of org-mode in other
-modes, is this possible?}@*
-@c
-Not really. For tables there is @code{orgtbl-mode} which implements the
-table editor as a minor mode. For other features you need to switch to
-Org-mode temporarily, or prepare text in a different buffer.
-
-@item @b{Can I get the visibility-cycling features in outline-mode and
-outline-minor-mode?}@*
-@c
-Yes, these functions are written in a way that they are independent of
-the outline setup. The following setup provides standard Org-mode
-functionality in outline-mode on @key{TAB} and @kbd{S-@key{TAB}}. For
-outline-minor-mode, we use @kbd{C-@key{TAB}} instead of @key{TAB},
-because @key{TAB} usually has mode-specific tasks.
-@lisp
-(add-hook 'outline-minor-mode-hook
- (lambda ()
- (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
- (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
-(add-hook 'outline-mode-hook
- (lambda ()
- (define-key outline-mode-map [(tab)] 'org-cycle)
- (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
-@end lisp
-
-Or check out @file{outline-magic.el}, which does this and also provides
-promotion and demotion functionality. @file{outline-magic.el} is
-available at @url{http://www.astro.uva.nl/~dominik/Tools/OutlineMagic}.
-
-@item @b{Some of my links stopped working after I upgraded to a version
-4.20 or later. Why is this, and how can I fix it?}@*
-@c
-These must be links in plain text, containing white space, such as
-@samp{bbdb:Richard Stallman}. You need to protect these links by
-putting double brackets around them, like @samp{[[bbdb:Richard
-Stallman]]}.
-
-@item @b{I see that Org-mode now creates links using the double bracket
-convention that hides the link part and the brackets, only showing the
-description part. How can I convert my old links to this new format?}@*
-@c
-Execute once in each Org-mode file: @kbd{M-x org-upgrade-old-links}.
-This replaces angular brackets with the new link format.
-
-@item @b{I don't care if you find the new bracket links great, I am
-attached to the old style using angular brackets and no hiding of the
-link text. Please give them back to me, don't tell me it is not
-possible!}@*
-@c
-Would I let you down like that? If you must, you can do this
-
-@lisp
-(setq org-link-style 'plain
- org-link-format "<%s>")
-@end lisp
-
-@item @b{When I am executing shell/elisp links I always get a
-confirmation prompt and need to type @kbd{yes @key{RET}}, that's 4 key
-presses! Can I get rid of this?}@*
-@c
-@cindex shell links, confirmation
-@cindex dangerous commands
-The confirmation is there to protect you from unwantingly execute
-potentially dangerous commands. For example, imagine a link
-@samp{[[shell:rm -rf ~/*][Google Search]]}. In an Org-mode buffer, this
-command would look like @samp{Google Search}, but really it would remove
-your home directory. If you wish, you can make it easier to respond to
-the query by setting @code{org-confirm-shell-link-function} and/or
-@code{org-confirm-elisp-link-function} to @code{y-or-n-p}. Then a
-single @kbd{y} keypress will be enough to confirm those links. It is
-also possible to turn off this check entirely, but I do not recommend to
-do this. Be warned.
-
-@item @b{All these stars are driving me mad, I just find the Emacs
-outlines unreadable. Can't you just put white space and a single star as a
-starter for headlines?}@*
-@c
-See @ref{Clean view}.
-
-@item @b{I would like to have two windows on the same Org-mode
-file, but with different outline visibility. Is that possible?}@*
-@c
-@cindex @code{make-indirect-buffer}
-@cindex indirect buffers
-In GNU Emacs, you may use @emph{indirect buffers} which do exactly this.
-See the documentation on the command @code{make-indirect-buffer}. In
-XEmacs, this is currently not possible because of the different outline
-implementation.
-
-@item @b{When I export my TODO list, every TODO item becomes a
-separate section. How do I enforce these items to be exported as an
-itemized list?}@*
-@c
-If you plan to use ASCII or HTML export, make sure things you want to
-be exported as item lists are level 4 at least, even if that does mean
-there is a level jump. For example:
-
-@example
-* Todays top priorities
-**** TODO write a letter to xyz
-**** TODO Finish the paper
-**** Pick up kids at the school
-@end example
-
-Alternatively, if you need a specific value for the heading/item
-transition in a particular file, use the @samp{+OPTIONS} line to
-configure the @samp{H} switch.
-
-@example
-+OPTIONS: H:2; ...
-@end example
-
-@item @b{I would like to export only a subtree of my file to HTML.
-How?}@*
-@c
-@cindex exporting a subtree
-If you want to export a subtree, mark the subtree as region and then
-export. Marking can be done with @kbd{C-c @@ C-x C-x}, for example.
-
-@item @b{Org-mode takes over the S-cursor keys. I also want to use
-CUA-mode, is there a way to fix this conflict?}@*
-Yes, see @ref{Conflicts}.
-
-@item @b{One of my table columns has started to fill up with
-@samp{#ERROR}. What is going on?}@*
-@c
-Org-mode tried to compute the column from other fields using a
-formula stored in the @samp{#+TBLFM:} line just below the table, and
-the evaluation of the formula fails. Fix the fields used in the
-formula, or fix the formula, or remove it!
-
-@item @b{When I am in the last column of a table and just above a
-horizontal line in the table, pressing TAB creates a new table line
-@i{before} the horizontal line. How can I quickly move to the line
-@i{below} the horizontal line instead?}@*
-@c
-Press @key{down} (to get on the separator line) and then @key{TAB}.
-Or configure the variable @code{org-table-tab-jumps-over-hlines}.
-
-@item @b{How can I change the indentation of an entire table without
-fixing every line by hand?}@*
-@c
-@cindex indentation, of tables
-The indentation of a table is set by the first line. So just fix the
-indentation of the first line and realign with @key{TAB}.
-
-@item @b{Is it possible to include entries from org-mode files into my
-emacs diary?}@*
-@c
-Since the org-mode agenda is much more powerful and can contain the
-diary (@pxref{Calendar/Diary integration}), you should think twice
-before deciding to do this. Integrating Org-mode information into the
-diary is, however, possible. You need to turn on @emph{fancy diary
-display} by setting in @file{.emacs}:
-
-@lisp
-(add-hook 'diary-display-hook 'fancy-diary-display)
-@end lisp
-
-Then include the following line into your @file{~/diary} file, in
-order to get the entries from all files listed in the variable
-@code{org-agenda-files}:
-
-@example
-&%%(org-diary)
-@end example
-@noindent
-You may also select specific files with
-
-@example
-&%%(org-diary) ~/path/to/some/org-file.org
-&%%(org-diary) ~/path/to/another/org-file.org
-@end example
-
-If you now launch the calendar and press @kbd{d} to display a diary, the
-headlines of entries containing a timestamp, date range, schedule, or
-deadline referring to the selected date will be listed. Just like
-Org-mode's agenda view, the diary for @emph{today} contains additional
-entries for overdue deadlines and scheduled items. See also the
-documentation of the @command{org-diary} function. Under XEmacs, it is
-not possible to jump back from the diary to the org, this works only in
-the agenda buffer.
-
-@end enumerate
-
-
-@node Interaction, Bugs, FAQ, Miscellaneous
+@node Interaction, Bugs, TTY keys, Miscellaneous
@section Interaction with other packages
@cindex packages, interaction with other
Org-mode lives in the world of GNU Emacs and interacts in various ways
with other code out there.
@menu
-* Extensions:: Third-party extensions for Org-mode
* Cooperation:: Packages Org-mode cooperates with
* Conflicts:: Packages that lead to conflicts
@end menu
-@node Extensions, Cooperation, Interaction, Interaction
-@subsection Third-party extensions for Org-mode
-
-The following extensions for Org-mode have been written by other people:
-
-@table @asis
-@cindex @file{org-mouse.el}
-@item @file{org-mouse.el} by Piotr Zielinski
-This package implements extended mouse functionality for Org-mode. It
-allows you to cycle visibility and to edit the document structure with
-the mouse. Best of all, it provides a context-sensitive menu on
-@key{mouse-3} that changes depending on the context of a mouse-click.
-@file{org-mouse.el} is freely available at @url{http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el}.
-@cindex @file{org-publish.el}
-@item @file{org-publish.el} by David O'Toole
-This package provides facilities for publishing related sets of Org-mode
-files together with linked files like images as a webpages. It is
-highly configurable and can be used for other publishing purposes as
-well. As of Org-mode version 4.30, @file{org-publish.el} is part of
-the Org-mode distribution. It is not yet part of Emacs, however, due to
-a pending copyright assignment. In the mean time, @file{org-publish.el}
-can be downloaded from David's site:
-@url{http://dto.freeshell.org/e/org-publish.el}.
-@end table
-@node Cooperation, Conflicts, Extensions, Interaction
+@node Cooperation, Conflicts, Interaction, Interaction
@subsection Packages that Org-mode cooperates with
@table @asis
@@ -4487,6 +4581,11 @@ at @url{http://www.astro.uva.nl/~dominik/Tools}. Org-mode checks for
the function @code{constants-get}, which has to be autoloaded in your
setup. See the installation instructions in the file
@file{constants.el}.
+@item @file{cdlatex.el} by Carsten Dominik
+@cindex @file{cdlatex.el}
+Org-mode can make use of the cdlatex package to efficiently enter
+La@TeX{} fragments into Org-mode files.
+@file{cdlatex.el} is not part of Emacs, find it on the web.
@item @file{remember.el} by John Wiegley
@cindex @file{remember.el}
Org mode cooperates with remember, see @ref{Remember}.
@@ -4538,7 +4637,7 @@ in the paragraph above about CUA mode also applies here.
@end table
-@node Bugs, Acknowledgments, Interaction, Miscellaneous
+@node Bugs, , Interaction, Miscellaneous
@section Bugs
@cindex bugs
@@ -4564,10 +4663,6 @@ When the application called by @kbd{C-c C-o} to open a file link fails
(for example because the application does not exist or refuses to open
the file), it does so silently. No error message is displayed.
@item
-Plain list items should be able to hold a TODO item. Unfortunately this
-has so many technical problems that I will only consider this change for
-the next major release (5.0).
-@item
The remote-editing commands in the agenda buffer cannot be undone with
@code{undo} called from within the agenda buffer. But you can go to
the corresponding buffer (using @key{TAB} or @key{RET} and execute
@@ -4577,22 +4672,144 @@ Recalculating a table line applies the formulas from left to right.
If a formula uses @emph{calculated} fields further down the row,
multiple recalculation may be needed to get all fields consistent.
@item
-Several words in a row may @b{*be made bold*}, but this does not work if
-the string is distributed over two lines.
+A single letter cannot be made bold, for example @samp{*a*}.
@item
The exporters work well, but could be made more efficient.
@end itemize
-@node Acknowledgments, , Bugs, Miscellaneous
-@section Acknowledgments
+
+@node Extensions and Hacking, History and Acknowledgments, Miscellaneous, Top
+@appendix Extensions, Hooks and Hacking
+
+This appendix lists extensions for Org-mode written by other authors.
+It also covers some aspects where users can easily extend the
+functionality of Org-mode.
+
+@menu
+* Extensions:: Existing 3rd-part extensions
+* Dynamic blocks:: Automatically filled blocks
+@end menu
+
+@node Extensions, Dynamic blocks, Extensions and Hacking, Extensions and Hacking
+@section Third-party extensions for Org-mode
+
+The following extensions for Org-mode have been written by other people:
+
+@table @asis
+@cindex @file{org-mouse.el}
+@item @file{org-mouse.el} by Piotr Zielinski
+This package implements extended mouse functionality for Org-mode. It
+allows you to cycle visibility and to edit the document structure with
+the mouse. Best of all, it provides a context-sensitive menu on
+@key{mouse-3} that changes depending on the context of a mouse-click.
+@file{org-mouse.el} is freely available at @url{http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el}.
+@cindex @file{org-publish.el}
+@item @file{org-publish.el} by David O'Toole
+This package provides facilities for publishing related sets of Org-mode
+files together with linked files like images as a webpages. It is
+highly configurable and can be used for other publishing purposes as
+well. As of Org-mode version 4.30, @file{org-publish.el} is part of the
+Org-mode distribution. It is not yet part of Emacs, however, a delay
+caused by the preparations for the 22.1 release. In the mean time,
+@file{org-publish.el} can be downloaded from David's site:
+@url{http://dto.freeshell.org/e/org-publish.el}.
+@cindex @file{org-blog.el}
+@item @file{org-blog.el} by David O'Toole
+A blogging plug-in for @file{org-publish.el}.
+@url{http://dto.freeshell.org/notebook/OrgMode.html}.
+@cindex @file{org-blogging.el}
+@item @file{org-blogging.el} by Bastien Guerry
+Publish Org-mode files as
+blogs. @url{http://www.cognition.ens.fr/~guerry/org-blogging.html}.
+@end table
+
+@node Dynamic blocks, , Extensions, Extensions and Hacking
+@section Dynamic blocks
+
+Org-mode documents can contain @emph{dynamic blocks}. These are
+specially marked regions that are updates by some user-written
+function. A good example for such a block is the clock table inserted
+by the command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
+
+Dynamic block are enclosed by a BEGIN-END structure that assigns a name
+to the block and can also specify parameters for the function producing
+the content of the block.
+
+@example
+#+BEGIN: myblock :parameter1 value1 :parameter2 value2 .....
+
+#+END:
+@end example
+
+Dynamic blocks are updated with the following commands
+
+@table @kbd
+@kindex C-c C-x C-u
+@item C-c C-x C-u
+Update dynamic block at point.
+@kindex C-u C-c C-x C-u
+@item C-u C-c C-x C-u
+Update all dynamic blocks in the current file.
+@end table
+
+Updating a dynamic block means to remove all the text between BEGIN and
+END, parse the BEGIN line for parameters and then call the specific
+writer function for this block to insert the new content. For a block
+with name @code{myblock}, the writer function is
+@code{org-dblock-write:myblock} with as only parameter a property list
+with the parameters given in the begin line. Here is a trivial example
+of a block that keeps track of when the block update function was last
+run:
+
+@example
+#+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
+
+#+END:
+@end example
+
+@noindent
+The corresponding block writer function could look like this:
+
+@lisp
+(defun org-dblock-write:date-and-time (params)
+ (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
+ (insert "Last block update at: "
+ (format-time-string fmt (current-time)))))
+@end lisp
+
+If you want to make sure that all dynamic blocks are always up-to-date,
+you could add the function @code{org-update-all-dblocks} to a hook, for
+example @code{before-save-hook}. @code{org-update-all-dblocks} is
+written in a way that is does nothing in buffers that are not in Org-mode.
+
+
+@node History and Acknowledgments, Index, Extensions and Hacking, Top
+@appendix History and Acknowledgments
@cindex acknowledgments
+@cindex history
@cindex thanks
-Org-mode was created by @value{AUTHOR}, who still maintains it at the
-Org-mode homepage @uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
-The following people (in alphabetic order) have helped the development
-along with ideas, suggestions and patches. Many thanks to all of you,
-Org-mode would not be what it is without your input.
+The beginnings of Org-mode go back to 2003. It was borne out of
+frustration over the user interface of the emacs outline-mode. All I
+wanted was to make working with an outline tree possible without having
+to remember more than 10 commands just for hiding and unhiding parts of
+the outline tree, and to allow to restructure a tree easily. Visibility
+cycling and structure editing were originally implemented in the package
+@file{outline-magic.el}, but quickly moved to the more general
+@file{org.el}. TODO entries, basic time stamps, and table support were
+added next, and highlight the two main goals that Org-mode still has
+today: To create a new, outline-based, plain text mode with innovative
+and intuitive editing features, and to incorporate project planning
+functionality directly into a notes file.
+
+Since the first release, hundreds of emails to me or on
+@code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
+reports, feedback, new ideas, and sometimes even patches and add-on
+code. Many thanks to everyone who has helped to improve this package.
+I am trying to keep here a list of the people who had significant
+influence in shaping one or more aspects of Org-mode. The list may not
+be complete, if I have forgotten someone, please accept my apologies and
+let me know.
@itemize @bullet
@item
@@ -4607,8 +4824,9 @@ for Remember.
@i{Pavel Chalmoviansky} influenced the agenda treatment of items with
specified time.
@item
-@i{Gregory Chenov} patched support for lisp forms into table
-calculations and improved XEmacs compatibility.
+@i{Gregory Chernov} patched support for lisp forms into table
+calculations and improved XEmacs compatibility, in particular by porting
+@file{nouline.el} to XEmacs.
@item
@i{Sacha Chua} suggested to copy some linking code from Planner.
@item
@@ -4619,9 +4837,15 @@ patched CSS formatting into the HTML exporter, and inspired the agenda.
@item
@i{Nic Ferrier} contributed mailcap and XOXO support.
@item
+@i{Niels Giessen} had the idea to automatically archive DONE trees.
+@item
+@i{Bastien Guerry} provoded extensive feedback.
+@item
@i{Kai Grossjohann} pointed out key-binding conflicts caused by
Org-mode.
@item
+@i{Leon Liu} asked for embedded LaTeX and tested it.
+@item
@i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
happy.
@item
@@ -4656,6 +4880,9 @@ other things.
Linking to VM/BBDB/GNUS was inspired by @i{Tom Shannon}'s
@file{organizer-mode.el}.
@item
+@i{Daniel Sinder} came up with the idea of internal archiving by locking
+subtrees.
+@item
@i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
chapter about publishing.
@item
@@ -4684,9 +4911,10 @@ work on a tty.
@i{Piotr Zielinski} wrote @file{org-mouse.el} and showed how to follow
links with mouse-1.
@end itemize
-
-@node Index, Key Index, Miscellaneous, Top
-@chapter Index
+
+
+@node Index, Key Index, History and Acknowledgments, Top
+@unnumbered Index
@printindex cp
diff --git a/orgcard.pdf b/orgcard.pdf
index 2327538..813a1ac 100644
--- a/orgcard.pdf
+++ b/orgcard.pdf
Binary files differ
diff --git a/orgcard.tex b/orgcard.tex
index 646a03b..a97d024 100644
--- a/orgcard.tex
+++ b/orgcard.tex
@@ -1,5 +1,5 @@
% Reference Card for Org Mode
-\def\orgversionnumber{4.37}
+\def\orgversionnumber{4.40}
\def\year{2006}
%
%**start of header
@@ -288,10 +288,8 @@ are preserved on all copies.
\section{Motion}
-\key{next heading}{C-c C-n}
-\key{previous heading}{C-c C-p}
-\key{next heading, same level}{C-c C-f}
-\key{previous heading, same level}{C-c C-b}
+\key{next/previous heading}{C-c C-n/p}
+\key{next/previous heading, same level}{C-c C-f/b}
\key{backward to higher level heading}{C-c C-u}
\key{jump to another place in document}{C-c C-j}
\key{previous/next plain list item}{S-UP/DOWN$^3$}
@@ -306,13 +304,18 @@ are preserved on all copies.
\key{promote current subtree up one level}{M-S-LEFT}
\key{demote current subtree down one level}{M-S-RIGHT}
-\key{move subtree/list item up}{M-S-UP}
-\key{move subtree/list item down}{M-S-DOWN}
+\key{move subtree/list item up/down}{M-S-UP/DOWN}
\key{kill subtree}{C-c C-x C-w}
\key{copy subtree}{C-c C-x M-w}
\key{yank subtree}{C-c C-x C-y}
+\key{narrow buffer to current subtree}{C-x n s}
-\key{archive subtree}{C-c \$}
+\section{Archiving}
+
+\key{toggle ARCHIVE tag}{C-c C-x C-a}
+\metax{mark fully dine children}{C-u C-c C-x C-a}
+\key{move subtree to achive file}{C-c \$}
+\key{move all fully done children}{C-u C-c \$}
To set archive location for current file, add a line like$^2$:
\vskip -1mm
\beginexample%
@@ -329,18 +332,8 @@ To set archive location for current file, add a line like$^2$:
%\key{agenda for the week}{C-c a$^1$}
%\key{agenda for date at cursor}{C-c C-o}
-\section{Tags}
-
-\key{set tags for current heading}{C-c C-c}
-\key{realign tags in all headings}{C-u C-c C-c}
-\key{create sparse tree with matching tags}{C-c \\}
-\key{globally (agenda) match tags at cursor}{C-c C-o}
-
\section{Tables}
-%Org-mode has its own built-in intuitive table editor with unique
-%capabilities.
-
{\bf Creating a table}
%\metax{insert a new Org-mode table}{M-x org-table-create}
@@ -466,6 +459,39 @@ formula, \kbd{:=} a named-field formula.
%\key{\kbd{vm://myself@some.where.org/folder\#id}}{\rm VM remote}
+\section{Remember-mode Integration}
+
+See the manual for how to make remember.el use Org-mode links and
+files. The note-finishing command \kbd{C-c C-c} will first prompt for
+an org file. In the file, find a location with:
+
+\key{rotate subtree visibility}{TAB}
+\key{next heading}{DOWN}
+\key{previous heading}{UP}
+
+Insert the note with one of the following:
+
+\key{as sublevel of heading at cursor}{RET}
+\key{right here (cursor not on heading)}{RET}
+\key{before current heading}{LEFT}
+\key{after current heading}{RIGHT}
+\key{shortcut to end of buffer (cursor at buf-start)}{RET}
+\key{Abort}{q}
+
+\section{Completion}
+
+In-buffer completion completes TODO keywords at headline start, TeX
+macros after ``{\tt \\}'', option keywords after ``{\tt \#-}'', TAGS
+after ``{\tt :}'', and dictionary words elsewhere.
+
+\key{Complete word at point}{M-TAB}
+
+
+\newcolumn
+\title{Org-Mode Reference Card (2/2)}
+
+\centerline{(for version \orgversionnumber)}
+
\section{TODO Items}
\key{rotate the state of the current item}{C-c C-t}
@@ -480,6 +506,13 @@ formula, \kbd{:=} a named-field formula.
\key{\kbd{\#+SEQ_TODO: TODO TRY BLUFF DONE}}{\rm todo workflow}
\key{\kbd{\#+TYP_TODO: Phil home work DONE}}{\rm todo types}
+\section{Tags}
+
+\key{set tags for current heading}{C-c C-c}
+\key{realign tags in all headings}{C-u C-c C-c}
+\key{create sparse tree with matching tags}{C-c \\}
+\key{globally (agenda) match tags at cursor}{C-c C-o}
+
\section{Timestamps}
\key{prompt for date and insert timestamp}{C-c .}
@@ -502,18 +535,26 @@ formula, \kbd{:=} a named-field formula.
%\key{... forward/backward one month}{M-S-LEFT/RIGT}
-\newcolumn
-\title{Org-Mode Reference Card (2/2)}
-
-\centerline{(for version \orgversionnumber)}
-
\section{Clocking Time}
\key{start clock on current item}{C-c C-x C-i}
\key{stop clock on current item}{C-c C-x C-o}
\key{cancel current clock}{C-c C-x C-x}
+
\key{display total subtree times}{C-c C-x C-d}
\key{remove displayed times}{C-c C-c}
+\key{insert/update table with clock report}{C-c C-x C-r}
+
+\section{Dynamic Blocks}
+
+\key{update dynamic block at point}{C-c C-x C-u}
+\metax{update all dynamic blocks}{C-u C-c C-x C-u}
+
+\section{LaTeX and cdlatex-mode}
+
+\key{preview LaTeX fragment}{C-c C-x C-l}
+\key{Expand abbreviation (cdlatex-mode)}{TAB}
+\key{Insert/modify math symbol (cdlatex-mode)}{` / '}
\section{Agenda Views}
@@ -565,6 +606,7 @@ To set categories, add lines like$^2$:
\key{change state of current TODO item}{t}
\key{show tags of current headline}{T}
\key{set tags for current headline}{:}
+\key{toggle ARCHIVE tag}{a}
\key{set priority of current item}{p}
\key{raise/lower priority of current item}{S-UP/DOWN$^3$}
\key{display weighted priority of current item}{P}
@@ -577,7 +619,6 @@ To set categories, add lines like$^2$:
\key{Stop the clock (clock-out)}{O}
\key{Cancel current clock}{X}
-\newcolumn
{\bf Calendar commands}
@@ -593,6 +634,13 @@ To set categories, add lines like$^2$:
\key{quit agenda, remove agenda buffer}{q}
\key{exit agenda, remove all agenda buffers}{x}
+\section{Calendar and Diary Integration}
+
+To include entries from the Emacs diary in your Org-mode agenda:
+\beginexample%
+(setq org-agenda-include-diary t)
+\endexample
+
\section{Exporting and Publishing}
Exporting creates files with extensions {\it .txt\/} and {\it .html\/}
@@ -629,18 +677,19 @@ keywords. {\tt M-TAB} again just after keyword is complete inserts examples.
\key{language code for html}{\#+LANGUAGE:}
\key{free text description of file}{\#+TEXT:}
\key{... which can carry over multiple lines}{\#+TEXT:}
-\key{settings for the export process - see below}{\#+OPTIONS:}
-
-\key{set number of headline levels for export}{H:2}
-\key{turn on/off section numbers}{num:t}
-\key{turn on/off table of contents}{toc:t}
-\key{turn on/off linebreak preservation}{\\n:nil}
-\key{turn on/off quoted html tags}{@:t}
-\key{turn on/off fixed width sections}{::t}
-\key{turn on/off tables}{|:t}
-\key{turn on/off \TeX\ syntax for sub/super-scripts}{\^{}:t}
-\key{turn on/off emphasised text}{*:nil}
-\key{turn on/off \TeX\ macros}{TeX:t}
+%\key{settings for the export process - see below}{\#+OPTIONS:}
+\key{settings for the export process}{\#+OPTIONS:}
+
+%\key{set number of headline levels for export}{H:2}
+%\key{turn on/off section numbers}{num:t}
+%\key{turn on/off table of contents}{toc:t}
+%\key{turn on/off linebreak preservation}{\\n:nil}
+%\key{turn on/off quoted html tags}{@:t}
+%\key{turn on/off fixed width sections}{::t}
+%\key{turn on/off tables}{|:t}
+%\key{turn on/off \TeX\ syntax for sub/super-scripts}{\^{}:t}
+%\key{turn on/off emphasised text}{*:nil}
+%\key{turn on/off \TeX\ macros}{TeX:t}
{\bf Comments: Text not being exported}
@@ -651,53 +700,20 @@ Subtrees whose header starts with COMMENT are never exported.
\key{toggle COMMENT keyword on entry}{C-c ;}
-\section{Completion}
-
-In-buffer completion completes TODO keywords at headline start, TeX
-macros after ``{\tt \\}'', option keywords after ``{\tt \#-}'', TAGS
-after ``{\tt :}'', and dictionary words elsewhere.
-
-\key{Complete word at point}{M-TAB}
-
-\section{Calendar and Diary Integration}
-To include entries from the Emacs diary in your Org-mode agenda:
-\beginexample%
-(setq org-agenda-include-diary t)
-\endexample
-
-\section{Remember-mode Integration}
+%\section{CUA and pc-select compatibility}%
-See the manual for how to make remember.el use Org-mode links and
-files. The note-finishing command \kbd{C-c C-c} will first prompt for
-an org file. In the file, find a location with:
-
-\key{rotate subtree visibility}{TAB}
-\key{next heading}{DOWN}
-\key{previous heading}{UP}
-
-Insert the note with one of the following:
-
-\key{as sublevel of heading at cursor}{RET}
-\key{right here (cursor not on heading)}{RET}
-\key{before current heading}{LEFT}
-\key{after current heading}{RIGHT}
-\key{shortcut to end of buffer (cursor at buf-start)}{RET}
-\key{Abort}{q}
-
-\section{CUA and pc-select compatibility}
-
-Configure the variable {\tt org-CUA-compatibility} to make Org-mode
-avoid the \kbd{S-<cursor>} bindings used by these modes. When set,
-Org-mode will change the following keybindings (also in the agenda
-buffer, but not during date selection). See note mark four$^3$
-throughout the reference card.
-%\vskip-mm
-\beginexample
-S-UP $\to$ M-p S-DOWN $\to$ M-n
-S-LEFT $\to$ M-- S-RIGHT $\to$ M-+
-S-RET $\to$ C-S-RET
-\endexample
+%Configure the variable {\tt org-CUA-compatibility} to make Org-mode
+%avoid the \kbd{S-<cursor>} bindings used by these modes. When set,
+%Org-mode will change the following keybindings (also in the agenda
+%buffer, but not during date selection). See note mark four$^3$
+%throughout the reference card.
+%%\vskip-mm
+%\beginexample
+%S-UP $\to$ M-p S-DOWN $\to$ M-n
+%S-LEFT $\to$ M-- S-RIGHT $\to$ M-+
+%S-RET $\to$ C-S-RET
+%\endexample
\section{Notes}
$^1$ This is only a suggestion for a binding of this command. Choose
diff --git a/xemacs/README b/xemacs/README
new file mode 100644
index 0000000..70d2c1e
--- /dev/null
+++ b/xemacs/README
@@ -0,0 +1,9 @@
+This directory contains files that are necessary or at least useful
+companions for Org-mode:
+
+noutline.el Greg Chernov's port of the overlay-based implementation of
+ outline-mode. This is requires, and until XEmacs uses
+ this (or another port), you need to install it with Org-mode.
+
+ps-print-invisible.el Greg Chernovs modification to ps-print, to
+ honor invisible text properties during printing. \ No newline at end of file
diff --git a/xemacs/noutline.el b/xemacs/noutline.el
new file mode 100644
index 0000000..2e11ee5
--- /dev/null
+++ b/xemacs/noutline.el
@@ -0,0 +1,1051 @@
+;;; outline.el --- outline mode commands for Emacs
+
+;; ----------------------------------------------------------------------
+;; This is a port of GNU Emacs outline.el to XEmacs. The port was
+;; done by Greg Chernov and is temporarily made available on the Org-mode
+;; homepage http://www.astro.uva.nl/~dominik/Tools/org/, and as part
+;; of the Org-mode distribution.
+;; ----------------------------------------------------------------------
+
+;; Copyright (C) 1986, 1993, 1994, 1995, 1997, 2000, 2001, 2002,
+;; 2003, 2004, 2005 Free Software Foundation, Inc.
+
+;; Maintainer: FSF
+;; Keywords: outlines
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This package is a major mode for editing outline-format documents.
+;; An outline can be `abstracted' to show headers at any given level,
+;; with all stuff below hidden. See the Emacs manual for details.
+
+;;; Todo:
+
+;; - subtree-terminators
+;; - better handle comments before function bodies (i.e. heading)
+;; - don't bother hiding whitespace
+
+;;; Code:
+
+(require 'easymenu)
+
+;; XEmacs and compatibility
+
+(defalias 'match-string-no-properties 'match-string)
+
+(if (not (fboundp 'add-to-invisibility-spec))
+ (defun add-to-invisibility-spec (arg)
+ "Add elements to `buffer-invisibility-spec'.
+See documentation for `buffer-invisibility-spec' for the kind of elements
+that can be added."
+ (if (eq buffer-invisibility-spec t)
+ (setq buffer-invisibility-spec (list t)))
+ (setq buffer-invisibility-spec
+ (cons arg buffer-invisibility-spec))))
+
+(if (not (fboundp 'remove-from-invisibility-spec))
+ (defun remove-from-invisibility-spec (arg)
+ "Remove elements from `buffer-invisibility-spec'."
+ (if (consp buffer-invisibility-spec)
+ (setq buffer-invisibility-spec
+ (delete arg buffer-invisibility-spec)))))
+
+(defvar font-lock-warning-face)
+
+
+(defgroup outlines nil
+ "Support for hierarchical outlining."
+ :prefix "outline-"
+ :group 'editing)
+
+(defcustom outline-regexp "[*\^L]+"
+ "*Regular expression to match the beginning of a heading.
+Any line whose beginning matches this regexp is considered to start a heading.
+Note that Outline mode only checks this regexp at the start of a line,
+so the regexp need not (and usually does not) start with `^'.
+The recommended way to set this is with a Local Variables: list
+in the file it applies to. See also `outline-heading-end-regexp'."
+ :type '(choice regexp (const nil))
+ :group 'outlines)
+
+(defcustom outline-heading-end-regexp "\n"
+ "*Regular expression to match the end of a heading line.
+You can assume that point is at the beginning of a heading when this
+regexp is searched for. The heading ends at the end of the match.
+The recommended way to set this is with a `Local Variables:' list
+in the file it applies to."
+ :type 'regexp
+ :group 'outlines)
+
+(defvar outline-mode-prefix-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "@" 'outline-mark-subtree)
+ (define-key map "\C-n" 'outline-next-visible-heading)
+ (define-key map "\C-p" 'outline-previous-visible-heading)
+ (define-key map "\C-i" 'show-children)
+ (define-key map "\C-s" 'show-subtree)
+ (define-key map "\C-d" 'hide-subtree)
+ (define-key map "\C-u" 'outline-up-heading)
+ (define-key map "\C-f" 'outline-forward-same-level)
+ (define-key map "\C-b" 'outline-backward-same-level)
+ (define-key map "\C-t" 'hide-body)
+ (define-key map "\C-a" 'show-all)
+ (define-key map "\C-c" 'hide-entry)
+ (define-key map "\C-e" 'show-entry)
+ (define-key map "\C-l" 'hide-leaves)
+ (define-key map "\C-k" 'show-branches)
+ (define-key map "\C-q" 'hide-sublevels)
+ (define-key map "\C-o" 'hide-other)
+ (define-key map "\C-^" 'outline-move-subtree-up)
+ (define-key map "\C-v" 'outline-move-subtree-down)
+ (define-key map [(control ?<)] 'outline-promote)
+ (define-key map [(control ?>)] 'outline-demote)
+ (define-key map "\C-m" 'outline-insert-heading)
+ ;; Where to bind outline-cycle ?
+ map))
+
+
+
+(defvar outline-mode-menu-heading
+ '("Headings"
+ ["Up" outline-up-heading t]
+ ["Next" outline-next-visible-heading t]
+ ["Previous" outline-previous-visible-heading t]
+ ["Next Same Level" outline-forward-same-level t]
+ ["Previous Same Level" outline-backward-same-level t]
+ ["New heading" outline-insert-heading t]
+ ["Copy to kill ring" outline-headers-as-kill :active (region-active-p)]
+ ["Move subtree up" outline-move-subtree-up t]
+ ["Move subtree down" outline-move-subtree-down t]
+ ["Promote subtree" outline-promote t]
+ ["Demote subtree" outline-demote t]))
+
+(defvar outline-mode-menu-show
+ '("Show"
+ ["Show All" show-all t]
+ ["Show Entry" show-entry t]
+ ["Show Branches" show-branches t]
+ ["Show Children" show-children t]
+ ["Show Subtree" show-subtree t]))
+
+(defvar outline-mode-menu-hide
+ '("Hide"
+ ["Hide Leaves" hide-leaves t]
+ ["Hide Body" hide-body t]
+ ["Hide Entry" hide-entry t]
+ ["Hide Subtree" hide-subtree t]
+ ["Hide Other" hide-other t]
+ ["Hide Sublevels" hide-sublevels t]))
+
+
+
+(defvar outline-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-c" outline-mode-prefix-map)
+ map))
+
+(defvar outline-font-lock-keywords
+ '(;;
+ ;; Highlight headings according to the level.
+ (eval . (list (concat "^\\(?:" outline-regexp "\\).+")
+ 0 '(outline-font-lock-face) nil t)))
+ "Additional expressions to highlight in Outline mode.")
+
+(defface outline-1
+ '((t (:foreground "Blue1")))
+ "Level 1."
+ :group 'outlines)
+
+(defface outline-2
+ '((t (:foreground "DarkGoldenrod")))
+ "Level 2."
+ :group 'outlines)
+
+(defface outline-3
+ '((t (:foreground "Purple")))
+ "Level 3."
+ :group 'outlines)
+
+(defface outline-4
+ '((t (:foreground "Firebrick")))
+ "Level 4."
+ :group 'outlines)
+
+(defface outline-5
+ '((t (:foreground "ForestGreen")))
+ "Level 5."
+ :group 'outlines)
+
+(defface outline-6
+ '((t (:foreground "CadetBlue")))
+ "Level 6."
+ :group 'outlines)
+
+(defface outline-7
+ '((t (:foreground "Orchid")))
+ "Level 7."
+ :group 'outlines)
+
+(defface outline-8
+ '((t (:foreground "RosyBrown")))
+ "Level 8."
+ :group 'outlines)
+
+
+
+(defvar outline-font-lock-faces
+ [outline-1 outline-2 outline-3 outline-4
+ outline-5 outline-6 outline-7 outline-8])
+
+(defvar outline-font-lock-levels nil)
+(make-variable-buffer-local 'outline-font-lock-levels)
+
+(defun outline-font-lock-face ()
+ ;; (save-excursion
+ ;; (outline-back-to-heading t)
+ ;; (let* ((count 0)
+ ;; (start-level (funcall outline-level))
+ ;; (level start-level)
+ ;; face-level)
+ ;; (while (not (setq face-level
+ ;; (if (or (bobp) (eq level 1)) 0
+ ;; (cdr (assq level outline-font-lock-levels)))))
+ ;; (outline-up-heading 1 t)
+ ;; (setq count (1+ count))
+ ;; (setq level (funcall outline-level)))
+ ;; ;; Remember for later.
+ ;; (unless (zerop count)
+ ;; (setq face-level (+ face-level count))
+ ;; (push (cons start-level face-level) outline-font-lock-levels))
+ ;; (condition-case nil
+ ;; (aref outline-font-lock-faces face-level)
+ ;; (error font-lock-warning-face))))
+ (save-excursion
+ (goto-char (match-beginning 0))
+ (looking-at outline-regexp)
+ (condition-case nil
+ (aref outline-font-lock-faces (1- (funcall outline-level)))
+ (error font-lock-warning-face))))
+
+(defvar outline-view-change-hook nil
+ "Normal hook to be run after outline visibility changes.")
+
+(defvar outline-mode-hook nil
+ "*This hook is run when outline mode starts.")
+
+(defvar outline-blank-line nil
+ "*Non-nil means to leave unhidden blank line before heading.")
+
+;;;###autoload
+(define-derived-mode outline-mode text-mode "Outline"
+ "Set major mode for editing outlines with selective display.
+Headings are lines which start with asterisks: one for major headings,
+two for subheadings, etc. Lines not starting with asterisks are body lines.
+
+Body text or subheadings under a heading can be made temporarily
+invisible, or visible again. Invisible lines are attached to the end
+of the heading, so they move with it, if the line is killed and yanked
+back. A heading with text hidden under it is marked with an ellipsis (...).
+
+Commands:\\<outline-mode-map>
+\\[outline-next-visible-heading] outline-next-visible-heading move by visible headings
+\\[outline-previous-visible-heading] outline-previous-visible-heading
+\\[outline-forward-same-level] outline-forward-same-level similar but skip subheadings
+\\[outline-backward-same-level] outline-backward-same-level
+\\[outline-up-heading] outline-up-heading move from subheading to heading
+
+\\[hide-body] make all text invisible (not headings).
+\\[show-all] make everything in buffer visible.
+\\[hide-sublevels] make only the first N levels of headers visible.
+
+The remaining commands are used when point is on a heading line.
+They apply to some of the body or subheadings of that heading.
+\\[hide-subtree] hide-subtree make body and subheadings invisible.
+\\[show-subtree] show-subtree make body and subheadings visible.
+\\[show-children] show-children make direct subheadings visible.
+ No effect on body, or subheadings 2 or more levels down.
+ With arg N, affects subheadings N levels down.
+\\[hide-entry] make immediately following body invisible.
+\\[show-entry] make it visible.
+\\[hide-leaves] make body under heading and under its subheadings invisible.
+ The subheadings remain visible.
+\\[show-branches] make all subheadings at all levels visible.
+
+The variable `outline-regexp' can be changed to control what is a heading.
+A line is a heading if `outline-regexp' matches something at the
+beginning of the line. The longer the match, the deeper the level.
+
+Turning on outline mode calls the value of `text-mode-hook' and then of
+`outline-mode-hook', if they are non-nil."
+ (make-local-variable 'line-move-ignore-invisible)
+ (setq line-move-ignore-invisible t)
+ ;; Cause use of ellipses for invisible text.
+ (add-to-invisibility-spec '(outline . t))
+
+ (easy-menu-add outline-mode-menu-heading)
+ (easy-menu-add outline-mode-menu-show)
+ (easy-menu-add outline-mode-menu-hide)
+ (set (make-local-variable 'paragraph-start)
+ (concat paragraph-start "\\|\\(?:" outline-regexp "\\)"))
+ ;; Inhibit auto-filling of header lines.
+ (set (make-local-variable 'auto-fill-inhibit-regexp) outline-regexp)
+ (set (make-local-variable 'paragraph-separate)
+ (concat paragraph-separate "\\|\\(?:" outline-regexp "\\)"))
+ (set (make-local-variable 'font-lock-defaults)
+ '(outline-font-lock-keywords t nil nil backward-paragraph))
+ (setq imenu-generic-expression
+ (list (list nil (concat "^\\(?:" outline-regexp "\\).*$") 0)))
+ (add-hook 'change-major-mode-hook 'show-all nil t))
+
+(defcustom outline-minor-mode-prefix "\C-c@"
+ "*Prefix key to use for Outline commands in Outline minor mode.
+The value of this variable is checked as part of loading Outline mode.
+After that, changing the prefix key requires manipulating keymaps."
+ :type 'string
+ :group 'outlines)
+
+;;;###autoload
+(define-minor-mode outline-minor-mode
+ "Toggle Outline minor mode.
+With arg, turn Outline minor mode on if arg is positive, off otherwise.
+See the command `outline-mode' for more information on this mode."
+ nil " Outl" (list (cons outline-minor-mode-prefix outline-mode-prefix-map))
+ :group 'outlines
+ (if outline-minor-mode
+ (progn
+ ;; Turn off this mode if we change major modes.
+ (easy-menu-add outline-mode-menu-heading)
+ (easy-menu-add outline-mode-menu-show)
+ (easy-menu-add outline-mode-menu-hide)
+ (add-hook 'change-major-mode-hook
+ (lambda () (outline-minor-mode -1))
+ nil t)
+ (set (make-local-variable 'line-move-ignore-invisible) t)
+ ;; Cause use of ellipses for invisible text.
+ (add-to-invisibility-spec '(outline . t)))
+ (easy-menu-remove outline-mode-menu-heading)
+ (easy-menu-remove outline-mode-menu-show)
+ (easy-menu-remove outline-mode-menu-hide)
+ (setq line-move-ignore-invisible nil)
+ ;; Cause use of ellipses for invisible text.
+ (remove-from-invisibility-spec '(outline . t))
+ ;; When turning off outline mode, get rid of any outline hiding.
+ (show-all)))
+
+(defvar outline-level 'outline-level
+ "*Function of no args to compute a header's nesting level in an outline.
+It can assume point is at the beginning of a header line and that the match
+data reflects the `outline-regexp'.")
+
+(defvar outline-heading-alist ()
+ "Alist associating a heading for every possible level.
+Each entry is of the form (HEADING . LEVEL).
+This alist is used two ways: to find the heading corresponding to
+a given level and to find the level of a given heading.
+If a mode or document needs several sets of outline headings (for example
+numbered and unnumbered sections), list them set by set and sorted by level
+within each set. For example in texinfo mode:
+
+ (setq outline-heading-alist
+ '((\"@chapter\" . 2) (\"@section\" . 3) (\"@subsection\" . 4)
+ (\"@subsubsection\" . 5)
+ (\"@unnumbered\" . 2) (\"@unnumberedsec\" . 3)
+ (\"@unnumberedsubsec\" . 4) (\"@unnumberedsubsubsec\" . 5)
+ (\"@appendix\" . 2) (\"@appendixsec\" . 3)...
+ (\"@appendixsubsec\" . 4) (\"@appendixsubsubsec\" . 5) ..))
+
+Instead of sorting the entries in each set, you can also separate the
+sets with nil.")
+(make-variable-buffer-local 'outline-heading-alist)
+
+;; This used to count columns rather than characters, but that made ^L
+;; appear to be at level 2 instead of 1. Columns would be better for
+;; tab handling, but the default regexp doesn't use tabs, and anyone
+;; who changes the regexp can also redefine the outline-level variable
+;; as appropriate.
+(defun outline-level ()
+ "Return the depth to which a statement is nested in the outline.
+Point must be at the beginning of a header line.
+This is actually either the level specified in `outline-heading-alist'
+or else the number of characters matched by `outline-regexp'."
+ (or (cdr (assoc (match-string 0) outline-heading-alist))
+ (- (match-end 0) (match-beginning 0))))
+
+(defun outline-next-preface ()
+ "Skip forward to just before the next heading line.
+If there's no following heading line, stop before the newline
+at the end of the buffer."
+ (if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)")
+ nil 'move)
+ (goto-char (match-beginning 0)))
+ (if (and (bolp) (or outline-blank-line (eobp)) (not (bobp)))
+ (forward-char -1)))
+
+(defun outline-next-heading ()
+ "Move to the next (possibly invisible) heading line."
+ (interactive)
+ ;; Make sure we don't match the heading we're at.
+ (if (and (bolp) (not (eobp))) (forward-char 1))
+ (if (re-search-forward (concat "^\\(?:" outline-regexp "\\)")
+ nil 'move)
+ (goto-char (match-beginning 0))))
+
+(defun outline-previous-heading ()
+ "Move to the previous (possibly invisible) heading line."
+ (interactive)
+ (re-search-backward (concat "^\\(?:" outline-regexp "\\)")
+ nil 'move))
+
+(defsubst outline-invisible-p (&optional pos)
+ "Non-nil if the character after point is invisible."
+ (get-char-property (or pos (point)) 'invisible))
+
+(defun outline-visible ()
+ (not (outline-invisible-p)))
+(make-obsolete 'outline-visible 'outline-invisible-p)
+
+(defun outline-back-to-heading (&optional invisible-ok)
+ "Move to previous heading line, or beg of this line if it's a heading.
+Only visible heading lines are considered, unless INVISIBLE-OK is non-nil."
+ (beginning-of-line)
+ (or (outline-on-heading-p invisible-ok)
+ (let (found)
+ (save-excursion
+ (while (not found)
+ (or (re-search-backward (concat "^\\(?:" outline-regexp "\\)")
+ nil t)
+ (error "before first heading"))
+ (setq found (and (or invisible-ok (not (outline-invisible-p)))
+ (point)))))
+ (goto-char found)
+ found)))
+
+(defun outline-on-heading-p (&optional invisible-ok)
+ "Return t if point is on a (visible) heading line.
+If INVISIBLE-OK is non-nil, an invisible heading line is ok too."
+ (save-excursion
+ (beginning-of-line)
+ (and (bolp) (or invisible-ok (not (outline-invisible-p)))
+ (looking-at outline-regexp))))
+
+(defun outline-insert-heading ()
+ "Insert a new heading at same depth at point."
+ (interactive)
+ (let ((head (save-excursion
+ (condition-case nil
+ (outline-back-to-heading)
+ (error (outline-next-heading)))
+ (if (eobp)
+ (or (caar outline-heading-alist) "")
+ (match-string 0)))))
+ (unless (or (string-match "[ \t]\\'" head)
+ (not (string-match (concat "\\`\\(?:" outline-regexp "\\)")
+ (concat head " "))))
+ (setq head (concat head " ")))
+ (unless (bolp) (end-of-line) (newline))
+ (insert head)
+ (unless (eolp)
+ (save-excursion (newline-and-indent)))
+ (run-hooks 'outline-insert-heading-hook)))
+
+(defun outline-invent-heading (head up)
+ (save-match-data
+ ;; Let's try to invent one by repeating or deleting the last char.
+ (let ((new-head (if up (substring head 0 -1)
+ (concat head (substring head -1)))))
+ (if (string-match (concat "\\`\\(?:" outline-regexp "\\)")
+ new-head)
+ ;; Why bother checking that it is indeed higher/lower level ?
+ new-head
+ ;; Didn't work, so ask what to do.
+ (read-string (format "%s heading for `%s': "
+ (if up "Parent" "Demoted") head)
+ head nil nil)))))
+
+(defun outline-promote (&optional children)
+ "Promote headings higher up the tree.
+If prefix argument CHILDREN is given, promote also all the children.
+If the region is active in `transient-mark-mode', promote all headings
+in the region."
+ (interactive
+ (list (if (and zmacs-regions (region-active-p)) 'region
+ (outline-back-to-heading)
+ (if current-prefix-arg nil 'subtree))))
+ (cond
+ ((eq children 'region)
+ (outline-map-region 'outline-promote (region-beginning) (region-end)))
+ (children
+ (outline-map-region 'outline-promote
+ (point)
+ (save-excursion (outline-get-next-sibling) (point))))
+ (t
+ (outline-back-to-heading t)
+ (let* ((head (match-string-no-properties 0))
+ (level (save-match-data (funcall outline-level)))
+ (up-head (or (outline-head-from-level (1- level) head)
+ ;; Use the parent heading, if it is really
+ ;; one level less.
+ (save-excursion
+ (save-match-data
+ (outline-up-heading 1 t)
+ (and (= (1- level) (funcall outline-level))
+ (match-string-no-properties 0))))
+ ;; Bummer!! There is no lower level heading.
+ (outline-invent-heading head 'up))))
+
+ (unless (rassoc level outline-heading-alist)
+ (push (cons head level) outline-heading-alist))
+
+ (replace-match up-head nil t)))))
+
+(defun outline-demote (&optional children)
+ "Demote headings lower down the tree.
+If prefix argument CHILDREN is given, demote also all the children.
+If the region is active in `transient-mark-mode', demote all headings
+in the region."
+ (interactive
+ (list (if (and zmacs-regions (region-active-p)) 'region
+ (outline-back-to-heading)
+ (if current-prefix-arg nil 'subtree))))
+ (cond
+ ((eq children 'region)
+ (outline-map-region 'outline-demote (region-beginning) (region-end)))
+ (children
+ (outline-map-region 'outline-demote
+ (point)
+ (save-excursion (outline-get-next-sibling) (point))))
+ (t
+ (let* ((head (match-string-no-properties 0))
+ (level (save-match-data (funcall outline-level)))
+ (down-head
+ (or (outline-head-from-level (1+ level) head)
+ (save-excursion
+ (save-match-data
+ (while (and (progn (outline-next-heading) (not (eobp)))
+ (<= (funcall outline-level) level)))
+ (when (eobp)
+ ;; Try again from the beginning of the buffer.
+ (goto-char (point-min))
+ (while (and (progn (outline-next-heading) (not (eobp)))
+ (<= (funcall outline-level) level))))
+ (unless (eobp)
+ (looking-at outline-regexp)
+ (match-string-no-properties 0))))
+ ;; Bummer!! There is no higher-level heading in the buffer.
+ (outline-invent-heading head nil))))
+
+ (unless (rassoc level outline-heading-alist)
+ (push (cons head level) outline-heading-alist))
+ (replace-match down-head nil t)))))
+
+(defun outline-head-from-level (level head &optional alist)
+ "Get new heading with level LEVEL from ALIST.
+If there are no such entries, return nil.
+ALIST defaults to `outline-heading-alist'.
+Similar to (car (rassoc LEVEL ALIST)).
+If there are several different entries with same new level, choose
+the one with the smallest distance to the assocation of HEAD in the alist.
+This makes it possible for promotion to work in modes with several
+independent sets of headings (numbered, unnumbered, appendix...)"
+ (unless alist (setq alist outline-heading-alist))
+ (let ((l (rassoc level alist))
+ ll h hl l2 l2l)
+ (cond
+ ((null l) nil)
+ ;; If there's no HEAD after L, any other entry for LEVEL after L
+ ;; can't be much better than L.
+ ((null (setq h (assoc head (setq ll (memq l alist))))) (car l))
+ ;; If there's no other entry for LEVEL, just keep L.
+ ((null (setq l2 (rassoc level (cdr ll)))) (car l))
+ ;; Now we have L, L2, and H: see if L2 seems better than L.
+ ;; If H is after L2, L2 is better.
+ ((memq h (setq l2l (memq l2 (cdr ll))))
+ (outline-head-from-level level head l2l))
+ ;; Now we have H between L and L2.
+ ;; If there's a separator between L and H, prefer L2.
+ ((memq h (memq nil ll))
+ (outline-head-from-level level head l2l))
+ ;; If there's a separator between L2 and H, prefer L.
+ ((memq l2 (memq nil (setq hl (memq h ll)))) (car l))
+ ;; No separator between L and L2, check the distance.
+ ((< (* 2 (length hl)) (+ (length ll) (length l2l)))
+ (outline-head-from-level level head l2l))
+ ;; If all else fails, just keep L.
+ (t (car l)))))
+
+(defun outline-map-region (fun beg end)
+ "Call FUN for every heading between BEG and END.
+When FUN is called, point is at the beginning of the heading and
+the match data is set appropriately."
+ (save-excursion
+ (setq end (copy-marker end))
+ (goto-char beg)
+ (when (re-search-forward (concat "^\\(?:" outline-regexp "\\)") end t)
+ (goto-char (match-beginning 0))
+ (funcall fun)
+ (while (and (progn
+ (outline-next-heading)
+ (< (point) end))
+ (not (eobp)))
+ (funcall fun)))))
+
+;; Vertical tree motion
+
+(defun outline-move-subtree-up (&optional arg)
+ "Move the currrent subtree up past ARG headlines of the same level."
+ (interactive "p")
+ (outline-move-subtree-down (- arg)))
+
+(defun outline-move-subtree-down (&optional arg)
+ "Move the currrent subtree down past ARG headlines of the same level."
+ (interactive "p")
+ (let ((movfunc (if (> arg 0) 'outline-get-next-sibling
+ 'outline-get-last-sibling))
+ (ins-point (make-marker))
+ (cnt (abs arg))
+ (tmp-string "")
+ beg end folded)
+ ;; Select the tree
+ (outline-back-to-heading)
+ (setq beg (point))
+ (save-match-data
+ (save-excursion (outline-end-of-heading)
+ (setq folded (outline-invisible-p)))
+ (outline-end-of-subtree))
+ (if (= (char-after) ?\n) (forward-char 1))
+ (setq end (point))
+ ;; Find insertion point, with error handling
+ (goto-char beg)
+ (while (> cnt 0)
+ (or (funcall movfunc)
+ (progn (goto-char beg)
+ (error "Cannot move past superior level")))
+ (setq cnt (1- cnt)))
+ (if (> arg 0)
+ ;; Moving forward - still need to move over subtree
+ (progn (outline-end-of-subtree)
+ (if (= (char-after) ?\n) (forward-char 1))))
+ (move-marker ins-point (point))
+ (setq tmp-string (buffer-substring beg end))
+ (delete-region beg end)
+ (insert tmp-string)
+ (goto-char ins-point)
+ (if folded (hide-subtree))
+ (move-marker ins-point nil)))
+
+(defun outline-end-of-heading ()
+ (if (re-search-forward outline-heading-end-regexp nil 'move)
+ (forward-char -1)))
+
+(defun outline-next-visible-heading (arg)
+ "Move to the next visible heading line.
+With argument, repeats or can move backward if negative.
+A heading line is one that starts with a `*' (or that
+`outline-regexp' matches)."
+ (interactive "p")
+ (if (< arg 0)
+ (beginning-of-line)
+ (end-of-line))
+ (while (and (not (bobp)) (< arg 0))
+ (while (and (not (bobp))
+ (re-search-backward (concat "^\\(?:" outline-regexp "\\)")
+ nil 'move)
+ (outline-invisible-p)))
+ (setq arg (1+ arg)))
+ (while (and (not (eobp)) (> arg 0))
+ (while (and (not (eobp))
+ (re-search-forward (concat "^\\(?:" outline-regexp "\\)")
+ nil 'move)
+ (outline-invisible-p (match-beginning 0))))
+ (setq arg (1- arg)))
+ (beginning-of-line))
+
+(defun outline-previous-visible-heading (arg)
+ "Move to the previous heading line.
+With argument, repeats or can move forward if negative.
+A heading line is one that starts with a `*' (or that
+`outline-regexp' matches)."
+ (interactive "p")
+ (outline-next-visible-heading (- arg)))
+
+(defun outline-mark-subtree ()
+ "Mark the current subtree in an outlined document.
+This puts point at the start of the current subtree, and mark at the end."
+ (interactive)
+ (let ((beg))
+ (if (outline-on-heading-p)
+ ;; we are already looking at a heading
+ (beginning-of-line)
+ ;; else go back to previous heading
+ (outline-previous-visible-heading 1))
+ (setq beg (point))
+ (outline-end-of-subtree)
+ (push-mark (point) nil t)
+ (goto-char beg)))
+
+
+(defun outline-discard-extents (&optional beg end)
+ "Clear BEG and END of overlays whose property NAME has value VAL.
+Overlays might be moved and/or split.
+BEG and END default respectively to the beginning and end of buffer."
+ (unless beg (setq beg (point-min)))
+ (unless end (setq end (point-max)))
+ (if (< end beg)
+ (setq beg (prog1 end (setq end beg))))
+ (save-excursion
+ (map-extents
+ #'(lambda (ex ignored)
+ (if (< (extent-start-position ex) beg)
+ (if (> (extent-end-position ex) end)
+ (progn
+ (set-extent-endpoints (copy-extent ex)
+ (extent-start-position ex) beg)
+ (set-extent-endpoints ex end (extent-end-position ex)))
+ (set-extent-endpoints ex (extent-start-position ex) beg)))
+ (if (> (extent-end-position ex) end)
+ (set-extent-endpoints ex end (extent-end-position ex))
+ (delete-extent ex)))
+ (current-buffer) beg end nil 'end-closed 'outline)))
+
+
+;;;(defun outline-discard-extents (from to)
+;;; "Delete hideshow extents in region defined by FROM and TO."
+;;; (when (< to from)
+;;; (setq from (prog1 to (setq to from))))
+;;; (map-extents #'(lambda (ex ignored) (delete-extent ex))
+;;; (current-buffer) from to nil 'end-closed 'outline))
+
+(defun outline-flag-region (from to flag)
+ "Hide or show lines from FROM to TO, according to FLAG.
+If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
+ (when (< to from)
+ (setq from (prog1 to (setq to from))))
+ ;; first clear it all out
+ (outline-discard-extents from to)
+ (when flag
+ (let ((ex (make-extent from to)))
+ (set-extent-property ex 'invisible 'outline)
+ (set-extent-property ex 'outline flag)
+ (set-extent-property ex 'isearch-open-invisible 'outline-isearch-open-invisible)))
+ ;; Seems only used by lazy-lock. I.e. obsolete.
+ (run-hooks 'outline-view-change-hook))
+
+
+
+;; Function to be set as an outline-isearch-open-invisible' property
+;; to the overlay that makes the outline invisible (see
+;; `outline-flag-region').
+(defun outline-isearch-open-invisible (overlay)
+ ;; We rely on the fact that isearch places point on the matched text.
+ (show-entry))
+
+(defun hide-entry ()
+ "Hide the body directly following this heading."
+ (interactive)
+ (save-excursion
+ (outline-back-to-heading)
+ (outline-end-of-heading)
+ (outline-flag-region (point) (progn (outline-next-preface) (point)) t)))
+
+(defun show-entry ()
+ "Show the body directly following this heading.
+Show the heading too, if it is currently invisible."
+ (interactive)
+ (save-excursion
+ (outline-back-to-heading t)
+ (outline-flag-region (max 1 (1- (point)))
+ (progn (outline-next-preface) (point)) nil)))
+
+(defun hide-body ()
+ "Hide all body lines in buffer, leaving all headings visible."
+ (interactive)
+ (hide-region-body (point-min) (point-max)))
+
+(defun hide-region-body (start end)
+ "Hide all body lines in the region, but not headings."
+ ;; Nullify the hook to avoid repeated calls to `outline-flag-region'
+ ;; wasting lots of time running `lazy-lock-fontify-after-outline'
+ ;; and run the hook finally.
+ (let (outline-view-change-hook)
+ (save-excursion
+ (save-restriction
+ (narrow-to-region start end)
+ (goto-char (point-min))
+ (if (outline-on-heading-p)
+ (outline-end-of-heading)
+ (outline-next-preface))
+ (while (not (eobp))
+ (outline-flag-region (point)
+ (progn (outline-next-preface) (point)) t)
+ (unless (eobp)
+ (forward-char (if (looking-at "\n\n") 2 1))
+ (outline-end-of-heading))))))
+ (run-hooks 'outline-view-change-hook))
+
+(defun show-all ()
+ "Show all of the text in the buffer."
+ (interactive)
+ (outline-flag-region (point-min) (point-max) nil))
+
+(defun hide-subtree ()
+ "Hide everything after this heading at deeper levels."
+ (interactive)
+ (outline-flag-subtree t))
+
+(defun hide-leaves ()
+ "Hide all body after this heading at deeper levels."
+ (interactive)
+ (save-excursion
+ (outline-back-to-heading)
+ (outline-end-of-heading)
+ (hide-region-body (point) (progn (outline-end-of-subtree) (point)))))
+
+(defun show-subtree ()
+ "Show everything after this heading at deeper levels."
+ (interactive)
+ (outline-flag-subtree nil))
+
+(defun outline-show-heading ()
+ "Show the current heading and move to its end."
+ (outline-flag-region (- (point)
+ (if (bobp) 0
+ (if (and outline-blank-line
+ (eq (char-before (1- (point))) ?\n))
+ 2 1)))
+ (progn (outline-end-of-heading) (point))
+ nil))
+
+(defun hide-sublevels (levels)
+ "Hide everything but the top LEVELS levels of headers, in whole buffer."
+ (interactive "p")
+ (if (< levels 1)
+ (error "Must keep at least one level of headers"))
+ (let (outline-view-change-hook)
+ (save-excursion
+ (goto-char (point-min))
+ ;; Skip the prelude, if any.
+ (unless (outline-on-heading-p t) (outline-next-heading))
+ ;; First hide everything.
+ (outline-flag-region (point) (point-max) t)
+ ;; Then unhide the top level headers.
+ (outline-map-region
+ (lambda ()
+ (if (<= (funcall outline-level) levels)
+ (outline-show-heading)))
+ (point) (point-max))))
+ (run-hooks 'outline-view-change-hook))
+
+(defun hide-other ()
+ "Hide everything except current body and parent and top-level headings."
+ (interactive)
+ (hide-sublevels 1)
+ (let (outline-view-change-hook)
+ (save-excursion
+ (outline-back-to-heading t)
+ (show-entry)
+ (while (condition-case nil (progn (outline-up-heading 1 t) (not (bobp)))
+ (error nil))
+ (outline-flag-region (max 1 (1- (point)))
+ (save-excursion (forward-line 1) (point))
+ nil))))
+ (run-hooks 'outline-view-change-hook))
+
+(defun outline-toggle-children ()
+ "Show or hide the current subtree depending on its current state."
+ (interactive)
+ (save-excursion
+ (outline-back-to-heading)
+ (if (not (outline-invisible-p (point-at-eol)))
+ (hide-subtree)
+ (show-children)
+ (show-entry))))
+
+(defun outline-flag-subtree (flag)
+ (save-excursion
+ (outline-back-to-heading)
+ (outline-end-of-heading)
+ (outline-flag-region (point)
+ (progn (outline-end-of-subtree) (point))
+ flag)))
+
+(defun outline-end-of-subtree ()
+ (outline-back-to-heading)
+ (let ((first t)
+ (level (funcall outline-level)))
+ (while (and (not (eobp))
+ (or first (> (funcall outline-level) level)))
+ (setq first nil)
+ (outline-next-heading))
+ (if (bolp)
+ (progn
+ ;; Go to end of line before heading
+ (forward-char -1)
+ (if (and outline-blank-line (bolp))
+ ;; leave blank line before heading
+ (forward-char -1))))))
+
+(defun show-branches ()
+ "Show all subheadings of this heading, but not their bodies."
+ (interactive)
+ (show-children 1000))
+
+(defun show-children (&optional level)
+ "Show all direct subheadings of this heading.
+Prefix arg LEVEL is how many levels below the current level should be shown.
+Default is enough to cause the following heading to appear."
+ (interactive "P")
+ (setq level
+ (if level (prefix-numeric-value level)
+ (save-excursion
+ (outline-back-to-heading)
+ (let ((start-level (funcall outline-level)))
+ (outline-next-heading)
+ (if (eobp)
+ 1
+ (max 1 (- (funcall outline-level) start-level)))))))
+ (let (outline-view-change-hook)
+ (save-excursion
+ (outline-back-to-heading)
+ (setq level (+ level (funcall outline-level)))
+ (outline-map-region
+ (lambda ()
+ (if (<= (funcall outline-level) level)
+ (outline-show-heading)))
+ (point)
+ (progn (outline-end-of-subtree)
+ (if (eobp) (point-max) (1+ (point)))))))
+ (run-hooks 'outline-view-change-hook))
+
+
+
+(defun outline-up-heading (arg &optional invisible-ok)
+ "Move to the visible heading line of which the present line is a subheading.
+With argument, move up ARG levels.
+If INVISIBLE-OK is non-nil, also consider invisible lines."
+ (interactive "p")
+ (and (eq this-command 'outline-up-heading)
+ (or (eq last-command 'outline-up-heading) (push-mark)))
+ (outline-back-to-heading invisible-ok)
+ (let ((start-level (funcall outline-level)))
+ (if (eq start-level 1)
+ (error "Already at top level of the outline"))
+ (while (and (> start-level 1) (> arg 0) (not (bobp)))
+ (let ((level start-level))
+ (while (not (or (< level start-level) (bobp)))
+ (if invisible-ok
+ (outline-previous-heading)
+ (outline-previous-visible-heading 1))
+ (setq level (funcall outline-level)))
+ (setq start-level level))
+ (setq arg (- arg 1))))
+ (looking-at outline-regexp))
+
+(defun outline-forward-same-level (arg)
+ "Move forward to the ARG'th subheading at same level as this one.
+Stop at the first and last subheadings of a superior heading."
+ (interactive "p")
+ (outline-back-to-heading)
+ (while (> arg 0)
+ (let ((point-to-move-to (save-excursion
+ (outline-get-next-sibling))))
+ (if point-to-move-to
+ (progn
+ (goto-char point-to-move-to)
+ (setq arg (1- arg)))
+ (progn
+ (setq arg 0)
+ (error "No following same-level heading"))))))
+
+(defun outline-get-next-sibling ()
+ "Move to next heading of the same level, and return point or nil if none."
+ (let ((level (funcall outline-level)))
+ (outline-next-visible-heading 1)
+ (while (and (not (eobp)) (> (funcall outline-level) level))
+ (outline-next-visible-heading 1))
+ (if (or (eobp) (< (funcall outline-level) level))
+ nil
+ (point))))
+
+(defun outline-backward-same-level (arg)
+ "Move backward to the ARG'th subheading at same level as this one.
+Stop at the first and last subheadings of a superior heading."
+ (interactive "p")
+ (outline-back-to-heading)
+ (while (> arg 0)
+ (let ((point-to-move-to (save-excursion
+ (outline-get-last-sibling))))
+ (if point-to-move-to
+ (progn
+ (goto-char point-to-move-to)
+ (setq arg (1- arg)))
+ (progn
+ (setq arg 0)
+ (error "No previous same-level heading"))))))
+
+(defun outline-get-last-sibling ()
+ "Move to previous heading of the same level, and return point or nil if none."
+ (let ((level (funcall outline-level)))
+ (outline-previous-visible-heading 1)
+ (while (and (> (funcall outline-level) level)
+ (not (bobp)))
+ (outline-previous-visible-heading 1))
+ (if (< (funcall outline-level) level)
+ nil
+ (point))))
+
+(defun outline-headers-as-kill (beg end)
+ "Save the visible outline headers in region at the start of the kill ring.
+
+Text shown between the headers isn't copied. Two newlines are
+inserted between saved headers. Yanking the result may be a
+convenient way to make a table of contents of the buffer."
+ (interactive "r")
+ (save-excursion
+ (save-restriction
+ (narrow-to-region beg end)
+ (goto-char (point-min))
+ (let ((buffer (current-buffer))
+ start end)
+ (with-temp-buffer
+ (with-current-buffer buffer
+ ;; Boundary condition: starting on heading:
+ (when (outline-on-heading-p)
+ (outline-back-to-heading)
+ (setq start (point)
+ end (progn (outline-end-of-heading)
+ (point)))
+ (insert-buffer-substring buffer start end)
+ (insert "\n\n")))
+ (let ((temp-buffer (current-buffer)))
+ (with-current-buffer buffer
+ (while (outline-next-heading)
+ (unless (outline-invisible-p)
+ (setq start (point)
+ end (progn (outline-end-of-heading) (point)))
+ (with-current-buffer temp-buffer
+ (insert-buffer-substring buffer start end)
+ (insert "\n\n"))))))
+ (kill-new (buffer-string)))))))
+
+(provide 'outline)
+(provide 'noutline)
+
+;; arch-tag: 1724410e-7d4d-4f46-b801-49e18171e874
+;;; outline.el ends here
diff --git a/xemacs/ps-print-invisible.el b/xemacs/ps-print-invisible.el
new file mode 100644
index 0000000..8f005fe
--- /dev/null
+++ b/xemacs/ps-print-invisible.el
@@ -0,0 +1,225 @@
+;;; ps-print-invisible.el - addon to ps-print package that deals
+;; with invisible text printing in xemacs
+
+;; Author: Greg Chernov
+;;
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+;;
+;; Put ps-print-invisible.el on your load path.
+;; (require 'ps-print-invisible)
+;; ps-print-buffer-with-faces will not print invisible parts of the buffer.
+;; Work with invisible extents/text properties only
+;; (xemacs hideshow and noutline packages).
+
+(defun ps-generate-postscript-with-faces (from to)
+ ;; Some initialization...
+ (setq ps-current-effect 0)
+
+ ;; Build the reference lists of faces if necessary.
+ (when (or ps-always-build-face-reference
+ ps-build-face-reference)
+ (message "Collecting face information...")
+ (ps-build-reference-face-lists))
+
+ ;; Black/white printer.
+ (setq ps-black-white-faces-alist nil)
+ (and (eq ps-print-color-p 'black-white)
+ (ps-extend-face-list ps-black-white-faces nil
+ 'ps-black-white-faces-alist))
+
+ ;; Generate some PostScript.
+ (save-restriction
+ (narrow-to-region from to)
+ (ps-print-ensure-fontified from to)
+ (let ((face 'default)
+ (position to))
+ (cond
+ ((memq ps-print-emacs-type '(xemacs lucid))
+ ;; Build the list of extents...
+ ;;(debug)
+ (let ((a (cons 'dummy nil))
+ record type extent extent-list
+ (list-invisible (ps-print-find-invisible-xmas from to)))
+ (ps-x-map-extents 'ps-mapper nil from to a)
+ (setq a (sort (cdr a) 'car-less-than-car)
+ extent-list nil)
+
+ ;; Loop through the extents...
+ (while a
+ (setq record (car a)
+ position (car record)
+
+ record (cdr record)
+ type (car record)
+
+ record (cdr record)
+ extent (car record))
+
+ ;; Plot up to this record.
+ ;; XEmacs 19.12: for some reason, we're getting into a
+ ;; situation in which some of the records have
+ ;; positions less than 'from'. Since we've narrowed
+ ;; the buffer, this'll generate errors. This is a hack,
+ ;; but don't call ps-plot-with-face unless from > point-min.
+ (and (>= from (point-min))
+ (ps-plot-with-face from (min position (point-max)) face))
+
+ (cond
+ ((eq type 'push)
+ (and (or (ps-x-extent-face extent)
+ (extent-property extent 'invisible))
+ (setq extent-list (sort (cons extent extent-list)
+ 'ps-extent-sorter))))
+
+ ((eq type 'pull)
+ (setq extent-list (sort (delq extent extent-list)
+ 'ps-extent-sorter))))
+
+
+ (setq face (if extent-list
+ (let ((prop (extent-property (car extent-list) 'invisible)))
+ (if (or (and (eq buffer-invisibility-spec t)
+ (not (null prop)))
+ (and (consp buffer-invisibility-spec)
+ (or (memq prop buffer-invisibility-spec)
+ (assq prop buffer-invisibility-spec))))
+ 'emacs--invisible--face
+ (ps-x-extent-face (car extent-list))))
+ 'default)
+ from position
+ a (cdr a)))))
+
+ ((eq ps-print-emacs-type 'emacs)
+ (let ((property-change from)
+ (overlay-change from)
+ (save-buffer-invisibility-spec buffer-invisibility-spec)
+ (buffer-invisibility-spec nil)
+ before-string after-string)
+ (while (< from to)
+ (and (< property-change to) ; Don't search for property change
+ ; unless previous search succeeded.
+ (setq property-change (next-property-change from nil to)))
+ (and (< overlay-change to) ; Don't search for overlay change
+ ; unless previous search succeeded.
+ (setq overlay-change (min (ps-e-next-overlay-change from)
+ to)))
+ (setq position (min property-change overlay-change)
+ before-string nil
+ after-string nil)
+ ;; The code below is not quite correct,
+ ;; because a non-nil overlay invisible property
+ ;; which is inactive according to the current value
+ ;; of buffer-invisibility-spec nonetheless overrides
+ ;; a face text property.
+ (setq face
+ (cond ((let ((prop (get-text-property from 'invisible)))
+ ;; Decide whether this invisible property
+ ;; really makes the text invisible.
+ (if (eq save-buffer-invisibility-spec t)
+ (not (null prop))
+ (or (memq prop save-buffer-invisibility-spec)
+ (assq prop save-buffer-invisibility-spec))))
+ 'emacs--invisible--face)
+ ((get-text-property from 'face))
+ (t 'default)))
+ (let ((overlays (ps-e-overlays-at from))
+ (face-priority -1)) ; text-property
+ (while (and overlays
+ (not (eq face 'emacs--invisible--face)))
+ (let* ((overlay (car overlays))
+ (overlay-invisible
+ (ps-e-overlay-get overlay 'invisible))
+ (overlay-priority
+ (or (ps-e-overlay-get overlay 'priority) 0)))
+ (and (> overlay-priority face-priority)
+ (setq before-string
+ (or (ps-e-overlay-get overlay 'before-string)
+ before-string)
+ after-string
+ (or (and (<= (ps-e-overlay-end overlay) position)
+ (ps-e-overlay-get overlay 'after-string))
+ after-string)
+ face-priority overlay-priority
+ face
+ (cond
+ ((if (eq save-buffer-invisibility-spec t)
+ (not (null overlay-invisible))
+ (or (memq overlay-invisible
+ save-buffer-invisibility-spec)
+ (assq overlay-invisible
+ save-buffer-invisibility-spec)))
+ 'emacs--invisible--face)
+ ((ps-e-overlay-get overlay 'face))
+ (t face)
+ ))))
+ (setq overlays (cdr overlays))))
+ ;; Plot up to this record.
+ (and before-string
+ (ps-plot-string before-string))
+ (ps-plot-with-face from position face)
+ (and after-string
+ (ps-plot-string after-string))
+ (setq from position)))))
+ (ps-plot-with-face from to face))))
+
+
+(defun ps-print-find-invisible-xmas (from to)
+ (let ((list nil))
+ (map-extents '(lambda (ex ignored)
+ (let ((prop (extent-property ex 'invisible)))
+ (if (or (and (eq buffer-invisibility-spec t)
+ (not (null prop)))
+ (or (memq prop buffer-invisibility-spec)
+ (assq prop buffer-invisibility-spec)))
+ (setq list (cons (list
+ (extent-start-position ex)
+ (extent-end-position ex))
+ list))))
+ nil)
+ (current-buffer)
+ from to nil 'start-and-end-in-region 'invisible)
+ (reverse list)))
+
+
+(defun ps-mapper (extent list)
+ ;;(debug)
+ (let ((beg (ps-x-extent-start-position extent))
+ (end (ps-x-extent-end-position extent))
+ (inv-lst list-invisible)
+ (found nil))
+ (while (and inv-lst
+ (not found))
+ (let ((inv-beg (caar inv-lst))
+ (inv-end (cadar inv-lst)))
+ (if (and (>= beg inv-beg)
+ (<= end inv-end)
+ (not (extent-property extent 'invisible)))
+ (setq found t))
+ (setq inv-lst (cdr inv-lst))))
+ (if (not found)
+ (nconc list
+ (list (list beg 'push extent)
+ (list end 'pull extent)))))
+ nil)
+
+
+(provide 'ps-print-invisible)
+
+
+;;; ps-print-invisible.el ends here \ No newline at end of file
012'>14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16084 16085 16086 16087 16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 16118 16119 16120 16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169 16170 16171 16172 16173 16174 16175 16176 16177 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215 16216 16217 16218 16219 16220 16221 16222 16223 16224 16225 16226 16227 16228 16229 16230 16231 16232 16233 16234 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 16404 16405 16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16495 16496 16497 16498 16499 16500 16501 16502 16503 16504 16505 16506 16507 16508 16509 16510 16511 16512 16513 16514 16515 16516 16517 16518 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 16531 16532 16533 16534 16535 16536 16537 16538 16539 16540 16541 16542 16543 16544 16545 16546 16547 16548 16549 16550 16551 16552 16553 16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 16567 16568 16569 16570 16571 16572 16573 16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 16590 16591 16592 16593 16594 16595 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 16607 16608 16609 16610 16611 16612 16613 16614 16615 16616 16617 16618 16619 16620 16621 16622 16623 16624 16625 16626 16627 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 16640 16641 16642 16643 16644 16645 16646 16647 16648 16649 16650 16651 16652 16653 16654 16655 16656 16657 16658 16659 16660 16661 16662 16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 16682 16683 16684 16685 16686 16687 16688 16689 16690 16691 16692 16693 16694 16695 16696 16697 16698 16699 16700 16701 16702 16703 16704 16705 16706 16707 16708 16709 16710 16711 16712 16713 16714 16715 16716 16717 16718 16719 16720 16721 16722 16723 16724 16725 16726 16727 16728 16729 16730 16731 16732 16733 16734 16735 16736 16737 16738 16739 16740 16741 16742 16743 16744 16745 16746 16747 16748 16749 16750 16751 16752 16753 16754 16755 16756 16757 16758 16759 16760 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 16773 16774 16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 16786 16787 16788 16789 16790 16791 16792 16793 16794 16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 16817 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16838 16839 16840 16841 16842 16843 16844 16845 16846 16847 16848 16849 16850 16851 16852 16853 16854 16855 16856 16857 16858 16859 16860 16861 16862 16863 16864 16865 16866 16867 16868 16869 16870 16871 16872 16873 16874 16875 16876 16877 16878 16879 16880 16881 16882 16883 16884 16885 16886 16887 16888 16889 16890 16891 16892 16893 16894 16895 16896 16897 16898 16899 16900 16901 16902 16903 16904 16905 16906 16907 16908 16909 16910 16911 16912 16913 16914 16915 16916 16917 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 16931 16932 16933 16934 16935 16936 16937 16938 16939 16940 16941 16942 16943 16944 16945 16946 16947 16948 16949 16950 16951 16952 16953 16954 16955 16956 16957 16958 16959 16960 16961 16962 16963 16964 16965 16966 16967 16968 16969 16970 16971 16972 16973 16974 16975 16976 16977 16978 16979 16980 16981 16982 16983 16984 16985 16986 16987 16988 16989 16990 16991 16992 16993 16994 16995 16996 16997 16998 16999 17000 17001 17002 17003 17004 17005 17006 17007 17008 17009 17010 17011 17012 17013 17014 17015 17016 17017 17018 17019 17020 17021 17022 17023 17024 17025 17026 17027 17028 17029 17030 17031 17032 17033 17034 17035 17036 17037 17038 17039 17040 17041 17042 17043 17044 17045 17046 17047 17048 17049 17050 17051 17052 17053 17054 17055 17056 17057 17058 17059 17060 17061 17062 17063 17064 17065 17066 17067 17068 17069 17070 17071 17072 17073 17074 17075 17076 17077 17078 17079 17080 17081 17082 17083 17084 17085 17086 17087 17088 17089 17090 17091 17092 17093 17094 17095 17096 17097 17098 17099 17100 17101 17102 17103 17104 17105 17106 17107 17108 17109 17110 17111 17112 17113 17114 17115 17116 17117 17118 17119 17120 17121 17122 17123 17124 17125 17126 17127 17128 17129 17130 17131 17132 17133 17134 17135 17136 17137 17138 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 17151 17152 17153 17154 17155 17156 17157 17158 17159 17160 17161 17162 17163 17164 17165 17166 17167 17168 17169 17170 17171 17172 17173 17174 17175 17176 17177 17178 17179 17180 17181 17182 17183 17184 17185 17186 17187 17188 17189 17190 17191 17192 17193 17194 17195 17196 17197 17198 17199 17200 17201 17202 17203 17204 17205 17206 17207 17208 17209 17210 17211 17212 17213 17214 17215 17216 17217 17218 17219 17220 17221 17222 17223 17224 17225 17226 17227 17228 17229 17230 17231 17232 17233 17234 17235 17236 17237 17238 17239 17240 17241 17242 17243 17244 17245 17246 17247 17248 17249 17250 17251 17252 17253 17254 17255 17256 17257 17258 17259 17260 17261 17262 17263 17264 17265 17266 17267 17268 17269 17270 17271 17272 17273 17274 17275 17276 17277 17278 17279 17280 17281 17282 17283 17284 17285 17286 17287 17288 17289 17290 17291 17292 17293 17294 17295 17296 17297 17298 17299 17300 17301 17302 17303 17304 17305 17306 17307 17308 17309 17310 17311 17312 17313 17314 17315 17316 17317 17318 17319 17320 17321 17322 17323 17324 17325 17326
2000-05-29  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (free_realized_faces): Block/unblock input.
	(free_realized_multibyte_face): Ditto.

2000-05-29  Dave Love  <fx@gnu.org>

	* textprop.c (Qkeymap): New variable.
	(syms_of_textprop): Intern it.

	* keymap.c: Include intervals.h.
	(Fkey_binding, Fwhere_is_internal): Deal with `keymap' property.

	* Makefile.in (keymap.o): Depend on intervals.h.

	* keyboard.c (menu_bar_items, tool_bar_items)
	(Fexecute_extended_command): Deal with `keymap' property.
	(read_key_sequence): Track map from `keymap' property as well as
	`local_map'.

	* intervals.c (get_local_map): Extra arg to allow looking for
	`keymap' too.

	* intervals.h (map_property): New enum.
	(get_local_map): Extra arg using it.
	(Qkeymap): Declare.

	* lisp.h (get_local_map): Don't declare here.

2000-05-29  Kenichi Handa  <handa@etl.go.jp>

	* Makefile.in (callproc.o): Depend on composite.h.

	* callproc.c: Include composite.h.
	(Fcall_process): Handle composition correctly.

	* coding.h (coding_allocate_composition_data): Extern it.
	(coding_restore_composition): Likewise.

	* coding.c (DECODE_COMPOSITION_START): If coding->cmp_data is not
	yet allocated, finish decoding with result
	CODING_FINISH_INSUFFICIENT_CMP.
	(coding_allocate_composition_data): Make it non-static.
	(coding_restore_composition): Likewise.

2000-05-29  Eli Zaretskii  <eliz@is.elta.co.il>

	* charset.c (syms_of_charset): Revert last change.

2000-05-28  Eli Zaretskii  <eliz@is.elta.co.il>

	* term.c (produce_glyphs): Treat characters from the eight-bit-*
        charsets as unibyte, with 1-column screen width.  Sent by Kenichi
        Handa.

2000-05-28  Eli Zaretskii  <eliz@is.elta.co.il>

	* charset.c (syms_of_charset): Set width of character sets
	eight-bit-control and eight-bit-graphic to 1 column.

2000-05-26  Gerd Moellmann  <gerd@gnu.org>

	* config.in (HAVE_SPEED_T): New define.

	* sysdep.c, terminfo.c (ospeed) [HAVE_SPEED_T]: Declare as
	`extern speed_t'.

2000-05-26  Dave Love  <fx@gnu.org>

	* coding.c (shrink_decoding_region): Initialize eol_conversion.

	* data.c (Qsubrp, Qmany, Qunevalled): New variables.
	(Fsubr_arity): New function.
	(syms_of_data): Install them.

2000-05-26  Kenichi Handa  <handa@etl.go.jp>

	* charset.c (init_charset_once): Set the table bytes_by_char_head
	correctly.

	* fontset.c (syms_of_fontset): Adjust the font name for ascii of
	the default fontset to what Emacs uses by default.
	(check_registry_encoding): This function deleted.
	(Fset_fontset_font): Remove the adhoc condition for the default
	fontset.  Allow cons in FONTNAME.

	* fns.c (map_char_table): Ignore char-table entries for
	charsets eight-bit-control and eight-bit-graphic.

2000-05-25  Ken Raeburn  <raeburn@gnu.org>

	* emacs.c (main): Initialize keyboard syms before initializing
	window code, so face names are available.

2000-05-25  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.c (at_begline_loc_p): Also recognize the \\(?:^ case
	of an anchor at the beginning of a shy-group.

2000-05-25  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (handle_invisible_prop): Don't try to skip over
	invisible text if end of text is already reached.

2000-05-25  Dave Love  <fx@gnu.org>

	* xdisp.c (Fdump_glyph_matrix): Declare the arg.

	* coding.c (encode_eol): Add null statement after label.

2000-05-25  Eli Zaretskii  <eliz@is.elta.co.il>

	* w16select.c (Fw16_set_clipboard_data): Fix the change from
	2000-05-20.

2000-05-25  Kenichi Handa  <handa@etl.go.jp>

	* ccl.c (ccl_driver): Fix previous change.

2000-05-25  Kenichi Handa  <handa@etl.go.jp>

	* coding.c (run_pre_post_conversion_on_str): Set point to the
	beginning of buffer before calling coding->post_read_conversion.
	(decode_coding_string): Give correct args to
	run_pre_post_conversion_on_str.
	(encode_coding_string): Likewise.

	* ccl.c (ccl_driver) <CCL_ReadMultibyteChar2>
	<CCL_WriteMultibyteChar2>:  Handle charsets eight-bit-control and
	eight-bit-graphic correctly.

2000-05-24  Kenichi HANDA  <handa@etl.go.jp>

	* fileio.c (Finsert_file_contents): Even if a file is not found,
	execute codes for setting up coding system.  Call
	after-insert-file-functions unconditionally.

2000-05-24  Gerd Moellmann  <gerd@gnu.org>

	* callproc.c, emacs.c, sysdep.c (setpgrp): Don't define if USG and
	BSD_PGRPS are not defined.

2000-05-24  Kenichi Handa  <handa@etl.go.jp>

	* charset.c (update_charset_table): Accept nil in LONG_NAME and
	DESCRIPTION.
	(syms_of_charset): Avoid building same strings.

2000-05-23  Gerd Moellmann  <gerd@gnu.org>

	* lread.c (Fload): Add a comment about the meaning of
	Vuser_init_file being t.

	* puresize.h (BASE_PURESIZE): Increase to 675000.

	* s/gnu-linux.h (setpgrp): Don't define it here because this
	prevents compilation on GNU/Linux systems with glib 2.2.

	* callproc.c, emacs.c, sysdep.c (setpgrp) [HAVE_SETPGID]: Define
	as setpgid.
	
2000-05-23  Eli Zaretskii  <eliz@is.elta.co.il>

	* Makefile.in (SOME_MACHINE_LISP): Add disp-table.elc,
	dos-vars.elc, ccl.elc, and codepage.elc, all loaded by the MS-DOS
	version.
	(MSDOS_SUPPORT): Add dos-vars.elc, ccl.elc, and codepage.elc.

2000-05-23  Kenichi Handa  <handa@etl.go.jp>

	* syntax.c (skip_chars): Use FETCH_STRING_CHAR_ADVANCE
	unconditionally.

	* msdos.c (IT_write_glyphs): Set coding->src_multibyte to 1.

	* term.c (encode_terminal_code): Set coding->src_multibyte
	properly.

	* coding.c (encode_eol): Fix a bug of DOS style EOL encoding.

2000-05-22  Kenichi Handa  <handa@etl.go.jp>

	* keyboard.c (read_char): Allow character codes 128..255 to be
	handled by input-method-function.

	* insdel.c (adjust_markers_for_replace): Fix previous change.
	(adjust_after_replace): If PREV_TEXT is nil, call
	adjust_markers_for_insert, not adjust_markers_for_replace.

2000-05-20  NIIBE Yutaka  <gniibe@mri.co.jp>
	
	* s/gnu-linux.h (UNIX98_PTYS) [HAVE_GRANDPT]: Define.
	(PTY_ITERATION, PTY_NAME_SPRINTF, PTY_OPEN, PTY_TTY_NAME_SPRINTF)
	[HAVE_GRANDPT]: Define.
	(C_SWITCH_SYSTEM): Add -D_XOPEN_SOURCE.

	* sysdep.c (setup_pty): Treat case that UNIX98_PTYS is defined
	like SYSV_PTYS.

	* config.in (HAVE_GRANDPT, HAVE_GETPT): New defines.

	* process.c (toplevel) [UNIX98_PTYS]: Include stdlib.h.

2000-05-20  Kenichi Handa  <handa@etl.go.jp>

	The following changes are to handle 8-bit characters in a
	multibyte buffer/string without facing with byte combining
	problem.  Two new charsets eight-bit-control (for 0x80..0x9F) and
	eight-bit-graphic (for 0xA0..0xFF) are introduced.

	* Makefile.in (fns.o): Depend on charset.h.

	* alloc.c (Fmake_byte_code): If BYTECODE-STRING is multibyte,
	convert it to unibyte.
	(make_string): Use parse_str_as_multibyte, not chars_in_text.

	* buffer.c (advance_to_char_boundary): Don't use DEC_POS to find a
	apparent char boundary.
	(Fset_buffer_multibyte): Convert 8-bit characters in the range
	0x80..0x9F to/from multibyte form.

	* bytecode.c (Fbyte_code): If arg BYTESTR is multibyte, convert it
	to unibyte.

	* callproc.c (Fcall_process): Always encode an argument string if
	it is multibyte.  Setup src_multibyte and dst_multibyte members of
	process_coding properly.

	* category.c (Fmodify_category_entry): Use SPLIT_CHAR, not
	SPLIT_NON_ASCII_CHAR.

	* ccl.c (CCL_WRITE_CHAR): Be sure to write single byte characters
	as is.
	(CCL_MAKE_CHAR): Use MAKE_CHAR, not MAKE_NON_ASCII_CHAR.

	* charset.c (Qeight_bit_control, Qeight_bit_graphic): New
	variables.
	(SPLIT_CHARACTER_SEQ): This macro deleted.
	(SPLIT_MULTIBYTE_SEQ): Assume that multibyte sequence at STR is
	valid.
	(CHAR_COMPONENTS_VALID_P): Handle new charsets; eight-bit-control
	and eight-bit-graphic.
	(char_to_string): Likewise.  Signal an error for too large
	character code.
	(char_printable_p): Return 0 for 8-bit characters.
	(update_charset_table): Update iso_charset_table only when a final
	character is non-negative.
	(find_charset_in_text): Renamed from find_charset_in_str.
	Arguments and return value changed.  Callers changed.
	(Fdefine_charset): Args ISO-FINAL-CHAR and ISO-GRAPHIC-PLANE can
	be -1 if CHARSET is used only internally.
	(Fmake_char_internal): Handle new charsets; eight-bit-control and
	eight-bit-graphic.
	(Fcharset_after): Simplified.
	(char_valid_p): Use SPLIT_CHAR, not SPLIT_NON_ASCII_CHAR.
	(char_bytes): Return 2 for chars of the range 0xA0..0xFF.
	(multibyte_chars_in_text): Simplified by assuming there's no
	invalid multibyte sequence.
	(parse_str_as_multibyte, str_as_multibyte, str_to_multibyte,
	str_as_unibyte): New functions.
	(Fstring): Simpified by assuming that byte combining never
	happens.
	(init_charset_once): Initialization for
	LEADING_CODE_8_BIT_CONTROL.
	(syms_of_charset): Intern and staticpro Qeight_bit_control and
	Qeight_bit_graphic.  Include them in Vcharset_list.  Make charsets
	eight-bit-control and eight-bit-graphic.

	* charset.h (LEADING_CODE_8_BIT_CONTROL, CHARSET_8_BIT_CONTROL,
	CHARSET_8_BIT_GRAPHIC): New macros.
	(SINGLE_BYTE_CHAR_P): Make it faster by using casting.
	(CHARSET_ISO_GRAPHIC_PLANE): Use XINT instead of XFASTINT.
	(CHARSET_REVERSE_CHARSET): Likewise.
	(CHARSET_VALID_P): Handle new charsets; eight-bit-control and
	eight-bit-graphic.
	(BYTES_BY_CHAR_HEAD, WIDTH_BY_CHAR_HEAD): Optimize for ASCII.
	(CHAR_CHARSET, MAKE_CHAR, SPLIT_CHAR, CHAR_BYTES): Likewise.
	(PARSE_MULTIBYTE_SEQ) [BYTE_COMBINING_DEBUG]: Abort if we
	encounter an invalid multibyte sequence.
	(PARSE_MULTIBYTE_SEQ) [not BYTE_COMBINING_DEBUG]: Assume multibyte
	sequence is always valid.
	(MAKE_NON_ASCII_CHAR, SPLIT_NON_ASCII_CHAR): These macros Deleted.
	(UNIBYTE_STR_AS_MULTIBYTE_P, MULTIBYTE_STR_AS_UNIBYTE_P): New
	macros.
	(CHAR_STRING): For 8-bit characters, call char_to_string.
	(INC_POS) [not BYTE_COMBINING_DEBUG]: Faster version.  Assume
	multibyte sequence is always valid.
	(BUF_INC_POS) [not BYTE_COMBINING_DEBUG]: Likewise.
	(parse_str_as_multibyte, str_as_multibyte, str_to_multibyte,
	str_as_unibyte): Extern them.
	(BCOPY_SHORT): Fix a bug.
	(CHAR_LEN): This macro deleted.  Callers changed to use
	CHAR_BYTES.
	(FETCH_STRING_CHAR_ADVANCE): Check multibyteness of STRING.
	(FETCH_STRING_CHAR_ADVANCE_NO_CHECK): New macro.
	(FETCH_CHAR_ADVANCE): Check multibyteness of the current buffer.

	* coding.c (ONE_MORE_BYTE, TWO_MORE_BYTES): Set coding->result to
	CODING_FINISH_INSUFFICIENT_SRC if there's not enough source.
	(ONE_MORE_CHAR, EMIT_CHAR, EMIT_ONE_BYTE, EMIT_TWO_BYTE,
	EMIT_BYTES): New macros.
	(THREE_MORE_BYTES, DECODE_CHARACTER_ASCII,
	DECODE_CHARACTER_DIMENSION1, DECODE_CHARACTER_DIMENSION2): These
	macros deleted.
	(CHECK_CODE_RANGE_A0_FF): This macro deleted.
	(detect_coding_emacs_mule): Use UNIBYTE_STR_AS_MULTIBYTE_P to
	check the validity of multibyte sequence.
	(decode_coding_emacs_mule): New function.
	(encode_coding_emacs_mule): New macro.
	(detect_coding_iso2022): Use ONE_MORE_BYTE to fetch a byte from
	the source.
	(DECODE_ISO_CHARACTER): Just return a character code.
	(DECODE_COMPOSITION_START): Set coding->result instead of result.
	(decode_coding_iso2022, decode_coding_sjis_big5, decode_eol): Use
	EMIT_CHAR to produced decoded characters.  Exit the loop only by
	macros ONE_MORE_BYTE or EMIT_CHAR.  Don't handle the case of last
	block here.
	(ENCODE_ISO_CHARACTER): Don't translate character here.  Produce
	only position codes for an invalid character.
	(encode_designation_at_bol): Return new destination pointer.  5th
	arg DSTP is changed to DST.
	(encode_coding_iso2022, decode_coding_sjis_big5): Get a character
	from the source by ONE_MORE_CHAR.  Don't handle the case of last
	block here.
	(DECODE_SJIS_BIG5_CHARACTER, ENCODE_SJIS_BIG5_CHARACTER): These
	macros deleted.
	(detect_coding_sjis, detect_coding_big5, detect_coding_utf_8,
	detect_coding_utf_16, detect_coding_ccl): Use ONE_MORE_BYTE and
	TWO_MORE_BYTES to fetch a byte from the source.
	(encode_eol): Pay attention to coding->src_multibyte.
	(detect_coding, detect_eol): Preserve members src_multibyte and
	dst_multibyte.
	(DECODING_BUFFER_MAG): Return 2 even for coding_type_raw_text.
	(encoding_buffer_size): Set magnification to 3 for all coding
	systems that require encoding.
	(ccl_coding_driver): For decoding, be sure that the result is
	valid multibyte sequence.
	(decode_coding): Initialize coding->errors and coding->result.
	For emacs-mule, call decode_coding_emacs_mule.  For no-conversion
	and raw-text, always call decode_eol.  Handle the case of last
	block here.  If not coding->dst_multibyte, convert the resulting
	sequence to unibyte.
	(encode_coding): Initialize coding->errors and coding->result.
	For emacs-mule, call encode_coding_emacs_mule.  For no-conversion
	and raw-text, always call encode_eol.  Handle the case of last
	block here.
	(shrink_decoding_region, shrink_encoding_region): Detect cases
	that we can't skip data more rigidly.
	(code_convert_region): Setup src_multibyte and dst_multibyte
	members of coding.  For decoding, if the buffer is multibyte,
	convert the source sequence to unibyte in advance.  For encoding,
	if the buffer is multibyte, convert the resulting sequence to
	multibyte afterward.
	(run_pre_post_conversion_on_str): New function.
	(code_convert_string): Deleted and divided into the following two.
	(decode_coding_string, encode_coding_string): New functions.
	(code_convert_string1, code_convert_string_norecord): Call one of
	above.
	(Fdecode_sjis_char, Fdecode_big5_char): Use MAKE_CHAR instead of
	MAKE_NON_ASCII_CHAR.
	(Fset_terminal_coding_system_internal,
	Fset_safe_terminal_coding_system_internal): Setup src_multibyte
	and dst_multibyte members.
	(init_coding_once): Initialize iso_code_class with new enum
	ISO_control_0 and ISO_control_1.

	* coding.h (enum iso_code_class_type): Member ISO_control_code is
	devided into ISO_control_0 and ISO_control_1.
	(struct coding_system): New members src_multibyte, dst_multibyte,
	errors, and result.  Delete member fake_multibyte.
	(CODING_REQUIRE_DECODING): Return 1 if coding->dst_multibyte is
	nonzero.
	(CODING_REQUIRE_ENCODING): Return 1 if coding->src_multibyte is
	nonzero.

	* data.c (Faref): Use SPLIT_CHAR instead of SPLIT_NON_ASCII_CHAR.
	(Faset): Likewise.

	* editfns.c (Fformat): Be sure to convert 8-bit characters to
	multibyte form.
	(Ftranspose_region) [BYTE_COMBINING_DEBUG]: Abort if byte
	combining occurs.
	(Ftranspose_region): Delete codes for handling byte combining.

	* fileio.c (Finsert_file_contents): Setup src_multibyte and
	dst_multibyte members of coding.  On handling REPLACE on unibyte
	buffer, convert the result of decode_coding to unibyte.  On
	inserting into a mutibyte buffer, always call code_convert_region.
	(e_write): Setup coding->src_multibyte according to the
	multibyteness of the source (buffer or string).

	* fns.c (concat): Handle 8-bit characters correctly.
	(Fstring_as_unibyte): Be sure to make all 8-bit characters in
	unibyte in the result.
	(Fstring_as_multibyte): Be sure to make all 8-bit characters in
	valid multibyte form in the result.
	(map_char_table): Use MAKE_CHAR instead of MAKE_NON_ASCII_CHAR.
	(Fbase64_encode_region, Fbase64_encode_string): If base64_encode_1
	return -1, signal an error.
	(base64_encode_1): New arg MULTIBYTE.  Get each character by
	CHAR_STRING_AND_LENGTH if MULTIBYTE is nonzero.  If a multibyte
	character is found, return -1.
	(Fbase64_decode_region): Delete codes for handling byte-combining.
	Treat each decoded byte as a unibyte character.
	(Fbase64_decode_string): Return unibyte string.
	(Fcompare_strings, concat, string_byte_to_char): Use
	FETCH_STRING_CHAR_ADVANCE_NO_CHECK instead off
	FETCH_STRING_CHAR_ADVANCE.
	(Fstring_lessp): Use FETCH_STRING_CHAR_ADVANCE unconditionally.
	(mapcar1): If SEQ is string, always use FETCH_STRING_CHAR_ADVANCE.

	* fontset.c (fontset_ref): Use SPLIT_CHAR instead of
	SPLIT_NON_ASCII_CHAR.
	(fontset_ref_via_base, fontset_set): Likewise

	* insdel.c (adjust_markers_for_record_delete): Deleted.
	(adjust_markers_for_insert): Argument changed.  Caller changed.
	(adjust_markers_for_replace): Likewise.
	(ADJUST_CHAR_POS, combine_bytes, byte_combining_error,
	CHECK_BYTE_COMBINING_FOR_INSERT): Deleted.
	(copy_text): Delete unused local varialbe c_save.  For converting
	to multibyte, be sure to make all 8-bit characters in valid
	multibyte form.
	(count_size_as_multibyte): Handle 8-bit characters correctly.
	(insert_1_both, insert_from_string_1, insert_from_buffer_1,
	adjust_after_replace, replace_range, del_range_2)
	[BYTE_COMBINING_DEBUG]: Abort if byte combining occurs.
	(insert_1_both, insert_from_string_1, insert_from_buffer_1,
	adjust_after_replace, replace_range, del_range_2) Delete codes for
	handling byte combining.
	(adjust_before_replace): Deleted.
	
	* keymap.c (Fsingle_key_description): Use SPLIT_CHAR instead of
	SPLIT_NON_ASCII_CHAR.
	(describe_vector): Use MAKE_CHAR instead of MAKE_NON_ASCII_CHAR.
	(Faccessible_keymaps): Use FETCH_STRING_CHAR_ADVANCE
	unconditionally.
	(Fkey_description): Likewise.

	* lread.c (read1): On reading multibyte string, be sure to make
	all 8-bit chararacters in valid multibyte form.
	(readchar): Use FETCH_STRING_CHAR_ADVANCE unconditionally.

	* print.c (print_object): Use FETCH_STRING_CHAR_ADVANCE
	unconditionally.

	* process.c (Fstart_process): GCPRO current_dir before calling
	Ffind_operation_coding_system.  Encode arguments here.
	(create_process): Don't encode arguments here.  Setup
	src_multibyte and dst_multibyte members of struct coding.
	(read_process_output): Setup src_multibyte and dst_multibyte
	members of struct coding.  If the output is to multibyte buffer,
	always decode the output of the process.  Adjust the
	representation of 8-bit characters to the multibyteness of the
	output.
	(send_process): Setup coding->src_multibyte according to the
	multibyteness of the source.

	* search.c (wordify): Use FETCH_STRING_CHAR_ADVANCE
	unconditionally.
	(Freplace_match): Use FETCH_STRING_CHAR_ADVANCE and
	FETCH_STRING_CHAR_ADVANCE_NO_CHECK appropriately.

	* term.c (produce_special_glyphs): Use CHAR_BYTES instead of
	CHAR_LEN.

	* w16select.c (Fw16_set_clipboard_data): Setup members
	src_multibyte and dst_multibyte of coding.  Adjusted for the
	change for find_charset_in_str.
	(Fw16_get_clipboard_data): Likewise.

	* w32fns.c (w32_to_x_font): Setup members src_multibyte and
	dst_multibyte of coding.
	(x_to_w32_font): Likewise.

	* w32select.c (Fw32_set_clipboard_data): Setup members
	src_multibyte and dst_multibyte of coding.  Adjusted for the
	change for find_charset_in_str.
	(Fw32_get_clipboard_data): Likewise.

	* xdisp.c (get_next_display_element): Handle 8-bit characters
	correctly.
	(next_element_from_display_vector): Use CHAR_BYTES instead of
	CHAR_LEN.
	(disp_char_vector): Use SPLIT_CHAR instead of
	SPLIT_NON_ASCII_CHAR.

	* xselect.c (selection_data_to_lisp_data): Setup members
	src_multibyte and dst_multibyte of coding.  Adjusted for the
	change for find_charset_in_str.
	(lisp_data_to_selection_data): Likewise.

2000-05-19  Gerd Moellmann  <gerd@gnu.org>

	* buffer.c (Fbury_buffer): Avoid trouble from burying a killed
	buffer.

	* dispextern.h (Vimage_types): Add extern declaration.

	* xdisp.c (Vimage_types): Moved here from xfns.c.
	(syms_of_xdisp): Move `image-types' variable here from xfns.c.

	* xfns.c (Vimages_types): Moved to xdisp.c.
	(syms_of_xfns): Move `image-types' to xdisp.c.

	* w32fns.c (Vimage_types): Removed.
	(syms_of_w32fns): Remove `image-types'.

2000-05-18  Kenichi Handa  <handa@etl.go.jp>

	* fns.c (map_char_table): Pay attention to character number of
	charset.  Check the validity of charset at the first level.   For
	leaf nodes that has nil value, call C_FUNCTION or FUNCTION with
	the default value.

	* fontset.c: Include "buffer.h".
	(fs_load_font): If the face has fontset, record the face ID in
	that fontset.
	(Finternal_char_font): New function.
	(accumulate_font_info): New function.
	(Ffontset_info): Rewritten for the new fontset implementation.
	(syms_of_fontset): Register Vdefault_fontset in the first element
	of Vfontset_table.  Include Vdefault_fontset in
	Vfontset_alias_alist.  Declare `internal-char-font' as a Lisp
	function.

2000-05-16  Dave Love  <fx@gnu.org>

	* m/iris5d.h: Deleted -- unused.

2000-05-16  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c, w32.c, print.c, msdos.c, emacs.c: Use the term
	`invalid' instead of `illegal'.

	* indent.c (Fmove_to_column): When ending within a tab, insert
	spaces first so that markers at the end of the tab get adjusted.

	* frame.c (frames_bury_buffer): Don't add a buffer to the frame's
	buffer list that wasn't selected in that frame.

	* filelock.c (get_boot_time): To obtain an 8 char file name, which
	is needed on mescaline, use a 2 char prefix, and call
	make_temp_name with second arg non-zero.

	* fileio.c (make_temp_name): New function, extracted from
	Fmake_temp_name.
	(Fmake_temp_name): Use it.

2000-05-15  Eli Zaretskii  <eliz@is.elta.co.il>

	* window.c (coordinates_in_window): Subtract 1 when computing
	right_x.

2000-05-15  Gerd Moellmann  <gerd@gnu.org>

	* Makefile.in (lisp): Add env.elc.

	* callproc.c (Fgetenv_internal): Renamed from Fgetenv.

2000-05-12  Gerd Moellmann  <gerd@gnu.org>

	* search.c (Freplace_match): Handle case of `\N' in the
	replacement when there's no group N.

2000-05-11  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (add_to_log): Don't pass the terminating NUL byte
	of the message to message_dolog.

	* keyboard.c (read_char): Don't clear current message for help
	events; let the code handling help events handle this.  Change
	code detecting help events that should be ignored.

	* xdisp.c (handle_single_display_prop): Don't try to set PT if
	we're interating over a string.

2000-05-09  Dave Love  <fx@gnu.org>

	* fileio.c (Fwrite_region): If APPEND arg is an integer, seek to
	that offset before writing.  Move gcpro region past call of
	Ffile_regular_p.

2000-05-04  Dave Love  <fx@gnu.org>

	* buffer.c (syms_of_buffer) [auto-fill-function]: Doc fix.

2000-05-04  Gerd Moellmann  <gerd@gnu.org>

	* insdel.c (insert_from_buffer_1): Adjust FROM position by number
	of inserted characters when BUF equals the current buffer, and PT
	is in front of or equal to FROM.

2000-05-03  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (handle_single_display_prop): If display property value
	is invalid, or something not supported on the frame, restore
	iterator's position to what it was initially.  Make sure to return
	0 for invalid and unsupported property values.

	* xterm.c (x_produce_glyphs) <composite chars>: Handle case
	that x_per_char_metric returns null.

2000-05-02  Gerd Moellmann  <gerd@gnu.org>

	* xterm.h (struct face): Add forward declaration.
	(struct image): Ditto.
	(image_ascent): Add prototype.

	* xterm.c (x_produce_image_glyph, x_draw_image_foreground)
	(x_draw_image_relief, x_draw_image_foreground_1): Call function
	image_ascent instead of using IMAGE_ASCENT.

	* dispextern.h (DEFAULT_IMAGE_HEIGHT): New macro.
	(IMAGE_ASCENT): Removed.

	* xfns.c (Qcenter): New variable.
	(enum image_value_type): Add IMAGE_ASCENT_VALUE.
	(parse_image_spec): Handle IMAGE_ASCENT_VALUE.
	(image_ascent): New function.
	(lookup_image): Recognize `:ascent center'.
	(xbm_format, xpm_format, pbm_format, png_format, jpeg_format)
	(tiff_format, gif_format, gs_format): Use IMAGE_ASCENT_VALUE.
	(xbm_load): Don't set image's ascent here.
	(xbm_image_p, xpm_image_p, pbm_image_p, png_image_p)
	(jpeg_image_p, tiff_image_p, gif_image_p, gs_image_p): Don't
	check ascent values here.
	(Fimagep, Flookup_image [GLYPH_DEBUG]: Removed.
	(syms_of_xfns) [GLYPH_DEBUG]: Don't defsubr removed functions.
	(syms_of_xfns): Initialize Qcenter.

	* eval.c (Fsignal): If lisp_eval_depth or spepdl_size are near
	to the limits, increase the limits.

2000-05-01  Kenichi Handa  <handa@etl.go.jp>

	* fontset.c (fs_load_font): By default, use 0x00..0x7f for ASCII.
	Check Vfont_encoding_alist against the full name of the opened
	font.

2000-04-28  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (make_cursor_line_fully_visible): Handle case of rows
	taller than the window.

2000-04-28  Kenichi Handa  <handa@etl.go.jp>

	* xfaces.c (realize_x_face): Fix the argument of the second
	xassert.  BASE_FACE may not be a face for ASCII.

2000-04-27  Gerd Moellmann  <gerd@gnu.org>

	* print.c (print_object): Treat print-length < 0 as nil.

	* Makefile.in (termcapobj): Don't use TERMCAP_OBJ.

	* s/freebsd.h (TERMCAP_OBJ): Removed.
	(LIBS_TERMCAP): Don't define for __FreeBSD_version >= 400000.

	* lread.c (read1): Don't treat period followed by certain
	characters as symbol start.

	* xfns.c (slurp_file): New function.
	(xbm_image_p): Handle case of in-memory XBM files.
	(xbm_scan): Rewritten to work on memory buffers instead of files.
	(xbm_read_bitmap_data): Renamed from xbm_read_bitmap_file_data.
	Work on memory buffers instead of files.  If DATA is null test
	if buffer looks like an in-memory XBM file.
	(xbm_load_image): Renamed from xbm_load_image_file.  Work on
	memory buffers instead of files.
	(xbm_file_p): New function.
	(xbm_load): Accept :data DATA where DATA is an in-memory XBM file.

	* lread.c (end_of_file_error): New function.
	(read1): Call it instead of signaling `end-of-file' directly.

	* print.c (print_error_message): Print data of `end-of-file' 
	with Fprinc instead of Fprin1.

2000-04-26  Ken Raeburn  <raeburn@gnu.org>

	* window.c (freeze_window_start): Check that minibuffer scroll
	window isn't nil before extracting the window structure pointer
	from it.

	* undo.c (record_delete): If we hit the end of the undo list, stop
	picking elements apart.

2000-04-26  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (display_line): If lines are continued, restore
	iterator's ascent/descent information to the values before the
	first glyph not fitting on the line.

2000-04-25  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (try_window_id) <all changes above window start>: Adjust
	positions in glyph matrix.  Don't compute new window end
	positions.

	* dispnew.c (increment_matrix_positions): Renamed from
	increment_glyph_matrix_buffer_positions.
	(increment_row_positions): Renamed from
	increment_glyph_row_buffer_positions.

	* dispextern.h: Change names of renamed functions from dispnew.c
	in prototypes.

2000-04-24  Gerd Moellmann  <gerd@gnu.org>

	* fileio.c (Fdo_auto_save): Create directories for auto-save
	list file if necessary.

	* xdisp.c (init_iterator): Set iterator's extra_line_spacing
	from buffer or frame.
	(automatic_hscrolling_p): New variable.
	(hscroll_windows): Scroll windows horizontally only if automatic
	hscrolling is allowed.
	(syms_of_xdisp): New variable `automatic-hscrolling'.

	* frame.h (struct frame): Add member extra_line_spacing.

	* xfns.c (x_set_line_spacing): New function.
	(Fx_create_frame): Set line spacing from resources.
	(Qline_spacing): New variable.
	(syms_of_xfns): Initialize Qline_spacing.
	
	* emacs.c (USAGE2): Add `--line-spacing' and `-lsp'.

	* buffer.c (init_buffer_once): Handle extra_line_spacing.
	(syms_of_buffer): Add `default-line-spacing' and `line-spacing'.
	(reset_buffer): Don't initialize extra2 and extra3.  Initialize
	extra_line_spacing from default value.
	(init_buffer_once): Initialize default value of extra_line_spacing.

	* buffer.h (struct buffer): Add extra_line_spacing, remove extra2
	and extra3.

	* xterm.c (x_produce_glyphs): Remove reference to struct it's
	prompt_width.  Add extra line spacing.

	* term.c (produce_glyphs): Remove reference to struct it's
	prompt_width.

	* dispextern.h (struct it): Remove member prompt_width, add
	extra_line_spacing.

2000-04-22  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (update_frame_line): When writing a whole line, make
	sure cursor is in the right row afterwards, otherwise a use of
	capability `ch' in cmgoto might leave the cursor in the row below.

2000-04-21  Gerd Moellmann  <gerd@gnu.org>

	* lisp.h (struct Lisp_Buffer_Cons): Remove.

	* keyboard.c (timer_check): Fix typo in comment.

2000-04-21  Kenichi Handa  <handa@etl.go.jp>

	* fontset.c (Fset_fontset_font): Fix docstring.  Local variable
	name change: ch -> character.

2000-04-20  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (echo_message_buffer): New variable.
	(echo_now): Set echo_message_buffer to the echo area buffer used
	to display the echo.
	(cancel_echoing): Reset echo_message_buffer to nil.
	(read_char): Code rewritten that handles canceling an echo or
	echoing a dash, respectively.

	* fileio.c (Ffile_writable_p) [WINDOWSNT]: Return nil if parent
	directory doesn't exist.

2000-04-19  Dave Love  <fx@gnu.org>

	* fns.c (syms_of_fns): Defsubr mapc.
	(concat): Don't allow numeric args.
	(Fconcat): Doc change.

2000-04-19  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.c (re_match_2_internal): Don't shorten the strings anymore,
	instead define end_match(1|2) more carefully.
	Use GET_CHAR_BEFORE_2 for `begline'.

2000-04-19  Gerd Moellmann  <gerd@gnu.org>

	* frame.h (SELECTED_FRAME): Change definition to compile cleanly
	on 64-bit systems where NULL is defined as `0'.

	* xdisp.c (with_echo_area_buffer): Add more `int' parameters for
	the `variable argument list' to make it work on Alpha.

	* m/alpha.h (_LP64) [!_LP64]: Define.
	(ORDINARY_LINK): Define for NetBSD.

	* m/macppc.h (ORDINARY_LINK): Define for NetBSD.
	
2000-04-19  Dave Love  <fx@gnu.org>

	* s/bsd386.h, s/freebsd.h, s/gnu.h, s/netbsd.h: Revert 2000-04-14
	change.

	* Makefile.in (LIBS): Don't use.
	(GETLOADAVG_OBJ): Define again.
	(otherobj): Add GETLOADAVG_OBJ.

	* buffer.c (Fmake_indirect_buffer): Escape newline in doc.

2000-04-18  Gerd Moellmann  <gerd@gnu.org>

	* lread.c (read_filtered_event): Cancel and start busy cursor.

	* xterm.c (x_produce_glyphs) <ASCII chars>: Take into account 
	that the per-character metrics may be null.

2000-04-17  Gerd Moellmann  <gerd@gnu.org>

	* buffer.c (clone_per_buffer_values): New function.
	(Fmake_indirect_buffer): Add optional argument CLONE.  Call
	clone_per_buffer_values if CLONE is not nil.

	* xfaces.c (Ftty_suppress_bold_inverse_default_colors): Doc fix.

2000-04-16  Dave Love  <fx@gnu.org>

	* Makefile.in: Remove obsolete localcpp stuff.
	(GETLOADAVG_OBJ): Don't define.
	(obj): Move LIBOBJS...
	(otherobj): ... to here.
	(MSDOS_OBJ): Convert to make variable -- preprocessing zapped
	whitespace-only lines after the continuation (Irix).

2000-04-14  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (xpm_load) [DEBUG_X_COLORS]: Register colors.

	* s/freebsd.h (LD_SWITCH_SYSTEM): Add `-L /usr/local/lib'.

2000-04-14  Dave Love  <fx@gnu.org>

	* s/aix3-1.h, s/bsd4-2.h, s/bsd4-3.h, s/cxux.h, s/dgux.h, s/gnu.h:
	* s/hpux.h, s/iris3-5.h, s/iris3-6.h, s/irix3-3.h, s/rtu.h:
	* s/unipl5-0.h, s/unipl5-2.h, s/usg5-0.h, s/usg5-2-2.h, s/usg5-2.h:
	* s/usg5-3.h, s/xenix.h, s/umax.h: Don't define autoconfiscated
	NLIST_STRUCT.

	* s/bsd386.h, s/freebsd.h, s/gnu.h, s/netbsd.h: Don't define
	autoconfiscated HAVE_GETLOADAVG.

	* s/nextstep.h, s/sco4.h, s/sco5.h: Don't define autoconfiscated
	BROKEN_MKTIME.

2000-04-14  Gerd Moellmann  <gerd@gnu.org>

	* filelock.c (MAKE_LOCK_NAME): Allocate 2 more bytes.
	(fill_in_lock_file_name): Avoid existing files that aren't
	links.

2000-04-14  Dave Love  <fx@gnu.org>

	* Makefile.in (LIBS, LIBOBJS): New variable.
	(INTERVAL_SRC): Convert to make variable.
	(INTERVAL_OBJ, MKTIME_OBJ, FLOAT_SUPPORT, FACE_SUPPORT)
	(HAVE_X_WINDOWS, OBJECTS_SYSTEM): Remove.
	(obj): Substitute INTERVAL_OBJ, add MKTIME_OBJ, GETLOADAVG_OBJ and
	add LIBOBJS.
	(SOME_MACHINE_OBJECTS): Remove interval stuff.
	(lisp): Substitute FACE_SUPPORT, FLOAT_SUP.
	(shortlisp): Add facemenu, float-sup, frame.
	(SOME_MACHINE_LISP): Remove them from here.
	(LIBES): Change unused LDLIBS to autoconf LIBS.

	* config.in: Add BROKEN_MKTIME, NLIST_STRUCT, NLIST_NAME_UNION.

2000-04-14  Kenichi Handa  <handa@etl.go.jp>

	* composite.c (update_compositions): If FROM and TO are not in a
	valid range, do nothing.

2000-04-13  Gerd Moellmann  <gerd@gnu.org>

	* tparam.c (tparam1): Abort when encountering an unknown
	`%'-specifier.

	* s/freebsd.h (TERMCAP_OBJ) [__FreeBSD__ >= 4]: Define as
	terminfo.o.

	* Makefile.in (termcapobj) [LIBS_TERMCAP && TERMCAP_OBJ]: Define
	as TERMCAP_OBJ.

2000-04-13  Eli Zaretskii  <eliz@is.elta.co.il>

	* fileio.c (a_write): Remove redundant semi-colons.
	(e_write): Return -1 if failed to write all the data.
	This fixes the changes made at 1999-12-15.

2000-04-12  Dave Love  <fx@gnu.org>

	* fns.c (mapcar1): Test for null vals to support mapc.
	(Fmapc): New function.

2000-04-12  Eli Zaretskii  <eliz@is.elta.co.il>

	* msdos.c (NUM_MOUSE_BUTTONS): Define.
	(IT_frame_up_to_date): Support the buffer local value of
	cursor-type, if defined.

2000-04-10  Dave Love  <fx@gnu.org>

	* editfns.c (preceding-char, following-char): Doc fix.

2000-04-10  Ken Raeburn  <raeburn@gnu.org>

	* Makefile.in (temacs): Revert 2000-03-12 change.

2000-04-10  Jason Rumney  <jasonr@gnu.org>

	* xfaces.c (realize_face): Change FRAME_X_P to FRAME_WINDOW_P.

2000-04-10  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (setup_echo_area_for_printing): Choose an echo
	area buffer, if it's not set up yet.

	* indent.c (compute_motion): Set immediate_quit.

2000-04-09  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (tty_suppress_bold_inverse_default_colors_p): New
	variable.
	(realize_tty_face): Suppress boldness if colors are the inverse of
	the default colors, and tty_suppress_bold_inverse_default_colors_p
	is set.
	(Ftty_suppress_bold_inverse_default_colors): New function.
	(syms_of_xfaces): Defsubr it.

	* buffer.c (Frestore_buffer_modified_p): New function.
	(syms_of_buffer): Defsubr it.

2000-04-08  Ken Raeburn  <raeburn@gnu.org>

	* charset.c (Fmake_char_internal): CHAR_COMPONENTS_VALID_P takes a
	charset id (int) argument, not a charset (Lisp_Object).

	* coding.h (code_convert_string): Declare.
	* coding.c (code_convert_string_norecord): Pass an int, not a lisp
	object, as the fourth argument to code_convert_string.

	* fontset.c (make_fontset_for_ascii_face): Use XINT on return
	value.
	(Fset_fontset_font): Use EQ to compare lisp objects.

2000-04-05  Ken Raeburn  <raeburn@gnu.org>

	* intervals.h (SET_INTERVAL_PARENT): Use INT_LISPLIKE to test for
	a pointer that looks like a lisp object.
	(SET_INTERVAL_OBJECT): Don't explicitly compare the object with
	zero, instead see whether it's an integer object, since they can't
	have intervals.
	(GET_INTERVAL_OBJECT): Simply assign to the destination.

	* dispnew.c (allocate_matrices_for_frame_redisplay,
	direct_output_forward_char): Use X(U)INT and make_number as needed
	to convert between (unsigned) int values and lisp integers.
	* keyboard.c (read_key_sequence): Likewise.
	* lread.c (substitute_object_recurse): Likewise.
	* fns.c (concat, hash_lookup, hash_remove): Likewise.
	* minibuf.c (do_completion, Fminibuffer_complete_word,
	Fminibuffer_completion_help): Likewise.
	* term.c (produce_special_glyphs): Likewise.

	* fileio.c (Fwrite_region): Use EQ when comparing lisp objects.
	* print.c (print_preprocess, print_object): Likewise.

	* search.c (compile_pattern): Use NILP when checking for nil.

	* lisp.h (make_number) [!NO_UNION_TYPE && __GNUC__ >= 2 &&
	__OPTIMIZE__]: Provide a GNU C macro version that handles
	lisp-object unions.
	(XSET) [!NO_UNION_TYPE]: Set the value field first, then the type
	field, to better cope with ENABLE_CHECKING and calls that modify a
	Lisp_Object using its old value.

2000-04-04  Gerd Moellmann  <gerd@gnu.org>

	* window.c (compare_window_configurations): Signal an error
	if parameters C1 or C2 aren't window configurations.

	* bytecode.c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
	AFTER_POTENTIAL_GC calls around calls to functions that can
	signal an error and thus invoke the debugger.

2000-04-03  Gerd Moellmann  <gerd@gnu.org>

	* fns.c (Fbase64_decode_region, Fbase64_decode_string): Signal
	an error if decoding fails.

	* keyboard.c (lispy_mouse_names): Variable removed.
	(Vlispy_mouse_stem): New variable.
	(syms_of_keyboard): Initialize Vlispy_mouse_stem.
	(make_lispy_event) <mouse_click, scroll_bar_click>: Don't abort
	for any mouse button number.  Increase size of mouse_syms and
	button_down_location as needed.  Call modify_event_symbol with
	different arguments.
	(make_lispy_event) <scroll_bar_click> [USE_TOOLKIT_SCROLL_BARS]:
	Call modify_event_symbol with different arguments.
	(make_lispy_event) <w32_scroll_bar_click> [WINDOWSNT]: Don't abort
	for any button number.  Call modify_event_symbol with different
	arguments.
	(modify_event_symbol): Rename NAME_ALIST to NAME_ALIST_OR_STEM.
	Accept a string for NAME_ALIST_OR_STEM.

	* lisp.h (larger_vector): Add prototype.

	* fns.c (larger_vector): Make externally visible.

	* termhooks.h (NUM_MOUSE_BUTTONS): Removed.

2000-04-02  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.c (PTR_TO_OFFSET) [!emacs]: Remove.
	(RE_MULTIBYTE_P, RE_STRING_CHAR_AND_LENGTH): New macros.
	(GET_CHAR_BEFORE_2): Moved from charset.h plus fixed minor bug when
	we are between str1 and str2.
	(MAX_MULTIBYTE_LENGTH, CHAR_STRING) [!emacs]: Provide trivial default.
	(PATFETCH): Use `TRANSLATE'.
	(PATFETCH_RAW): Fetch multibyte char if applicable.
	(PATUNFETCH): Remove.
	(regex_compile): Rely on PATFETCH to do most of the multibyte magic.
	When writing a char, write it directly into the pattern buffer rather
	than going needlessly through a temp char-array.
	(re_match_2_internal): Similarly, rely on RE_STRING_CHAR to do the
	multibyte magic and remove the useless `#ifdef emacs'.
	(bcmp_translate): Don't compare as multibyte chars when in a unibyte
	buffer.

	* regex.h (struct re_pattern_buffer): Make field `multibyte'
	conditional on `emacs'.

	* charset.h (GET_CHAR_BEFORE_2): Moved to regex.c.

2000-04-01  Ken Raeburn  <raeburn@gnu.org>

	* alloc.c (MARK_STRING, UNMARK_STRING, STRING_MARKED_P): Expand
	non-union-type versions of XMARK and friends here, because XMARK
	and friends won't work on an integer field if NO_UNION_TYPE is not
	defined.
	(make_number): Define as a function if it's not defined as a
	macro.

	* composite.c (run_composite_function): Use NILP when checking for
	nil.
	(syms_of_composite): Delete local var NARGS, pass an int as first
	argument to Fmake_hash_table.

	* editfns.c (text_property_stickiness): Use NILP to test
	Lisp_Object boolean value.
	(Fmessage_or_box): Don't use NILP to test int variable.
	(Fformat): Use a temporary variable to avoid ENABLE_CHECKING
	problems reading from and changing the same lisp value in an
	XSETSTRING call.

2000-04-01  Gerd Moellmann  <gerd@gnu.org>

	* term.c (TN_no_color_video): New variable.
	(term_init): Intitialize TN_no_color_video.
	(enum no_color_bit): New enumeration.
	(MAY_USE_WITH_COLORS_P): New macro.
	(turn_on_face): Use it to determine if attributes may be used
	combined with colors.

2000-04-01  Ken Raeburn  <raeburn@gnu.org>

	* window.c (CURBEG, CURSIZE): Don't overload lisp object lvalues
	with int lvalues via casts; instead, just yield lisp object
	lvalues.
	(enlarge_window): Variable sizep now points to Lisp_Object.  Use
	proper accessor macros.
	(shrink_window_lowest_first): w->top is Lisp_Object; use XINT.
	(grow_mini_window): Fix typo getting int value of root->height.

	* xdisp.c (compute_string_pos): Fix order of arguments to
	string_pos_nchars_ahead.
	(handle_fontified_prop, add_to_log): Pass int, not Lisp_Object, as
	count arg to variable-arg routines like Frun_hook_with_args and
	Fformat.
	(back_to_previous_visible_line_start)
	(build_desired_tool_bar_string): Pass Lisp_Object, not int, to
	fixed-arg routines like Fget_char_property and Fmake_string.
	(reconsider_clip_changes): Use XINT when comparing integer lisp
	objects, or passing them as int arguments.
	(mark_window_display_accurate, insert_left_trunc_glyphs)
	(append_space, extend_face_to_end_of_line): Use make_number when
	storing or passing integer values as lisp objects.
	(set_cursor_from_row, highlight_trailing_whitespace): Use
	INTEGERP, not implicit test against zero, for glyph object.
	(try_window_id): Don't use make_number when we want an int value.

	* xfaces.c (xlfd_symbolic_value): Make last argument a
	Lisp_Object, to be consistent with callers.
	(Fbitmap_spec_p): Use XINT to get numeric value of height.
	(lface_hash): Apply XFASTINT to lisp values before folding in.

	* xfns.c (Fx_show_tip): Use make_number to get lisp objects to
	fill in window width and height.  Pass an int, not a lisp object,
	as first arg to Finsert.

2000-04-01  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (realize_basic_faces): Block input while realizing
	the faces.

	* keyboard.c (lispy_mouse_names): Add additional mouse names.

	* termhooks.h (NUM_MOUSE_BUTTONS): Increase to 15.

2000-03-31  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_produce_glyphs): When displaying unibyte text
	or ASCII, handle case that per-char metric is null.

2000-03-30  Ken Raeburn  <raeburn@gnu.org>

	* lisp.h (NO_UNION_TYPE) [ENABLE_CHECKING]: Undef.

	* lisp.h (XCONS, XSTRING, XSYMBOL, XFLOAT, XPROCESS, XWINDOW,
	XSUBR, XBUFFER): Verify correct object type before returning
	pointer, using eassert.
	* frame.h (XFRAME): Likewise.

	* buffer.c (Frename_buffer, Fset_buffer_multibyte,
	swap_out_buffer_local_variables, Fmove_overlay): Don't apply
	XSYMBOL, XBUFFER, etc, to values that may be nil or of the wrong
	type.
	* data.c (set_internal): Likewise.
	* dispextern.h (WINDOW_WANTS_MODELINE_P,
	WINDOW_WANTS_HEADER_LINE_P): Likewise.
	* fileio.c (auto_save_1): Likewise.
	* insdel.c (check_markers): Likewise.
	* marker.c (buf_charpos_to_bytepos, unchain_marker): Likewise.
	* undo.c (record_insert): Likewise.
	* vmsproc.c (child_sig): Likewise.
	* window.c (unshow_buffer, window_loop): Likewise.
	* xterm.c (x_erase_phys_cursor): Likewise.

2000-03-30  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (free_image_cache): Free the cache structure itself
	last, after all its members have been freed.

	* lisp.h (xstrdup): Add prototype.

	* alloc.c (xstrdup): Moved here from xfaces.c.
	(allocating_for_lisp): Variable removed.
	(lisp_malloc): Block input around the calls to malloc and
	mem_insert.

	* xfaces.c (realize_tty_face): Use find_symbol_value instead
	of Fsymbol_value.
	(xstrdup): Moved to alloc.c.

2000-03-29  Ken Raeburn  <raeburn@gnu.org>

	* scroll.c (CHECK_BOUNDS): Renamed from CHECK.

	* emacs.c (main): Fix sense of no-loadup test.

	* config.in (ENABLE_CHECKING): Undef.

	* lisp.h (struct interval): Replace "parent" field with a union of
	interval pointer and Lisp_Object; add new bitfield to use as
	discriminant.  Change other flag fields to bitfields.
	(CHECK): New macro for consistency checking.  If ENABLE_CHECKING
	is defined and the supplied test fails, print a message and
	abort.
	(eassert): New macro.  Use CHECK to provide an assert-like
	facility.

	* intervals.h (NULL_INTERVAL_P): Now applies only to real interval
	pointers; abort if the value looks like a lisp object.
	(NULL_INTERVAL_P, NULL_PARENT, HAS_PARENT, HAS_OBJECT, SET_PARENT,
	SET_OBJECT, INTERVAL_PARENT, GET_INTERVAL_OBJECT, COPY_PARENT):
	Modify for new interval parent definition.

	* alloc.c (mark_interval_tree, MARK_INTERVAL_TREE,
	UNMARK_BALANCE_INTERVALS): Update references that need an
	addressable lisp object in the interval structure.
	(die): New function.
	(suppress_checking): New variable.

	* intervals.c (interval_start_pos): Just return 0 if there's no
	parent object.

2000-03-29  Gerd Moellmann  <gerd@gnu.org>

	* lread.c (read1): Accept `.' (period) as symbol start like in CL
	and earlier Emacs versions.

	* keyboard.c (Ftop_level): Cancel busy-cursor.

	* eval.c (call_debugger): Cancel busy-cursor.

2000-03-29  Kenichi Handa  <handa@etl.go.jp>

	* search.c (Freplace_match): Adjust multibyteness of the current
	buffer and NEWTEXT.  Free allocated memory before signaling an
	error.

2000-03-28  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.c (analyse_first): New function obtained by ripping out most
	of re_compile_fastmap and generalizing it a little bit so that it
	can also just return whether a given (sub)pattern can match the empty
	string or not.
	(regex_compile): Use `analyse_first' to decide whether the loop-check
	needs to be done or not for *, +, *? and +? (the loop check is costly
	for non-greedy repetition).
	(re_compile_fastmap): Delegate the actual work to `analyse_first'.

2000-03-28  Dave Love  <fx@gnu.org>

	* s/gnu-linux.h (GC_SETJMP_WORKS): Define for i386, sparc, m68k,
	alpha.

	* alloc.c: Include stdio.h.  Test STDC_HEADERS, not __STDC__.

2000-03-27  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.c (REGEX_FREE_STACK, RESET_FAIL_STACK): Make them usable as
	an expression.
	(enum re_opcode_t): Update description of succeed_n.
	(PATFETCH): Always define.
	(regex_compile): Use lookahead rather than PATUNFETCH (for repetition
	operators, char classes, shy-groups and intervals).
	Optimize special cases of intervals so as to only use succeed_n and
	jump_n when really needed.
	(re_compile_fastmap): Simplify handling of jump_n and succeed_n now
	that we don't have to handle the special cases any more.
	Simplify on_failure_jump handling as well.

2000-03-28  Jason Rumney  <jasonr@gnu.org>

	* lread.c (Fload): Move safe_p definition to above #ifdef DOS_NT.

2000-03-27  Gerd Moellmann  <gerd@gnu.org>

	* s/freebsd.h (GC_SETJMP_WORKS): Define.

	* s/msdos.h (GC_SETJMP_WORKS): Define.
	
	* alloc.c (mark_maybe_object): New function.
	(mark_memory): Use it.
	(SETJMP_WILL_LIKELY_WORK, SETJMP_WILL_NOT_WORK): New macros.
	(setjmp_tested_p, longjmp_done): New variables.
	(test_setjmp): New function.
	(mark_stack) [!GC_SETJMP_WORKS]: Call test_setjmp.
	(init_alloc): Initialize setjmp_tested_p and longjmp_done.

	* xdisp.c (face_before_or_after_it_pos): Pass multibyteness
	to DEC_TEXT_POS and INC_TEXT_POS.

	* dispnew.c (direct_output_for_insert): Use DEC_TEXT_POS
	with parameter MULTIBYTE_P.

	* dispextern.h (INC_TEXT_POS, DEC_TEXT_POS): Add parameter 
	MULTIBYTE_P.

	* editfns.c (Fsubst_char_in_region): Don't use INC_POS in unibyte
	buffers because it looks for multibyte character byte sequences
	which don't exist in unibyte text.

	* xterm.h (x_specified_cursor_type, x_copy_color): Add prototypes.

	* xfaces.c (register_color, unregister_color, unregister_colors)
	[DEBUG_X_COLORS]: New functions.
	(x_free_colors) [DEBUG_X_COLORS]: Unregister colors.

	* xfns.c (x_set_cursor_color): Get color reference counts right.

	* xterm.c (x_copy_color): New function.
	(x_alloc_nearest_color) [DEBUG_X_COLORS]: Call register_color.

	* buffer.h (MAX_PER_BUFFER_VARS): Renamed from MAX_BUFFER_LOCAL_VARS.
	(PER_BUFFER_VAR_OFFSET): Renamed from BUFFER_LOCAL_VAR_OFFSET.
	(PER_BUFFER_VAR_IDX): Renamed from BUFFER_LOCAL_VAR_IDX.
	(PER_BUFFER_VALUE_P): Renamed from BUFFER_HAS_LOCAL_VALUE_P.
	(SET_PER_BUFFER_VALUE_P): Renamed from SET_BUFFER_HAS_LOCAL_VALUE_P.
	(PER_BUFFER_IDX): Renamed from BUFFER_LOCAL_IDX.
	(PER_BUFFER_DEFAULT): Renamed from BUFFER_LOCAL_DEFAULT_VALUE.
	(PER_BUFFER_VALUE): Renamed from BUFFER_LOCAL_VALUE.
	(PER_BUFFER_SYMBOL): Renamed from BUFFER_LOCAL_SYMBOL.
	(PER_BUFFER_TYPE): Renamed from BUFFER_LOCAL_TYPE.

	* category.c, data.c, syntax.c, print.c, lread.c: Use new macro
	names for handling per-buffer variables.

	* buffer.c (buffer_permanent_local_flags): Use MAX_PER_BUFFER_VARS
	instead of MAX_BUFFER_LOCAL_VARS.
	(last_per_buffer_idx): Renamed from max_buffer_local_idx.

	* xfaces.c (lookup_face): Don't assert FACE_SUITABLE_FOR_CHAR_P.

	* xfns.c (x_specified_cursor_type): New function.
	(x_set_cursor_type): Use it.

	* buffer.h (struct buffer): Add cursor_type.

2000-03-26  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.c (enum re_opcode_t): New opcode on_failure_jump_nastyloop.
	(print_partial_compiled_pattern, re_compile_fastmap): Handle new 
	opcode.
	(regex_compile): Use on_failure_jump_nastyloop for non-greedy loops.
	(re_match_2_internal): Add code for on_failure_jump_nastyloop when
	executing it as well as when popping it off the stack to find infinite
	loops in non-greedy repetition operators.

2000-03-26  Gerd Moellmann  <gerd@gnu.org>

	* doc.c (Qfunction_documentation): New variable.
	(syms_of_doc): Initialize Qfunction_documentation.
	(Fdocumentation): If FUNCTION is a symbol with non-nil
	`function-documentation' property, return a documentation derived
	from that.

	* buffer.c (syms_of_buffer): Add default-cursor-type.
	(init_buffer_once): Don't let cursor_type have a local value
	in every buffer.

	* xterm.c (x_display_and_set_cursor): Choose cursor depending
	on buffer-local value of cursor_type.
	(x_draw_bar_cursor): Add parameter WIDTH.

	* buffer.c (reset_buffer): Initialize buffer's cursor_type.
	(init_buffer_once): Set default cursor_type value to t.
	Mark cursor_type as local everywhere.
	(syms_of_buffer): New per-buffer variable cursor-type.

	* buffer.h (struct buffer): Remove member local_var_flags,
	add local_flags.
	(MAX_BUFFER_LOCAL_VARS): New macro.
	(BUFFER_LOCAL_VAR_OFFSET, BUFFER_LOCAL_VAR_IDX)
	(BUFFER_HAS_LOCAL_VALUE_P, SET_BUFFER_HAS_LOCAL_VALUE_P)
	(BUFFER_LOCAL_IDX, BUFFER_LOCAL_DEFAULT_VALUE, BUFFER_LOCAL_VALUE)
	(BUFFER_LOCAL_SYMBOL, BUFFER_LOCAL_TYPE): New macros.

	* print.c (print_object): Use new macros for per-buffer
	variables.

	* category.c (Fset_category_table): Use new macros for per-buffer
	variables.

	* buffer.c (buffer_permanent_local_flags): Make a char array.
	(max_buffer_local_idx): New variable.
	(reset_buffer_local_variables, Fbuffer_local_variables): Rewritten
	for new handling of per-buffer variables.
	(buffer_slot_type_mismatch): Use new macros for per-buffer vars.
	(init_buffer_once): Initialize per-buffer vars differently.
	Set max_buffer_local_idx.

	* syntax.c (Fset_syntax_table): Use new macros for per-buffer
	variables.

	* lread.c (defvar_per_buffer): Use new macros for per-buffer
	variables.

	* data.c (do_symval_forwarding, store_symval_forwarding)
	(find_symbol_value, set_internal, default_value, Fset_default)
	(Fkill_local_variable, Flocal_variable_p): Use new macros for
	per-buffer variables.

	* Makefile.in (bootstrap-emacs): Use `mv -f' instead of `mv'.

2000-03-24  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_term_init): Unblock input around call1 of
	Qvendor_specific_keysyms.

	* syntax.c (open_paren_in_column_0_is_defun_start): New variable.
	(find_defun_start): Consider an open parenthesis in column 0
	a defun start only if open_paren_in_column_0_is_defun_start is set.
	(syms_of_syntax): New variable open-paren-in-column-0-is-defun-start.

2000-03-24  Stefan Monnier  <monnier@cs.yale.edu>

	* eval.c (Fautoload): Add entry in load-history (if after dump).
	* lread.c (load-history): Update docstring.

2000-03-24  Gerd Moellmann  <gerd@gnu.org>

	* indent.c (Fvertical_motion): Always use the current buffer.
	Temporarily change the window's buffer, if necessary.

2000-03-23  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (fast_find_position): Make sure not to consider rows
	not visible in the window.

2000-03-22  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.c (enum syntaxcode): Provide default for non-Emacs.
	(re_compile_fastmap, re_match_2_internal): Undo Dave's previous fix.

2000-03-22  Jason Rumney  <jasonr@gnu.org>

	* w32menu.c (single_submenu): Set help string to NULL if none.
	(w32_menu_show): Set help string correctly.
	(add-menu-item): Set help string in MIIM_DATA for menu item.
	Load SetMenuItemInfoA explicitly.
	(w32_menu_display_help): New function.
	
	* w32fns.c (w32_wnd_proc): Handle WM_MENUSELECT message.
	(QCdata): Moved to xdisp.c.

	* w32term.c (w32_read_socket): Handle WM_MENUSELECT message.
	(Vw32_charset_to_codepage_alist): Removed.
	(Vw32_charset_info_alist): New variable.
	(Qw32_charset_[ansi, default, symbol, shiftjis, hangul, gb2312,
	chinesebig5, oem, easteurope, turkish, baltic, russian, arabic,
	greek, hebrew, thai, johab, mac, unicode]): New symbols.
	(x_produce_glyphs): Remove out of date #ifdef 0'd section. Replace
	with TODO comment.
	(w32_codepage_for_font): Use Vw32_charset_info_alist.
	(syms_of_w32term): Remove Vw32_charset_to_codepage_alist.
	Define Vw32_charset_info_alist and w32_charset symbols.

2000-03-22  Jason Rumney  <jasonr@gnu.org>

	* makefile.nt (w32bdf.obj): Update dependencies.

	* w32bdf.c: Include frame.h and dispextern.h before fontset.h.

	* w32fns.c: Include fontset.h after dispextern.h.
	(Fx_create_frame): Do not create fontset.
	(w32_load_system_font): Doc fix.
	(Fx_close_connection): Free full_name if it is not shared.

	* w32term.c: Include fontset.h after dispextern.h.
	(x_get_glyph_face_and_encoding): New parameter two_byte_p. Callers
	updated.
	(w32_per_char_metric): If PCM is invalid, delete and return NULL.
	(x_get_char_and_face_encoding): Use FACE_FOR_CHAR to get face_id.
	(w32_font_is_double_byte): New function, needs body.
	(x_append_glyph): Set glyph->glyph_not_available_p.
	(x_produce_glyphs): Set it->glyph_not_available_p.  Don't set
	it->charset.  If it->multibyte_p is zero and it->c is a multibyte
	character, convert it to a unibyte character.
	(struct glyph_string): Delete member `charset'.
	(W32_TEXTOUT): Temporarily remove charset_dim until another way of
	calculating it is found.
	(x_set_mouse_face_gc): Call FACE_FOR_CHAR to get face_id.  Handle
	the case that per char metric is not available correctly.
	(x_fill_glyph_string): Handle the case that the specific glyph is
	not available correctly.
	(BUILD_CHAR_GLYPH_STRINGS): Don't set s->charset.
	(BUILD_COMPOSITE_GLYPH_STRING): Likewise.
	(x_new_font): Call FS_LOAD_FONT, not fs_load_font.
	(x_new_fontset): Call fontset_ascii to get ASCII font name of the
	fontset.  Don't call FS_LOAD_FONT.

2000-03-22  Ken Raeburn  <raeburn@gnu.org>

	* intervals.h (NULL_INTERVAL): Cast to INTERVAL type.
	(INT_LISPLIKE): New macro.
	(NULL_INTERVAL_P): Use it.
	(INTERVAL_HAS_PARENT, INTERVAL_HAS_OBJECT, SET_INTERVAL_PARENT,
	SET_INTERVAL_OBJECT, INTERVAL_PARENT, COPY_INTERVAL_PARENT,
	GET_INTERVAL_OBJECT, INTERVAL_PARENT_OR_NULL): New macros.

	* alloc.c (make_interval, gc_sweep): Use new macros; eliminate all
	explicit references to "parent" field of struct interval and
	associated unclean type conversions.
	* intervals.c (create_root_interval, root_interval, rotate_right,
	rotate_left, balance_possible_root_interval, split_interval_right,
	split_interval_left, interval_start_pos, find_interval,
	next_interval, previous_interval, update_interval,
	adjust_intervals_for_insertion, delete_node, delete_interval,
	adjust_intervals_for_deletion, merge_interval_right,
	merge_interval_left, reproduce_tree, graft_intervals_into_buffer,
	copy_intervals_to_string): Likewise.
	* intervals.h (AM_LEFT_CHILD, AM_RIGHT_CHILD, RESET_INTERVAL):
	Likewise.
	* syntax.c (update_syntax_table): Likewise.

	* intervals.c (reproduce_tree_obj): New function, like
	reproduce_tree but takes a Lisp_Object for the parent.  Declare
	with prototype.
	(graft_intervals_into_buffer): Use it when appropriate.
	(reproduce_tree): Declare with prototype.
	(balance_possible_root_interval): Check that the parent is a lisp
	object before trying to examine its type.

2000-03-22  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (lface_same_font_attributes_p): Compare font attributes
	as strings only if both are known to be strings.

	* s/openbsd.h (LIBS_TERMCAP): Undef.

2000-03-21  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.c (CHAR_CHARSET, CHARSET_LEADING_CODE_BASE): Add default
	definitions for non-Emacs compilation.
	(enum re_opcode_t): Remove (not)wordchar and move (not)syntaxspec
	outside of `#ifdef emacs'.
	(print_partial_compiled_pattern): Update.
	(regex_compile): Use (not)syntaxspec(Sword) instead of (not)wordchar.
	(re_compile_fastmap): Merge handling of charset and charset_not (for
	emacs and non-emacs compilation as well).
	Similarly for (not)categoryspec and (not)syntaxspec.
	Don't use the fastmap when reaching `anychar' since the added
	complexity is not justified.
	(re_match_2_internal): Merge (not)wordchar (emacs and non-emacs)
	and (not)syntaxspec.  Merge (not)categoryspec.

2000-03-22  Kenichi Handa  <handa@etl.go.jp>

	* dispextern.h [!HAVE_WINDOW_SYSTEM] (FACE_SUITABLE_FOR_CHAR_P,
	FACE_FOR_CHAR): Define them differently for the configuration of
	--without-x.

2000-03-21  Dave Love  <fx@gnu.org>

	* fontset.c (Fset_fontset_font, Ffontset_font): Fix newlines in
	doc string.

2000-03-21  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (check_lface_attrs) [GLYPH_DEBUG]: Fix syntax error.
	(lface_fully_specified_p): Don't check contents of
	LFACE_FONT_INDEX because that attribute is optional.
	(realize_x_face): Remove now unwarranted xassert.

2000-03-21  Kenichi HANDA  <handa@etl.go.jp>

	The following changes are to make font selection based on
	characters, not charset.  In addition, they recover fontset
	facilities while utilizing the new font selection mechanism.

	* Makefile.in (fontset.o): Depend on dispextern.h.

	* alloc.c (mark_face_cache): Don't mark face->registry.

	* dispextern.h (struct glyph): New member glyph_not_available_p.
	Use 22 bits for face_id.
	(enum lface_attribute_index): Add LFACE_FONT_INDEX.
	(struct face): Delete member registry, new member ascii_face.
	(FACE_SUITABLE_FOR_CHAR_P): Renamed from
	FACE_SUITABLE_FOR_CHARSET_P.  Caller changed.
	(FACE_FOR_CHAR): Renamed from FACE_FOR_CHARSET.  Caller changed.
	(struct it): Delete member charset, new member
	glyph_not_available_p.

	* fontset.h (FONT_NOT_OPENED, FONT_NOT_FOUND): Macros removed.
	(struct fontset_info, struct fontset_data): Structs removed.
	(allloc_fontset_data, free_fontset_data, fs_regiser_fontset,
	Vglobale_fontset_alist, font_idx_temp): Externs removed.
	(fs_load_font, fs_query_fontset): Adjusted for new argument.
	(fs_free_face_fontset, fontset_font_pattern,
	face_suitable_for_char_p, face_for_char,
	make_fontset_for_ascii_face): Extern them.
	(FS_LOAD_FONT): Adjusted for the change of fontset implementation.
	(FS_LOAD_FACE_FONT): New macro.

	* fontset.c: All codes rewritten or adjusted for the change of
	fontset implementation.  Now fontset is represented by char table.
	(Vglobal_fontset_alist, font_idx_temp, my_strcasetbl): Variables
	removed.
	(my_strcasecmp): Function removed.
	(Vfontset_table, next_fontset_id, Vdefault_fontset): New
	variables.
	(AREF, ASIZE): New macros.
	(FONTSET_FROM_ID, FONTSET_ID, FONTSET_NAME, FONTSET_FRAME,
	FONTSET_ASCII, FONTSET_BASE, BASE_FONTSET_P, FONTSET_REF,
	FONTSET_REF_VIA_BASE, FONTSET_SET): New macros.
	(fontset_ref, fontset_ref_via_base, fontset_set, make_fontset,
	fontset_id_valid_p, font_family_registry, fontset_name,
	fontset_ascii, free_face_fontset, face_suitable_for_char_p,
	face_for_char, make_fontset_for_ascii_face, fontset_font_pattern):
	New functions.
	(fs_load_font): New arg FACE.  Caller changed.
	(fs_query_fontset): Argument changed.  Caller changed.
	(Fquery_fontset): call fs_query_fontset.
	(fs_register_fontset, alloc_fontset_data, free_fontset_data):
	Functions removed.
	(clear_fontset_elements, check_registry_encoding,
	check_fontset_name): New functions.
	(syms_of_fontset): Set char-table-extra-slots property of fontset
	to 3.  Staticpro and initialize Vfontset_table and
	Vdefault_fontset.  Defsubr fontset_font and fontset_list.

	* frame.h (struct frame): Member `fontset_data' removed.
	(FRAME_FONTSET_DATA): Macro removed.

	* frame.c (make_frame): Don't allocate f->fontset_data.
	(Fdelete_frame): Don't free f->fontset_data.

	* msdos.c (XMenuActivate): Args to lookup_derived_face changed.

	* xdisp.c (charset_at_position): Function removed.
	(init_iterator): Don't set member charset of struct `it'.
	(handle_face_prop, reseat_to_string, set_iterator_to_next,
	next_element_from_display_vector, insert_left_trunc_glyphs):
	Likewise.
	(face_before_or_after_it_pos): Call FACE_FOR_CHAR, not
	FACE_FOR_CHARSET.
	(get_next_display_element, append_space,
	extend_face_to_end_of_line): Likewise.

	* xfaces.c (Qx_charset_registry, Vface_default_registry):
	Variables removed.
	(clear_font_table, frame_update_line_height, load_face_font):
	Adjusted for the change of fontset implementation.
	(load_face_fontset_font): Function removed.
	(pixel_point_size): New function.
	(font_list): Argument type changed.  Caller changed.
	(LFACE_FONT): New macro.
	(check_lface_attrs): Check attr[LFACE_FONT_INDEX].
	(set_lface_from_font_name): Type of arg FONTNAME is changed to
	Lisp_Object.  Determine the font name by actually loading a font
	by the specified pattern.  Set LFACE_FONT (lface) to the specified
	pattern.  Even if a font is not found, don't try alternatives.
	(Finternal_set_lisp_face_attribute): Handle `font' slot in lface.
	(set_font_frame_param): If `font' is specified in lface, use it.
	(Finternal_get_lisp_face_attribute): Handle `font' slot in lface.
	(lface_same_font_attributes_p): Likewise.
	(make_realized_face): Arguent changed.  Caller changed.  Set
	face->ascii_face to face itself.
	(free_realized_face): Free face->fontset if face is for ASCII.
	(face_suitable_for_iso8859_1_p, face_suitable_for_charset_p,
	deduce_unibyte_registry, x_charset_registry): Functions removed.
	(free_realized_multibyte_face): New function.
	(lookup_face, lookup_named_face, lookup_derived_face): Argument
	changed.  Caller changed.
	(try_font_list): Argument type changed.
	(face_fontset): Check `font' slot of ATTRS, not `family' slot.
	(choose_face_font): Argument changed.  Handle fontset properly.
	(choose_face_fontset_font): Function removed.
	(realize_default_face, realize_named_face): Don't remove the
	former face here.
	(realize_face): Argument changed.  Caller changed.  Remove face
	with the arg former_face_id in advance.  Load font for the new
	face.
	(realize_x_face): Argument changed.  Caller changed.  For a
	multibyte character, share fontset with base_face.  For a single
	byte character, make a new realized fontset.  Don't load a font
	here.
	(realize_tty_face): Argument changed.  Caller changed.
	(compute_char_face): Call FACE_FOR_CHAR, not FACE_FOR_CHARSET.
	(face_at_buffer_position): Don't check multibyte_p for returning
	DEFAULT_FACE_ID.
	(face_at_string_position): Call FACE_SUITABLE_FOR_CHAR_P, not
	FACE_SUITABLE_FOR_CHARSET_P.
	(syms_of_xfaces): Remove code for Qx_charset_registry and
	Vface_default_registry.

	* xterm.c: Include fontset.h after dispextern.h.  Undo the changes
	related to PER_CHAR_METRIC done by Gerd on 2000-03-03.
	(x_per_char_metric): Don't try FONT->default_char.  Even if
	pcm->width is zero, glyph bits may exist.
	(x_encode_char): Always initialize char2b->byte1.
	(x_get_char_face_and_encoding): Call FACE_FOR_CHAR to get face_id.
	(x_get_glyph_face_and_encoding): New arg two_byte_p.  Caller
	changed.
	(x_append_glyph): Set glyph->glyph_not_available_p.
	(x_produce_glyphs): Set it->glyph_not_available_p.  Don't set
	it->charset.  Handle the case that per char metric is not
	available.  If it->multibyte_p is zero and it->c is a multibyte
	character, convert it to a unibyte character.
	(struct glyph_string): Delete member `charset'.
	(x_set_mouse_face_gc): Call FACE_FOR_CHAR to get face_id.  Handle
	the case that per char metric is not available correctly.
	(x_fill_glyph_string): Handle the case that the specific glyph is
	not available correctly.
	(BUILD_CHAR_GLYPH_STRINGS): Don't set s->charset.
	(BUILD_COMPOSITE_GLYPH_STRING): Likewise.
	(x_new_font): Call FS_LOAD_FONT, not fs_load_font.
	(x_new_fontset): Call fontset_ascii to get ASCII font name of the
	fontset.  Don't call FS_LOAD_FONT.

	* xfns.c (Fx_create_frame): Don't cal fs_register_fontset.
	(x_create_tip_frame): Likewise.
	(Fx_close_connection): Free full_name of font_info.

	* fns.c (optimize_sub_char_table): New function.
	(Foptimize_char_table): New function.
	(syms_of_fns): Defsubr Soptimize_char_table.

2000-03-20  Gerd Moellmann  <gerd@gnu.org>

	* buffer.c (Fset_buffer_modified_p): Set update_mode_lines
	only if buffer is displayed in some window.

	* xdisp.c (handle_single_display_prop): Initialize local `value'.
	(try_window_reusing_current_matrix): Don't call scroll run
	function if run's current and desired position are the same;
	this prevents cursor flickering.

2000-03-19  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.h (RE_TRANSLATE. RE_TRANSLATE_P): Moved to regex.c.

	* regex.c (RE_STRING_CHAR): New macro.
	(GET_CHAR_AFER_2): Remove.
	(RE_TRANSLATE, RE_TRANSLATE_P): New macros moved from regex.h.
	(enum re_opcode_t): Remove on_failure_jump_exclusive.
	(print_partial_compiled_pattern, re_compile_fastmap)
	(re_match_2_internal): Remove on_failure_jump_exclusive.
	(regex_compile): Turn optimizable P+ loops into PP*, so that the
	optimization only need to work for * (ie. can use of_keep_string_jump).
	Remove the special case for .*\n since it is now covered by the general
	optimization.
	(re_search_2): Don't bother with `room'.
	(skip_one_char): New function.
	(skip_noops): Simplify since `memory' is not needed any more.
	(mutually_exclusive_p): Restructure slightly to use `switch' and
	add handling for "all" remaining cases.
	(re_match_2_internal): Change on_failure_jump_smart to use
	on_failure_keep_string_jump (and redirect the end-of-loop jump)
	rather than on_failure_jump_exclusive.

2000-03-19  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (select_visual): Don't set dpyinfo->n_planes to the
	number of bits per RGB because it's everywhere used as the depth
	of the visual.

	* term.c (calculate_costs): Remove code dealing with X frames.

2000-03-19  Richard M. Stallman  <rms@caffeine.ai.mit.edu>

	* lread.c (syms_of_lread): Doc fix for load-convert-to-unibyte.

2000-03-18  Gerd Moellmann  <gerd@gnu.org>

	* lread.c (read_integer): Unread the last char not consumed.

2000-03-17  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_update_window_cursor): Don't update in frames
	which are in the process of being deleted.

2000-03-16  Gerd Moellmann  <gerd@gnu.org>

	* Makefile.in (mostlyclean): Add `*.core'.
	(clean): Add `bootstrap-emacs'.

	* lread.c (read_integer): New function.
	(read1): Support read syntax #o, #x, #b, #r.

2000-03-15  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.c (re_match_2): Fix string shortening (to fit `stop') to
	make sure POINTER_TO_OFFSET gives the same value before and after
	PREFETCH.  Use `dfail' to guarantee "atomic" matching.
	(PTR_TO_OFFSET): Use POINTER_TO_OFFSET.
	(debug): Now only active if > 0 rather than if != 0.
	(DEBUG_*): Update for the new meaning of `debug'.
	(print_partial_compiled_pattern): Add missing `succeed' case.  Use
	CHARSET_* macros in the charset(_not) branch.  Fix off-by-two bugs
	in `succeed_n', `jump_n' and `set_number_at'.
	(store_op1, store_op2, insert_op1, insert_op2)
	(at_begline_loc_p, at_endline_loc_p): Add prototype.
	(group_in_compile_stack): Move to after its arg's types are
	declared and add a prototype.
	(PATFETCH): Define in terms of PATFETCH_RAW.
	(GET_UNSIGNED_NUMBER): Add the usual `do { ... } while(0)'
	wrapper.
	(QUIT): Redefine as a nop except for NTemacs.
	(regex_compile): Handle intervals {,M} as if it was {0,M}.  Fix
	indentation of the greedy-op and shy-group code.
	(at_(beg|end)line_loc_p): Fix argument's types.
	(re_compile_fastmap): Ifdef out failure_stack_ptr to shut up gcc.
	(re_search_2): Use POS_AS_IN_BUFFER.  Simplify `room' computation.
	(MATCHING_IN_FIRST_STRING): Remove.
	(re_match_2): Use POS_AS_IN_BUFFER.  Ifdef out failure_stack_ptr
	to shut up gcc.  Use FIRST_STRING_P and POINTER_TO_OFFSET.  Use
	QUIT unconditionally.

2000-03-15  Gerd Moellmann  <gerd@gnu.org>

	* minibuf.c (Fminibuffer_complete): Set point to ZV if finding
	a sole completion.

	* process.c (send_process): Add a hint that the function
	can call Lisp code to its comment.

	* lread.c (load_dangerous_libraries): New variable.
	(Vbytecomp_version_regexp): New variable.
	(safe_to_load_p): New function.
	(Fload): Handle files not compiled with Emacs specially.
	(syms_of_lread): New Lisp variable load-dangerous-libraries.

2000-03-14  Gerd Moellmann  <gerd@gnu.org>

	* lisp.h (free_frame_xic) [HAVE_X_I18N]: Add missing semicolon.

	* xterm.c (xim_close_dpy, xim_initialize): Use X11R6-style XIM
	support functions only if HAVE_X11R6_XIM is defined.
	(xim_instantiate_callback): Define only if HAVE_X11R6_XIM.

	* s/sol2.h (INHIBIT_X11R6_XIM): Define.

	* xfns.c (X_I18N_INHIBITED): Don't define.
	(create_frame_xic): Remove conditional compilation on
	X_I18N_INHIBITED.
	(x_kill_gs_process, x_window): Use FRAME_X_VISUAL.

	* config.in (HAVE_X_I18N): Moved here from xterm.h.
	(HAVE_X11R6_XIM): Define.

	* xterm.h (HAVE_X_I18N) [HAVE_X11R6]: Moved to config.in.

	* xterm.c (x_term_init): Add support for X resource `synchronous'.
	If set, call XSynchronize.

2000-03-13  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.c: Declare a new type `re_char' used throughout the code
	for the string char type.  It's `const unsigned char' to match the
	rest of Emacs.  Consistently make sure all pointers to strings use
	it and make sure all pointers into the pattern use `unsigned
	char'.
	(re_match_2_internal): Use `PREFETCH+STRING_CHAR' instead of
	GET_CHAR_AFTER_2.  Also merge wordbound and notwordbound to reduce
	code duplication.

	* charset.h (GET_CHAR_AFTER_2): Remove.
	(GET_CHAR_BEFORE_2): Use unsigned chars, like everywhere else.

2000-03-12  Ken Raeburn  <raeburn@gnu.org>

	* Makefile.in (temacs): Evaluate ALL_LDFLAGS into a temporary
	variable before the invocation of YMF_PASS_LDFLAGS, in case both
	of them try to use backquotes.

2000-03-12  Dave Love  <fx@gnu.org>

	* unexelf.c: Restore changes of 1999-10-19.
	(unexec): Don't adjust bss for sbss type SHT_PROGBITS; otherwise
	fix its type and alignment; copy it from current process.

2000-03-12  Gerd Moellmann  <gerd@gnu.org>

	* atimer.c (cancel_atimer): Break out of the loop as soon as timer
	has been found.  Fix bug not computing timer's predecessor.

	* fileio.c (Fread_file_name): Handle case that DIR contains a 
	file name.

	* window.c (Fsave_window_excursion): Doc fix.

	* xfns.c (x_defined_color): Rewritten to use
	x_allocate_nearest_color.

2000-03-12  Eli Zaretskii  <eliz@is.elta.co.il>

	* msdos.c (vga_installed): New function, code moved from
	dos_set_window_size.
	(Qbar, Qcursor_type, outside_cursor): New variables.
	(syms_of_msdos): Intern and staticpro them.
	(dos_ttraw) [__DJGPP__ >= 2, !HAVE_X_WINDOWS]: Save the cursor
	shape used outside Emacs when called for the first time.
	(dos_ttcooked) [__DJGPP__ >= 2, !HAVE_X_WINDOWS]: Restore the
	cursor shape used outside Emacs.
	(msdos_set_cursor_shape, IT_set_cursor_type): New functions.
	(IT_frame_up_to_date): Call IT_set_cursor_type, in case the cursor
	type has changed.
	(IT_set_frame_parameters): Call IT_set_cursor_type if the frame
	parameters specify the cursor.  Make qreverse a global
	variable (renamed to Qreverse).

2000-03-09  Gerd Moellmann  <gerd@gnu.org>

	* fns.c (Fy_or_n_p): Cancel busy-cursor.

2000-03-08  Stefan Monnier  <monnier@cs.yale.edu>

	This is a big redesign of failure-stack and register handling, prompted
	by bugs revealed when trying to add shy-groups.  Overall, what happened
	is that loops are now structured a little differently, groups can be
	shy and the code is a little simpler.

	* regex.h: Update the copyright.
	(RE_SHY_GROUPS): New value.
	(RE_UNMATCHED_RIGHT_PAREN_ORD): Renumber.
	(RE_SYNTAX_EMACS): Add RE_SHY_GROUPS.

	* regex.c (enum re_opcode_t): Remove jump_past_alt,
	maybe_pop_jump, push_dummy_failure and dumy_failure_jump.  Add
	on_failure_jump_(exclusive, loop and smart).  Also fix the comment
	for (start|stop)_memory since they now only take one argument (the
	second has becomes unnecessary).
	(print_partial_compiled_pattern): Adjust for changes in
	re_opcode_t.
	(print_compiled_pattern): Use %ld to printf long ints and flush to
	make debugging a little easier.
	(union fail_stack_elt): Make the integer unsigned.
	(struct fail_stack_type): Add a `frame' element.
	(INIT_FAIL_STACK): Init `frame' as well.
	(POP_PATTERN_OP): New macro for re_compile_fastmap.
	(DEBUG_PUSH, DEBUG_POP): Remove.
	(NUM_REG_ITEMS): Remove.
	(NUM_NONREG_ITEMS): Adjust.
	(FAILURE_PAT, FAILURE_STR, NEXT_FAILURE_HANDLE)
	(TOP_FAILURE_HANDLE): New macros for the cycle detection.
	(ENSURE_FAIL_STACK): New macro for PUSH_FAILURE_(REG|POINT).
	(PUSH_FAILURE_REG, POP_FAILURE_REG, CHECK_INFINITE_LOOP): New
	macros.
	(PUSH_FAILURE_POINT): Don't push registers any more.  The pattern
	address pushed is not the destination of the jump but the source
	of it instead.
	(NUM_FAILURE_ITEMS): Remove.
	(POP_FAILURE_POINT): Adapt to the new stack structure (i.e. pop
	registers before the actual failure point).  Don't hardcode any
	meaning for str==NULL anymore.
	(union register_info_type, REG_MATCH_NULL_STRING_P, IS_ACTIVE)
	(MATCHED_SOMETHING, EVER_MATCHED_SOMETHING, SET_REGS_MATCHED):
	Remove.
	(REG_UNSET_VALUE): Use NULL (why not?).
	(compile_range): Remove declaration since it doesn't exist.
	(struct compile_stack_elt_t): Remove inner_group_offset.
	(old_reg(start|end), reg_info, reg_dummy, reg_info_dummy): Remove.
	(regex_grow_registers): Remove dead code.
	(FIXUP_ALT_JUMP): New macro.
	(regex_compile): Add shy-groups Change loops to use
	on_failure_jump_smart&jump instead of
	on_failure_jump&maybe_pop_jump.  Change + loops to eliminate the
	initial (dummy_failure_)jump.  Remove c1_base (looks like unused
	variable to me).  Use `jump' instead of `jump_past_alt' and don't
	bother with push_dummy_failure in alternatives since it is now
	unnecessary.  Use FIXUP_ALT_JUMP.  Eliminate a useless `#ifdef
	emacs' for (re)allocating the stack.
	(re_compile_fastmap): Remove dead variables i and num_regs.  Exit
	from loop when bufp->can_be_null rather than jumping to `done'.
	Avoid jumping backwards so as to ensure termination.  Use
	PATTERN_STACK_EMPTY and POP_PATTERN_OP.  Improved handling of
	backreferences.  Remove dead code in handling of `anychar'.
	(skip_noops, mutually_exclusive_p): New functions taken from the
	handling of `maybe_pop_jump' in re_match_2_internal.  Slightly
	improve mutually_exclusive_p to handle ".+\n".
	(lowest_active_reg, highest_active_reg,
	NO_(LOWEST|HIGHEST)_ACTIVE_REG) Remove.
	(re_match_2_internal): Use %p instead of 0x%x when printf'ing
	ptrs.  Don't SET_REGS_MATCHED anymore.  Remove many dead
	variables.  Push register (in `start_memory') on the stack rather
	than storing it in old_reg(start|end).  Remove the cycle detection
	from `stop_memory', replaced by the use of on_failure_jump_loop
	for greedy loops.  Add code for the new on_failure_jump_<foo>.
	Remove ad-hoc code in `on_failure_jump' to push more registers in
	the case of a loop.  Take out code from `maybe_pop_jump' into
	separate functions and adapt it to the semantics of
	`on_failure_jump_smart'.  Remove jump_past_alt, dummy_failure_jump
	and push_dummy_failure.  Remove dummy_failure handling and
	handling of `failures to jump to on_failure_jump' (this last one
	was already dead code, it seems).
	(group_match_null_string_p, alt_match_null_string_p)
	(common_op_match_null_string_p): Remove.

2000-03-08  Dave Love  <fx@gnu.org>

	* config.in: Don't depend on __STDC__ for volatile.
	Add POINTER_TYPE, PTR, PROTOTYPES.

	* hftctl.c, strftime.c: Use PROTOTYPES.
	* eval.c (find_handler_clause): Likewise.

	* mem-limits.h: Use POINTER_TYPE.

	* lisp.h (P_): Define based on PROTOTYPES, not __STDC__.
	(memory_warnings): Declare using POINTER_TYPE.

2000-03-08  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_set_cursor_type): If ARG is nil, give frame no cursor.

	* xdisp.c (display_echo_area): Temporarily inhibit garbage
	collection.

	* xfns.c: Remove obsolete code in #if 0.
	(Fx_focus_frame): New function.

2000-03-07  Miyashita Hisashi  <himi@bird.scphys.kyoto-u.ac.jp>

	* coding.c (coding_category_name): Add coding-category-utf-8,
	coding-category-utf-16-be, coding-category-utf-16-le.
	(UTF_8_1_OCTET_P, UTF_8_EXTRA_OCTET_P, UTF_8_2_OCTET_LEADING_P,
	UTF_8_3_OCTET_LEADING_P, UTF_8_4_OCTET_LEADING_P,
	UTF_8_5_OCTET_LEADING_P, UTF_8_6_OCTET_LEADING_P): New macros.
	(detect_coding_utf_8): New function.
	(UTF_16_INVALID_P, UTF_16_HIGH_SURROGATE_P
	UTF_16_LOW_SURROGATE_P): New macros.
	(detect_coding_utf_16): New function
	(detect_coding_mask): When priorities are specified, skip any
	categories that have `nil' coding-system.  Fix bug of returning
	wrong mask when PRIORITIES is specified and detect_coding_XXX()
	returns a mask not set in PRIORITIES.
	(detect_eol_type_in_2_octet_form): New function.
	(detect_eol): selects detect_eol_type_XXX to call according to
	cooding->category_idx.
	(detect_coding_system): Remove `nil' coding-system in the result.
	(Fupdate_coding_systems_internal): Update all coding-categories.

	* coding.h (CODING_CATEGORY_IDX_UTF_8,
	CODING_CATEGORY_IDX_UTF_16_BE, CODING_CATEGORY_IDX_UTF_16_LE): New
	macros.
	(CODING_CATEGORY_IDX_RAW_TEXT, CODING_CATEGORY_IDX_BINARY,
	CODING_CATEGORY_IDX_MAX): Adjusted for the above macros.
	CODING_CATEGORY_IDX_UTF_16_LE.
	(CODING_CATEGORY_MASK_UTF_8, CODING_CATEGORY_MASK_UTF_16_BE,
	CODING_CATEGORY_MASK_UTF_16_LE): New macros.
	(CODING_CATEGORY_MASK_ANY): Include the above macros.
	(CODING_CATEGORY_MASK_UTF_16_BE_LE): New macro.

2000-03-07  Gerd Moellmann  <gerd@gnu.org>

	* doc.c (Fdocumentation_property): If value is not a string,
	and doesn't refer to etc/DOC, evaluate it to obtain a string.

	* xterm.c (x_connection_closed) [USE_X_TOOLKIT]: Don't try to
	close the display with XtCloseDisplay.  This caused a bus error
	on OpenWindows.

	* minibuf.c (Fminibuffer_complete): Move point to ZV when input is
	complete but not unique.

2000-03-06  Gerd Moellmann  <gerd@gnu.org>

	* process.c (send_process): Remove local variable `procname' that
	might become invalid when a GC happens.  Instead, access the
	process name slot directly.

	* xfns.c (x_set_menu_bar_lines_1): Adjust window's orig_top and
	orig_height if set.

	* frame.c (set_menu_bar_lines_1): Adjust window's orig_top and
	orig_height if set.

2000-03-06  Eli Zaretskii  <eliz@is.elta.co.il>

	* msdos.c (IT_note_mouse_highlight): Return immediately if frame's
	glyph matrices have been freed.

2000-03-05  Gerd Moellmann  <gerd@gnu.org>

	* Makefile.in (tags): Include ../lwlib/TAGS in TAGS.
	(bootstrap-temacs): Set LC_ALL to C like for temacs.

	* xfns.c (QCdata): Moved to xdisp.c.

	* xdisp.c (QCdata): Moved here from xfns.c.
	(syms_of_xdisp): Initialize QCdata.

	* frame.h (FRAME_INTERNAL_BORDER_WIDTH) [!HAVE_X_WINDOWS]: Define.

	* window.c (coordinates_in_window): Use
	FRAME_INTERNAL_BORDER_WIDTH_SAFE instead of
	FRAME_INTERNAL_BORDER_WIDTH.

	* xdisp.c (try_window_id): Recompute unchanged information if
	it is obviously invalid.

	* xterm.c (x_term_init): Create a colormap if not using the
	default visual.

	* xterm.h (select_visual): Change prototype.

	* xfns.c (select_visual): Rewritten.  Recognize user-specified
	visual classes.
	(visual_classes): New variable.

2000-03-04  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_defined_color, x_set_mouse_color, lookup_rgb_color)
	(lookup_pixel_color, x_laplace, x_build_heuristic_mask)
	(png_load): Access colormap of frame using FRAME_X_COLORMAP.
	(x_decode_color): Don't handle allocation of white and black
	specially.
	(x_window) [USE_X_TOOLKIT]: Set XtNvisual, XtNdepth, and
	XtNcolormap resources.
	(x_window) [!USE_X_TOOLKIT]: Pass colormap to XCreateWindow.
	(Fx_create_frame): Initialize color members of x_output structure.
	(xpm_load): Pass colormap to XPM lib.

	* xfaces.c (x_free_colors): Access colormap of frame using
	FRAME_X_COLORMAP.  Be paranoid about freeing black and white
	when default colormap is used.

	* xterm.c (x_term_init): Set Colormap member of x_display_info
	structure.  Copy colormap if resource `privateColormap' is
	specified (PseudoColor only).
	(x_setup_relief_color): Access colormap of frame using
	FRAME_X_COLORMAP.

	* xterm.h (struct x_display_info): Add Colormap member `cmap'.
	(FRAME_X_COLORMAP, FRAME_X_VISUAL): New macros.

2000-03-04  Jason Rumney  <jasonr@gnu.org>

	* xfaces.c Change many FRAME_X... macros to FRAME_WINDOW... or
	other non-platform-specific equivalents.
	[WINDOWSNT]: Include w32term.h, fontset.h and define X
	specific functions and macros as their w32 equivalents where
	non-platform-specifics are not available.
	[HAVE_X_WINDOWS]: Change most of these to HAVE_WINDOW_SYSTEM.
	(x_create_gc, x_free_gc) [WINDOWSNT]: Add W32 versions.
	(clear_font_table) [WINDOWSNT]: Call w32_unload_font.
	(frame_update_line_height): Use macros to access f->output_data.
	(defined_color): Remove FIXME comments; fixed.
	(x_face_list_fonts, prepare_face_for_display): Put X specifics
	into #ifdef blocks. Add WINDOWSNT blocks.
	(Fx_list_fonts): Use macros for accessing font data.
	(set_lface_from_font_name): Different default fonts for X and
	WINDOWSNT.
	(font_scalable_p) [WINDOWSNT]: Treat wildcard XLFD_AVGWIDTH as
	scalable for backward compatibility.
	(realize_tty_face) [MSDOS]: Do the same for WINDOWSNT.
	(syms_of_xfaces) [WINDOWSNT]: Allow scalable fonts by default.

	* emacs.c (main) [HAVE_NTGUI]: Call syms_of_xfaces instead of
	syms_of_w32faces.

	* makefile.nt (w32faces.obj): Remove.
	(xfaces.obj): Add.

2000-03-03  Jason Rumney  <jasonr@gnu.org>

	* keyboard.c (make_lispy_event): Call buffer_posn_from_coords with
	correct parameters.

2000-03-03  Ken Raeburn  <raeburn@gnu.org>

	* unexelf.c (PT_LOAD, SHT_*, SHN_*) [__NetBSD__]: Only provide
	standard ELF definitions here if the system header does not.

2000-03-03  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (PER_CHAR_METRIC): Removed.
	(x_per_char_metric_1, x_default_char): New functions.
	(x_per_char_metric): If font's default char is invalid, return
	metrics of a suitably chosen usable default char.
	(x_draw_glyph_string_foreground): If font has an invalid default
	char, replace occurrences of unprintable chars with a suitably
	chosen usable default char.

2000-03-02  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (note_mouse_highlight): Return quickly if frame's
	glyph matrices have been freed.

	* dispnew.c (free_glyphs): Block input while freeing matrices.

	* xfns.c (x_clear_image, x_kill_gs_process): Use x_free_colors.

	* xterm.c (x_alloc_lighter_color, x_setup_relief_color): Use
	x_free_colors.

	* dispextern.h (x_free_colors): Add prototype.

	* xfaces.c (x_free_colors): New function.
	(unload_color, free_face_colors): Use it.

2000-03-02  Eli Zaretskii  <eliz@is.elta.co.il>

	* msdos.h (FRAME_INTERNAL_BORDER_WIDTH): Define to zero.

	* window.c [MSDOS]: Include msdos.h.

2000-03-02  Dave Love  <fx@gnu.org>

	* m/powerpcle.h, m/sparc.h: Don't set C_OPTIMIZE_SWITCH.

	* m/mips-siemens.h, m/news-r6.h, m/news-risc.h, m/tekxd88.h: Don't
	set C_OPTIMIZE_SWITCH for gcc.

2000-03-02  Kenichi Handa  <handa@etl.go.jp>

	* coding.c (coding_save_composition): Be sure to allocate
	composition data area in coding even if there's no composition in
	the current run.

2000-03-01  Jason Rumney  <jasonr@gnu.org>

	* w32term.c: Equivalent changes to those made to xterm.c on
	2000-02-25 and 2000-02-24.

	* w32fns.c: Equivalent changes to those made to xfns.c on
	2000-02-25 and 2000-02-21.

	* sysdep.c: [WINDOWSNT]: Use sys_read and sys_write to ensure
	correct line-end convention is followed.

	* w32menu.c [HAVE_BOXES]: Remove #undef.
	(single_keymap_panes): Remove code for simulating checkmarks.
	(single_menu_item): Remove notbuttons_ptr argument. Callers changed.
	Remove code for drawing simulated checkmarks.
	(w32_menu_show): make unibyte help string correctly.
	(add_menu_item): draw standard Windows checkmarks. Draw radio
	buttons as radio buttons if possible.

2000-03-01  Gerd Moellmann  <gerd@gnu.org>

	* sysdep.c (start_of_text): Don't define this function for NetBSD
	with ELF.

	* m/pmax.h (START_FILES, CANNOT_DUMP) [__NetBSD__ || __OpenBSD__]: 
	Don't define.
	(UNEXEC) [__NetBSD__ || __OpenBSD__]: Define to unexelf.o.
	(LINKER): Don't undef if __NetBSD__ is defined.

	* m/mips.h (LINKER) [__NetBSD__ || __OpenBSD__]: Don't define.

	* fileio.c [__NetBSD__]: Define `unix'.

	* xfns.c (start_busy_cursor): Allow floats for busy-cursor-delay.

2000-02-29  Gerd Moellmann  <gerd@gnu.org>

	* atimer.c (start_atimer): Don't abort when timers are stopped.
	(append_atimer_lists): New function.
	(cancel_atimer, stop_other_atimers, run_all_atimers): Handle
	arbitrary lists of stopped and running atimers.

	* atimer.c (cancel_atimer): Handle canceling an atimer when
	some timers are stopped.

	* xfns.c (cancel_busy_cursor): Set busy_cursor_atimer to null
	after canceling it.

	* fns.c (maybe_resize_hash_table): Handle case of new size
	coming out as being the same as old size.

2000-02-27  Jason Rumney  <jasonr@gnu.org>

	* makefile.nt: Add atimer.h to dependencies.
	* w32.c (init_environment): Set Vw32_num_mouse_buttons here.
	* w32console.c: Only disable window system features for dispextern.h
	(initialize_w32_display): Build a display info for the console.
	* w32faces.c (tty_defined_color): Apply xfaces.c change from 02-17.
	* w32fns.c (w32_wnd_proc) [WM_LBUTTON_DOWN, WM_RBUTTON_DOWN,
	WM_LBUTTON_UP, WM_RBUTTON_UP]: Do not treat 4 or more button mice
	as 2 button mice.
	* w32gui.h (struct W32FontStruct): Revert last change after change
	to xdisp.c.
	* w32menu.c (single_submenu): Set up help string.
	[!HAVE_MULTILINGUAL_MENU]: Don't overwrite item_name with descrip.
	(w32_dialog_show): Set up help string.
	* w32term.c (w32_display_info_for_display): Remove unused function.
	(w32_draw_bitmap): Use pre-built bitmaps.
	(w32_initialize_display_info): New function to initialize parts of
	display info that are common to both GUI and console frames.
	(w32_term_init): Use w32_initialize_display_info. Do not set
	Vw32_num_mouse_buttons here, as it is not called for console
	frames.  Build bitmaps for indicating truncated lines etc.
	(x_delete_display): Destroy pre-built bitmaps.
	* xdisp.c (handle_single_display_prop): Use FONT_HEIGHT macro.
	(echo_area_display): Change HAVE_X_WINDOWS to HAVE_WINDOW_SYSTEM.

2000-02-27  Dave Love  <fx@gnu.org>

	* lisp.h: Add a bunch of prototypes.

2000-02-26  Kenichi Handa  <handa@etl.go.jp>

	* keyboard.c (read_char): Set `usec' correctly.

2000-02-25  Miyashita Hisashi  <himi@bird.scphys.kyoto-u.ac.jp>

	* ccl.c (ccl_driver) [CCL_MapMultiple]: When the mapped value is
	`lambda', set reg[RRR] to the map index.
	(ccl_driver) [CCL_MapSingle]: When the mapped value is found, set
	reg[RRR] to 0.  Otherwise, set it to -1.

2000-02-25  Gerd Moellmann  <gerd@gnu.org>

	* emacs.c (main): Remove code snippet commented out with `//'.

2000-02-25  Richard M. Stallman  <rms@caffeine.ai.mit.edu>
	
	* fileio.c (Ffile_symlink_p): If result starts with a `/'
	and contains a `:', prepend `/:'.

	* window.c (select_window_1): If selected_window is nil,
	don't "swap out" the buffer's point.
	(Fset_window_configuration): Set selected_window to nil
	before calling Fselect_window.
	(unshow_buffer): Don't set point in buffer from window's point
	if another more recently selected window also shows the buffer.

2000-02-25  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (recursive_edit_1): Cancel busy-cursor.

	* xfns.c (inhibit_busy_cursor, busy_count): Removed.
	(Fx_show_busy_cursor, Fx_hide_busy_cursor): Removed.
	(busy_cursor_atimer, busy_cursor_shown_p, Vbusy_cursor_delay): New
	variables.
	(DEFAULT_BUSY_CURSOR_DELAY): New define.
	(start_busy_cursor, cancel_busy_cursor, show_busy_cursor)
	(hide_busy_cursor): New functions.
	(syms_of_xfns): DEFVAR_LISP Vbusy_cursor_delay.

	* minibuf.c (read_minibuf): Cancel busy-cursor.

	* keyboard.c (command_loop_1): Call start_busy_cursor before
	Fcommand_execute and cancel_busy_cursor after it.
	(timer_check): Remove busy-cursor code.
	(Fread_key_sequence, Fread_key_sequence_vector): Start/cancel busy
	cursor timer.

	* process.c (wait_reading_process_input): Remove busy-cursor code.

	* eval.c (Fsignal): Call cancel_busy_cursor instead of
	Fx_hide_busy_cursor.

	* dispextern.h (Fx_show_busy_cursor, Fx_hide_busy_cursor):
	Remove prototyoes.
	(start_busy_cursor, cancel_busy_cursor): Add prototypes.

	* lisp.h (Fx_hide_busy_cursor): Remove prototype.

	* xterm.c (XTread_socket): Remove busy-cursor code.

	* dispnew.c (flush_stdout) [GLYPH_DEBUG]: New function.
	(build_frame_matrix_from_leaf_window): Put code handling
	glyph row's not being a slice of a frame row in #if 0.
	(sync_window_with_frame_matrix_rows): New function.
	(frame_row_to_window): New function.
	(mirror_line_dance): Handle copies between windows.

	* lread.c (Fload): Use `xfree' instead of `free'.
	(init_obarray): Use `xmalloc' instead of `malloc'.

	* window.c (Fset_window_buffer): Set WINDOW to the window
	after decoding.
	(coordinates_in_window): Take frame's internal border width
	into account.

2000-02-24  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_display_and_set_cursor): Display cursor of
	non-selected windows depending on the setting of
	cursor_in_non_selected_windows.

	* xdisp.c (cursor_in_non_selected_windows): New variable.
	(syms_of_xdisp): DEFVAR_BOOL it.

2000-02-23  Gerd Moellmann  <gerd@gnu.org>

	* data.c (Fstring_to_number): If number is greater than what
	fits into an integer, return a float.

	* eval.c (specbind): Remove references to
	keyword_symbols_constant_flag.

	* data.c (keyword_symbols_constant_flag): Removed.
	(Fmakunbound, set_internal, syms_of_data): Remove references to
	keyword_symbols_constant_flag.

	* bytecode.c (Fbyte_code): Remove keyword_symbols_constant_flag.

2000-02-23  Kenichi Handa  <handa@etl.go.jp>

	* syntax.c (multibyte_syntax_as_symbol): New variable.
	(syms_of_syntax): Declare it as a Lisp variable.
	(SYNTAX_WITH_MULTIBYTE_CHECK): New macro.
	(scan_lists): If both sexpflag and multibyte_syntax_as_symbol are
	nonzero, treat all multibyte characters as symbol.
	(init_syntax_once): Give syntax `word' to all multibyte
	characters.

2000-02-22  Eli Zaretskii  <eliz@is.elta.co.il>

	* frame.c (Fdelete_frame): Don't let echo_area_window remain on
        a deleted frame.

2000-02-21  Gerd Moellmann  <gerd@gnu.org>

	* frame.c (Fmouse_position): GCPRO retval instead of x and y.

	* xfns.c (x_window_to_frame, x_any_window_to_frame)
	(x_non_menubar_window_to_frame): Check the busy-cursor window.

2000-02-21  Dave Love  <fx@gnu.org>

	* frame.c (Vmouse_position_function): New variable.
	(Fmouse_position): Use it.
	(syms_of_frame): Install it.

	* charset.c (find_charset_in_str): Fix use of `c' instead of `c1'.

2000-02-20  Gerd Moellmann  <gerd@gnu.org>

	* fileio.c (Finsert_file_contents): Unbind the binding of
	standard-output done by temp_output_buffer_setup.

	* eval.c (funcall_lambda): Don't bind Qmocklisp_arguments unless
	Vmocklisp_arguments is nil.  Inline Fcar and Fcdr.
	(specbind, unbind_to): Handle most common case of non-constant
	symbol with trivial value specially.

	* bytecode.c (Fbyte_code) <Bvarset>: Inline most common case.

2000-02-20  Richard M. Stallman  <rms@caffeine.ai.mit.edu>

	* data.c (Fmake_variable_buffer_local): Doc fix.
	Init found_for_buffer to 0.
	(Fmake_variable_frame_local): If the variable has already
	been buffer-local, set the check_frame field.

2000-02-20  Eli Zaretskii  <eliz@is.elta.co.il>

	* msdos.c (IT_write_glyphs): Allocate a larger screen_buf as data
	produced for CODING_MODE_LAST_BLOCK requires.

2000-02-18  Dave Love  <fx@gnu.org>

	* keyboard.c (echo_keystrokes): Remove declaration.
	(Vecho_keystrokes) New variable.
	(read_char, record_menu_key, read_key_sequence): Use it to allow
	use of float value.
	(syms_of_keyboard): Change Vecho_keystrokes declaration.

	* lread.c: Undef feature selection macros before defining.

2000-02-18  Gerd Moellmann  <gerd@gnu.org>

	* data.c (let_shadows_buffer_binding_p): Ignore specbindings
	for symbols other than the symbol in question.

2000-02-17  Dave Love  <fx@gnu.org>

	* s/sol2.h (C_DEBUG_SWITCH): Define to allow optimization.

2000-02-17  Gerd Moellmann  <gerd@gnu.org>

	* emacs.c (main): Use #if GC_MARK_STACK instead of #ifdef.

	* alloc.c (enum mem_type): Compile unconditionally.

2000-02-17  Eli Zaretskii  <eliz@is.elta.co.il>

	* xfaces.c (tty_defined_color): Don't return faulire indication
	for unspecified-fg and unspecified-bg pseudo-colors.

2000-02-17  Gerd Moellmann  <gerd@gnu.org>

	* alloc.c (mark_object): Don't mark symbol names in pure space.
	(gc_sweep): Don't unmark symbol names in pure space.

	* lisp.h (GC_USE_GCPROS_AS_BEFORE, GC_MAKE_GCPROS_NOOPS)
	(GC_MARK_STACK_CHECK_GCPROS, GC_USE_GCPROS_CHECK_ZOMBIES)
	[GC_MARK_STACK]: New defines.
	(GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, UNGCPRO) 
	[GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS]: Define as no-ops.

	* emacs.c (main) [GC_MARK_STACK]: Initialize stack_base.

	* buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Use
	allocate_buffer instead of xmalloc.

	* alloc.c (toplevel): Include setjmp.h.
	(PURE_POINTER_P): New define.
	(enum mem_type) [GC_MARK_STACK]: New enumeration.
	(Vdead) [GC_MARK_STACK]: New variable.
	(lisp_malloc): Add parameter TYPE, call mem_insert if
	GC_MARK_STACK is defined.
	(allocate_buffer): New function.
	(lisp_free) [GC_MARK_STACK]: Call mem_delete. 
	(free_float) [GC_MARK_STACK]: Set type to Vdead.
	(free_cons) [GC_MARK_STACK]: Set car to Vdead.
	(stack_base, mem_root, mem_z) [GC_MARK_STACK]: New variables.
	(MEM_NIL) [GC_MARK_STACK]: New define.
	(struct mem_node) [GC_MARK_STACK]: New structure.
	(mem_init, mem_find, mem_insert, mem_delete, mem_insert_fixup)
	(mem_delete_fixup, mem_rotate_left, mem_rotate_right)
	(live_string_p, live_cons_p, live_symbol_p, live_float_p)
	(live_misc_p, live_vector_p, live_buffer_p, mark_memory)
	(mark_stack) [GC_MARK_STACK]: New functions.
	(Fgarbage_collect) [GC_MARK_STACK]: Call mark_stack.
	(clear_marks): Removed.
	(gc_sweep): Set free conses' car, free floats' type, free
	symbols' function to Vdead.  Use lisp_free to free buffers.
	(init_alloc_once): Initialize Vdead.
	(survives_gc_p): Return non-zero for pure objects.

	* alloc.c: Add comments throughout the file.

	* atimer.c (stop_other_atimers): Don't call cancel_atimer because
	that unblocks alarms.

	* alloc.c, bytecode.c, data.c, dispnew.c, ecrt0.c, editfns.c,
	emacs.c, floatfns.c, fns.c, lread.c, print.c, config.in, lisp.h,
	Makefile.in: Remove `LISP_FLOAT_TYPE' and `standalone'.

	* frame.c (make_frame): Set frame initiallly to `garbaged'.
	
2000-02-17  Kenichi Handa  <handa@etl.go.jp>

	* xdisp.c (decode_mode_spec_coding): Delete superfluous code to
	avoid infinite error signaling.  Allocate sufficient memory for
	eol_str in the case that eoltype is Lisp_Int.

2000-02-17  Stefan Monnier  <monnier@cs.yale.edu>

	* syntax.c (Fforward_comment): Undo the previous change, since cc-mode
	depends on the previous behavior.

2000-02-16  Gerd Moellmann  <gerd@gnu.org>

	* sysdep.c (vfork) [!HAVE_VFORK]: Removed.

2000-02-15  Gerd Moellmann  <gerd@gnu.org>

	* s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN): Define.

	* process.c (send_process) [BROKEN_PTY_READ_AFTER_EAGAIN]:
	Workaround for FreeBSD bug.  Clear output queue after EAGAIN in
	write(2).

2000-02-15  Richard M. Stallman  <rms@gnu.org>

	* data.c (set_internal): Don't make variable buffer-local
	if within a let-binding for the same buffer.
	(let_shadows_buffer_binding_p): New function.

	* eval.c (specbind): For buffer-local value,
	record the current buffer also.
	(unbind_to): Cope with that change.

2000-02-15  Gerd Moellmann  <gerd@gnu.org>

	* window.c (Fsave_window_excursion): Doc fix.

2000-02-15  Stefan Monnier  <monnier@cs.yale.edu>

	* syntax.c (back_comment): Make sure we only consider comment-starters
	of the relevant style and return -1 in case of a failure to find the
	beginning of the comment.
	(Fforward_comment): If back_comment fails, go back to the position just
	after the comment-end.
	(scan_lists): Add comment describing a very minor bug.

2000-02-14  Stefan Monnier  <monnier@cs.yale.edu>

	* minibuf.c (Ftry_completion, Fall_completions): Add a reference to
	`completion-regexp-list' in the docstring.

2000-02-14  Dave Love  <fx@gnu.org>

	* xfaces.c (tty_defined_color): Declare color_idx unsigned long.

2000-02-14  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.h (RE_SYNTAX_EMACS): Add RE_CHAR_CLASSES and RE_INTERVALS
	to Emacs' syntax.  Also fix the comment about set/not-set meanings
	since Emacs syntax is not the value 0 any more.
	* search.c (compile_pattern_1): Remove RE_CHAR_CLASSES from the syntax
	since it's now part of RE_SYNTAX_EMACS.

2000-02-12  Dave Love  <fx@gnu.org>

	* frame.h (SELECTED_FRAME): Use NULL, not 0 to avoid warnings on
	Alpha.

2000-02-12  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (syms_of_xdisp): Doc fix for scroll-conservatively.

2000-02-12  Dave Love  <fx@gnu.org>

	* s/aix3-2.h, s/osf-1.h: Define C_DEBUG_SWITCH for non-gcc.

	* s/ux4800.h, s/umips.h, s/umax.h, s/sol2.h, s/sco5.h, s/rtu.h:
	* s/ptx4.h, s/umax.h, s/dgux.h, s/bsd4-2.h, s/bsd4-3.h:
	* s/hpux.h: Don't define HAVE_VFORK.

	* s/gnu-linux.h: Don't define HAVE_VFORK or HAVE_SYS_SIGLIST.

	* s/nextstep.h: Don't define HAVE_ALLOCA.

	* config.in: Add vfork bits.

2000-02-12  Gerd Moellmann  <gerd@gnu.org>

	* process.c (Fopen_network_stream) [POLL_FOR_INPUT]: Register
	unwind function to undo the effect of stopping atimers.

	* keyboard.c (bind_polling_period): Stop all timers except
	poll_timer.

	* atimer.c (stopped_atimers): New variable.
	(stop_other_atimers, run_all_atimers, unwind_stop_other_atimers):
	New functions.

	* atimer.h (stop_other_atimers, run_all_atimers)
	(unwind_stop_other_atimers): Add function prototypes.
	
	* s/hpux10.h (HAVE_XRMSETDATABASE): Define if not already defined.

2000-02-11  Ken Raeburn  <raeburn@gnu.org>

	* Makefile.in (LIBX): Link in tiff library before jpeg, since tiff
	library may depend on jpeg.
	(atimer.o): Depends on atimer.c.

2000-02-11  Kenichi Handa  <handa@etl.go.jp>

	* insdel.c (del_range_1): Call update_compositions.
	(del_range_both): Call update_compositions just once..

2000-02-10  Dave Love  <fx@gnu.org>

	* xfns.c (create_frame_xic): Fix initialization of automatic
	aggregates for pcc.

2000-02-09  Kenichi Handa  <handa@etl.go.jp>

	* ccl.c (CCL_MAKE_CHAR): New macro.
	(ccl_driver) <CCL_TranslateCharacter>: Check the validity of
	registers by CCL_MAKE_CHAR before calling translate_char.
	<CCL_TranslateCharacterConstTbl> Likewise.

2000-02-08  Dave Love  <fx@gnu.org>

	* lread.c (__EXTENSIONS__): Define.

2000-02-08  Gerd Moellmann  <gerd@gnu.org>

	* puresize.h (BASE_PURESIZE): Increase to 650000.

2000-02-07  Eli Zaretskii  <eliz@is.elta.co.il>

	* msdos.c (XMenuActivate): Turn off the cursor after displaying
	the help message.

2000-02-07  Eli Zaretskii <eliz@is.elta.co.il>

	* s/msdos.h (INTERNAL_TERMINAL): Add capabilities se, so, us, ue,
	md, mh, mb, mr, and me to the fake termcap entry.

2000-02-06  Ken Raeburn  <raeburn@gnu.org>

	* sound.c (sound_cleanup): Don't call device close routine if the
	function pointer is null.

2000-02-06  Andrew Innes  <andrewi@gnu.org>

	* dispextern.h: Change HAVE_X_WINDOWS to HAVE_WINDOW_SYSTEM,
	around image definitions and prototypes.
	(gamma_correct) [WINDOWSNT]: New prototype.

	* w32term.c (x_make_frame_visible): Replace call to
	input_poll_signal with poll_for_input.

	* window.c [WINDOWSNT]: Include w32term.h.

	* xdisp.c [WINDOWSNT]: Include w32term.h.

	* makefile.nt: Add dependencies on w32gui.h.
	(OBJ1): Include atimer.obj.
	($(BLD)\atimer.obj): New dependency rule.

	* w32.c (sigmask): New function (does nothing).
	(sigunblock): Ditto.

	* frame.c [WINDOWSNT]: Include w32term.h.

	* w32gui.h (struct W32FontStruct): Add ascent and descent slots.

	* lread.c (syms_of_lread): Fix literal newlines.

	* emacs.c (USAGE): Split into USAGE1 and USAGE2, to work-around
	the string constant limit (2048 bytes) in MSVC.
	(main): Ditto.

2000-02-05  INOUE Seiichiro <inoue@ainet.or.jp>

	* xterm.c (x_display_and_set_cursor) [HAVE_X_I18N]: Set pre-edit
	area.
	(x_display_cursor) [HAVE_X_I18N]: Don't set it here.
	(XTread_socket) [HAVE_X_I18N]: <KeyPress, KeyRelease>: Don't
	dispatch the event.

2000-02-04  Dave Love  <fx@gnu.org>

	* fileio.c: Remove some unused vars.
	(_GNU_SOURCE): Define (for euidaccess).

	* lread.c (_XOPEN_SOURCE): Declare (for ftello).

	* minibuf.c (read_minibuf_noninteractive): Remove undeclared
	gcpro1, gcpro2.
	(read_minibuf): Deal with allow_props correctly.

2000-02-03  Eli Zaretskii  <eliz@is.elta.co.il>

	* s/msdos.h (SYSTEM_PURESIZE_EXTRA): Enlarge to 60000.

2000-02-03  Ken Raeburn  <raeburn@gnu.org>

	* search.c (compile_pattern): If a cache entry has a nil regexp,
	fill in that entry instead of clobbering a previously cached
	string regexp.

2000-02-02  Ken Raeburn  <raeburn@gnu.org>

	* puresize.h (BASE_PURESIZE): Increase to 610000.

2000-02-02  Gerd Moellmann  <gerd@gnu.org>

	* frame.c (Fframe_parameters): Add GCPRO because tty_color_name
	can GC.

2000-02-02  Kenichi Handa  <handa@etl.go.jp>

	* ccl.c (ccl_driver) <CCL_WriteExprRegister>: Set jump_address
	instead of incrementing ic directly.
	<CCL_WriteExprConst> Likewise.
	<ccl_set_expr>: Set ic to jump_address.

	* fileio.c (e_write): Fix the handling of
	CODING_FINISH_INSUFFICIENT_SRC.

2000-02-01  Dave Love  <fx@gnu.org>

	* editfns.c (Fpropertize): Doc fix.

	* process.c (Fstart_process): Doc fix.

	* eval.c: Fix various doc strings not to duplicate information
	from help-manyarg-func-alist.

	* window.c (Fset_window_margins): Don't make interactive.  Doc
	fix.

	* doc.c (Vhelp_manyarg_func_alist): New variable.
	(Fdocumentation): Use it.
	(syms_of_doc): Define it.

2000-01-31  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (xim_open_dpy): Remove unused local variable.

	* emacs.c (USAGE): Use term `display options' instead of `X
	options'.

	* xdisp.c (Ftrace_to_stderr) [GLYPH_DEBUG]: New function.
	(syms_of_xdisp) [GLYPH_DEBUG]: Defsubr it.

	* fns.c (sweep_weak_table): New function.
	(sweep_weak_hash_tables): Use it.  Keep on marking until there
	is no more change.

2000-01-30  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_delete_display): Update next_noop_dpyinfo to ensure
	that XTread_socket does not crash by trying to call XNoOp on a
	closed display.
	
2000-01-30  Jason Rumney  <jasonr@gnu.org>

	* w32inevt.c (get_frame, w32_console_mouse_position, mouse_moved_to):
	Change selected_frame to SELECTED_FRAME ().
	(w32_console_mouse_position): Remove #ifndef MULE from around
	`insist' parameter.

	* makefile.nt: Remove dosfns.obj.

	* term.c (term_init) [WINDOWSNT]: Initialize TN_max_colors.

	* w32fns.c (w32_defined_color): Check for valid frame before
	applying gamma correction. Eliminate dependency on frame elsewhere.
	(w32_load_system_font): Switch FIXED_PITCH and VARIABLE_PITCH.
	(w32_to_x_font): Use resx and resy not height_in and width_in.
	(x_to_w32_font): Doc fix.
	(xlfd_strip_height): New function to strip and return font height.
	(w32_font_match): Compare height separately from rest of xlfd
	spec, using xlfd_strip_height.

	* w32term.c (w32_term_init): Swap resx and height_in, resy and
	width_in. Use w32_defined_color in place of defined_color.

	* w32faces.c: Merge more of DOS and X specifics in preparation for
	merge with xfaces.c.
	(defined_color): Remove FIXME comment.
	(tty_color_name): Provide w32-specific function.
	(realize_tty_face): Handle FACE_TTY_DEFAULT*_COLOR specially.

	* w32console.c (turn_on_face, turn_off_face): Removed.
	(w32_face_attributes): New function.
	(Global_variables): Reduce scope where possible.
	(clear_frame, ins_del_lines, scroll_line): Use char_attr_normal as
	fill attribute.
	(hl_mode): Don't modify text attributes.
	(write_glyphs): Don't do anything if len <= 0. Use
	w32_face_attributes to get attributes for drawing. Write
	terminating codes using char_attr_normal.
	(reset_terminal_modes, set_terminal_modes): Turn off highlight.
	(update_begin, update_end): Likewise.
	(vga_stdcolor_name): New function.
	(initialize_w32_display): Remove char_attr_reverse and char_attr.
	(Fset_screen_color): Remove char_attr_reverse.

2000-01-29  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (xic_set_preeditarea): Take window parameter and
	window-relative pixel-positions.

	* xterm.c (x_display_cursor): Set XIC pre-edit area only if window
	is its frame's selected window.
	(xim_instantiate_callback): Likewise.

	* xfns.c (x_create_im): Removed.
	(DEFAULT_STYLE, DEFAULT_FONT): Removed.
	(supported_xim_styles): Renamed from supported_styles.
	(best_xim_style): Renamed from best_style.
	(create_frame_xic): Renamed from xic_create_frame.
	(free_frame_xic): Renamed from xic_destroy_frame.
	
2000-01-29  INOUE Seiichiro <inoue@ainet.or.jp>

	* xterm.c (XTread_socket) [HAVE_X_I18N]: If event is for none of
	our frames, call XFilterEvent with 2nd parameter `None'.
	(XTread_socket) <KeyPress> [HAVE_X_I18N]: Handle XmbLookupString
	returning XBufferOverflow.
	(XTread_socket) <ConfigureNotify> [HAVE_X_I18N]: Set XIC status
	area.
	(x_display_cursor) [HAVE_X_I18N]: Set XIC pre-edit area.
	(x_new_fontset) [HAVE_X_I18N]: Create XIC status area fontset.
	(xim_destroy_callback, xim_open_dpy, xim_instantiate_callback)
	(xim_initialize, xim_close)
	[HAVE_X_I18N && HAVE_X11R6]: New functions.
	(x_destroy_window) [HAVE_X_I18N]:  Call xic_destroy_frame.
	(x_term_init) [HAVE_X_I18N]: Call xim_initialize.
	(x_delete_display) [HAVE_X_I18N]: Call xim_close.

	* xterm.h (struct x_display_info) [HAVE_X_I18N]: Add members `xim'
	and `xim_styles'.
	(struct x_output) [HAVE_X_I18N]: Remove member `xim', add
	`xic_style' and `xic_xfs'.
	(FRAME_MENUBAR_HEIGHT, FRAME_X_XIM, FRAME_X_XIM_STYLES)
	(FRAME_XIC_STYLE, FRAME_XIC_FONTSET): New macros.
	(FRAME_XIM): Removed.

	* xfns.c (supported_styles): New variable.
	(DEFAULT_STYLE, DEFAULT_FONT): New macros
	(xic_create_xfontset, best_style, xic_create_frame)
	(xic_destroy_frame, xic_set_preeditarea, xic_set_statusarea)
	(xic_set_xfontset): New functions.

2000-01-28  Dave Love  <fx@gnu.org>

	* s/irix6-5.h: Revert last change after change to irix5-0.h.

	* m/iris4d.h (C_SWITCH_MACHINE): Don't use -G0.

2000-01-28  Gerd Moellmann  <gerd@gnu.org>

	* buffer.c (Fother_buffer): Don't call Fset_buffer_major_mode
	for *scratch* if it already existed.

	* emacs.c (USAGE): New macro.
	(main): Use it to display usage information.

2000-01-27  Eli Zaretskii  <eliz@is.elta.co.il>

	Support for the menu-help feature:

	* msdos.h: Change prototypes of XMenuAddSelection and
	XMenuActivate.

	* msdos.c (IT_clear_end_of_line): Print the extent of the cleared
	part of the line to the termscript file.
	(IT_clear_to_end): Clear the entire line, not just its beginning.
	(menu_help_message, prev_menu_help_message): New variables.
	(IT_menu_make_room): Make room for the help_text member.
	(IT_menu_display): New argument disp_help; all callers changed.
	If disp_help is non-zero, store the help text of the active menu
	item in menu_help_message.
	(XMenuAddPane): Initialize the help_text member to NULL.
	(XMenuAddSelection): New argument help_text.  Store it in the
	XMenu structure.
	(XMenuActivate): New argument help_callback.  If the value of
	menu_help_message has changed since the last time, display the
	menu help message text while waiting for the mouse to move.  Clear
	the echo area before exiting.
	(XMenuDestroy): Free the help_text member.

2000-01-27  Gerd Moellmann  <gerd@gnu.org>

	* xmenu.c (xmenu_show) [!USE_X_TOOLKIT]: Pass help to
	XMenuAddSelection.  Pass help callback to XMenuActivate.
	(menu_help_callback) [!USE_X_TOOLKIT]: New function.

2000-01-27  Eli Zaretskii  <eliz@is.elta.co.il>

	* atimer.c (start_atimer) [!HAVE_SETITIMER]: Use EMACS_SET_SECS
	and EMACS_SET_USECS.

2000-01-26  Dave Love  <fx@gnu.org>

	* editfns.c (Fchar_after, Fchar_before): Doc fix.

	* bytecode.c (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
	an error may be signalled.

2000-01-26  Gerd Moellmann  <gerd@gnu.org>

	* s/irix6-5.h [__GNUC__ && __GNUC_MINOR__ >= 95]: Undef
	LD_SWITCH_SYSTEM inherited from irix5-0.h.

	* bytecode.c (Fbyte_code) [BYTE_CODE_SAFE]: Fix typo.

2000-01-25  Gerd Moellmann  <gerd@gnu.org>

	* charset.c (Fstring): If there is a multibyte char among
	the args, always return a multibyte string.

2000-01-25  Gerd Moellmann  <gerd@gnu.org>

	* sysdep.c (sys_select): Turn atimers off and on instead of
	recording and restoring old alarm handler

	* process.c (toplevel): Include atimer.h.
	(create_process_1): Rewritten.
	(create_process): Use atimers instead of alarm.
	(wait_reading_process_input) [hpux]: Turn atimers off instead
	of turning off SIGALRM.
	(wait_reading_process_input): Turn off atimers instead off
	calling stop_polling.

	* emacs.c (main): Call init_atimer.

	* keyboard.c (toplevel): Include systime.h and atimer.h.
	(polling_for_input): Removed because unused.
	(input_poll_signal) [POLL_FOR_INPUT]: Removed.
	(poll_timer): New variable.
	(poll_for_input, poll_for_input_1): New functions.
	(start_polling, stop_polling): Rewritten.

	* keyboard.h (polling_for_input): Removed.
	
	* atimer.h, atimer.c: New files.

	* Makefile.in (obj): Add atimer.o.
	(atimer.o): New target.

	* blockinput.h (pending_atimers): Add extern declaration.
	(UNBLOCK_INPUT): Rewritten.  Handle pending atimers.

	* lisp.h (popup_activated_flag): Add extern declaration.

	* xmenu.c (popup_activated_flag): Make externally visible.
	(popup_activate_callback) [USE_MOTIF]: Increment
	popup_activated_flag.
	(popup_deactivate_callback) [USE_MOTIF]: Decrement it.

	* xterm.c (toplevel): Include atimer.h.
	(toolkit_scroll_bar_interaction): New variable.
	(Fxt_process_timeouts): Removed.
	(x_process_timeouts): New function.
	(xt_action_hook): Clear toolkit_scroll_bar_interaction.
	(x_send_scroll_bar_event): Set toolkit_scroll_bar_interaction.
	(x_make_frame_visible): Call poll_for_input_1 instead of
	input_poll_signal.  Don't call alarm.
	(x_initialize): Install timer calling x_process_timeouts.
	
2000-01-24  Dave Love  <fx@gnu.org>

	* s/irix5-0.h: Don't set LD_SWITCH_SYSTEM -- we use unexelf now.
	Don't use -cckr -- apparently not now necessary.

2000-01-24  Eli Zaretskii  <eliz@is.elta.co.il>

	* msdos.c (IT_menu_display): Truncate long menu lines at the right
	screen boundary.

2000-01-23  Jason Rumney  <jasonr@gnu.org>

	* w32fns.c (w32_defined_color): Apply gamma correction before
	trying to map to the palette.
	(w32_wnd_proc) [WM_ERASE_BACKGROUND]: Pass device context of frame
	to w32_clear_rect.

	* w32term.c (w32_fill_rect): Do not try to deal with NULL hdc
	here. Callers changed to always pass real device context.
	(w32_draw_bitmap): Likewise.
	(w32_get_glyph_overhangs): Likewise.
	(w32_draw_box_rect): Make use of s->hdc rather than getting a new
	one.
	(w32_set_vertical_scroll_bar): Pass correct HWND parameters to
	pfnSetScrollInfo and SetScrollRange.
	(x_get_char_face_and_encoding): Don't turn iso8859-1 characters
	back into MULE characters after decoding them.
	(x_get_glyph_face_and_encoding): Likewise.
	(w32_per_char_metric): Use GetCharExtentPoint32W as fallback when
	GetCharABCWidthsW fails, since this is defined on Windows 9x.
	(x_produce_glyphs): Calculate per char metrics for a character
	that we know exists in default font when font_not_found_p is true.

2000-01-22  Jason Rumney <jasonr@gnu.org>

	* makefile.nt (intervals.obj, composite.obj): New modules.
	(composite.h): Added as dependency where appropriate.

	* w32gui.h (XGCValue): New struct for emulating X GCs.

	* w32term.h (XCharStruct): New struct for emulating X.

	* w32console.c (turn_on_face, turn_off_face): New functions.
	(change_line_highlight): New prototype for new redisplay.
	(write_glyphs): Support multibyte text. Support faces.

	* w32faces.c: Complete rewrite for new redisplay based on new
	xfaces.c.

	* w32fns.c: Use SELECTED_FRAME macro in place of selected_frame
	throughout. struct frame * in place of FRAME_PTR.
	Skeleton support for images, toolbars, tooltips from xfns.c.
	(Fx_create_frame): Use system default for default scroll bar
	width.
	(w32_get_arg): Renamed from x_get_arg.
	(Fx_file_dialog): New function.
	(w32_list_fonts): Check cache before asking system.
	(Vw32_enable_synthesized_fonts): New variable.
	(Vw32_enable_italics): Obsolete, removed.

	* w32inevt.c (get_frame, w32_console_mouse_position, mouse_moved_to):
	Use SELECTED_FRAME macro.

	* w32menu.c: Add skeleton support for help strings on menus.
	(add_menu_item): Native checkbox and radio support added, but not
	yet enabled due to bugs.
	(push_menu_item): Add parameters type, selection and help.
	Callers updated.
	Formatting changes to reduce unnecessary diffs with xmenu.c.

	* w32select.c (Fw32_set_clipboard_data): Update call to
	find_charset_in_str.

	* w32term.c: Complete rewrite for new redisplay based on new
	xterm.c with necessary sections merged back in from old w32term.c.

2000-01-21  Richard M. Stallman  <rms@gnu.org>

	* data.c (set_internal): Further fix in same criterion.

2000-01-20  Richard M. Stallman  <rms@gnu.org>

	* data.c (set_internal): Fix the criteria for whether
	to swap out the old cached binding.

2000-01-19  Dave Love  <fx@gnu.org>

	* lread.c: (syms_of_lread) [user-init-file]: Doc change.

2000-01-18  Kenichi Handa  <handa@etl.go.jp>

	* regex.c (re_compile_fastmap): While checking a range table for
	`charset', skip flag bits for a character class correctly.

2000-01-17  Gerd Moellmann  <gerd@gnu.org>

	* m/news-risc.h (LD_SWITCH_MACHINE): Define differently for GCC.

	* xfns.c (x_window): Call lw_create_widget with new parameter
	list.

	* widget.c (EmacsFrameSetCharSize): Change size of children first
	because of problems with main window geometry management under
	Lesstif.

	* xmenu.c (enum menu_item_idx): New enumeration replacing defines
	MENU_ITEMS_ITEM_.*.
	(MENU_ITEMS_ITEM_HELP): New enumerator.
	(push_menu_item): Add parameter HELP.  Record help in menu_items.
	(single_menu_item, single_submenu, list_of_items): Call
	push_menu_item with new parameter.
	(single_submenu): Set help string in widget value.
	(menu_highlight_callback): New function.
	(set_frame_menubar): Call lw_create_widget with new
	parameter list.
	(xmenu_show, xdialog_show): Ditto.

2000-01-13  Gerd Moellmann  <gerd@gnu.org>

	* sound.c (Fplay_sound): Improve doc string.

2000-01-11  Richard M. Stallman  <rms@gnu.org>

	* lisp.h (set_internal): Enter the new arg.

	* eval.c (specbind): Record buffer-local variables specially,
	indicating which buffer's binding was saved.
	(unbind_to): Restore buffer-local variables specially
	in the proper buffer.

	* data.c (set_internal): New arg BUF.
	
	* eval.c (specbind, unbind_to): Pass new arg to set_internal.
	* data.c (Fset): Pass new arg to set_internal.
	* bytecode.c (Fbyte_code): Pass new arg to set_internal.
	
2000-01-11  Gerd Moellmann  <gerd@gnu.org>

	* .gdbinit: Adapt to new strings.  Add xbacktrace, xreload,
	xprintsym.

2000-01-11  Richard M. Stallman  <rms@gnu.org>

	* minibuf.c (Ftry_completion): Doc fix.

2000-01-11  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (Fclear_this_command_keys): Clear recent_keys
	vector, too.

2000-01-11  Andreas Schwab  <schwab@suse.de>

	* coding.c (code_convert_region): Initialize total_skip.

2000-01-08  Dave Love  <fx@gnu.org>

	* eval.c (Fuser_variable_p): Check customizability too.

2000-01-07  Gerd Moellmann  <gerd@gnu.org>

	* minibuf.c (Fcompleting_read): Doc fix.

2000-01-05  Gerd Moellmann  <gerd@gnu.org>

	* s/freebsd.h (C_SWITCH_SYSTEM): Add -I /usr/local/include and
	-L /usr/local/lib.

	* xfns.c (x_create_im): New function to set IM and IC of a frame.
	Check that input style is supported before trying to create an
	IC for it.
	(x_window): Call x_create_im.
	
2000-01-04  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (current_gif_memory_src): New variable.
	(gif_load): Record the address of the current memory source
	in current_gif_memory_src.
	(gif_read_from_memory): Use current_gif_memory_src.

	* systime.h (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME): Give
	macros statement form.

	* sound.c (struct sound): Renamed from struct sound_file.
	(struct sound): Add members `data' and `header_size'.
	(enum sound_attr): Add SOUND_DATA.
	(current_sound, current_sound_device): Variables renamed from
	sound_file and sound_device.
	(parse_sound): Parse :data.
	(parse_sound): Handle sound data in strings.
	(find_sound_type): Function renamed from find_sound_file_type.
	(wav_init, au_init): Fail if sound's header_size is smaller than 
	needed header size.
	(wav_play, au_play): Play sounds from string data.

	* puresize.h (BASE_PURE_SIZE): Increase to 600000.

	* lisp.h: Add prototype for allocate_string_data.

	* alloc.c (Fgarbage_collect): Return number of live and free
	strings.

	* alloc.c (mark_buffer): Remove code in #if 0.
	(gc_sweep): Ditto.
	(UNMARK_BALANCE_INTERVALS): Give the macro statement form.
	(strings_consed): New variable.
	(allocate_string): Set it.
	(syms_of_alloc): Add DEFVAR_INT for strings_consed.
	(Fmemory_use_counts): Return strings_consed.  Use Flist.

	* alloc.c: General cleanup in comments etc.  Remove conditional
	compilation for `standalone'.

	* lisp.h (struct Lisp_String): Make DATA member `unsigned char *'.

	* alloc.c (MARK_STRING, UNMARK_STRING, STRING_MARKED_P):
	(GC_STRING_BYTES, GC_STRING_CHARS): New macros.
	(DONT_COPY_FLAG): Removed.
	(SBLOCK_SIZE, LARGE_STRING_BYTES): New macros.
	(struct sdata, struct sblock): New
	(struct string_block): Rewritten.
	(STRINGS_IN_STRING_BLOCK): New macro.
	(oldest_sblock, current_sblock, total_strings, total_free_strings)
	(large_sblocks, string_blocks, string_free_list): New variables.
	(NEXT_FREE_LISP_STRING, SDATA_OF_STRING, SDATA_SIZE): New macros.
	(init_strings): Rewritten.
	(allocate_string, allocate_string_data, compact_small_strings)
	(free_large_strings, sweep_strings): New functions.
	(STRING_BLOCK_SIZE, STRING_BLOCK_OUTSIZE)
	(struct string_block_head, current_string_block)
	(first_string_block, large_string_blocks, STRING_FULLSIZE)
	(STRING_PAD): Removed.
	(make_uninit_multibyte_string, make_pure_string): Rewritten.
	(Fgarbage_collect): Don't set mark bit in large strings.
	(mark_object): Mark strings differently.  Mark symbol names
	differently.
	(survives_gc_p): Test marked strings differently.
	(gc_sweep): Sweep strings differently, unmark strings in 
	symbol names.
	(compact_strings): Removed.

2000-01-04  Eli Zaretskii  <eliz@is.elta.co.il>

	* xfaces.c (syms_of_xfaces): defsubr Scolor_gray_p and
	Scolor_supported_p even if HAVE_X_WINDOWS is not defined.

2000-01-04  Kenichi Handa  <handa@etl.go.jp>

	* fileio.c (Finsert_file_contents): Signal error if visiting file
	in a non-empty buffer. 

	* term.c (encode_terminal_code): Fix the previous change.

2000-01-03  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (syms_of_xfaces): Change Sface_color_gray_p to
	Scolor_gray_p, Sface_color_supported_p to Scolor_supported_p.

	* s/hpux9.h (NO_EDITRES): Define even if HAVE_LIBXMU.

2000-01-03  Eli Zaretskii  <eliz@is.elta.co.il>

	* xdisp.c (handle_single_display_prop) [HAVE_WINDOW_SYSTEM]: No
	need to test for MSDOS frames.

2000-01-03  Eli Zaretskii  <eliz@is.elta.co.il>

	* dosfns.c (unspecified_colors): Remove.
	(msdos_stdcolor_idx): Use global variables unspecified_fg and
	unspecified_bg.
	(msdos_stdcolor_name): Return strings for unspecified fore- and
	back-ground colors.

	* xfaces.c (Qunspecified_fg, Qunspecified_bg): Remove.
	(syms_of_xfaces): Remove their staticpro's.
	(tty_color_name): Return Lisp strings for unspecified fore- and
	back-ground colors.
	(Finternal_set_lisp_face_attribute): Remove the special treatment
	for Qunspecified_{f,b}g.
	(realize_default_face): Replace Qunspecified_{f,b}g with a Lisp
	string.

2000-01-03  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (reseat_at_next_visible_line_start): Position before
	newline only if ending up on a newline.
	(next_element_from_ellipsis): Return success.  Handle case of
	displaying no ellipsis.  Fix case of ellipsis defined in display
	table.
	(next_element_from_buffer): Return 0 if next_element_from_ellipsis
	returns 0.

2000-01-03  Eli Zaretskii  <eliz@is.elta.co.il>

	* xfaces.c (Fcolor_gray_p): Renamed from face-color-gray-p.
	(Fcolor_supported_p): Renamed from face-color-supported-p.

2000-01-02  Eli Zaretskii  <eliz@is.elta.co.il>

	* xfaces.c (tty_defined_color): Pass frame to tty-color-desc.  The
	list of colors renamed to tty-defined-color-alist.
	(tty_color_name): Pass the frame to tty-color-by-index.
	(realize_tty_face): tty-color-alist is now a function which
	accepts the frame as argument.

	* term.c (Ftty_display_color_p): Accept an optional argument
	FRAME.

2000-01-02  Eli Zaretskii  <eliz@is.elta.co.il>

	* term.c (insert_glyphs): Pass glyph, not &glyph, to
	encode_terminal_code.

2000-01-02  Eli Zaretskii  <eliz@is.elta.co.il>

	* dispnew.c (mode_line_string): Support termcap frames as well.

2000-01-01  Gerd Moellmann  <gerd@gnu.org>

	* syntax.c (Fforward_word): Undo previous change.

	* editfns.c (Fconstrain_to_field): Don't constrain if
	inhibit-field-text-motion is non-nil.
	(Fline_beginning_position): Undo previous change.
	(Fline_end_position): Ditto.

	* syntax.c (Fforward_word): Notice field boundaries only if
	inhibit-field-text-motion is nil.

	* lisp.h: Add extern declaration for Vinhibit_field_text_motion.

	* editfns.c (Vinhibit_field_text_motion): New variable.
	(inhibit-field-text-motion): New DEFVAR_LISP.
	(Fline_beginning_position, Fline_end_position): Notice field
	boundaries only if inhibit-field-text-motion is nil.

	* xfns.c (x_create_x_image_and_pixmap): Remove parameter FILE.
	All calls adjusted.
	(x_build_heuristic_mask): Likewise.
	(xbm_load_image_from_file): Change error output.
	(xbm_load, xpm_load, pbm_load, png_load, jpeg_load, tiff_load)
	(gif_load, gs_load, x_kill_gs_process): Ditto.

	* xfns.c (gif_load): Avoid sign extension and thus out of bounds
	color indices when accessing raster pixels.
	(gif_image_p, png_image_p, jpeg_image_p, tiff_image_p): Allow only
	one of :file or :data.
	(enum pbm_keyword_index): Add PBM_DATA.
	(pbm_format): Add :data.
	(pbm_image_p): Allow either :file or :data.
	(pbm_read_file): New function.
	(pbm_scan_number): Rewritten to read from string.
	(pbm_load): Support :data.

1999-12-31  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c: New image functions adapted to Emacs conventions.
	(png_load, tiff_load, jpeg_load, gif_load): Always GCPRO local
	variable `file'.

1999-12-31  William M. Perry  <wmperry@aventail.com>

	* xfns.c (jpeg_format): Added the :data keyword
	(jpeg_image_p): JPEG is valid with :file _or_ :data
	(jpeg_memory_src): Defined new JPEG image source to read from a
	memory buffer.
	(jpeg_load): Pay attention to the :data keyword if specified.
	Instantiates a jpeg_memory_src instead of jpeg_stdio_src if
	found.
	(png_format): Added the :data keyword
	(png_image_p): PNG is valid with :file _or_ :data
	(png_read_from_memory): New PNG read function to read from a
	memory buffer.
	(png_load): Pay attention to the :data keyword if specified.  Uses
	png_set_read_fn() instead of png_init_io() if specified.
	(tiff_format): Added the :data keyword for TIFF images.
	(tiff_image_p): TIFF is valid with :file _or_ :data
	(tiff_read_from_memory): Defined new TIFF I/O functions to read
	from a memory buffer.
	(tiff_load): Pay attention to the :data keyword if specified.
	Uses TIFFClientOpen() instead of TIFFOpen() if specified.
	(gif_format): Added the :data keyword
	(gif_image_p): GIF is valid with :file _or_ :data
	(gif_read_from_memory): New GIF input function to read from a
	memory buffer.
	(gif_load): Pay attention to the :data keyword.  Uses DGifOpen()
	instead of DGifOpenFileName() if specified.

1999-12-31  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (next_element_from_buffer): Change assertion at the end
	because it doesn't hold when there's an overlay string at the end
	from which we deliver an image.

1999-12-30  Eli Zaretskii  <eliz@is.elta.co.il>

	* msdos.c (IT_update_begin): Don't dereference members of struct
	window for deleted windows.

1999-12-30  Gerd Moellmann  <gerd@gnu.org>

	* abbrev.c (Fexpand_abbrev): If expanding an abbrev which has only
	a hook, and the hook has a non-nil `no-self-insert' property, let
	the return value of the hook specify whether an expansion took
	place.  If it returns nil, no expansion has been performed.

	* xterm.c (x_make_frame_visible): Wait for frame becoming visible
	differently.

1999-12-30  Eli Zaretskii  <eliz@is.elta.co.il>

	* msdos.c (IT_write_glyphs): Track last changes to struct glyph.

1999-12-29  Eli Zaretskii  <eliz@is.elta.co.il>

	* dispnew.c (mode_line_string): Support MS-DOS frames.

1999-12-29  Gerd Moellmann  <gerd@gnu.org>

	* eval.c (syms_of_eval): Initialize debugger_may_continue.

1999-12-29  Kenichi Handa  <handa@etl.go.jp>

	* process.c (read_process_output): Fix the args CHARPOS and LENINS
	to signal_after_change.

1999-12-28  Eli Zaretskii  <eliz@is.elta.co.il>

	* msdos.c (dos_set_window_size) [__DJGPP__ > 1]: If the frame
	dimensions changed, invalidate the mouse highlight info.
	(disable_mouse_highlight, help_echo, previous_help_echo): New
	variables.
	(IT_set_mouse_pointer, show_mouse_face, clear_mouse_face)
	(fast_find_position, IT_note_mode_line_highlight)
	(IT_note_mouse_highlight): New functions.
	(IT_update_begin): If the redisplay affects the window where the
	mouse highlight is, clear the highlight.  If the frame where the
	highlight was displayed was killed, invalidate the highlight
	info.
	(IT_update_end): Reset the highlight flag.  Reset the mouse
	highlight-defer flag.
	(IT_frame_up_to_date): New function, if mouse highlight was
	deferred due to GC, do it now.
	(internal_terminal_init): Initialize mouse-highlight related
	members of the_only_x_display.  Assign IT_frame_up_to_date to
	frame_up_to_date_hook.
	(dos_rawgetc): If the mouse moved, update mouse highlight.  If
	help_echo changed value, generate a HELP_EVENT event.
	(syms_of_msdos): Staticpro help_echo and previous_help_echo.

	* msdos.h (struct display_info): New.
	(struct x_output): Add the display_info member.
	(FRAME_X_DISPLAY_INFO): New macro.

1999-12-28  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (try_window_id): Compute BEG_UNCHANGED and END_UNCHANGED
	if MODIFF > 1.
	(dump_glyph_row): Adapt to changes in struct glyph.

	* buffer.c (modify_overlay): Always compute unchanged info.

1999-12-27  Kenichi Handa  <handa@etl.go.jp>

	* dispextern.h (FACE_FROM_ID): Cast the arg ID to `unsigned'.

1999-12-27  Kenichi Handa  <handa@etl.go.jp>

	The following changes are to use more bits for face IDs.

	* lisp.h (GLYPH): Defined as `int', not `unsigned int'.  Now the
	lowest 8 bits are single byte character code, the bits above are
	face ID.
	(GLYPH_MASK_FACE, GLYPH_MASK_CHAR): Adjusted for the change
	above.
	(FAST_MAKE_GLYPH, FSST_GLYPH_FACE): Likewise.
	(GLYPH_MASK_REV_DIR, GLYPH_MASK_PADDING): Macros deleted.

	* charset.h (CHAR_BYTES): Use ((1 << CHARACTERBITS) - 1) instead
	of GLYPH_MASK_CHAR.

	* charset.c (char_bytes): Use ((1 << CHARACTERBITS) - 1) instead
	of GLYPH_MASK_CHAR.

	* dispextern.h (struct glyph): Make face_id and padding_p the top
	level members.  Change members in union `u'.
	(GLYPH_EQUAL_P): Check also members face_id and padding_p.
	(GLYPH_CHAR_AND_FACE_EQUAL_P): New macro.
	(SET_CHAR_GLYPH): Adjusted for the change of struct glyph.
	(CHAR_GLYPH_PADDING_P): Likewise.
	(GLYPH_FROM_CHAR_GLYPH): Likewise.  Always return -1 for multibyte
	characters.

	* dispnew.c (line_hash_code, direct_output_for_insert): Adjusted
	for the change of struct glyph.
	(line_draw_cost): Adjusted for the change of
	GLYPH_FROM_CHAR_GLYPH.
	(count_match): Use macro GLYPH_CHAR_AND_FACE_EQUAL_P.

	* term.c (encode_terminal_code): Adjusted for the change of struct
	glyph and GLYPH_FROM_CHAR_GLYPH.
	(write_glyphs, insert_glyphs, append_glyph): Adjusted for the
	change of struct glyph.

	* xdisp.c: All codes adjusted for the change of struct glyph.

	* xterm.c: All codes adjusted for the change of struct glyph.

1999-12-27  Kenichi Handa  <handa@etl.go.jp>

	* composite.h (struct composition): Change the order of declaring
	members to reduce the byte size of the structure.

1999-12-25  Gerd Moellmann  <gerd@gnu.org>

	* search.c (looking_at_1): Reset immediate_quit before modifying
	global data.

1999-12-24  Kenichi Handa  <handa@etl.go.jp>

	* process.c (read_process_output): Fix the arg FROM to
	update_compositions.

1999-12-22  Richard M. Stallman  <rms@gnu.org>

	* search.c (Freplace_match): For nonliteral replacement in buffer,
	construct all the new text first, then insert all at once.

1999-12-22  Dave Love  <fx@gnu.org>

	* xfns.c (Fx_show_tip): Gcpro `timeout' too.

1999-12-22  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (Fx_create_frame): Move x_default_parameter calls that
	lead to size changes to after the X window has been created.

	* xfaces.c (realize_x_face): Don't use uninitialized local
	variable in xassert.

1999-12-22  Kenichi Handa  <handa@etl.go.jp>

	* xfaces.c (face_color_supported_p): Check by tty_defined_color
	only when the frame is not for a window system.

1999-12-22  Gerd Moellmann  <gerd@gnu.org>

	* buffer.c (Fset_buffer_multibyte): Arrange for a thorough
	redisplay after changing the multibyteness of a buffer.

	* xterm.c (XTread_socket): At the beginning of the loop, pass the
	frame's X window to XFilterEvent instead of None because that's
	the X window for which the IC was created.  This makes dead
	accents work when the pointer is not in Emacs' frame.
	(XTread_socket) <KeyPress>: Don't call XFilterEvent here.

1999-12-20  Dave Love  <fx@gnu.org>

	* xfns.c (Fx_show_tip): Add missing UNGCPRO.

1999-12-19  Gerd Moellmann  <gerd@gnu.org>

	* eval.c (debugger_may_continue): New variable.
	(syms_of_eval): Add a DEFVAR_BOOL for it.
	(call_debugger): Bind it.

1999-12-19  Eli Zaretskii  <eliz@is.elta.co.il>

	* msdos.c (IT_set_face): Don't swap face colors when highlight or
	fp->tty_reverse_p is set, unless the computed colors are identical
	to frame colors.  Print both original and computed colors to
	termscript file.
	(IT_write_glyphs): Track the changes in handling of composite
	characters.
	(IT_set_frame_parameters): Don't set frame colors from
	unspecified-fg and unspecified-bg pseudo-colors.

1999-12-17  Dave Love  <fx@gnu.org>

	* data.c (Fkeywordp): New function.
	(syms_of_data): Install it.

1999-12-16  Eli Zaretskii  <eliz@is.elta.co.il>

	* xfaces.c (tty_defined_color): Fix last change.

1999-12-15  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (redisplay_window) <optional new window start>: Check
	that window start is in [BEGV..ZV].

1999-12-15  Eli Zaretskii  <eliz@is.elta.co.il>

	* dispextern.h (FACE_TTY_DEFAULT_FG_COLOR)
	(FACE_TTY_DEFAULT_BG_COLOR):  New macros.

	* xfaces.c (Qunspecified_fg, Qunspecified_bg): New variables.
	(syms_of_xfaces): Initialize and staticpro them.
	(tty_defined_color): If the color name is unspecified-fg or
	unspecified-bg, return FACE_TTY_DEFAULT_FG_COLOR and
	FACE_TTY_DEFAULT_BG_COLOR, respectively, as the pixel value.
	(tty_color_name): If the color pixel value is either
	FACE_TTY_DEFAULT_FG_COLOR or FACE_TTY_DEFAULT_BG_COLOR, return
	Qunspecified_fg or Qunspecified_bg, respectively.
	(Finternal_set_lisp_face_attribute): Allow values Qunspecified_fg
	and Qunspecified_bg for foreground and background colors.
	(realize_default_face): If the foreground and background colors
	are not specified, default to Qunspecified_fg and Qunspecified_bg.
	(realize_tty_face): By default, set the face colors to
	FACE_TTY_DEFAULT_FG_COLOR and FACE_TTY_DEFAULT_BG_COLOR.
	[MSDOS]: Handle FACE_TTY_DEFAULT_FG_COLOR and
	FACE_TTY_DEFAULT_BG_COLOR when face colors are not defined.
	Reverse the colors if the default colors were reversed.

	* dispnew.c (init_display): Initialize the frame pixels of the
	initial frame to FACE_TTY_DEFAULT_FG_COLOR and
	FACE_TTY_DEFAULT_BG_COLOR.

	* term.c (turn_on_face): If the default fore- and background
	colors are reversed, enter inverse video mode.  Don't send color
	escape sequences for unspecified foreground and background colors.
	(turn_off_face): Handle unspecified-fg and unspecified-bg colors.

	* dosfns.c (unspecified_colors): New variable.
	(msdos_stdcolor_idx): Handle unspecified-fg and unspecified-bg
	color names, return FACE_TTY_DEFAULT_FG_COLOR and
	FACE_TTY_DEFAULT_BG_COLOR, respectively.
	(msdos_stdcolor_name): Handle FACE_TTY_DEFAULT_FG_COLOR and
	FACE_TTY_DEFAULT_BG_COLOR, return Qunspecified_fg and
	Qunspecified_bg, respectively.

	* msdos.c (IT_set_face): Support FACE_TTY_DEFAULT_FG_COLOR and
	FACE_TTY_DEFAULT_BG_COLOR as pixel values.

1999-12-15  Kenichi Handa  <handa@etl.go.jp>

	* coding.c (code_convert_region): Fix the secoding arg to
	update_compositions.

1999-12-15  Kenichi Handa  <handa@etl.go.jp>

	The following changes are for the new composition mechanism.  We
	have deleted `composition' charset and composite characters,
	instead introduced a special text property `composition'.

	* Makefile.in (INTERVAL_SRC): Include composite.h.
	(INTERVAL_OBJ): Include composite.o.
	(SOME_MACHINE_OBJECTS): Include composite.o.
	(casefiddle.o) (dispnew.o) (indent.o) (process.o) (search.o)
	(syntax.o) (window.o) (xdisp.o) (xfaces.o) (xterm.o) (print.o):
	Depend on composite.h.
	(doc.o): Depend on charset.h.
	(keyboard.o) (textprop.o) (intervals.o): Depend on INTERVAL_SRC.
	(composite.o): New target.
	
	* alloc.c (Fmake_string): Adjusted for the change of CHAR_STRING.

	* callproc.c (Fcall_process): Call code_convert_string to encode
	arguments.  Use CODING_REQUIRE_DECODING to check if the process
	output should be decoded.

	* casefiddle.c: Include composite.h.
	(casify_object): Use MAX_MULTIBYTE_LENGTH to allocate memory for a
	multibyte character.  Adjusted for the change of CHAR_STRING.
	(casify_region): Likewise.  Call update_compositions.

	* category.h (CATEGORY_SET): Delete codes for a composite
	character.

	* category.c (word_boundary_p): Delete codes for a composite
	character.
	(Fmake_category_table): New function.
	(syms_of_category): Defsubr it.

	* ccl.c (CCL_WRITE_CHAR): Adjusted for the change of CHAR_STRING.
	(ccl_driver): Delete codes for a composite character.

	* charset.h: In this entry, just `Modified' means that codes for a
	composite character is deleted.
	(LEADING_CODE_COMPOSITION) (CHARSET_COMPOSITION)
	(charset_composition) (MIN_CHAR_COMPOSITION)
	(MAX_CHAR_COMPOSITION) (GENERIC_COMPOSITION_CHAR)
	(COMPOSITE_CHAR_P) (MAKE_COMPOSITE_CHAR) (COMPOSITE_CHAR_ID)
	(PARSE_COMPOSITE_SEQ) (PARSE_CHARACTER_SEQ): Deleted.
	(MAX_CHAR) (CHARSET_VALID_P) (CHARSET_DEFINED_P) (CHARSET_AT)
	(FIRST_CHARSET_AT) (SAME_CHARSET_P) (MAKE_NON_ASCII_CHAR)
	(PARSE_MULTIBYTE_SEQ) (SPLIT_NON_ASCII_CHAR) (CHAR_PRINTABLE_P):
	Modified.
	(SPLIT_STRING): Call split_string, not split_non_ascii_string.
	(CHAR_STRING): Delete WORKBUF argument.  Call char_string, not
	non_ascii_char_to_string.
	(STRING_CHAR): Call string_to_char, not string_to_non_ascii_char.
	(STRING_CHAR_AND_LENGTH): Likewise.
	(FETCH_CHAR_ADVANCE): New macro.
	(MAX_COMPONENT_COUNT) (struct cmpchar_info): Deleted.
	(MAX_MULTIBYTE_LENGTH): New macro.
	(MAX_LENGTH_OF_MULTI_BYTE_FORM): Deleted.
	(find_charset_in_str): Argument adjusted.
	(CHAR_LEN): Modified.
	
	* charset.c: In this entry, just `Modified' means that codes for a
	composite character is deleted.
	(Qcomposition) (leading_code_composition)
	(charset_composition) (min_composite_char) (cmpchar_table)
	(cmpchar_table_size) (n_cmpchars): Deleted.
	(SPLIT_COMPOSITE_SEQ): Deleted.
	(SPLIT_MULTIBYTE_SEQ): Modified.
	(char_to_string): Renamed from non_ascii_char_to_string.
	Modified.
	(string_to_char): Renamed from string_to_non_ascii_char.
	(split_string): Renamed from split_non_ascii_string.
	(char_printable_p) (Fsplit_char)
	(Ffind_charset_region) (Ffind_charset_string) (char_valid_p)
	(char_bytes) (Fchar_width) (strwidth): Modified.
	(find_charset_in_str): Argument CMPCHARP deleted.  Modified.
	(Fstring): Adjusted for the change of CHAR_STRING.  Modified.
	(hash_string) (CMPCHAR_HASH_TABLE_SIZE) (cmpchar_hash_table)
	(CMPCHAR_HASH_SIZE) (CMPCHAR_HASH_USED) (CMPCHAR_HASH_CMPCHAR_ID)
	(str_cmpchar_id) (cmpchar_component) (Fcmpcharp)
	(Fcmpchar_component) (Fcmpchar_cmp_rule) (Fcmpchar_cmp_rule_p)
	(Fcmpchar_cmp_count): Deleted.
	(Fcompose_string): Implemented by Emacs Lisp in composite.el.
	(init_charset_once): Modified.
	(syms_of_charset): Modified.

	* cmds.c (internal_self_insert): Adjusted for the change of
	CHAR_STRING.

	* coding.h (emacs_code_class_type): Delete the member
	EMACS_leading_code_composition.
	(COMPOSING_NO) (COMPOSING_WITH_RULE_HEAD) (COMPOSING_NO_RULE_HEAD)
	(COMPOSING_WITH_RULE_TAIL) (COMPOSING_NO_RULE_TAIL)
	(COMPOSING_WITH_RULE_RULE) (COMPOSING_HEAD_P)
	(COMPOSING_WITH_RULE_P): Macros deleted.
	(COMPOSITION_DATA_SIZE) (COMPOSITION_DATA_MAX_BUNCH_LENGTH): New
	macros.
	(struct composition_data): New structure.
	(CODING_FINISH_INSUFFICIENT_CMP): New macro.
	(struct coding_system): New members composition_rule_follows,
	cmp_data, cmp_data_start, cmp_data_index.
	(coding_save_composition) (coding_free_composition_data)
	(coding_adjust_composition_offset): Extern them.

	* coding.c: Include composite.h.
	(DECODE_CHARACTER_ASCII): Don't handle composition here.
	(DECODE_CHARACTER_DIMENSION1): Likewise.  Don't check the validity
	of multibyte code here.
	(DECODE_CHARACTER_DIMENSION2): Likewise.
	(detect_coding_emacs_mule): Change the case label from
	EMACS_leading_code_composition to 0x80.
	(detect_coding_iso2022): Handle new composition sequence.
	(DECODE_ISO_CHARACTER): Likewise.
	(check_composing_code): Deleted.
	(coding_allocate_composition_data): New function.
	(CODING_ADD_COMPOSITION_START) (CODING_ADD_COMPOSITION_END)
	(CODING_ADD_COMPOSITION_COMPONENT) (DECODE_COMPOSITION_START)
	(DECODE_COMPOSITION_END) (DECODE_COMPOSITION_RULE): New macros.
	(decode_coding_iso2022): Handle new composition sequence.
	(ENCODE_ISO_CHARACTER): Don't check composition here.
	(ENCODE_COMPOSITION_RULE) (ENCODE_COMPOSITION_START): New macros.
	(ENCODE_COMPOSITION_NO_RULE_START)
	(ENCODE_COMPOSITION_WITH_RULE_START): Deleted.
	(ENCODE_COMPOSITION_END): Handle new composition sequence.
	(ENCODE_COMPOSITION_FAKE_START): New macro.
	(encode_coding_iso2022): Handle new composition sequence.
	(ENCODE_SJIS_BIG5_CHARACTER): Delete superfluous `;' at the tail.
	(encode_coding_sjis_big5): Ignore composition.
	(setup_coding_system): Initialize new members of struct
	coding_system.  Enable composition only when the coding system has
	`composition' property t.
	(coding_free_composition_data) (coding_adjust_composition_offset)
	(coding_save_composition) (coding_restore_composition): New
	functions.
	(code_convert_region): Call coding_save_composition for encoding
	and coding_allocate_composition_data for decoding.  Don't skip
	ASCII characters if we handle composition on encoding.  Call
	signal_after_change with Check_BORDER.
	(code_convert_string): Call coding_save_composition for encoding
	and coding_allocate_composition_data for decoding.  Don't skip
	ASCII characters if we handle composition on encoding.
	(code_convert_string1): Set Vlast_coding_system_used after calling
	code_convert_string.
	(code_convert_string_norecord): Disable composition.
	(Fset_terminal_coding_system_internal): Likewise.
	(Fset_safe_terminal_coding_system_internal): Likewise.
	(Fset_keyboard_coding_system_internal): Likewise.
	(init_coding_once): Set emacs_code_class[0x80] to
	EMACS_invalid_code.

	* composite.h: New file.

	* composite.c: New file.

	* data.c (Faref): Delete codes for a composite character..
	(Faset): Likewise.  Adjusted for the change of CHAR_STRING.

	* dispextern.h (enum glyph_type): New member COMPOSITE_GLYPH.
	(struct glyph): Add new sub-structure cmp to the union `u'.
	(enum display_element_type): New member IT_COMPOSITION.
	(enum prop_idx): New member COMPOSITION_PROP_IDX.
	(struct it): New members cmp_id, cmp_len.

	* dispnew.c (direct_output_forward_char): Check point moving into
	or out of a composition.  If so, give up direct method.

	* doprnt.c (doprnt1): Adjusted for the change of CHAR_STRING.

	* editfns.c (Fchar_to_string): Adjusted for the change of
	CHAR_STRING.
	(general_insert_function): Likewise.
	(Finsert_char): Likewise.
	(Fsubst_char_in_region): Likewise.  Call update_compositions.
	(Ftranslate_region): Call update_compositions.
	(Ftranspose_regions): Call update_compositions.

	* emacs.c (main): Call syms_of_composite.

	* fileio.c (Fsubstitute_in_file_name): Adjusted for the change of
	CHAR_STRING.
	(Finsert_file_contents): Set Vlast_coding_system_used before
	calling signal_after_change.  Call update_compositions if some
	texts are inserted..
	(Fwrite_region): Adjusted for the change of a_write and e_write.
	(a_write): Argument changed.  Work based on character position,
	not byte position.
	(e_write): Argument changed.  Handle new way of composition.

	* fns.c (Flength): The length of char-table is MAX_CHAR.
	(concat): Adjusted for the change of CHAR_STRING.
	(Ffillarray): Adjusted for the change of CHAR_STRING.
	(Fset_char_table_default): Delete codes for a composite character.
	(hash_put): Return hash index.

	* fontset.h (struct font_info): New member vertical_centering.
	(Vvertical_centering_font_regexp): Extern it.

	* fontset.c (Vvertical_centering_font_regexp): New variable.
	(syms_of_fontset): Declare it as a Lisp variable and initialize.
	Set Vignore_relative_composition to nil.
	(fs_load_font): Initialize `vertical_centering' of struct
	font_info.

	* indent.c (check_composition): New function.
	(MULTIBYTE_BYTES_WIDTH): Call STRING_CHAR_AND_LENGTH with
	MAX_MULTIBYTE_LENGTH, not MAX_LENGTH_OF_MULTI_BYTE_FORM.
	(current_column_1): Handle new way of composition.
	(Fmove_to_column): Likewise.
	(compute_motion): Likewise.

	* insdel.c (copy_text): Adjusted for the change of CHAR_STRING.
	(insert_char): Likewise.
	(insert): Call update_compositions.
	(insert_and_inherit): Likewise.
	(insert_before_markers): Likewise.
	(insert_before_markers_and_inherit): Likewise.
	(insert_from_string): Likewise.
	(insert_from_string_before_markers): Likewise.
	(insert_from_buffer): Likewise.
	(replace_range): Likewise.
	(count_combining_composition): Deleted.
	(count_combining_before): Delete codes for a composite character.
	(count_combining_after): Likewise.
	(del_range_1): Call update_compositions.
	(del_range_byte): Likewise.
	(del_range_both): Likewise.
	(Fcombine_after_change_execute): Likewise.

	* intervals.h: Include composite.h.
	(get_property_and_range): Extern it.
	(Vtext_property_default_nonsticky): Extern it.
	
	* intervals.c (adjust_intervals_for_insertion): To check stickines
	of properties, pay attention to text-property-default-nonsticky.
	(merge_properties_sticky): Likewise.
	(get_property_and_range): New function.

	* keyboard.c (Vdisable_point_adjustment): New variable.
	(Vglobal_disable_point_adjustment): New variable.
	(syms_of_keyboard): Declare them as Lisp variables.
	(command_loop_1): Check them and call adjust_point_for_property if
	necessary.
	(adjust_point_for_property): New function.

	* keymap.c (push_key_description): Adjusted for the change of
	CHAR_STRING.
	(Ftext_char_description): Likewise.

	* lisp.h (QCtest, QCweakness, Qequal): Extern them.
	(hash_put): Adjusted for the change of the definition.
	(signal_after_change): Likewise.
	(check_point_in_composition): Extern it.

	* lread.c (readchar): Adjusted for the change of CHAR_STRING.
	Delete a code that handles an invalid too-long multibyte sequence
	because we are now sure that we never encounter with such a
	sequence.
	(read_multibyte): Use macro MAX_MULTIBYTE_LENGTH, not
	MAX_LENGTH_OF_MULTI_BYTE_FORM.
	(init_obarray): Likewise.
	(read1): Likewise.  Adjusted for the change of CHAR_STRING.

	* print.c (printchar): Adjusted for the change of CHAR_STRING.

	* process.c: Include composite.h.
	(read_process_output): Call update_compositions.

	* regex.c (regex_compile): Adjusted for the change of CHAR_STRING.

	* search.c (search_buffer): Adjusted for the change of CHAR_STRING.

	* syntax.h (SYNTAX_ENTRY_INT): Delete codes for a composite
	character.

	* term.c (encode_terminal_code): Delete codes for a composite
	character.  Adjusted for the change of CHAR_STRING.
	(produce_glyphs): When called, it->what can be IT_COMPOSITION.
	Delete codes for a composite character.

	* textprop.c (Vtext_property_default_nonsticky): New variable
	(syms_of_textprop): Declare it as a Lisp variable.

	* window.c (Frecenter): Clear all caches of compositions.

	* xdisp.c (it_props): Add an entry for composition.
	(face_before_or_after_it_pos): For composition, check face of a
	character after the composition.
	(handle_composition_prop): New function.
	(get_next_display_element): Adjusted for the change of
	CHAR_STRING.
	(set_iterator_to_next): Handle the case that it->method ==
	next_element_from_composition.
	(next_element_from_composition): New function.
	(message_dolog): Adjusted for the change of CHAR_STRING.
	(set_message_1): Likewise.
	(check_point_in_composition): New function.
	(reconsider_clip_changes): If point moved into or out of
	composition, set b->clip_changed to 1 to force updating of the
	screen.
	(disp_char_vector): Delete codes for a composite character.
	(decode_mode_spec_coding): Adjusted for the change of CHAR_STRING.

	* xfaces.c (choose_face_fontset_font): Delete codes for a
	composite character.
	(realize_x_face): Likewise.  Change a place to set local variable
	`f' to avoid a bug of GCC 2.8.1 on Solaris.

	* xfns.c: Include intervals.h.
	(syms_of_xfns): Make `display' property nonsticky by default.

	* xselect.c (lisp_data_to_selection_data): Adjusted for the change
	for find_charset_in_str.

	* xterm.h (struct x_output): Change member font_baseline to
	baseline_offset.

	* xterm.c (x_append_glyph): Setup members of struct glyph properly
	for composition.
	(x_append_composite_glyph): New function.
	(VCENTER_BASELINE_OFFSET): New macro.
	(x_produce_glyphs): If it->what == IT_COMPOSITION, setup members
	of struct it for the composition.  Cache pixel offsets in the
	struct composition.  Delete codes for a composite character.
	Handle Vignore_relative_composition in composition code.
	(struct glyph_string): Delete member cmpcharp, add new member cmp.
	(x_set_cursor_gc): Check s->cmp, not s->cmpcharp.
	(x_compute_glyph_string_overhangs): Likewise.
	(x_get_glyph_overhangs): Delete codes for a composite character.
	(x_right_overwritten): Check s->cmp, not s->cmpcharp.
	(x_draw_glyph_string_background): Likewise.  Delete codes for
	checking s->gidx for a composition.
	(x_draw_glyph_string_foreground): Delete code for a composite
	character.
	(x_draw_composite_glyph_string_foreground): New function.
	(x_draw_glyph_string_box): Check s->cmp, not s->cmpcharp.
	(x_draw_glyph_string): Handle the case of COMPOSITE_GLYPH.
	(struct work): Deleted.
	(x_fill_composite_glyph_string): Argument changed.  Mostly
	rewritten for that.
	(x_fill_glyph_string): Don't check CHARSET_COMPOSITION.
	(BUILD_CHAR_GLYPH_STRINGS): Don't handle composition here.
	(BUILD_COMPOSITE_GLYPH_STRING): New macro.
	(BUILD_GLYPH_STRINGS): For composition, call
	BUILD_COMPOSITE_GLYPH_STRING.
	(x_new_font): Initialize f->output_data.x->baseline_offset, not
	f->output_data.x->font_baseline.

1999-12-14  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (show_mouse_face): Don't use updated_area, use
	TEXT_AREA.

1999-12-12  Richard M. Stallman  <rms@gnu.org>

	* minibuf.c (Fall_completions): Doc fix.

1999-12-12  Richard M. Stallman  <rms@gnu.org>

	* macros.c (Fstart_kbd_macro): Handle case where last-kbd-macro
	has been changed by the Lisp code.

1999-12-12  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c: Indentation fixes.

1999-12-10  Stefan Monnier  <monnier@cs.yale.edu>

	* xterm.c (x_initialize): Only setup xaw3d_* if they've been declared.

1999-12-10  Gerd Moellmann  <gerd@gnu.org>

	* frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL)
	[!MSDOS && !WINDOWSNT && !macintosh]: Moved here from xterm.h.

	* xterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Moved
	to frame.h.

1999-12-09  Stefan Monnier  <monnier@cs.yale.edu>

	* keyboard.c (Qratio): New symbol.
	(scroll_bar_parts): Add `Qratio' to it.
	(syms_of_keyboard): Init `Qratio'.
	* termhooks.h (scroll_bar_part): Add `scroll_bar_move_ratio'.
	* xterm.c (#includes): Allow compilation with only Xaw.
	(xaw3d_arrow_scroll, xaw3d_pick_top): New variables.
	(xt_action_hook): Replace XAW3D by XAW.
	(xaw3d_jump_callback): Renamed to xaw_jump_callback.
	(xaw_jump_callback): Renamed from xaw3d_jump_callback.
	Determine epsilon dynamically and don't try to be too clever.
	(xaw3d_scroll_callback): Renamed to xaw_scroll_callback.
	(xaw_scroll_callback): Renamed from xaw3d_scroll_callback.
	Handle both Xaw3d with arrow-scrollbars and with Xaw-style
	scrollbar (using `ratio').
	(x_create_toolkit_scroll_bar): Try to detect which style of Xaw3d
	scrollbar we have so as to set it up more optimally and to fix
	xaw3d_arrow_scroll and xaw3d_pick_top.
	(x_set_toolkit_scroll_bar_thumb): Try to maintain 2 spare pixels at the
	bottom of the Xaw3d scrollbar, to work around its tendency to refuse
	shrinking the thumb.  Also make sure that `XawScrollbarSetThumb'
	is not ignored, using a major gross hack.
	(x_initialize): Init default values for xaw3d_arrow_scroll and
	xaw3d_pick_top.

1999-12-09  Dave Love  <fx@gnu.org>

	* frame.h: (PIX_TYPE) [! HAVE_X_WINDOWS]: Define PIX_TYPE.

1999-12-08  Gerd Moellmann  <gerd@gnu.org>

	* eval.c: Remove conditional compilation on `standalone'.
	(call_debugger): When entering the debugger while redisplaying,
	reset redisplaying_p, and go back to the top-level if the debugger
	returns.

1999-12-07  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (x_set_menu_resources_from_menu_face): Make sure
	basic faces are realized before trying to use face `menu'.

	* window.c (delete_window): Block input for the time window
	matrices are being changed.

1999-12-07  Dave Love  <fx@gnu.org>

	* lread.c (Fintern_soft): Fix newlines in doc string.

1999-12-07  Alexandre Oliva  <oliva@dcc.unicamp.br>

	* unexelf.c: Include <syms.h>, not <sym.h> on IRIX.  Removed
	duplicate definition of ElfW.
	(find_section): Copied from unexsgi.c.
	(unexec): Use find_section.  Adjust whitespace.  Initialize
	new_data2_offset based on old_data, not sbss (this fixes a bug on
	IRIX6).  Change #ifdef __mips to __sgi, since it's IRIX-specific.
	Adjust test for presence of .mdebug section to the new return
	value of find_section.
	
1999-12-07  Gerd Moellmann  <gerd@gnu.org>

	* unexelf.c: Merge changes from 20.5.
	(unexec): Handle .lit4 and .lit8 unconditionally.

	* m/iris4d.h (UNEXEC) [USG5_4]: Use unexelf.o instead of
	unexsgi.o again.
	
	* m/iris5d.h (UNEXEC): Likewise.

1999-12-06  Stefan Monnier  <monnier@cs.yale.edu>

	* editfns.c (Fdelete_and_extract_region): New function.
	(syms_of_editfns): Register it.
	* insdel.c (del_range): Update del_range_1 call.
	(del_range_1, del_range_2): Add a ret_string argument to
	request that the deleted text be returned.
	(del_range_byte, del_range_both): Update del_range_2 call.
	* lisp.h (del_range_1, del_range_2): Change prototype
	* casefiddle.c (casify_region): Update del_range_1 call.
	* coding.c (code_convert_region): Update del_range_2 call.
	* fileio.c (Finsert_file_contents): Update del_range_2 call.

1999-12-06  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (set_lface_from_font_name): Fix incomplete merge.

1999-12-04  Hrvoje Niksic  <hniksic@iskon.hr>

	* lread.c (Fintern_soft): Accept a symbol argument.
	
1999-12-06  Eli Zaretskii  <eliz@is.elta.co.il>

	* s/msdos.h (SYSTEM_PURESIZE_EXTRA): Reduce to 40000.

	* insdel.c (adjust_markers_for_delete): Fix last change.

1999-12-06  Eli Zaretskii  <eliz@is.elta.co.il>

	Changes for automatic remapping of X colors on terminal frames:

	* xfaces.c (XColor) [!HAVE_X_WINDOWS]: Provide a typedef for non-X
	frames.
	(Vface_tty_color_alist): Remove.
	(tty_defined_color): New function.
	(defined_color): Rewrite to support any type of frame.
	(tty_color_name): New function.
	(face_color_supported_p, Fface_color_gray_p,
	Fface_color_supported_p): Support non-X frames.
	(load_color): Enclose the color name in quotes, in the log
	messages.  Remove DOS-specific version of load_color.
	(realize_tty_face): Take the supported colors from
	tty-color-alist.  Support translation of X colors to the closest
	tty color, for both MSDOS and tty frames.
	[MSDOS]: Don't invert face colors if they were taken from the
	frame colors.
	(Fface_register_tty_color, Fface_clear_tty_colors): Remove.

	* frame.h (struct x_output) [!MSDOS, !WINDOWSNT, !HAVE_X_WINDOWS]:
	Define a mostly empty surrogate.
	(tty_display): Declare.

	* frame.c (make_terminal_frame) [!macintosh]: Don't use
	tty_display.
	(Fframe_parameters): Don't invert colors of non-FRAME_WINDOW_P
	frames when the frame's param_alist includes 'reverse.
	(tty_display): Define.
	(make_terminal_frame) [!MSDOS]: Assign &tty_display to the
	output_data.x member.
	(Fframe_parameters): Return foreground and background color names
	on tty frames as well, in addition to MSDOS frames.

	* msdos.h (DisplayWidth, DisplayHeight): Changes for Lisp_Object
	selected_frame.
	(struct x_output): Remove unused members; document who uses each
	member.
	(FRAME_PARAM_FACES, FRAME_N_PARAM_FACES, FRAME_DEFAULT_PARAM_FACE,
	FRAME_MODE_LINE_PARAM_FACE, FRAME_COMPUTED_FACES,
	FRAME_N_COMPUTED_FACES, FRAME_SIZE_COMPUTED_FACES,
	FRAME_DEFAULT_FACE, FRAME_MODE_LINE_FACE, unload_color): Remove
	unused macro definintions.

	* msdos.c (IT_set_frame_parameters): Don't call
	recompute_basic_faces, the next redisplay will, anyway.
	(x_current_display): Remove unused variable.
	Many functions: changes for Lisp_object selected_frame.
	(IT_set_face): If the tty_reverse_p flag is set for the face,
	reverse the foreground and background colors.
	(Fmsdos_remember_default_colors): New function.
	(syms_of_msdos): Defsubr it.
	(IT_set_frame_parameters): Use initial_screen_colors[] when
	creating a new frame.  If the frame parameters include 'reverse,
	swap the foreground and background colors.
	(internal_terminal_init): Initialize initial_screen_colors to -1.
	(syms_of_msdos): Add DEFVAR_BOOL for x-stretch-cursor, to shut up
	cus-start.el.

	* Makefile.in (lisp, shortlisp): Add lisp/term/tty-colors.elc.

	* xfns.c (x_defined_color): Rename from defined_color.  All
	callers changed.
	(Fxw_color_defined_p): Renamed from Fx_color_defined_p;
	all callers changed.
	(Fxw_color_values): Renamed from Fx_color_values; all callers
	changed.
	(Fxw_display_color_p): Renamed from Fx_display_color_p; all
	callers changed.
	(x_window_to_frame, x_any_window_to_frame,
	x_non_menubar_window_to_frame, x_menubar_window_to_frame,
	x_top_window_to_frame): Use !FRAME_X_P instead of
	f->output_data.nothing.
	* xterm.h (x_defined_color): Rename from defined_color.

	* w32fns.c (x_window_to_frame): Use FRAME_W32_P instead of
	f->output_data.nothing.
	(Fxw_color_defined_p): Renamed from Fx_color_defined_p;
	all callers changed.
	(Fxw_color_values): Renamed from Fx_color_values; all callers
	changed.
	(Fxw_display_color_p): Renamed from Fx_display_color_p; all
	callers changed.

	* dispextern.h (tty_color_name): Add prototype.

	* xmenu.c (menubar_id_to_frame): Use FRAME_WINDOW_P instead of
	f->output_data.nothing.
	* w32menu.c (menubar_id_to_frame): Likewise.
	* w32term.h (w32_output): Declare.

	* dosfns.c (Qmsdos_color_translate): Remove.
	(msdos_stdcolor_name): Now returns a Lisp_Object.
	* dosfns.h (Qmsdos_color_translate): Remove.

	* s/msdos.h (INTERNAL_TERMINAL): Add entries for color support.

1999-12-06  Kenichi Handa  <handa@etl.go.jp>

	* fileio.c (decide_coding_unwind): Renamed from
	set_auto_coding_unwind.
	(Finsert_file_contents): Make single unwind protect to call both
	Vset_auto_coding_function and Ffind_operation_coding_system.

	* insdel.c (adjust_markers_for_delete): Make it non-static.

1999-12-04  Stefan Monnier  <monnier@cs.yale.edu>

	* regex.c (regex_compile): Recognize *?, +? and ?? as non-greedy
	operators and handle them properly.
	* regex.h (RE_ALL_GREEDY): New option.
	(RE_UNMATCHED_RIGHT_PAREN_ORD): Moved to the end where alphabetic
	sorting would put it.
	(RE_SYNTAX_AWK, RE_SYNTAX_GREP, RE_SYNTAX_EGREP)
	(_RE_SYNTAX_POSIX_COMMON): Use the new option to keep old behavior.

1999-12-04  Dave Love  <d.love@dl.ac.uk>

	* m/arm.h: New file.

1999-12-03  Dave Love  <fx@gnu.org>

	* editfns.c (Fmessage_or_box): Use use_dialog_box.

1999-12-02  Gerd Moellmann  <gerd@gnu.org>

	* s/usg5-4.h (LIBS_SYSTEM): Add -lgen because that's needed
	for building with Motif.

	* m/iris4d.h (UNEXEC) [USG5_4]: Use unexsgi.o instead of
	unexelf.o.
	
	* m/iris5d.h (UNEXEC): Use unexsgi.o instead of unexelf.o.

1999-12-01  Dave Love  <fx@gnu.org>

	* emacs.c (main): Set LANG=C iff AX3_2 defined.

1999-11-28  Gerd Moellmann  <gerd@gnu.org>

	* systime.h (EMACS_TIME_CMP, EMACS_TIME_EQ, EMACS_TIME_NE)
	(EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT,EMACS_TIME_LE): New
	macros.

	* config.in (HAVE_SETITIMER, HAVE_UALARM): New.

1999-11-28  eliz  <eliz@dlpx1>

	* emacs.c (synchronize_locale): Avoid compiler warnings about
	pointer type mismatch.

1999-11-28  Gerd Moellmann  <gerd@gnu.org>

	* window.c (Fwindow_end): Don't call temp_set_pt_both with
	out of range position.

	* xterm.c (XTread_socket) <ClientMessage, Xatom_Scrollbar>: 
	Switch off busy-cursor by setting inhibit_busy_cursor to 2.

1999-11-28  Eli Zaretskii  <eliz@is.elta.co.il>

	* charset.c (Fmake_char_internal): Print the charset ID when
	signalling an error.

	* emacs.c (synchronize_locale): Avoid compiler warnings about
	pointer type mismatch.

1999-11-26  Richard M. Stallman  <rms@gnu.org>

	* editfns.c (Fdelete_field): Make it noninteractive.  Return nil.

1999-11-26  Gerd Moellmann  <gerd@gnu.org>

	* puresize.h (BASE_PURESIZE): Increase to 550000.

	* textprop.c (set_text_properties): New function.  Like
	Fset_text_properties, but with additional parameter
	SIGNAL_AFTER_CHANGE_P.  If that is nil, don't signal after
	changes.
	(Fset_text_properties): Use it.

	* insdel.c (insert_1_both): Call set_text_properties with last
	parameter nil so that no after changes will be signaled.

	* lisp.h: Add prototype for set_text_properties.

	* xfaces.c (set_lface_from_font_name): Fix previous change.
	(recompute_basic_faces): Change assert to abort.

1999-11-25  Dave Love  <fx@gnu.org>

	* fns.c (Fnthcdr, Fnreverse): Inline cdr.
	(Fmember, Fdelq, Fdelete): Inline car.
	(Fy_or_n_p): Doc fix.

1999-11-25  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (set_lface_from_font_name): New parameter may_fail_p.
	Callers changed.  If specified font name is bogus, and may_fail_p
	is not set, try to use a reasonable default.

	* dispnew.c (direct_output_for_insert): Set glyph row's
	displays_text_p flag.  Correct window's window_end_vpos if
	necessary.

1999-11-25  Paul Eggert  <eggert@twinsun.com>

	* emacs.c (fixup_locale): Don't bother to record initial locale.
	(synchronize_locale): If the desired locale is nil,
	treat it as if it were the empty string,
	so that we set the locale from the environment.

1999-11-25  Kenichi Handa  <handa@etl.go.jp>

	* fileio.c (Finsert_file_contents): Set buffer-file-coding-system
	of the current buffer via Fset.

1999-11-24  Dave Love  <fx@gnu.org>

	* xfns.c: Don't duplicate Qdisplay definition done elsewhere.

	* xfaces.c: Don't duplicate Qmode_line definition done elsewhere.

	* xfns.c: Don't duplicate Qdisplay definition done elsewhere.

1999-11-24  Gerd Moellmann  <gerd@gnu.org>

	* lisp.h (enum pvec_type): Put PVEC_FLAG in #if 0.

	* emacs.c (PVEC_FLAG): New variable.

1999-11-23  Gerd Moellmann  <gerd@gnu.org>

	* unexaix.c (unexec): Use unsigned instead of uintptr_t because
	that fails on IBM PowerPC, AIX 4.2.
	
1999-11-22  Eli Zaretskii  <eliz@is.elta.co.il>

	* buffer.c (syms_of_buffer): Add %z, %Z, %m and %& to the doc
	string of mode-line-format.  Remove the obsolete %t.

1999-11-22  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (direct_output_for_insert): Increment glyph positions
	for glyphs from buffer text only.

	* emacs.c (gdb_valbits, gdb_gctypebits, gdb_emacs_intbits)
	(gdb_data_seg_bits): New variables.
	
	* lisp.h (enum gdb_lisp_params): Put in #if 0, since it doesn't
	work on systems not allowing enumerators > INT_MAX, and it
	won't work if EMACS_INT is long long.

1999-11-22  Paul Eggert  <eggert@twinsun.com>

	Port to SunOS 4.1.x again.  Help out with Alpha port.
	Rename messages-locale to system-messages-locale,
	and likewise for time-locale.
	
	* callproc.c (strerror): Remove decl.
	* fileio.c (strerror): Likewise.
	* process.c (strerror): Likewise.
	* emacs.c (strerror): Likewise.
	(Vsystem_messages_locale): Renamed from Vmessages_locale.
	All uses changed.
	(Vprevious_system_messages_locale): Likewise, from
	Vprevious_messages_locale.
	(Vsystem_time_locale): Likewise, from Vtime_locale.
	(Vprevious_system_time_locale): Likewise, from Vprevious_time_locale.
	(ABORT_RETURN_TYPE): New macro.
	(abort): Return type is now ABORT_RETURN_TYPE.
	(main): Always invoke init_signals, even if POSIX_SIGNALS is not
	defined.
	(syms_of_emacs): messages-locale -> system-messages-locale,
	previous-messages-locale -> previous-system-messages-locale,
	time-locale -> system-time-locale,
	previous-time-locale -> previous-system-time-locale.

	* gmalloc.c (PP, __ptr_t): Assume ANSI C if STDC_HEADERS is defined.
	(const): Do not define; that's config.h's job.
	(<limits.h>): Include if HAVE_LIMITS_H is defined.
	(CHAR_BIT): Move test for definedness outside of limits.h condition.
	(<stddef.h>): Include if STDC_HEADERS is defined.
	(FREE_RETURN_TYPE): New macro.
	(free): Return type is now FREE_RETURN_TYPE.

	* lisp.h (synchronize_system_time_locale): Renamed from
	synchronize_time_locale.  All uses changed.
	(synchronize_system_messages_locale): Likewise, from
	synchronize_messages_locale.

	* m/alpha.h (malloc, realloc, calloc): Remove decls;
	stdlib.h now does this.

	* process.c (sys_siglist): Remove.

	* s/sunos4-0.h (ABORT_RETURN_TYPE, FREE_RETURN_TYPE):
	New macros.

	* syntax.c (scan_sexps_forward): Use abort, not assert.

	* sysdep.c (my_sys_siglist): New var.
	(sys_siglist): New macro.  Remove old initialized vars of same name.
	(init_signals): Initialize sys_siglist.

	* xfns.c (abort): Remove decl; stdlib.h now does this.

1999-11-18  Dave Love  <fx@gnu.org>

	* filelock.c: Add forward declaration for get_boot_time_1.

	* dispnew.c (Finternal_show_cursor_p): Fix doc string.

1999-11-18  Gerd Moellmann  <gerd@gnu.org>

	* buffer.h (struct buffer_text): Add comment about moving
	buffer text if REL_ALLOC is defined.

1999-11-18  Kenichi Handa  <handa@etl.go.jp>

	* lisp.h (KEY_DESCRIPTION_SIZE): New macro.

	* keyboard.c (echo_char): Use KEY_DESCRIPTION_SIZE to check free
	memory for push_key_description.

	* keymap.c (Fsingle_key_description): Use KEY_DESCRIPTION_SIZE to
	allocate memory for push_key_description.
	(describe_buffer_bindings): Likewise.

1999-11-17  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (Fx_show_busy_cursor): Doc-fix.
	(Fx_hide_busy_cursor): Ditto.

1999-11-17  Marco Walther <walther@siemens-pyramid.com>

	* unexsni.c (unexec): Handle .rel.dyn section.

1999-11-16  Dave Love  <fx@gnu.org>

	* doc.c (Fdocumentation): Remove gcpro here too.

1999-11-16  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (command_loop_1): Remove no_redisplay.

1999-11-16  Richard M. Stallman  <rms@gnu.org>

	* print.c (PRINTPREPARE): Don't call setup_echo_area_for_printing
	in noninteractive.

1999-11-14  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (ensure_echo_area_buffers): New.
	(with_echo_area_buffer): Use it.
	(setup_echo_area_for_printing): Ditto.

	* buffer.c (indicate-empty-lines): Doc-fix.

1999-11-12  Gerd Moellmann  <gerd@gnu.org>

	* term.c (term_init): If "op" isn't available, don't support color
	because we can't switch back to the default foreground and
	background.

	* doc.c (Fdocumentation_property): Remove GCPRO because
	Fsubstitute_command_keys gcpro's the string.

1999-11-12  Kenichi Handa  <handa@etl.go.jp>

	* editfns.c (Ftranslate_region): Check the buffer multibyteness.

1999-11-11  Gerd Moellmann  <gerd@gnu.org>

	* print.c, keymap.c, indent.c, insdel.c, keyboard.c, intervals.c,
	lread.c, textprop.c, undo.c, emacs.c, lisp.h, intervals.h,
	buffer.h, config.in, Makefile.in: Remove USE_TEXT_PROPERTIES.

1999-11-10  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (QCuser_data): Removed.
	(syms_of_xfns): Initialization of QCuser_data removed.
	(parse_image_spec): Don't handle :user-data specially.  Allow
	unknown keys.  Remove parameter ALLOW_OTHER_KEYS.
	(xbm_image_p, xbm_load, xpm_image_p, pbm_image_p, png_image_p)
	(tiff_image_p, jpeg_image_p, gif_image_p, gs_image_p): Call
	parse_image_spec accordingly.

1999-11-09  Richard M. Stallman  <rms@gnu.org>

	* cmds.c (Fbeginning_of_line): Doc fix.
	(Fend_of_line): Doc fix.

	* editfns.c (Fline_beginning_position): If N is not 1,
	pass t to Fconstrain_to_field for ESCAPE-FROM-EDGE.

	* syntax.c (Fforward_word): Handle fields even if would have hit
	an edge of the buffer.  Return nil if affected by fields.

1999-11-09  Richard M. Stallman  <rms@gnu.org>

	* editfns.c (preceding_pos): Function deleted.
	(text_property_stickiness): Decrement POS directly.
	Fix a confusion that used PT instead of POS.

	* editfns.c (find_field): Properly handle the case
	of a field boundary where `field' inherits from neither side.

	* editfns.c (Ffield_beginning, Ffield_end): Doc fixes.
	(Ferase_field, Ffield_string, Ffield_string_no_properties): Doc fixes.

1999-11-08  Gerd Moellmann  <gerd@gnu.org>

	* bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
	BEFORE_POTENTIAL_GC before DISCARD.

1999-11-07  Gerd Moellmann  <gerd@gnu.org>

	* alloc.c (Fgarbage_collect): Call unmark_byte_stack.

	* lisp.h: Add prototype for unmark_byte_stack.

	* bytecode.c (mark_byte_stack): Use XMARKBIT and XMARK.
	(unmark_byte_stack): Renamed from relocate_byte_pcs.  Use
	XUNMARK.

	* xdisp.c (resize_mini_window): Fix computation of needed
	mini-window height.

	* alloc.c, buffer.c, editfns.c, xdisp.c: Remove conditional
	compilation on USE_TEXT_PROPERTIES.

	* Fbyte_code: Use block statements in cases and declare v1 and v2
	locally there.  Rearrange case statements so that those most
	frequently executed come first.  Avoid goto's in frequently
	executed cases.

1999-11-05  Gerd Moellmann  <gerd@gnu.org>

	* bytecode.c (Fbyte_code): Use BEFORE_POTENTIAL_GC and
	AFTER_POTENTIAL_GC around internal_catch.

	* alloc.c (Fgarbage_collect): Call mark_byte_stack and
	relocate_byte_pcs.
	(init_alloc_once, init_alloc): Set byte_stack_list to null.

	* eval.c (struct catchtag): Add member byte_stack.
	(internal_catch, Fcondition_case, internal_condition_case)
	(internal_condition_case_1): Save value of byte_stack_list in
	catchtag.
	(unwind_to_catch): Restore byte_stack_list from catchtag.

	* lisp.h: Add prototypes for new functions in bytecode.c.
	Add extern declaration for byte_stack_list.

	* bytecode.c (struct byte_stack): New.
	(byte_stack_list, mark_byte_stack, relocate_byte_pcs): New
	(BEFORE_POTENTIAL_GC, AFTER_POTENTIAL_GC): New.
	(FETCH, PUSH, POP, DISCARD, TOP, MAYBE_GC): Rewritten.
	(HANDLE_RELOCATION): Removed.
	(Fbyte_code): Use byte_stack structures.

	* filelock.c (Ffile_locked_p): Make FILENAME a required argument.

	* buffer.c (syms_of_buffer): Extend documentation of
	mode-line-format.

1999-11-04  Gerd Moellmann  <gerd@gnu.org>

	* editfns.c (Fdelete_field): Renamed from Ferase_field.

	* minibuf.c (do_completion, Fminibuffer_complete_word): Use
	Ferase_field instead of Fdelete_field.

1999-11-03  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (Finternal_show_cursor): Change it to set the
	cursor on/off, not toggle its state.
	(Finternal_show_cursor_p): New.
	(syms_of_display): Defsubr Sinternal_show_cursor_p.

1999-11-03  Dave Love  <fx@gnu.org>

	* charset.c (split_non_ascii_string): Define return value.

1999-11-03  Gerd Moellmann  <gerd@gnu.org>

	* minibuf.c (string_to_object): New.
	(read_minibuf_noninteractive): New.
	(read_minibuf): Call read_minibuf_noninteractive if
	noninteractive.  Use string_to_object.

	* doc.c (Fdocumentation_property): Fix bug bypassing UNGCPRO.

1999-11-02  Dave Love  <fx@gnu.org>

	* gnu-linux.h: Use SIGCHLD, not SIGCLD (not in glibc 2.1).

	* process.c: Define _GNU_SOURCE before config.h to get strsignal
	declared with glibc2.

1999-11-02  Gerd Moellmann  <gerd@gnu.org>

	* lisp.h (QUIT): Give it statement form.

1999-11-02  Dave Love  <fx@gnu.org>

	* eval.c (init_eval): Conditionalize declaration of gcpro_level.

1999-11-02  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (QCuser_data): New.
	(syms_of_xfns): Initialize QCuser_data.
	(parse_image_spec): Ignore :user-data DATA properties.

	* xdisp.c (display_line): Set charpos of first glyph in blank
	lines not corresponding to any text to -1, even if no glyphs are
	filled in in that line.

1999-11-01  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (png_load) [PNG_READ_sRGB_SUPPORTED]: Put code using 
	png_get_sRGB in #ifdef.

	* dispnew.c (Finternal_show_cursor): Renamed from Fshow_cursor.
	(syms_of_display): Use the new name.

	* textprop.c (verify_interval_modification): Signal text-read-only
	instead of calling error.

	* data.c (Qtext_read_only): New built-in error.
	(syms_of_data): Initialize it.

	* lisp.h: Add extern declaration for Qtext_read_only.

	* syntax.c: Remove whitespace after open or in front of closing
	parentheses.

1999-11-01  Richard M. Stallman  <rms@gnu.org>

	* Makefile.in (w16select.o, sound.o): Don't depend on lisp.h.

1999-10-31  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (resize_mini_window): Compute needed height differently.

	* fns.c (Flength): Unroll loop over lists.

	* xdisp.c (append_space): Return non-zero if space was appended.
	(display_line): Set charpos of first glyph to -1 only if that
	glyph is the space added by append_glyph.

1999-10-30  Richard M. Stallman  <rms@gnu.org>

	* print.c (strout): Consider `noninteractive' and use stdout
	only when PRINTCHARFUN is t.

	* lisp.h (struct gcpro) [DEBUG_GCPRO]: New field `level'.
	(gcpro_level): Declare it extern.
	[DEBUG_GCPRO] (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5):
	Alternate definitions that set `level' and increment `gcpro_level'.
	[DEBUG_GCPRO] (UNGCPRO): Alternate definition that checks gcpro_level.

	* eval.c [DEBUG_GCPRO] (gcpro_level): New variable.
	(init_eval) [DEBUG_GCPRO]: Initialize it.
	(unwind_to_catch) [DEBUG_GCPRO]: Set gcpro_level
	from remaining gcprolist.

1999-10-29  Kenichi Handa  <handa@etl.go.jp>

	* coding.c (code_convert_region): Update `dst' correctly.

1999-10-28  Gerd Moellmann  <gerd@gnu.org>

	* fns.c (Fmemq, Fassq, Frassq, assq_no_quit, Fassoc)
	(Frassoc): Rewritten.

1999-10-27  Noah Friedman  <friedman@splode.com>

	* s/gnu-linux.h [HAVE_DEV_PTMX]: Redefine FIRST_PTY_LETTER to 'z'.
	Define PTY_NAME_SPRINTF.
	Redefine PTY_TTY_NAME_SPRINTF.
	* config.in: Add undef for HAVE_DEV_PTMX.

1999-10-26  Richard M. Stallman  <rms@gnu.org>

	* regex.c (POP_FAILURE_POINT): Use failure_id.integer
	as arg to DEBUG_POP and DEBUG_PRINT.

1999-10-27  Richard M. Stallman  <rms@gnu.org>

	* data.c (Qad_activate_internal): Renamed from Qad_activate.
	(Ffset): Call Qad_activate_internal.
	(syms_of_data): Initialize Qad_activate_internal.

1999-10-27  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (echo_area_display) [HAVE_X_WINDOWS]: Do nothing if
	Vterminal_frame is selected and Vwindow_system is non-nil.

1999-10-26  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (echo_area_display): Put previous change in #if 0.

	* emacs.c (standard_args): Add `file' as synonym for `visit',
	`execute' as synonym for `eval'.
	(main): Add new options to usage message.

1999-10-25  Gerd Moellmann  <gerd@gnu.org>

	* data.c (Qhash_table): New.
	(Ftype_of): Return it for hash tables.
	(syms_of_data): Initialize Qhash_table.

1999-10-25  Richard M. Stallman  <rms@gnu.org>

	* regex.c (POP_FAILURE_POINT): Extract failure_id as an integer.

1999-10-24  Ken Raeburn  <raeburn@gnu.org>

	* alloc.c: Undef HIDE_LISP_IMPLEMENTATION before including
	lisp.h.

	* buffer.c (Fbuffer_list, Fget_file_buffer, get_truename_buffer,
	Fbuffer_local_variables, Fother_buffer, record_buffer,
	set_buffer_internal_1, Fbury_buffer, Fkill_all_local_variables,
	swap_out_buffer_local_variables, overlays_at, overlays_in,
	overlay_touches_p, overlay_strings, recenter_overlay_lists,
	fix_overlays_in_range, fix_overlays_before, Foverlay_get,
	Foverlay_put, report_overlay_modification, evaporate_overlays):
	Use XCAR, XCDR, and XFLOAT_DATA instead of explicit member
	references.
	* data.c (Fcar, Fcar_safe, Fcdr, Fcdr_safe, Fsetcar, Fsetcdr,
	swap_in_symval_forwarding, set_internal, default_value,
	Fset_default, Fmake_variable_buffer_local, Fmake_local_variable,
	Fmake_variable_frame_local, Flocal_variable_p,
	Flocal_variable_if_set_p, arithcompare, Fzerop, cons_to_long,
	Fnumber_to_string, float_arith_driver, Fadd1, Fsub1): Likewise.
	* dispnew.c (Fframe_or_buffer_changed_p): Likewise.
	* emacs.c (main): Likewise.
	* fontset.c (fs_load_font, fs_register_fontset,
	CACHED_FONTSET_NAME, CACHED_FONTSET_REGEX, Fquery_fontset,
	Fnew_fontset, Fset_fontset_font): Likewise.
	* frame.c (do_switch_frame, next_frame, prev_frame,
	other_visible_frames, Fdelete_frame, Fvisible_frame_list):
	Likewise.
	* keyboard.c (read_char, help_char_p, event_to_kboard,
	kbd_buffer_get_event, timer_start_idle, timer_check,
	make_lispy_event, apply_modifiers, reorder_modifiers,
	Fevent_convert_list, lucid_event_type_list_p, menu_bar_items,
	menu_bar_one_keymap, menu_item_eval_property_1, parse_menu_item,
	tool_bar_items, read_char_x_menu_prompt, read_key_sequence,
	Fcommand_execute, Fexecute_extended_command): Likewise.
	* minibuf.c (read_minibuf, get_minibuffer, Ftry_completion,
	Fall_completions): Likewise.
	* window.c (Fset_window_margins): Likewise.

	* callint.c (quotify_args): Don't explicitly use struct
	Lisp_Cons, use Lisp_Object and XCAR/XCDR instead.

	* s/netbsd.h (HAVE_GETLOADAVG): Define as 1.
	(UNEXEC, START_FILES, LIB_STANDARD, LIB_GCC): Define ELF versions,
	if __ELF__ is defined.

1999-10-24  Gerd Moellmann  <gerd@gnu.org>

	* window.c (Fnext_window): Add a QUIT in the loop.

1999-10-23  Gerd Moellmann  <gerd@gnu.org>

	* Makefile.in (bootstrap, bootstrap-emacs, bootstrap-temacs): 
	New targets.

1999-10-22  Dave Love  <fx@gnu.org>

	* emacs.c (main): Enable profiling conditional on __linux also.

1999-10-20  Gerd Moellmann  <gerd@gnu.org>

	* xrdb.c (x_load_resources): Set default resources for resource
	classes instead of for the specific Emacs.

1999-10-19  Gerd Moellmann  <gerd@gnu.org>

	* s/freebsd.h (HAVE_GETLOADAVG): Define as 1 because config.h
	defines it that way.
	
	* xdisp.c (echo_area_display) [HAVE_X_WINDOWS]: Do nothing
	if selected_frame is equal to Vterminal_frame.

1999-10-19  Paul Eggert  <eggert@twinsun.com>
	
	Add support for large files, 64-bit Solaris, system locale codings.
	
	* Makefile.in (emacs): Set the LC_ALL environment variable to "C"
	when dumping, so that the dumped Emacs doesn't have stray locale info.
	(dired.o): Depend on systime.h.
	(editfns.o): Depend on coding.h.

	* alloc.c, buffer.c, callproc.c, ccl.c, charset.c, coding.c, data.c,
	dispnew.c, editfns.c, emacs.c, filelock.c, floatfns.c, hftctl.c,
	keyboard.c, process.c, sysdep.c, unexelf.c, unexhp9k800.c,
	unexsunos4.c, vmsfns.c, vmsgmalloc.c, w32faces.c, w32menu.c, w32term.c,
	w32xfns.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
	Include <config.h> before any system include files.

	* alloc.c, buffer.c, ccl.c, data.c, editfns.c, emacs.c, eval.c,
	fileio.c, filelock.c, frame.c, insdel.c, keymap.c, lread.c,
	m/alpha.h, print.c, search.c, sysdep.c, xdisp.c, xfaces.c, xfns.c,
	xmenu.c, xterm.c:
	Do not include <stdlib.h>, as <config.h> does this now.

	* callproc.c (Fcall_process):
	Synchronize messages locale before invoking strerror.
	Decode resulting string with locale-coding-system.

	* coding.c (Vlocale_coding_system): New var.
	(syms_of_coding): Adjust to above change.
	(emacs_strerror): New function.

	* coding.h (emacs_strerror, Vlocale_coding_system): New decls.
	
	* config.in (HAVE_STDIO_EXT_H, HAVE_TM_GMTOFF, HAVE___FPENDING,
	HAVE_FTELLO, HAVE_GETLOADAVG, HAVE_MBLEN, HAVE_MBRLEN,
	HAVE_STRSIGNAL): New macros.
	(BITS_PER_LONG): Default to 64 if _LP64 is defined.
	<stdlib.h>: Include if HAVE_STDLIB_H is defined and NOT_C_CODE isn't.

	* dired.c: Include "systime.h".
	(Ffile_attributes): Do not cast s.st_size to int; this loses
	information if int is 32 bits but st_size and EMACS_INT are larger.
	Treat large device numbers like large inode numbers.

	* dispnew.c (PENDING_OUTPUT_COUNT): Use __fpending if available.

	* editfns.c: Include coding.h.
	(emacs_strftime): Remove decl.
	(emacs_strftimeu): New decl.
	(emacs_memftimeu): Renamed from emacs_memftime; new arg UT.
	Use emacs_strftimeu instead of emacs_strftime.
	(Fformat_time_string): Convert format string using
	Vlocale_coding_system, and convert result back.  Synchronize time
	locale before invoking lower level function.  Invoke
	emacs_memftimeu, passing ut, instead of emacs_memftime.
	
	* emacs.c: Include <locale.h> if HAVE_SETLOCALE is defined.
	(Vmessages_locale, Vprevious_messages_locale, Vtime_locale,
	Vprevious_time_locale): New variables.
	(main): Invoke setlocale early, so that initial error messages are
	localized properly.  But skip locale-setting if LC_ALL is "C".
	Fix up locale when it's safe to do so.
	(fixup_locale): Moved here from xterm.c.
	(synchronize_locale, synchronize_time_locale,
	synchronize_messages_locale): New functions.
	(syms_of_emacs): Accommodate above changes.

	* fileio.c (report_file_error): Convert strerror output according
	to Vlocale_coding_system.
	(Finsert_file_contents): Check for arithmetic overflow in
	computations that depend on file size.  Report IO errors
	with emacs_strerror, not strerror.

	* fns.c (Fgethash): Declare dflt parameter.

	* gmalloc.c: Do not define const to nothing if HAVE_CONFIG_H
	is defined; that's config.h's job.

	* lisp.h (EMACS_INT, BITS_PER_EMACS_INT, EMACS_UINT): If _LP64,
	default these values to long, BITS_PER_LONG, and unsigned long.
	(VALBITS, MARKBIT, XINT): Do not assume 32-bit EMACS_INT.
	(PNTR_COMPARISON_TYPE): Default to EMACS_UINT, not to unsigned int.
	(code_convert_string_norecord, fixup_locale,
	synchronize_messages_locale, synchronize_time_locale,
	emacs_open, emacs_close, emacs_read, emacs_write): New decls.
	All Emacs callers of open, close, read, write changed to use
	emacs_open, emacs_close, emacs_read, emacs_write.

	* lread.c (file_offset, file_tell): New macros.  All uses of ftell
	changed to file_tell.
	(saved_doc_string_position, prev_saved_doc_string_position): Now
	of type file_offset.
	(init_lread): Do not fix locale here; fixup_locale now does this.

	* m/amdahl.h, s/usg5-4.h:
	(NSIG): Remove.
	(NSIG_MINIMUM): New macro.

	* m/cydra5.h, m/dpx2.h, m/mips.h, m/pfa50.h, m/sps7.h, m/stride.h,
	m/ustation.h, s/gnu-linux.h, s/hpux.h, s/iris3-5.h, s/iris3-6.h,
	s/umips.h, s/usg5-4.h:
	(SIGIO): Do not undef.
	(BROKEN_SIGIO): New macro.

	* m/ustation.h:
	(SIGTSTP): Do not undef.
	(BROKEN_SIGTSTP): New macro.

	* s/gnu-linux.h:
	(SIGPOLL, SIGURG): Do not undef.
	(BROKEN_SIGPOLL, BROKEN_SIGURG): New macros.

	* s/ptx4.h:
	(SIGINFO): Do not undef.
	(BROKEN_SIGINFO): New macros.
	
	* m/delta.h, s/ptx.h, s/template.h: Doc fix.

	* mktime.c, strftime.c: Update to glibc 2.1.2 version, with
	some Emacs-related changes merged.

	* print.c (float_to_string): Prepend "-" to representation of a
	NaN if the NaN is negative.

	* process.c (sys_siglist): Omit if HAVE_STRSIGNAL.
	(wait_reading_process_input): Use emacs_strerror, not strerror.
	
	* process.c (status_message, sigchld_handler): Synchronize locale,
	then use strsignal istead of sys_siglist.
	* w32proc.c (sys_wait): Likewise.
	
	* s/aix3-1.h, s/bsd4-1.h, s/dgux.h, s/gnu-linux.h, s/hiuxmpp.h,
	s/hpux.h, s/iris3-5.h, s/iris3-6.h, s/irix3-3.h, s/osf1.h, s/rtu.h,
	s/sunos4-1.h, s/unipl5-0.h, s/unipl5-2.h, s/usg5-0.h, s/usg5-2-2.h,
	s/usg5-2.h, s/usg5-3.h, s/xenix.h:
	(open, close, read, write, INTERRUPTIBLE_OPEN,
	INTERRUPTIBLE_CLOSE, INTERRUPTIBLE_IO): Remove.

	* s/sol2-5.h (_LARGEFILE_SOURCE, _FILE_OFFSET_BITS): New macros.

	* sysdep.c (sys_read, sys_write, read, write, sys_close, close,
	sys_open, open): Remove.
	(emacs_open, emacs_close, emacs_read, emacs_write): Always define;
	the old INTERRUPTIBLE_OPEN, INTERRUPTIBLE_CLOSE, and INTERRUPTIBLE_IO
	macros are no longer used.
	(emacs_open): Renamed from sys_open.  Merge BSD4_1 version.
	(emacs_close): Renamed from sys_close.
	(emacs_read): Renamed from sys_read.
	(emacs_write): Renamed from sys_write.
	(sys_siglist): Do not declare if HAVE_STRSIGNAL.
	(dup2): Do not print error on failure; the real dup2 doesn't.
	(strsignal): New function, defined if !HAVE_STRSIGNAL.

	* syssignal.h (SIGINFO): Undef if defined and if BROKEN_SIGINFO
	is defined.
	(SIGIO, SIGPOLL, SIGTSTP, SIGURG): Likewise.
	(NSIG): If less than NSIG_MINIMUM, define to NSIG_MINIMUM.
	(strsignal): Declare if !HAVE_STRSIGNAL.

	* unexelf.c (ElfBitsW, ELFSIZE, ElfExpandBitsW): New macros.
	(ElfW): Define in terms of ElfExpandBitsW.

	* w32proc.c (sys_siglist): Remove decl.

	* xdisp.c (decode_mode_spec): 3rd arg is int, not char, to comply
	with ANSI C.
	(display_string): Declare face_string_pos arg.

	* xfns.c (Fx_show_tip): Declare timeout param.

	* xterm.c: No need to include locale.h.
	(x_alloc_lighter_color, x_setup_relief_color):
	Pass arg as double, not float, for compatibility with ANSI C.
	(fixup_locale): Move to emacs.c.
	(x_term_init): Do not setlocale or fixup locale; the main program
	does this now.

1999-10-18  Dave Love  <fx@gnu.org>

	* doc.c (Fdocumentation_property): Gcpro `tem'.

1999-10-18  Kenichi Handa  <handa@etl.go.jp>

	* lread.c (Fload): Calculate bytes of filename correctly.
	(openp): Likewise.

1999-10-18  Keisuke Nishida  <kxn30@po.cwru.edu>

	* print.c (print_preprocess): In case print-circle is nil,
	add OBJ to Vprint_number_table only when OBJ is a symbol.

1999-10-18  Kenichi Handa  <handa@etl.go.jp>

	* coding.c (code_convert_string): Add record_unwind_protect to
	assure setting inhibit_pre_post_conversion back to zero.  Take
	care of the multibyteness of the working buffer.

	* coding.c (inhibit_pre_post_conversion): New variable.
	(setup_coding_system): If inhibit_pre_post_conversion is nonzero,
	ignore post-read-conversion and pre-write-conversion property of
	the coding system.
	(code_convert_region_unwind): New function.
	(code_convert_region): Set inhibit_pre_post_conversion to 1 while
	running pre-write-conversion and post-read-conversion.
	(code_convert_string): Likewise.

1999-10-17  Miles Bader  <miles@gnu.org>

	* editfns.c: Doc fix.

1999-10-17  Miles Bader  <miles@gnu.org>

	* editfns.c (Fconstrain_to_field): Make sure we don't violate the
	argument preconditions of find_before_next_newline in the case
	where both ONLY_IN_LINE and ESCAPE_FROM_EDGE are set and OLD_POS
	was indeed at the edge.

1999-10-17  Miles Bader  <miles@gnu.org>

	* minibuf.c (Fminibuffer_complete_and_exit): Supply value for new
	ESCAPE_FROM_EDGE parameter to Ffield_beginning.

	* editfns.c (text_property_eq, text_property_stickiness): Don't
	use initializers for auto variables of type Lisp_Object.
	(find_field): Likewise.  Use braces around nested ifs.
	(Fline_end_position): Store the raw eol in a variable, so that the
	final expression doesn't look so ugly.
	(Fconstrain_to_field): Doc fix.
	(preceding_pos): Renamed from `preceeding_pos'.
	(text_property_stickiness, find_field): Call preceding_pos,
	not preceeding_pos.

1999-10-17  Miles Bader  <miles@gnu.org>

	* editfns.c (Ffield_string_no_properties): New function.
	(text_property_stickiness, preceeding_pos): New functions.
	(Ffield_string): Remove PROPS parameter.
	(find_field): Add MERGE_AT_BOUNDARY parameter.
	Rewrite to use stickiness of `field' property to resolve
	ambiguous cases.
	(Ffield_beginning, Ffield_end): Add ESCAPE_FROM_EDGE parameter.
	(Fconstrain_to_field): Likewise.
	(syms_of_editfns): Init Sfield_string_no_properties.
	(Ffield_string, Ferase_field, Ffield_end): 
	Supply new MERGE_AT_BOUNDARY argument to find_field.
	(Fline_beginning_position, Fline_end_position): Supply new
	ESCAPE_FROM_EDGE parameter to Fconstrain_to_field.
	Pass a value of Qt for the ONLY_IN_LINE argument to
	Fconstrain_to_field (only matters if N != 1).
	* syntax.c (Fforward_word): Supply new ESCAPE_FROM_EDGE parameter
	to Fconstrain_to_field.

	* minibuf.c (Fminibuffer_complete_word): Use
	Ffield_beginning to find the prompt end.

1999-10-17  Miles Bader  <miles@gnu.org>

	* editfns.c (Fconstrain_to_field): Add get/set-current-point
	behavior when NEW_POS is nil.
	(find_field): Use XSETFASTINT instead of make_number.
	* minibuf.c (Fminibuffer_complete_and_exit): Test for an empty
	input string by seeing where the field begins, instead of
	looking at text-properties.

1999-10-17  Miles Bader  <miles@gnu.org>

	* editfns.c (Qfield): New variable.
	(find_field, Ferase_field, Ffield_string,
	Ffield_beginning, Ffield_end, Fconstrain_to_field): New functions.
	(Fline_beginning_position, Fline_end_position): Constrain to any field.
	(make_buffer_string_both): Remove minibuffer-prompt hack.
	(syms_of_editfns): Initialize Qfield, and subr entries for
	field functions above.
	* minibuf.c (read_minibuf): Don't save minibuffer prompt length on
	minibuf_save_list.
	Don't initialize minibuffer prompt length.
	Wrap prompt text-properties around the entire prompt.
	Add 'prompt text-property to prompt.
	Get final value with Ffield_string instead of make_buffer_string.
	(read_minibuf_unwind): Don't restore minibuffer prompt length from
	minibuf_save_list.
	(do_completion): Get minibuffer input with Ffield_string
	instead of Fbuffer_string.
	Erase minibuffer input with Ferase_field instead of erase_buffer.
	(Fminibuffer_complete_and_exit): Likewise.
	Test whether buffer is empty by looking for the 'prompt text
	property at the end.
	Set prompt length by looking for the end of the prompt text property,
	and save prompt length for later use (since there is no longer a
	buffer variable to get it from).
	(Fminibuffer_prompt_width, Fminibuffer_prompt_end): Functions removed.
	(syms_of_minibuf): Remove initializations of
	Sminibuffer_prompt_width and Sminibuffer_prompt_end.
	* buffer.h (struct buffer): Remove prompt_end_charpos field.
	* buffer.c (Fget_buffer_create, Fmake_indirect_buffer, Fkill_buffer): 
	Don't initialize prompt_end_charpos field.
	* syntax.c (Fforward_word): Likewise.
	Constrain to any field.

1999-10-16  Gerd Moellmann  <gerd@gnu.org>

	* window.c (enum save_restore_action): New.
	(save_restore_orig_size): Change parameter list.  Add
	functionality to check for valid orig_top and orig_height members
	in a window tree.
	(grow_mini_window): Call save_restore_orig_size with new parameter
	list.
	(shrink_mini_window): Restore old window sizes only if old
	size information is valid in all windows in a window tree.
	
1999-10-15  Gerd Moellmann  <gerd@gnu.org>

	* xmenu.c (set_frame_menubar): Don't call
	x_set_menu_resources_from_menu_face here.
	(update_frame_menubar): Call x_set_menu_resources_from_menu_face.

	* xfns.c (gif_load): Fix handling of interlaced GIFs.

1999-10-14  Dave Love  <fx@gnu.org>

	* xdisp.c (handle_fontified_prop): GCPRO `pos'.

1999-10-14  Gerd Moellmann  <gerd@gnu.org>

	* process.c (Fopen_network_stream): Don't loop if gethostbyname
	fails and h_errno is TRY_AGAIN.

1999-10-13  Dave Love  <fx@gnu.org>

	* filelock.c (lock_file): Move gcpro of `fn'.

1999-10-10  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (auto-save-interval): Fix documentation.
	
1999-10-09  Richard M. Stallman  <rms@gnu.org>

	* print.c (print): When removing objects from Vprint_number_table,
	only scan the newly added objects.
	(print_preprocess): If OBJ is a gensym, and print-continuous-numbering,
	unconditionally force it to stay in the table.

1999-10-09  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (prepare_image_for_display): Don't try to load image if
	loading it failed before.
	(lookup_image, prepare_image_for_display): Remember if loading the
	image failed.
	(xpm_load): Add missing UNBLOCK_INPUT.

	* dispextern.h (struct image): New member load_failed_p.

1999-10-08  Stefan Monnier  <monnier@cs.yale.edu>

	* fileio.c (Fmake_temp_name): Add a reference to `make-temp-file'
	in the docstring.

1999-10-08  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (XTread_socket) <ClientMessage, WM_TAKE_FOCUS>:
	Don't call XSetInputFocus because that can generate additional
	FocusIn events.
	
1999-10-07  Jeffrey C Honig <jch@bsdi.com>

	* bsdos4.h [HAVE_LIBNCURSES]: Define TERMINFO and LIBS_TERMCAP.

1999-10-07  Richard M. Stallman  <rms@gnu.org>

	* process.c (wait_reading_process_input): When trying to suck
	input from one process, for accept-process-output,
	exit that loop if we get EAGAIN or EWOULDBLOCK.

1999-10-07  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (Qbitmap_spec_p): Replaces Qpixmap_spec_p.
	(Fbitmap_spec_p): Replaces Fpixmap_spec_p.
	(load_pixmap): Use Fbitmap_spec_p and Qbitmap_spec_p instead of
	Fpixmap_spec_p and Qpixmap_spec_p.
	(load_face_colors, check_lface_attrs,
	merge_face_vector_with_property,
	Finternal_set_lisp_face_attribute): Use Fbitmap_spec_p.
	(syms_of_xfaces): Initialize Qbitmap_spec_p, defsubr
	Fbitmap_spec_p.

1999-10-07  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (display_menu_bar): Use MENU_FACE_ID instead of
	MODE_LINE_FACE_ID.

	* xfaces.c (toplevel) [USE_MOTIF]: Include some Motif headers.
	(struct x_resources) [USE_X_TOOLKIT]: New.
	(xm_apply_resources, xm_set_menu_resources_from_menu_face)
	[USE_MOTIF]: New.
	(xl_apply_resources, xl_set_menu_resources_from_menu_face)
	[USE_LUCID]: New.
	(x_set_menu_resources_from_menu_face) [USE_X_TOOLKIT]: New.
	(Qmenu): New.
	(syms_of_xfaces): Initialize Qmenu.
	(realize_basic_faces): Realize face `menu'.
	(resolve_face_name): New.
	(lface_from_face_name): Use it.
	(Finternal_set_lisp_face_attribute): Ditto.
	(Fpixmap_spec_p): Rewritten.  Extend doc string.

	* xmenu.c (set_frame_menubar, xmenu_show): Call
	x_set_menu_resources_from_menu_face.

	* dispextern.h (enum face_id): Add MENU_FACE_ID.
	(toplevel): Include X11/Intrinsic.h.

1999-10-03  Ken'ichi Handa  <handa@gnu.org>

	* coding.c (DECODE_CHARACTER_ASCII): Decode ASCII invocated to GR
	correctly.

1999-09-30  Kenichi Handa  <handa@etl.go.jp>

	* category.c (modify_lower_category_set): Set default value of
	TABLE correctly.

	* minibuf.c (Fminibuffer_complete_word): Calculate string byte
	size correctly.

1999-09-29  Gerd Moellmann  <gerd@gnu.org>

	* editfns.c (Fpropertize): Renamed from Fproperties.

1999-09-29  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (resize_mini_window): Do nothing if frame is an X
	frame that hasn't been initialized yet.

1999-09-28  Richard M. Stallman  <rms@gnu.org>

	* keymap.c (Fsingle_key_description): Make tem big enough.
	(describe_buffer_bindings): Make buf big enough.

1999-09-27  Richard M. Stallman  <rms@gnu.org>

	* intervals.c (get_local_map): Use indirect_function,
	not Findirect_function.

1999-09-27  Dave Love  <fx@gnu.org>

	* cm.h: Remove unneeded declaration of ospeed.

1999-09-26  Gerd Moellmann  <gerd@gnu.org>

	* lisp.h (toplevel): Add prototype for
	next_single_char_property_change.

	* textprop.c (next_single_char_property_change): New.

	* xdisp.c (display_prop_end, invisible_text_between_p): Use
	next_single_char_property_change.

1999-09-25  Gerd Moellmann  <gerd@gnu.org>

	* editfns.c (Fproperties): New.
	(syms_of_editfns): Defsubr it.

	* xfns.c (lookup_image): Set image's timestamp because it's
	used when we look it up.

1999-09-23  Gerd Moellmann  <gerd@gnu.org>

	* window.c (enlarge_window): Add window parameter instead of using
	selected_window.
	(Fdisplay_buffer): Call it with window parameter instead of
	setting selected_window.
	(Fenlarge_window, Fshrink_window): Ditto.
	(shrink_mini_window): If there is no recorded height and position
	info, resize mini-window to height 1.

	* xfns.c (image_error): Use add_to_log.

	* xfaces.c (load_pixmap): Call add_to_log without frame parameter.
	(load_face_font_or_fontset, load_color,
	merge_face_vector_with_property): Ditto.

	* dispextern.h: Add prototype for add_to_log.

	* xfaces.c (add_to_log): Move to xdisp.c.

	* xdisp.c (add_to_log): Moved from xfaces.c.  Remove frame
	parameter.

1999-09-23  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (XTread_socket) <MotionNotify>: Change #ifdef
	USE_X_TOOLKIT to #ifdef USE_TOOLKIT_SCROLL_BARS.

	* xdisp.c (resize_mini_window): Use grow_mini_window and
	shrink_mini_window.

	* window.c (window_min_size): Add parameter ignore_fixed_p.
	(change_window_height): Call window_min_size with new parameter.
	(shrink_window_lowest_first, save_restore_orig_size,
	grow_mini_window, shrink_mini_window): New.
	(make_window, replace_window): Initialize orig_top and
	orig_height.
	(enlarge_window): Renamed from change_window_height.  Make it
	static.
	(Fdisplay_buffer, Fenlage_window, Fshrink_window): Call
	enlarge_window instead of change_window_height.

	* window.h (struct window): New members orig_top, orig_height.
	(toplevel): Add prototypes for grow_mini_window and
	shrink_mini_window.  Remove prototype for change_window_height.

1999-09-21  Eli Zaretskii  <eliz@gnu.org>

	* frame.c (frame_name_fnn_p): Fix previous change.

1999-09-20  Gerd Moellmann  <gerd@gnu.org>

	* minibuf.c (toplevel): Move include of stdio.h to other includes.

	* dispnew.c (direct_output_for_insert): Cast arguments to
	safe_bcopy to char *.

	* lread.c (readchar): Remove unused variables.
	(read_filtered_event, read1, Fmapatoms): Ditto.
	(toplevel): Include intervals.h.

	* eval.c (Fsignal): Remove unused variables.
	(Fcommandp, do_autoload): Ditto.

	* lisp.h: Add prototype for safe_bcopy, fatal.

	* editfns.c (init_editfns): Remove unused variables.
	(Fgoto_char, Fchar_after, Fformat): Ditto.
	(message_text, message_length): Put in #ifndef HAVE_MENUS.

	* data.c (find_symbol_value): Remove unused variables.
	(Faref, Fstring_to_number): Ditto.
	(toplevel): Include stdio.h.
	(Fnumber_to_string): Cast XINT to long for %ld.

	* casefiddle.c (casify_object): Remove unused variables.
	(casify_region): Ditto.

	* filelock.c (get_boot_time): Put local variable used in 
	conditinally compiled section in #ifdef.
	(toplevel): Include stdio.h.

	* keymap.c (Flookup_key, Faccessible_keymaps, describe_vector,
	keys_of_keymap, syms_of_keymap): Remove unused variables.

1999-09-20  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (sync_frame_with_window_matrix_rows): Disable frame rows
	whose corresponding window rows have been disabled in
	try_window_id.

1999-09-20  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (compute_window_start_on_continuation_line): Handle case
	that window start is out of range.
	(handle_display_prop, handle_single_display_prop): Replace
	marginal area specifications like `left-margin' with `(margin
	left-margin)'.
	(Qmargin): New.
	(syms_of_xdisp): Initialize Qmargin.

1999-09-19  Gerd Moellmann  <gerd@gnu.org>

	* syntax.c (update_syntax_table, find_defun_start, back_comment,
	describe_syntax, skip_chars): Remove unused variables.
	(back_comment, forw_comment): Add braces to if-statement with
	if-else as dependent statement.

	* process.c (list_processes_1): Remove unused variables.
	(Fopen_network_stream, create_process): Add parentheses to
	conditional expressions.
	(create_process): Put declaration of sigchld in #if 0.
	(Fopen_network_stream): Removed unused variables.
	(Fopen_network_stream, wait_reading_process_input,
	wait_reading_process_input, send_process, send_process): Ditto.
	(toplevel): Add prototypes for set_waiting_for_input and
	keyboard_bit_set.

	* abbrev.c (Fexpand_abbrev): Remove unused variables.

	* textprop.c (Fset_text_properties): Remove unused variables.
	(text_property_list, verify_interval_modification,
	interval_has_all_properties): Ditto.

	* callproc.c (toplevel) [HAVE_UNISTD_H]: Include unistd.h.
	(Fcall_process): Remove unused variable.

	* keyboard.c (Frecursive_edit): Remove unused variable.
	(command_loop_1, safe_run_hooks, kbd_buffer_get_event,
	timer_check, make_lispy_event, menu_bar_items,
	menu_bar_one_keymap, menu_bar_item, parse_menu_item,
	parse_tool_bar_item, read_char_x_menu_prompt, read_key_sequence,
	kbd_buffer_get_event, make_lispy_event, read_char_x_menu_prompt,
	read_key_sequence): Ditto.  Fread_key_sequence,
	Fread_key_sequence_vector, Fsuspend_emacs): Ditto.
	(read_key_sequence) [GOBBLE_FIRST_EVENT]: Put local variables only
	used when GOBBLE_FIRST_EVENT is defined in #ifdef
	(Fexecute_extended_command): Cast XINT to long for %ld.
	(toplevel) [HAVE_UNISTD_H]: Include unistd.h.
	(toplevel): Include sys/types.h.

	* lisp.h (RETURN_UNGCPRO): Use do-while (0) idiom.
	(toplevel): Add prototypes for stuff_char, and
	code_convert_string_norecord.

1999-09-19  Gerd Moellmann  <gerd@gnu.org>

	* buffer.h: Add prototype for r_re_alloc.

	* insdel.c (copy_text): Removed unused variables.
	(count_combining_after, count_combining_after, insert_1_both,
	insert_from_string_1, insert_from_buffer_1, check_markers): Ditto.
	(adjust_after_replace, replace_range): Add parentheses to logical
	expressions.  Remove unused variables.
	(CHECK_BYTE_COMBINING_FOR_INSERT): Add parentheses to logical
	expression.

	* alloc.c (Fgarbage_collect): Remove unused variable.
	(compact_strings): Add parentheses around assignments in
	conditional context.
	(toplevel): Put declaration of unused function clear_marks
	in #if 0 like its definition.

	* lisp.h: Add prototype for shrink_regexp_cache,
	sweep_weak_hash_tables.

1999-09-19  Dave Love  <fx@gnu.org>

	* process.c (Fopen_network_stream): Use strerror, not gai_strerror.

	* doc.c (read_bytecode_char): Declare arg.

	* lisp.h: Declare Fcurrent_message, Fmake_temp_name,
	read_bytecode_char, Fx_hide_busy_cursor, getloadavg.

1999-09-18  Richard Stallman  <rms@gnu.org>

	* xdisp.c (echo_area_display): Turn off code that returned
	without doing anything when using a terminal frame.

1999-09-17  Richard M. Stallman  <rms@gnu.org>

	* unexelf.c (unexec): Don't get confused by a short section
	just before the bss section.

1999-09-16  Gerd Moellmann  <gerd@gnu.org>

	* emacs.c (main): Remove unused variables.
	(sort_args, Fkill_emacs, Fkill_emacs): Ditto.

	* lisp.h: Add prototype for uninterrupt_malloc, memory_warnings,
	init_fileio_once, syms_of_sound, init_xfns, init_fns
	init_sound, check_message_stack.

	* emacs.c (toplevel) [HAVE_UNISTD_H]: Include unistd.h.

	* intervals.c (rotate_right, rotate_left): Add braces to avoid
	ambiguous else warning.
	(split_interval_left): Remove unused variables.
	(previous_interval, adjust_intervals_for_deletion,
	set_point_both, set_point_both, set_intervals_multibyte_1): Ditto.
	(icount, idepth, zero_length): Move into #if 0 section below
	original position where these are used.

	* buffer.h [REL_ALLOC]: Add prototypes for r_alloc and r_alloc_free.

	* buffer.c (Fkill_buffer): Remove unused variables.
	(Fkill_buffer, overlays_at, overlays_in, recenter_overlay_lists,
	fix_overlays_in_range, Fmove_overlay, Fprevious_overlay_change,
	init_buffer_once, (syms_of_buffer): Ditto.

	* xrdb.c (get_fallback): Remove unused variable.
	(x_load_resources): Ditto.  Put local variable used for Motif only
	in #ifdef USE_MOTIF.

1999-09-16  Gerd Moellmann  <gerd@gnu.org>

	* minibuf.c (read_minibuf): Remove unused variables.
	(read_minibuf, Fread_buffer, scmp, Fcompleting_read): Ditto.
	(do_completion): Move assignment out of conditional context.
	(Fdisplay_completion_list): Add parentheses to conditional expression.

	* cm.c (toplevel) [HAVE_TERMCAP_H]: Include termcap.h.

	* lisp.h: Add prototype for no_switch_window.

	* window.c (Fset_window_buffer): Remove unused variables.
	(Fset_window_margins): Ditto.

	* xdisp.c (resize_mini_window): Temporarily set the selected
	window's or Vminibuf_scroll_window's height to "fixed" around
	the call the change_window_height.

	* window.c (window_fixed_size_p): Check window's height_fixed_p
	flag.

	* window.h (struct window): New member height_fixed_p.

	* dispnew.c (direct_output_forward_char): Don't use this method
	if showing a message or a message was just cleared because we
	might need to resize the mini-window.

1999-09-16  Gerd Moellmann  <gerd@gnu.org>

	* frame.c (Fdelete_frame): Correct local variable pointing to
	selected frame after selecting new frame.

1999-09-15  Richard Stallman  <rms@gnu.org>

	* puresize.h (BASE_PURESIZE): Increase to 525000.

	* filelock.c (Vtemporary_file_directory): New variable.
	(syms_of_filelock): Set up Lisp variable.

1999-09-15  Gerd Moellmann  <gerd@gnu.org>

	* term.c (OUTPUT_IF, OUTPUT1_IF): Use do-while.
	(encode_terminal_code): Remove unused variables.
	(turn_off_face): Ditto.
	(toplevel): Include termcap.h if HAVE_TERMCAP_H.

	* dispnew.c (update_frame_line): If writing whole desired line,
	don't clear to end of line if already at the end.

1999-09-15  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (resize_mini_window): Don't report changed window
	height if it actually hasn't changed.

	* widget.c (set_frame_size, EmacsFrameSetCharSize):  Remove 
	unused variables.
	(mark_shell_size_user_specified): Put in #if 0 because not used.
	(create_frame_gcs): Put in #if 0 because currently unused.
	(first_frame_p): Ditto.

	* xmenu.c (single_menu_item, Fx_popup_menu, Fx_popup_menu,
	single_submenu, update_frame_menubar, set_frame_menubar,
	free_frame_menubar, xmenu_show, xdialog_show): Remove unused
	variables.

	* print.c (PRINTFULLP): Removed because it is no longer used and
	is misleading.
	(Ferror_message_string): Remove unused variables.
	(print_object): Cast argument of sprintf to long for `%ld'
	specifier.  Remove unused variable.

1999-09-14  Gerd Moellmann  <gerd@gnu.org>

	* sound.c (Fplay_sound): Remove usused variables.
	(be2hs): Put in #if 0 because it's currently not used.

1999-09-14  Ken Raeburn  <raeburn@gnu.org>

	* print.c (Ferror_message_string, print_error_message,
	print_object): Use XCAR, XCDR and XFLOAT_DATA instead of explicit
	member access.

1999-09-14  Gerd Moellmann  <gerd@gnu.org>

	* frame.h (CHECK_FRAME, CHECK_LIVE_FRAME): Put code in do-while.

	* frame.c (Fnext_frame): Remove unused variable(s).
	(Fprevious_frame, Fmouse_pixel_position, frame_name_fnn_p): Ditto.
	(store_frame_param): Add parentheses to conditional expression.
	(Fmodify_frame_parameters): Remove unused variables.
	(Fmodify_frame_parameters, Fset_frame_size, Fset_frame_position):
	Ditto.

	* xfns.c (x_set_background_color): Remove unused variable(s).
	(x_set_border_pixel): Ditto.
	(x_set_menu_bar_lines): Put local variable used only for
	non-toolkit case in #ifdef/#endif.
	(x_figure_window_size): Remove unused variable(s).
	(x_figure_window_size, x_window, lookup_image, 
	xbm_read_bitmap_file_data, x_build_heuristic_mask, pbm_load,
	png_load, jpeg_load, gif_load, x_create_tip_frame,
	x_create_tip_frame, Fx_show_tip, x_set_border_pixel): Ditto.

	* xterm.c (x_scroll_bar_handle_click): Compile only if
	not USE_TOOLKIT_SCROLL_BARS.
	(x_scroll_bar_set_handle, x_scroll_bar_note_movement): Ditto.

	* dispextern.h: Add prototypes for gamma_correct and
	x_kill_gs_process.

	* xterm.c (x_produce_glyphs): Remove unused variable(s).
	(x_alloc_nearest_color_for_widget, note_tool_bar_highlight,
	x_set_toolkit_scroll_bar_thumb): Ditto.
	(x_scroll_bar_create): Move local variable to the
	conditionally compiled section of code where it is used.
	(x_scroll_bar_create): Remove unused variable(s).
	(x_scroll_bar_remove, XTread_socket): Ditto.
	(XTread_socket) <ConfigureNotify>: Move variables used for
	non-toolkit case into conditionally compiled section of code.

	* window.h (freeze_window_starts): Fix typo in prototype.

	* xdisp.c (display_echo_area_1, try_window_id): Remove unused
	variable(s).

	* lisp.h: Add prototype for debug_print.

	* dispextern.h (xassert) [GLYPH_DEBUG]: Change definition
	to use do-while.

	* fns.c (SXHASH_COMBINE): Add missing parentheses.
	(Fchar_table_range, Fset_char_table_default, mapcar1,
	Fyes_or_no_p, sweep_weak_hash_tables): Remove unused variable(s).

	* lisp.h: Add prototype for getloadavg.

1999-09-14  Andreas Schwab  <schwab@gnu.org>

	* process.c (Fopen_network_stream): Avoid socket decriptor leak.

	* lisp.h: Declare close_file_unwind.

1999-09-14  Richard Stallman  <rms@gnu.org>

	* filelock.c (get_boot_time): Make the temp name in the proper dir.

1999-09-13  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (redisplay_window): Make sure start_at_line_beg
	is always set correctly.

1999-09-13  Dave Love  <fx@gnu.org>

	* xdisp.c (move_it_in_display_line_to): Make type consistent with
	declaration.

1999-09-13  Gerd Moellmann  <gerd@delysid.gnu.org>

	* xdisp.c (QCfile): Move here from xfns.c.
	(syms_of_xdisp): Initialize it.
	(message2_nolog): Change for Lisp_Object selected_frame.
	(message3_nolog, message_with_string, message,
	setup_echo_area_for_printing, truncate_echo_area,
	prepare_menu_bars, redisplay_internal, Fdump_tool_bar_row): Ditto.

1999-09-13  Dave Love  <fx@gnu.org>

	* xterm.c: Don't continue #define args for benefit of old cc.
	(xt_action_hook): Indent #error for benefit of K&R cc.

1999-09-13  Gerd Moellmann  <gerd@delysid.gnu.org>

	* xterm.c (XTcursor_to): Change for Lisp_Object selected_frame.
	(x_clear_frame, XTring_bell, XTmouse_position, XTread_socket): Ditto.
	(XRINGBELL): Removed.

1999-09-13  Dave Love  <fx@gnu.org>

	* xfns.c (x_put_x_image): Make type consistent with declaration.

	* fns.c (Fmake_hash_table): Fix string continuation.

1999-09-13  Gerd Moellmann  <gerd@delysid.gnu.org>

	* xfns.c (QCfile): Moved to xdisp.c.
	(syms_of_xfns): Don't initialize QCfile.
	(check_x_frame): Change for Lisp_Object selected_frame.
	(check_x_display_info, x_get_resource_string): Ditto.

1999-09-13  Gerd Moellmann  <gerd@gnu.org>

	* minibuf.c (choose_minibuf_frame): Don't try to set the
	mini-buffer window's buffer, if the buffer is invalid.

	* xfns.c (QCfile): Moved to xdisp.c.
	(syms_of_xfns): Don't initialize QCfile.

	* xdisp.c (QCfile): Move here from xfns.c.
	(syms_of_xdisp): Initialize it.

	* lisp.h (selected_frame): Add external declaration.

	* xselect.c (x_own_selection): Change for Lisp_Object selected_frame.
	(Fx_store_cut_buffer_internal): Ditto.
	(Fx_rotate_cut_buffers_internal): Ditto.

	* xfaces.c (frame_or_selected_frame): Change for Lisp_Object
	selected_frame.
	(Finternal_set_lisp_face_attribute): Ditto.
	(Finternal_get_lisp_face_attribute): Ditto.
	(Finternal_lisp_face_empty_p): Ditto.
	(Fdump_face): Ditto.

	* term.c (OUTPUT): Change for Lisp_Object selected_frame.
	(OUTPUT_IF, ring_bell, set_terminal_modes, reset_terminal_modes,
	set_terminal_window, set_scroll_region, reassert_line_highlight,
	change_line_highlight, cursor_to, raw_cursor_to, clear_to_end,
	clear_end_of_line, clear_end_of_line_raw, clear_end_of_line_raw,
	encode_terminal_code, write_glyphs, term_init): Ditto.

	* sysdep.c (reset_sys_modes): Change for Lisp_Object selected_frame.
	(kbd_input_ast, read_input_waiting): Ditto.

	* minibuf.c (choose_minibuf_frame): Change for Lisp_Object
	selected_frame.
	(read_minibuf): Ditto.

	* keyboard.c (command_loop_1): Change for Lisp_Object
	selected_frame.
	(cmd_error_internal, command_loop_1, read_char,
	kbd_buffer_get_event, read_avail_input,
	read_char_minibuf_menu_prompt, read_key_sequence, Fsuspend_emacs,
	interrupt_signal, quit_throw_to_read_char): Ditto.

	* fontset.c (Ffont_info): Change for Lisp_Object selected_frame.
	(Ffontset_info): DItto.

	* emacs.c (handle_USR1_signal): Change for Lisp_Object selected_frame.

	* dispnew.c (selected_frame): Make it a Lisp_Object.
	(adjust_frame_glyphs_initially): Change for Lisp_Object selected_frame.
	(direct_output_for_insert, direct_output_forward_char,
	init_display): Ditto.

	* data.c (swap_in_symval_forwarding): Change for Lisp_Object
	selected_frame.
	(set_internal): Ditto.

	* buffer.c (Fother_buffer): Change for Lisp_Object selected_frame.
	(record_buffer): Ditto.

	* frame.c (Fmake_terminal_frame): Use SELECTED_FRAME.
	(do_switch_frame): Change for Lisp_Object selected_frame.
	(Fselected_frame): Ditto.
	(Fframe_first_window): Use SELECTED_FRAME.
	(Fframe_root_window): Change for Lisp_Object selected_frame.
	(Fframe_selected_window, Fset_frame_selected_window, Fnext_frame,
	Fprevious_frame, other_visible_frames, Fdelete_frame,
	Fmouse_position, Fmouse_pixel_position, Fmake_frame_visible,
	Fmake_frame_invisible, Ficonify_frame, Fraise_frame, Flower_frame,
	Fframe_parameters, Fmodify_frame_parameters, Fframe_char_height,
	Fframe_char_width, Fframe_pixel_height, Fframe_pixel_width,
	Fset_frame_height, Fset_frame_width): Ditto.

1999-09-13  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (message2_nolog): Change for Lisp_Object selected_frame.
	(message3_nolog, message_with_string, message,
	setup_echo_area_for_printing, truncate_echo_area,
	prepare_menu_bars, redisplay_internal, Fdump_tool_bar_row): Ditto.

	* xmenu.c (Fx_popup_menu): Change for Lisp_Object selected_frame.
	(Fx_popup_dialog): Ditto.

	* xfns.c (check_x_frame): Change for Lisp_Object selected_frame.
	(check_x_display_info, x_get_resource_string): Ditto.

	* xterm.c (XTcursor_to): Change for Lisp_Object selected_frame.
	(x_clear_frame, XTring_bell, XTmouse_position, XTread_socket): Ditto.
	(XRINGBELL): Removed.

	* window.c (Fminibuffer_window): Change for Lisp_Object
	selected_frame.
	(Fwindow_at, Fprevious_window, window_loop, select_window_1,
	display_buffer_1, Fdisplay_buffer, temp_output_buffer_show,
	Fcurrent_window_configuration, init_window_once): Ditto.

	* frame.h (SELECTED_FRAME): New.

1999-09-12  Ken Raeburn  <raeburn@gnu.org>

	* category.c (word_boundary_p): Use XCAR and XCDR.
	* ccl.c (ccl_driver, resolve_symbol_ccl_program,
	Fregister_code_conversion_map): Likewise.
	* coding.c (setup_coding_system, detect_coding_system,
	Ffind_operation_coding_system, Fset_coding_priority_internal):
	Likewise.
	* doc.c (get_doc_string, Fdocumentation,
	store_function_docstring): Likewise.
	* editfns.c (save_restriction_restore): Likewise.
	* eval.c (Fcond, Fmacroexpand, Fcondition_case, wants_debugger,
	skip_debugger, find_handler_clause, Fautoload, Fapply,
	run_hook_with_args, run_hook_list_with_args, Ffetch_bytecode):
	Likewise.
	* fileio.c (Ffind_file_name_handler, Finsert_file_contents,
	Fwrite_region, do_auto_save_unwind, Fdo_auto_save,
	Fread_file_name): Likewise.
	* filelock.c (unlock_all_files): Likewise.
	* insdel.c (Fcombine_after_change_execute): Likewise.
	* intervals.c (adjust_intervals_for_insertion): Likewise.
	* keymap.c (get_keymap_1, Fkeymap_parent, Fset_keymap_parent,
	Fset_keymap_parent, fix_submap_inheritance, access_keymap,
	store_in_keymap, Fcopy_keymap, define_as_prefix,
	current_minor_maps, Faccessible_keymaps,
	accessible_keymaps_char_table, Fkey_description,
	Fwhere_is_internal, where_is_internal_2, where_is_internal_1,
	describe_buffer_bindings, describe_map_tree, shadow_lookup,
	describe_map): Likewise.
	* lread.c (Fload, load_unwind, close_load_descs, read_vector,
	read_list, init_lread): Likewise.
	* search.c (Fmatch_data): Likewise.
	* sunfns.c (Fsun_menu_internal): Likewise.
	* syntax.c (describe_syntax): Likewise.
	* undo.c (record_insert, record_delete, Fundo_boundary,
	truncate_undo_list): Likewise.
	* vmsproc.c (child_sig): Likewise.

	* editfns.c (Fformat): Use XFLOAT_DATA.

1999-09-12  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (command_loop_1): Resize mini-window to the
	exact size of a message displayed, if any.

	* xdisp.c (resize_mini_window): Add parameter exact_p.  Resize
	to exact size if exact_p is non-zero.
	(display_echo_area_1): Call resize_mini_window with
	new parameter.
	(redisplay_internal): Ditto.
	(resize_echo_area_axactly): New.

	* minibuf.c (read_minibuf_unwind): Call resize_mini_window with
	new parameter.

	* dispextern.h: Change prototype of resize_mini_window.
	Add prototype for resize_echo_area_axactly.

	* xfaces.c (Fx_family_fonts): Replaces Fx_font_list.
	(syms_of_xfaces): Defsubr accordingly.

	* xdisp.c (hscroll_window_tree): Choose cursor row from
	desired or current matrix.
	(redisplay_internal): Hscroll before updating.

1999-09-12  Gerd Moellmann  <gerd@gnu.org>

	* syntax.c (Fforward_word): Use prompt_end_charpos instead
	of minibuffer_prompt_length.

	* minibuf.c (read_minibuf): Use prompt_end_charpos instead
	of minibuffer_prompt_length.
	(read_minibuf_unwind): Ditto.
	(Fminibuffer_complete_and_exit): Ditto.
	(Fminibuffer_complete_word): Ditto.
	(Fminibuffer_prompt_end): Ditto.

	* editfns.c (Fbuffer_string): Use prompt_end_charpos instead
	of minibuffer_prompt_length.
	(Fline_beginning_position): Ditto.

	* buffer.c (Fget_buffer_create): Use prompt_end_charpos instead
	of minibuffer_prompt_length.
	(Fmake_indirect_buffer): Ditto.
	(Fkill_buffer): Ditto.
	(Ferase_buffer): Ditto.

	* buffer.h (prompt_end_charpos): Replaces
	minibuffer_prompt_length.

	* minibuf.c (read_minibuf): Return mini-buffer contents 
	without the prompt.

	* editfns.c (make_buffer_string_both): Take out the code
	to handle mini-buffer prompts.
	(Fbuffer_string): Handle the prompt here, instead.

	* xfaces.c (lface_from_face_name): Resolve face aliases.
	(Qmode_line): Replaces Qmodeline.
	(realize_basic_faces): Use Qmode_line.
	(syms_of_xfaces): Initialize Qmode_line.

1999-09-12  Gerd Moellmann  <gerd@gnu.org>

	* minibuf.c (read_minibuf): Set minibuf_prompt_width to the
	current column after inserting prompt.
	(Fminibuffer_prompt_width): Return minibuf_prompt_width.

	* xfaces.c (Qframe_update_face_colors): New.
	(syms_of_xfaces): Initialize call.
	(update_face_from_frame_parameter): Call that function when
	the frame's background changes.

1999-09-12  Richard Stallman  <rms@gnu.org>

	* insdel.c (del_range_1): Don't treat minibuffer prompt specially.

1999-09-12  Ken Raeburn  <raeburn@gnu.org>

	* alloc.c (Fcons, pure_cons, Fpurecopy, Fgarbage_collect,
	mark_object, mark_buffer): Use XCAR and XCDR.
	* bytecode.c (Fbyte_code): Likewise.
	* callint.c (Fcall_interactively, Fprefix_numeric_value):
	Likewise.
	* callproc.c (Fcall_process, Fcall_process_region, child_setup,
	getenv_internal): Likewise.
	* dired.c (file_name_completion): Likewise.
	* fns.c (Fsafe_length, concat, Fcopy_alist, Fmember, Fmemq, Fassq,
	assq_no_quit, Fassoc, Frassq, Frassoc, Fdelq, Fdelete, Freverse,
	Fplist_get, Fplist_put, internal_equal, mapcar1): Likewise.
	* indent.c (Fcompute_motion): Likewise.
	* process.c (decode_status, Fprocess_status, Fprocess_exit_status,
	list_processes_1, Fstart_process, Fopen_network_stream,
	wait_reading_process_input, read_process_output_call,
	kill_buffer_processes, sigchld_handler, exec_sentinel_unwind,
	status_notify, wait_reading_process_input): Likewise.
	* textprop.c (PLIST_ELT_P, property_value, set_properties,
	extend_property_ranges): Likewise.
	* w32faces.c (Fpixmap_spec_p, merge_face_list): Likewise.
	* w32fns.c (x_window_to_frame, x_set_frame_parameters,
	x_report_frame_params, x_set_cursor_type, x_icon_type,
	x_figure_window_size, Fx_create_frame, w32_load_system_font,
	w32_load_font, enum_font_cb2, w32_list_bdf_fonts, w32_list_fonts,
	w32_list_synthesized_fonts, w32_find_ccl_program, Fx_list_fonts,
	Fw32_find_bdf_fonts, w32_find_bdf_fonts_in_dir,
	x_display_info_for_name, Fx_display_list): Likewise.
	* w32menu.c (menubar_id_to_frame, single_keymap_panes,
	Fx_popup_menu, Fx_popup_dialog): Likewise.
	* w32proc.c (Fw32_set_keyboard_layout): Likewise.
	* w32term.c (x_window_to_scroll_bar, w32_read_socket,
	w32_term_init, x_delete_display): Likewise.
	* xfns.c (x_window_to_frame, x_any_window_to_frame,
	x_non_menubar_window_to_frame, x_menubar_window_to_frame,
	x_top_window_to_frame, x_set_frame_parameters,
	x_report_frame_params, x_set_cursor_type, x_icon_type,
	x_figure_window_size, Fx_create_frame, x_display_info_for_name,
	Fx_display_list, x_create_tip_frame): Likewise.
	* xmenu.c (menubar_id_to_frame, single_keymap_panes,
	Fx_popup_menu, Fx_popup_dialog): Likewise.
	* xselect.c (x_own_selection, x_get_local_selection,
	x_handle_selection_request, x_handle_selection_clear,
	x_clear_frame_selections, wait_for_property_change_unwind,
	wait_for_property_change, x_handle_property_notify,
	copy_multiple_data, x_get_foreign_selection,
	lisp_data_to_selection_data, clean_local_selection_data,
	x_handle_selection_notify, Fx_get_selection_internal,
	x_disown_buffer_selections): Likewise.
	* xterm.c (x_window_to_scroll_bar, XTread_socket, x_list_fonts,
	x_load_font, x_find_ccl_program, x_term_init, x_delete_display):
	Likewise.

	* alloc.c (make_float, make_pure_float, Fpurecopy): Use
	XFLOAT_DATA.
	* bytecode.c (Fbyte_code): Likewise.
	* floatfns.c (extract_float, Fexpt, Fabs, rounding_driver,
	fmod_float): Likewise.

1999-09-11  Richard Stallman  <rms@gnu.org>

	* xdisp.c (run_window_scroll_functions): If hook functions switch
	buffers, switch back after.

1999-09-11  Ken Raeburn  <raeburn@gnu.org>

	* charset.h (GET_TRANSLATION_TABLE): Use XCDR.
	* frame.h (FOR_EACH_FRAME): Use XCAR and XCDR.
	(PIXEL_X_FROM_CANON_X, PIXEL_Y_FROM_CANON_Y): Use XFLOAT_DATA.
	* keyboard.h (EVENT_HEAD, EVENT_START, EVENT_END, POSN_WINDOW,
	POSN_BUFFER_POSN, POSN_WINDOW_POSN, POSN_TIMESTAMP): Use XCAR and
	XCDR.
	* syntax.h (SYNTAX, SYNTAX_WITH_FLAGS, SYNTAX_MATCH): Use XCAR and
	XCDR.

1999-09-10  Richard Stallman  <rms@gnu.org>

	* xterm.c (XTread_socket): In XSetInputFocus, use RevertToParent,
	not RevertToPointerRoot.
	(XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]:
	Fix the code to clear around the scroll bar.

1999-09-10  Keisuke Nishida  <kxn30@po.cwru.edu>

	* print.c: Support print-circle and related features.
	(Vprint_gensym_alist): Removed.
	(Vprint_circle, Vprint_continuous_numbering, print_number_index
	Vprint_number_table): New variables.
	(PRINT_NUMBER_OBJECT, PRINT_NUMBER_STATUS): New macros.
	(PRINTPREPARE, PRINTFINISH): Don't set Vprint_gensym_alist.
	(print, print_preprocess, print_preprocess_string, print_object):
	New/modified functions with print-circle feature.  Use
	Vprint_number_table instead of Vprint_gensym_alist for print-gensym.
	(syms_of_print): Defined new Lisp variables `print-circle',
	`print-continuous-numbering', `print-number-table'.

1999-09-10  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_build_heuristic_mask): Accept a list `(R G B)'
	as background color specification instead of an integer.
	(image-cache-eviction-delay): Replaces image-eviction-seconds.
	(Vimage_cache_eviction_delay): Replaces Vimage_eviction_seconds.
	(clear_image_cache, syms_of_xfns): Use it.
	(Qpostscript): Replaces Qghostscript.
	(gs_type): Use it.
	(gs_image_p): Ditto.
	(syms_of_xfns): Initialize Qpostscript.

1999-09-10  Richard Stallman  <rms@gnu.org>

	* buffer.c (Ferase_buffer): Don't erase the minibuffer prompt.

1999-09-09  Richard Stallman  <rms@gnu.org>

	* editfns.c (Fline_beginning_position): Handle minibuffer prompt here.

	* cmds.c (Fbeginning_of_line): Don't handle minibuffer prompt here.

1999-09-09  Gerd Moellmann  <gerd@gnu.org>

	* fns.c (Fmakehash): Accept just one optional argument TEST.

	* xfns.c (QCindex): New.
	(syms_of_xfns): Initialize QCindex.
	(gif_load): Use it instead of `:image'.

1999-09-09  Richard Stallman  <rms@gnu.org>

	* fileio.c (Fwrite_region): Finish renaming CONFIRM to MUSTBENEW.
	(Fwrite_region) [DOS_NT]: Handle `excl' here too.

1999-09-08  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (Qwhen): Replaces QCwhen.
	(syms_of_xdisp): Initialized it instead of QCwhen.
	(handle_single_display_prop): Use it instead of QCwhen.

1999-09-08  Ken'ichi Handa  <handa@gnu.org>

	* charset.c (translate_char): Reset MSBs of arguments of
	MAKE_CHAR.
	(CHAR_COMPONENTS_VALID_P): Fix for ASCII.

1999-09-08  Lars Magne Ingebrigtsen  <larsi@gnus.org>

	* editfns.c (Fbufsize): Accept an extra BUFFER parameter.

	* fns.c (Fbase64_decode_region): Don't place point outside of the
	current accessible portion.

1999-09-07  Richard Stallman  <rms@gnu.org>

	* keymap.c (fix_submap_inheritance): Do nothing if the proper
	parent is an ancestor of SUBMAP; otherwise, add it as the
	ultimate ancestor.

1999-09-07  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (handle_single_display_prop): Change conditional
	display property to `:when FORM . VALUE'.

1999-09-07  Richard Stallman  <rms@gnu.org>

	* fileio.c (Fwrite_region): Doc fix.

1999-09-07  Stefan Monnier  <monnier@cs.yale.edu>

	* fileio.c (Qexcl): New variable.
	(report_file_error): Handle EEXIST specially.
	(Fwrite_region): Special handling for CONFIRM = `excl'.
	(syms_of_fileio): Initialize Qexcl.

1999-09-07  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_set_foreground_color): Call
	update_face_from_frame_parameter.
	(x_set_background_color): Ditto.
	(x_set_mouse_color): Ditto.
	(x_set_cursor_color): Ditto.
	(x_set_border_color): Ditto.
	(x_set_scroll_bar_foreground): Ditto.
	(x_set_scroll_bar_background): Ditto.

	* xfaces.c (recompute_basic_faces): Clear face cache.
	(Finternal_set_lisp_face_attribute): Modify frame parameters
	if attributes of certain faces are changed.
	(update_face_from_frame_parameter): New.

	* xfaces.c (realize_basic_faces): Realize new basic faces.

	* dispextern.h (SCROLL_BAR_FACE_ID, BORDER_FACE_ID,
	CURSOR_FACE_ID, MOUSE_FACE_ID): New.

	* xfaces.c (Qscroll_bar, Qcursor, Qborder, Qmouse): New.
	(syms_of_xfaces): Intialize new symbols.

	* fns.c (Fmakehash): Take one argument, test, make all the
	rest keyword arguments.

	* window.c (Fset_window_margins): Make window the first argument.
	(set_window_buffer): Call Fset_window_margins with window as first
	argument.

1999-09-07  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (Qfringe): Replaces Qmargin.

1999-09-07  Kenichi Handa  <handa@etl.go.jp>

	* charset.h: Lots of comments fixed.
	(PARSE_MULTIBYTE_SEQ): Make it work also for ASCII string.
	(STRING_CHAR_AND_CHAR_LENGTH): This macro removed.

	* charset.c : Lots of comments fixed.
	(SPLIT_MULTIBYTE_SEQ): Make it work also for ASCII string.
	(CHAR_COMPONENTS_VALID_P): Name changed from
	CHAR_COMPONENT_VALID_P.  Caller changed.

1999-09-06  Richard Stallman  <rms@gnu.org>

	* insdel.c (syms_of_insdel): Define Lisp variable
	inhibit-modification-hooks.

1999-09-06  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>

	* s/aix4-2.h (ALIGN_DATA_RELOC): Undefined to support new
	unexaix.c.

	* s/aix3-1.h (ALIGN_DATA_RELOC): Defined to support new unexaix.c.

1999-09-06  Dave Love  <fx@gnu.org>

	* unexaix.c: New version incorporating Michael Sperber's changes
	from XEmacs.  Should solve problems on AIX 4.3.

	* lread.c (Vbyte_boolean_vars): New variable.
	(defvar_bool, syms_of_lread): Use it.

1999-09-05  Richard Stallman  <rms@gnu.org>

	* minibuf.c (read_minibuf): Put all three properties on the
	same range, the whole prompt.

1999-09-05  Gerd Moellmann  <gerd@gnu.org>

	* sound.c (Qplay_sound_functions): Replaces Qplay_sound_hook.
	(Fplay_sound, syms_of_sound): Use it.
	(parse_sound): Allow float volume values in the range [0, 1].
	(Fplay_sound): Ditto.

	* window.c (Fset_window_vscroll): Make window the first argument,
	amount to scroll the second.  Take non-negative vscroll as
	argument.
	(Fwindow_vscroll): Return non-negative vscroll.

	* xfns.c (Fx_show_tip): Improve documentation.

1999-09-05  Gerd Moellmann  <gerd@gnu.org>

	* buffer.c, buffer.h, dispextern.h, dispnew.c, keyboard.c,
	window.c, xdisp.c, xfaces.c, xterm.c, keyboard.h: Change
	`top-line' and `top_line' to `header-line' and `header_line'.
	Likewise for similar spellings.

1999-09-05  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (row_containing_pos): New.
	(try_window_id): Use it.

	* alloc.c, dispextern.h, dispnew.c, frame.c, frame.h, keyboard.c,
	lisp.h, termhooks.h, window.c xdisp.c, xfaces.c, xfns.c, xterm.c:
	Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
	Likewise for upper-case etc.

1999-09-05  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]:
	Fix reference to renamed variable.

1999-09-04  Gerd Moellmann  <gerd@gnu.org>

	* window.c (Qwindow_size_fixed): Replaces Qfixed_window_size.
	(window_fixed_size_p): Use Qwindow_size_fixed instead of 
	Qfixed_window_size.
	(syms_of_window): Ditto.

	* fns.c (Fmakehash): Exchange optional test and size arguments.

1999-09-03  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (XTset_vertical_scroll_bar): Block input when clearing
	under newly created scroll bar.
	(expose_window): If window is not yet fully initialized, do
	nothing.  This can happen when toolkit scroll bars are used and a
	window is split.  Reconfiguring the scroll bars will generate an
	expose for a newly created window.

	* frame.h (struct frame): New member `gamma'.

	* xfns.c: Include math.h.  Add extern declaration for atof in case
	we don't see one.
	(Qscreen_gamma): New.
	(struct x_frame_parm_table): Add prototypes, add
	x_set_screen_gamma.
	(gamma_correct): New function.
	(defined_color): Call it.
	(x_set_screen_gamma): New.
	(x_set_title): Add parameter old_value.
	(RES_TYPE_FLOAT): New.
	(x_get_arg): Handle RES_TYPE_FLOAT.
	(Fx_create_frame): Call x_default_parameter for `screen-gamma'.
	(lookup_pixel_color): Change call to x_alloc_nearest_color to
	new prototype.
	(lookup_rgb_color): Ditto.
	(syms_of_xfns): Initialize Qscreen_gamma.

	* xterm.c (x_alloc_nearest_color_for_widget) [USE_X_TOOLKIT]:
	New.  Allocate color for lwlib widgets.
	(x_alloc_nearest_color): Change parameter list include the
	frame on which to allocate colors.  Gamma-correct colors.
	(x_alloc_lighter_color): Call x_alloc_lighter_color with new
	parameter list.

	* xterm.h: Change protorype of x_alloc_nearest_color.

1999-09-03  Richard Stallman  <rms@gnu.org>

	* callproc.c: Delete the system-independent include of stdlib.h
	(leaving only the one in the WINDOWSNT conditional).

1999-09-03  Andrew Choi  <choi@cs.hku.hk>

	* callproc.c (call-process) [macintosh]: Call mac_run_command in
	sysdep.c.  The Mac code is modeled after the DOS code.
	
	* dispextern.h [macintosh]: Include macterm.h to define substitute X
	Window types and macros.

	* frame.h: Do nothing if included a second time.
	(enum output_method): Add mac_output frame type.
	(union output_data): Add new alternative `mac'.
	(FRAME_MAC_P): New macro.
	
	* frame.c (Fframep) [macintosh]: Handle mac frame type.
	(syms_of_frame_1): Initialize Qmac.
	(make_terminal_frame) [macintosh]: Initialize output_data.mac fields.
	(Fmake_terminal_frame) [macintosh]: Add an alternate error check.
	(Fmodify_frame_parameters) [macintosh]: Call
	mac_set_frame_parameter in macterm.c.
	
	* keyboard.c [macintosh]: Set KBD_BUFFER_SIZE to a smaller value
	(512) because Mac compilers limit local data of a function to 32K.
	
	* make-docfiles.c: Correctly handle input files with Mac-style
	eol's.
	
	* sysdep.c: Define numerous routines to emulate Unix system calls.
	
	* xfaces.c: on MacOS, define the set of colors listed in rgb.txt
	file of an X Window environment.
	
	* xfaces.c: on MacOS, define the Lisp functions x-display-color-p,
	x-display-grayscale, x-color-defined-p, and x-color-values.
	
	* sysdep.c [macintosh] (stat, fstat, mkdir, rmdir, utime, access)
	(open, creat, unlink, read, write, rename, fopen, pause, alarm)
	(signal, sleep, gmtime, localtime, ctime, time, index, mktemp)
	(getpwuid, getpwnam, dup, dup2, isatty, getgid, getegid, getuid)
	(geteuid, getpid, getenv, uname, opendir, closedir, readdir, getwd.):
	New functions, replacing POSIX features.
	
	* sysdep.c [macintosh] (Mac2UnixPathname, Unix2MacPathname, CheckAlarm)
	(InitMyPasswd, GetTempDirName, mystrchr, mystrtok, mystrcpy):
	(InitEmacsPasswdDir, run_mac_command): New subroutines.

	* sysdep.c [macintosh] (targetTicks, alarm_signal_func, myPasswdName)
	(myPasswd, emacsPasswdDir, emacsPasswd, myPasswdInited, mask)
	(myPasswdDir, TempDirName, sys_siglist): New variables.

	* sysdep.c [macintosh] (execvp, wait, croak, fork, kill, sigsetmask)
	(sigblock, request_sigio, unrequest_sigio, setpgrp, pipe, symlink)
	(link, lstat, readlink, umask, chmod, sbrk, fsync, ioctl):
	Define empty stubs so Emacs will link.

1999-09-03  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c: Use XCAR and XCDR instead of XCONS.

	* window.h: New member frozen_window_start_p.

	* window.c (foreach_window, foreach_window_1): New.
	(freeze_window_start, freeze_window_starts): New.
	(make_window): Initialize frozen_window_start_p.
	(replace_window): Ditto.
	(Fset_window_point): Remove references to deleted variables.
	(Fset_window_start): Ditto.

	* xdisp.c (Vresize_mini_config, resize_mini_frame,
	resize_mini_initial_height): Removed.
	(syms_of_xdisp): Remove references to these variables.
	(resize_mini_window): Don't save window configuration, freeze
	window starts instead.  Enlarge window until displaying an empty
	buffer, then shrink it.  Make the function externally visible.
	(redisplay_window): Treat frozen window start like forced start,
	but accept point outside of the window.

	* dispextern.h: Add function prototype for resize_mini_window.

	* minibuf.c (read_minibuf_unwind): Resize mini-window when
	reaching minibuf_level 0.

	* lisp.h: Remove extern declarations for variables deleted from
	xdisp.c.

	* dispnew.c (adjust_frame_glyphs): Remove reference to
	Vresize_mini_config.

1999-09-03  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_set_scroll_bar_width): Change conditional compilation
	to USE_TOOLKIT_SCROLL_BARS.

	* xterm.c (x_scroll_bar_create): Don't clear under scroll bar
	here.
	(XTset_vertical_scroll_bar): Clarify position computations.  Clear
	under newly created scroll bar.  Put toolkit scroll bars in the
	middle of the area reserved for the scroll bar.

1999-09-03  Kenichi Handa  <handa@etl.go.jp>

	The following changes are for the new handling of mulitbyte
	sequence.  Now, except for a composite character, no multibyte
	character in string/buffer has trailing garbage bytes.  For
	instance, the length of string "\201\300\300" is now 2, the first
	character is Latin-1 A-grave, the second is raw \300.

	* charset.h (MAKE_NON_ASCII_CHAR): Handle the case that C1 or C2
	are negative.
	(MAKE_CHAR): Don't set MSBs of C1 and C2 to 0.
	(VALID_MULTIBYTE_CHAR_P): This macro deleted.
	(PARSE_COMPOSITE_SEQ): New macro.
	(PARSE_CHARACTER_SEQ): New macro.
	(PARSE_MULTIBYTE_SEQ): New macro. 
	(CHAR_PRINTABLE_P): New macro.
	(STRING_CHAR): Adjusted for the change of string_to_non_ascii_char.
	(STRING_CHAR_AND_LENGTH): Likewise.
	(STRING_CHAR_AND_CHAR_LENGTH): Define it as STRING_CHAR_AND_LENGTH.
	(INC_POS): Use the macro PARSE_MULTIBYTE_SEQ.
	(DEC_POS, BUF_INC_POS, BUF_DEC_POS): Likewise,

	* charset.c (SPLIT_COMPOSITE_SEQ): New macro.
	(SPLIT_CHARACTER_SEQ): New macro.
	(SPLIT_MULTIBYTE_SEQ): New macro.
	(CHAR_COMPONENT_VALID_P): New macro.
	(non_ascii_char_to_string): Generate a multibyte sequence as far
	as possible.
	(string_to_non_ascii_char): The 4th arg exclude_tail_garbage is
	deleted.  Caller changed.  Use the macro SPLIT_MULTIBYTE_SEQ.
	(split_non_ascii_string): Likewise.
	(multibyte_form_length): Use the macro PARSE_MULTIBYTE_SEQ.
	(char_printable_p): New function.
	(translate_char): Check character by NATNUMP instead of INTEGERP.
	(unibyte_char_to_multibyte): Call char_valid_p instead of
	VALID_MULTIBYTE_CHAR_P.
	(Fmake_char_internal): Check the arguments more rigidly.
	(Fcharset_after): Use the macro SPLIT_MULTIBYTE_SEQ.
	(char_valid_p): Check the validity by CHAR_COMPONENT_VALID_P.
	(Fmultibyte_char_to_unibyte): Check the validity of character by
	CHAR_VALID_P.
	(chars_in_text): Call multibyte_chars_in_text.
	(multibyte_chars_in_text): Use the macro PARSE_MULTIBYTE_SEQ.
	(Fcompose_string): Use the macro STRING_CHAR_AND_LENGTH instead of
	STRING_CHAR_AND_CHAR_LENGTH (which is obsolete now).

	* data.c (Faset): Adjust the way to check byte-combining
	possibility for the new handling of multibyte sequence.

	* editfns.c (Fsubst_char_in_region): Likewise.

	* fns.c (count_combining): Use the macro PARSE_MULTIBYTE_SEQ.
	(string_char_to_byte): Likewise.
	(string_byte_to_char): Likewise.

	* indent.c (MULTIBYTE_BYTES_WIDTH): Delete the 2nd arg C.  Use the
	macro STRING_CHAR_AND_LENGTH.  Caller changed.

	* insdel.c (count_combining_composition): New function.
	(count_combining_before): Adjust the way to check byte-combining
	possibility for the new handling of multibyte sequence.  Call
	count_combining_composition for a composite character.
	(count_combining_after): Likewise.

	* print.c (print_string): Use the macro STRING_CHAR_AND_LENGTH.
	(print): Likewise.

	* dispextern.h (struct it): Change the size of the member
	`ctl_chars'.

	* xdisp.c (get_next_display_element): Display incomplete multibyte
	sequence (e.g. \222\300) by octal form.

1999-09-02  Gerd Moellmann  <gerd@gnu.org>

	* xterm.h (VERTICAL_SCROLL_BAR_WIDTH_TRIM): Change from 2 to 0.

	* fns.c (Fhash_table_weakness): Replaces Fhash_table_weak.
	(cmpfn_eql, sxhash): Use XFLOAT_DATA.

1999-09-02  Gerd Moellmann  <gerd@gnu.org>

	* buffer.c (set_buffer_internal): Never set
	windows_or_buffers_changed.

	* xdisp.c (try_window_id): Reset first_unchanged_at_end_row
	if we have displayed to the bottom of the window.

	* syntax.c (Fforward_word): Stop at a mini-buffer prompt end
	in both directions.  Extend documentation.

1999-09-01  Gerd Moellmann  <gerd@gnu.org>

	* minibuf.c (read_minibuf): Flush display after setting cursor to
	column 0.

1999-08-31  Gerd Moellmann  <gerd@gnu.org>

	* s/freebsd.h (__FreeBSD_version): Don't define it if it is
	already defined.  This avoids a warning from buffer.c.

1999-08-30  Gerd Moellmann  <gerd@gnu.org>

	* xterm.h (FRAME_X_FLAGS_AREA_COLS): Define it as the total width
	of both margins.
	(FRAME_X_FLAGS_AREA_WIDTH): Likewise.
	(FRAME_X_LEFT_FLAGS_AREA_WIDTH): New.
	(FRAME_X_RIGHT_FLAGS_AREA_WIDTH): New.

	* frame.h (FRAME_WINDOW_WIDTH_ARG): Add in FRAME_FLAGS_AREA_COLS
	once instead of twice.
	(FRAME_LEFT_FLAGS_AREA_WIDTH): New.

	* xterm.c: Remove unused bitmaps.
	(continued_bits, continuation_bits, overlay_bits): Change images.
	(x_draw_vertical_border): Use FRAME_X_RIGHT_FLAGS_AREA_WIDTH
	instead of FRAME_X_FLAGS_AREA_WIDTH.
	(x_after_update_window_line): Ditto.
	(x_draw_bitmap): Likewise.
	(x_draw_row_bitmaps): Likewise.
	(x_draw_glyph_string_box): Likewise.
	(x_draw_glyphs): Likewise.
	(x_scroll_run): Likewise.
	(expose_window_tree): Likewise.
	(note_mode_line_highlight): Likewise.
	(XTset_vertical_scroll_bar): Likewise.
	(x_clip_to_row): Likewise.
	(x_set_window_size): Likewise.

	* xfns.c (x_figure_window_size): Use FRAME_FLAGS_AREA_COLS instead
	of 2 * that value.

	* xdisp.c (window_box_width): Use FRAME_FLAGS_AREA_COLS instead of
	2 * that value.
	(window_box_left): Use FRAME_LEFT_FLAGS_AREA_WIDTH instead of
	FRAME_FLAGS_AREA_WIDTH.

	* window.c (coordinates_in_window): Use
	FRAME_LEFT_FLAGS_AREA_WIDTH instead of FRAME_FLAGS_AREA_WIDTH.
	(window_internal_width): Subtract FRAME_FLAGS_AREA_WIDTH once
	instead of twice.

	* widget.c (set_frame_size): Set flags_area_extra to 
	FRAME_FLAGS_AREA_WIDTH instead of 2 * that width.
	(EmacsFrameSetCharSize): Ditto.

	* dispnew.c (mode_line_string): Add FRAME_LEFT_FLAGS_AREA_WIDTH
	instead of FRAME_FLAGS_AREA_WIDTH.

	* dispextern.h (WINDOW_DISPLAY_PIXEL_WIDTH): Subtract
	FRAME_FLAGS_AREA_COLS once.
	(WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X): Add
	FRAME_LEFT_FLAGS_AREA_WIDTH instead of FRAME_FLAGS_AREA_WIDTH.

1999-08-30  Gerd Moellmann  <gerd@gnu.org>

	* freebsd.h (C_SWITCH_SYSTEM): Added to let configure find headers
	in /usr/X11R6/include which are checked for with AC_CHECK_HEADER.

1999-08-30  Gerd Moellmann  <gerd@gnu.org>

	* fns.c (QCweakness): Replaces QCweak.
	(Fmake_hash_table): Ditto.
	(Fmakehash): Ditto.
	(syms_of_fns): Ditto.

1999-08-29  Richard Stallman  <rms@gnu.org>

	* search.c (compile_pattern_1): Enable RE_CHAR_CLASSES for regexp.

	* sysdep.c (read_input_waiting): Pass read_socket_hook just 4 args.

	* syntax.h (SYNTAX_COMMENT_NESTED, SYNTAX_FLAGS_COMMENT_NESTED):
	Add support for nested comments.

 	* syntax.c (Fforward_comment, scan_lists, scan_sexps_forward):
 	Consolidate the forward comment code into the new `forw_comment'.
 	(forw_comment): New subroutine.  Added support for nested comments.
 	(lisp_parse_state, back_comment, Fmodify_syntax_entry)
 	(Fparse_partial_sexp): Add support for nested comments.

1999-08-28  Ken Raeburn  <raeburn@gnu.org>

	* lisp.h (struct Lisp_Cons, XCAR, XCDR, struct Lisp_Float): Change
	names of structure elements if HIDE_LISP_IMPLEMENTATION is
	defined, to help detect code that uses knowledge of the Lisp
	internals that it shouldn't have.
	(XFLOAT_DATA): New macro.

1999-08-25  Gerd Moellmann  <gerd@gnu.org>

	* syntax.c (Fforward_word): If in a mini-buffer and moving
	backwards, stop in front of the prompt to prevent accidentially
	moving into the read-only prompt.

	* window.c (Frecenter): Clear frame if called with nil or no arg.

	* xdisp.c (resize_mini_window): Don't resize if
	Vmax_mini_window_height is nil.  Otherwise, use a default if
	Vmax_mini_window_height is not ot a number.
	(syms_of_xdisp): Extend documentation of Vmax_mini_window_height.

1999-08-25  Alexandre Oliva  <oliva@dcc.unicamp.br>

	* unexelf.c: Merge IRIX debugging info patch from unexsgi.c
	* m/iris4d.h: Use unexelf for IRIX 5.*.
	* m/iris5d.h: Use unexelf for IRIX 6.*.
	* unexsgi.c: Deleted.

	* unexelf.c: Auto-detect .sbss section.
	(round_up): Make it static.
	(unexec): Declare alignment as Elf Word.  Skip ``Program
	segment above .bss'' test on MIPS without .sbss.
	Copy sections .got and .sdata1 sections.  Adjust offsets in
	sections .sdata, .lit4, .lit8, .got and .sdata1.

1999-08-25  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (try_window_id): Remove typo.

1999-08-24  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (try_window_id): Recognize case that PT == ZV and in
	unchanged text at the bottom when computing the cursor position.
	(message3_nolog): Raise frame only if minibuffer_auto_raise is
	set.

	* lisp.h (PVEC_TYPE_MASK): Add the bit for hash tables.

1999-08-24  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (Qmargin): Replacement for Qbitmap_area.
	(realize_basic_faces): Replace Qmargin for Qbitmap_area.
	(syms_of_xfaces): Ditto.

	* window.c (Fset_window_point): Reset Vresize_mini_config.
	(Fset_window_start): Ditto.
	(set_window_buffer): Ditto.

	* dispnew.c (adjust_frame_glyphs): Reset Vresize_mini_config.

	* xdisp.c (redisplay_window): Don't ever test just_this_one_p
	before calling try_window.
	(echo_area_display): If height has changed, update other windows.
	(resize_mini_frame, resize_mini_initial_height): New.
	(resize_mini_window): Save/restore window configuration
	differently.

	* lisp.h (Vresize_mini_config, resize_mini_frame, 
	resize_mini_initial_height): Add extern declarations.

	* xterm.c (expose_window_tree): Fix typo CANON_Y_UNIT to
	CANON_X_UNIT.

	* xfns.c [HAVE_JPEG]: Work around a warning about HAVE_STDLIB_H
	being redefined in jconfig.h.

1999-08-23  Ken'ichi Handa  <handa@gnu.org>

	* coding.h: Include "ccl.h" instead of "../src/ccl.h".

1999-08-22  Gerd Moellmann  <gerd@gnu.org>

	* alloc.c (mark_glyph_matrix): Mark strings only.

	* xdisp.c (redisplay_internal): Clear garbaged frames after
	resizing mini-window.

1999-08-22  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (unwind_with_echo_area_buffer): Use
	set_buffer_internal_1 instead of set_buffer_internal.
	(with_echo_area_buffer): Ditto.

	* buffer.c (set_buffer_internal): Set windows_or_buffers_changed
	only if buffer is displayed somewhere.

	* buffer.h (BUF_COMPUTE_UNCHANGED): New.

	* insdel.c (gap_left): Use BUF_COMPUTE_UNCHANGED.
	(gap_right): Ditto.
	(modify_region): Ditto.

	* buffer.c (modify_overlay): Use BUF_COMPUTE_UNCHANGED.

	* xdisp.c (Vresize_mini_config): New.
	(resize_mini_window): Use it to save restore original window
	configuration
	(syms_of_xdisp): Initialize it.

	* buffer.h (struct buffer): Add prevent_redisplay_optimizations_p.

	* dispextern.h (struct glyph_matrix): Add buffer, begv, and zv.

	* xdisp.c (reconsider_clip_changes): New.
	(redisplay_internal, redisplay_window): Call it.
	(mark_window_display_accurate, redisplay_internal): Set current
	matrix' buffer, begv, zv.

	* window.c (Fset_window_hscroll): Set
	prevent_redisplay_optimizations_p instead of clip_changed.
	(Fset_window_hscroll): Ditto.
	(temp_output_buffer_show): Ditto.
	(Fset_window_vscroll): Ditto.

	* buffer.c (reset_buffer): Set clip_changed to 0 and
	prevent_redisplay_optimizations_p to 1.
	(Fget_buffer_create): Set prevent_redisplay_optimizations_p to 1.

	* buffer.h (BUF_UNCHANGED_MODIFIED, UNCHANGED_MODIFIED,
	BUF_OVERLAY_UNCHANGED_MODIFIED, OVERLAY_UNCHANGED_MODIFIED,
	BUF_BEG_UNCHANGED, BEG_UNCHANGED, BUF_END_UNCHANGED,
	END_UNCHANGED): New.
	(struct buffer_text):  Add beg_unchanged, end_unchanged,
	unchanged_modified, overlay_unchanged_modified.

	* window.h (beg_unchanged, end_unchanged, unchanged_modified,
	overlay_unchanged_modified): Removed.
	(with_echo_area_unwind_data): Don't save beg/end_unchanged.
	(unwind_with_echo_area_buffer): Don't restore them.
	(debug_beg_unchanged, debug_end_unchanged) [GLYPH_DEBUG]: Removed.
	(text_outside_line_unchanged_p, redisplay_internal,
	try_scrolling): Use/set buffer-specific beg/end_unchanged.
	(redisplay_window): Let try_window_id be called if more than one
	window is displayed.  Use/set buffer-specific beg/end_unchanged.
	(get_last_unchanged_at_beg_row, get_first_unchanged_at_end_row,
	try_window_id):
	Use buffer-specific beg/end_unchanged.

	* window.h (beg_unchanged, end_unchanged, unchanged_modified,
	overlay_unchanged_modified): Remove extern declarations.

	* keyboard.c (command_loop_1):  Set beg/end_unchanged per
	buffer.

	* insdel.c (gap_left): Compute beg/end_unchanged per buffer.
	(gap_right): Ditto.
	(adjust_after_replace): Likewise.
	(replace_range, del_range_2, modify_region): Likewise.

	* dispnew.c (direct_output_for_insert):  Set beg_unchanged
	and unchanged_modified per buffer.

	* coding.c (code_convert_region): Compute beg/end_unchanged per
	buffer.

	* buffer.c (modify_overlay): Compute beg/end_unchanged
	per buffer.
	(Fget_buffer_create): Initialize new members of the buffer 
	structure.

1999-08-22  Gerd Moellmann  <gerd@gnu.org>

	* lisp.h: Add prototype for copy_hash_table and Fcopy_hash_table.

	* fns.c (Qkey, Qvalue): Renamed from Qkey_weak, and Qvalue_weak.
	(Qkey_value_weak):  Removed.
	(make_hash_table): Use nil, `key', `value', t for weakness.
	(Fmake_hash_table): Ditto.
	(copy_hash_table): New.
	(Fcopy_hash_table): New.

1999-08-22  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c: Call change_frame_size and do_pending_window_change with
        new parameter.  

1999-08-21  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (resize_mini_window): Do it for truncate-lines t as
	well.
	(redisplay_internal): Resize mini-window only if text might 
	have changed.
	(display_echo_area): Reset displayed echo_area_buffer to nil
	at the end if we're displaying a nil message.

1999-08-21  Gerd Moellmann  <gerd@gnu.org>
	
	* fns.c (hash_lookup): Test with EQ before calling key comparion
	function.
	(hash_remove): Ditto.
	(cmpfn_eq): Removed.
	(cmpfn_eql): Don't test with EQ.
	(cmpfn_equal): Ditto.
	(make_hash_table): Set comparison function for `eq' to null.

	* buffer.c, cmds.c, editfns.c, indent.c, insdel.c, buffer.h:
	Remove conditional compilation on NO_PROMPT_IN_BUFFER.

	* dispextern.h (NO_PROMPT_IN_BUFFER): Removed.

	* window.c, widget.c, process.c, keyboard.c, frame.c, xdisp.c,
	xterm.c: Call change_frame_size and do_pending_window_change with
	new parameter.

	* dispnew.c (do_pending_window_change): Add parameter `safe'.
	(change_frame_size): Ditto.
	(change_frame_size_1): Ditto.  Deley size changes if redisplaying
	and not called from a safe place.
	(window_change_signal): Call change_frame_size with new parameter.

	* dispextern.h: Change prototypes for do_pending_window_change
	and change_frame_size.

	* xfaces.c (face_at_buffer_position): Don't xassert that
	window's buffers equals current_buffer; this is not the 
	case during echo area display.

1999-08-21  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c, minibuf.c: Remove conditional compilation on
	NO_PROMPT_IN_BUFFER.

	* minibuf.c (Fminibuffer_prompt_end): New.
	(syms_of_minibuf): Defsubr it.  Remove
	minibuffer-prompt-in-buffer.
	(Fminibuffer_prompt_width): Return 0 if not in mini-buffer.
	Extend documentation.

	* xdisp.c (get_next_display_element): Display \r as ^M.

	* xterm.c (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS]: Clear
	under scroll bar widget.

1999-08-21  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (minibuffer_scroll_overlap): Removed because not used
	anywhere.
	(unwind_redisplay): Return nil.
	(clear_garbaged_frames): New.
	(redisplay_internal): Use it.
	(echo_area_display): Ditto.
	(resize_mini_window): Mew.
	(display_echo_area_1): Use it to resize echo area window.
	(redisplay_internal): Use it to resize active mini-window.

	* dispextern.h, lisp.h: Add function prototypes.

	* dispnew.c (set_window_cursor_after_update): Do the 
	cursor_in_echo_area case only for a mini-window showing
	a message.  Don't let cursor end up after the end of a row.

	* xdisp.c (echo_area_glyphs, echo_area_message,
	echo_area_glyphs_length, previous_echo_glyphs,
	previous_echo_area_message, previous_echo_area_glyphs_length):
	Removed.
	(Vmessage_stack, echo_area_buffer, echo_buffer,
	display_last_displayed_message_p, Vwith_echo_area_save_vector): New.
	(message2_nolog): Use set_message and clear_message.
	(message3): Rename parameter len to nbytes to make clear what
	it is.
	(message3_nolog): Ditto.  Use set_message and clear_message.
	(update_echo_area): Rewritten.
	(with_echo_area_buffer): New.
	(with_echo_area_buffer_unwind_data, unwind_with_area_buffer): New.
	(setup_echo_area_for_printing): New.
	(display_echo_area, display_echo_area_1): New.

	(current_message, current_message_1): New.
	(push_message, restore_message, pop_message, 
	check_message_stack): New.
	(truncate_echo_area): Rewritten.
	(truncate_message_1): New.
	(set_message, set_message_1, clear_message): New.
	(echo_area_display): Rewritten.
	(redisplay_internal): Check for needed echo area update
	differently.
	(redisplay_preserve_echo_area): Rewritten.
	(redisplay_window): Check for mini-window displaying echo area 
	message differently.
	(syms_of_xdisp): Initialize Vmessage_stack and echo area buffers.
	Remove initialzation of removed variables.
	(init_xdisp): Remove references to removed variables.

	* dispnew.c (adjust_frame_message_buffer): Removed references
	to echo_area_glyphs and previous_echo_glyphs.
	(direct_output_for_insert): Check for mini-window displaying
	echo area message differently.
	(update_frame): Likewise.
	(set_window_cursor_after_update): Likewise.  In echo area,
	don't try to set cursor on rows that aren't enabled.

	* print.c: Remove conditional compilation on `standalone'.
	(glyph_len, str_to_glyph_cpy, str_to_glyph_ncpy,
	glyph_to_str_cpy):  Remove that section because GLYPHs are no 
	longer used in that way.
	(PRINTDECLARE): Add multibyte.
	(PRINTPREPARE, PRINTFINISH): Handle printcharfun t differently.
	(printbufidx): Removed.
	(printchar, strout): Rewritten.

	* keyboard.c (ok_to_echo_at_next_pause): Make it a pointer to
	a struct kboard.
	(echo_kboard): New.
	(echo_now): Set echo_kboard to the current kboard.
	(cancel_echoing): Set echo_kboard to null.
	(cmd_error_internal): Use clear_message, remove references
	to echo_area_glyphs and echo_area_message.
	(command_loop_1): Check for echo area messages differently.
	(read_char): Likewise.
	(record_menu_key): Use clear_message.
	(Fexecute_extended_command):  Check for echo area messages
	differently.  Use push_message, restore_message, pop_message.

	* alloc.c (Fgarbage_collect): Use push_message, restore_message,
	pop_message.

	* emacs.c (shut_down_emacs): Call check_message_stack.

	* lisp.h: Add function prototypes and extern declarations for
	new functions and variables.

	* fileio.c (Fdo_auto_save): Use push_message, restore_message,
	pop_message.

	* minibuf.c (read_minibuf): Use clear_message instead of 
	setting echo_area_glyphs.
	(Fminibuffer_completion_help): Ditto.

	* editfns.c (Fcurrent_message): Rewritten.

	* frame.c, window.h: Remove references to echo_area_glyphs
	and previous_echo_glyphs.

1999-08-21  Dave Love  <fx@gnu.org>

	* aix3-2-5.h (C_DEBUG_SWITCH): Use -g -O.
	* aix4-1.h: Likewise.

	* irix6-5.h (C_DEBUG_SWITCH): Set for debug and optimize.

1999-08-20  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c: Remove tiff34 prefix from include.

1999-08-20  Dave Love  <fx@gnu.org>

	* cm.c: Revert previous change.

1999-08-19  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (XTset_vertical_scroll_bar): Fix previous change.  Clear
	under scroll bar with width FRAME_SCROLL_BAR_COLS.

1999-08-18  Dave Love  <fx@gnu.org>

	* callproc.c, filelock.c, insdel.c, sysdep.c, xmenu.c: Use
	stdlib.h.

	* doprnt.c: Use stdlib.h, unistd.h.

	* config.in: Add HAVE_TERMCAP_H.

	* cm.c: Use termcap.h.

1999-08-18  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_window) [USE_X_TOOLKIT]: Remove test for
	FRAME_X_WINDOW (f) being null at the of the function.  If widgets
	cannot be created we will already have crashed earlier.  Call
	lw_set_main_areas with a null menu-bar widget, so that we have
	a reasonable default.
	(Fx_create_frame): Rearranged so that Lisp errors during frame
	initialization cause less damage.  Initialize menu bar widget
	here.

1999-08-18  Gerd Moellmann  <gerd@gnu.org>
	
	* dispnew.c (update_frame_line): Fix previous change.  If writing
	whole line clear to end of frame.

1999-08-17  Gerd Moellmann  <gerd@gnu.org>

	* window.c (Fcoordinates_in_window_p): Return `left-bitmap-area'
	and `right-bitmap-area' if position is in the bitmap areas.  This
	avoids an error when clicking on the bitmap areas.  Instead, they
	are currently treated like clicks inside the window.
	(coordinates_in_window): Return 5 and 6 for bitmap areas.
	(Qleft_bitmap_area, Qright_bitmap_area): New.
	(syms_of_window): Initialize new symbols.

	* dispnew.c (update_frame_line): If writing whole line,
	don't write trailing spaces unless we must.

	* xdisp.c (unwind_redisplay): New.  Resets flag redisplaying_p.
	(redisplay_internal): Register unwind_redisplay with
	register_unwind_protect.
	(try_window_reusing_current_matrix): If new start > old start,
	give up if start pos of first reusable row is not equal to new
	start.

	* eval.c (Fsignal): Don't reset redisplaying_p here.

	* xterm.c (expose_area): If row extends face to end of line,
	write the whole line.

1999-08-16  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (struct it): Remove member
	show_trailing_whitespace_p.

	* dispnew.c (direct_output_for_insert): Use
	Vshow_trailing_whitespace instead of former iterator member
	show_trailing_whitespace_p.
	(direct_output_forward_char): Don't do it if hightlighting
	trailing whitespace.

	* xdisp.c (Qshow_trailing_whitespace): Removed.
	(Vshow_trailing_whitespace): Added.
	(init_iterator): Remove initialization code for
	show_trailing_whitespace_p.
	(redisplay_internal): Don't try cursor movement in this_line
	if showing trailing whitespace.
	(redisplay_window): Likewise for cursor movement in current
	matrix and try_window_id.
	(try_window_reusing_current_matrix): Likewise.
	(trailing_whitespace_p): Return 0 if trailing whitespace is
	in front of point.
	(display_line): Use Vshow_trailing_whitespace instead of
	former iterator member show_trailing_whitespace_p.
	(syms_of_xdisp): Add DEFVAR_LISP for show-trailing-whitespace.

1999-08-16  Gerd Moellmann  <gerd@gnu.org>

	* window.c (Fpos_visible_in_window_p): Rewritten.

	* xfaces.c (add_to_log): Renamed from display_message.
	Don't display messages in echo area.

	* xterm.c (x_draw_glyph_string_box): Use the background width
	of the glyph string for the width of the box.

1999-08-16  Stefan Monnier  <monnier@cs.yale.edu>

	* syntax.c (Fforward_comment): Set comstyle for Scomment_fence.

1999-08-16  Geoff Voelker  <voelker@cs.washington.edu>

	* xfns.c, w32fns.c (x_set_frame_parameters): Set foreground and
	background first, and then set other parameters that might
	depend upon their new values.

1999-08-15  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (Vfont_list_limit): New.
	(syms_of_xfaces): Make it a user-variable.
	(DEFAULT_FONT_LIST_LIMIT): New.
	(sorted_font_list): If Vfont_list_limit is an integer > 0, list
	maximally that number of fonts, otherwise use
	DEFAULT_FONT_LIST_LIMIT.
	(Fx_font_family_list): Bind `font-list-limit' to higher values 
	until we have all fonts.
	(Fxfont_list): Additionally return the full names of fonts and
	their registry and encoding.

	* xterm.c (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: 
	Simplify clearing "under" scroll bar.

	* window.c (Qfixed_window_size): New.
	(syms_of_window): Initialiaze it.
	(check_all_windows): Add return type void.
	(window_fixed_size_p): New.  Return non-zero if window
	is fixed-size.
	(window_min_size_1): New.
	(window_min_size): Handle fixed-size windows.
	(size_window): New. Rewritten combination of set_window_height and
	set_window_width that handles fixed-size windows.
	(set_window_height): Call it.
	(set_window_width): Call it.
	(Fsplit_window): Give an error on attempt to split a fixed-size
	window.
	(change_window_height): Partly rewritten to handle fixed-size
	windows.

1999-08-13  Wolfgang Rupprecht  <wolfgang@wsrcc.com>

	* process.c (Fopen_network_stream): Fix previous change.

1999-08-13  Karl Heuer  <kwzh@gnu.org>

	* xdisp.c (line_number_display_limit_width): New var.
	(decode_mode_spec): Use it instead of hardcoded value.
	(syms_of_xdisp): Defvar it.

1999-08-13  Richard M. Stallman  <rms@gnu.org>

	* eval.c (run_hook_list_with_args): Gcpro `globals'.
	(run_hook_with_args): Likewise.

	* window.h (struct window): New field too_small_ok.

	* window.c (set_window_height, set_window_width): 
	If window starts out "too small", set its too_small_ok flag.
	If window's too_small_ok flag is set, don't delete it
	unless it is so small it would cause a crash.

1999-08-13  Gerd Moellmann  <gerd@gnu.org>

	* window.c (MINSIZE): Removed.
	(window_min_size): New.
	(set_window_height): Use window_min_size.
	(change_window_height): Ditto.

1999-08-12  Gerd Moellmann  <gerd@gnu.org>

	* indent.c (vmotion): Don't add in mini-buffer prompt width
	if prompts are inserted into mini-buffer.

1999-08-12  Wolfgang Rupprecht  <wolfgang@wsrcc.com>

	* config.in: Add HAVE_GETADDRINFO.
	* process.c (Fopen_network_stream): Use getaddrinfo.

1999-08-11  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (get_overlay_arrow_glyph_row): Set the charpos of
	glyphs to -1.

	* xdisp.c (face_before_or_after_it_pos): If position after
	or before iterator's current position in the buffer is out
	of bounds, return the iterator's original face id.

	* dispnew.c (mirror_make_current): If desired row isn't enabled,
	just swap glyphs pointers between current and desired row.
	(build_frame_matrix_from_leaf_window) [GLYPH_DEBUG]: Copy
	desired matrix method string to current matrix.

1999-08-11  Kenichi Handa  <handa@etl.go.jp>

	* lisp.h (CHAR_MODIFIER_MASK): New macro.

	* lread.c (read_escape): For Control modifier, pay attention to
	multibyte character.
	(read1): Likewise.  Singal error or a multibyte character which
	has a modifer bit.  Check validity of Shift modifer.

	* charset.c (non_ascii_char_to_string): Handle modifier bits as
	the same as Lisp reader.

1999-08-10  Richard M. Stallman  <rms@gnu.org>

	* charset.h (BCOPY_SHORT): Fix typo `unsigined'.

1999-08-10  Alexandre Oliva  <oliva@dcc.unicamp.br>

	* unexelf.c [__linux__ && __alpha__] (HAS_SBSS_SECTION): Define.

1999-08-10  Eli Zaretskii  <eliz@gnu.org>

	* msdos.c (IT_set_face): Abort if the default face is not realized
	and cached.
	(IT_write_glyphs): Reset the screen face to the default face
	before writing glyphs.

	* xfaces.c (realize_default_face) [MSDOS]: Don't take default
	colors from the frame here.
	(realize_tty_face) [MSDOS]: Do it here.  Update the face
	attributes with the actual name of the color taken from the
	frame.

	* dosfns.c (msdos_stdcolor_name): Remove const from return value.
	* dosfns.h (msdos_stdcolor_name): Ditto for the prototype.

	* frame.c (Fframe_parameters): Swap foreground and background
	colors returned in frame parameters if the frame has reverse in
	its parameter alist.
	(Fmake_terminal_frame): Make a unique copy of face_alist for
	each frame.

1999-08-07  Richard Stallman  <rms@gnu.org>

	* buffer.c (Fprevious_overlay_change): Just return
	the answer obtained from overlays_at.

	* xfns.c (xpm_load) [!XpmAllocCloseColors]:
	Use XpmCloseness and attrs.closeness instead.

1999-08-06  Richard Stallman  <rms@gnu.org>

	* lread.c (Feval_buffer): New arg DO_ALLOW_PRINT.

1999-08-06  Geoff Voelker  <voelker@cs.washington.edu>

	* dired.c (directory_files_internal, Fdirectory_files_and_attributes, 
	Ffile_attributes_lessp): New functions.
	(Fdirectory_files): Use directory_files_internal.
	(syms_of_dired): Initialize Fdirectory_files_and_attributes,
	Ffile_attributes_lessp.

	* w32.c (stat): Check for directory ending in separator when
	doing readdir fast path.

	* w32fns.c (x_set_icon_type): Support setting frame icons.
	* w32term.c (x_bitmap_icon): New function.
	(x_make_frame_visible, x_iconify_frame): Invoke x_bitmap_icon.
	
1999-08-06  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (set_iterator_to_next): After delivering a character
	from a display vector, restore face and charset to what they were
	before the display vector was processed.

1999-08-06  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (reseat_at_next_visible_line_start): New parameter
	on_newline_p.
	(set_iterator_to_next):  After delivering last char
	from display vector, reseat on next visible line start if 
	dpvec_char_len < 0.
	(next_element_from_buffer): Set dpvec_char_len to -1 for
	selective display.

1999-08-06  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (compute_line_metrics): If first line's physical ascent
	 is larger than its logical ascent, use the physical ascent, and
	 make the row taller.  Set row's overlapping_p flag.

	* dispnew.c (redraw_overlapping_rows): Use flag overlapping_p.
	(direct_output_for_insert): Ditto.

	* dispextern.h (struct glyph_row): Add overlapping_p.

	* xterm.c (x_draw_phys_cursor_glyph): Redraw overlaps.

	* dispextern.h (MATRIX_ROW_OVERLAPS_PRED_P): New.
	(MATRIX_ROW_OVERLAPS_SUCC_P): New.

	* dispnew.c (direct_output_for_insert): Don't use this method if
	row is overlapped by others.
	(update_text_area): Write full line if current line is overlapped.
	(redraw_overlapped_rows): New.
	(update_window): Call it.
	(redraw_overlapping_rows): New.
	(update_window): Call it.
	(scrolling_window): Make sure overlapped_p flag in current rows is
	unchanged.
	(row_equal_p): Take rows overlapped_p flag into account.

	* dispextern.h (struct glyph_row): Add flag overlapped_p.

	* xterm.c (x_fix_overlapping_area): New.
	(x_redisplay_interface): Add x_fix_overlapping_area.

	* dispnew.c (adjust_glyphs): Block input while adjusting matrices.

1999-08-06  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_draw_glyphs): Add parameter overlaps_p.
	(struct glyph_string): Add member for_overlaps_p.
	(x_get_glyph_string_clip_rect): If glyph string draws foreground
	of overlapping rows, clip to window bottom.
	(x_fill_glyph_string): Add parameter overlaps_p.
	(x_fill_composite_glyph_string): Ditto.
	(BUILD_GLYPH_STRINGS): Ditto.
	(BUILD_CHAR_GLYPH_STRINGS): Ditto.
	(x_draw_glyph_string): Don't draw anything but the foreground
	if glyph string draws row overlaps.

	* dispnew.c (direct_output_for_insert): Don't use this
	optimization for rows that overlap others.
	(update_window_line): Return non-zero if display has changed.
	(update_text_area): Ditto.
	(update_window): Record if display has been changed.

	* dispextern.h (MATRIX_ROW_OVERLAPPING_P): New.

	* dispextern.h (struct redisplay_interface): Add
	fix_overlapping_area.

	* xterm.c (x_append_glyph): Set glyph flag overlaps_vertically_p.

	* dispextern.h (struct glyph): Add overlaps_vertically_p.

	* xterm.c (x_produce_image_glyph): Compute iterator's physical
	ascent and descent.
	(x_produce_stretch_glyph): Ditto.
	(x_produce_glyphs): Ditto.

	* xdisp.c (init_iterator): Reset physical line height info
	after producing special glyphs.
	(display_toolbar_line): Set physical line height info.
	(compute_line_metrics): Ditto.
	(display_line): Ditto.
	(display_string): Ditto.

	* term.c (produce_glyphs): Set iterator's physical height
	information.

	* dispnew.c (blank_row): Compute glyph row's physical height.
	(row_equal_p): Take physical row heights into account.
	(direct_output_for_insert): Ditto.
	(update_text_area): Ditto.

	* dispextern.h (struct glyph_row): Add phys_ascent and
	phys_height.
	(struct it): Add phys_ascent, phys_descent, max_phys_ascent,
	max_phys_descent.

1999-08-04  Stefan Monnier  <monnier@cs.yale.edu>

	* buffer.c (switch_to_buffer_1): New subroutine, taken out from
	Fswitch_to_buffer.
	(no_switch_buffer): New function.
	(Fswitch_to_buffer): Call them.  Don't get confused
	by "same-window" buffers in a dedicated frame.

	* window.c (display-buffer): Don't get confused
	by "same-window" buffers in a dedicated frame.

1999-08-04  Andreas Schwab  <schwab@gnu.org>

	* insdel.c (insert_from_string_1): Check gap size against number
	of outgoing bytes, not incoming bytes.

1999-08-03  Tom Breton  <tob@world.std.com>

	* lread.c (read1): Added circular reading code to #N=.
	(SUBSTITUTE): New macro.
	(seen_list): New variable.
	(substitute_object_in_subtree): New function.
	(substitute_object_recurse): New function.
	(substitute_in_interval): New function.

1999-08-02  Eli Zaretskii  <eliz@gnu.org>

	* Makefile.in (frame.o, sysdep.o, xfaces.o): Depend on dosfns.h.

	* frame.c (make_terminal_frame): Don't call init_frame_faces if
	noninteractive, for termcap frames as well.

	* sysdep.c (init_sys_modes): Call init_frame_faces for termcap
	frames.

1999-08-01  Richard Stallman  <rms@gnu.org>

	* fns.c (internal_equal): Correct overlay comparison.

1999-07-31  Richard M. Stallman  <rms@gnu.org>

	* xfns.c (x_set_internal_border_width): 
	Call do_pending_window_change.  Don't block input, don't call XFlush.
	(x_set_vertical_scroll_bars): Call do_pending_window_change.
	(x_set_scroll_bar_width, x_set_font): Likewise.

	* frame.c (Fset_frame_height): Call do_pending_window_change.
	(Fset_frame_width, Fset_frame_size): Likewise.

	* xterm.c (x_set_window_size): When calling change_frame_size,
	specify 1 for DELAY.

	* widget.c (EmacsFrameSetCharSize): Don't call
	do_pending_window_change here.

1999-07-30  Dave Love  <fx@gnu.org>

	* config.in: Add HAVE_STDLIB_H.

1999-07-30  Richard M. Stallman  <rms@gnu.org>

	* process.c (create_process): Detect failure of `pipe'.

1999-07-30  Keisuke Nishida  <kei@psn.net>

	* alloc.c (allocate_vectorlike): Add missing increment.

	* data.c (Fdefalias): Call Ffset instead of duplicating code.

	* keymap.c (get_keymap_1, get_keyelt): Check the type of OBJECT
	before calling indirect_function.

1999-07-30  Eli Zaretskii  <eliz@gnu.org>

	* dispextern.h (load_color, lookup_derived_face): Declare
	prototypes.

	* dispnew.c (init_display) [MSDOS]: Don't initialize frame faces,
	it will be done later.

	* frame.c (make_terminal_frame) [MSDOS]: Don't call
	init_frame_faces if non-interactive.
	(Fframe_parameters) [MSDOS]: Replace indexing into colornames[]
	array with a call to msdos_stdcolor_name.  The font name is now
	"ms-dos", consistent with realize_tty_face.

	* keyboard.c (cmd_error_internal): Don't kill Emacs if this is an
	MSDOS frame.

	* window.c (Fset_window_configuration) [MSDOS]: Don't call
	x_set_toolbar_lines.

	* xfaces.c (load_color): Remove static from definition and remove
	prototype.
	[MSDOS]: Add a DOS-specific version of load_color.
	(lookup_face): Replace FRAME_TERMCAP_P with !FRAME_WINDOW_P.
	(lookup_derived_face): New function.
	(realize_default_face): Support MSDOS frames.
	[MSDOS]: If fore/background colors are unspecified, inherit them
	from the frame.
	(realize_face): Support MSDOS frames.
	(realize_tty_face): Support MSDOS frames.
	[MSDOS]: If the face color is not in Vface_tty_color_alist, call
	load_color to try to find a suitable approximation.  If the face
	is inverse-video, swap the foreground and background colors.

	* dosfns.c (msdos_stdcolor_name, msdos_stdcolor_idx): New
	functions.

	* dosfns.h (msdos_stdcolor_name, msdos_stdcolor_idx): Declare.

	* msdos.h: Remove redundant declarations (most of them are now in
	dispextern.h).

	* msdos.c (IT_set_face): Rewritten for the new redisplay engine.
	Use default frame colors if the face doesn't specify them; invert
	the colors if highlight is ON.
	(IT_write_glyphs): Rewritten for the new redisplay engine.
	(IT_change_line_highlight): Add (unused) parameter Y, since that's
	how the hook is called by term.c.
	(IT_copy_glyphs): New function, copies an area of the display in
	video RAM.
	(IT_insert_glyphs): Rewritten to DTRT instead of aborting, since
	redisplay now calls it even if char_ins_del_ok is zero.
	(IT_set_frame_parameters): Prototype changed.  Calls the new
	load_color.  Puts the new fore/background colors into the default
	face on current frame.
	(IT_menu_display): Rewritten to handle the new struct glyph
	instead of a char array.
	(XMenuActivate): Call lookup_derived_face to create and use
	special faces for the pop-up and drop-down menus.

1999-07-29  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_set_toolkit_scroll_bar_thumb): Don't call
	XawScrollbarSetThumb if thumb parameters haven't changed because
	that function apparently isn't optimized for this case.

1999-07-29  Eli Zaretskii  <eliz@gnu.org>

	* msdos.c (getdefdir): Don't return failure indication when
	_fixpath sets errno to ENOSYS.

1999-07-28  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (string_char_and_length): New.  Use it everywhere
	instead of STRING_CHAR_AND_LENGTH in xdisp.c.

1999-07-28  Kenichi Handa  <handa@etl.go.jp>

	* fns.c (count_combining): New function.
	(struct textprop_rec): New structure.
	(concat): Copy text properties correctly when byte combining
	occurs.

1999-07-28  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_setup_relief_color): Don't try smart color allocation
	if display is mono.
	(x_draw_row_bitmaps): If face has stipple, don't switch
	to foreground color for clearing areas, and set the fill style.

	* xfaces.c (load_face_colors): Load background color if setting
	stipple, too.
	(prepare_face_for_display): Use FillOpaqueStippled instead of 
	FillStippled.

1999-07-26  Ken'ichi Handa  <handa@gnu.org>

	* xterm.c (x_find_ccl_program): Add casting.

	* w32fns.c (w32_find_ccl_program): Add casting.

1999-07-27  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (struct glyph_row): Flag internal_border_p removed.

	* xfns.c (x_create_tip_frame): Don't set bitmapIcon resource
	because this will try to access a nonexisting widget.

1999-07-26  Markus Rost  <rost@gnu.org>

	* fns.c (Fgethash): Fix order of variables (patch by gerd). 
	(Fputhash): Ditto.
	(Fremhash): Ditto.

1999-07-26  Gerd Moellmann <gerd@gnu.org>
	
	* widget.c (EmacsFrameSetCharSize): Don't add XtNborderWidth
	value to frame width and height.

	* xterm.c (x_get_glyph_string_clip_rect): Take internal border
	into account for full-width windows.  Don't add scroll bar width
	to width of clip rect.
	(x_draw_glyph_string_box): Add 1 to right x of full width lines.
	(x_set_glyph_string_background_width): Add 1 to background width.
	(x_draw_glyphs): Take internal border into account for full-width
	lines.

1999-07-26  Richard M. Stallman  <rms@gnu.org>

	* xfns.c (x_set_mouse_color): Always unload the old color.
	Don't allow nil as color value.
	(x_set_cursor_color, x_set_background_color, x_set_foreground_color): 
	Always unload the old color.

	* indent.c (Fmove_to_column): Extend end of line only if FORCE is t.

1999-07-26  Karl Heuer  <kwzh@gnu.org>

	* fns.c (Fy_or_n_p): Doc fix.

1999-07-26  Kenichi Handa  <handa@etl.go.jp>

	* ccl.h (setup_ccl_program): The type is changed to `int'.

	* ccl.c (ccl_driver) <CCL_Call>: Now CCL program ID to call may be
	stored in the following CCL code.  Adjusted for the change of
	Vccl_program_table.
	(resolve_symbol_ccl_program): Adjusted for the new style of
	embedded symbols (SYMBOL . PROP) in CCL compiled code.   Return Qt
	is resolving failed.
	(ccl_get_compiled_code): New function.
	(setup_ccl_program): Function type changed from `void' to `int'.
	Resolve symbols in CCL_PROG.
	(Fccl_program_p): New function.
	(Fccl_execute): Get compiled CCL code by just calling
	setup_ccl_program.
	(Fccl_execute_on_string): Likewise.
	(Fregister_ccl_program): Adjusted for the change of
	Vccl_program_table.

	* coding.c (setup_coding_system): Get compiled CCL code by just
	calling setup_ccl_program.

	* xterm.c (x_find_ccl_program): Get compiled CCL code by just
	calling setup_ccl_program.

	* w32fns.c (w32_find_ccl_program): Get compiled CCL code by just
	calling setup_ccl_program.

1999-07-23  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (frame_update_line_height): Just use the height of the
	frame's fontset or font, instead of taking face fonts into
	account.

	* xdisp.c (get_next_display_element): Display DEL as `^?'.

1999-07-23  Richard M. Stallman  <rms@gnu.org>

	* window.c (Fsplit_window): For default size, round up for left window.

1999-07-21  Joe Ramey  <ramey@ti.com>

        * filelock.c (lock_if_free): Return -1 if check_lock_owner
	has returned -1 (lockfile exists but is not a symlink?).

1999-07-20  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_draw_bar_cursor): Use scratch_cursor_gc to
	because of a change in cursor_gc made in 20.4.

1999-07-19  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_calc_absolute_position): Subtract menu bar height
	for YNegative, if using X toolkit.

	* xfns.c (x_real_positions): Don't subtract window borders 
	from positions returned.

1999-07-17  Gerd Moellmann  <gerd@gnu.org>

	* xrdb.c (x_load_resources): Set double-click time defaults
	for Motif list boxes from double-click-time.

	* fns.c (Vhash_table_tests): Remvoed.
	(Qhash_table_test): New.
	(syms_of_fns): Initialize Qhash_table_test.
	(Fmake_hash_table): Look up user-defined tests in symbol prop
	`hash-table-test'.
	(Fdefine_hash_table_test): Store test and hash function as
	symbol prop `hash-table-test'.
	(make_hash_table): Add parameters user_test and user_hash.

	* window.c (set_window_buffer): Set window margins for tty
	frames, too.
	(Fset_window_margins): Ditto.

	* term.c (append_glyph): Use glyph area of iterator instead of
	always TEXT_AREA.

	* dispnew.c (update_frame_1): Add left margin width to cursor
	hpos.
	(direct_output_for_insert): Ditto.
	(direct_output_forward_char): Ditto.

	* dispnew.c (adjust_glyph_matrix): Set glyph matrix' top_line_p.

	* dispextern.h (struct glyph_matrix): Add top_line_p.

1999-07-16  Gerd Moellmann  <gerd@gnu.org>

	* frame.h (FRAME_WINDOW_REDISPLAY_P): Removed.  Use FRAME_WINDOW_P
	instead.

	* fns.c (cmpfn_eq): Add hash code parameters.
	(cmpfn_eql): Ditto.
	(cmpfn_equal): Ditto, and compare hash codes before calling Fequal.
	(cmpfn_user_defined): Likewise.

1999-07-15  Gerd Moellmann  <gerd@gnu.org>

	* lisp.h (DEFAULT_REHASH_THRESHOLD): Changed to 0.8.

	* fns.c (maybe_resize_hash_table): Correct computation of
	index vector size.
	(make_hash_table): Ditto.
	(Fmakehash): New.

	* xdisp.c (echo_area_display): Don't call redraw_garbaged_frames.

	* alloc.c (gc_sweep): Call sweep_weak_hash_tables.
	(survives_gc_p): Make it externally visible.
	(mark_object): Ditto.

	* fns.c (remove_hash_entry): Removed.
	(sweep_weak_hash_tables): New.

	* print.c (print): Print more information about hash tables.

	* xfns.c (image_spec_hash): Removed.
	(lookup_image): Use sxhash instead of image_spec_hash.
	(image_spec_equal_p): Removed.
	(lookup_image): Use Fequal instead of image_spec_equal_p.

1999-07-14  Gerd Moellmann  <gerd@gnu.org>

	* lisp.h (P_): Moved to top of file.

	* fns.c (make_hash_table): Set new members.

	* alloc.c (mark_object): Mark hash table's user_hash_function.
	Mark index vector for weak hash tables.

	* lisp.h (struct Lisp_Hash_Table): Add user_cmp_function,
	user_hash_function, cmpfn, and hashfn.

	* fns.c (build_hash): Removed.
	(hash_test): Removed.
	(cmpfn_eq, cmpfn_eql, cmpfn_equal, cmpfn_user_defined): New.
	(hashfn_eq, hashfn_eql, hashfn_equal, hashfn_user_defined): New.

1999-07-13  Gerd Moellmann  <gerd@gnu.org>

	* alloc.c (survives_gc_p): New.

	* print.c (print): Add hash table handling.

	* alloc.c (mark_object): Add code to mark hash tables.

	* lisp.h (GC_HASH_TABLE_P): New.

	* emacs.c (main): Call init_fns.

	* fns.c (init_fns): New.

	* fns.c: Add hash table implementation.

	* lisp.h (PVEC_HASH_TABLE): New.
	(struct Lisp_Hash_Table): New.
	(XHASH_TABLE): New.
	(XSET_HASH_TABLE): New.
	(HASH_TABLE_P): New.
	(CHECK_HASH_TABLE): New.
	(DEFAULT_HASH_SIZE): New.
	(DEFAULT_REHASH_THRESHOLD): New.
	(DEFAULT_REHASH_SIZE): New.

	* xterm.c (x_draw_glyphs): Add parameters real_start and real_end.
	(x_write_glyphs): Compute overwritten cursor using real start
	and end positions of display.
	(x_insert_glyphs): Ditto.

1999-07-10  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (read_char): Use message3_nolog to show help-echo.

	* dispnew.c (blank_row): Add y-position as parameter.  Compute
	visible height.

	* xdisp.c (next_element_from_string): Give padding spaces
	a position of -1.

	* dispnew.c (adjust_glyph_matrix): Some work to support 
	marginals areas on tty frames in a future version.
	(allocate_matrices_for_frame_redisplay): Ditto.

	* xdisp.c (display_line): At ZV, set glyph row's displays_text_p
	to zero if number of glyphs in the row is <= 1.

1999-07-09  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (buffer_posn_from_coords): Take left marginal area
	into account.

	* xdisp.c (handle_display_prop): Don't reset area if handing
	a property from a string that came from a `display' property.
	(handle_single_display_prop): Don't handle recursive `display'
	properties.
	(handle_single_display_prop): Handle some display property
	forms for terminal frames.
	(Qimage): Moved here from xfns.c.

	* dispextern.h (struct it): New field string_from_display_prop_p.

	* xterm.c (x_clip_to_row): Don't let clip_rect include top
	line.

1999-07-08  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (handle_single_display_prop): Handle `:when FORM'.

	* window.c (set_window_buffer): Set window's vscroll to zero.

	* xdisp.c (QCwhen): New.
	(display_prop_end): New.
	(handle_single_display_prop): Use it.
	(debug_method_add): Print buffer name if tracing.
	(try_window_reusing_current_matrix): Compute visible height
	of reused rows.  Fix cursor position calculation in case of
	top-line.

	* dispextern.h (struct redisplay_interface): Add parameter
	cursor_on_p to update_window_end_hook.

	* xterm.c (x_update_window_end): Add parameter cursor_on_p.

1999-07-07  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (redisplay_internal): Ensure that redisplayinp_p 
	doesn't become negative when decrementing it.

	* eval.c (Fsignal): Reset redisplaying_p to zero.

	* xdisp.c (try_window_reusing_current_matrix): Call hooks
	for window update.
	(try_window_id): Ditto.

	* xterm.c (x_clear_end_of_line): Handle top-line correctly.
	(x_scroll_run): Ditto.
	(any_help_event_p): New.
	(x_initialize): Set it to zero.
	(XTread_socket): Clear help echo only if any_help_event_p.

	* xdisp.c (init_iterator): Set top_line_p.
	(start_display): Use correct initial y if top-line is present.
	(make_cursor_line_fully_visible): Bug fixes for top-line.
	(try_scrolling): Ditto.
	(try_window_reusing_current_matrix): Ditto.

	* dispextern.h (struct it): Add top_line_p.

	* dispnew.c (shift_glyph_matrix): Move some computations out
	of the loop.

	* dispnew.c (margin_glyphs_to_reserve): Use NUMBERP and 
	XFLOATINT.

1999-07-06  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (update_frame_1): When setting cursor in echo area,
	skip only over padding spaces at the end.

	* xfaces.c (realize_tty_face): Set face's font_name field to
	"tty".

	* term.c (update_end): Turn cursor on only if selected window's
	cursor_off_p flag is not set.

1999-07-05  Gerd Moellmann  <gerd@gnu.org>

	* term.c (TS_cursor_visible): Renamed from TS_visual_mode.
	(TS_cursor_normal): Renamed from TS_end_visual_mode.
	(TS_cursor_invisible):  New.
	(term_init): Initialize TS_cursor_invisible.
	(tty_hide_cursor): New.
	(tty_show_cursor): New.
	(update_end): Show tty cursor.
	(update_begin): Hide tty cursor to prevent cursor flickering
	during redisplays triggered by timers (stealth fontification).

	* keyboard.c (make_lispy_event) <TOOLBAR_EVENT>: Apply modifiers.

	* xterm.c (XTread_socket) [USE_MOTIF] <KeyPress>: Catch events
	in scroll bars.
	(x_handle_toolbar_click): Set modifier bits.

1999-07-04  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (kbd_store_ptr): Declare it as a volatile pointer
	instead of a pointer to a volatile input_event.
	(kbd_buffer_store_event): Remove volatile modifier from 
	declaration of local variable `sp'.
	(Fdiscard_input): Don't cast when assigning kbd_store_ptr
	to kbd_fetch_ptr.

1999-07-03  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (try_window_id): Set beg_unchanged and end_unchanged
	only if buffer is modified.  Return quickly if changes are
	above window start.

1999-07-02  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (HSCROLL_WINDOWS): Removed.

	* xdisp.c (mark_window_display_accurate): Don't set
	w->region_showing.
	(redisplay_internal): Don't call redraw_garbaged_frames.

1999-07-01  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (echo_area_display): Don't display truncation marks
	for messages because 20.4 doesn't do it either.
	(redisplay_window): Case same window start.  Instead of giving
	up when cursor is partially visible, make it fully visible.
	(mark_window_display_accurate): Some cleanup.  Record window's
	last cursor information.
	(debug_method_add): Improved.
	(redisplay_internal): Record last cursor info only if not
	consider_all_windows_p.

	* dispnew.c (update_window): Update top line after scrolling.
	(blank_row): Renamed from make_empty_enabled_row.
	(increment_glyph_row_buffer_positions): Increment positions
	in buffers, only.

	* window.c (Fcoordinates_in_window_p): Add top-line to doc
	string.

1999-06-30  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (update_window): Check that updated row is visible.

	* xterm.c (x_draw_row_bitmaps): Check for invisible rows at
	top of window differently.

	* xdisp.c (try_window_reusing_current_matrix): Don't do it
	if region is showing.

	* dispnew.c (adjust_glyph_matrix): Check w->vscroll when
	avoiding matrix reallocation.  Set window_vscroll in matrix.

	* dispextern.h (struct glyph_matrix): Add member window_vscroll.

	* xdisp.c (debug_method_add): New.
	(debug_redisplay_method): Removed.
	(try_window_reusing_current_matrix): Handle case where old
	window start is the same as new window start.

	* dispextern.h (struct glyph_matrix) [GLYPH_DEBUG]: Make `method'
	an array instead of a pointer.

	* xfns.c (Fx_show_tip): Undo previous change.

	* xterm.c (x_append_glyph): Clear glyph->u.val.

	* dispextern.h (struct glyph): Increase size of face_id bit-field
	for CHAR_GLYPH to 12.

1999-06-29  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (x_charset_registry): Make it externally visible.

1999-06-28  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (update_window): Use mode_line_p flag of rows 
	instead of WINDOW_WANTS_MODELINE_P.

	* xterm.c (clear_mouse_face): Make externally visible.

	* xfns.c (Fx_show_tip): Clear mouse face before showing tip.

	* xterm.c (expose_line): Handle exposure of top-lines.

	* xterm.c (XTframe_up_to_date): Don't call note_mouse_highlight
	if mouse_face_mouse_frame is null.

	* xdisp.c (redisplay_window): If window is echo_area_window,
	and update_mode_line is set, update menubar and toolbar.

	* dispnew.c (space_glyph): Set its charpos to -1.
	(update_frame_1): Ignore trailing padding spaces.

	* xdisp.c (next_element_from_c_string): Set position of padding
	glyphs to -1.

1999-06-27  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_laplace_read_row): Use XQueryColors instead of
	XQueryColor.

	* xdisp.c (display_menu_bar): Remove unwarranted assertion.
	(set_cursor_from_row): Skip over glyphs having a null object at
	the start of rows.
	(insert_left_trunc_glyphs): Use charpos < 0 to indicate truncation
	glyphs.
	(handle_invisible_prop): Compute next change only when needed.
	(handle_face_prop): Don't correct DEFAULT_FACE_ID if in the mode
	line.

1999-06-26  Gerd Moellmann  <gerd@gnu.org>

	* xrdb.c (x_load_resources): Don't set resource for double-click
	time.

	* xdisp.c (try_window_id): Return quickly if all changes are
	below the window's current matrix end.

	* dispextern.h (MATRIX_ROW_PARTIALLY_VISIBLE_P): Remove window
	parameter.

	* xdisp.c (try_window_reusing_current_matrix): Set no_scrolling_p
	in desired not in current matrix.
	(try_window_reusing_current_matrix): Rotate matrices starting
	at start_vpos instead of 0.

	* xterm.c (expose_window): Use window_text_bottom_y.
	(fast_find_position): Ditto.

	* xdisp.c (redisplay_window): Use window_text_bottom_y.
	(try_window_reusing_current_matrix): Ditto.
	(get_last_unchanged_at_beg_row): Ditto.
	(init_iterator): Ditto.

	* dispnew.c (allocate_matrices_for_window_redisplay): Allocate one
	more row.
	(check_matrix_invariants): Use window_text_bottom_y.
	(update_window): Ditto.
	(scrolling_window): Ditto.

	* xdisp.c (window_text_bottom_y): New.

1999-06-25  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (XTread_socket): Set mouse_face_frame to zero after
	clearing mouse face.
	(XTread_socket) <EnterNotify> [LESSTIF_VERSION]: If
	event.xcrossing.focus is not set, and focus is in the menu bar,
	set focus frame as if event.xcrossing.focus were set.

1999-06-24  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (make_lispy_event): Handle mouse on top lines.
	* keyboard.c (make_lispy_movement): Ditto.

	* window.c (coordinates_in_window): Return 4 if on top line.
	(Fcoordinates_in_window_p): Return `top-line' if on top line.

	* xdisp.c (window_box_height): Subtract top line height.
	(window_box): Add top line height to top y position if top line
	exists.
	(init_iterator): If base_face_id is TOP_LINE_FACE_ID, set row to
	the top line row of the window.  Set initial y-position to
	window's top line height plus delta.
	(start_display): Choose start glyph row depending on whether
	window has a top line.
	(try_scrolling): Take top line height into account for aggressive
	scrolling.
	(compute_window_start_on_continuation_line): Take top line into
	account.
	(redisplay_window): Ditto.  If top line height has changed, 
	trigger a new redisplay.
	(try_window_reusing_current_matrix): Take top line into account.
	(find_last_row_displaying_text): Ditto.
	(get_last_unchanged_at_beg_row): DItto.
	(try_window_id): Ditto.
	(compute_line_metrics): Ditto.

	* dispnew.c (shift_glyph_matrix): Compute visible row height
	taking top line of window into account.
	(update_window): Update top line.  If scrolling_window detects
	that all rows are equal, only set cursor.
	(update_window_line): Call after_update_window_line_hook if
	mode_line_p flag of rows has changed.
	(scrolling_window): Add parameter top_line_p.  Return -1 if
	all rows are equal.
	(mode_line_string): Add parameter mode_line_p.  Handle strings
	in top lines.

	* dispextern.h (MATRIX_TOP_LINE_ROW): New.
	(MATRIX_FIRST_TEXT_ROW): New.
	(MATRIX_ROW_PARTIALLY_VISIBLE_P): Use row's visible_height.
	(MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P): New.
	(MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): New.
	(MATRIX_TOP_LINE_HEIGHT): New.
	(CURRENT_MODE_LINE_HEIGHT): Use estimate_mode_line_height.
	(CURRENT_TOP_LINE_HEIGHT): New.
	(DESIRED_TOP_LINE_HEIGHT): New.
	(WINDOW_DISPLAY_TOP_LINE_HEIGHT): New.
	(WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE): Replaces
	WINDOW_DISPLAY_TEXT_AREA_PIXEL_HEIGHT.
	(WINDOW_DISPLAY_TEXT_HEIGHT): New.

	* xterm.c (x_after_update_window_line): Don't draw bitmaps for top
	lines.
	(x_draw_row_bitmaps): Take top line into account when clearing
	bitmap area.
	(x_estimate_mode_line_height): Replacement for
	x_frame_mode_line_height.
	(x_get_glyph_string_clip_rect): Take top line into account.
	(x_clear_end_of_line): Ditto.
	(note_mode_line_highlight): Add parameter mode_line_p.  Handle
	top lines.
	(note_mouse_highlight): Call note_mode_line_highlight for top lines.
	(x_erase_phys_cursor): Take top line into account.

	* xdisp.c (window_box_height): Subtract top line height if
	window wants a top line.
	(display_mode_lines): New.
	(redisplay_window): Call it.
	(display_mode_line): Add parameters face_id and format.

	* dispextern.h (CURRENT_TOP_LINE_HEIGHT): New.
	(MATRIX_TOP_LINE_HEIGHT): New.

	* xterm.c (x_frame_mode_line_height): Add parameter face_id.

	* term.c (estimate_mode_line_height): Renamed from
	frame_mode_line_height.  Add parameter face_id.
	(estimate_mode_line_height_hook): Renamed from
	frame_mode_line_height_hook.
	(produce_special_glyphs_hook): Removed.
	(produce_glyphs_hook): Removed.

1999-06-23  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (WINDOW_WANTS_TOP_LINE_P): New.
	(struct glyph_row): Add mode_line_p.

	* xfaces.c (realize_basic_faces): Realize face `top-line'.
	(Qtop_line): New.
	(syms_of_xfaces): Initialize Qtop_line.

	* dispextern.h (TOP_LINE_FACE_ID): New.

	* buffer.c (init_buffer_once): Set default for
	top_line_format to nil.
	(init_buffer_once): Init top_line_format.
	(default-top-line-format): New.
	(top-line-format): New buffer-local variable.

	* buffer.h: Add top_line_format.

	* xdisp.c (overlay_arrow_changed_p): Removed because not used.

1999-06-17  Dave Love  <fx@gnu.org>

	* xfns.c: Move the PNG section before the JPEG one to avoid
	problems surrounding setjmp.h/png.h on GNU/Linux.
	
1999-06-17  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_kill_gs_process): Don't free colors.

1999-06-17  Dave Love  <fx@gnu.org>

	* s/gnu-linux.h: Zap spurious ~.

1999-06-16  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (gif_load): Improve multi-image support.

1999-06-15  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (gif_load): Support multi-image files.

	* Makefile.in (LIBGIF): Use libungif.

	* configure.in (HAVE_GIF): Use libungif instead of libgif
	because the former doesn't contain patented compression code.

	* xdisp.c (compute_window_start_on_continuation_line): Don't
	do it if line start is too far away from window start.

1999-06-14  Gerd Moellmann  <gerd@gnu.org>

	* buffer.c (init_buffer_once): Set buffer_local_flags for
	scroll_*_aggressively.
	(syms_of_buffer): Add DEFVAR_PER_BUFFER for scroll-*-aggressively.
	(init_buffer_once): Set defaults for these variables.
	(syms_of_buffer): Add default-scroll-*-aggressively.

	* buffer.h (scroll_up_aggressively): New.
	(scroll_down_aggressively):  New.

	* Makefile.in (LIBPNG): Add -lz -lm in case we're linking with
	a static PNG library.

	* configure.in (HAVE_PNG): Add -lz -lm when checking for PNG lib
	in case it's a static library.

	* Makefile.in (ctagsfiles): Split so that files starting
	with an `x' are found before files starting with `w32'.
	(ctagsfiles1): New.
	(ctagsfiles2): New.
	(TAGS): Use ctagsfiles[12] instead of ctagsfiles.

	* xdisp.c (compute_window_start_on_continuation_line): New.
	(redisplay_window): Use it.
	(INFINITY): New.
	(reseat_to_string): Use it.
	(hscroll_window_tree): Ditto.
	(compute_window_start_on_continuation_line): Ditto.
	(redisplay_window): Don't force display with a new window start.

1999-06-06  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_report_frame_params): Don't report `outer-window-id'
	if widget not present.

	* xdisp.c (prepare_menu_bars): Ignore tooltip frame.

1999-06-04  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (recompute_basic_faces)[GLYPH_DEBUG]: Check return
	value of realize_basic_faces.
	(load_face_font_or_fontset): Store full font name in face.
	(realize_default_face): Use full font name.

	* xterm.c (x_produce_glyphs): Set member char_to_display.
	(x_append_glyph): Store char_to_display in glyphs.

	* dispextern.h (struct it): Add char_to_display.

	* xfns.c (x_set_font): Don't call face-set-after-frame-default
	if faces haven't been initialized.
	(Fx_create_frame): Call face-set-after-frame-default after
	faces have been initialized, and widget has been created.

	* puresize.h (BASE_PURESIZE): Increased.

1999-06-01  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (set_lface_from_font_name): Add parameter force_p.
	(Finternal_set_lisp_face_attribute): If frame is t when
	:font attribute is set, use the selected frame.
	(clear_face_cache): Add parameter clear_fonts_p.
	(Fclear_face_cache): Add optional parameter thorougly.

	* xfaces.c (face_numeric_value): Return -1 if symbol is not
	in table.
	(Fclear_face_cache): New.
	(choose_face_fontset_font): If fontset doesn't contain font
	pattern for the given charset, use CHARSET_ASCII.
	(Finternal_set_lisp_face_attribute): Fix handling of nil
	stipple attribute.
	(Finternal_set_lisp_face_attribute): Fix handling of changing
	font-related face attributes of the default face.
	(set_lface_from_font_name): Set only attributes that aren't
	specified.

1999-05-31  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (SCALABLE_FONTS): Define this to enable scalable
	font support.
	(Vscalable_fonts_allowed) [SCALABLE_FONTS]: New.
	(x_face_list_fonts): Add parameter scalable_fonts_p.  Handle
	scalable fonts depending on the setting of SCALABLE_FONTS.
	(first_font_matching): List more than one font to find the
	first non-scalable matching font.
	(sorted_font_list): Let x_face_list_fonts return scalable fonts
	depending on SCALABLE_FONTS.
	(better_font_p): New parameter compare_pt_p.  If zero, don't
	compare point sizes of fonts.
	(exact_face_match_p) [SCALABLE_FONTS]: New.
	(build_scalable_font_name) [SCALABLE_FONTS]: New.
	(may_use_scalable_font_p) [SCALABLE_FONTS]: New.
	(best_matching_font) [SCALABLE_FONTS]: Handle scalable fonts.
	(syms_of_xfaces):  Add scalable-fonts-allowed.

1999-05-26  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (png_load): Let PNG lib handle gamma.  Construct
	mask only if image contains simple transparency information.
	Otherwise, combine image with frame background color.

	* configure.in (--with-png, HAVE_PNG): New.

	* config.in (HAVE_PNG): New.

	* Makefile.in: Add PNG library.

	* xfns.c: Add PNG support.

1999-05-25  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (init_xdisp): Initialize echo_area_message and
	previous_echo_area_message to nil.

	* keyboard.c (read_char): Rename local variable echo_area_message
	because it shadows the global one.

1999-05-05  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (note_mode_line_highlight): Restructured.

	* window.c (coordinates_in_window): Handle windows that don't have
	a mode line because their buffer's mode-line-format is nil.
	Recognize the mode line under x positions that correspond to
	flags areas and left scroll bar.

1999-05-02  Dave Love  <fx@gnu.org>

	* xterm.c (note_mouse_highlight): Separate help-echo processing
	from check on mouse-face so that it works generally.

1999-04-21  Gerd Moellmann  <gerd@gnu.org>

	* sound.c (Fplay_sound): Run hook play-sound-hook.
	(Qplay_sound_hook): New.

1999-04-20  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (update_echo_area): Handle echo_area_message.

1999-04-19  Gerd Moellmann  <gerd@gnu.org>

	* editfns.c (Fmessage): Use message3.

	* print.c (printchar): Set echo_area_message to nil.
	(strout): Ditto.

	* minibuf.c (read_minibuf): Reset echo message strings to nil.
	(Fminibuffer_completion_help): Ditto.

	* keyboard.c (cmd_error_internal): Set echo_areA_message.
	(command_loop_1): Test echo_areA_message.
	(read_char): Ditto.
	(record_menu_key): Set echo_area_message to nil.
	(Fexecute_extended_command): Test echo_area_message.
	(Fexecute_extended_command): Handle echo_area_message.

	* fileio.c (Fdo_auto_save): Handle the case that echo_area_message
	is set.

	* editfns.c (Fcurrent_message): If echo_area_message is set,
	return a substring of that string.

	* dispnew.c (direct_output_for_insert): Test echo_area_message
	in addition to echo_area_glyphs.
	(set_window_cursor_after_update): Ditto.
	(update_frame_1): Ditto.

	* alloc.c (Fgarbage_collect): Use message3_nolog to display
	old Lisp message string.

	* xdisp.c (echo_area_message): New.
	(previous_echo_area_message): New.
	(syms_of_xdisp): Initialize and staticpro new variables.
	(echo_area_display): Display echo_area_message if set.
	(message2_nolog): Set echo_area_message and
	previous_echo_area_message.
	(echo_area_display): Set previous_echo_area_message.
	(redisplay_internal): Display echo area if echo_area_message
	or previous_echo_area_message are set.
	(redisplay_preserve_echo_area): Test/set echo_area_message and
	previous_echo_area_message.
	(redisplay_window): Test echo_area_message.
	(message3_nolog): New.
	(message3): New.

	* editfns.c (Fformat): Add text properties to the result string
	from properties of the format string and properties of string
	arguments.

	* textprop.c (text_property_list): New.
	(add_text_properties_from_list): New.
	(extend_property_ranges): New.

1999-03-29  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (Qraised, Qsunken, QCshadow): Removed.
	(QCline_width, QCstyle, Qpressed_button, Qreleased_button): New.
	Use these symbols for the box face attribute instead of the
	removed ones.

1999-03-12  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (realize_tty_face): Don't set alt_char_p of face.
	Correct wrong test for slant.

1999-03-10  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c: Use `unspecified' for unspecified face attributes,
	use t and nil for on/off.

1999-03-06  Gerd Moellmann  <gerd@gnu.org>

	* buffer.c (syms_of_buffer): Extend doc string of
	mode-line-format.

	* xfaces.c (x_face_list_fonts): New parameter try_alternatives_p.
	(first_font_matching): New.
	(set_lface_from_font_name): Use it if font name is a pattern.
	(font_field_wildcard_p): Removed.

	* dispnew.c (shift_glyph_matrix): Add `window' parameter.
	Recompute visible height of rows.

	* xterm.c (note_mouse_highlight): Reorder code for help-echo.
	Don't accept non-strings for help-echo from overlays.

1999-03-04  Dave Love  <fx@gnu.org>

	* xterm.c (note_mouse_highlight): Check overlays for help-text
	property.
	(XTread_socket): Fix compiler warning.
	
1999-03-05  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (note_mouse_highlight): Don't restrict number of 
	overlay to 10.  Call overlays_at so that it doesn't try to
	extend the vector.

	* xdisp.c (compute_line_metrics): Compute glyph row's visible
	height.

	* dispnew.c (row_equal_p): Compare visible row height, only.
	(update_text_area): Draw whole line if visible heights of
	rows differ.
	(update_window_line): Call after_update_window_line_hook
	if visible row height has changed.

	* dispextern.h (MATRIX_ROW_VISIBLE_HEIGHT): Removed.
	(struct glyph_row): New member visible_height.

	* xfaces.c (font_field_wildcard_p): New.
	(set_lface_from_font_name): Remove parameter force_p.  Accept
	font names containing wildcards.

1999-03-04  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_after_update_window_line): Clear internal border
	when windows_or_buffers_changed.

	* dispextern.h (WINDOW_WANTS_MODELINE_P): Return zero if window's
	buffer has a nil mode_line_format.

1999-03-03  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_setup_relief_colors): Use either background color
	or specified color.

	* xfaces.c (realize_x_face): Set face->use_box_color_for_shadows_p.

	* dispextern.h (struct face): Add use_box_color_for_shadows_p.

	* xterm.c (x_draw_box_rect): New.
	(x_draw_glyph_string_box): Renamed from
	x_draw_glyph_string_relief.  Call x_draw_box_rect.

	* xfns.c (QCrelief): New.
	(syms_of_xfns): Initialize it.

	* dispextern.h (struct glyph): Rename left_shadow_p to
	left_box_line_p, right_shadow_p to right_box_line_p.
	(MAX_RELIEF_THICKNESS): Removed.
	(struct it): Rename members having `relief' in their names
	to contain `box' instead.

	* xfaces.c (realize_x_face): Handle new box attribute values.
	(QCrelief, Qbox): Removed.
	(QCshadow, QCcolor, Qraised, Qsunken): New.
	(syms_of_xfaces): Initialize new symbols.

1999-03-02  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (LFACE_RELIEF_INDEX): Removed.

	* xfaces.c (LFACE_RELIEF): Removed.
	(merge_face_vector_with_property): Remove handling of `:relief'.
	(Finternal_set_lisp_face_attribute): Ditto.
	(Finternal_set_lisp_face_attribute_from_resource): Ditto.
	(Finternal_get_lisp_face_attribute): Ditto.
	(realize_default_face): Ditto.
	(lface_hash): Don't compute hash from relief.

	* dispextern.h (struct face): Replace member `relief' by
	`box_line_width'.  Add member `box'.
	(face_box_type): New.

	* xterm.c (x_produce_glyphs): If face has overline, add overline
	thickness + 1 to ascent.

1999-03-01  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_draw_glyph_string): Draw underline, overline,
	strike-through, and boxes.
	(x_draw_glyph_string_underline): Removed.

	* xfaces.c (QCoverline, QCstrike_through, QCbox): New.
	(Qoverline, Qstrike_through, Qbox): New.
	(syms_of_xfaces): Define these symbols.
	(check_lface_attrs): Add checks for overline, strike-through,
	and box.
	(Finternal_set_lisp_face_attribute): Set new attributes.
	(LFACE_OVERLINE, LFACE_STRIKE_THROUGH, LFACE_BOX): New.
	(load_color): Handle new attributes.
	(realize_x_face): Ditto.
	(merge_face_vector_with_property): Ditto.
	(free_face_colors): Ditto.
	(Finternal_set_lisp_face_attribute_from_resource): Ditto.
	(Finternal_get_lisp_face_attribute): Ditto.
	(Finternal_lisp_face_attribute_values): Ditto.

	* dispextern.h (lface_attribute_index): Add enumerators for
	overstrike, strike-through, and box.
	(struct face): Add members for overline, strike-through, and
	box.

1999-02-17  Dave Love  <fx@gnu.org>

	* s/gnu-linux.h s/gnu.h s/irix5-0.h s/netbsd.h s/sco4.h s/sco5.h
	s/template.h (NARROWPROTO): Define on the basis of relevant X cf
	files.

1999-02-16  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (toolbar_items): Call access_keymap with third
	parameter 1, so that we don't get inherited toolbar item
	definitions.

	* xdisp.c (redisplay_internal): In optimization 1, don't decrement
	the window end vpos when in empty first line of window.

1999-02-15  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (set_font_frame_param): New.
	(Finternal_set_lisp_face_attribute): Call it.

Sun Feb 14 10:54:02 1999  Masatake Yamato  <masata-y@is.aist-nara.ac.jp>

	* xfaces.c (Finternal_set_lisp_face_attribute_from_resource):
	Accept specifications of color for underline.

1999-02-13  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (Finternal_set_lisp_face_attribute): If parameter
	`frame' is t, operate on face defaults for new frames.  If it
	is nil, operate on the selected frame.

1999-02-12  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (check_matrix_invariants): Put it in #if 0.
	(update_window): Put the call to check_matrix_invariants in #if 0.

Sun Feb  7 09:58:49 1999  Masatake Yamato  <masata-y@is.aist-nara.ac.jp>

	* dispextern.h: Remove all else block of UNDERLINE_COLOR.
	Remove definition of UNDERLINE_COLOR.

Mon Jan  4 04:43:41 1999  Masatake Yamato  <masata-y@is.aist-nara.ac.jp>

	* xfaces.c (free_face_colors): Free the color for underline.

	* xterm.c (x_draw_glyph_string_underline): Set the color for underline
	to the GC.

Sun Jan  3 08:41:10 1999  Masatake Yamato  <masata-y@is.aist-nara.ac.jp>

	* dispextern.h 	(UNDERLINE_COLOR): Defined.
	(struct face): Added two new members.
	underline_color, underline_defaulted_p.

	* xfaces.c (merge_face_vector_with_property): 
	(check_lface_attrs): Accept the string value for underline.
	(Finternal_set_lisp_face_attribute): Likewise. 

	* xfaces.c (load_color): Change the last argument type to enum
	lface_attribute_index from int. And addec code for underling coloring.
	(load_face_colors): Pass LFACE_*_INDEX to load_color.
	
1999-02-12  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (Fx_image_header): Removed.

1999-02-07  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c: Don't include <bitmaps/gray>.
	(x_term_init): Use gray_bitmap_width and gray_bitmap_height.

	* xfns.c (Fx_image_header): Add missing `\n\'.
	(gray_bitmap_width, gray_bitmap_height, gray_bitmap_bits): New.

1999-02-01  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_scroll_bar_create): Set background pixel from
	specified scroll bar color.
	(x_scroll_bar_set_handle): Use scroll bar foreground color.

	* xfns.c (x_set_scroll_bar_foreground): Remove all scroll bars.
	(x_set_scroll_bar_background): Ditto.

	* xterm.c (x_create_toolkit_scroll_bar): Set scroll bar colors.

	* xfns.c (x_default_scroll_bar_color_parameter): New.
	(Fx_create_frame): Call it.

1999-01-31  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (Fx_create_frame): Initialize scroll bar pixel color
	values in x_output structure.  
	(Qscroll_bar_foreground, Qscroll_bar_background): New.
	(syms_of_xfns): Initialize these symbols.

	* xterm.h (struct x_output): Add scroll bar pixel colors.

	* xfns.c (x_frame_parms): Add entries for scroll bar colors.
	(x_set_scroll_bar_foreground): New.
	(x_set_scroll_bar_background): New.

1999-01-12  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (handle_single_display_prop): New.
	(handle_display_prop): Call it.
	(handle_raise_prop): Removed.
	(handle_height_prop): Removed.
	(handle_space_width_prop): Removed.
	(handle_face_prop): Remove handling of raised text.
	(handle_display_prop): Do it here.

	* dispextern.h (DISPLAY_PROP_IDX): Replaces GLYPH_PROP_IDX.
	(RAISE_PROP_IDX): Removed.
	(HEIGHT_PROP_IDX): Removed.
	(SPACE_WIDTH_PROP_IDX): Removed.

	* xdisp.c (Qdisplay): Replaces Qglyph.
	(handle_display_prop): Formerly handle_glyph_prop.

1999-01-11  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (reseat_to_string): Set position in display vector to -1.
	(handle_stop): Set position in display vector to -1.  Don't
	check overlay strings when set up to deliver characters from a
	display vector.
	(set_iterator_to_next): At the end of a run of characters from a
	display vector, check whether the display vector display replaces
	the display of a character.

1999-01-05  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (init_frame_faces): Don't realize faces if frame's
	X window hasn't been created yet.

1998-12-06  Gerd Moellmann  <gerd@gnu.org>

	* sound.c: New.

1998-12-04  Gerd Moellmann  <gerd@gnu.org>

	* config.in (HAVE_SOUND): New.

	* emacs.c (main): Call syms_of_sound and init_sound.

	* Makefile.in (obj): Add sound.o.

	* configure.in: Add checks for machine/soundcard.h and sys/soundcard.h.

	* config.in (HAVE_MACHINE_SOUNDCARD_H): New.
	(HAVE_SYS_SOUNDCARD_H): New.

1998-12-03  Gerd Moellmann  <gerd@gnu.org>

	* buffer.h (struct buffer): indicate_empty_lines renamed from
	indicate_zv_lines.

	* buffer.c (indicate-empty-lines): Renamed from indicate_zv_lines.
	(default-indicate-zv-lines): Likewise.

	* dispextern.h (struct glyph_row): Rename indicate_zv_line_p
	to indicate_empty_line_p.

	* xdisp.c (reseat_at_next_visible_line_start): Reset method
	to next_element_from_buffer.

	* frame.c (make_frame): Set n_current_toolbar_items to 0.

	* xdisp.c (handle_face_prop): Allow symbols of the form `N+'
	and `N-'.

	* xfns.c (xbm_scan): New.
	(xbm_read_hexint): Removed.
	(xbm_read_bitmap_file_data): Use xbm_scan.

	* fileio.c (Finsert_file_contents): Prevent redisplay optimizations.

1998-12-02  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (xbm_read_hexint): New.
	(xbm_read_bitmap_file_data): New.
	(xbm_load_image_from_file): Call xbm_read_bitmap_file_data
	instead of XReadBitmapFileData.

	* xdisp.c (handle_raise_prop): Compute voffset from current font.

	* xfaces.c (face_with_height): New.

	* xdisp.c (eval_handler): Renamed from eval_mode_handler.
	(eval_form): Renamed from eval_mode_element.
	(handle_face_prop): Use it.
	(Qheight): Replaces Qsmaller.
	(handle_height_prop): Replaces handle_smaller_prop.
	(handle_face_prop): If iterator's font_height is not an 
	integer, evaluate it to get the font height to use.

	* dispextern.h (HEIGHT_PROP_IDX): Replaces SMALLER_PROP_IDX.
	(struct it): Use `font_height' instead of `smaller'.

1998-12-01  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (reseat_1): New.
	(reseat): Call it.
	(move_it_vertically_backward): Ditto.
	(redisplay_window): Don't abort when cursor not found in recenter.

1998-11-30  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (reseat_at_next_visible_line_start): When not
	currently delivering display elements from the current buffer,
	restore buffer position first.
	(init_from_display_pos): Don't set IT's position from the
	position passed to this function.

1998-11-28  Gerd Moellmann  <gerd@gnu.org>

	* config.in (PROTO): Removed.

	* xterm.h: Change PROTO to P_.

1998-11-26  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (take_vertical_position_into_account): New.
	(x_produce_image_glyph): Call it.
	(x_produce_stretch_glyph): Ditto.
	(x_produce_glyphs): Ditto.
	(x_fill_glyph_string): Adjust base line for glyph's voffset.
	(x_fill_composite_glyph_string): Ditto.
	(x_fill_image_glyph_string): Ditto.
	(x_fill_stretch_glyph_string): Ditto.

	* xdisp.c (display_line): Always compute row height from
	max_ascent and max_descent.

	* dispextern.h (struct glyph): Add voffset.
	(struct it): Replace height by descent, max_height by max_descent.

	* xterm.c (x_append_glyph): Set voffset
	(x_append_stretch_glyph): Ditto.
	(x_produce_image_glyph): Ditto.
	(x_produce_glyphs): Take voffset into account.
	(x_produce_image_glyph): Ditto.
	(x_produce_stretch_glyph): Ditto.

	* dispextern.h (struct it): Add voffset.
	* xdisp.c (push_it): Save voffset.
	(pop_it): Restore it.

	* xdisp.c (it_props): Add entry for `raise'.
	(handle_raise_prop): New.

	* dispextern.h (RAISE_PROP_IDX): New.

	* xdisp.c (Qraise): New.
	(syms_of_xdisp): Define Qraised.

	* xterm.c (x_scroll_bar_move): Clear to the left and right
	of toolkit scroll bars differently.
	(x_scroll_bar_move): Removed.
	(XTset_vertical_scroll_bar): Move code from x_scroll_bar_move here.

	* dispextern.h: Make it compilable --with-x=no.
	* alloc.c: Ditto.
	* emacs.c: Ditto.
	* dispnew.c: Ditto.
	* keyboard.c: Ditto.
	* term.c: Ditto.
	* xdisp.c: Ditto.
	* xfaces.c: Ditto.
	* xfns.c: Ditto.
	* xmenu.c: Ditto.

1998-11-25  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (XTread_socket): Cancel help-echo when leaving frame.

1998-11-24  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_set_toolkit_scroll_bar_thumb): When dragging,
	update slider size, only.
	(xm_scroll_callback): Set dragging member of the scroll bar.
	(xt_action_hook): Reset last_scroll_bar_part.
	(XTredeem_scroll_bar): Reset bar->dragging to nil.

	* xfns.c (Fx_hide_busy_cursor): Don't try to hide busy cursor
	window on newly created frames that don't have one.

1998-11-23  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (restore_overlay_strings): Removed.
	(restore_dpvec): Removed.
	(init_from_display_pos): Inline both functions above.

	* xfns.c (IMAGE_NON_NEGATIVE_INTEGER_VALUE): New.
	(parse_image_spec): Handle it.
	(xbm_format): Use it.
	(xpm_format): Ditto.
	(pbm_format): Ditto.
	(jpeg_format): Ditto.
	(tiff_format): Ditto.
	(gif_format): Ditto.
	(gs_format): Ditto.

	* xdisp.c (set_window_cursor): Removed.
	(redisplay_internal): Case cursor motion in cursor line of
	selected window; use set_cursor_from_row.

1998-11-22  Gerd Moellmann  <gerd@gnu.org>

	* widget.c (EmacsFrameSetCharSize): Take widget's border width
	into account.

1998-11-21  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (expose_frame): Redraw menu bar window.

	* xdisp.c (display_menu_bar): Record hpos instead of x-position
	in menu item.

	* dispnew.c (change_frame_size_1): Use FRAME_TOP_MARGIN instead
	of FRAME_TOOLBAR_LINES.  Use `f' instead of `frame'.

	* widget.c (set_frame_size): Use FRAME_SCROLL_BAR_COLS
	to determine vertical_scroll_bar_extra.
	(EmacsFrameSetCharSize): Ditto.
	* xfns.c (x_figure_window_size): Ditto.

	* xterm.c (x_draw_row_bitmaps): Draw in `bitmap-area' face.
	(x_draw_bitmap): Ditto.

	* dispextern.h (face_id): New id BITMAP_AREA_FACE_ID.
	* xfaces.c (realize_basic_faces): Realize it.

1998-11-20  Gerd Moellmann  <gerd@gnu.org>

	* xmenu.c (xmenu_show): Add workaround for remaining button grab
	under LessTif   Use the widget of the frame as parent for the 
	menu, again.

1998-11-19  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (XTread_socket): Inhibit busy cursor for EnterNotify.
	When EnterNotify, don't generate a mouse movement event if
	notification is from a busy-cursor child window.

	* xterm.h (struct x_output): Add busy_window, remove cursor.

	* xfns.c (Fx_show_busy_cursor): Formerly Fx_display_busy_cursor.
	Use a transparent window to display the busy-cursor.
	(Fx_hide_busy_cursor): Formerly Fx_undisplay_busy_cursor.

1998-11-17  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (check_window_end): New, for debugging.
	(CHECK_WINDOW_END): New.
	(try_window_id): Use it.

	* xterm.c (process_expose_from_menu): Return int.

	* keyboard.c (kbd_buffer_get_event): Set flag to prevent recording
	TOOLBAR_EVENT events in last_nonmenu_event.

1998-11-16  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (redisplay_window): If windows_or_buffers_changed,
	window end isn't reliable, so set window_end_valid to nil.
	(redisplay_internal): If overlay arrow has changed, set
	windows_or_buffers_changed to redisplay thoroughly.

	* dispnew.c (adjust_glyph_matrix): Invalidate window end, if
	necessary.

	* xfns.c (file_dialog_cb): New.
	(Fx_file_dialog): New.
	* fileio.c (Fread_file_name): Call it.

	* xrdb.c (x_load_resources): Add default resoures for file 
	selection dialog.

1998-11-14  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (note_mouse_highlight): Don't highlight when popup
	is active.

	* keyboard.c (timer_check): Inhibit busy cursor around calls to
	timer-event-handler.  This busy cursor tends to be anoying if
	fontifying stealthily.

	* dispnew.c (direct_output_for_insert): Give up if current row
	contains trailing whitespace.

1998-11-13  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (prop_idx): Add FONTIFIED_PROP_IDX.

	* xdisp.c (handle_fontified_prop): New.
	(Vfontification_functions): New.
	(Qfontification_functions): New.
	(it_props): Add handle_fontified_prop.

1998-11-12  Gerd Moellmann  <gerd@gnu.org>

	* xmenu.c (xmenu_show): Use the frame's edit_widget as parent.
	Otherwise, under LessTif, after the popup has gone, all button
	press events come in for the frame's widget, and release events
	come in for the edit_widget.
	* xterm.c (XTread_socket): Remove workaround for that problem.
	(x_set_toolkit_scroll_bar_thumb): Add workaround for LessTif
	XmScrollBarSetValues.
	(SET_SAVED_MENU_EVENT): Give it statement form.

	* xfaces.c (display_message): If waiting_for_input, don't display
	the message.

	* window.c (scroll_command): If not acting on current_buffer,
	make redisplay consider all windows.

	* xfns.c (Fx_hide_tip): Return t if tooltip was open.

	* xdisp.c (handle_glyph_prop): Set it->object for images to
	the object having the glyph property.

	* xterm.c (x_draw_row_bitmaps): Don't draw if row is completely
	invisible.

1998-11-11  Gerd Moellmann  <gerd@gnu.org>

	* xterm.h (struct x_display_info): Add gray pixmap.  * xterm.c
	(x_term_init): Create the gray pixmap.
	(x_setup_relief_color): Use it.
	(x_get_glyph_string_clip_rect): Draw a toolbar window over the
	internal border at the top of a frame.
	(x_init_glyph_string): Likewise.
	(x_draw_glyph_string_relief): Correct right x by 1 pixel for 
	full-width lines.
	(XTflash): Don't flash the toolbar window.

	* xterm.c (XTread_socket): Workaround for LessTif popup menus
	in case of ButtonPress events.

1998-11-10  Gerd Moellmann  <gerd@gnu.org>

	* xrdb.c (x_load_resources): Add grey background colors as
	defaults for menus, scroll bars, and dialogs.

	* insdel.c (prepare_to_modify_buffer): Move setting
	windows_or_buffers_changed from modify_region here.

	* xfns.c (Fx_show_tip): Inhibit redisplay.
	(Fx_hide_tip): Ditto.
	(Fx_image_header): New.

1998-11-09  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (clear_window_matrices): Set window_end_valid to nil
	when clearing current window matrices.

1998-11-08  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (handle_glyph_prop): Don't set an iterator's buffer
	position from a string position.  Use the right end position
	if the property spans a whole overlay string.

1998-11-07  Gerd Moellmann  <gerd@gnu.org>

	* xmenu.c (menubar_selection_callback): Remove workaround for
	Lesstif not calling XmNpopdownCallback because it doesn't
	handle the case where users don't select any menu item.

	* insdel.c (modify_region): Set windows_or_buffers_changed.

	* buffer.c (set_buffer_internal): Don't set
	windows_or_buffers_changed.

	* xmenu.c (HAVE_BOXES): Define if USE_X_TOOLKIT.

	* xmenu.c (menubar_selection_callback): Add workaround for
	Lesstif not calling XmNpopdownCallback.

	* xdisp.c (eval_mode_element): New.
	(eval_mode_handler): New.
	(display_mode_element): Use eval_mode_element.

	* xdisp.c (display_mode_element): Allow `(:eval FORM)'.
	Remove code looking at text props of default value.

	* xmenu.c (HAVE_BOXES): Define if using Lucid menus.

1998-11-06  Gerd Moellmann  <gerd@gnu.org>

	* xmenu.c (single_submenu): Set button_type of menu to 
	BUTTON_TYPE_NONE.
	(single_submenu): Likewise for panes and menu items.
	(set_frame_menubar): Set button_type of menu bar to none.
	(xmenu_show): Likewise.
	(single_submenu): Set widget values selected slot.
	(xmenu_show): Likewise.

	* xmenu.c (push_menu_item): Add parameters `type' and
	`selected'. Store it in menu_items.
	(MENU_ITEMS_ITEM_TYPE): New.
	(MENU_ITEMS_ITEM_SELECTED): New.
	(MENU_ITEMS_ITEM_LENGTH): Increase by two.

	* xfns.c (clear_image_cache): Get the current time, before
	doing anything.
	(cache_image): Set prev pointer of next image.
	(clear_image_cache): Clear current matrices if any image was
	freed.

	* xterm.c (XTread_socket): Set inhibit_busy_cursor.

	* xfns.c (x_set_cursor): New.
	(Fx_display_busy_cursor): New.
	(Fx_undisplay_busy_cursor): New.

	* xterm.h (struct x_output): Add busy_cursor.

	* xfns.c (Vx_busy_pointer_shape): New.
	(x_set_mouse_color): Create busy cursor.

	* process.c (wait_reading_process_input): Show and hide busy
	cursor.

	* keyboard.c (command_loop_1): Display busy cursor.

	* eval.c (Fsignal): Hide busy cursor.

	* buffer.c (set_buffer_internal): Don't set
	windows_or_buffers_changed.

	* xterm.c (redo_mouse_highlight): New.

1998-11-04  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_create_x_image_and_pixmap): Add depth parameter.
	(x_build_heuritic_mask): New.
	(lookup_image): Call it.

	* xterm.c (note_toolbar_highlight): Always set up help_echo.
	(previous_help_echo): New.
	(XTread_socket): Generate help event with nil message when
	leaving a region with help-echo.
	(note_mouse_highlight): Handle `help-echo' over text.
	(XTread_socket): Dispatch VisibilityNotify, CirculateNotify,
	CirculateRequest.
	(clear_mouse_face): Don't clear if tooltip is shown.
	(XTread_socket): Redo mouse-highlight after tooltip is gone.
	Avoid SET_FRAME_GARBAGED when tooltip is mapped.

	* keyboard.c (Vshow_help_function): New.
	(read_char): Use it.

1998-11-03  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_create_tip_frame): New.
	(Fx_show_tip): New.
	(Fx_hide_tip): New.

	* xterm.c (x_destroy_window): Handle case that we don't have 
	a widget.

	* dispextern.h (struct glyph_row): Rename no_marginal_areas_p
	to full_width_p.  Add internal_border_p.

1998-11-02  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (note_mode_line_highlight): Check the charpos of
	the glyph under the mouse pointer before accessing text
	properties at that position.

1998-11-01  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_draw_image_relief): Handle toolbar_button_relief.

	* xdisp.c (auto-raise-toolbar-buttons): New.
	(build_desired_toolbar_string): Handle the flag.
	(toolbar-button-margin): New.
	(toolbar-button-relief): New.
	(build_desired_toolbar_string): Use margin and relief.

	* xterm.c (x_set_toolkit_scroll_bar_thumb): Remove workaround
	for FreeBSD.
	(note_mode_line_highlight): New.
	(note_mouse_highlight): Call it.

1998-10-31  Gerd Moellmann  <gerd@gnu.org>

	* s/freebsd.h (NARROWPROTO): New.

	* xdisp.c (display_string): New parameter face_string.
	(display_mode_element): When displaying a symbol with a string
	value, use text properties from the symbol's default value, maybe.

	* xrdb.c (x_load_resources): Add font defaults for menus and
	dialogs.

1998-10-30  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (Fx_create_frame): Try 12pt Courier font first.

1998-10-29  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_produce_glyphs): Fix bug causing glyphs to be
	produced for characters with codes < 32 under certain
	circumstances.

	* xdisp.c (redisplay_window): Handle values of PT in front
	of invisible, intangible text.
	(try_window_id): Set overlay_arrow_seen to zero before 
	displaying lines.
	(display_mode_element): Assign to glyphs written for a mode
	line spec `%x' as object the Lisp format string, as position
	the position of the `%' in that string.
	(display_string): If displaying a C string, optionally get
	the face to use from a Lisp string.

	* xterm.c (expose_window_tree): Include mode line height.

	* xfns.c (Fx_create_frame): Add toolbar height to frame height.

1998-10-27  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (note_mouse_highlight): Change mouse pointer shape
	over mode line.

1998-10-26  Gerd Moellmann  <gerd@gnu.org>

	* window.c (coordinates_in_window): Use CURRENT_MODE_LINE_HEIGHT.

	* xdisp.c (redisplay_window): If mode line height has changed,
	 arrange for a thorough immediate redisplay using the correct mode
	 line height.
	 (window_box_height): Use CURRENT_MODE_LINE_HEIGHT.

	* dispextern.h (MATRIX_MODE_LINE_HEIGHT): New.
	(CURRENT_MODE_LINE_HEIGHT): New.
	(DESIRED_MODE_LINE_HEIGHT): New.

	* keyboard.c (make_lispy_event): Add string and string position
	info to mouse-click events.
	(read_key_sequence): Handle `local-map' property of mode line
	strings.

	* keyboard.h (POSN_STRING): New.

1998-10-25  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (mode_line_string): Mew.

	* xterm.c (xt_action_hook): New.
	(x_create_toolkit_scroll_bar): Add action hook.
	(xm_scroll_callback): Implement dragging.

	* keyboard.c (Qend_scroll): New.
	(scroll_bar_parts): Add it.

	* termhooks.h (scroll_bar_end_scroll): New.

	* xterm.c (XTread_socket): Bug fix.

1998-10-24  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (redisplay_window): Finish scroll bars after
	redisplaying toolbar.

	* keyboard.c (scroll_bar_parts): Add Qtop and Qbottom.
	(syms_of_keyboard): Add Qbottom.

	* termhooks.h (scroll_bar_to_top): New.
	(scroll_bar_to_bottom): New.

	* xdisp.c (redisplay_window): Always resize toolbar window if
	auto_resize_toolbar_p is non-zero.
	(auto_resize_toolbar_p): Renamed from auto_resize_toolbar.
	(window_box): New.
	(window_box_height): New.
	(window_box_width): New.
	(window_box_left): New.
	(window_box_right): New.
	(window_box_edges): New.

1998-10-23  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_set_toolkit_scroll_bar_thumb): Kluge for call to
	XawScrollbarSetThumb in FreeBSD.
	(x_create_toolkit_scroll_bar): Set resource "beNiceToColormap"
	to true.

	* window.c (get_phys_cursor_glyph): Return null if cursor vpos
	is out of range.

	* xterm.c (x_create_toolkit_scroll_bar): Set scroll_bar_pixel.
	(x_term_init): Initialize it.

	* xterm.h (struct x_display_info): Add scroll_bar_pixel.

	* xterm.c (x_create_toolkit_scroll_bar): Set LessTif scroll bar's
	cursor.

1998-10-22  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (make_lispy_event): Handle scroll_bar_click
	differently when using toolkit scroll bars.

	* xterm.c (x_send_scroll_bar_event): New.
	(x_scroll_bar_to_input_event): New.
	(xaw3d_scroll_callback): New.
	(xaw3d_jump_callback): New.
	(xm_scroll_callback): New.
	(x_toolkit_scroll_p): New.
	(XTread_socket): Handle scroll bar client message.
	(x_term_init): Initialize Xatom_Scrollbar.
	(x_scroll_bar_create): Set cursor.
	(xm_scroll_callback):
	(x_create_toolkit_scroll_bar): New.
	(x_set_toolkit_scroll_bar_thumb): New.
	(x_scroll_bar_create): Call x_create_toolkit_scroll_bar.
	(XTset_vertical_scroll_bar): Call x_set_toolkit_scroll_bar_thumb.

	* xterm.h (struct x_display_info): Add Xatom_Scrollbar.

1998-10-21  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_scroll_bar_remove): Handle toolkit scroll bars.
	(XTread_socket): Don't handle mouse button events for scroll bars
	if using toolkit scroll bars.
	(XTset_vertical_scroll_bar): Set thumb size and position for
	Athena scroll bar.

	* xterm.h (scroll_bar): Add x_widget_low and x_widget_high.

	* xterm.c (XTread_socket): Dispatch expose event to widget
	if using toolkit scroll bars.
	(x_scroll_bar_expose): Make no-op for toolkit scroll bars.
	(x_scroll_bar_create): Create and show a scroll bar widget 
	if using toolkit scroll bars.
	(x_scroll_bar_move): Handle tookit scroll bars.

	* Makefile.in (LIBW): Use Xaw3d if present.

	* configure.in (USE_TOOLKIT_SCROLL_BARS): New.
	(HAVE_XAW3D): New.
	
	* config.in (USE_TOOLKIT_SCROLL_BARS): New.
	(HAVE_XAW3D): New.

	* xterm.c (XTset_vertical_scroll_bar): Correct position of 
	right vertical scroll bar.

1998-10-20  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (xpm_load): Support reading XPM images from string
	buffers containing data in the same format as an XPM file.
	Support `:color-symbols'.
	(xpm_format): Add `:data'.
	(xpm_keyword_index): Add XPM_DATA.
	(syms_of_xfns): Add `:color-symbols'.
	(xpm_keyword_index): Add XPM_COLOR_SYMBOLS.
	(xpm_valid_color_symbols_p): New.
	(xpm_image_p): Call it.

	* xdisp.c (build_desired_toolbar_string): Add `:algorithm'
	attribute to the image if item is not enabled.

	* xfns.c (x_laplace): New.
	(x_laplace_read_row): New.
	(x_laplace_write_row): New.
	(lookup_image): Handle common image attributes here.  New
	attribute `:algorithm'.

	* xfaces.c (clear_face_cache): Call clear_image_cache.

	* xterm.c (x_inverted_image_mask): Removed.
	(x_draw_image_foreground_1): New.
	(x_draw_image_glyph_string): Draw images with mask to a temporary
	pixmap to reduce flickering.

	* xdisp.c (redisplay_toolbar): Handle auto-resize-toolbars.
	(display_toolbar_line): Remove parameter `margin'.

1998-10-19  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (toolbar_lines_needed): New.
	(auto-resize-toolbars): New.

	* xfns.c (cache_image): Correct call to xrealloc.

	* dispnew.c (Fset_toolbar_height): Removed.

	* xdisp.c (init_xdisp): Use FRAME_TOP_MARGIN instead of
	FRAME_MENU_BAR_LINES.

	* window.c (Fdelete_other_windows): Use FRAME_TOP_MARGIN
	instead of FRAME_MENU_BAR_LINES.
	(check_frame_size): Ditto.

	* dispnew.c (adjust_frame_glyphs_initially): Use FRAME_TOP_MARGIN
	instead of FRAME_MENU_BAR_LINES.
	(adjust_frame_glyphs_for_frame_redisplay): Ditto.
	(build_frame_matrix): Ditto.
	(change_frame_size_1): Ditto.

	* frame.h (FRAME_TOOLBAR_LINES): New.
	(FRAME_TOP_MARGIN): New.

	* window.c (struct save_window_data): Add frame_toolbar_lines.
	(Fset_window_configuration): Handle toolbar lines.
	(Fcurrent_window_configuration): Save toolbar lines.

	* frame.c (syms_of_frame_1): Add Qtoolbar_lines.

	* xfns.c (Fx_create_frame): Add default parameter for toolbar.

	* frame.h (struct frame): Rename top_margin to toolbar_lines.

	* xfns.c (x_frame_parms): Add `toolbar-lines'.
	(x_set_toolbar_lines): New.

	* keyboard.c (cmd_error_internal): Bug fix.

	* xterm.c: Remove double include of syssignal.h.

1998-10-18  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_toolbar_item): New.
	(x_handle_toolbar_click): Use it.
	(note_toolbar_highlight): Use it.

	* keyboard.c (syms_of_keyboard): Staticpro toolbar_item_properties
	and toolbar_items_vectors.

	* xterm.c (help_echo): New.
	(draw_glyphs_face): Add DRAW_IMAGE_RAISED and DRAW_IMAGE_SUNKEN.
	(x_set_glyph_string_gc): Handle them.
	(x_after_update_window_line): Don't do anything in pseudo-windows.
	(x_produce_image_glyph): Take image margin and face relief into
	account.
	(x_get_glyph_string_clip_rect): Handle pseudo-windows.
	(x_draw_glyph_string_background): Optimize case when face has
	relief.
	(x_setup_relief_color): Take frame instead of glyph string
	parameter.
	(x_draw_relief_rect): New.
	(x_draw_glyph_string_relief): Call it.
	(x_draw_image_glyph_string_foreground): Handle margin and image
	relief.
	(x_draw_image_glyph_string_background): Ditto.
	(expose_frame): Redraw toolbar window.
	(expose_window): Don't draw cursor for pseudo-windows.
	(x_y_to_hpos_vpos): Handle pseudo-windows.
	(frame_to_window_pixel_xy): New.
	(note_mouse_highlight): Call note_toolbar_highlight.
	(x_handle_toolbar_click): New.
	(note_toolbar_highlight): New.
	(show_mouse_face): Change int parameter `hl' to parameter of
	type enum draw_glyphs_face.  Handle image highlighting.
	(XTread_socket): Return a HELP_EVENT input event if help_echo is
	non-nil.  Use x_handle_toolbar_click.

	* termhooks.h (event_kind): Add HELP_EVENT, TOOLBAR_EVENT.

	* xfns.c (image_value_type): Add IMAGE_INTEGER_VALUE,
	IMAGE_BOOL_VALUE.
	(parse_image_spec): Handle them.
	(image_spec_value): Additional parameter found.
	(free_image): Remove image from the vector `images' of the 
	image cache.
	(clear_image_cache): Additional parameter force_p.
	(Fclear_image_cache): New.
	(x_find_image_file): New.
	(xbm_load): Handle `:margin' and `:relief'.  Use
	x_find_image_file.
	(xpm_load): Likewise.
	(pbm_load): Likewise.
	(jpeg_load): Likewise.
	(tiff_load): Likewise.
	(gif_load): Likewise.

	* keyboard.c (Qhelp_echo): New symbol.
	(read_char): Handle `toolbar' and `help_echo' events.
	(kbd_buffer_get_event): Handle HELP_ECHO input event.
	(make_lispy_event): Handle TOOLBAR_EVENT.
	(toolbar_items): New.
	(process_toolbar_item): New.
	(PROP): New.
	(init_toolbar_items): New.
	(append_toolbar_item): New.
	(read_char_x_menu_prompt): Handle `toolbar' event.
	(read_key_sequence): Ditto.

	* xfaces.c (Qtoolbar): New.
	(realize_basic_faces): Realize `toolbar' face.
	(face_at_string_position): Remove parameter modeline_p, add
	base_face_id.

	* xfns.c (xbm_load_image_from_file): Don't use Xmu function
	to read data.

1998-10-17  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (init_iterator): Replace parameter modeline_p with
	base_face_id.
	(next_element_from_string): Call get_next_display_element
	recursively after handling text properties.
	(prepare_menu_bars): Call update_toolbar.
	(update_toolbar): New.
	(build_desired_toolbar_string): New.
	(display_toolbar_line): New.
	(redisplay_toolbar): New.
	(toolbar_item_info): New.
	(redisplay_window): Call redisplay_toolbar.
	(Fdump_toolbar_row): New.  Defined if compiled with GLYPH_DEBUG.

	* dispnew.c (clear_current_matrices): Clear matrices of toolbar
	window.
	(clear_desired_matrices): Ditto.
	(adjust_frame_glyphs_for_window_redisplay): Make toolbar window.
	(free_glyphs): Free matrices of toolbar window.
	(update_frame): Update toolbar window.
	(change_frame_size_1): Take toolbar into account.
	(Fset_toolbar_height): New.

	* dispextern.h (struct it): Remove member modeline_p, add
	base_face_id.
	(struct image): Add members relief and margin.
	(IMAGE_ASCENT): Include margin in height.

1998-10-14  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (Fclear_image_cache): New.

	* xfaces.c (realize_basic_faces): Realize toolbar face.
	(face_at_string_position): Remove parameter modeline_p, add
	base_face_id.

	* dispextern.h (enum face_id): Add TOOLBAR_FACE_ID.

1998-10-13  Gerd Moellmann  <gerd@gnu.org>

	* keyboard.c (syms_of_keyboard): Intern `:help'.

1998-10-12  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (note_toolbar_highlight): New.
	(note_mouse_highlight): Call it.

	* window.c (window_from_coordinates): Additional parameter toolbar_p.
	(coordinates_in_window): Handle toolbar window.

	* keyboard.c (toolbar_items): New.
	(process_toolbar_item): New.
	(parse_toolbar_item): New.
	(init_toolbar_items): New.
	(append_toolbar_item): New.

	* dispextern.h (enum toolbar_item_idx): New.
	(enum toolbar_item_image): New.

	* frame.h (struct frame): Add toolbar-related members.

	* xfaces.c (face_at_string_position): Remove assertion that
	current_buffer == window's buffer.  This is not the case when
	called for the toolbar window.

	* frame.c (make_frame): Initialize toolbar members.

	* alloc.c (mark_object): Mark toolbar data of frames.

	* frame.h (struct frame): Add toolbar-related members
	toolbar_window, desired_toolbar_items, current_toolbar_items,
	desired_toolbar_string, current_toolbar_string,
	n_desired_toolbar_items, n_current_toolbar_items.  Add
	window_height.

	* xterm.c (x_after_update_window_line): Don't draw bitmap
	areas for pseudo-windows.
	(expose_frame): Handle toolbar window.
	(expose_window): Don't do cursor stuff for pseudo-windows.

	* xdisp.c (display_menu_bar): Correct calls to init_iterator.

1998-10-11  Gerd Moellmann  <gerd@gnu.org>

	* frame.c (make_frame): Initialize toolbar_window.

	* alloc.c (mark_object): Make the toolbar window.

	* dispnew.c (update_frame): Update frame's toolbar_window.
	(clear_current_matrices): Likewise.
	(clear_desired_matrices): Likewise.
	(adjust_frame_glyphs_for_window_redisplay): Make toolbar_window.
	(free_glyphs): Free the toolbar window and its matrices.

	* frame.h (struct frame): Add toolbar_window.

	* xterm.c (x_draw_glyph_string_relief): Handle mouse-face
	with relief.

1998-10-10  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (buffer_posn_from_coords): Don't screw up if 
	window start is not in the range BEGV..ZV.

1998-10-09  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (try_scrolling): Experimentally handle the case
	that scroll-preserve-screen-position is set to `always'.

	* window.c (Vscroll_preserve_screen_position): Replacement for
	scroll_preserve_screen_position.

1998-10-08  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c: Don't initialize auto structs; the HP/UX compiler
	doesn't like it.
	* xdisp.c: Ditto.

	* xdisp.c (make_cursor_line_fully_visible): Adjust this_line_y.

1998-10-06  Gerd Moellmann  <gerd@gnu.org>

	* minibuf.c (Fminibuffer_complete_word): Fix computation of 
	i_byte when prompts are inserted into minibuffers.

	* dispextern.h (FRAME_INTERNAL_BORDER_WIDTH_SAFE): New.
	(WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X): Use it.
	(WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y): Ditto.

1998-10-04  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (make_cursor_line_fully_visible): New.
	(try_scrolling): New.
	(redisplay_window): Move scrolling code to try_scrolling.
	(make_cursor_line_fully_visible): Handle case of window too small
	to show a single line.
	(redisplay_window): Case forced window start---use
	make_cursor_line_fully_visible.
	(redisplay_window): Case cursor movement via current matrix.
	If ending up on a partially visible line, make it fully visible
	instead of recentering.
	(try_scrolling): Additional parameter scroll_smoothly.

	* xterm.c (x_draw_bitmap): Don't XClearArea under the pixmap.

1998-09-28  Gerd Moellmann  <gerd@gnu.org>

	* window.c (window_scroll_pixel_based): Bug fix: vpos used
	instead of y-position for scroll-preserved-screen-position.

1998-09-07  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (update_frame_line): If current row is not enabled,
	write the whole line.

1998-09-06  Gerd Moellmann  <gerd@gnu.org>

	* lisp.h (HAVE_FACES): Removed.

	* dispextern.h (HAVE_FACES): Removed.

	* config.in (HAVE_FACES): Removed.

	* dispnew.c (HAVE_FACES): Removed.

	* xdisp.c (HAVE_FACES): Removed.

	* xfaces.c (HAVE_FACES): Removed.

1998-09-05  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (init_iterator): If face_change_count is non-zero,
	free realized faces.

	* xfaces.c (free_all_realized_faces): Make it externally visible.
	(Finternal_set_lisp_face_attribute): Increment
	windows_or_buffers_changed.

	* dispnew.c (direct_output_for_insert): Give up if
	face_change_count is non-zero.
	(direct_output_forward_char): Ditto.

	* xfaces.c (face_change_count): New.

1998-09-04  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_draw_bar_cursor): Don't draw if cursor hpos is out
	of range.

1998-09-03  Gerd Moellmann  <gerd@gnu.org>

	* term.c (Ftty_display_color_p): New.

1998-09-02  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (Ftty_defined_colors): New.

	* xterm.c (x_produce_glyphs): Fix computation of
	contains_overlapping_glyphs_p for ASCII.

	* dispnew.c (Fshow_cursor): Don't change cursor state while
	redisplaying.
	(direct_output_for_insert): If a glyph with lbearing or rbearing
	is among the new glyphs, set row flag contains_overlapping_glyph_p.

1998-09-01  Gerd Moellmann  <gerd@gnu.org>

	* term.c (OUTPUT_IF): Make replacement text have statement form.
	(OUTPUT1_IF): Ditto.
	(TS_italic_mode, TS_end_italic_mode): Removed.
	(TS_bold_mode): Removed.
	(TS_underscore_mode, TS_end_underscore_mode): Removed.
	(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
	(TS_enter_reverse_mode): New.
	(TS_enter_underline_mode, TS_exit_underline_mode): New.
	(TN_magic_cookie_glitch_ul): New.
	(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
	(TS_exit_attribute_mode): New.
	(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
	(TS_set_foreground, TS_set_background): New.
	(reset_terminal_modes): Switch colors back to default.
	(write_glyphs): Turn face on before writing text, turn it off
	afterwards.
	(insert_glyphs): Ditto.
	(term_init): Initialize new terminal capability variables.
	(turn_on_face): Turn a face on.
	(turn_off_face): Turn a face off.

	* lisp.h (MAKE_GLYPH): Remove test for frame type.
	(GLYPH_CHAR): Ditto.
	(GLYPH_FACE): Ditto.

	* xfaces.c (Vface_tty_color_alist): New.
	(face-register-tty-color): New.
	(face-clear-tty-colors): New.

	* dispextern.h (FACE_TTY_DEFAULT_COLOR): New.
	(struct it): Remove member faces_p since we now always have faces.

1998-08-31  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (struct face): Add tty appearance flags.

	* xdisp.c (init_iterator): Always handle faces.
	(extend_face_to_end_of_line): Handle tty frames.

	* dispnew.c (clear_glyph_matrix): Allow a null matrix to be
	passed in.

1998-08-30  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (realize_default_face): Use empty strings to indicate
	that the face should use the default foreground/background
	color of the terminal.  Fill font-related attributes with 
	appropriate values for tty frames.

	* emacs.c (main): Call syms_of_xfaces before init_window_once.

	* xfaces.c (realize_default_face): If face `default' is not
	yet known, create it.

	* frame.c (make_terminal_frame): Call init_frame_faces
	unconditionally.

	* xfaces.c (init_frame_faces): Make it work for tty frames.
	(free_frame_faces): Ditto.
	(clear_face_cache): Ditto.
	(recompute_basic_faces): Ditto.
	(Fframe_face_alist): Ditto.
	(free_realized_face): Ditto.
	(prepare_face_for_display): Ditto.
	(clear_face_gcs): Ditto.
	(lookup_face): Ditto.
	(smaller_face): Ditto.
	(realize_default_face): Ditto.
	(realize_face): Ditto.
	(realize_face): Dispatch to functions depending on the frame type.
	(realize_x_face): X way of realizing faces.
	(realize_tty_face): TTY way of realizing faces.

1998-08-29  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (realize_face): Remove parameter unibyte_registry,
	compute it instead.
	(lookup_face): Remove local variable unibyte_registry.

1998-08-22  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_draw_glyph_string_relief): Draw top and bottom lines
	1 pixel longer.

	* xdisp.c (face_before_or_after_it_pos): Fix computation 
	of face in buffer.

	* editfns.c (make_buffer_string_both): If prompt in buffer,
	prevent start > end.

	* indent.c (Fvertical_motion): Set current_buffer to window's
	buffer if it isn't already.

1998-08-21  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (GLYPH_DEBUG): Use default 0.

	* xdisp.c (it_props): New member `smaller'.
	(init_iterator): Initialize it.
	(Qsmaller): New.
	(push_it): Save value of `smaller' value on the stack.
	(pop_it): Restore `smaller' from the stack.
	(handle_smaller_prop): New.
	(handle_face_prop): Use `smaller' text property to select a
	suitable face.

	* dispextern.h (SMALLER_PROP_IDX): New.
	(struct it): Add member `smaller'.

	* xfaces.c (smaller_face): New.

	* frame.h (FRAME_WINDOW_WIDTH_ARG): Add bitmap area widths.

	* dispnew.c (allocate_matrices_for_window_redisplay): Compute
	total pixel width of window differently.

	* xdisp.c (init_iterator): Compute width of mode line differently.

	* dispextern.h (WINDOW_DISPLAY_PIXEL_WIDTH): Subtract width
	of bitmap areas.

	* window.c (Fsplit_window): Include width of bitmap areas in
	window width.
	(window_internal_width): Subtract width of bitmap areas from
	total width.

1998-08-18  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c: Functions reordered for better readability.

	* dispnew.c (update_text_area): Handle glyphs with arbitrary
	lbearing.
	(update_window_tree): Parameter no_scrolling_p removed.
	(update_single_window): Ditto.

	* xterm.c (x_get_char_font_and_encoding): Renamed to
	x_get_char_face_and_encoding.

	* dispnew.c (update_text_area): Don't call get_glyph_overhangs
	if end of current row reached.

	* xterm.c (x_get_glyph_face_and_encoding): New.
	(x_get_glyph_overhangs): Call it.

	* xdisp.c (Qshow_trailing_whitespace): New.
	(Qtrailing_whitespace): New.
	(enum prop_handled): New.
	(struct props, it_props): New.
	(next_overlay_change): New.  Works like Fnext_overlay_change
	but doesn't use xmalloc.
	(handle_stop): Restructured.
	(face_before_or_after_it_pos): Case iteration over a string: fix
	handling of face before current position.

1998-08-16  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (adjust_glyph_matrix): Don't optimize matrix
	reallocation matrix if fonts_changed_p.
	(update_text_area): Handle glyphs with lbearing.

1998-08-14  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (struct props): New.
	(it_props): New.
	(compute_prop_info): New.
	(handle_stop): New.

	* textprop.c (validate_interval_range): Make it externally
	visible.

	* dispnew.c (direct_output_for_insert): Remove calls
	to compute_stop_pos.

	* dispextern.h (struct it): Remove check_charpos,
	next_overlay_pos.  Add what_changes.

1998-08-10  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (note_mouse_highlight): Set BEGV_BYTE, ZV_BYTE.

	* xfaces.c (Vx_unibyte_registry_and_encoding): Removed.  Use
	face_default_registry instead.

	* syntax.c (scan_sexps_forward): Set up syntax table before
	jumping to initial state label.

1998-08-09  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (check_matrix_invariants): Handle case of row end pos
	>= ZV specially.

1998-08-08  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (redisplay_window): Case cursor movement---if cursor
	ends up in partially visible row, try to scroll.  Case forced
	window start---handle windows not tall enough to show a single
	line.

	* window.h (struct window): Member dy renamed vscroll.

	* xterm.c (x_list_fonts): Re-activate suppression of scalable
	fonts.
	(x_draw_stretch_glyph_string): Set clipping if using GC that
	hasn't set it yet.

	* xdisp.c (redisplay_window): Case forced window start -
	don't let cursor end on partially visible row.  Use desired
	matrix to find a suitable PT if it doesn't appear.
	(decode_mode_spec): Merged with 20.2.97.
	(try_window_reusing_current_matrix): Give up if old or
	new display is vscrolled.
	(redisplay_window): Reset vscrolling if forced window start,
	or if recentering.

1998-08-06  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (realize_default_face): Use the fontset name instead of
	the alias for the family attribute of the default face because we
	can't easily determine a good alias from fontset-alias-alist.
	(face_fontset): Use Fquery_fontset to find the fontset.
	(font_list): Additional pattern parameter.
	(try_font_list): Ditto.
	(set_lface_from_font_name): Set face family from font foundry
	and family.
	(font_list): If family contains a hyphen, build pattern differently.

1998-08-05  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (free_realized_faces): Increment windows_or_buffers_-
	changed instead of setting the frame garbaged.

	* xfaces.c (lface_equal_p): Don't assume equal Lisp types for
	all attribute values.  This is wrong if values are unspecified,
	i.e. nil.

	* xdisp.c (try_window_id): Give up if window start changed.

	* xfaces.c (make_realized_face): Store registry as Lisp object.
	(load_face_font_or_fontset): Compute registry of a face
	differently.  Make it `eq' to Vx_unibyte_registry_and_encoding if
	possible.

	* dispextern.h (FACE_SUITABLE_FOR_CHARSET_P): Compare registries
	differently.

	* alloc.c (mark_face_cache): Mark the registry member of faces.

	* dispextern.h (struct face): Make registry a Lisp string.

1998-08-04  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_get_char_font_and_encoding): Additional parameter
	multibyte_p.  Handle unibyte text.
	(x_append_glyph): Set the multibyte_p flag of glyphs.
	(x_produce_image_glyph): Ditto.
	(x_append_stretch_glyph): Ditto.
	(x_produce_glyphs): Handle unibyte text like ASCII.

	* xdisp.c (push_it): Save the multibyte flag of an iterator on the
	stack.
	(pop_it): Restore it.
	(face_before_or_after_it_pos): Handle the case that the string or
	buffer is unibyte.
	(get_overlay_strings): Set the multibyte flag of the iterator if
	the new overlay string is multibyte.
	(get_glyph_property): Likewise.
	(get_next_display_element): Don't check for charset changes in
	unibyte text.
	(append_space): Compute face differently for unibyte text.
	(extend_face_to_end_of_line): Don't return quickly if face has
	stipple.

	* xfaces.c (load_face_font_or_fontset): Store registry and
	encoding of the font in the registry member of the face.
	(make_realized_face): Additional parameter `registry'.
	(free_realized_face): Free the registry of a realized face.
	(face_suitable_for_charset_p): Function form of the macro
	with the same name in uppercase.
	(lookup_face): Use Vx_unibyte_registry_and_encoding if charset < 0.
	(choose_face_font): New parameter unibyte_registry.
	(choose_face_fontset_font): Ditto.
	(realize_default_face): Remember the registry and encoding of
	the specified frame font in Vx_unibyte_registry_and_encoding.
	(face_at_buffer_position): Handle unibyte.
	(face_at_string_position): Likewise.
	(realize_face): New parameter unibyte_registry.  
	(compute_char_face): Handle the unibyte case.

	* dispextern.h (struct glyph): Add bit multibyte_p.
	(struct face): New member registry holding the registry and
	encoding of the X font of the face.
	(FACE_UNIBYTE_P): Value is non-zero if face is for unibye text.
	(enum face_id): Add BASIC_FACE_ID_SENTINEL.
	(FACE_SUITABLE_FOR_CHARSET_P): Handle charset < 0 meansing unibyte
	text.
	(struct iterator_stack_entry): Add multibyte_p.

	* xdisp.c (string_pos): Use string_char_to_byte.
	(char_charset): Removed.

1998-08-03  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_draw_image_glyph_string_foreground): Draw a
	rectangle for a block cursor over an image without a mask.
	(x_stretch_block_cursor): Added.  Non-zero means don't draw
	a block cursor over a stretch as wide as that stretch.
	(x_draw_stretch_glyph_string): Use it.
	(x_draw_hollow_cursor): Ditto.

	* minibuf.c (read_minibuf): Use minibuf_prompt instead of prompt.
	(read_minibuf): Add front-sticky text property for prompt.

	* xdisp.c (char_charset): Return charset of a character,
	depending on whether or not multi-byte characters are enabled.

	* xfaces.c (Fset_face_charset_registry): Removed.
	(x_charset_registry): Determine registry from charset plist.

1998-08-02  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (get_next_display_element): Don't check for charset
	changes if multi-byte characters are not enabled.
	
	* xdisp.c (echo_area_display): Use the flush function from the
	redisplay interface.  
	* keyboard.c (detect_input_pending_run_timers): Likewise.

	* dispextern.h (produce_*glyphs_hook): Removed.
	* term.c (produce_*glyphs): Ditto.
	(cursor_to): Remove pixel position parameters.

	* dispnew.c: Remove hooks for window-based redisplay, introduce
	a redisplay interface structure.

	* xterm.c (x_per_char_metric): Return default char metrics if per
	char metric exists but contains a zero width.  Adobe Courier seems
	to contain such characters.

	* xdisp.c (compute_line_metrics): Compute the width of rows
	without stopping at glyphs with zero width.

1998-08-01  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (display_mode_line): If nothing was displayed at all,
	display a space.
	(hscroll_window_tree): Don't subtract 1 from target point if equal
	to ZV and window is not the selected window.

	* dispnew.c (check_matrix_invariants): Remove check for window
	start at BEGV or after newline.  This happens in rare cases
	intentionally.

1998-07-31  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (x_charset_registry): Use STRING_BYTES.
	(syms_of_xfaces): Add Vface_default_registry.
	(x_charset_registry): Use it.

	* xdisp.c (run_window_scroll_functions): Run window scroll functions.
	(redisplay_window): Use it.

	* dispnew.c (update_text_area): Handle lbearing of deleted text
	by backing up one character.

1998-07-30  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (adjust_glyph_matrix): Use a different check to 
	decide to do nothing.

	* xfaces.c (face_at_string_position): Additional parameter
	mode_line_p.  If non-zero, merge with the mode line face
	instead of the default face.
	* dispextern.h (struct it): Add mode_line_p.
	* xdisp.c (init_iterator): Set it.
	(compute_face_in_string): Use it.
	(face_before_or_after_it_pos): Handle strings.
	(get_next_display_element): Don't look for relief end in C strings.
	(next_element_from_string): Deliver string position instead of
	buffer position.

	* xterm.c (x_flush): Flush X output buffer.
	(XTflash): Use it.

	* xfaces.c (lface_from_face_name): Renamed from lface_from_symbol.
	Allow strings as face names.

	* xfns.c (forall_images_in_image_cache): Check that frame is
	alive.

	* widget.c (EmacsFrameDestroy): Remove call to free_frame_faces;
	it's also called from x_destroy_window.  Since this function is
	called from X, freeing stuff allocated with xmalloc is dangerous
	here, anyway.

	* xfaces.c (free_realized_faces): Don't clear current matrices
	of a frame being destroyed.

	* frame.c (make_frame): Call set_window_buffer instead of 
	Fset_window_buffer.

	* window.c (set_window_buffer): Extracted from Fset_window_buffer,
	with an additional argument specifying whether or not hooks may
	be called.
	(Fset_window_buffer): Call it.

	* dispnew.c (clear_desired_matrices): Check that frame has
	a valid root window before clearing matrices in the window tree.
	(clear_current_matrices): Ditto.
	(clear_window_matrices): If GLYPH_DEBUG, check that hchild and
	vchild are valid windows if not nil.

	* xfaces.c (merge_face_vector_with_property): Allow :reverse-video
	for :inverse-video.
	(Finternal_set_lisp_face_attribute): Ditto.
	(Finternal_set_lisp_face_attribute_from_resource): Ditto.
	(Finternal_get_lisp_face_attribute): Ditto.
	(Finternal_lisp_face_attribute_values): Ditto.
	(syms_of_xfaces): Define the symbol `:reverse-video'.

	* xdisp.c (get_glyph_property): Renamed from
	fill_iterator_from_glyph_property.
	(next_element_from_buffer): Handle case	that no `glyph' property
	was found correctly.
	(display_line): Extend face to end of line only if we have faces.

1998-07-29  Gerd Moellmann  <gerd@gnu.org>

	* dispnew.c (Fshow_cursor): Renamed from blink_cursor.  Take
	additional window argument.

	* xdisp.c (reseat_at_previous_visible_line_start): Renamed from
	set_iterator_to_previous_visible_line_start.
	(reseat_at_next_visible_line_start): Likewise.
	(compute_stop_pos): Renamed from set_iterator_stop_pos.
	(face_before_or_after_it_pos): Renamed from get_face_at_it_pos.
	(compute_face_in_buffer): Renamed from
	compute_face_at_iterator_position.
	(compute_face_in_string): Renamed from
	compute_face_at_iterator_string_position.
	(get_space_width): Renamed from get_iterator_space_width.
	(next_overlay_string): Renamed from
	set_iterator_to_next_overlay_string.
	(get_overlay_strings): Renamed from
	get_overlay_strings_at_iterator_position.
	(restore_overlay_strings): Renamed from
	setup_overlay_strings_from_glyph_pos.
	(restore_dpvec): Renamed from setup_iterator_dpvec_from_glyph_pos.
	(init_from_display_pos): Renamed from init_iterator_from_glyph_pos.
	(init_to_row_start): Renamed from init_iterator_to_row_start.
	(init_to_row_end): Formerly init_iterator_to_next_row_start.

	* xterm.c: Merge with 20.2.97.
	(x_produce_glyphs): Use x_append_stretch_glyph for tabs.

	* dispextern.h (struct glyph): Replace text_pos position with
	simple charpos.

	* xdisp.c (this_line_start_pos): Use struct text_pos.
	(this_line_end_pos): Renamed from .*endpos; use struct text_pos.
	(enum move_it_result): Renamed from move_iterator_result.
	(string_pos_nchars_ahead): Compute text_pos in a string from a
	known text_pos plus a character delta.
	(string_pos): Compute text_pos in string from charpos.
	(c_string_pos): Likewise for a C string.
	(number_of_chars): Return number of characters in a possibly
	multi-byte C string.
	(check_it): Renamed from check_iterator.  Check that charpos and
	bytepos are in sync.
	(push_it): Renamed from save_iterator_settings.
	(pop_it): Renamed from restore_iterator_settings.
	(move_it_.*): Renamed from move_iterator_.*.
	(charset_at_position): Take charpos/bytepos into account.
	(back_to_previous_line_start): Set iterator to previous line start.
	(forward_to_next_line_start): Set iterator to next line start.
	(back_to_previous_visible_line_start): Renamed from 
	move_iterator_previous_visible_line_start.
	(set_iterator_to_next_visible_line_start): Handle charpos/bytepos.
	(get_face_at_it_pos): Renamed from get_face_from_cursor_pos.
	Handle charpos/bytepos.
	(compute_face_at_iterator_position): Handle charpos/bytepos.
	(compute_face_at_iterator_string_position): Likewise.
	(get_iterator_space_width): Likewise.
	(load_overlay_strings): Likewise.
	(get_overlay_strings_at_iterator_position): Likewise.
	(reseat_iterator): Take a text_pos position argument.
	(setup_iterator_overlay_strings_from_glyph_pos): Handle charpos/
	bytepos.
	(init_iterator): Take additional bytepos parameter.
	(reseat_iterator_to_string): Handle charpos/bytepos.
	(start_display): Take a text_pos parameter.  Handle charpos/bytepos.
	(next_element_from_string): Handle charpos/bytepos.
	(next_element_from_c_string): Likewise.
	(fill_iterator_from_glyph_property): Likewise.
	(next_element_from_buffer): Likewise.
	(set_iterator_to_next): Increment charpos and bytepos of an iterator.
	(move_iterator_in_display_line_to): Handle charpos/bytepos.
	(move_it_to): Likewise.
	(move_it_vertically_backward): Likewise.
	(move_it_vertically): Likewise.
	(move_it_by_lines): Likewise.
	(hscroll_window_tree): Likewise.
	(redisplay_internal): Likewise.
	(set_cursor_from_row): Likewise.
	(redisplay_window): Likewise.
	(try_window): Take a text_pos parameter.  Handle charpos/bytepos.
	(try_window_reusing_current_matrix): Handle charpos/bytepos.
	(get_first_unchanged_at_end_row): Compute and return delta_bytes.
	(try_window_id): Handle charpos/bytepos.
	(Ftrace_redisplay_toggle): Return Qnil.
	(get_overlay_arrow_glyph_row): Handle charpos/bytepos.
	(insert_left_trunc_glyphs): Likewise.

	* dispnew.c: `Merge' with 20.2.97 (it's really too different to
	do a real merge).
	(increment_glyph_matrix_buffer_positions): Add parameter delta_bytes.
	(increment_glyph_row_buffer_positions): Ditto.
	(copy_glyph_row_contents): Ditto.
	(check_matrix_invariants): Add additional checks for charpos/
	bytepos consistency.
	(direct_output_for_insert): Changed for charpos/bytepos.
	(buffer_posn_from_coords): Likewise.  Put code dealing with 
	`direction-reversed' in #if 0.

	* xterm.h: Merge with 20.2.97.
	
	* frame.h: Merge with 20.2.97.

	* window.h: Merge with 20.2.97.  Add window_end_bytepos.

	* dispextern.h (MATRIX_ROW_START_CHARPOS): Get charpos of a row
	start.
	(MATRIX_ROW_START_BYTEPOS): Likewise for the byte position.
	(MATRIX_ROW_END_CHARPOS): Likewise for the row end.
	(MATRIX_ROW_END_BYTEPOS): Likewise for the row end byte position.
	(struct it): Various members renamed from .*pos to .*charpos.
	(IT_CHARPOS): Access current buffer character position of an
	iterator.
	(IT_BYTEPOS): Access current buffer byte position of an iterator.
	(IT_STRING_CHARPOS): Access current string character position of
	an iterator.
	(IT_STRING_BYTEPOS): Access current string byte position of
	an iterator.
	(globally): Add function prototypes from 20.2.97.

	* everywhere: Use P_ instead of PROTO for function prototypes
	because everyone else seems to use P_.

	* dispextern.h (struct text_pos): Structure describing a charpos/
	bytepos position in text.
	(BYTEPOS): Access the byte position part of a text_pos.
	(CHARPOS): Likewise for the character position.
	(SET_TEXT_POS): Set a text_pos from a character and byte position.
	(INC_TEXT_POS, DEC_TEXT_POS): Increment/decrement a text position.
	(SET_TEXT_POS_FROM_MARKER): Set a text_pos from a marker.
	(SET_MARKER_FROM_TEXT_POS): Set a marker from a text_pos.
	(TEXT_POS_EQUAL_P): Compare two text_pos structures for equality.
	(struct display_pos): Renamed from glyph_pos. Use struct text_pos
	for buffer and string positions.
	(struct glyph): Use text_pos.
	(struct it): Renamed from display_iterator.  Use text_pos.

1998-07-23  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (x_kill_gs_process): Get image colors from XImage of a
	pixmap.

1998-07-21  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (struct glyph_row): New flag indicate_zv_line_p.
	* xterm.c (x_draw_row_bitmaps): Use it.
	* dispnew.c (row_equal_p): Ditto.
	(update_window_line): Ditto.

	* xfns.c (prepare_image_for_display): Don't set loading_failed_p
	flag of images.

	* dispextern.h (struct image): Removed member loading_failed_p.
	It's probably better to have the chance to try to load an image
	again.

1998-07-20  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_draw_bitmap): Draw bitmap for empty lines ending
	at ZV if `indicate-zv-lines' is non-nil.
	(x_draw_row_bitmaps): Compute bitmap for `indicate-zv-lines'.

	* dispnew.c (row_equal_p): Compare displays_text_p and
	ends_at_zv_p flags of rows.
	(update_window_line): Ditto.

	* buffer.h (struct buffer): New member indicate_zv_lines.

	* buffer.c (init_buffer_once): Add default for `indicate-zv-lines'.
	(init_buffer_once): New variable `default-indicate-zv-lines'.
	(syms_of_buffer): New buffer-local varianle `indicate-zv-lines'.

	* xdisp.c (redisplay_window): Don't try moving the cursor
	if current glyph row w->last_cursor.vpos isn't enabled.

	* xterm.c (bitmap_type): Add ZV_LINE_BITMAP.

	* window.c (Fset_window_vscroll): Allow only negative scroll
	values.  Others don't seem to make sense, and this way it's easy
	to restore a vscroll of zero.

	* xterm.c (x_inverted_image_mask): Check that pixmap could be
	allocated.
	(x_draw_image_glyph_string_background): Don't clip if pixmap
	could not be created.

	* xfns.c (xbm_load_image_from_file): Check that pixmap could
	be created.
	(xbm_load): Ditto.
	(gs_load): Ditto.

	* xterm.c (x_get_glyph_overhangs): Take image and stretch
	glyphs into account.

	* xfaces.c (realize_default_face): Don't set font family of
	the default face from the fontset alias name for `fontset-startup'.

	* xfns.c (gs_load): Pass frame's pixel foreground and background
	color to the Lisp loader.

1998-07-19  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (tiff_image_p, tiff_load): Support TIFF images via
	libtiff34.

	* configure.in (--with-tiff, HAVE_TIFF): Added.

	* config.in (HAVE_TIFF): Added.

	* Makefile.in (LIBTIFF): Added.

	* xfns.c (jpeg_image_p, jpeg_load): Support JPEG images.

	* Makefile.in (LIBJPEG): Added.

	* xfns.c (resource_types): Enumerators renamed to RES_TYPE_NUMBER,
	RES_TYPE_BOOLEAN etc. because of conflict of `boolean' with
	jpeglib.h.

	* configure.in (HAVE_JPEG, --with-jpeg): Added.  On systems 
	where the library is installed in /usr/local/lib, e.g. FreeBSD,
	configure must be run with `--x-includes=/usr/X11R6/include:
	/usr/local/include --x-libraries=/usr/X11R6/lib:/usr/local/lib'.

1998-07-18  Gerd Moellmann  <gerd@gnu.org>

	* config.in (HAVE_JPEG): Added.

	* xfns.c (ct_init): Initialize color table used to map RGB colors
	from images to X pixel colors.
	(ct_free): Free color table.
	(ct_lookup): Look an RGB color up.
	(ct_allocated_colors): Get vector of allocated colors.
	(pbm_image_p): Test if image specification is a valid PPM 
	image specification.
	(pbm_scan_number): Scan a decimal ASCII number from a file.
	(pbm_load): Load a PPM image.

	* window.c (Fset_window_vscroll): Adjust glyph matrix if
	necessary.  Take canonical character units as parameter.
	(Fwindow_vscroll): Return canonical character units.

	* dispnew.c (allocate_matrices_for_window_redisplay): Add negative
	w->dy to display height for which glyph rows must be allocated.

1998-07-17  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (face_at_string_position): Merge in region face
	so that it won't overwrite the font in the region.
	(face_at_buffer_position): Ditto.
	(realize_basic_faces): Don't realize region face.

	* dispextern.h (enum face_id): REGION_FACE_ID removed.

	* xterm.c (x_set_glyph_string_background_width): Don't let
	cursor face extend to end of line.

	* xdisp.c (append_space): If adding space of default face,
	make sure glyph ist produced with right face.

	* xterm.c (x_clear_glyph_string_rect): Draw a rectangle in the
	background color of a glyph string.
	(x_draw_glyph_string_background): Call it.
	(x_draw_glyph_string_bg_rect): Ditto.
	(x_draw_stretch_glyph_string): Ditto.

1998-07-15  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (init_iterator): Initialize it->current_y to the
	window's vscroll w->dy.

	* window.c (Fwindow_vscroll): Return number of pixels window
	is vscrolled smoothly.
	(Fset_window_vscroll): Set the number.

	* xdisp.c (move_iterator_to): Recognize case MOVE_TO_POS and
	to_pos in truncated part of a line.

1998-07-14  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (move_iterator_in_display_line_to): If very first glyph
	doesn't fit on the line, truncate it, despite truncate_lines nil.
	(display_line): Ditto.

	* xfns.c: Experimental support for Ghostscript images.

	* xterm.c (x_term_init): Initialize new atoms DONE and PAGE.
	(XTread_socket): React on events from Ghostscript.
	(expose_frame): If width or height are zero, redraw entire frame.
	(XTread_socket): Call expose_frame after receiving event from
	Ghostscript.

	* xterm.h (struct x_display_info): Add atoms DONE and PAGE
	for Ghostscript support.

	* xdisp.c (redisplay_internal): Return quickly if called
	recursively.

	* alloc.c (NSTATICS): Increased to 1024.

1998-07-08  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_append_stretch_glyph): Append a stretch glyph to an
	iterator's glyph row.
	(x_produce_stretch_glyph): Call it.
	(x_produce_glyphs): Handle `space-width' property; call
	x_append_stretch_glyph.

	* xdisp.c (syms_of_xdisp): Add symbol `space-width' used as a text
	property.
	(get_iterator_space_width): Determine value of `space-width'
	property at iterator's position.
	(reseat_iterator): Call it.
	(next_element_from_string): Ditto.
	(next_element_from_buffer): Ditto.
	(init_iterator): Initialize space_width of iterator.
	(redisplay_internal): Don't goto end_of_redisplay if PT hasn't
	moved, but cursor blinks.
	(redisplay_internal): Set w->last_cursor_off_p after update.

	* dispextern.h (enum iterator_prop_idx): Add SPACE_WIDTH_PROP_IDX.
	(struct display_iterator): Add new member space_width.

	* window.h (struct window): Add last_cursor_off_p.

1998-07-07  Gerd Moellmann  <gerd@gnu.org>

	* Saved.

	* window.c (Fpos_visible_in_window_p): Case window not up to
	date---return nil if iterator hasn't reached position.

1998-07-06  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (text_outside_line_unchanged_p): Fix case that
	overlays have changed.
	(redisplay_window): Case cursor movement.  Don't try it if
	last_cursor.vpos is out of range.

	* xdisp.c (set_cursor_from_row): Set this_line_.* variables.  This
	way, the display optimization for the line containing the cursor
	is used more frequently, esp. when we have a blinking cursor.
	(display_line): Don't set this_line_.* variables.

	* xterm.c (x_redraw_cursor): Removed.
	(x_display_and_set_cursor): Set cursor type depending on
	cursor_off_p flag of window.

	* dispnew.c (redraw_cursor_hook): Removed.
	(Fblink_cursor): Additional parameter on_p to set the cursor_off_p
	member of the selected window.

	* xfaces.c (Fface_font): Added for compatibility with 20.2.

	* xterm.c (x_y_to_hpos_vpos): Return null if not over text.
	Return glyph area under x/y.
	(note_mouse_highlight): Use x_y_to_hpos_vpos in its new form.

	* keyboard.c (detect_input_pending_run_timers): Call gobble_input
	after redisplaying.

1998-07-05  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (text_outside_line_unchanged_p): Test if changes
	are all outside of a line of text.
	(redisplay_internal): Use it.

1998-06-30  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (next_element_from_buffer): After skipping over
	invisible text, look for the `glyph' property.
	(set_iterator_stop_pos): Ignore check positions in front
	of an iterator's current position.

	* xterm.c (show_mouse_face): Don't act on rows that don't exist
	anymore or which are marked as not having valid contents.

	* xfaces.c (Finternal_set_lisp_face_attribute): Don't free
	realized faces if new attribute value is equal to old value.

1998-06-29  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (Finternal_make_lisp_face): Increment
	lface_id_to_name_size when lface_id_to_name is reallocated.

1998-06-27  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (set_iterator_stop_pos): Compute initial stop_pos
	as minimum of endpos and overlay_pos.
	(load_overlay_strings): Set next_overlay_pos of iterator to
	-1 if we don't have to check for more overlay strings.

1998-05-09  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (set_iterator_to_next_visible_line_start): Don't
	do anything if iterator is at ZV because scan_buffer doesn't
	work otherwise.

	* xterm.c (x_encode_char): Inline it.
	(x_get_char_font_and_encoding): Simplified.
	(x_per_char_metric): Inline it.

	* xterm.c (x_draw_glyph_string_relief): Use clipping.

	* xdisp.c (get_next_display_element): Check for end of relief
	face moved here from next_element_from_buffer.

	* xterm.c (x_produce_image_glyph): Add relief thickness.
	(x_produce_stretch_glyph): Ditto.

1998-05-08  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (fill_iterator_from_glyph_property): Handle glyph
	property value (space :width WIDTH :height HEIGHT :ascent ASCENT).

	* xterm.c (x_produce_stretch_glyph): Produce a stretch glyph
	from a glyph property.
	(x_produce_glyphs): Use it.

	* xdisp.c (set_iterator_to_next): Handle next_element_from_stretch.

	* xterm.c (x_produce_image_glyph): Add to current_x only if 
	in text area.
	(x_produce_glyphs): Ditto.

	* xdisp.c (display_line): Compute row height from glyphs in 
	marginal areas.

	* xterm.c (x_draw_image_glyph_string_background): Draw 
	background of an image glyph string.
	(x_draw_glyph_string_bg_rect): Draw a rectangular region of 
	the background of a glyph string.
	(x_draw_image_glyph_string_foreground): Draw the foreground of
	an image glyph string.
	(x_inverted_image_mask): Return the inverted mask of an image.

	* xfns.c (x_draw_image): Removed.

	* dispextern.h (struct image_type): Remove drawing function.

	* xfaces.c (load_face_colors): Swap colors if face is inverse.

	* xdisp.c (get_next_display_element): In marginal areas, translate
	newlines, tabs, etc. like normal control characters.

	* xfaces.c (Fface_color_supported_p): Transpose parameters frame
	and color.
	(free_realized_faces): Set frame garbaged.

	* xfaces.c (syms_of_xfaces): Add defsubr for
	internal-lisp-face-attribute-values.

1998-05-07  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_produce_image_glyph): Don't add glyph if area is
	full.
	(x_produce_image_glyph): Set IT->nglyphs to 1.
	(x_draw_image_glyph_string): Use inverted mask to draw background.

	* dispextern.h (struct image_type): Additional clipping rect
	parameters for drawing functions.

	* xterm.c (x_get_glyph_string_clip_rect): Get clip rect for 
	a glyph string.
	(x_draw_image_glyph_string): Use it and pass the rect to the
	image drawing function.

	* xdisp.c (fill_iterator_from_glyph_property): Use position of
	first character with `glyph' property as image position.  Set
	iterator back to that position as long as the image hasn't been
	consumed with set_iterator_to_next.
	(set_cursor_from_row): Accept when glyph with given position is
	not found in the row.  Set cursor x to end of line in that case,
	so that we can hscroll.
	(redisplay_internal): Correct computation of delta by which
	positions have changed in redisplay optimization for cursor
	row of selected window.

	* xdisp.c (display_line): Remove start_pos.
	(display_line): Fix bug preventing display optimization for 
	cursor line of selected window.
	(next_element_from_buffer): Avoid XSETBUFFER, use it->w->buffer
	instead.

	* dispnew.c (update_text_area): Use GLYPH_EQUAL_P.
	(update_text_area): Take glyph pixel width into account
	when trying to find a resync point.
	(row_equal_p): Compare glyphs in all areas.

1998-05-06  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_produce_glyphs): Don't add glyph if area is full.

	* dispextern.h (struct glyph_row): Use unsigned hash value.

	* xdisp.c (display_line): Simplified and made faster by setting
	the cursor with set_cursor_from_row.
	(set_cursor_from_row): Handle rows of desired matrix.

1998-05-05  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (set_cursor_from_row): Don't put cursor on glyphs
	with type != CHAR_GLYPH.
	(fill_iterator_from_glyph_property): Return void.  Set
	method to next_element_from_image.
	(next_element_from_image): Dummy function for delivering a
	single image id.
	(set_iterator_to_next): Add method next_element_from_image.
	(redisplay_window): When recentering, and cursor vpos is -1
	after display, assume middle of window is in first line displayed
	in window, and display again.
	(fill_iterator_from_glyph_property): Assign image glyph 
	the position of the first character having the glyph property.

	* dispextern.h (IMAGE_ASCENT): Compute ascent of image.
	* xfns.c (x_draw_image): Use it.
	* xterm.c (x_produce_image_glyph): Use it.

	* xterm.c (x_produce_image_glyph): Set iterator's pixel_width.

	* Makefile.in: Extraneous #define of LIBXPM removed.

	* xterm.c (x_produce_glyphs): Produce a STRETCH_GLYPH for tabs.
	(x_fill_stretch_glyph_string): Fill a glyph string from a 
	stretch glyph.
	(x_compute_glyph_string_overhangs): Compute overhangs only
	for text glyph strings.
	(x_draw_stretch_glyph_string): Draw a stretch glyph string.
	(x_draw_glyph_string): Call it.

	* dispextern.h (glyph_type): Add STRETCH_GLYPH.
	(struct glyph): Add sub-structure for stretchable glyphs.
	(GLYPH_EQUAL_P): Compare glyph type and u.val.

	* xdisp.c (get_overlay_arrow_glyph_row): Put face code into
	#ifdef HAVE_FACES.

	* xterm.c (x_produce_glyphs): Use ASCII face for spaces of a TAB.

	* xdisp.c (fill_iterator_from_glyph_property): Renamed from
	setup_iterator_from_glyph_property.  Don't do it for terminal
	frames.

	* xterm.c (x_produce_image_glyph): Produce glyph for image
	that can't be loaded.

	* xfns.c (lookup_image): If image can't be loaded, set its
	width and height so that we can draw a rectangle.
	(x_draw_image): Draw a rectangle for images that don't have
	a pixmap.
	(make_image): Set hash value.
	(image_spec_equal_p): Use image_spec_value.

	* xterm.c (expose_frame): Don't try to redraw if basic faces
	haven't benn realized yet.
	(x_draw_image_glyph_string): Fill background only if image 
	is not as tall as row.

1998-05-04  Gerd Moellmann  <gerd@gnu.org>

	* Makefile.in (LIBXPM): If not already defined, define to -lXpm.
	(LIBX)[HAVE_X11]: Add LIBXPM.

	* xfns.c (xpm_image_p): Implementation of image type functions
	for XPM.
	(xpm_load): Ditto.

	* dispextern.h (struct image): Add mask pixmap for XPM.

	* xfns.c (x_draw_image): Handle images with masks.

	* configure.in: --with-xpm added.  Code detecting -lXpm added.

	* config.in: Add HAVE_XPM.

	* xfns.c (xbm_draw): Removed.
	(x_draw_image): Default implementation for drawing images.
	(xbm_keyword_index): Remove XBM_DEPTH.
	(xbm_format): Remove `:depth'.
	(xbm_image_spec_from_file): Removed to reduce consing.
	(xbm_load_image_from_file): Added for the same reason. 

	* xterm.c (x_fill_image_glyph_string): Don't set ybase of 
	glyph string.
	(x_draw_image_glyph_string): Pass ybase to image draw function.

	* xfns.c (make_image): Set default baseline.

	* xterm.c (x_produce_image_glyph): Compute ascent of image
	from its height and baseline percentage.

	* xfns.c (xbm_keyword_index): Add XBM_BASELINE.
	(xbm_format): Add description for `:baseline'.
	(xbm_image_spec_from_file): Add keywords from original spec to
	result.
	(xbm_load): Set baseline of image.
	(xbm_image_p): Check range for baseline.

	* dispextern.h (struct image): Add member baseline.

	* xdisp.c (dump_glyph_matrix): Handle image glyphs.

	* term.c (produce_glyphs): Change assertion to allow DISP_IMAGE.

	* xdisp.c (get_next_display_element): Do character translations
	only if delivering characters.

1998-05-03  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (ITERATOR_AT_END_OF_LINE_P): Test for 
	DISP_CHARACTER.

	* xterm.c (x_produce_image_glyph): Poduce image glyphs.
	(x_produce_glyphs): Call x_produce_glyphs for DISP_IMAGE.

1998-05-02  Gerd Moellmann  <gerd@gnu.org>

	* xfns.c (prepare_image_for_display): Set image timestamp.
	(clear_image_cache): Clear images if image's timestamp +
	Vimage_eviction_seconds is > now.
	(syms_of_xfns): New variables image-eviction-seconds, and
	image-types.
	(add_image_format): Add to image-types.
	(xbm_load): Support new image spec format.
	(x_alloc_image_color): Allocate a color for an image.

	* dispextern.h (struct image): Add timestamp.

	* xfns.c (xbm_image_p): Allow bool-vectors, vectors of strings and
	vectors of bool-vectors.
	(xbm_lisp_object_from_file): Build new format image spec.

1998-05-01  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (init_frame_faces): Initialize image cache.
	(free_frame_faces): Free it.

	* xterm.c (x_delete_display): Don't free image cache.

	* emacs.c (main): Call init_xfns.

1998-04-30  Gerd Moellmann  <gerd@gnu.org>

	* alloc.c (mark_object): Mark objects in image cache.

	* xfns.c (x_set_internal_border_width): Correct call to 
	widget_store_internal_border_width.

	* widget.c (widget_store_internal_border): Return void.

	* xfns.c (x_destroy_bitmap): Use xfree instead of free.  Return
	void.
	(init_x_parm_symbols): Return void.
	(x_report_frame_params): Ditto.
	(x_set_border_pixel): Ditto.
	(syms_of_xfns): Ditto.
	(x_destroy_all_bitmaps): Use xfree instead of free.

	* xterm.h (FRAME_X_IMAGE_CACHE): Access the image cache of a frame.

	* xterm.c (x_term_init): Initialize image_cache of display info.
	(x_delete_display): Free image cache.

	* xterm.h (struct x_display_info): Add image_cache.

	* xfns.c (make_image_cache): Allocate a new image cache.
	(free_image_cache): Free an image cache.
	(make_image): Allocate an image.
	(free_image): Free an image.

	* dispextern.h (struct image): Structure describing an image.
	(struct image_cache): Structure describing an image cache.

1998-04-29  Gerd Moellmann  <gerd@gnu.org>

	* xdisp.c (check_iterator_glyph_property): Return int.  Value is
	non-zero if iterator is filled with something to return.
	(next_element_from_buffer): Immediately return if
	setup_iterator_from_glyph_prop has filled iterator with pixmap.
	(next_element_from_string): Likewise.

	* xfaces.c (load_pixmap): Allow to pass null for W_PTR and H_PTR.

	* dispextern.h (struct glyph): Add pixmap_id.
	(display_element_type): Add DISP_PIXMAP.

	* xmenu.c (popup_get_selection): Use xmalloc/xfree instead of
	malloc/free.

	* xfaces.c (clear_font_table): Free fonts not used by fontsets.
	(clear_face_cache): Call it.

	* xterm.c (x_query_font): Don't look at empty font table slots.
	(x_compute_min_glyph_bounds): Likewise.
	(x_term_init): Initialize font_table to null.
	(x_load_font): Change allocation of font_info structures so
	that it is possible to free fonts.

	* xfns.c (Fx_close_connection): Use xfree instead of free. 
	Only free fonts from filled font table entries.

	* xfaces.c (best_matching_font): Support use of scalable fonts.
	(Fface_scalable_fonts_mode): Toggle use of scalable fonts.

	* xterm.h (struct x_display_info): Remove screen_dpi, add resx
	and resy.
	* xterm.c (x_term_init): Compute resx and resy.

	* xfaces.c (split_font_name): Don't reject scalable fonts.

	* xterm.c (x_list_fonts): Set code exclusing scalable fonts 
	in #if 0.

	* xfaces.c (xlfd_point_size): Return 0 for fonts whose real
	point size cannot be determined.

	* xterm.h (FRAME_SMALLEST_CHAR_WIDTH): Return smallest character
	width over all fonts on a frame.
	(FRAME_SMALLEST_FONT_HEIGHT): Likewise for font height.
	* dispnew.c (adjust_frame_glyphs_for_window_redisplay): Use these
	macros.

	* xterm.c (x_font_min_bounds): Moved here from xfaces.c.
	(x_compute_min_char_bounds): Formerly min_char_bounds in xfaces.c.
	(x_load_font): Use x_compute_min_char_bounds.

	* xterm.h (struct x_display_info): New members smallest_char_width
	and smallest_font_height.

1998-04-28  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (PREPARE_FACE_FOR_DISPLAY): Call function with
	the same name if GC of face is zero.

	* dispextern.h (struct face): Member non_ascii_gc removed.

	* xterm.c (x_get_char_font_and_encoding): Return face's font
	for characters < 0177 in default face.  Prepare face for 
	display before returning it.
	(x_produce_glyphs): Use it->charset.
	(x_get_char_font_and_encoding): Simplified.
	(x_encode_char): Remove parameter `font'.

	* xfaces.c (choose_face_font): If registry from charset symbol
	doesn't contain a `-', make it a pattern by appending "*-*".

	* xdisp.c (check_iterator_glyph_property): Adjust limit for
	glyph_check_pos computation to character boundary.

1998-04-27  Gerd Moellmann  <gerd@gnu.org>

	* fontset.h (FONT_INFO_FROM_ID): Return null if ID is invalid.

	* xfaces.c (ascii_face_of_lisp_face): Get the id of the realized
	ASCII face for a given Lisp face id.

	* xdisp.c (set_iterator_stop_pos): Take glyph_check_pos into
	account.
	(reseat_iterator): Set glyph_check_pos. Handle case where 
	new position is < original position.
	(check_iterator_glyph_property): Handle glyph property in strings.
	(next_element_from_string): Call above function.
	(next_element_from_display_vector): Handle faces in glyphs.
	(get_next_display_element): Set face_id of glyphs for
	control chars to zero.

	* Makefile.in (term.o): Add dependency on dispextern.h.

	* xdisp.c (syms_of_xdisp): Add symbol `glyph'.
	(display_line): Handle marginal areas.
	(move_iterator_in_display_line_to): Likewise.

	* xfaces.c (Finternal_make_lisp_face): Assign Lisp faces an id.

	* xfaces.c (face_at_buffer_position): Don't merge with nil
	text property.
	(face_at_string_position): Ditto.

	* dispextern.h (struct display_iterator): Use a stack of saved
	values instead of saving check positions etc. individually.

	* xdisp.c (set_iterator_to_next): If end of Lisp string reached,
	maybe pop the iterator's stack.
	(save_iterator_settings): Push a value on iterator's stack.
	(get_overlay_strings_at_iterator_position): Use it.
	(restore_iterator_settings): Pop the stack.
	(set_iterator_to_next_overlay_string): Use it.

	* xfaces.c (try_font_list): Use alternative font families.

1998-04-26  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (Fset_face_font_sort_order): Set the order in which
	font selection matches fonts.
	(Fface_font_sort_order): Return the font sort order.
	(best_matching_font): Find best matching font based on sort order.
	(cmp_font_names): Sort by given sort order.

	* dispextern.h (struct display_iterator): New member faces_p.
	* xdisp.c (init_iterator): Initialize it->faces_p.
	(compute_face_at_iterator_string_position): Use it.
	(compute_face_at_iterator_position): Use it.
	(init_iterator): Use it.
	(display_mode_line): Ditto.

	* xdisp.c (get_next_display_element): Put code choosing a face
	when the charset changes in #ifdef HAVE_FACES.

	* dispextern.h (FACE_FOR_CHARSET): Replacement for function 
	lookup_face_for_charset.

	* xfaces.c (free_font_names): Renamed from free_split_font_names.
	(free_all_realized_faces): Renamed from remove_all_realized_faces.

1998-04-25  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (best_matching_font): Return the name of the best
	matching font in an array of font_name structures.
	(choose_face_font): Use it.
	(choose_face_fontset_font): Use it.
	(find_best_weight_font): If final font found has same weight as
	the font we started with, return the original font because it is a
	better match for the resolution of the display.
	(find_best_slant_font): Likewise.
	(merge_face_vector_with_property): Check more invalid attribute
	values.
	(lface_suitable_for_charset_p): Replaced by a macro with the same
	name in upper-case.

1998-04-24  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (struct face): Member
	fontset_chosen_for_realization_p removed.

	* xfaces.c (cache_face): If face->fontset >= 0, add face to the
	end of the collision list, so that we find more specific faces
	first.
	(lookup_face_for_charset): Look up a new face if face->fontset >=
	0, and charset != CHARSET_COMPOSITION.

	* xfaces.c (split_font_name): Return zero if point size of font
	couldn't be computed.
	(realize_default_face): Use ASCII font of a fontset to determine
	font-related attributes of the default face.
	(face_fontset): Return fontset id for face family.
	(font_list): Additional parameter font_pattern.  If non-nil,
	return fonts matching that pattern.

1998-04-23  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (choose_face_fontset): If new fontset cannot be
	constructed, or fontset name cannot be split, return the id of the
	standard fontset.

	* xterm.c (XTframe_up_to_date): Check that frame is an X frame.
	When Emacs starts, it may be called for the initial frame which
	isn't an X frame.

	* dispextern.h (struct face): New members foreground_defaulted_p,
	background_defaulted_p.
	(struct face): Members `mask' and `cache' removed.

	* xfaces.c (load_color): Set them.
	(free_face_colors): Check them.
	(xlfd_point_size): Return -1 if resolution or point size of 
	font unknown.

	* xfaces.c (free_font): Removed.
	(load_face_font_or_fontset): Renamed from load_font.
	(load_face_font_or_fontset): Use message2 instead of signalling.
	(load_color): Likewise.
	(load_pixmap): Likewise.

	* xterm.h (struct x_display_info): Add screen_dpi.
	* xterm.c (x_term_init): Initialize it.
	* xfaces.c (xlfd_point_size): Use it.
	(split_font_name): Compute numeric XLFD_RESY.
	(cmp_font_names): Make fonts with an y-resolution more 
	similar to that of the frame appear first in the result.

	* xfaces.c (cache_face): If fontset_chosen_for_realization_p
	is set for the face to cache, add it to the end of the collision
	list.
	(try_font_list): If fonts for given family and registry cannot
	be found, first try to keep the registry, and choose a different
	family.
	(choose_face_font): Allow nfonts == 0.
	(try_font_list): Give up if no font matches given registry.

1998-04-22  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_get_char_font_and_encoding): Get font_info from
	font info id of the face.

	* xfaces.c (load_font): Set font_info_id.
	(realize_face): Ditto.

	* dispextern.h (struct face): Change member font_info to
	font_info_id.

	* fontset.h (FONT_INFO_ID): Build an ID from a font_info pointer.
	(FONT_INFO_FROM_ID): Get a font_info pointer from an ID.

	* xdisp.c (extend_face_to_end_of_line): If IT's current charset
	isn't ASCII, get the ASCII face before adding a space.
	(append_space): Likewise.
	(insert_left_trunc_glyphs): Initialize truncate_it's charset
	to -1 so that it will compute the right face for the truncation
	glyphs.

	* xfaces.c (realize_face): Set
	face->fontset_chosen_for_realization_p.
	(lookup_face_for_charset): If fontset wasn't specified originally
	and new charset != CHARSET_COMPOSITION, get a new face for that
	charset.

	* dispextern.h (struct face): New member
	fontset_chosen_for_realization_p_specified_p.  Set to 1 when
	realize_face has chosen a fontset to display composite characters
	for a Lisp face not specifying a fontset.

	* xdisp.c (extend_face_to_end_of_line): Move tests for default
	face and line already filled here.  Don't do anything if current
	face hasn't a relief or has a background equal to the frame
	background.

	* xfaces.c (split_font_name): Additional parameter numeric_p.
	Don't compute numeric values if it is non-zero.
	(choose_face_fontset): Call split_font_name with numeric_p == 0.
	(choose_face_fontset): Print a message if fontset contains a 
	font whose name cannot be split into fields.

1998-04-21  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (try_font_list): Try to load a list of fonts, 
	possibly using less restrictive patterns.
	(choose_face_font): Use it.

	* xterm.c (x_get_char_font_and_encoding): For charset !=
	CHARSET_ASCII use font_info of face if face hasn't a fontset set.

	* dispextern.h (struct face): New member font_info.

	* xfaces.c (load_font): Use FS_LOAD_FONT to load fonts for faces
	specifying a fontset as well as those not having a fontset.
	(free_font): Make it empty.
	(realize_face): Use changed load_font.

	* xterm.c (x_get_char_font_and_encoding): If face doesn't
	fit for charset, get the right one.

	* xfaces.c (load_font): Take frame and name parameter, return
	font.
	(free_font): Likewise.
	(split_font_name): Compute numeric values for height, swidth etc.
	(cmp_font_names): Use them.
	(find_best_width_font): Ditto.
	(find_best_height_font): Ditto.
	(find_best_weight_font): Ditto.
	(find_best_slant_font): Ditto.
	(lface_hash): Add weight, slant, swidth and relief to hash value.
	(lface_equal_p): Make it faster.
	(lface_from_symbol): Use assq_no_quit.
	(Fnote_default_face_changed): Removed.
	(cmp_font_names): Use strcmp instead of xstricmp.
	(face_charset_registries): Removed.

1998-04-20  Gerd Moellmann  <gerd@gnu.org>

	* frame.h (CHECK_FRAME): Give this macro a statement form.
	(CHECK_LIVE_FRAME): Ditto.

	* xfaces.c (find_best_width_font): Find the best matching font
	for a given width.
	(find_best_height_font): Likewise for height.
	(find_best_weight_font): Likewise for weight.
	(find_best_slant_font): Likewise for slant.
	(choose_face_font): Use them.
	(get_lface_attributes): Always return frame-local face attrs.
	(Finternal_merge_in_global_face): Merge local face with 
	global face attributes.

	* xfaces.c (check_lface_attrs, check_lface): Check consistency of
	Lisp face attributes.

1998-04-19  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (Finternal_set_lisp_face_attribute): Add :bold
	and :italic for compatibility.
	(Finternal_set_lisp_face_attribute_from_resource): Handle
	:bold and :italic.  Handle boolean resource values for 
	:underline and :italic.

	* xfns.c (display_x_get_resource): Make it externally visible.

	* xfaces.c (lface_from_symbol): Take a frame as parameter.
	If that frame is non-null, return the frame-local face.
	(Finternal_make_lisp_face): Additional frame argument.
	(lface_attributes): Get face attributes from global and frame-local
	definitions.
	(Finternal_lisp_face_equal_p): Additional frame argument.
	(merge_lisp_face_vector_with_property): Ditto.
	(Frealize_basic_faces): Removed.
	(Finternal_get_lisp_face_attribute): Additional frame argument.
	(Finternal_lisp_face_p): Ditto.
	(load_color) [MSDOS]: Removed because it isn't clear how
	to do this for MS-DOS.

	* xfaces.c (lface_from_symbol): Get global face definition
	from face-global-alist.

	* xfaces.c (Finternal_set_lisp_face_attribute): Allow `t'
	as values for :underline and :inverse-video.
	(Finternal_set_lisp_face_attribute): Allow nil values.

1998-04-17  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (Finternal_make_lisp_face): Return Lisp face vector.

	* xfaces.c (syms_of_xfaces): Add Vall_faces.
	(Finternal_make_lisp_face): Add new face to Vall_faces.

	* xdisp.c (echo_area_display): Remove code recomputing faces.
	(redisplay_internal): Ditto.
	(init_iterator): Do it here.

	* xfaces.c (choose_face_font): Check that swidth doesn't change
	for subusequent attributes.
	(xlfd_point_size): Return int.

	* xdisp.c (redisplay_internal, echo_area-display): If realized
	faces have been cleared, call recompute_basic_faces.

	* xfaces.c (recompute_basic_faces): Free realized faces.  Reset
	face_attributes_changed_p.
	(remove_all_realized_faces): Remove all realized faces on 
	all frames.
	(Finternal_set_lisp_face_attribute): Call remove_all_realized_faces.

	* xdisp.c (redisplay_internal): If face attributes have been
	changed since the last redisplay, recompute basic faces.
	(echo_area_display): Ditto.

	* xfaces.c (clear_face_gcs): Renamed from clear_realized_face_cache.

	* xfaces.c (min_char_bounds): If face cache not yet present,
	don't try to get font dimensions from faces.

	* xterm.c (x_frame_mode_line_height): If face cache not present
	set, return default height.

	* alloc.c (mark_face_cache): Check for null faces.  Correct
	index bug.

	* dispextern.h (struct face): Renamed from struct rface.  Member
	underline renamed underline_p.  Make it a bit-field.

	* xfaces.c (init_frame_faces): Allocate face cache.
	(free_frame_faces): Free face cache.
	(recompute_basic_faces): Realize basic faces only if face cache is
	allocated, i.e. after init_frame_faces has been called.

	* frame.c (make_frame): Initialze face cache with null.

	* xfaces.c (same_size_fonts): Removed.

	* xterm.c (x_set_glyph_string_gc): Add post-condition 
	s->gc != 0.
	(x_set_mouse_face_gc): Ditto.
	(x_set_mode_line_face_gc): Ditto.

	* xfaces.c (realize_default_face): Return int.  Value is 
	zero if frame params don't contain enough information to 
	realize the default face.
	(realize_basic_faces): Ditto.
	(init_frame_faces): Realize basic faces.

	* xfns.c (x_set_font): First store real font name in frame
	parameters, then call recompute_basic_faces.

	* xfaces.c (recompute_basic_faces): Call realize_basic_faces.

1998-04-16  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (syms_of_xfaces): Correct calls to defsubr.

	* xfns.c (Fx_face_fixed_p): Removed.
	(Fx_list_fonts): Moved to xfaces.c.

	* xfaces.c (compute_face_at_buffer_pos): Renamed to
	face_at_buffer_position.  Parameter charset removed; always
	compute face for CHARSET_ASCII.
	(face_at_string_position): Renamed from
	compute_face_at_string_pos. Parameter charset removed; always
	compute for CHARSET_ASCII.
	(lookup_face_for_charset): Take frame parameter instead of 
	face_cache.
	(lookup_face): Ditto.
	(compute_char_face): Renamed from compute_glyph_face.

	* xdisp.c (init_iterator): Initialize charset member.
	(reseat_iterator_to_string): Ditto.
	(get_charset_at_buffer_position): Determine charset at
	buffer position in current_buffer.
	(reseat_iterator): Call above function.
	(compute_face_at_iterator_position): Call
	compute_face_at_buffer_pos.
	(compute_face_at_iterator_string_position): Call
	compute_face_at_string_pos.
	(get_face_from_id): Removed.
	(get_face_from_cursor_pos): Call compute_face_at_buffer_pos.
	Call get_charset_at_buffer_position.
	(reseat_iterator): Determine face if charset at pos differs
	from iterator's charset.
	(reseat_iterator_to_glyph_pos): Removed.

	* xfaces.c (compute_face_at_bufpos): Remove parameter charset.
	Determine charset from buffer position.
	(compute_string_char_face): Renamed to compute_face_at_string_pos.
	(compute_face_at_bufpos): Renamed to compute_face_at_buffer_pos.

	* dispextern.h (struct display_iterator): Add member charset.

1998-04-15  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (compute_char_face): Removed.

	* xdisp.c (get_overlay_arrow_glyph_row): Use compute_glyph_face
	with new parameter list.

	* xfaces.c (region_face): Removed.
	(allocate_face): Removed.
	(copy_face): Ditto.
	(face_eql): Removed.
	(intern_face): Removed.
	(clear_face_cache): Removed.
	(load_font): Ditto.
	(unload_font): Ditto.
	(load_color): Ditto.
	(unload_color): Ditto.
	(new_computed_face): Ditto.
	(intern_computed_face): Ditto.
	(ensure_face_ready): Ditto.
	(merge_faces): Ditto.
	(compute_base_face): Ditto.
	(merge_face_list): Ditto.
	(Fmake_face_internal): Removed.
	(Fset_face_attribute_internal): Ditto.
	(face_name_id_number): Removed.
	(Fframe_face_alist): Ditto.
	(Fset_frame_face_alist): Ditto.
	(Finternal_next_face_id): Ditto.

	* xterm.h (struct x_output): Remove computed_faces, and
	param_faces.  Remove macros accessing them.

	* xfaces.c: Entirely new face implementation added.

1998-04-11  Gerd Moellmann  <gerd@gnu.org>

	* dispextern.h (struct glyph_pos): Member `bufpos' renamed
	`charpos'.

1998-04-10  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_scroll_bar_move): Clear only regions not covered by
	scroll bar window to reduce flickering.  Clear entire height.

	* xdisp.c (move_iterator_vertically_backward): Set iterator's
	current_x and hpos to zero after moving to previous line
	start.

1998-04-03  Gerd Moellmann  <gerd@gnu.org>

	* frame.h (FRAME_FACE_CACHE): Access to a frame's face cache.

	* xfaces.c (xlfd_point_size): Compute relative point size of
	fonts from font and frame resolution.
	(sort_fonts): New function to sort fonts, temporarily setting
	font_frame to the frame in effect.
	(xlfd_point_size): Take additional frame parameter to be able
	to get at the display's resolution.

	* xterm.c (x_setup_relief_colors): Use WHITE_PIX_DEFAULT and
	BLACK_PIX_DEFAULT.
	(x_setup_relief_color): Use FRAME_X_SCREEN instead of default
	screen of display.

1998-03-31  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c (choose_face_fontset): Instantiate fontsets.

	* fontset.h: Add external declarations for Vfontset_alias_alist
	and Vglobal_fontset_alist.

	* xfaces.c (merge_lisp_face_vector_with_property): Simplified.
	(realize_default_face): If frame parameters contain an artificial
	font name naming a fontset, set the family of the default face to
	the fontset name given by the registry.

	* Makefile.in (alloc.o): Add dependency to dispextern.h.

1998-03-22  Gerd Moellmann  <gerd@gnu.org>

	* alloc.c (mark_object): Add function prototype.  Add cast to
	Lisp_Object pointer in call to mark_object for symbol names
	because this otherwise gives a warning from gcc 2.8.1.
	(mark_face_cache): Mark Lisp objects in realized faces.

1998-03-19  Gerd Moellmann  <gerd@gnu.org>

	* frame.h (struct frame): Add member face_cache.

	* alloc.c (mark_object): Mark face cache.
	(mark_face_cache): Mark Lisp faces in face cache of frame.

	* frame.c (make_frame): Initialize face_cache.
	(Fdelete_frame): Free it.

1998-03-18  Gerd Moellmann  <gerd@gnu.org>

	* xfaces.c: Very first skeleton of functions for face realization,
	face merging, face cache etc.

	* dispextern.h (struct rface): Realized faces.  Will replace
	struct face when tested.
	(struct face_cache): Realized face caches.

	* xdisp.c (init_iterator): Initialize area member of display
	iterator.

1998-03-17  Gerd Moellmann  <gerd@gnu.org>

	* xterm.c (x_append_glyph): Use it->area to store glyphs.

	* dispextern.h (struct display_iterator): New member area.

	* xterm.c (note_overwritten_text_cursor): Note when the text
	cursor of a window is overwritten.

	* xdisp.c (set_cursor_from_row): If PT is not found in the
	row, display the cursor at the start of the row.

	* dispnew.c (direct_output_forward_char): Call
	set_cursor_from_row.

	* xdisp.c (setup_iterator_overlay_strings_from_glyph_pos): If
	position is not in an overlay string, set iterator's position and
	method explicitly so.
	(set_cursor_from_row): Correct cursor position calculation. 
	Make it externally visible.
	(redisplay_window): Call set_cursor_from_row so that there is only
	one place where the cursor position is calculated from a current
	row.

	* dispextern.h (struct display_iterator): New member
	overlay_strings_at_end_processed_p.

	* xdisp.c (check_iterator): Perform sanity checks on
	display_iterators.
	(next_element_from_buffer): Check for overlay strings at ZV.

1998-03-16  Gerd Moellmann  <gerd@gnu.org>

	* buffer.c (init_buffer_once): Add left_margin_width and
	right_margin_width to buffer_local_flags.

	* dispnew.c (margin_glyphs_to_reserve): Function computing
	number of glyphs to reserve for a marginal area.
	(adjust_glyph_matrix): Call it.
	(adjust_frame_glyphs_for_frame_redisplay): Return if frame
	is not alive.

	* window.c (Fset_window_margins): Allow floats.

	* buffer.c (syms_of_buffer): Add buffer-local variables
	left-margin-width and right-margin-width.  Add defaults
	default-left-margin-width and default-right-margin-width.

	* buffer.h (struct buffer): New members left_margin_width
	and right_margin_width.

	* window.c (Fset_window_margins): Make window the last and
	optional argument.

	* xterm.c (x_draw_glyphs): Compute x-positions for rows with
	flag no_marginal_areas_p differently.
	(x_clear_end_of_line): Ditto.
	(x_draw_glyph_string_relief): Compute width of relief differently
	for rows with flag no_marginal_areas_p.

	* dispnew.c (update_window_line): Update marginal areas only
	for rows that don't have no_marginal_areas_p set.

	* xdisp.c (display_mode_line): Set row's flag no_marginal_areas_p.
	(display_menu_bar): Ditto.

	* dispextern.h (struct glyph_row): New member no_marginal_areas_p.

	* dispnew.c (adjust_glyph_matrix): Compute glyph pointers for
	marginal areas in window-based redisplay.

	* dispextern.h (struct glyph_matrix): New members
	left_margin_glyphs and right_margin_glyphs.

1998-03-15  Gerd Moellmann  <gerd@gnu.org>

	* minibuf.c (read_minibuf_unwind): Return Lisp_Object.

	* charset.c (non_ascii_char_to_string): Use char type parameters
	because the function is used that way from outside.  Use unsigned
	char internally.

	* window.c (change_window_height): Return void.
	(make_dummy_parent): Return void.
	(init_window_once): Return void.
	(syms_of_window): Ditto.
	(keys_of_window): Ditto.
	(delete_window): Correct return with and without value.

	* buffer.c (record_buffer): Return void.

	* marker.c (unchain_marker): Return void.

	* window.c (unshow_buffer): Return void.
	(replace_window): Ditto.
	(delete_window): Ditto.

	* term.c (delete_glyphs_hook): Void return type.
	(ring_bell_hook): Ditto.
	(set_terminal_window_hook): Ditto.

	* sysdep.c (init_sigio): Return void.

	* xterm.c (x_set_window_size): Return void.
	(x_calc_absolute_position): Ditto.
	(x_set_offset): Ditto.
	(x_focus_on_frame): Ditto.
	(x_unfocus_frame): Ditto.
	(x_make_frame_visible): Ditto.
	(x_make_frame_invisible): Ditto.
	(x_iconify_frame): Ditto.
	(x_destroy_window): Ditto.
	(x_wm_set_window_state): Ditto.
	(x_wm_set_icon_pixmap): Ditto.
	(x_wm_set_icon_position): Ditto.
	(x_initialize): Ditto.
	(x_error_quitter): Ditto.
	(x_destroy_window): Use xfree instead of free.

	* keyboard.c (clear_waiting_for_input): Return void.

	* xterm.c (x_wm_set_size_hint): Return void.
	(x_raise_frame): Ditto.
	(refreshicon): Ditto.
	(x_error_catcher): Ditto.
	(x_clear_errors): Ditto.

	* keyboard.c (record_asynch_buffer_change): Return void.

	* xterm.c (XTroï