Browse Source

Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode

Eric Schulte 15 years ago
parent
commit
c2c3e98004
10 changed files with 304 additions and 159 deletions
  1. 13 4
      doc/org.texi
  2. 1 1
      doc/orgcard.tex
  3. 70 70
      lisp/ChangeLog.01
  4. 12 0
      lisp/org-compat.el
  5. 18 0
      lisp/org-entities.el
  6. 0 70
      lisp/org-exp.el
  7. 11 2
      lisp/org-html.el
  8. 2 1
      lisp/org-macs.el
  9. 10 4
      lisp/org-table.el
  10. 167 7
      lisp/org.el

+ 13 - 4
doc/org.texi

@@ -787,11 +787,14 @@ command, @command{org-cycle}, which is bound to the @key{TAB} key.
 @cindex headlines
 @cindex headlines
 @cindex outline tree
 @cindex outline tree
 @vindex org-special-ctrl-a/e
 @vindex org-special-ctrl-a/e
+@vindex org-special-ctrl-k
+@vindex org-ctrl-k-protect-subtree
 
 
-Headlines define the structure of an outline tree.  The headlines in
-Org start with one or more stars, on the left margin@footnote{See
-the variable @code{org-special-ctrl-a/e} to configure special behavior
-of @kbd{C-a} and @kbd{C-e} in headlines.}.  For example:
+Headlines define the structure of an outline tree.  The headlines in Org
+start with one or more stars, on the left margin@footnote{See the variables
+@code{org-special-ctrl-a/e}, @code{org-special-ctrl-k}, and
+@code{org-ctrl-k-protect-subtree} to configure special behavior of @kbd{C-a},
+@kbd{C-e}, and @kbd{C-k} in headlines.}.  For example:
 
 
 @example
 @example
 * Top level headline
 * Top level headline
@@ -8783,6 +8786,12 @@ convention, or use, on a per-file basis:
 #+OPTIONS: ^:@{@}
 #+OPTIONS: ^:@{@}
 @end example
 @end example
 
 
+@table @kbd
+@kindex C-c C-x \
+@item C-c C-x \
+In addition to showing entities as UTF8 characters, this command will also
+format sub- and superscripts in a WYSIWYM way.
+@end table
 
 
 @node LaTeX fragments, Previewing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
 @node LaTeX fragments, Previewing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
 @subsection La@TeX{} fragments
 @subsection La@TeX{} fragments

+ 1 - 1
doc/orgcard.tex

@@ -704,7 +704,7 @@ some other place.
 \key{export visible part only}{C-c C-e v}
 \key{export visible part only}{C-c C-e v}
 \key{insert template of export options}{C-c C-e t}
 \key{insert template of export options}{C-c C-e t}
 \key{toggle fixed width for entry or region}{C-c :}
 \key{toggle fixed width for entry or region}{C-c :}
-\key{toggle display of entities as UTF8 chars}{C-c C-x {\tt\char`\\}}
+\key{toggle pretty display of scripts, entities}{C-c C-x {\tt\char`\\}}
 
 
 %{\bf HTML formatting}
 %{\bf HTML formatting}
 
 

+ 70 - 70
lisp/ChangeLog.01

@@ -7811,7 +7811,7 @@ installed as 5.12
 	(org-paste-subtree): Fix the level at which a tree is pasted.
 	(org-paste-subtree): Fix the level at which a tree is pasted.
 	(org-fit-agenda-window): Limitations on window size removed.
 	(org-fit-agenda-window): Limitations on window size removed.
 	(org-agenda-find-same-or-today-or-agenda): Renamed from
 	(org-agenda-find-same-or-today-or-agenda): Renamed from
-	`org-agenda-find-today-or-agenda'. 
+	`org-agenda-find-today-or-agenda'.
 	(org-scheduled-past-days): New option.
 	(org-scheduled-past-days): New option.
 	(org-agenda-scheduled-leaders)
 	(org-agenda-scheduled-leaders)
 	(org-agenda-deadline-leaders): New options.
 	(org-agenda-deadline-leaders): New options.
@@ -7825,7 +7825,7 @@ installed as 5.12
 
 
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 Installed as 5.11
 Installed as 5.11
-	
+
 
 
 2007-10-05  Carsten Dominik  <dominik@science.uva.nl>
 2007-10-05  Carsten Dominik  <dominik@science.uva.nl>
 
 
@@ -7840,7 +7840,7 @@ Installed as 5.11
 	new one.
 	new one.
 	(org-clock-goto): New function.
 	(org-clock-goto): New function.
 	(org-open-file): Use `start-process-shell-command' instead of
 	(org-open-file): Use `start-process-shell-command' instead of
-	`shell-command' with an ampersand. 
+	`shell-command' with an ampersand.
 	(org-deadline, org-schedule): New argument REMOVE to remove the
 	(org-deadline, org-schedule): New argument REMOVE to remove the
 	date from the entry.
 	date from the entry.
 	(org-agenda-schedule, org-agenda-deadline): Pass the prefix
 	(org-agenda-schedule, org-agenda-deadline): Pass the prefix
@@ -7851,7 +7851,7 @@ Installed as 5.11
 	(org-clock-find-position): New function.
 	(org-clock-find-position): New function.
 	(org-clock-into-drawer): New option.
 	(org-clock-into-drawer): New option.
 	(org-agenda-tags-column): Renamed from
 	(org-agenda-tags-column): Renamed from
-	`org-agenda-align-tags-to-column'. 
+	`org-agenda-align-tags-to-column'.
 	(org-agenda-align-tags): Allow negative values for
 	(org-agenda-align-tags): Allow negative values for
 	`org-agenda-tags-column'.
 	`org-agenda-tags-column'.
 	(org-insert-labeled-timestamps-before-properties-drawer): Variable
 	(org-insert-labeled-timestamps-before-properties-drawer): Variable
@@ -7884,13 +7884,13 @@ Installed as 5.11
 
 
 2007-10-05  Bastien Guerry  <Bastien.Guerry@ens.fr>
 2007-10-05  Bastien Guerry  <Bastien.Guerry@ens.fr>
 
 
-	* org-export-latex.el (org-export-latex-protect-string): 
+	* org-export-latex.el (org-export-latex-protect-string):
         Renaming of `org-latex-protect'.
         Renaming of `org-latex-protect'.
-	(org-export-latex-emphasis-alist): By default, don't protect 
+	(org-export-latex-emphasis-alist): By default, don't protect
         any emphasis formatter from further conversion.
         any emphasis formatter from further conversion.
 	(org-export-latex-tables): honor column grouping for tables.
 	(org-export-latex-tables): honor column grouping for tables.
 	(org-export-latex-title-command): New option.
 	(org-export-latex-title-command): New option.
-        (org-export-latex-treat-backslash-char): Use \textbackslash{} to 
+        (org-export-latex-treat-backslash-char): Use \textbackslash{} to
         export backslash character.
         export backslash character.
 
 
 ------------------------------------------------------------
 ------------------------------------------------------------
@@ -7928,17 +7928,17 @@ Installed as 5.10
 
 
 2007-09-26  Bastien Guerry  <Bastien.Guerry@ens.fr>
 2007-09-26  Bastien Guerry  <Bastien.Guerry@ens.fr>
 
 
-	* org-export-latex.el (org-export-latex-emphasis-alist): 
+	* org-export-latex.el (org-export-latex-emphasis-alist):
 	Each list of the alist now requires three elements.
 	Each list of the alist now requires three elements.
 -----------------------------------------------------------------
 -----------------------------------------------------------------
 Installed as 5.09
 Installed as 5.09
-	
+
 	2007-09-14  Bastien Guerry  <bzg@altern.org>
 	2007-09-14  Bastien Guerry  <bzg@altern.org>
 
 
 	* org-export-latex.el (org-export-latex-tables-verbatim): New
 	* org-export-latex.el (org-export-latex-tables-verbatim): New
 	function.
 	function.
 	(org-export-latex-remove-from-headlines): Name changed because of
 	(org-export-latex-remove-from-headlines): Name changed because of
-	typo. 
+	typo.
 	(org-export-latex-quotation-marks-convention): Option removed.
 	(org-export-latex-quotation-marks-convention): Option removed.
 	(org-export-latex-make-preamble): Handle the DATE option.
 	(org-export-latex-make-preamble): Handle the DATE option.
 	(org-export-latex-cleaned-string): Now the only cleaning function,
 	(org-export-latex-cleaned-string): Now the only cleaning function,
@@ -8081,7 +8081,7 @@ installed in Emacs as 5.08
 	(org-get-todo-face): New function.
 	(org-get-todo-face): New function.
 	(org-todo-keyword-faces): New option.
 	(org-todo-keyword-faces): New option.
 
 
--------------------------------------------------------------------------	
+-------------------------------------------------------------------------
 
 
 2007-08-21  Carsten Dominik  <dominik@science.uva.nl>
 2007-08-21  Carsten Dominik  <dominik@science.uva.nl>
 
 
@@ -8131,7 +8131,7 @@ installed in Emacs as 5.08
 	(org-agenda-align-tags, org-agenda-priority)
 	(org-agenda-align-tags, org-agenda-priority)
 	(org-agenda-set-tags, org-agenda-toggle-archive-tag)
 	(org-agenda-set-tags, org-agenda-toggle-archive-tag)
 	(org-agenda-show-new-time, org-cleaned-string-for-export)
 	(org-agenda-show-new-time, org-cleaned-string-for-export)
-	(org-export-grab-title-from-buffer): 
+	(org-export-grab-title-from-buffer):
 	(org-export-as-ascii, org-export-as-html): Use `inhibit-read-only'
 	(org-export-as-ascii, org-export-as-html): Use `inhibit-read-only'
 	instead of `buffer-read-only'.
 	instead of `buffer-read-only'.
 	(org-export-as-html): Set `coding-system-for-write'.
 	(org-export-as-html): Set `coding-system-for-write'.
@@ -8205,17 +8205,17 @@ installed in Emacs as 5.08
 	`org-current-columns-maxwidths'.
 	`org-current-columns-maxwidths'.
 	(org-columns-begin-marker, org-columns-current-fmt-compiled)
 	(org-columns-begin-marker, org-columns-current-fmt-compiled)
 	(org-previous-header-line-format)
 	(org-previous-header-line-format)
-	(org-columns-inhibit-recalculation) 
+	(org-columns-inhibit-recalculation)
 	(org-columns-top-level-marker): New variables.
 	(org-columns-top-level-marker): New variables.
 	(org-columns-default-format): Renamed from
 	(org-columns-default-format): Renamed from
 	`org-default-columns-format'.
 	`org-default-columns-format'.
 	(org-property-re): New constant.
 	(org-property-re): New constant.
 
 
-	
+
 
 
 =====================================================================
 =====================================================================
 
 
-Installed as 5.01b	
+Installed as 5.01b
 
 
 2007-07-02  Carsten Dominik  <dominik@science.uva.nl>
 2007-07-02  Carsten Dominik  <dominik@science.uva.nl>
 
 
@@ -8248,7 +8248,7 @@ Installed as 5.01b
 
 
 2007-06-28  Carsten Dominik  <dominik@science.uva.nl>
 2007-06-28  Carsten Dominik  <dominik@science.uva.nl>
 
 
-	* org.el (org-priority): Realign tags after changing priority. 
+	* org.el (org-priority): Realign tags after changing priority.
 	(org-preserve-lc): New macro.
 	(org-preserve-lc): New macro.
 	(org-update-checkbox-count): Catch case when there is no headline.
 	(org-update-checkbox-count): Catch case when there is no headline.
 	(org-agenda-quit): Remove any column overlays.
 	(org-agenda-quit): Remove any column overlays.
@@ -8314,7 +8314,7 @@ Installed as 5.01b
 
 
 
 
 ======================================================================
 ======================================================================
-	
+
 2007-06-06  Carsten Dominik  <dominik@science.uva.nl>
 2007-06-06  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* textmodes/org.el:
 	* textmodes/org.el:
@@ -8427,12 +8427,12 @@ Installed as 5.01b
 -------------------------------------------------------------------------
 -------------------------------------------------------------------------
 
 
 installed as 4.67
 installed as 4.67
-	
+
 2007-02-25  Carsten Dominik  <dominik@science.uva.nl>
 2007-02-25  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.texi (The spreadsheet): Renamed from "Table calculations".
 	* org.texi (The spreadsheet): Renamed from "Table calculations".
 	Completely reorganized and rewritten.
 	Completely reorganized and rewritten.
-	(CamelCase links): Section removed. 
+	(CamelCase links): Section removed.
 	(Repeating items): New section.
 	(Repeating items): New section.
 	(Tracking TODO state changes): New section.
 	(Tracking TODO state changes): New section.
 	(Agenda views): Chapter reorganized and rewritten.
 	(Agenda views): Chapter reorganized and rewritten.
@@ -8462,7 +8462,7 @@ installed as 4.67
 	(org-table-formula-numbers-only): Option removed.
 	(org-table-formula-numbers-only): Option removed.
 	(org-link-style, org-link-format): Options removed.
 	(org-link-style, org-link-format): Options removed.
 	(org-select-agenda-window, org-fit-agenda-window): Options
 	(org-select-agenda-window, org-fit-agenda-window): Options
-	removed. 
+	removed.
 	(org-export-ascii-show-new-buffer)
 	(org-export-ascii-show-new-buffer)
 	(org-export-html-show-new-buffer): Options removed.
 	(org-export-html-show-new-buffer): Options removed.
 	(org-activate-links): Camel option removed.
 	(org-activate-links): Camel option removed.
@@ -8489,7 +8489,7 @@ installed as 4.67
 	(orgtbl-to-latex, orgtbl-insert-radio-table)
 	(orgtbl-to-latex, orgtbl-insert-radio-table)
 	(orgtbl-toggle-comment, orgtbl-send-table): New functions.
 	(orgtbl-toggle-comment, orgtbl-send-table): New functions.
 	(orgtbl-radio-table-templates): New option.
 	(orgtbl-radio-table-templates): New option.
-	(org-store-link-props): 
+	(org-store-link-props):
 	(org-remember-templates): More possibilities to insert
 	(org-remember-templates): More possibilities to insert
 	info into templates.
 	info into templates.
 	(org-remember-apply-template): Make use of the extended template
 	(org-remember-apply-template): Make use of the extended template
@@ -8502,7 +8502,7 @@ installed as 4.67
 	(org-table-remove-rectangle-highlight)
 	(org-table-remove-rectangle-highlight)
 	(org-time-stamp-format, org-toggle-log-option)
 	(org-time-stamp-format, org-toggle-log-option)
 	(org-table-highlight-rectangle)
 	(org-table-highlight-rectangle)
-	(org-table-iterate, org-table-make-reference): 
+	(org-table-iterate, org-table-make-reference):
 	(org-translate-time, org-tree-to-indirect-buffer)
 	(org-translate-time, org-tree-to-indirect-buffer)
 	(org-table-field-info, org-table-fix-formulas)
 	(org-table-field-info, org-table-fix-formulas)
 	(org-table-force-dataline, org-table-get-descriptor-line)
 	(org-table-force-dataline, org-table-get-descriptor-line)
@@ -8523,7 +8523,7 @@ installed as 4.67
 	(org-do-sort, org-file-image-p, org-find-overlays)
 	(org-do-sort, org-file-image-p, org-find-overlays)
 	(org-find-row-type, org-get-indirect-buffer, org-get-repeat)
 	(org-find-row-type, org-get-indirect-buffer, org-get-repeat)
 	(org-highlight-until-next-command, org-isearch-end)
 	(org-highlight-until-next-command, org-isearch-end)
-	(org-match-any-p, org-next-link, org-previous-link): 
+	(org-match-any-p, org-next-link, org-previous-link):
 	(org-remove-subtree-entries-from-agenda, org-replace-escapes)
 	(org-remove-subtree-entries-from-agenda, org-replace-escapes)
 	(org-rewrite-old-row-references)
 	(org-rewrite-old-row-references)
 	(org-isearch-post-command)
 	(org-isearch-post-command)
@@ -8531,12 +8531,12 @@ installed as 4.67
 	(org-table-edit-scroll, org-table-edit-scroll-down)
 	(org-table-edit-scroll, org-table-edit-scroll-down)
 	(org-set-frame-title, org-show-reference)
 	(org-set-frame-title, org-show-reference)
 	(org-unhighlight-once, org-verify-change-for-undo): New
 	(org-unhighlight-once, org-verify-change-for-undo): New
-	functions. 
+	functions.
 	(org-show-variable): Command removed.
 	(org-show-variable): Command removed.
 	(org-add-log-maybe): New arguments STATE, FINDPOS
 	(org-add-log-maybe): New arguments STATE, FINDPOS
 	(org-table-sort-lines): Rewritten from scratch.
 	(org-table-sort-lines): Rewritten from scratch.
 	(org-link-search): New argument AVOID-POS.
 	(org-link-search): New argument AVOID-POS.
-	(org-print-icalendar-entries): Argument CATEGORY removed. 
+	(org-print-icalendar-entries): Argument CATEGORY removed.
 	(org-run-agenda-series): Argument WONDOW removed.
 	(org-run-agenda-series): Argument WONDOW removed.
 	(org-next-link, org-previous-link): New commands.
 	(org-next-link, org-previous-link): New commands.
 	(org-agenda-date-format): New option.
 	(org-agenda-date-format): New option.
@@ -8603,7 +8603,7 @@ installed as 4.56
 	(org-agenda-change-all-lines): Make sure TODO are highlighted.
 	(org-agenda-change-all-lines): Make sure TODO are highlighted.
 
 
 ----------------------------------------------------------------------------
 ----------------------------------------------------------------------------
-Installed as 4.54	
+Installed as 4.54
 
 
 2006-11-10  Carsten Dominik  <dominik@science.uva.nl>
 2006-11-10  Carsten Dominik  <dominik@science.uva.nl>
 
 
@@ -8738,7 +8738,7 @@ Installed as 4.54
 
 
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 installed as 4.44
 installed as 4.44
-	
+
 
 
 2006-08-15  Carsten Dominik  <dominik@science.uva.nl>
 2006-08-15  Carsten Dominik  <dominik@science.uva.nl>
 
 
@@ -8767,7 +8767,7 @@ installed as 4.44
 	(org-set-autofill-regexps): Use `org-set-local'.
 	(org-set-autofill-regexps): Use `org-set-local'.
 	(org-table-eval-formula): Fixed bug with parsing of display flags.
 	(org-table-eval-formula): Fixed bug with parsing of display flags.
 
 
-	
+
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 installed as 4.43
 installed as 4.43
 
 
@@ -8811,12 +8811,12 @@ installed as 4.41
 	* org.texi (Checkboxes): New section.
 	* org.texi (Checkboxes): New section.
 
 
 	* orgcard.tex (section{Structure Editing}): Document checkbox
 	* orgcard.tex (section{Structure Editing}): Document checkbox
-	toggling. 
+	toggling.
 
 
 	* org.el (org-prepare-agenda-buffers): Use `invisible-OK' argument
 	* org.el (org-prepare-agenda-buffers): Use `invisible-OK' argument
 	for `org-end-of-subtree'.
 	for `org-end-of-subtree'.
 	(org-export-cleanup-toc-line): Renamed from
 	(org-export-cleanup-toc-line): Renamed from
-	`org-html-cleanup-toc-line'. 
+	`org-html-cleanup-toc-line'.
 	(org-beginning-of-item): Fixed bug in regular expression for white
 	(org-beginning-of-item): Fixed bug in regular expression for white
 	line.
 	line.
 	(org-export-as-html): Enforce space after bullet in plain list
 	(org-export-as-html): Enforce space after bullet in plain list
@@ -8839,7 +8839,7 @@ installed as 4.40
 2006-06-28  Carsten Dominik  <dominik@science.uva.nl>
 2006-06-28  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-context): New contexts :item-bullet, :latex-fragment,
 	* org.el (org-context): New contexts :item-bullet, :latex-fragment,
-	:latex-preview. 
+	:latex-preview.
 	(org-overlays-at, org-overlay-start, org-overlay-end): New
 	(org-overlays-at, org-overlay-start, org-overlay-end): New
 	compatibility functions.
 	compatibility functions.
 
 
@@ -8860,7 +8860,7 @@ installed as 4.39
 	(org-cdlatex-texmathp-advice-is-done): New variables.
 	(org-cdlatex-texmathp-advice-is-done): New variables.
 	(org-cdlatex-mode): New minor mode.
 	(org-cdlatex-mode): New minor mode.
 	(org-inside-LaTeX-fragment-p, org-try-cdlatex-tab): New
 	(org-inside-LaTeX-fragment-p, org-try-cdlatex-tab): New
-	functions. 
+	functions.
 	(org-cdlatex-underscore-caret, org-cdlatex-math-modify): New
 	(org-cdlatex-underscore-caret, org-cdlatex-math-modify): New
 	commands.
 	commands.
 	(org-export-with-archived-trees): New option.
 	(org-export-with-archived-trees): New option.
@@ -8871,11 +8871,11 @@ installed as 4.39
 	(org-sparse-tree-open-archived-trees): New options.
 	(org-sparse-tree-open-archived-trees): New options.
 	(org-cycle-hide-archived-subtrees, org-hide-archived-subtrees)
 	(org-cycle-hide-archived-subtrees, org-hide-archived-subtrees)
 	(org-toggle-tag, org-prepare-agenda-buffers, org-agenda-skip): New
 	(org-toggle-tag, org-prepare-agenda-buffers, org-agenda-skip): New
-	functions. 
+	functions.
 	(org-agenda-toggle-archive-tag, org-toggle-archive-tag): New
 	(org-agenda-toggle-archive-tag, org-toggle-archive-tag): New
 	commands.
 	commands.
 	(org-agenda-mode-map): Add binding of
 	(org-agenda-mode-map): Add binding of
-	`org-agenda-toggle-archive-tag'. 
+	`org-agenda-toggle-archive-tag'.
 	(org-mode-map): Add binding for `org-toggle-archive-tag'.
 	(org-mode-map): Add binding for `org-toggle-archive-tag'.
 	(org-timeline, org-agenda-list, org-todo-list, org-tags-view):
 	(org-timeline, org-agenda-list, org-todo-list, org-tags-view):
 	Call `org-prepare-agenda-buffers'.
 	Call `org-prepare-agenda-buffers'.
@@ -8894,7 +8894,7 @@ installed as 4.39
 
 
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 installed as 4.38
 installed as 4.38
-	
+
 
 
 2006-06-18  Carsten Dominik  <dominik@science.uva.nl>
 2006-06-18  Carsten Dominik  <dominik@science.uva.nl>
 
 
@@ -8968,7 +8968,7 @@ installed as 4.37
 
 
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 installed as 4.36
 installed as 4.36
-	
+
 
 
 2006-06-02  Carsten Dominik  <dominik@science.uva.nl>
 2006-06-02  Carsten Dominik  <dominik@science.uva.nl>
 
 
@@ -9126,11 +9126,11 @@ installed as 4.33
 	(Publishing): New chapter.
 	(Publishing): New chapter.
 	(HTML export): Include a list of supported CSS classes.
 	(HTML export): Include a list of supported CSS classes.
 	(Setting tags): Describe the fast-tag-setting interface.
 	(Setting tags): Describe the fast-tag-setting interface.
-	
+
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 
 
 installed as 4.26
 installed as 4.26
-	
+
 2006-04-21  Carsten Dominik  <dominik@science.uva.nl>
 2006-04-21  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.texi Many small fixes.
 	* org.texi Many small fixes.
@@ -9172,7 +9172,7 @@ installed as 4.25
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 installed as 4.24
 installed as 4.24
 
 
-	
+
 	* org.texi (Formula syntax): Fixed link to Calc Manual.
 	* org.texi (Formula syntax): Fixed link to Calc Manual.
 
 
 	* org.el (org-insert-heading): Insert heading before current if at
 	* org.el (org-insert-heading): Insert heading before current if at
@@ -9185,7 +9185,7 @@ installed as 4.24
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 installed as 4.23
 installed as 4.23
 
 
-	
+
 	* org.texi (Visibility cycling): Better names for the startup
 	* org.texi (Visibility cycling): Better names for the startup
 	folding options.
 	folding options.
 	(Exporting): Completely restructured.
 	(Exporting): Completely restructured.
@@ -9276,7 +9276,7 @@ installes as 4.13
 
 
 -------------------------------------------------------------------
 -------------------------------------------------------------------
 installed as 4.10
 installed as 4.10
-	
+
 2006-03-14  Carsten Dominik  <dominik@science.uva.nl>
 2006-03-14  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-insert-centered): Use `string-width' to make
 	* org.el (org-insert-centered): Use `string-width' to make
@@ -9335,15 +9335,15 @@ installed as 4.08
 	--------------------------------------------------------------
 	--------------------------------------------------------------
 installed as 4.07
 installed as 4.07
 
 
-	
+
 2006-02-28  Carsten Dominik  <dominik@science.uva.nl>
 2006-02-28  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-get-legal-level, org-tr-level): New functions.
 	* org.el (org-get-legal-level, org-tr-level): New functions.
 	(org-odd-levels-only): New option.
 	(org-odd-levels-only): New option.
 	(org-level-faces, org-paste-subtree, org-convert-to-odd-levels,
 	(org-level-faces, org-paste-subtree, org-convert-to-odd-levels,
-	org-demote, org-promote):  Deal with double-star levels. 
+	org-demote, org-promote):  Deal with double-star levels.
 	(org-convert-to-odd-levels): New command.
 	(org-convert-to-odd-levels): New command.
-	(org-tr-level): 
+	(org-tr-level):
 
 
 	* org.el (org-export-as-html): Fixed bugs in HTML
 	* org.el (org-export-as-html): Fixed bugs in HTML
 	formatting (removed nested achors).
 	formatting (removed nested achors).
@@ -9365,7 +9365,7 @@ installed as 4.07
 
 
 --------------------------------------------------------------------------
 --------------------------------------------------------------------------
 installed as 4.06
 installed as 4.06
-	
+
 2006-02-23  Carsten Dominik  <dominik@science.uva.nl>
 2006-02-23  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-cleaned-string-for-export, org-solidify-link-text):
 	* org.el (org-cleaned-string-for-export, org-solidify-link-text):
@@ -9375,7 +9375,7 @@ installed as 4.06
 	(org-export-as-ascii, org-export-as-html-and-open): Use
 	(org-export-as-ascii, org-export-as-html-and-open): Use
 	`org-cleaned-string-for-export' and create internal links.
 	`org-cleaned-string-for-export' and create internal links.
 	(org-follow-mhe-link): Require mh-e, use folder.
 	(org-follow-mhe-link): Require mh-e, use folder.
-	(org-read-date): 
+	(org-read-date):
 
 
 --------------------------------------------------------------------------
 --------------------------------------------------------------------------
 	Installed as 4.05
 	Installed as 4.05
@@ -9397,10 +9397,10 @@ installed as 4.06
 	directory link.
 	directory link.
 	(org-file-apps): Fixed bugs in customize type, added setting for
 	(org-file-apps): Fixed bugs in customize type, added setting for
 	directories.
 	directories.
-	(org-activate-tags, org-format-agenda-item, org-complete) 
-	(org-get-tags-at, org-scan-tags, org-make-tags-matcher) 
-	(org-get-tags, org-get-buffer-tags, org-open-at-point) 
-	(org-link-search, org-make-org-heading-search-string) 
+	(org-activate-tags, org-format-agenda-item, org-complete)
+	(org-get-tags-at, org-scan-tags, org-make-tags-matcher)
+	(org-get-tags, org-get-buffer-tags, org-open-at-point)
+	(org-link-search, org-make-org-heading-search-string)
 	(org-make-org-heading-camel): Allow @ and 0-9 as tags characters.
 	(org-make-org-heading-camel): Allow @ and 0-9 as tags characters.
 	(org-radio-targets, org-file-link-context-use-camel-case)
 	(org-radio-targets, org-file-link-context-use-camel-case)
 	(org-activate-camels): New options.
 	(org-activate-camels): New options.
@@ -9500,8 +9500,8 @@ installed as 4.02
 	(org-calendar-select-mouse): New command.
 	(org-calendar-select-mouse): New command.
 
 
 	* org.texi (Agenda Views): Chapter reorganized.
 	* org.texi (Agenda Views): Chapter reorganized.
-	
-	
+
+
 ------------------------------------------------------------------------
 ------------------------------------------------------------------------
 installed as 4.01
 installed as 4.01
 
 
@@ -9557,7 +9557,7 @@ installed as 3.24
 
 
 ------------------------------------------------------------------------
 ------------------------------------------------------------------------
 installed as 3.23
 installed as 3.23
-	
+
 2005-12-06  Carsten Dominik  <dominik@science.uva.nl>
 2005-12-06  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-insert-heading): Try to do items before headings.
 	* org.el (org-insert-heading): Try to do items before headings.
@@ -9568,7 +9568,7 @@ installed as 3.23
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 
 
 installed as 3.22
 installed as 3.22
-	
+
 2005-12-05  Carsten Dominik  <dominik@science.uva.nl>
 2005-12-05  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-occur-highlights): New variable.
 	* org.el (org-occur-highlights): New variable.
@@ -9603,11 +9603,11 @@ installed as 3.22
 
 
 	* org.texi (TODO basics): Document the global todo list.
 	* org.texi (TODO basics): Document the global todo list.
 	(TODO items): Documents sparse tree for specific TODO
 	(TODO items): Documents sparse tree for specific TODO
-	keywords. 
+	keywords.
 
 
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 installed as 3.21
 installed as 3.21
-	
+
 2005-11-23  Carsten Dominik  <dominik@science.uva.nl>
 2005-11-23  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-export-plain-list-max-depth): Renamed from
 	* org.el (org-export-plain-list-max-depth): Renamed from
@@ -9632,7 +9632,7 @@ installed as 3.21
 
 
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 installed as 3.20
 installed as 3.20
-	
+
 2005-11-16  Carsten Dominik  <dominik@science.uva.nl>
 2005-11-16  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-table-sort-lines): New command.
 	* org.el (org-table-sort-lines): New command.
@@ -9670,7 +9670,7 @@ installed as 3.19
 
 
 ------------------------------------------------------------------------
 ------------------------------------------------------------------------
 
 
-installed as 3.18	
+installed as 3.18
 
 
 2005-10-19  Carsten Dominik  <dominik@science.uva.nl>
 2005-10-19  Carsten Dominik  <dominik@science.uva.nl>
 
 
@@ -9696,8 +9696,8 @@ installed as 3.18
 	* orgcard.tex: Add iCalendar export keys.
 	* orgcard.tex: Add iCalendar export keys.
 
 
 ------------------------------------------------------------------------
 ------------------------------------------------------------------------
-installed as 3.17	
-	
+installed as 3.17
+
 2005-10-10  Carsten Dominik  <dominik@science.uva.nl>
 2005-10-10  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-mode-map): Explicit definition of `C-c C-x' as a
 	* org.el (org-mode-map): Explicit definition of `C-c C-x' as a
@@ -9710,9 +9710,9 @@ installed as 3.17
 	* org.texi (Workflow states): Documented that change in keywords
 	* org.texi (Workflow states): Documented that change in keywords
 	becomes active only after restart of Emacs.
 	becomes active only after restart of Emacs.
 
 
---------------------------------------------------------------------------	
+--------------------------------------------------------------------------
 Installed as 3.16
 Installed as 3.16
-	
+
 2005-09-21  Carsten Dominik  <dominik@science.uva.nl>
 2005-09-21  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-mode-map, orgtbl-mode-map): Move keybindings with
 	* org.el (org-mode-map, orgtbl-mode-map): Move keybindings with
@@ -9795,7 +9795,7 @@ installed as 3.14
 ----------------------------------------------------------------------------
 ----------------------------------------------------------------------------
 
 
 installed as version 3.12
 installed as version 3.12
-	
+
 2005-06-28  Carsten Dominik  <dominik@science.uva.nl>
 2005-06-28  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (orgtbl-setup): New function, for delayed setup for the
 	* org.el (orgtbl-setup): New function, for delayed setup for the
@@ -9840,7 +9840,7 @@ installed as version 3.12
 
 
 installed as 3.11
 installed as 3.11
 
 
-	
+
 2005-06-13  Carsten Dominik  <dominik@science.uva.nl>
 2005-06-13  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* textmodes/org.el (org-CUA-compatible): New option.
 	* textmodes/org.el (org-CUA-compatible): New option.
@@ -9872,7 +9872,7 @@ installed as 3.11
 --------------------------------------------------------------------------
 --------------------------------------------------------------------------
 
 
 installed as 3.10
 installed as 3.10
-	
+
 2005-05-30  Carsten Dominik  <dominik@science.uva.nl>
 2005-05-30  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-agenda-mode): Use `run-mode-hooks' if available.
 	* org.el (org-agenda-mode): Use `run-mode-hooks' if available.
@@ -9881,7 +9881,7 @@ installed as 3.10
 
 
 
 
  installed as 3.09
  installed as 3.09
-	
+
 2005-05-19  Carsten Dominik  <dominik@science.uva.nl>
 2005-05-19  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* textmodes/org.el (org-agenda-toggle-time-grid): New command.
 	* textmodes/org.el (org-agenda-toggle-time-grid): New command.
@@ -9900,10 +9900,10 @@ installed as 3.10
 	specifications and move these into the prefix if possible.
 	specifications and move these into the prefix if possible.
 	(org-agenda-priority): Get current heading, not previous heading
 	(org-agenda-priority): Get current heading, not previous heading
 	during agenda remote editing.
 	during agenda remote editing.
-	
+
 ======================================================================
 ======================================================================
 	Intsalled as 3.08
 	Intsalled as 3.08
-	
+
 2005-04-28  Carsten Dominik  <dominik@science.uva.nl>
 2005-04-28  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el Many small changes to keep the byte compiler happy.
 	* org.el Many small changes to keep the byte compiler happy.
@@ -9979,10 +9979,10 @@ installed as 3.10
 
 
 ======================================================================
 ======================================================================
 	Installed as version 3.05
 	Installed as version 3.05
-	
+
 2005-03-29  Carsten Dominik  <dominik@science.uva.nl>
 2005-03-29  Carsten Dominik  <dominik@science.uva.nl>
 
 
-	* org.el (org-agenda-phases-of-moon, org-agenda-sunrise-sunset) 
+	* org.el (org-agenda-phases-of-moon, org-agenda-sunrise-sunset)
 	(org-agenda-convert-date, org-agenda-goto-calendar): New commands.
 	(org-agenda-convert-date, org-agenda-goto-calendar): New commands.
 
 
 2005-03-28  Carsten Dominik  <dominik@science.uva.nl>
 2005-03-28  Carsten Dominik  <dominik@science.uva.nl>

+ 12 - 0
lisp/org-compat.el

@@ -313,6 +313,18 @@ TIME defaults to the current time."
       (time-to-seconds (or time (current-time)))
       (time-to-seconds (or time (current-time)))
     (float-time time)))
     (float-time time)))
 
 
+(defun org-string-match-p (&rest args)
+  (if (fboundp 'string-match-p)
+      (apply 'string-match-p args)
+    (save-match-data
+      (apply 'string-match args))))
+
+(defun org-looking-at-p (&rest args)
+  (if (fboundp 'looking-at-p)
+      (apply 'looking-at-p args)
+    (save-match-data
+      (apply 'looking-at-p args))))
+
 ; XEmacs does not have `looking-back'.
 ; XEmacs does not have `looking-back'.
 (if (fboundp 'looking-back)
 (if (fboundp 'looking-back)
     (defalias 'org-looking-back 'looking-back)
     (defalias 'org-looking-back 'looking-back)

+ 18 - 0
lisp/org-entities.el

@@ -480,6 +480,24 @@ Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'."
     (goto-char pos)
     (goto-char pos)
     (org-table-align)))
     (org-table-align)))
 
 
+(defun org-entities-help ()
+  "Create a Help buffer with all available entities"
+  (interactive)
+  (with-output-to-temp-buffer "*Help*"
+    (princ "Org-mode entities\n=================\n\n")
+    (let ((ll (append org-entities-user org-entities))
+	  e latex mathp html latin utf8 name ascii)
+      (princ "Symbol   Org entity        LaTeX code             HTML code\n")
+      (princ "-----------------------------------------------------------\n")
+      (while ll
+	(setq e (pop ll))
+	(setq name (car e)
+	      latex (nth 1 e)
+	      html (nth 3 e)
+	      utf8 (nth 6 e))
+	(princ (format "%-8s \\%-16s %-22s %-13s\n"
+		       utf8 name latex html))))))
+
 (defun replace-amp ()
 (defun replace-amp ()
   "Postprocess HTML file to unescape the ampersant."
   "Postprocess HTML file to unescape the ampersant."
   (interactive)
   (interactive)

+ 0 - 70
lisp/org-exp.el

@@ -448,35 +448,6 @@ This option can also be set with the +OPTIONS line, e.g. \"f:nil\"."
   :group 'org-export-translation
   :group 'org-export-translation
   :type 'boolean)
   :type 'boolean)
 
 
-(defcustom org-export-with-sub-superscripts t
-  "Non-nil means interpret \"_\" and \"^\" for export.
-When this option is turned on, you can use TeX-like syntax for sub- and
-superscripts.  Several characters after \"_\" or \"^\" will be
-considered as a single item - so grouping with {} is normally not
-needed.  For example, the following things will be parsed as single
-sub- or superscripts.
-
- 10^24   or   10^tau     several digits will be considered 1 item.
- 10^-12  or   10^-tau    a leading sign with digits or a word
- x^2-y^3                 will be read as x^2 - y^3, because items are
-			 terminated by almost any nonword/nondigit char.
- x_{i^2} or   x^(2-i)    braces or parenthesis do grouping.
-
-Still, ambiguity is possible - so when in doubt use {} to enclose the
-sub/superscript.  If you set this variable to the symbol `{}',
-the braces are *required* in order to trigger interpretations as
-sub/superscript.  This can be helpful in documents that need \"_\"
-frequently in plain text.
-
-Not all export backends support this, but HTML does.
-
-This option can also be set with the +OPTIONS line, e.g. \"^:nil\"."
-  :group 'org-export-translation
-  :type '(choice
-	  (const :tag "Always interpret" t)
-	  (const :tag "Only with braces" {})
-	  (const :tag "Never interpret" nil)))
-
 (defcustom org-export-with-TeX-macros t
 (defcustom org-export-with-TeX-macros t
   "Non-nil means interpret simple TeX-like macros when exporting.
   "Non-nil means interpret simple TeX-like macros when exporting.
 For example, HTML export converts \\alpha to &alpha; and \\AA to &Aring;.
 For example, HTML export converts \\alpha to &alpha; and \\AA to &Aring;.
@@ -520,12 +491,6 @@ This option can also be set with the +OPTIONS line, e.g. \"::nil\"."
   :group 'org-export-translation
   :group 'org-export-translation
   :type 'boolean)
   :type 'boolean)
 
 
-(defcustom org-match-sexp-depth 3
-  "Number of stacked braces for sub/superscript matching.
-This has to be set before loading org.el to be effective."
-  :group 'org-export-translation
-  :type 'integer)
-
 (defgroup org-export-tables nil
 (defgroup org-export-tables nil
   "Options for exporting tables in Org-mode."
   "Options for exporting tables in Org-mode."
   :tag "Org Export Tables"
   :tag "Org Export Tables"
@@ -2734,41 +2699,6 @@ If yes remove the column and the special lines."
     (setq s (replace-match "" t t s)))
     (setq s (replace-match "" t t s)))
   s)
   s)
 
 
-(defun org-create-multibrace-regexp (left right n)
-  "Create a regular expression which will match a balanced sexp.
-Opening delimiter is LEFT, and closing delimiter is RIGHT, both given
-as single character strings.
-The regexp returned will match the entire expression including the
-delimiters.  It will also define a single group which contains the
-match except for the outermost delimiters.  The maximum depth of
-stacked delimiters is N.  Escaping delimiters is not possible."
-  (let* ((nothing (concat "[^" left right "]*?"))
-	 (or "\\|")
-	 (re nothing)
-	 (next (concat "\\(?:" nothing left nothing right "\\)+" nothing)))
-    (while (> n 1)
-      (setq n (1- n)
-	    re (concat re or next)
-	    next (concat "\\(?:" nothing left next right "\\)+" nothing)))
-    (concat left "\\(" re "\\)" right)))
-
-(defvar org-match-substring-regexp
-  (concat
-   "\\([^\\]\\)\\([_^]\\)\\("
-   "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
-   "\\|"
-   "\\(" (org-create-multibrace-regexp "(" ")" org-match-sexp-depth) "\\)"
-   "\\|"
-   "\\(\\(?:\\*\\|[-+]?[^-+*!@#$%^_ \t\r\n,:\"?<>~;./{}=()]+\\)\\)\\)")
-  "The regular expression matching a sub- or superscript.")
-
-(defvar org-match-substring-with-braces-regexp
-  (concat
-   "\\([^\\]\\)\\([_^]\\)\\("
-   "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
-   "\\)")
-  "The regular expression matching a sub- or superscript, forcing braces.")
-
 
 
 (defun org-get-text-property-any (pos prop &optional object)
 (defun org-get-text-property-any (pos prop &optional object)
   (or (get-text-property pos prop object)
   (or (get-text-property pos prop object)

+ 11 - 2
lisp/org-html.el

@@ -570,8 +570,8 @@ DESCP is the boolean of whether there was a link description.
 See variables `org-export-html-inline-images' and
 See variables `org-export-html-inline-images' and
 `org-export-html-inline-image-extensions'."
 `org-export-html-inline-image-extensions'."
    (declare (special 
    (declare (special 
-	       org-export-html-inline-images 
-	       org-export-html-inline-image-extensions))
+	     org-export-html-inline-images 
+	     org-export-html-inline-image-extensions))
    (or 
    (or 
       (eq t org-export-html-inline-images)
       (eq t org-export-html-inline-images)
       (and 
       (and 
@@ -1171,6 +1171,15 @@ lang=\"%s\" xml:lang=\"%s\">
 		  desc2 (if (match-end 2) (concat type ":" path) path)
 		  desc2 (if (match-end 2) (concat type ":" path) path)
 		  descp (and desc1 (not (equal desc1 desc2)))
 		  descp (and desc1 (not (equal desc1 desc2)))
 		  desc (or desc1 desc2))
 		  desc (or desc1 desc2))
+	     ;; Make an image out of the description if that is so wanted
+	    (when (and descp (org-file-image-p
+				desc org-export-html-inline-image-extensions))
+	       (save-match-data
+		  (if (string-match "^file:" desc)
+		     (setq desc (substring desc (match-end 0)))))
+	       (setq desc (org-add-props
+			     (concat "<img src=\"" desc "\"/>")
+			     '(org-protected t))))
 	    (cond
 	    (cond
 	     ((equal type "internal")
 	     ((equal type "internal")
 		(let 
 		(let 

+ 2 - 1
lisp/org-macs.el

@@ -162,7 +162,8 @@ We use a macro so that the test can happen at compilation time."
   `(let ((inhibit-read-only t)) ,@body))
   `(let ((inhibit-read-only t)) ,@body))
 
 
 (defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t
 (defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t
-				   rear-nonsticky t mouse-map t fontified t)
+				   rear-nonsticky t mouse-map t fontified t
+				   org-emphasis t)
   "Properties to remove when a string without properties is wanted.")
   "Properties to remove when a string without properties is wanted.")
 
 
 (defsubst org-match-string-no-properties (num &optional string)
 (defsubst org-match-string-no-properties (num &optional string)

+ 10 - 4
lisp/org-table.el

@@ -629,7 +629,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
 		 (make-string sp2 ?\ ) "%%%s%ds" (make-string sp1 ?\ ) "|"))
 		 (make-string sp2 ?\ ) "%%%s%ds" (make-string sp1 ?\ ) "|"))
 	 (hfmt1 (concat
 	 (hfmt1 (concat
 		 (make-string sp2 ?-) "%s" (make-string sp1 ?-) "+"))
 		 (make-string sp2 ?-) "%s" (make-string sp1 ?-) "+"))
-	 emptystrings links dates emph narrow
+	 emptystrings links dates emph raise narrow
 	 falign falign1 fmax f1 len c e space)
 	 falign falign1 fmax f1 len c e space)
     (untabify beg end)
     (untabify beg end)
     (remove-text-properties beg end '(org-cwidth t org-dwidth t display t))
     (remove-text-properties beg end '(org-cwidth t org-dwidth t display t))
@@ -640,6 +640,9 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
     (setq emph (and org-hide-emphasis-markers
     (setq emph (and org-hide-emphasis-markers
 		    (re-search-forward org-emph-re end t)))
 		    (re-search-forward org-emph-re end t)))
     (goto-char beg)
     (goto-char beg)
+    (setq raise (and org-use-sub-superscripts
+		    (re-search-forward org-match-substring-regexp end t)))
+    (goto-char beg)
     (setq dates (and org-display-custom-times
     (setq dates (and org-display-custom-times
 		     (re-search-forward org-ts-regexp-both end t)))
 		     (re-search-forward org-ts-regexp-both end t)))
     ;; Make sure the link properties are right
     ;; Make sure the link properties are right
@@ -647,6 +650,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
     ;; Make sure the date properties are right
     ;; Make sure the date properties are right
     (when dates (goto-char beg) (while (org-activate-dates end)))
     (when dates (goto-char beg) (while (org-activate-dates end)))
     (when emph (goto-char beg) (while (org-do-emphasis-faces end)))
     (when emph (goto-char beg) (while (org-do-emphasis-faces end)))
+    (when raise (goto-char beg) (while (org-raise-scripts end)))
 
 
     ;; Check if we are narrowing any columns
     ;; Check if we are narrowing any columns
     (goto-char beg)
     (goto-char beg)
@@ -737,14 +741,16 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
 
 
     ;; With invisible characters, `format' does not get the field width right
     ;; With invisible characters, `format' does not get the field width right
     ;; So we need to make these fields wide by hand.
     ;; So we need to make these fields wide by hand.
-    (when (or links emph)
+    (when (or links emph raise)
       (loop for i from 0 upto (1- maxfields) do
       (loop for i from 0 upto (1- maxfields) do
 	    (setq len (nth i lengths))
 	    (setq len (nth i lengths))
 	    (loop for j from 0 upto (1- (length fields)) do
 	    (loop for j from 0 upto (1- (length fields)) do
 		  (setq c (nthcdr i (car (nthcdr j fields))))
 		  (setq c (nthcdr i (car (nthcdr j fields))))
 		  (if (and (stringp (car c))
 		  (if (and (stringp (car c))
-			   (text-property-any 0 (length (car c)) 'invisible 'org-link (car c))
-;			   (string-match org-bracket-link-regexp (car c))
+			   (or (text-property-any 0 (length (car c))
+						  'invisible 'org-link (car c))
+			       (text-property-any 0 (length (car c))
+						  'org-dwidth t (car c)))
 			   (< (org-string-width (car c)) len))
 			   (< (org-string-width (car c)) len))
 		      (progn
 		      (progn
 			(setq space (make-string (- len (org-string-width (car c))) ?\ ))
 			(setq space (make-string (- len (org-string-width (car c))) ?\ ))

+ 167 - 7
lisp/org.el

@@ -344,6 +344,39 @@ the following lines anywhere in the buffer:
 	  (const :tag "Not" nil)
 	  (const :tag "Not" nil)
 	  (const :tag "Globally (slow on startup in large files)" t)))
 	  (const :tag "Globally (slow on startup in large files)" t)))
 
 
+(defcustom org-use-sub-superscripts t
+  "Non-nil means interpret \"_\" and \"^\" for export.
+When this option is turned on, you can use TeX-like syntax for sub- and
+superscripts.  Several characters after \"_\" or \"^\" will be
+considered as a single item - so grouping with {} is normally not
+needed.  For example, the following things will be parsed as single
+sub- or superscripts.
+
+ 10^24   or   10^tau     several digits will be considered 1 item.
+ 10^-12  or   10^-tau    a leading sign with digits or a word
+ x^2-y^3                 will be read as x^2 - y^3, because items are
+			 terminated by almost any nonword/nondigit char.
+ x_{i^2} or   x^(2-i)    braces or parenthesis do grouping.
+
+Still, ambiguity is possible - so when in doubt use {} to enclose the
+sub/superscript.  If you set this variable to the symbol `{}',
+the braces are *required* in order to trigger interpretations as
+sub/superscript.  This can be helpful in documents that need \"_\"
+frequently in plain text.
+
+Not all export backends support this, but HTML does.
+
+This option can also be set with the +OPTIONS line, e.g. \"^:nil\"."
+  :group 'org-startup
+  :group 'org-export-translation
+  :type '(choice
+	  (const :tag "Always interpret" t)
+	  (const :tag "Only with braces" {})
+	  (const :tag "Never interpret" nil)))
+
+(defvaralias 'org-export-with-sub-superscripts 'org-use-sub-superscripts)
+
+
 (defcustom org-startup-with-beamer-mode nil
 (defcustom org-startup-with-beamer-mode nil
   "Non-nil means turn on `org-beamer-mode' on startup.
   "Non-nil means turn on `org-beamer-mode' on startup.
 This can also be configured on a per-file basis by adding one of
 This can also be configured on a per-file basis by adding one of
@@ -891,6 +924,18 @@ When t, the following will happen while the cursor is in the headline:
   :group 'org-edit-structure
   :group 'org-edit-structure
   :type 'boolean)
   :type 'boolean)
 
 
+(defcustom org-ctrl-k-protect-subtree nil
+  "Non-nil means, do not delete a hidden subtree with C-k.
+When set to the symbol `error', simply throw an error when C-k is
+used to kill (part-of) a headline that has hidden text behind it.
+Any other non-nil value will result in a query to the user, if it is
+OK to kill that hidden subtree.  When nil, kill without remorse."
+  :group 'org-edit-structure
+  :type '(choice
+	  (const :tag "Do not protect hidden subtrees" nil)
+	  (const :tag "Protect hidden subtrees with a security query" t)
+	  (const :tag "Never kill a hidden subtree with C-k" error)))
+
 (defcustom org-yank-folded-subtrees t
 (defcustom org-yank-folded-subtrees t
   "Non-nil means when yanking subtrees, fold them.
   "Non-nil means when yanking subtrees, fold them.
 If the kill is a single subtree, or a sequence of subtrees, i.e. if
 If the kill is a single subtree, or a sequence of subtrees, i.e. if
@@ -3176,6 +3221,11 @@ When nil, the \\name form remains in the buffer."
   :group 'org-appearance
   :group 'org-appearance
   :type 'boolean)
   :type 'boolean)
 
 
+(defcustom org-pretty-entities-include-sub-superscripts t
+  "Non-nil means, pretty entity display includes formatting sub/superscripts."
+  :group 'org-appearance
+  :type 'boolean)
+
 (defvar org-emph-re nil
 (defvar org-emph-re nil
   "Regular expression for matching emphasis.
   "Regular expression for matching emphasis.
 After a match, the match groups contain these elements:
 After a match, the match groups contain these elements:
@@ -4047,9 +4097,11 @@ means to push this value onto the list in the variable.")
     (let ((re (org-make-options-regexp
     (let ((re (org-make-options-regexp
 	       '("CATEGORY" "TODO" "COLUMNS"
 	       '("CATEGORY" "TODO" "COLUMNS"
 		 "STARTUP" "ARCHIVE" "FILETAGS" "TAGS" "LINK" "PRIORITIES"
 		 "STARTUP" "ARCHIVE" "FILETAGS" "TAGS" "LINK" "PRIORITIES"
-		 "CONSTANTS" "PROPERTY" "DRAWERS" "SETUPFILE" "LATEX_CLASS")
+		 "CONSTANTS" "PROPERTY" "DRAWERS" "SETUPFILE" "LATEX_CLASS"
+		 "OPTIONS")
 	       "\\(?:[a-zA-Z][0-9a-zA-Z_]*_TODO\\)"))
 	       "\\(?:[a-zA-Z][0-9a-zA-Z_]*_TODO\\)"))
 	  (splitre "[ \t]+")
 	  (splitre "[ \t]+")
+	  (scripts org-use-sub-superscripts)
 	  kwds kws0 kwsa key log value cat arch tags const links hw dws
 	  kwds kws0 kwsa key log value cat arch tags const links hw dws
 	  tail sep kws1 prio props ftags drawers beamer-p
 	  tail sep kws1 prio props ftags drawers beamer-p
 	  ext-setup-or-nil setup-contents (start 0))
 	  ext-setup-or-nil setup-contents (start 0))
@@ -4122,6 +4174,9 @@ means to push this value onto the list in the variable.")
 				      '(face t fontified t) arch))
 				      '(face t fontified t) arch))
 	     ((equal key "LATEX_CLASS")
 	     ((equal key "LATEX_CLASS")
 	      (setq beamer-p (equal value "beamer")))
 	      (setq beamer-p (equal value "beamer")))
+	     ((equal key "OPTIONS")
+	      (if (string-match "\\([ \t]\\|\\`\\)\\^:\\(t\\|nil\\|{}\\)" value)
+		  (setq scripts (read (match-string 2 value)))))
 	     ((equal key "SETUPFILE")
 	     ((equal key "SETUPFILE")
 	      (setq setup-contents (org-file-contents
 	      (setq setup-contents (org-file-contents
 				    (expand-file-name
 				    (expand-file-name
@@ -4134,6 +4189,7 @@ means to push this value onto the list in the variable.")
 			      "\n" setup-contents "\n"
 			      "\n" setup-contents "\n"
 			      (substring ext-setup-or-nil start)))))
 			      (substring ext-setup-or-nil start)))))
 	     ))))
 	     ))))
+      (org-set-local 'org-use-sub-superscripts scripts)
       (when cat
       (when cat
 	(org-set-local 'org-category (intern cat))
 	(org-set-local 'org-category (intern cat))
 	(push (cons "CATEGORY" cat) props))
 	(push (cons "CATEGORY" cat) props))
@@ -4617,6 +4673,47 @@ Here is what the match groups contain after a match:
 (defvar org-any-link-re nil
 (defvar org-any-link-re nil
   "Regular expression matching any link.")
   "Regular expression matching any link.")
 
 
+(defcustom org-match-sexp-depth 3
+  "Number of stacked braces for sub/superscript matching.
+This has to be set before loading org.el to be effective."
+  :group 'org-export-translation ; ??????????????????????????/
+  :type 'integer)
+
+(defun org-create-multibrace-regexp (left right n)
+  "Create a regular expression which will match a balanced sexp.
+Opening delimiter is LEFT, and closing delimiter is RIGHT, both given
+as single character strings.
+The regexp returned will match the entire expression including the
+delimiters.  It will also define a single group which contains the
+match except for the outermost delimiters.  The maximum depth of
+stacked delimiters is N.  Escaping delimiters is not possible."
+  (let* ((nothing (concat "[^" left right "]*?"))
+	 (or "\\|")
+	 (re nothing)
+	 (next (concat "\\(?:" nothing left nothing right "\\)+" nothing)))
+    (while (> n 1)
+      (setq n (1- n)
+	    re (concat re or next)
+	    next (concat "\\(?:" nothing left next right "\\)+" nothing)))
+    (concat left "\\(" re "\\)" right)))
+
+(defvar org-match-substring-regexp
+  (concat
+   "\\([^\\]\\)\\([_^]\\)\\("
+   "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
+   "\\|"
+   "\\(" (org-create-multibrace-regexp "(" ")" org-match-sexp-depth) "\\)"
+   "\\|"
+   "\\(\\(?:\\*\\|[-+]?[^-+*!@#$%^_ \t\r\n,:\"?<>~;./{}=()]+\\)\\)\\)")
+  "The regular expression matching a sub- or superscript.")
+
+(defvar org-match-substring-with-braces-regexp
+  (concat
+   "\\([^\\]\\)\\([_^]\\)\\("
+   "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
+   "\\)")
+  "The regular expression matching a sub- or superscript, forcing braces.")
+
 (defun org-make-link-regexps ()
 (defun org-make-link-regexps ()
   "Update the link regular expressions.
   "Update the link regular expressions.
 This should be called after the variable `org-link-types' has changed."
 This should be called after the variable `org-link-types' has changed."
@@ -4721,7 +4818,7 @@ The time stamps may be either active or inactive.")
 		 (org-remove-flyspell-overlays-in
 		 (org-remove-flyspell-overlays-in
 		  (match-beginning 0) (match-end 0)))
 		  (match-beginning 0) (match-end 0)))
 	    (add-text-properties (match-beginning 2) (match-end 2)
 	    (add-text-properties (match-beginning 2) (match-end 2)
-				 '(font-lock-multiline t))
+				 '(font-lock-multiline t org-emphasis t))
 	    (when org-hide-emphasis-markers
 	    (when org-hide-emphasis-markers
 	      (add-text-properties (match-end 4) (match-beginning 5)
 	      (add-text-properties (match-end 4) (match-beginning 5)
 				   '(invisible org-link))
 				   '(invisible org-link))
@@ -5249,6 +5346,7 @@ For plain list items, if they are matched by `outline-regexp', this returns
 	   ;; Specials
 	   ;; Specials
 	   '(org-do-latex-and-special-faces)
 	   '(org-do-latex-and-special-faces)
 	   '(org-fontify-entities)
 	   '(org-fontify-entities)
+	   '(org-raise-scripts)
 	   ;; Code
 	   ;; Code
 	   '(org-activate-code (1 'org-code t))
 	   '(org-activate-code (1 'org-code t))
 	   ;; COMMENT
 	   ;; COMMENT
@@ -5283,9 +5381,11 @@ For plain list items, if they are matched by `outline-regexp', this returns
   (let (ee)
   (let (ee)
     (when org-pretty-entities
     (when org-pretty-entities
       (catch 'match
       (catch 'match
-	(while (re-search-forward "\\\\\\([a-zA-Z][a-zA-Z0-9]*\\)[^[:alnum:]]"
-				  limit t)
-	  (if (and (setq ee (org-entity-get (match-string 1)))
+	(while (re-search-forward
+		"\\\\\\([a-zA-Z][a-zA-Z0-9]*\\)\\($\\|[^[:alnum:]\n]\\)"
+		limit t)
+	  (if (and (not (org-in-indented-comment-line))
+		   (setq ee (org-entity-get (match-string 1)))
 		   (= (length (nth 6 ee)) 1))
 		   (= (length (nth 6 ee)) 1))
 	      (progn
 	      (progn
 		(add-text-properties
 		(add-text-properties
@@ -5373,6 +5473,7 @@ If KWD is a number, get the corresponding match group."
 	 (inhibit-read-only t) (inhibit-point-motion-hooks t)
 	 (inhibit-read-only t) (inhibit-point-motion-hooks t)
 	 (inhibit-modification-hooks t)
 	 (inhibit-modification-hooks t)
 	 deactivate-mark buffer-file-name buffer-file-truename)
 	 deactivate-mark buffer-file-name buffer-file-truename)
+    (decompose-region beg end)
     (remove-text-properties
     (remove-text-properties
      beg end
      beg end
      (if org-indent-mode
      (if org-indent-mode
@@ -5380,10 +5481,64 @@ If KWD is a number, get the corresponding match group."
 	 '(mouse-face t keymap t org-linked-text t
 	 '(mouse-face t keymap t org-linked-text t
 		      invisible t intangible t
 		      invisible t intangible t
 		      line-prefix t wrap-prefix t
 		      line-prefix t wrap-prefix t
-		      org-no-flyspell t)
+		      org-no-flyspell t org-emphasis t)
        '(mouse-face t keymap t org-linked-text t
        '(mouse-face t keymap t org-linked-text t
 		    invisible t intangible t
 		    invisible t intangible t
-		    org-no-flyspell t)))))
+		    org-no-flyspell t org-emphasis t)))
+    (org-remove-font-lock-display-properties beg end)))
+
+(defconst org-script-display  '(((raise -0.3) (height 0.7))
+				((raise 0.3)  (height 0.7))
+				((raise -0.5))
+				((raise 0.5)))
+  "Display properties for showing superscripts and subscripts.")
+
+(defun org-remove-font-lock-display-properties (beg end)
+  "Remove specific display properties that have been added by font lock.
+The will remove the raise properties that are used to show superscripts
+and subscriipts."
+  (let (next prop)
+    (while (< beg end)
+      (setq next (next-single-property-change beg 'display nil end)
+	    prop (get-text-property beg 'display))
+      (if (member prop org-script-display)
+	  (put-text-property beg next 'display nil))
+      (setq beg next))))
+
+(defun org-raise-scripts (limit)
+  "Add raise properties to sub/superscripts."
+  (when (and org-pretty-entities org-pretty-entities-include-sub-superscripts)
+    (if (re-search-forward
+	 (if (eq org-use-sub-superscripts t)
+	     org-match-substring-regexp
+	   org-match-substring-with-braces-regexp)
+	 limit t)
+	(let* ((pos (point)) table-p comment-p emph-p)
+	  (setq emph-p (get-text-property (match-beginning 3) 'org-emphasis))
+	  (goto-char (point-at-bol))
+	  (setq table-p (org-looking-at-p org-table-dataline-regexp)
+		comment-p (org-looking-at-p "[ \t]*#"))
+	  (goto-char pos)
+	  (if (or comment-p emph-p)
+	      t
+	    (put-text-property (match-beginning 3) (match-end 0)
+			       'display
+			       (if (equal (char-after (match-beginning 2)) ?^)
+				   (nth (if table-p 3 1) org-script-display)
+				 (nth (if table-p 2 0) org-script-display)))
+	    (add-text-properties (match-beginning 2) (match-end 2)
+				 (list 'invisible t
+				       'org-dwidth t 'org-dwidth-n 1))
+	    (if (and (eq (char-after (match-beginning 3)) ?{)
+		     (eq (char-before (match-end 3)) ?}))
+		(progn
+		  (add-text-properties
+		   (match-beginning 3) (1+ (match-beginning 3))
+		   (list 'invisible t 'org-dwidth t 'org-dwidth-n 1))
+		  (add-text-properties
+		   (1- (match-end 3)) (match-end 3)
+		   (list 'invisible t 'org-dwidth t 'org-dwidth-n 1))))
+	    t)))))
 
 
 ;;;; Visibility cycling, including org-goto and indirect buffer
 ;;;; Visibility cycling, including org-goto and indirect buffer
 
 
@@ -18441,6 +18596,11 @@ depending on context."
    ((or (not org-special-ctrl-k)
    ((or (not org-special-ctrl-k)
 	(bolp)
 	(bolp)
 	(not (org-on-heading-p)))
 	(not (org-on-heading-p)))
+    (if (and (get-char-property (min (point-max) (point-at-eol)) 'invisible)
+	     org-ctrl-k-protect-subtree)
+	(if (or (eq org-ctrl-k-protect-subtree 'error)
+		(not (y-or-n-p "Kill hidden subtree along with headline? ")))
+	    (error "C-k aborted - would kill hidden subtree")))
     (call-interactively 'kill-line))
     (call-interactively 'kill-line))
    ((looking-at (org-re ".*?\\S-\\([ \t]+\\(:[[:alnum:]_@:]+:\\)\\)[ \t]*$"))
    ((looking-at (org-re ".*?\\S-\\([ \t]+\\(:[[:alnum:]_@:]+:\\)\\)[ \t]*$"))
     (kill-region (point) (match-beginning 1))
     (kill-region (point) (match-beginning 1))