emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111456: Merge from emacs-24; up to r


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111456: Merge from emacs-24; up to r111157
Date: Wed, 09 Jan 2013 00:30:21 -0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111456 [merge]
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2013-01-09 00:30:21 -0800
message:
  Merge from emacs-24; up to r111157
modified:
  doc/misc/ChangeLog
  doc/misc/org.texi
  etc/ORG-NEWS
  etc/refcards/orgcard.pdf
  etc/refcards/orgcard.tex
  lisp/ChangeLog
  lisp/comint.el
  lisp/emacs-lisp/trace.el
  lisp/international/mule-cmds.el
  lisp/org/ChangeLog
  lisp/org/ob-eval.el
  lisp/org/ob-exp.el
  lisp/org/org-agenda.el
  lisp/org/org-ascii.el
  lisp/org/org-capture.el
  lisp/org/org-clock.el
  lisp/org/org-colview.el
  lisp/org/org-compat.el
  lisp/org/org-crypt.el
  lisp/org/org-docbook.el
  lisp/org/org-element.el
  lisp/org/org-exp.el
  lisp/org/org-faces.el
  lisp/org/org-html.el
  lisp/org/org-icalendar.el
  lisp/org/org-id.el
  lisp/org/org-inlinetask.el
  lisp/org/org-install.el
  lisp/org/org-jsinfo.el
  lisp/org/org-latex.el
  lisp/org/org-list.el
  lisp/org/org-lparse.el
  lisp/org/org-macs.el
  lisp/org/org-mobile.el
  lisp/org/org-odt.el
  lisp/org/org-protocol.el
  lisp/org/org-publish.el
  lisp/org/org-src.el
  lisp/org/org-table.el
  lisp/org/org-version.el
  lisp/org/org.el
  lisp/progmodes/compile.el
=== modified file 'doc/misc/ChangeLog'
--- a/doc/misc/ChangeLog        2013-01-08 00:11:51 +0000
+++ b/doc/misc/ChangeLog        2013-01-09 08:30:21 +0000
@@ -1,3 +1,18 @@
+2013-01-09  Bastien Guerry  <address@hidden>
+
+       * org.texi (Pushing to MobileOrg): Add footnote about using
+       symbolic links in `org-directory'.
+       (Timestamps, Deadlines and scheduling): Use `diary-float' instead
+       of the now obsolete alias `org-float'.
+       (TODO basics): Add `org-use-fast-todo-selection' to the variable
+       index.  Fix description of TODO keywords cycling.
+       (Advanced features): Add missing argument for @item.
+       (Storing searches): Add index entries and a note about
+       *-tree agenda views.
+       (Structure editing): Document `org-mark-element' and
+       `org-mark-subtree'.
+       (Tag inheritance): Document `org-agenda-use-tag-inheritance'.
+
 2013-01-08  Juri Linkov  <address@hidden>
 
        * info.texi (Go to node): Mention the abbreviated format

=== modified file 'doc/misc/org.texi'
--- a/doc/misc/org.texi 2013-01-06 20:34:54 +0000
+++ b/doc/misc/org.texi 2013-01-09 08:30:21 +0000
@@ -2,7 +2,7 @@
 @c %**start of header
 @setfilename ../../info/org
 @settitle The Org Manual
address@hidden VERSION 7.9.2 (GNU Emacs 24.3)
address@hidden VERSION 7.9.3+ (GNU Emacs 24.3)
 
 @c Use proper quote and backtick for code sections in PDF output
 @c Cf. Texinfo manual 14.2
@@ -1470,6 +1470,13 @@
 level).
 @address@hidden,org-move-subtree-down}
 Move subtree down (swap with next subtree of same level).
address@hidden,org-mark-element}
+Mark the element at point.  Hitting repeatedly will mark subsequent elements
+of the one just marked.  E.g. hitting @key{M-h} on a paragraph will mark it,
+hitting @key{M-h} immediately again will mark the next one.
address@hidden @@,org-mark-subtree}
+Mark the subtree at point.  Hitting repeatedly will mark subsequent subtrees
+of the same level than the marked subtree.
 @orgcmd{C-c C-x C-w,org-cut-subtree}
 Kill subtree, i.e., remove it from buffer but save in kill ring.
 With a numeric prefix argument N, kill N sequential subtrees.
@@ -3747,6 +3754,8 @@
 @table @kbd
 @orgcmd{C-c C-t,org-todo}
 @cindex cycling, of TODO states
address@hidden org-use-fast-todo-selection
+
 Rotate the TODO state of the current item among
 
 @example
@@ -3754,14 +3763,19 @@
 '--------------------------------'
 @end example
 
-The same rotation can also be done ``remotely'' from the timeline and
-agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
+If TODO keywords have fast access keys (see @ref{Fast access to TODO
+states}), you will be prompted for a TODO keyword through the fast selection
+interface; this is the default behavior when
address@hidden is @code{non-nil}.
+
+The same rotation can also be done ``remotely'' from the timeline and agenda
+buffers with the @kbd{t} command key (@pxref{Agenda commands}).
 
 @orgkey{C-u C-c C-t}
-Select a specific keyword using completion or (if it has been set up)
-the fast selection interface.  For the latter, you need to assign keys
-to TODO states, see @ref{Per-file keywords}, and @ref{Setting tags}, for
-more information.
+When TODO keywords have no selection keys, select a specific keyword using
+completion; otherwise force cycling through TODO states with no prompt.  When
address@hidden is set to @code{prefix}, use the fast
+selection interface.
 
 @kindex address@hidden
 @kindex address@hidden
@@ -4617,9 +4631,8 @@
 @noindent
 @vindex org-use-tag-inheritance
 @vindex org-tags-exclude-from-inheritance
-To limit tag inheritance to specific tags, or to turn it off entirely, use
-the variables @code{org-use-tag-inheritance} and
address@hidden
+To limit tag inheritance to specific tags, use 
@code{org-tags-exclude-from-inheritance}.
+To turn it off entirely, use @code{org-use-tag-inheritance}.
 
 @vindex org-tags-match-list-sublevels
 When a headline matches during a tags search while tag inheritance is turned
@@ -4630,6 +4643,15 @@
 match in a subtree, configure the variable
 @code{org-tags-match-list-sublevels} (not recommended).
 
address@hidden org-agenda-use-tag-inheritance
+Tag inheritance is relevant when the agenda search tries to match a tag,
+either in the @code{tags} or @code{tags-todo} agenda types.  In other agenda
+types, @code{org-use-tag-inheritance} has no effect.  Still, you may want to
+have your tags correctly set in the agenda, so that tag filtering works fine,
+with inherited tags.  Set @code{org-agenda-use-tag-inheritance} to control
+this: the default value includes all agenda types, but setting this to nil
+can really speed up agenda generation.
+
 @node Setting tags, Tag searches, Tag inheritance, Tags
 @section Setting tags
 @cindex setting tags
@@ -5512,7 +5534,7 @@
 
 @example
 * 22:00-23:00 The nerd meeting on every 2nd Thursday of the month
-  <%%(org-float t 4 2)>
+  <%%(diary-float t 4 2)>
 @end example
 
 @item Time/Date range
@@ -5850,7 +5872,7 @@
 assumption that the timestamp represents the @i{nearest instance} of
 the repeater.  However, the use of diary sexp entries like
 @c
address@hidden<%%(org-float t 42)>}
address@hidden<%%(diary-float t 42)>}
 @c
 in scheduling and deadline timestamps is limited.  Org mode does not
 know enough about the internals of each sexp function to issue early and
@@ -6539,7 +6561,7 @@
 @table @kbd
 @orgcmd{C-c c,org-capture}
 Call the command @code{org-capture}.  Note that this keybinding is global and
-not active by default; you need to install it.  If you have templates
+not active by default: you need to install it.  If you have templates
 @cindex date tree
 defined @pxref{Capture templates}, it will offer these templates for
 selection or use a new Org outline node as the default template.  It will
@@ -8621,6 +8643,13 @@
 buffer).
 @kindex C-c a C
 @vindex org-agenda-custom-commands
address@hidden agenda views, main example
address@hidden tags, as an agenda view
address@hidden todo, as an agenda view
address@hidden tags-todo
address@hidden todo-tree
address@hidden occur-tree
address@hidden tags-tree
 
 Custom commands are configured in the variable
 @code{org-agenda-custom-commands}.  You can customize this variable, for
@@ -8681,6 +8710,9 @@
 Peter, or Kim) as additional tag to match.
 @end table
 
+Note that the @code{*-tree} agenda views need to be called from an
+Org buffer as they operate on the current buffer only.
+
 @node Block agenda, Setting Options, Storing searches, Custom agenda views
 @subsection Block agenda
 @cindex block agenda
@@ -16537,14 +16569,18 @@
 all agenda files (as listed in @code{org-agenda-files}), but additional files
 can be included by customizing @code{org-mobile-files}.  File names will be
 staged with paths relative to @code{org-directory}, so all files should be
-inside this directory.  The push operation also creates a special Org file
address@hidden with all custom agenda view defined by the
address@hidden creating the agendas, Org mode will force ID properties
-on all referenced entries, so that these entries can be uniquely identified
-if @i{MobileOrg} flags them for further action.  If you do not want to get
-these properties in so many entries, you can set the variable
address@hidden to @code{nil}.  Org mode will then
-rely on outline paths, in the hope that these will be unique enough.}.
+inside this address@hidden links in @code{org-directory} need to
+have the same name than their targets.}.
+
+The push operation also creates a special Org file @file{agendas.org} with
+all custom agenda view defined by the address@hidden creating the
+agendas, Org mode will force ID properties on all referenced entries, so that
+these entries can be uniquely identified if @i{MobileOrg} flags them for
+further action.  If you do not want to get these properties in so many
+entries, you can set the variable @code{org-mobile-force-id-on-agenda-items}
+to @code{nil}.  Org mode will then rely on outline paths, in the hope that
+these will be unique enough.}.
+
 Finally, Org writes the file @file{index.org}, containing links to all other
 files.  @i{MobileOrg} first reads this file from the server, and then
 downloads all agendas and Org files listed in it.  To speed up the download,

=== modified file 'etc/ORG-NEWS'
--- a/etc/ORG-NEWS      2013-01-01 09:11:05 +0000
+++ b/etc/ORG-NEWS      2013-01-08 22:02:09 +0000
@@ -1,10 +1,54 @@
 ORG NEWS -- history of user-visible changes.           -*- org -*-
 
+#+LINK: doc http://orgmode.org/worg/doc.html#%s
+
 Copyright (C) 2012-2013 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Org bug reports to address@hidden
 
+* Version 7.9.3
+
+** New option 
[[doc::org-agenda-use-tag-inheritance][org-agenda-use-tag-inheritance]]
+
+[[doc::org-use-tag-inheritance][org-use-tag-inheritance]] controls whether 
tags are inherited when
+org-tags-view is called (either in =tags=, =tags-tree= or =tags-todo=
+agenda views.)
+
+When generating other agenda types such as =agenda=, =todo= and
+=todo-tree=, tags inheritance is not used when selecting the entries
+to display.  Still, you might want to have all tag information correct
+in the agenda buffer, e.g. for tag filtering.  In that case, add the
+agenda type to this variable.
+
+Setting this variable to nil should considerably speeds up the agenda
+generation.
+
+Note that the default was to display inherited tags in the agenda
+lines even if `org-use-tag-inheritance' was nil.  The default is now
+to *never* display inherited tags in agenda lines, but to /know/ about
+them when the agenda type is listed in 
[[doc::org-agenda-use-tag-inheritance][org-agenda-use-tag-inheritance]].
+
+** New default value nil for 
[[doc::org-agenda-dim-blocked-tasks][org-agenda-dim-blocked-tasks]]
+
+Using `nil' as the default value speeds up the agenda generation.  You
+can hit `#' (or `C-u #') in agenda buffers to temporarily dim (or turn
+invisible) blocked tasks.
+
+** New speedy keys for 
[[doc::org-speed-commands-default][org-speed-commands-default]]
+
+You can now use `:' (instead of `;') for setting tags---this is
+consistent with using the `:' key in agenda view.
+
+You can now use `=' for [[doc::org-columns][org-columns]].
+
+** =org-float= is now obsolete, use =diary-float= instead
+** Enhanced compatibility with Emacs 22 and XEmacs
+
+Thanks to Achim for his work on enhancing Org's compatibility with
+various Emacsen.  Things may not be perfect, but Org should work okay
+in most environments.
+
 * Version 7.9.2
 
 ** New ELPA repository for Org packages

=== modified file 'etc/refcards/orgcard.pdf'
Binary files a/etc/refcards/orgcard.pdf 2013-01-03 02:11:33 +0000 and 
b/etc/refcards/orgcard.pdf        2013-01-08 14:27:18 +0000 differ
=== modified file 'etc/refcards/orgcard.tex'
--- a/etc/refcards/orgcard.tex  2013-01-01 09:11:05 +0000
+++ b/etc/refcards/orgcard.tex  2013-01-08 22:02:09 +0000
@@ -1,6 +1,6 @@
 % Reference Card for Org Mode
-\def\orgversionnumber{7.9.2}
-\def\versionyear{2012}          % latest update
+\def\orgversionnumber{7.9.3}
+\def\versionyear{2013}          % latest update
 \input emacsver.tex
 
 %**start of header

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-01-09 08:17:47 +0000
+++ b/lisp/ChangeLog    2013-01-09 08:30:21 +0000
@@ -1,3 +1,27 @@
+2013-01-09  Glenn Morris  <address@hidden>
+
+       * emacs-lisp/trace.el (trace-function-foreground)
+       (trace-function-background): Doc fix.
+
+2013-01-09  Juri Linkov  <address@hidden>
+
+       * international/mule-cmds.el (read-char-by-name): Move let-binding
+       of completion-ignore-case around completing-read to fix regression
+       exhibited by the test case `C-x 8 RET *acc TAB' and caused by
+       `string-match-p' using the nil value of `case-fold-search' and
+       `completion-ignore-case' in `completion-pcm--all-completions'.
+       (Bug#12615).
+
+2013-01-09  Glenn Morris  <address@hidden>
+
+       * progmodes/compile.el (compilation-parse-errors):
+       Fix typo.  (Bug#13369)
+
+2013-01-09  Vitalie Spinu  <address@hidden>  (tiny change)
+
+       * comint.el (comint-send-input): Check size of buffer before
+       waiting for process output, in case already accepted.  (Bug#13290)
+
 2013-01-09  Paul Eggert  <address@hidden>
 
        Spelling fixes.

=== modified file 'lisp/comint.el'
--- a/lisp/comint.el    2013-01-02 16:13:04 +0000
+++ b/lisp/comint.el    2013-01-09 08:30:21 +0000
@@ -1847,9 +1847,9 @@
           (let ((echo-len (- comint-last-input-end
                              comint-last-input-start)))
             ;; Wait for all input to be echoed:
-            (while (and (accept-process-output proc)
-                        (> (+ comint-last-input-end echo-len)
+            (while (and (> (+ comint-last-input-end echo-len)
                            (point-max))
+                        (accept-process-output proc)
                         (zerop
                          (compare-buffer-substrings
                           nil comint-last-input-start

=== modified file 'lisp/emacs-lisp/trace.el'
--- a/lisp/emacs-lisp/trace.el  2013-01-09 04:01:57 +0000
+++ b/lisp/emacs-lisp/trace.el  2013-01-09 08:30:21 +0000
@@ -266,7 +266,9 @@
 trace advice for FUNCTION and activates it together with any other advice
 there might be!!  The trace BUFFER will popup whenever FUNCTION is called.
 Do not use this to trace functions that switch buffers or do any other
-display oriented stuff, use `trace-function-background' instead."
+display oriented stuff, use `trace-function-background' instead.
+
+To untrace a function, use `untrace-function' or `untrace-all'."
   (interactive (trace--read-args "Trace function: "))
   (trace-function-internal function buffer nil context))
 
@@ -280,7 +282,9 @@
 The trace output goes to BUFFER quietly, without changing
 the window or buffer configuration.
 
-BUFFER defaults to `trace-buffer'."
+BUFFER defaults to `trace-buffer'.
+
+To untrace a function, use `untrace-function' or `untrace-all'."
   (interactive (trace--read-args "Trace function in background: "))
   (trace-function-internal function buffer t context))
 

=== modified file 'lisp/international/mule-cmds.el'
--- a/lisp/international/mule-cmds.el   2013-01-02 16:13:04 +0000
+++ b/lisp/international/mule-cmds.el   2013-01-09 08:30:21 +0000
@@ -2946,14 +2946,14 @@
 point or a number in hash notation, e.g. #o21430 for octal,
 #x2318 for hex, or #10r8984 for decimal."
   (let* ((enable-recursive-minibuffers t)
+        (completion-ignore-case t)
         (input
          (completing-read
           prompt
           (lambda (string pred action)
-            (let ((completion-ignore-case t))
-              (if (eq action 'metadata)
-                  '(metadata (category . unicode-name))
-                (complete-with-action action (ucs-names) string pred))))))
+            (if (eq action 'metadata)
+                '(metadata (category . unicode-name))
+              (complete-with-action action (ucs-names) string pred)))))
         (char
          (cond
           ((string-match-p "\\`[0-9a-fA-F]+\\'" input)

=== modified file 'lisp/org/ChangeLog'
--- a/lisp/org/ChangeLog        2013-01-02 16:13:04 +0000
+++ b/lisp/org/ChangeLog        2013-01-09 08:30:21 +0000
@@ -1,3 +1,357 @@
+2013-01-09  Achim Gratz  <address@hidden>
+
+       * org-compat.el (org-define-obsolete-function-alias)
+       (org-define-obsolete-variable-alias): Introduce new compatibility
+       macros to obsolete functions and variables.
+
+       * org-agenda.el, org-clock.el, org-id.el, org-lparse.el:
+       * org-protocol.el, org.el:
+       Use `org-define-obsolete-{function,variable}-alias' instead
+       of `define-obsolate{function,variable}-alias'.
+
+       * org-faces.el: Define face alias mode-line for XEmacs (it's
+       called modeline there).
+
+       * org-compat.el (org-condition-case-unless-debug): Do not use
+       defalias for special forms, the Emacs 22 byte-compiler does not
+       recognize them correctly when compiling macros.  Use a macro
+       instead and rely on macro expansion.  That however makes the
+       decision at compile time, which should be acceptable in this case
+       since it only affects debugging.
+
+       * org-compat.el (org-no-popups): New wrapper macro which let-binds
+       the correct variables to suppress popup windows depending on the
+       Emacs version in use.  This is a compile-time decision when
+       byte-compiling.
+
+       * org.el (org-get-location, org-switch-to-buffer-other-window):
+       Use the wrapper `org-no-popups' to let-bind the correct variables
+       for suppression of popup windows.
+
+       * org-compat.el (user-error): Defalias to `error' for Emacsen that
+       don't have it.
+
+       * org-agenda.el (org-agenda-write): Use org-called-interactively-p
+       instead of called-interactively-p.
+
+       * org.el (org-find-invisible-foreground): Do not use the value of
+       variables `default-frame-alist', `initial-frame-alist' and
+       `window-system-default-frame-alist' when their symbol is not bound.
+
+2013-01-09  Bastien Guerry  <address@hidden>
+
+       * org-src.el (org-edit-src-code): Fix bug when trying to edit a
+       table.el table.
+
+       * org-agenda.el (org-agenda-finalize): Inhibit readonly for the
+       whole function.
+
+       * org.el (org-entry-get): Speed up by let-binding some variables
+       only if needed.  Also fix a bug: consider an empty drawer as no drawer.
+
+       * org-agenda.el (org-search-view, org-agenda-get-todos)
+       (org-agenda-get-timestamps, org-agenda-get-sexps)
+       (org-agenda-get-progress, org-agenda-get-deadlines)
+       (org-agenda-get-scheduled, org-agenda-get-blocks)
+       (org-agenda-change-all-lines): Get local tags only.
+       (org-agenda-use-tag-inheritance): New option.
+       (org-agenda-finalize): When `org-agenda-use-tag-inheritance'
+       is non-nil, possibly reset tags in the agenda buffer.
+       (org-agenda-check-type): Enhance docstring.
+
+       * org.el (org-use-tag-inheritance): Fix typo in docstring.
+
+       * org-agenda.el (org-float): Don't alias `org-float'.
+
+       * org.el (org-scan-tags): The skipper already checks for archived
+       entries.
+
+       * org.el (org-refresh-properties): Rename from
+       `org-refresh-effort-properties' and use two new parameters.
+       (org-agenda-prepare-buffers): Use `org-refresh-properties'.
+       Also refresh the 'org-appt-warntime text property.
+
+       * org-clock.el (org-clock-in): Use the renamed defun.
+
+       * org-icalendar.el (org-icalendar-print-entries):
+       Refresh the 'org-appt-warntime property.
+       (org-icalendar-print-entries):
+       * org-agenda.el (org-agenda-get-timestamps)
+       (org-agenda-get-sexps, org-agenda-get-deadlines)
+       (org-agenda-get-scheduled): Do not use `org-entry-get' to get the
+       "APPT_WARNTIME" property value.
+
+       * org.el (org-id-link-to-org-use-id): Fix compiler warning.
+
+       * org-agenda.el (org-agenda-format-item): Do not use
+       `org-get-effort' to get the effort text property.
+       (org-agenda-get-sexps): Use `org-back-to-heading' when setting tags.
+
+       * org-clock.el (org-clock-in): Refresh effort properties.
+
+       * org.el (org-refresh-effort-properties): New defun.
+       (org-get-effort): Delete.
+       (org-set-effort):
+       (org-property-next-allowed-value): Set the 'org-effort text property.
+       (org-agenda-prepare-buffers): Refresh effort properties.
+
+       * org.el (org-read-date): Let-bind `mouse-autoselect-window' to
+       nil so that the mouse doesn't jump when the option is set to t globally.
+
+       * org-agenda.el (org-agenda-dim-blocked-tasks): Default to nil.
+       (org-agenda-dim-blocked-tasks): Make interactive and allow an
+       optional parameter 'invisible to hide blocked tasks instead of
+       just dimming them.
+       (org-agenda-mode-map): Bind `org-agenda-dim-blocked-tasks' to "#".
+
+       * org-agenda.el (org-agenda-finalize): Don't try to align tags
+       when there are no tags.  Only try to draw the habit consistency
+       graph when there is a habit in the buffer.  Only mark clocking
+       task when there is one.
+
+       * org.el (org-adaptive-fill-function): DTRT in `message-mode'.
+
+       * org.el (org-get-priority): Save match data even when using
+       `org-get-priority-function'.
+
+       * org-mobile.el (org-mobile-create-index-file):
+       Possibly normalize `org-todo-keywords'.
+
+       * org-mobile.el (org-mobile-push): Use the correct agenda buffer names.
+
+       * org.el (org-store-link): Use `org-id-link-to-org-use-id' instead
+       of the obsolete variable name.
+
+       * org.el (org-fontify-meta-lines-and-blocks-1):
+       Fix bug when fontifying keywords with no value.
+
+       * org.el (org-goto-auto-isearch): Enhance docstring.
+       (org-goto-map): Make a defun, so that the customized value of
+       org-goto-auto-isearch is correctly initialized.
+       (org-goto): Initialize the keymap with `org-goto-map'.
+       (org-get-location): Use *Org Help* as a temporary buffer.
+       Tell whether auto-isearch is on or off.
+
+       * org-exp.el (org-export-as-org): Remove useless argument.
+
+       * org-docbook.el (org-export-as-docbook-batch)
+       (org-export-region-as-docbook, org-export-as-docbook-pdf):
+       Fix the number of arguments.
+       (org-export-as-docbook): Remove useless argument.
+
+       * org.el (org-speed-commands-default): Use ":" instead of ";" for
+       `org-set-tags-command', which is consistent with ":" in agenda
+       view.  Use "=" for `org-columns".
+
+       * org.el (org-sparse-tree): Fix redundant information in prompt.
+
+       * org-exp.el (org-export-string): Fix number of arguments passed
+       to the org-export-as-* functions.
+
+       * org-latex.el (org-export-as-latex): Fix typo in docstring.
+
+       * org-list.el (org-cycle-include-plain-lists): Docstring enhancement.
+
+       * org.el (org-fontify-meta-lines-and-blocks-1): Fix fontification
+       bug when fontifying a keyword with no associated value.
+       (org-cycle-internal-local): Don't run hooks when cycling a plain
+       list before first headline.
+       (org-ctrl-c-ctrl-c): Throw a user error when trying to toggle a
+       blocked checkbox.
+       (org-indent-line): Fix table formulas indenting.
+
+       * org-agenda.el (org-agenda-open-link): Fix bug when no link is
+       matched.  Return a message instead of an error.
+       (org-agenda-priority): Remove useless parameter and fix showing
+       priority in agenda buffers.
+
+       * org-macs.el (org-with-buffer-modified-unmodified): New macro.
+
+       * org.el (org-entry-blocked-p): Use the new macro.
+
+       * org-src.el (org-edit-src-exit): Don't comma-escape the content
+       of a fixed width region.
+
+       * org.el (org-blocker-hook): Update the docstring to mention that
+       functions in this hook should not modify the buffer.
+       (org-trigger-hook): Small docstring fix.
+       (org-entry-blocked-p): Use `with-buffer-modified-unmodified'
+       so that the function never modifies the buffer.
+
+       * org-agenda.el (org-agenda-open-link): Allow to open an internal
+       link by using the new `org-offer-links-in-entry' function.
+
+       * org.el (org-offer-links-in-entry): Do not open the link directly
+       through `org-open-link-from-string', only offer to select a link
+       and return a cons with the link (as a string) and the end of entry.
+       (org-open-at-point): Use `org-offer-links-in-entry' correctly.
+
+       * org.el (org-cycle-internal-local):
+       Fix bug: allow headings with leading blank characters.
+
+       * org-clock.el (org-clock-persist):
+       Docstring fix: document the 'history value.
+
+       * org.el (org-insert-link): Fix bug when inserting links to
+       headlines containing the ">" character.
+
+       * org-crypt.el (org-at-encrypted-entry-p): Fix search boundary.
+
+       * org-compat.el (org-delete-directory): New compatibility function
+       for Emacs 22, where `delete-directory' does not support recursive
+       deletion.
+
+       * org-odt.el (org-odt-cleanup-xml-buffers):
+       Use the new compatibility function.
+
+       * org.el (org-table-map-tables): Fix allowed blocks.
+
+       * org.el (org-edit-special):
+       * org-src.el (org-edit-src-code): Fix regression: allow editing
+       HTML and LaTeX source blocks again.
+
+       * org.el (org-nonsticky-props): Add `htmlize-link'.
+       (org-nonsticky-props): Add `htmlize-link'.
+
+       * org.el (org-edit-special):
+       * org-src.el (org-edit-src-code): Don't edit in verbatim blocks.
+
+       * org-table.el (org-table-fedit-lisp-indent)
+       (orgtbl-self-insert-command): Use `org-delete-backward-char'
+       instead of `backward-delete-char'.
+
+       * org-src.el (org-edit-src-code): Fix another bug about editing
+       special blocks "example" and "verbatim".
+
+       * org.el (org-structure-template-alist): Add verbatim.
+       (org-edit-special): Fix bug about editing special blocks
+       "example" and "verbatim".
+
+       * org.el (org-delete-backward-char, org-delete-char):
+       Save match data, `delete-backward-char' and `delete-char' don't.
+
+       * org.el (org-enable-table-editor, org-insert-heading)
+       (org-remove-timestamp-with-keyword, org-self-insert-command):
+       * org-table.el (org-table-fedit-lisp-indent)
+       (orgtbl-self-insert-command):
+       * org-latex.el (org-export-latex-subcontent):
+       * org-clock.el (org-clocktable-write-default):
+       * org-ascii.el (org-export-ascii-preprocess):
+       Use `delete-backward-char' instead of `backward-delete-char'.
+
+       * org.el (org-todo): Ignore the comment string when changing the
+       TODO state of a headline.
+       (org-edit-special): Fix docstring.
+       (org-in-src-block-p): Small enhancement.
+
+       * org-publish.el (org-publish-org-to): Call `org-export-as-*'
+       functions with the correct list of arguments.
+
+       * org-html.el (org-export-as-html): Delete obsolete arg `hidden'.
+       (org-export-as-html-and-open, org-export-as-html-batch)
+       (org-export-region-as-html): Don't use obsolete arg.
+
+       * org-ascii.el (org-export-as-ascii): Delete obsolete arg `hidden'.
+       (org-export-as-ascii-to-buffer): Don't use obsolete arg.
+
+       * org.el (org-in-fixed-width-region-p): Save match data.
+       (org-in-src-block-p): Use case-folding for searching the block
+       boundaries.
+       (org-activate-plain-links, org-activate-angle-links)
+       (org-activate-bracket-links): Prevent link activation in
+       source code blocks.
+
+       * org-odt.el (org-odt-cleanup-xml-buffers): Fix Emacs Bug#13197 by
+       setting the correct buffer before marking it unmodified to
+       silently kill him.
+
+       * org.el (org-set-font-lock-defaults): Don't activate links in
+       source code blocks and fixed-width regions.
+
+       * org-agenda.el (org-agenda-finalize): Fix links activation.
+
+       * org.el (org-open-at-point): Throw the correct error on
+       non-links.  Use `user-error' instead of `error'.
+
+       * org.el (org-in-fixed-width-region-p): Define before use.
+
+       * org-src.el (org-in-src-block-p): Declare function.
+
+       * org-compat.el: Fix bug: don't use `eval-when-compile' when
+       aliasing `user-error'.
+
+       * org-agenda.el (org-agenda-skip): Only check if point is
+       inside a code block, not at a code block.
+
+       * org.el (org-in-fixed-width-region-p):
+       Rewrite using org-element.el.
+
+       * org.el (org-fill-paragraph): Fill correctly in source code block.
+
+       * org.el (org-in-fixed-width-region-p): New function.
+       (org-edit-special): Fix bug: make sure to DTRT in every
+       special environment.  Also use the new function to check
+       against fixed-width environment.
+
+       * org-src.el (org-edit-src-code): Check if we are in a source code
+       block with `org-in-src-block-p'.  Slightly reformat the docstring.
+
+       * org.el (org-in-src-block-p): Return t when point is at the
+       #+BEGIN_SRC/#+END_SRC lines unless the new optional parameter
+       'inside is set to t.
+
+       * ob-exp.el (obe-marker): Delete useless var.
+
+       * org-src.el (org-edit-src-code): Fix bug triggered by the sexp
+       (copy-marker nil) on Emacs <24.1.
+
+2013-01-09  Dmitry Antipov  <address@hidden>
+
+       * org-agenda.el (org-agenda-get-restriction-and-command):
+       * org-capture.el (org-capture-place-template):
+       * org-colview.el (org-dblock-write:columnview):
+       * org-mobile.el (org-mobile-locate-entry):
+       * org-table.el (org-table-convert-region):
+       * org.el (org-update-statistics-cookies): Use `point-marker'.
+
+2013-01-09  Eric Schulte  <address@hidden>
+
+       * org-exp.el (org-export-string): Pass the dir option on through
+       to any subsequent export functions.
+
+2013-01-09  Henning Weiss  <address@hidden>  (tiny change)
+
+       * org-mobile.el (org-mobile-sumo-agenda-command): Remove match
+       description from block agendas when they have a title.
+
+2013-01-09  Jambunathan K  <address@hidden>
+
+       * org-odt.el (org-export-as-odt-batch): Init `org-odt-zip-dir'.
+       Fix Emacs Bug#13254.
+
+       * org-odt.el (org-odt-format-org-link): Add check for presence of
+       description in headline links.
+
+2013-01-09  Michael Gauland  <address@hidden>  (tiny change)
+
+       * org-src.el: Create a marker to pass to copy-marker.
+
+2013-01-09  Nicolas Goaziou  <address@hidden>
+
+       * org.el (org-setup-filling): Set `auto-fill-inhibit-regexp' to
+       nil because `org-adaptive-fill-function' already determines which
+       lines should be filled.
+
+       * org.el (org-fill-paragraph): Small refactoring.
+
+       * org-element.el (org-element--parse-elements)
+       (org-element-at-point): Fix parsing of a list in a block in a list.
+
+2013-01-09  Sebastien Vauban  <address@hidden>
+
+       * org.el (org-copy-subtree, org-paste-subtree):
+       Fix whitespace handling when copying/pasting a subtree.
+
 2012-12-20  Michael Albinus  <address@hidden>
 
        * ob.el (org-babel-temp-file): Fix setting of
@@ -129,9 +483,8 @@
        * ob-haskell.el (org-export-as-latex): Don't use the obsoleted
        argument `hidden'.
 
-       * org.el (org-refile): Run within `with-demoted-errors' so
-       that a corrupted bookmark file does not stop the refile
-       process.
+       * org.el (org-refile): Run within `with-demoted-errors' so that a
+       corrupted bookmark file does not stop the refile process.
 
        * org-capture.el (org-capture-bookmark-last-stored-position):
        Ditto for the capture process.

=== modified file 'lisp/org/ob-eval.el'
--- a/lisp/org/ob-eval.el       2013-01-02 16:13:04 +0000
+++ b/lisp/org/ob-eval.el       2013-01-09 08:30:21 +0000
@@ -30,6 +30,7 @@
 (eval-when-compile (require 'cl))
 
 (defvar org-babel-error-buffer-name "*Org-Babel Error Output*")
+(declare-function org-babel-temp-file "ob-core" (prefix &optional suffix))
 
 (defun org-babel-eval-error-notify (exit-code stderr)
   "Open a buffer to display STDERR and a message with the value of EXIT-CODE."
@@ -142,6 +143,11 @@
             shell-file-name
           "/bin/sh"))
        exit-status)
+    ;; There is an error in `process-file' when `error-file' exists.
+    ;; This is fixed in Emacs trunk as of 2012-12-21; let's use this
+    ;; workaround for now.
+    (unless (file-remote-p default-directory)
+      (delete-file error-file))
     (if (or replace
            (and output-buffer
                 (not (or (bufferp output-buffer) (stringp output-buffer)))))

=== modified file 'lisp/org/ob-exp.el'
--- a/lisp/org/ob-exp.el        2013-01-01 09:11:05 +0000
+++ b/lisp/org/ob-exp.el        2013-01-08 14:27:18 +0000
@@ -28,7 +28,6 @@
 (eval-when-compile
   (require 'cl))
 
-(defvar obe-marker nil)
 (defvar org-current-export-file)
 (defvar org-babel-lob-one-liner-regexp)
 (defvar org-babel-ref-split-regexp)

=== modified file 'lisp/org/org-agenda.el'
--- a/lisp/org/org-agenda.el    2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-agenda.el    2013-01-08 18:49:37 +0000
@@ -840,7 +840,7 @@
   :group 'org-agenda-daily/weekly
   :type 'boolean)
 
-(defcustom org-agenda-dim-blocked-tasks t
+(defcustom org-agenda-dim-blocked-tasks nil
   "Non-nil means dim blocked tasks in the agenda display.
 This causes some overhead during agenda construction, but if you
 have turned on `org-enforce-todo-dependencies',
@@ -857,6 +857,7 @@
 will only be dimmed."
   :group 'org-agenda-daily/weekly
   :group 'org-agenda-todo-list
+  :version "24.3"
   :type '(choice
          (const :tag "Do not dim" nil)
          (const :tag "Dim to a gray face" t)
@@ -889,7 +890,7 @@
   :version "24.1"
   :type 'boolean)
 
-(define-obsolete-variable-alias 'org-agenda-menu-two-column 
'org-agenda-menu-two-columns "24.3")
+(org-define-obsolete-variable-alias 'org-agenda-menu-two-column 
'org-agenda-menu-two-columns "24.3")
 
 (defcustom org-agenda-menu-two-columns nil
   "Non-nil means, use two columns to show custom commands in the dispatcher.
@@ -899,7 +900,7 @@
   :version "24.1"
   :type 'boolean)
 
-(define-obsolete-variable-alias 'org-finalize-agenda-hook 
'org-agenda-finalize-hook "24.3")
+(org-define-obsolete-variable-alias 'org-finalize-agenda-hook 
'org-agenda-finalize-hook "24.3")
 (defcustom org-agenda-finalize-hook nil
   "Hook run just before displaying an agenda buffer.
 The buffer is still writable when the hook is called.
@@ -1651,6 +1652,23 @@
   :group 'org-agenda-line-format
   :type 'boolean)
 
+(defcustom org-agenda-use-tag-inheritance '(todo search timeline agenda)
+  "List of agenda view types where to use tag inheritance.
+
+In tags/tags-todo/tags-tree agenda views, tag inheritance is
+controlled by `org-use-tag-inheritance'.  In other agenda types,
+`org-use-tag-inheritance' is not used when selecting the agenda
+entries, but you may want the agenda to use the inherited tags
+anyway, e.g. for later tag filtering.
+
+The default value reset tags in every agenda type.  Setting this
+option to nil will speed up non-tags agenda view a lot.
+
+Allowed value are 'todo, 'search, 'timeline and 'agenda."
+  :version "24.3"
+  :group 'org-agenda
+  :type '(repeat (symbol :tag "Agenda type")))
+
 (defcustom org-agenda-hide-tags-regexp nil
   "Regular expression used to filter away specific tags in agenda views.
 This means that these tags will be present, but not be shown in the agenda
@@ -2012,6 +2030,7 @@
 (org-defkey org-agenda-mode-map "\C-c\C-w" 'org-agenda-refile)
 (org-defkey org-agenda-mode-map "m"        'org-agenda-bulk-mark)
 (org-defkey org-agenda-mode-map "*"        'org-agenda-bulk-mark-all)
+(org-defkey org-agenda-mode-map "#"        'org-agenda-dim-blocked-tasks)
 (org-defkey org-agenda-mode-map "%"        'org-agenda-bulk-mark-regexp)
 (org-defkey org-agenda-mode-map "u"        'org-agenda-bulk-unmark)
 (org-defkey org-agenda-mode-map "U"        'org-agenda-bulk-unmark-all)
@@ -2664,7 +2683,7 @@
                      (add-text-properties (match-beginning 2) (match-end 2)
                                           '(face bold) header))
                    header)))
-       (setq header-end (move-marker (make-marker) (point)))
+       (setq header-end (point-marker))
        (while t
          (setq custom1 custom)
          (when (eq rmheader t)
@@ -3194,7 +3213,7 @@
                 (kill-buffer (current-buffer))
                 (message "Plain text written to %s" file))))))))
     (set-buffer (or agenda-bufname
-                   (and (called-interactively-p 'any) (buffer-name))
+                   (and (org-called-interactively-p 'any) (buffer-name))
                    org-agenda-buffer-name)))
   (when open (org-open-file file)))
 
@@ -3514,44 +3533,60 @@
     (save-excursion
       (let ((inhibit-read-only t))
        (goto-char (point-min))
-       (while (org-activate-bracket-links (point-max))
-         (add-text-properties (match-beginning 0) (match-end 0)
-                              '(face org-link)))
-       (while (org-activate-plain-links (point-max))
-         (add-text-properties (match-beginning 0) (match-end 0)
-                              '(face org-link)))
-       (org-agenda-align-tags)
+       (save-excursion
+         (while (org-activate-bracket-links (point-max))
+           (add-text-properties (match-beginning 0) (match-end 0)
+                                '(face org-link))))
+       (save-excursion
+         (while (org-activate-plain-links (point-max))
+           (add-text-properties (match-beginning 0) (match-end 0)
+                                '(face org-link))))
+       (unless (eq org-agenda-remove-tags t)
+         (org-agenda-align-tags))
        (unless org-agenda-with-colors
-         (remove-text-properties (point-min) (point-max) '(face nil))))
-      (if (and (boundp 'org-agenda-overriding-columns-format)
-              org-agenda-overriding-columns-format)
-         (org-set-local 'org-agenda-overriding-columns-format
-                        org-agenda-overriding-columns-format))
-      (if (and (boundp 'org-agenda-view-columns-initially)
-              org-agenda-view-columns-initially)
-         (org-agenda-columns))
-      (when org-agenda-fontify-priorities
-       (org-agenda-fontify-priorities))
-      (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
-       (org-agenda-dim-blocked-tasks))
-      ;; We need to widen when `org-agenda-finalize' is called from
-      ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
-      (save-restriction
-       (widen)
-       (org-agenda-mark-clocking-task))
-      (when org-agenda-entry-text-mode
-       (org-agenda-entry-text-hide)
-       (org-agenda-entry-text-show))
-      (if (functionp 'org-habit-insert-consistency-graphs)
-         (org-habit-insert-consistency-graphs))
-      (let ((inhibit-read-only t))
-       (run-hooks 'org-agenda-finalize-hook))
-      (setq org-agenda-type (org-get-at-bol 'org-agenda-type))
-      (when (or org-agenda-tag-filter (get 'org-agenda-tag-filter 
:preset-filter))
-       (org-agenda-filter-apply org-agenda-tag-filter 'tag))
-      (when (or org-agenda-category-filter (get 'org-agenda-category-filter 
:preset-filter))
-       (org-agenda-filter-apply org-agenda-category-filter 'category))
-      (org-add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 
'local))))
+         (remove-text-properties (point-min) (point-max) '(face nil)))
+       (if (and (boundp 'org-agenda-overriding-columns-format)
+                org-agenda-overriding-columns-format)
+           (org-set-local 'org-agenda-overriding-columns-format
+                          org-agenda-overriding-columns-format))
+       (if (and (boundp 'org-agenda-view-columns-initially)
+                org-agenda-view-columns-initially)
+           (org-agenda-columns))
+       (when org-agenda-fontify-priorities
+         (org-agenda-fontify-priorities))
+       (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
+         (org-agenda-dim-blocked-tasks))
+       ;; We need to widen when `org-agenda-finalize' is called from
+       ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
+       (when org-clock-current-task
+         (save-restriction
+           (widen)
+           (org-agenda-mark-clocking-task)))
+       (when org-agenda-entry-text-mode
+         (org-agenda-entry-text-hide)
+         (org-agenda-entry-text-show))
+       (if (and (functionp 'org-habit-insert-consistency-graphs)
+                (save-excursion (next-single-property-change (point-min) 
'org-habit-p)))
+           (org-habit-insert-consistency-graphs))
+       (setq org-agenda-type (org-get-at-bol 'org-agenda-type))
+       (when (delq nil (mapcar (lambda (tp) (org-agenda-check-type nil tp))
+                               org-agenda-use-tag-inheritance))
+         (let (mrk)
+           (save-excursion
+             (goto-char (point-min))
+             (while (equal (forward-line) 0)
+               (when (setq mrk (or (get-text-property (point) 'org-hd-marker)
+                                   (get-text-property (point) 'org-hd-marker)))
+                 (put-text-property (point-at-bol) (point-at-eol)
+                                    'tags (org-with-point-at mrk
+                                            (delete-dups
+                                             (mapcar 'downcase 
(org-get-tags-at))))))))))
+       (run-hooks 'org-agenda-finalize-hook)
+       (when (or org-agenda-tag-filter (get 'org-agenda-tag-filter 
:preset-filter))
+         (org-agenda-filter-apply org-agenda-tag-filter 'tag))
+       (when (or org-agenda-category-filter (get 'org-agenda-category-filter 
:preset-filter))
+         (org-agenda-filter-apply org-agenda-category-filter 'category))
+       (org-add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 
'local)))))
 
 (defun org-agenda-mark-clocking-task ()
   "Mark the current clock entry in the agenda if it is present."
@@ -3607,15 +3642,18 @@
               ((equal p h) 'bold)))
        (overlay-put ov 'org-type 'org-priority)))))
 
-(defun org-agenda-dim-blocked-tasks ()
+(defun org-agenda-dim-blocked-tasks (&optional invisible)
+  (interactive "P")
   "Dim currently blocked TODO's in the agenda display."
+  (message "Dim or hide blocked tasks...")
   (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-blocked-todo)
                        (delete-overlay o)))
        (overlays-in (point-min) (point-max)))
   (save-excursion
     (let ((inhibit-read-only t)
          (org-depend-tag-blocked nil)
-         (invis (eq org-agenda-dim-blocked-tasks 'invisible))
+         (invis (or (not (null invisible))
+                    (eq org-agenda-dim-blocked-tasks 'invisible)))
          org-blocked-by-checkboxes
          invis1 b e p ov h l)
       (goto-char (point-min))
@@ -3636,7 +3674,8 @@
            (if invis1
                (overlay-put ov 'invisible t)
              (overlay-put ov 'face 'org-agenda-dimmed-todo-face))
-           (overlay-put ov 'org-type 'org-blocked-todo)))))))
+           (overlay-put ov 'org-type 'org-blocked-todo))))))
+    (message "Dim or hide blocked tasks...done"))
 
 (defvar org-agenda-skip-function nil
   "Function to be called at each match during agenda construction.
@@ -3656,7 +3695,7 @@
 Also moves point to the end of the skipped region, so that search can
 continue from there."
   (let ((p (point-at-bol)) to)
-    (when (org-in-src-block-p) (throw :skip t))
+    (when (org-in-src-block-p t) (throw :skip t))
     (and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
         (get-text-property p :org-archived)
         (org-end-of-subtree t)
@@ -4405,7 +4444,7 @@
                        (setq marker (org-agenda-new-marker (point))
                              category (org-get-category)
                              category-pos (get-text-property (point) 
'org-category-position)
-                             tags (org-get-tags-at (point))
+                             tags (org-get-tags-at nil t)
                              txt (org-agenda-format-item
                                   ""
                                   (buffer-substring-no-properties
@@ -5229,7 +5268,7 @@
              category-pos (get-text-property (point) 'org-category-position)
              txt (org-trim
                   (buffer-substring (match-beginning 2) (match-end 0)))
-             tags (org-get-tags-at (point))
+             tags (org-get-tags-at nil t)
              txt (org-agenda-format-item "" txt category tags t)
              priority (1+ (org-get-priority txt))
              todo-state (org-get-todo-state))
@@ -5389,7 +5428,7 @@
              clockp (and org-agenda-include-inactive-timestamps
                          (or (string-match org-clock-string tmp)
                              (string-match "]-+\\'" tmp)))
-             warntime (org-entry-get (point) "APPT_WARNTIME")
+             warntime (get-text-property (point) 'org-appt-warntime)
              donep (member todo-state org-done-keywords))
        (if (or scheduledp deadlinep closedp clockp
                (and donep org-agenda-skip-timestamp-if-done))
@@ -5408,7 +5447,7 @@
                     (assoc (point) deadline-position-alist))
                (throw :skip nil))
            (setq hdmarker (org-agenda-new-marker)
-                 tags (org-get-tags-at))
+                 tags (org-get-tags-at nil t))
            (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
            (setq head (or (match-string 1) ""))
            (setq txt (org-agenda-format-item
@@ -5458,10 +5497,9 @@
          (setq marker (org-agenda-new-marker beg)
                category (org-get-category beg)
                category-pos (get-text-property beg 'org-category-position)
-               tags (save-excursion (org-backward-heading-same-level 0)
-                                    (org-get-tags-at))
+               tags (save-excursion (org-back-to-heading t) (org-get-tags-at 
nil t))
                todo-state (org-get-todo-state)
-               warntime (org-entry-get (point) "APPT_WARNTIME")
+               warntime (get-text-property (point) 'org-appt-warntime)
                extra nil)
 
          (dolist (r (if (stringp result)
@@ -5510,7 +5548,6 @@
   (org-no-warnings
    (let ((calendar-date-style 'european)       (european-calendar-style t))
      (diary-date day month year mark))))
-(defalias 'org-float 'diary-float)
 
 ;; Define the` org-class' function
 (defun org-class (y1 m1 d1 y2 m2 d2 dayname &rest skip-weeks)
@@ -5629,7 +5666,7 @@
              (setq txt org-agenda-no-heading-message)
            (goto-char (match-beginning 0))
            (setq hdmarker (org-agenda-new-marker)
-                 tags (org-get-tags-at))
+                 tags (org-get-tags-at nil t))
            (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
            (setq txt (match-string 1))
            (when extra
@@ -5833,13 +5870,13 @@
                           (not (= diff 0))))
                  (setq txt nil)
                (setq category (org-get-category)
-                     warntime (org-entry-get (point) "APPT_WARNTIME")
+                     warntime (get-text-property (point) 'org-appt-warntime)
                      category-pos (get-text-property (point) 
'org-category-position))
                (if (not (re-search-backward "^\\*+[ \t]+" nil t))
                    (setq txt org-agenda-no-heading-message)
                  (goto-char (match-end 0))
                  (setq pos1 (match-beginning 0))
-                 (setq tags (org-get-tags-at pos1))
+                 (setq tags (org-get-tags-at pos1 t))
                  (setq head (buffer-substring-no-properties
                              (point)
                              (progn (skip-chars-forward "^\r\n")
@@ -5923,7 +5960,7 @@
                  (match-string 1) d1 'past show-all
                  (current-buffer) pos)
              diff (- d2 d1)
-             warntime (org-entry-get (point) "APPT_WARNTIME"))
+             warntime (get-text-property (point) 'org-appt-warntime))
        (setq pastschedp (and todayp (< diff 0)))
        (setq did-habit-check-p nil)
        ;; When to show a scheduled item in the calendar:
@@ -5969,7 +6006,7 @@
                                pastschedp))
                       (setq mm (assoc pos1 deadline-position-alist)))
                      (throw :skip nil)))
-               (setq tags (org-get-tags-at))
+               (setq tags (org-get-tags-at nil t))
                (setq head (buffer-substring-no-properties
                            (point)
                            (progn (skip-chars-forward "^\r\n") (point))))
@@ -6051,7 +6088,7 @@
                    (setq txt org-agenda-no-heading-message)
                  (goto-char (match-beginning 0))
                  (setq hdmarker (org-agenda-new-marker (point)))
-                 (setq tags (org-get-tags-at))
+                 (setq tags (org-get-tags-at nil t))
                  (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
                  (setq head (match-string 1))
                  (let ((remove-re
@@ -6212,12 +6249,7 @@
                               (match-string 2 txt))
                       t t txt))))
        (when (derived-mode-p 'org-mode)
-         (setq effort
-               (condition-case nil
-                   (org-get-effort
-                    (or (get-text-property 0 'org-hd-marker txt)
-                        (get-text-property 0 'org-marker txt)))
-                 (error nil)))
+         (setq effort (ignore-errors (get-text-property 0 'org-effort txt)))
          (when effort
            (setq neffort (org-duration-string-to-minutes effort)
                  effort (setq effort (concat "[" effort "]")))))
@@ -6735,7 +6767,8 @@
 
 (defun org-agenda-check-type (error &rest types)
   "Check if agenda buffer is of allowed type.
-If ERROR is non-nil, throw an error, otherwise just return nil."
+If ERROR is non-nil, throw an error, otherwise just return nil.
+Allowed types are 'agenda 'timeline 'todo 'tags 'search."
   (if (not org-agenda-type)
       (error "No Org agenda currently displayed")
     (if (memq org-agenda-type types)
@@ -7669,7 +7702,7 @@
                "")))
   (force-mode-line-update))
 
-(define-obsolete-function-alias
+(org-define-obsolete-function-alias
   'org-agenda-post-command-hook 'org-agenda-update-agenda-type "24.3")
 
 (defun org-agenda-update-agenda-type ()
@@ -7890,29 +7923,45 @@
     (unless no-update (org-agenda-redo))))
 
 (defun org-agenda-open-link (&optional arg)
-  "Follow the link in the current line, if any.
-This looks for a link in the displayed line in the agenda.  It also looks
-at the text of the entry itself."
+  "Open the link(s) in the current entry, if any.
+This looks for a link in the displayed line in the agenda.
+It also looks at the text of the entry itself."
   (interactive "P")
   (let* ((marker (or (org-get-at-bol 'org-hd-marker)
                     (org-get-at-bol 'org-marker)))
         (buffer (and marker (marker-buffer marker)))
         (prefix (buffer-substring
-                 (point-at-bol) (point-at-eol))))
+                 (point-at-bol) (point-at-eol)))
+        (lkall (org-offer-links-in-entry buffer marker arg prefix))
+        (lk (car lkall))
+        (lkend (cdr lkall))
+        trg)
     (cond
-     (buffer
+     ((and buffer (stringp lk))
       (with-current-buffer buffer
-       (save-excursion
-         (save-restriction
-           (widen)
-           (goto-char marker)
-           (org-offer-links-in-entry arg prefix)))))
+       (setq trg (and (string-match org-bracket-link-regexp lk)
+                      (match-string 1 lk)))
+       (if (or (not trg) (string-match org-any-link-re trg))
+           (save-excursion
+             (save-restriction
+               (widen)
+               (goto-char marker)
+               (when (search-forward lk nil lkend)
+                 (goto-char (match-beginning 0))
+                 (org-open-at-point))))
+         ;; This is an internal link, widen the buffer
+         (switch-to-buffer-other-window buffer)
+         (widen)
+         (goto-char marker)
+         (when (search-forward lk nil lkend)
+           (goto-char (match-beginning 0))
+           (org-open-at-point)))))
      ((or (org-in-regexp (concat "\\(" org-bracket-link-regexp "\\)"))
          (save-excursion
            (beginning-of-line 1)
            (looking-at (concat ".*?\\(" org-bracket-link-regexp "\\)"))))
       (org-open-link-from-string (match-string 1)))
-     (t (error "No link to open here")))))
+     (t (message "No link to open here")))))
 
 (defun org-agenda-copy-local-variable (var)
   "Get a variable from a referenced buffer and install it here."
@@ -8313,35 +8362,37 @@
   (interactive)
   (org-agenda-priority 'down))
 
-(defun org-agenda-priority (&optional force-direction show)
+(defun org-agenda-priority (&optional force-direction)
   "Set the priority of line at point, also in Org-mode file.
 This changes the line at point, all other lines in the agenda referring to
-the same tree node, and the headline of the tree node in the Org-mode file."
+the same tree node, and the headline of the tree node in the Org-mode file.
+Called with a universal prefix arg, show the priority instead of setting it."
   (interactive "P")
-  (if (equal force-direction '(4)) (setq show t))
-  (unless org-enable-priority-commands
-    (error "Priority commands are disabled"))
-  (org-agenda-check-no-diary)
-  (let* ((marker (or (org-get-at-bol 'org-marker)
-                    (org-agenda-error)))
-        (hdmarker (org-get-at-bol 'org-hd-marker))
-        (buffer (marker-buffer hdmarker))
-        (pos (marker-position hdmarker))
-        (inhibit-read-only t)
-        newhead)
-    (org-with-remote-undo buffer
-      (with-current-buffer buffer
-       (widen)
-       (goto-char pos)
-       (org-show-context 'agenda)
-       (save-excursion
-         (and (outline-next-heading)
-              (org-flag-heading nil)))   ; show the next heading
-       (funcall 'org-priority force-direction show)
-       (end-of-line 1)
-       (setq newhead (org-get-heading)))
-      (org-agenda-change-all-lines newhead hdmarker)
-      (beginning-of-line 1))))
+  (if (equal force-direction '(4))
+      (org-show-priority)
+    (unless org-enable-priority-commands
+      (error "Priority commands are disabled"))
+    (org-agenda-check-no-diary)
+    (let* ((marker (or (org-get-at-bol 'org-marker)
+                      (org-agenda-error)))
+          (hdmarker (org-get-at-bol 'org-hd-marker))
+          (buffer (marker-buffer hdmarker))
+          (pos (marker-position hdmarker))
+          (inhibit-read-only t)
+          newhead)
+      (org-with-remote-undo buffer
+       (with-current-buffer buffer
+         (widen)
+         (goto-char pos)
+         (org-show-context 'agenda)
+         (save-excursion
+           (and (outline-next-heading)
+                (org-flag-heading nil)))   ; show the next heading
+         (funcall 'org-priority force-direction)
+         (end-of-line 1)
+         (setq newhead (org-get-heading)))
+       (org-agenda-change-all-lines newhead hdmarker)
+       (beginning-of-line 1)))))
 
 ;; FIXME: should fix the tags property of the agenda line.
 (defun org-agenda-set-tags (&optional tag onoff)

=== modified file 'lisp/org/org-ascii.el'
--- a/lisp/org/org-ascii.el     2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-ascii.el     2013-01-08 14:27:18 +0000
@@ -131,7 +131,7 @@
   "Call `org-export-as-ascii` with output to a temporary buffer.
 No file is created.  The prefix ARG is passed through to 
`org-export-as-ascii'."
   (interactive "P")
-  (org-export-as-ascii arg nil nil "*Org ASCII Export*")
+  (org-export-as-ascii arg nil "*Org ASCII Export*")
   (when org-export-show-temporary-export-buffer
     (switch-to-buffer-other-window "*Org ASCII Export*")))
 
@@ -183,23 +183,19 @@
     (goto-char end)
     (set-mark (point)) ;; to activate the region
     (goto-char beg)
-    (setq rtn (org-export-as-ascii
-              nil nil ext-plist
-              buffer body-only))
+    (setq rtn (org-export-as-ascii nil ext-plist buffer body-only))
     (if (fboundp 'deactivate-mark) (deactivate-mark))
     (if (and (org-called-interactively-p 'any) (bufferp rtn))
        (switch-to-buffer-other-window rtn)
       rtn)))
 
 ;;;###autoload
-(defun org-export-as-ascii (arg &optional hidden ext-plist
-                               to-buffer body-only pub-dir)
+(defun org-export-as-ascii (arg &optional ext-plist to-buffer body-only 
pub-dir)
   "Export the outline as a pretty ASCII file.
 If there is an active region, export only the region.
 The prefix ARG specifies how many levels of the outline should become
 underlined headlines, default is 3.    Lower levels will become bulleted
-lists.  When HIDDEN is non-nil, don't display the ASCII buffer.
-EXT-PLIST is a property list with external parameters overriding
+lists.  EXT-PLIST is a property list with external parameters overriding
 org-mode's default settings, but still inferior to file-local
 settings.  When TO-BUFFER is non-nil, create a buffer with that
 name and export to that buffer.  If TO-BUFFER is the symbol

=== modified file 'lisp/org/org-capture.el'
--- a/lisp/org/org-capture.el   2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-capture.el   2013-01-08 14:27:18 +0000
@@ -979,7 +979,7 @@
   (show-all)
   (goto-char (org-capture-get :pos))
   (org-set-local 'org-capture-target-marker
-                (move-marker (make-marker) (point)))
+                (point-marker))
   (org-set-local 'outline-level 'org-outline-level)
   (let* ((template (org-capture-get :template))
         (type (org-capture-get :type)))

=== modified file 'lisp/org/org-clock.el'
--- a/lisp/org/org-clock.el     2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-clock.el     2013-01-08 14:27:18 +0000
@@ -35,6 +35,7 @@
 (declare-function calendar-absolute-from-iso "cal-iso" (&optional date))
 (declare-function notifications-notify "notifications" (&rest params))
 (declare-function org-pop-to-buffer-same-window "org-compat" (&optional 
buffer-or-name norecord label))
+(declare-function org-refresh-properties "org" (dprop tprop))
 (defvar org-time-stamp-formats)
 (defvar org-ts-what)
 (defvar org-frame-title-format-backup frame-title-format)
@@ -159,12 +160,15 @@
 The clock is resumed when Emacs restarts.
 When this is t, both the running clock, and the entire clock
 history are saved.  When this is the symbol `clock', only the
-running clock is saved.
-
-When Emacs restarts with saved clock information, the file containing the
-running clock as well as all files mentioned in the clock history will
-be visited.
-All this depends on running `org-clock-persistence-insinuate' in .emacs"
+running clock is saved.  When this is the symbol `history', only
+the clock history is saved.
+
+When Emacs restarts with saved clock information, the file containing
+the running clock as well as all files mentioned in the clock history
+will be visited.
+
+All this depends on running `org-clock-persistence-insinuate' in your
+Emacs initialization file."
   :group 'org-clock
   :type '(choice
          (const :tag "Just the running clock" clock)
@@ -201,7 +205,7 @@
          (const :tag "Standard beep" t)
          (file :tag "Play sound file")))
 
-(define-obsolete-variable-alias 'org-clock-modeline-total
+(org-define-obsolete-variable-alias 'org-clock-modeline-total
   'org-clock-mode-line-total "24.3")
 
 (defcustom org-clock-mode-line-total 'auto
@@ -1078,6 +1082,7 @@
 make this the default behavior.)"
   (interactive "P")
   (setq org-clock-notification-was-shown nil)
+  (org-refresh-properties org-effort-property 'org-effort)
   (catch 'abort
     (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness)
                             (org-clocking-p)))
@@ -1199,7 +1204,7 @@
              (setq org-clock-start-time
                    (apply 'encode-time
                           (org-parse-time-string (match-string 1))))
-             (setq org-clock-effort (org-get-effort))
+             (setq org-clock-effort (get-text-property (point) 'org-effort))
              (setq org-clock-total-time (org-clock-sum-current-item
                                          (org-clock-get-sum-start))))
             ((eq org-clock-in-resume 'auto-restart)
@@ -1219,7 +1224,7 @@
                (beginning-of-line 1)
                (org-indent-line-to (- (org-get-indentation) 2)))
              (insert org-clock-string " ")
-             (setq org-clock-effort (org-get-effort))
+             (setq org-clock-effort (get-text-property (point) 'org-effort))
              (setq org-clock-total-time (org-clock-sum-current-item
                                          (org-clock-get-sum-start)))
              (setq org-clock-start-time

=== modified file 'lisp/org/org-colview.el'
--- a/lisp/org/org-colview.el   2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-colview.el   2013-01-08 14:27:18 +0000
@@ -1243,7 +1243,7 @@
 :skip-empty-rows
          When t, skip rows where all specifiers other than ITEM are empty.
 :format   When non-nil, specify the column view format to use."
-  (let ((pos (move-marker (make-marker) (point)))
+  (let ((pos (point-marker))
        (hlines (plist-get params :hlines))
        (vlines (plist-get params :vlines))
        (maxlevel (plist-get params :maxlevel))

=== modified file 'lisp/org/org-compat.el'
--- a/lisp/org/org-compat.el    2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-compat.el    2013-01-08 14:27:18 +0000
@@ -169,6 +169,24 @@
        (set-buffer-modified-p modified-p))
     (decompose-region beg end)))
 
+(defmacro org-define-obsolete-function-alias (o-name c-name when &optional doc)
+  "Reconcile the two-argument form of
+`define-obsolete-function-alias' in XEmacs/Emacs 22 with the 3-4
+argument form in Emacs 23 and later."
+  (if (or (featurep 'xemacs)
+         (< emacs-major-version 23))
+      `(define-obsolete-function-alias ,o-name ,c-name)
+    `(define-obsolete-function-alias ,o-name ,c-name ,when ,doc)))
+
+(defmacro org-define-obsolete-variable-alias (o-name c-name when &optional doc)
+  "Reconcile the two-argument form of
+`define-obsolete-variable-alias' in XEmacs/Emacs 22 with the 3-4
+argument form in Emacs 23 and later."
+  (if (or (featurep 'xemacs)
+         (< emacs-major-version 23))
+      `(define-obsolete-variable-alias ,o-name ,c-name)
+    `(define-obsolete-variable-alias ,o-name ,c-name ,when ,doc)))
+
 ;; Miscellaneous functions
 
 (defun org-add-hook (hook function &optional append local)
@@ -195,9 +213,8 @@
 ignored in this case."
   (cond ((if (fboundp 'window-full-width-p)
             (not (window-full-width-p window))
-          (> (frame-width) (window-width window)))
-        ;; do nothing if another window would suffer
-        )
+          ;; do nothing if another window would suffer
+          (> (frame-width) (window-width window))))
        ((and (fboundp 'fit-window-to-buffer) (not shrink-only))
         (fit-window-to-buffer window max-height min-height))
        ((fboundp 'shrink-window-if-larger-than-buffer)
@@ -257,7 +274,6 @@
       (when (boundp 'zmacs-regions)
        (setq zmacs-regions t)))))
 
-
 ;; Invisibility compatibility
 
 (defun org-remove-from-invisibility-spec (arg)
@@ -372,6 +388,20 @@
       (time-to-seconds (or time (current-time)))
     (float-time time)))
 
+;; `user-error' is only available from 24.2.50 on
+(unless (fboundp 'user-error)
+  (defalias 'user-error 'error))
+
+(defmacro org-no-popups (&rest body)
+  "Suppress popup windows.
+Let-bind some variables to nil around BODY to achieve the desired
+effect, which variables to use depends on the Emacs version."
+    (if (org-version-check "24.2.50" "" :predicate)
+       `(let (pop-up-frames display-buffer-alist)
+          ,@body)
+      `(let (pop-up-frames special-display-buffer-names 
special-display-regexps special-display-function)
+        ,@body)))
+
 (if (fboundp 'string-match-p)
     (defalias 'org-string-match-p 'string-match-p)
   (defun org-string-match-p (regexp string &optional start)
@@ -384,7 +414,7 @@
     (save-match-data
       (apply 'looking-at args))))
 
-                                       ; XEmacs does not have `looking-back'.
+;; XEmacs does not have `looking-back'.
 (if (fboundp 'looking-back)
     (defalias 'org-looking-back 'looking-back)
   (defun org-looking-back (regexp &optional limit greedy)
@@ -435,12 +465,34 @@
 
 ;; `condition-case-unless-debug' has been introduced in Emacs 24.1
 ;; `condition-case-no-debug' has been introduced in Emacs 23.1
-(defalias 'org-condition-case-unless-debug
+(defmacro org-condition-case-unless-debug (var bodyform &rest handlers)
+  (declare (debug condition-case) (indent 2))
   (or (and (fboundp 'condition-case-unless-debug)
-          'condition-case-unless-debug)
+          `(condition-case-unless-debug ,var ,bodyform ,@handlers))
       (and (fboundp 'condition-case-no-debug)
-          'condition-case-no-debug)
-      'condition-case))
+          `(condition-case-no-debug ,var ,bodyform ,@handlers))
+      `(condition-case ,var ,bodyform ,@handlers)))
+
+;; RECURSIVE has been introduced with Emacs 23.2.
+;; This is copying and adapted from `tramp-compat-delete-directory'
+(defun org-delete-directory (directory &optional recursive)
+  "Compatibility function for `delete-directory'."
+  (if (null recursive)
+      (delete-directory directory)
+    (condition-case nil
+       (funcall 'delete-directory directory recursive)
+      ;; This Emacs version does not support the RECURSIVE flag.  We
+      ;; use the implementation from Emacs 23.2.
+      (wrong-number-of-arguments
+       (setq directory (directory-file-name (expand-file-name directory)))
+       (if (not (file-symlink-p directory))
+          (mapc (lambda (file)
+                  (if (eq t (car (file-attributes file)))
+                      (org-delete-directory file recursive)
+                    (delete-file file)))
+                (directory-files
+                 directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
+       (delete-directory directory)))))
 
 ;;;###autoload
 (defmacro org-check-version ()

=== modified file 'lisp/org/org-crypt.el'
--- a/lisp/org/org-crypt.el     2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-crypt.el     2013-01-08 14:27:18 +0000
@@ -1,6 +1,6 @@
 ;;; org-crypt.el --- Public key encryption for org-mode entries
 
-;; Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
 
 ;; Emacs Lisp Archive Entry
 ;; Filename: org-crypt.el
@@ -258,7 +258,7 @@
     (save-excursion
       (org-back-to-heading t)
       (search-forward "-----BEGIN PGP MESSAGE-----"
-                     (save-excursion (org-end-of-subtree t)) t))))
+                     (save-excursion (outline-next-heading)) t))))
 
 (defun org-crypt-use-before-save-magic ()
   "Add a hook to automatically encrypt entries before a file is saved to disk."

=== modified file 'lisp/org/org-docbook.el'
--- a/lisp/org/org-docbook.el   2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-docbook.el   2013-01-08 14:27:18 +0000
@@ -274,14 +274,14 @@
 $ emacs --batch
         --load=$HOME/lib/emacs/org.el
         --visit=MyOrgFile.org --funcall org-export-as-docbook-batch"
-  (org-export-as-docbook 'hidden))
+  (org-export-as-docbook))
 
 ;;;###autoload
 (defun org-export-as-docbook-to-buffer ()
   "Call `org-export-as-docbook' with output to a temporary buffer.
 No file is created."
   (interactive)
-  (org-export-as-docbook nil nil "*Org DocBook Export*")
+  (org-export-as-docbook nil "*Org DocBook Export*")
   (when org-export-show-temporary-export-buffer
     (switch-to-buffer-other-window "*Org DocBook Export*")))
 
@@ -334,17 +334,14 @@
     (goto-char end)
     (set-mark (point)) ;; To activate the region
     (goto-char beg)
-    (setq rtn (org-export-as-docbook
-              nil nil
-              buffer body-only))
+    (setq rtn (org-export-as-docbook nil buffer body-only))
     (if (fboundp 'deactivate-mark) (deactivate-mark))
     (if (and (org-called-interactively-p 'any) (bufferp rtn))
        (switch-to-buffer-other-window rtn)
       rtn)))
 
 ;;;###autoload
-(defun org-export-as-docbook-pdf (&optional hidden ext-plist
-                                           to-buffer body-only pub-dir)
+(defun org-export-as-docbook-pdf (&optional ext-plist to-buffer body-only 
pub-dir)
   "Export as DocBook XML file, and generate PDF file."
   (interactive "P")
   (if (or (not org-export-docbook-xslt-proc-command)
@@ -360,8 +357,7 @@
           (org-combine-plists (org-default-export-plist)
                               ext-plist
                               (org-infile-export-plist))))
-        (docbook-buf (org-export-as-docbook hidden ext-plist
-                                            to-buffer body-only pub-dir))
+        (docbook-buf (org-export-as-docbook ext-plist to-buffer body-only 
pub-dir))
         (filename (buffer-file-name docbook-buf))
         (base (file-name-sans-extension filename))
         (fofile (concat base ".fo"))
@@ -398,8 +394,7 @@
 (defvar org-heading-keyword-regexp-format) ; defined in org.el
 
 ;;;###autoload
-(defun org-export-as-docbook (&optional hidden ext-plist
-                                       to-buffer body-only pub-dir)
+(defun org-export-as-docbook (&optional ext-plist to-buffer body-only pub-dir)
   "Export the current buffer as a DocBook file.
 If there is an active region, export only the region.  When
 HIDDEN is obsolete and does nothing.  EXT-PLIST is a

=== modified file 'lisp/org/org-element.el'
--- a/lisp/org/org-element.el   2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-element.el   2013-01-08 14:27:18 +0000
@@ -3808,7 +3808,8 @@
                'section))
             (plain-list 'item)
             (table 'table-row))
-          (org-element-property :structure element)
+          (and (memq type '(item plain-list))
+               (org-element-property :structure element))
           granularity visible-only element))
         ;; ELEMENT has contents.  Parse objects inside, if
         ;; GRANULARITY allows it.
@@ -4249,8 +4250,11 @@
                   (plain-list
                    (setq special-flag 'item
                          struct (org-element-property :structure element)))
-                  (table (setq special-flag 'table-row))
-                  (otherwise (setq special-flag nil)))
+                  (item (setq special-flag nil))
+                  (property-drawer
+                   (setq special-flag 'node-property struct nil))
+                  (table (setq special-flag 'table-row struct nil))
+                  (otherwise (setq special-flag nil struct nil)))
                 (setq end cend)
                 (goto-char cbeg)))))))))))
 

=== modified file 'lisp/org/org-exp.el'
--- a/lisp/org/org-exp.el       2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-exp.el       2013-01-08 14:27:18 +0000
@@ -3047,12 +3047,11 @@
          (eval ;; convert to fmt -- mimicking `org-run-like-in-org-mode'
           (list 'let org-local-vars
                 (list (intern (format "org-export-as-%s" fmt))
-                      nil nil nil ''string t))))
+                      nil nil ''string t dir))))
       (delete-file tmp-file))))
 
 ;;;###autoload
-(defun org-export-as-org (arg &optional hidden ext-plist
-                             to-buffer body-only pub-dir)
+(defun org-export-as-org (arg &optional ext-plist to-buffer body-only pub-dir)
   "Make a copy with not-exporting stuff removed.
 The purpose of this function is to provide a way to export the source
 Org file of a webpage in Org format, but with sensitive and/or irrelevant

=== modified file 'lisp/org/org-faces.el'
--- a/lisp/org/org-faces.el     2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-faces.el     2013-01-08 14:27:18 +0000
@@ -44,6 +44,9 @@
          (set-face-doc-string new-face docstring)))))
 (put 'org-copy-face 'lisp-indent-function 2)
 
+(when (featurep 'xemacs)
+  (put 'mode-line 'face-alias 'modeline))
+
 (defgroup org-faces nil
   "Faces in Org-mode."
   :tag "Org Faces"

=== modified file 'lisp/org/org-html.el'
--- a/lisp/org/org-html.el      2013-01-03 01:46:47 +0000
+++ b/lisp/org/org-html.el      2013-01-08 14:27:18 +0000
@@ -328,7 +328,7 @@
  * @licstart  The following is the entire license notice for the
  *  JavaScript code in %PATH.
  *
- * Copyright (C) 2012  MathJax
+ * Copyright (C) 2012-2013  MathJax
  *
  * Licensed under the Apache License, Version 2.0 (the \"License\");
  * you may not use this file except in compliance with the License.
@@ -793,7 +793,7 @@
 The prefix ARG specifies how many levels of the outline should become
 headlines.  The default is 3.  Lower levels will become bulleted lists."
   (interactive "P")
-  (org-export-as-html arg 'hidden)
+  (org-export-as-html arg)
   (org-open-file buffer-file-name)
   (when org-export-kill-product-buffer-when-displayed
     (kill-buffer (current-buffer))))
@@ -806,14 +806,14 @@
         --load=$HOME/lib/emacs/org.el
         --eval \"(setq org-export-headline-levels 2)\"
         --visit=MyFile --funcall org-export-as-html-batch"
-  (org-export-as-html org-export-headline-levels 'hidden))
+  (org-export-as-html org-export-headline-levels))
 
 ;;;###autoload
 (defun org-export-as-html-to-buffer (arg)
   "Call `org-export-as-html` with output to a temporary buffer.
 No file is created.  The prefix ARG is passed through to `org-export-as-html'."
   (interactive "P")
-  (org-export-as-html arg nil nil "*Org HTML Export*")
+  (org-export-as-html arg nil "*Org HTML Export*")
   (when org-export-show-temporary-export-buffer
     (switch-to-buffer-other-window "*Org HTML Export*")))
 
@@ -865,9 +865,7 @@
     (goto-char end)
     (set-mark (point)) ;; to activate the region
     (goto-char beg)
-    (setq rtn (org-export-as-html
-              nil nil ext-plist
-              buffer body-only))
+    (setq rtn (org-export-as-html nil ext-plist buffer body-only))
     (if (fboundp 'deactivate-mark) (deactivate-mark))
     (if (and (org-called-interactively-p 'any) (bufferp rtn))
        (switch-to-buffer-other-window rtn)
@@ -1171,14 +1169,12 @@
 (defvar org-heading-keyword-regexp-format) ; defined in org.el
 
 ;;;###autoload
-(defun org-export-as-html (arg &optional hidden ext-plist
-                              to-buffer body-only pub-dir)
+(defun org-export-as-html (arg &optional ext-plist to-buffer body-only pub-dir)
   "Export the outline as a pretty HTML file.
 If there is an active region, export only the region.  The prefix
 ARG specifies how many levels of the outline should become
 headlines.  The default is 3.  Lower levels will become bulleted
-lists.  HIDDEN is obsolete and does nothing.
-EXT-PLIST is a property list with external parameters overriding
+lists.  EXT-PLIST is a property list with external parameters overriding
 org-mode's default settings, but still inferior to file-local
 settings.  When TO-BUFFER is non-nil, create a buffer with that
 name and export to that buffer.  If TO-BUFFER is the symbol

=== modified file 'lisp/org/org-icalendar.el'
--- a/lisp/org/org-icalendar.el 2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-icalendar.el 2013-01-08 14:27:18 +0000
@@ -327,6 +327,7 @@
        tmp pri categories location summary desc uid alarm alarm-time
        (sexp-buffer (get-buffer-create "*ical-tmp*")))
     (org-refresh-category-properties)
+    (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
     (save-excursion
       (goto-char (point-min))
       (while (re-search-forward re1 nil t)
@@ -357,7 +358,7 @@
                        (org-id-get-create)
                      (or (org-id-get) (org-id-new)))
                categories (org-export-get-categories)
-               alarm-time (org-entry-get nil "APPT_WARNTIME")
+               alarm-time (get-text-property (point) 'org-appt-warntime)
                alarm-time (if alarm-time (string-to-number alarm-time) 0)
                alarm ""
                deadlinep nil scheduledp nil)
@@ -676,7 +677,7 @@
       (setq fmt (if have-time
                    (replace-regexp-in-string "%Z"
                                              org-icalendar-timezone
-                                             org-icalendar-date-time-format)
+                                             org-icalendar-date-time-format t)
                  ";VALUE=DATE:%Y%m%d"))
       (concat keyword (format-time-string fmt time
                                          (and 
(org-icalendar-use-UTC-date-timep)

=== modified file 'lisp/org/org-id.el'
--- a/lisp/org/org-id.el        2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-id.el        2013-01-08 14:27:18 +0000
@@ -83,7 +83,7 @@
   :tag "Org ID"
   :group 'org)
 
-(define-obsolete-variable-alias
+(org-define-obsolete-variable-alias
   'org-link-to-org-use-id 'org-id-link-to-org-use-id "24.3")
 (defcustom org-id-link-to-org-use-id nil
   "Non-nil means storing a link to an Org file will use entry IDs.

=== modified file 'lisp/org/org-inlinetask.el'
--- a/lisp/org/org-inlinetask.el        2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-inlinetask.el        2013-01-08 14:27:18 +0000
@@ -75,6 +75,9 @@
 ;; Also, if you want to use refiling and archiving for inline tasks,
 ;; The END line must be present to make things work properly.
 ;;
+;; Note that you should not try to use inline tasks within plain list,
+;; visibility cycling is known to be problematic when doing so.
+;;
 ;; This package installs one new command:
 ;;
 ;; C-c C-x t      Insert a new inline task with END line

=== modified file 'lisp/org/org-install.el'
--- a/lisp/org/org-install.el   2012-10-26 14:42:05 +0000
+++ b/lisp/org/org-install.el   2013-01-08 14:27:18 +0000
@@ -1,8 +1,10 @@
-;;; org-install.el --- autogenerated file, do not edit
+;;; org-install.el --- backward compatibility file for obsolete configuration
 ;;
 ;;; Code:
 (warn "The file org-install is obsolete.
-Please change your configuration to (require 'org) instead.")
+It is provided here so that (require 'org-install) does not
+trigger an error for users with obsolete Emacs configuration.
+You can safely remove (require 'org-install) from your config.")
 
 (provide 'org-install)
 

=== modified file 'lisp/org/org-jsinfo.el'
--- a/lisp/org/org-jsinfo.el    2013-01-03 01:46:47 +0000
+++ b/lisp/org/org-jsinfo.el    2013-01-08 14:27:18 +0000
@@ -112,7 +112,7 @@
  * @licstart  The following is the entire license notice for the
  *  JavaScript code in %SCRIPT_PATH.
  *
- * Copyright (C) 2012  Sebastian Rose
+ * Copyright (C) 2012-2013  Sebastian Rose
  *
  *
  * The JavaScript code in this tag is free software: you can

=== modified file 'lisp/org/org-latex.el'
--- a/lisp/org/org-latex.el     2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-latex.el     2013-01-08 14:27:18 +0000
@@ -872,7 +872,7 @@
 When BODY-ONLY is set, don't produce the file header and footer,
 simply return the content of \\begin{document}...\\end{document},
 without even the \\begin{document} and \\end{document} commands.
-when PUB-DIR is set, use this as the publishing directory."
+When PUB-DIR is set, use this as the publishing directory."
   (interactive "P")
   (when (and (not body-only) arg (listp arg)) (setq body-only t))
   (run-hooks 'org-export-first-hook)

=== modified file 'lisp/org/org-list.el'
--- a/lisp/org/org-list.el      2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-list.el      2013-01-08 14:27:18 +0000
@@ -144,15 +144,15 @@
 treated as text.  This is the most stable way of handling this,
 which is why it is the default.
 
-When this is the symbol `integrate', then during cycling, plain
-list items will *temporarily* be interpreted as outline headlines
-with a level given by 1000+i where i is the indentation of the
-bullet.  This setting can lead to strange effects when switching
-visibility to `children', because the first \"child\" in a
-subtree decides what children should be listed.  If that first
-\"child\" is a plain list item with an implied large level
-number, all true children and grand children of the outline
-heading will be exposed in a children' view."
+When this is the symbol `integrate', then integrate plain list
+items when cycling, as if they were children of outline headings.
+
+This setting can lead to strange effects when switching visibility
+to `children', because the first \"child\" in a subtree decides
+what children should be listed.  If that first \"child\" is a
+plain list item with an implied large level number, all true
+children and grand children of the outline heading will be
+exposed in a children' view."
   :group 'org-plain-lists
   :type '(choice
          (const :tag "Never" nil)

=== modified file 'lisp/org/org-lparse.el'
--- a/lisp/org/org-lparse.el    2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-lparse.el    2013-01-08 14:27:18 +0000
@@ -1718,7 +1718,7 @@
   (org-lparse-end-paragraph)
   (org-lparse-end-list-item (or type "u")))
 
-(define-obsolete-function-alias
+(org-define-obsolete-function-alias
   'org-lparse-preprocess-after-blockquote-hook
   'org-lparse-preprocess-after-blockquote
   "24.3")
@@ -1736,7 +1736,7 @@
         (format "ORG-%s-END %s" (upcase (match-string 2))
                 (match-string 3))) t t))))
 
-(define-obsolete-function-alias
+(org-define-obsolete-function-alias
   'org-lparse-strip-experimental-blocks-maybe-hook
   'org-lparse-strip-experimental-blocks-maybe
   "24.3")

=== modified file 'lisp/org/org-macs.el'
--- a/lisp/org/org-macs.el      2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-macs.el      2013-01-08 14:27:18 +0000
@@ -126,6 +126,15 @@
         (org-move-to-column ,col)))))
 (def-edebug-spec org-preserve-lc (body))
 
+;; Copied from bookmark.el
+(defmacro org-with-buffer-modified-unmodified (&rest body)
+  "Run BODY while preserving the buffer's `buffer-modified-p' state."
+  (org-with-gensyms (was-modified)
+    `(let ((,was-modified (buffer-modified-p)))
+       (unwind-protect
+           (progn ,@body)
+         (set-buffer-modified-p ,was-modified)))))
+
 (defmacro org-without-partial-completion (&rest body)
   `(if (and (boundp 'partial-completion-mode)
            partial-completion-mode

=== modified file 'lisp/org/org-mobile.el'
--- a/lisp/org/org-mobile.el    2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-mobile.el    2013-01-08 14:27:18 +0000
@@ -304,12 +304,13 @@
 
 ;;;###autoload
 (defun org-mobile-push ()
-  "Push the current state of Org affairs to the WebDAV directory.
+  "Push the current state of Org affairs to the target directory.
 This will create the index file, copy all agenda files there, and also
 create all custom agenda views, for upload to the mobile phone."
   (interactive)
   (let ((a-buffer (get-buffer org-agenda-buffer-name)))
-    (let ((org-agenda-buffer-name "*SUMO*")
+    (let ((org-agenda-curbuf-name org-agenda-buffer-name)
+         (org-agenda-buffer-name "*SUMO*")
          (org-agenda-tag-filter org-agenda-tag-filter)
          (org-agenda-redo-command org-agenda-redo-command))
       (save-excursion
@@ -329,15 +330,17 @@
          (org-mobile-create-index-file)
          (message "Writing checksums...")
          (org-mobile-write-checksums)
-         (run-hooks 'org-mobile-post-push-hook))))
+         (run-hooks 'org-mobile-post-push-hook)))
+      (setq org-agenda-buffer-name org-agenda-curbuf-name
+           org-agenda-this-buffer-name org-agenda-curbuf-name))
     (redraw-display)
-    (when (and a-buffer (buffer-live-p a-buffer))
+    (when (buffer-live-p a-buffer)
       (if (not (get-buffer-window a-buffer))
-         (kill-buffer a-buffer)
-       (let ((cw (selected-window)))
-         (select-window (get-buffer-window a-buffer))
-         (org-agenda-redo)
-         (select-window cw)))))
+         (kill-buffer a-buffer)
+       (let ((cw (selected-window)))
+         (select-window (get-buffer-window a-buffer))
+         (org-agenda-redo)
+         (select-window cw)))))
   (message "Files for mobile viewer staged"))
 
 (defvar org-mobile-before-process-capture-hook nil
@@ -417,7 +420,8 @@
        (target-file (expand-file-name org-mobile-index-file
                                       org-mobile-directory))
        file link-name todo-kwds done-kwds tags drawers entry kwds dwds twds)
-
+    (when (stringp (car def-todo))
+      (setq def-todo (list (cons 'sequence def-todo))))
     (org-agenda-prepare-buffers (mapcar 'car files-alist))
     (setq done-kwds (org-uniquify org-done-keywords-for-agenda))
     (setq todo-kwds (org-delete-all
@@ -536,7 +540,7 @@
                        (t (cons (car x) (cons "" (cdr x))))))
                org-agenda-custom-commands)))
        (default-list '(("a" "Agenda" agenda) ("t" "All TODO" alltodo)))
-       thelist new e key desc type match settings cmds gkey gdesc gsettings 
cnt)
+       thelist atitle new e key desc type match settings cmds gkey gdesc 
gsettings cnt)
     (cond
      ((eq org-mobile-agendas 'custom)
       (setq thelist custom-list))
@@ -588,12 +592,13 @@
        (setq cnt 0)
        (while (setq e (pop cmds))
          (setq type (car e) match (nth 1 e) settings (nth 2 e))
+         (setq atitle (if (string= "" gdesc) match gdesc))
          (setq settings (append gsettings settings))
          (setq settings
                (cons (list 'org-agenda-title-append
                            (concat "<after>KEYS=" gkey "#" (number-to-string
                                                             (setq cnt (1+ 
cnt)))
-                                   " TITLE: " gdesc " " match "</after>"))
+                                   " TITLE: " atitle "</after>"))
                      settings))
          (push (list type match settings) new)))))
     (and new (list "X" "SUMO" (reverse new)
@@ -983,7 +988,7 @@
              (goto-char (point-max))
              (newline)
              (goto-char (point-max))
-             (move-marker (make-marker) (point)))))
+             (point-marker))))
       (let ((file (match-string 1 link))
            (path (match-string 2 link)))
        (setq file (org-link-unescape file))

=== modified file 'lisp/org/org-odt.el'
--- a/lisp/org/org-odt.el       2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-odt.el       2013-01-08 14:27:18 +0000
@@ -439,14 +439,14 @@
                                "meta.xml" "styles.xml")))
               ;; kill all xml buffers
               (mapc (lambda (file)
-                      (let ((buf (find-file-noselect
-                                  (expand-file-name file org-odt-zip-dir) t)))
-                        (when (buffer-name buf)
-                          (set-buffer-modified-p nil)
-                          (kill-buffer buf))))
+                      (with-current-buffer
+                          (find-file-noselect
+                           (expand-file-name file org-odt-zip-dir) t)
+                        (set-buffer-modified-p nil)
+                        (kill-buffer)))
                     xml-files))
             ;; delete temporary directory.
-            (delete-directory org-odt-zip-dir t)))))
+            (org-delete-directory org-odt-zip-dir t)))))
      (org-condition-case-unless-debug err
         (prog1 (progn ,@body)
           (funcall --cleanup-xml-buffers))
@@ -474,7 +474,7 @@
         --load=$HOME/lib/emacs/org.el
         --eval \"(setq org-export-headline-levels 2)\"
         --visit=MyFile --funcall org-export-as-odt-batch"
-  (org-lparse-batch "odt"))
+  (org-odt-cleanup-xml-buffers (org-lparse-batch "odt")))
 
 ;;; org-export-as-odt
 ;;;###autoload
@@ -1727,6 +1727,7 @@
        ((and (string= type "")
             (or (not thefile) (string= thefile ""))
             (plist-get org-lparse-opt-plist :section-numbers)
+            (get-text-property 0 'org-no-description fragment)
             (setq sec-frag fragment)
             (or (string-match  "\\`sec\\(\\(-[0-9]+\\)+\\)" sec-frag)
                 (and (setq sec-frag
@@ -1756,7 +1757,11 @@
        (when (not (member type '("" "file")))
          (setq thefile (concat type ":" thefile)))
 
-       (let ((org-odt-suppress-xref nil))
+       (let ((org-odt-suppress-xref
+              ;; Typeset link to headlines with description, as a
+              ;; regular hyperlink.
+              (and (string= type "")
+                   (not (get-text-property 0 'org-no-description fragment)))))
          (org-odt-format-link
           (org-xml-format-desc desc) thefile attr)))))))
 

=== modified file 'lisp/org/org-protocol.el'
--- a/lisp/org/org-protocol.el  2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-protocol.el  2013-01-08 14:27:18 +0000
@@ -128,15 +128,15 @@
                  (filename &optional up))
 (declare-function server-edit "server" (&optional arg))
 
-(define-obsolete-function-alias
+(org-define-obsolete-function-alias
   'org-protocol-unhex-compound 'org-link-unescape-compound
   "2011-02-17")
 
-(define-obsolete-function-alias
+(org-define-obsolete-function-alias
   'org-protocol-unhex-string 'org-link-unescape
   "2011-02-17")
 
-(define-obsolete-function-alias
+(org-define-obsolete-function-alias
   'org-protocol-unhex-single-byte-sequence
   'org-link-unescape-single-byte-sequence
   "2011-02-17")

=== modified file 'lisp/org/org-publish.el'
--- a/lisp/org/org-publish.el   2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-publish.el   2013-01-08 14:27:18 +0000
@@ -577,7 +577,7 @@
        (setq export-buf-or-file
              (funcall (intern (concat "org-export-as-" format))
                       (plist-get plist :headline-levels)
-                      nil plist nil
+                      plist nil
                       (plist-get plist :body-only)
                       pub-dir))
        (when (and (bufferp export-buf-or-file)

=== modified file 'lisp/org/org-src.el'
--- a/lisp/org/org-src.el       2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-src.el       2013-01-08 18:49:37 +0000
@@ -39,6 +39,8 @@
 
 (declare-function org-do-remove-indentation "org" (&optional n))
 (declare-function org-at-table.el-p "org" ())
+(declare-function org-in-src-block-p "org" (&optional inside))
+(declare-function org-in-block-p "org" (names))
 (declare-function org-get-indentation "org" (&optional line))
 (declare-function org-switch-to-buffer-other-window "org" (&rest args))
 (declare-function org-pop-to-buffer-same-window
@@ -201,41 +203,40 @@
 `org-edit-src-save'")
 
 (defun org-edit-src-code (&optional context code edit-buffer-name)
-  "Edit the source CODE example at point.
-The example is copied to a separate buffer, and that buffer is
-switched to the correct language mode.  When done, exit with
-\\[org-edit-src-exit].  This will remove the original code in the
-Org buffer, and replace it with the edited version.  An optional
-argument CONTEXT is used by \\[org-edit-src-save] when calling
-this function.  See `org-src-window-setup' to configure the
-display of windows containing the Org buffer and the code
-buffer."
+  "Edit the source CODE block at point.
+The code is copied to a separate buffer and the appropriate mode
+is turned on.  When done, exit with \\[org-edit-src-exit].  This will
+remove the original code in the Org buffer, and replace it with the
+edited version.  An optional argument CONTEXT is used by \\[org-edit-src-save]
+when calling this function.  See `org-src-window-setup' to configure
+the display of windows containing the Org buffer and the code buffer."
   (interactive)
-  (unless (eq context 'save)
-    (setq org-edit-src-saved-temp-window-config 
(current-window-configuration)))
-  (let* ((mark (and (org-region-active-p) (mark)))
-        (case-fold-search t)
-        (info
-         ;; If the src region consists in no lines, we insert a blank
-         ;; line.
-         (let* ((temp (org-edit-src-find-region-and-lang))
-                (beg (nth 0 temp))
-                (end (nth 1 temp)))
-           (if (>= end beg) temp
-             (goto-char beg)
-             (insert "\n")
-             (org-edit-src-find-region-and-lang))))
-        (full-info (org-babel-get-src-block-info 'light))
-        (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive
-        (beg (make-marker))
-        ;; Move marker with inserted text for case when src block is
-        ;; just one empty line, i.e. beg == end.
-        (end (copy-marker nil t))
-        (allow-write-back-p (null code))
-        block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
-        begline markline markcol line col transmitted-variables)
-    (if (not info)
-       nil
+  (if (not (or (org-in-block-p '("src" "example" "latex" "html"))
+              (org-at-table.el-p)))
+      (user-error "Not in a source code or example block")
+    (unless (eq context 'save)
+      (setq org-edit-src-saved-temp-window-config 
(current-window-configuration)))
+    (let* ((mark (and (org-region-active-p) (mark)))
+          (case-fold-search t)
+          (info
+           ;; If the src region consists in no lines, we insert a blank
+           ;; line.
+           (let* ((temp (org-edit-src-find-region-and-lang))
+                  (beg (nth 0 temp))
+                  (end (nth 1 temp)))
+             (if (>= end beg) temp
+               (goto-char beg)
+               (insert "\n")
+               (org-edit-src-find-region-and-lang))))
+          (full-info (org-babel-get-src-block-info 'light))
+          (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is 
reflexive
+          (beg (make-marker))
+          ;; Move marker with inserted text for case when src block is
+          ;; just one empty line, i.e. beg == end.
+          (end (copy-marker (make-marker) t))
+          (allow-write-back-p (null code))
+          block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
+          begline markline markcol line col transmitted-variables)
       (setq beg (move-marker beg (nth 0 info))
            end (move-marker end (nth 1 info))
            msg (if allow-write-back-p
@@ -244,7 +245,7 @@
                  "Exit with C-c ' (C-c and single quote)")
            code (or code (buffer-substring-no-properties beg end))
            lang (or (cdr (assoc (nth 2 info) org-src-lang-modes))
-                     (nth 2 info))
+                    (nth 2 info))
            lang (if (symbolp lang) (symbol-name lang) lang)
            single (nth 3 info)
            block-nindent (nth 5 info)
@@ -527,6 +528,14 @@
        (pos (point))
        re1 re2 single beg end lang lfmt match-re1 ind entry)
     (catch 'exit
+      (when (org-at-table.el-p)
+       (re-search-backward "^[\t]*[^ \t|\\+]" nil t)
+       (setq beg (1+ (point-at-eol)))
+       (goto-char beg)
+       (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t)
+           (progn (goto-char (point-max)) (newline)))
+       (setq end (1- (point-at-bol)))
+       (throw 'exit (list beg end 'table.el nil nil 0)))
       (while (setq entry (pop re-list))
        (setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry)
              single (nth 3 entry))
@@ -557,16 +566,7 @@
                        (throw 'exit
                               (list (match-end 0) end
                                     (org-edit-src-get-lang lang)
-                                    single lfmt ind)))))))))
-      (when (org-at-table.el-p)
-       (re-search-backward "^[\t]*[^ \t|\\+]" nil t)
-       (setq beg (1+ (point-at-eol)))
-       (goto-char beg)
-       (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t)
-           (progn (goto-char (point-max)) (newline)))
-       (setq end (point-at-bol))
-       (setq ind (org-edit-src-get-indentation beg))
-       (throw 'exit (list beg end 'table.el nil nil ind))))))
+                                    single lfmt ind))))))))))))
 
 (defun org-edit-src-get-lang (lang)
   "Extract the src language."
@@ -633,7 +633,8 @@
   (unless (org-bound-and-true-p org-edit-src-from-org-mode)
     (error "This is not a sub-editing buffer, something is wrong"))
   (widen)
-  (let* ((beg org-edit-src-beg-marker)
+  (let* ((fixed-width-p (string-match "Fixed Width" (buffer-name)))
+        (beg org-edit-src-beg-marker)
         (end org-edit-src-end-marker)
         (ovl org-edit-src-overlay)
         (bufstr (buffer-string))
@@ -670,7 +671,8 @@
            (goto-char (point-max)) (insert "\\n")))
        (goto-char (point-min))
        (if (looking-at "\\s-*") (replace-match " ")))
-      (when (org-bound-and-true-p org-edit-src-from-org-mode)
+      (when (and (org-bound-and-true-p org-edit-src-from-org-mode)
+                (not fixed-width-p))
        (org-escape-code-in-region (point-min) (point-max))
        (setq delta (+ delta
                       (save-excursion

=== modified file 'lisp/org/org-table.el'
--- a/lisp/org/org-table.el     2013-01-01 09:11:05 +0000
+++ b/lisp/org/org-table.el     2013-01-08 14:27:18 +0000
@@ -509,10 +509,10 @@
         re)
     (goto-char beg)
     (beginning-of-line 1)
-    (setq beg (move-marker (make-marker) (point)))
+    (setq beg (point-marker))
     (goto-char end)
     (if (bolp) (backward-char 1) (end-of-line 1))
-    (setq end (move-marker (make-marker) (point)))
+    (setq end (point-marker))
     ;; Get the right field separator
     (unless separator
       (goto-char beg)
@@ -1895,7 +1895,7 @@
       (if (and (boundp 'font-lock-mode) font-lock-mode)
          (font-lock-fontify-block))))
    (t
-    (let ((pos (move-marker (make-marker) (point)))
+    (let ((pos (point-marker))
          (coord
           (if (eq org-table-use-standard-references t)
               (concat (org-number-to-letters (org-table-current-column))
@@ -3219,7 +3219,7 @@
   (let ((key (org-table-current-field-formula 'key 'noerror))
        (eql (sort (org-table-get-stored-formulas 'noerror)
                   'org-table-formula-less-p))
-       (pos (move-marker (make-marker) (point)))
+       (pos (point-marker))
        (startline 1)
        (wc (current-window-configuration))
        (sel-win (selected-window))
@@ -3580,7 +3580,7 @@
            (beginning-of-line 1)
            (insert ind))
          (goto-char (point-max))
-         (backward-delete-char 1)))
+         (org-delete-backward-char 1)))
       (goto-char beg))
      (t nil))))
 
@@ -4235,7 +4235,7 @@
           (looking-at "[^|\n]*  +|"))
       (let (org-table-may-need-update)
        (goto-char (1- (match-end 0)))
-       (backward-delete-char 1)
+       (org-delete-backward-char 1)
        (goto-char (match-beginning 0))
        (self-insert-command N))
     (setq org-table-may-need-update t)

=== modified file 'lisp/org/org-version.el'
--- a/lisp/org/org-version.el   2012-12-12 16:47:07 +0000
+++ b/lisp/org/org-version.el   2013-01-08 18:49:37 +0000
@@ -5,13 +5,13 @@
 (defun org-release ()
   "The release version of org-mode.
   Inserted by installing org-mode or when a release is made."
-   (let ((org-release "7.9.2+"))
+   (let ((org-release "7.9.3+"))
      org-release))
 ;;;###autoload
 (defun org-git-version ()
   "The Git version of org-mode.
   Inserted by installing org-mode or when a release is made."
-   (let ((org-git-version "7.9.2+-GNU-Emacs-24-3 (commit 488eea)"))
+   (let ((org-git-version "7.9.3+-GNU-Emacs-24-3 (commit 4cac75153)"))
      org-git-version))
 ;;;###autoload
 (defvar org-odt-data-dir "/usr/share/emacs/etc/org"

=== modified file 'lisp/org/org.el'
--- a/lisp/org/org.el   2013-01-01 09:11:05 +0000
+++ b/lisp/org/org.el   2013-01-08 14:27:18 +0000
@@ -1219,7 +1219,15 @@
   :type 'boolean)
 
 (defcustom org-goto-auto-isearch t
-  "Non-nil means typing characters in `org-goto' starts incremental search."
+  "Non-nil means typing characters in `org-goto' starts incremental search.
+When nil, you can use these keybindings to navigate the buffer:
+
+  q    Quit the org-goto interface
+  n    Go to the next visible heading
+  p    Go to the previous visible heading
+  f    Go one heading forward on same level
+  b    Go one heading backward on same level
+  u    Go one heading up"
   :group 'org-edit-structure
   :type 'boolean)
 
@@ -2236,8 +2244,9 @@
 (defvar org-blocker-hook nil
   "Hook for functions that are allowed to block a state change.
 
-Each function gets as its single argument a property list, see
-`org-trigger-hook' for more information about this list.
+Functions in this hook should not modify the buffer.
+Each function gets as its single argument a property list,
+see `org-trigger-hook' for more information about this list.
 
 If any of the functions in this hook returns nil, the state change
 is blocked.")
@@ -2245,8 +2254,8 @@
 (defvar org-trigger-hook nil
   "Hook for functions that are triggered by a state change.
 
-Each function gets as its single argument a property list with at least
-the following elements:
+Each function gets as its single argument a property list with at
+least the following elements:
 
  (:type type-of-change :position pos-at-entry-start
   :from old-state :to new-state)
@@ -2979,7 +2988,7 @@
 This may also be a list of tags that should be inherited, or a regexp that
 matches tags that should be inherited.  Additional control is possible
 with the variable  `org-tags-exclude-from-inheritance' which gives an
-explicit list of tags to be excluded from inheritance., even if the value of
+explicit list of tags to be excluded from inheritance, even if the value of
 `org-use-tag-inheritance' would select it for inheritance.
 
 If this option is t, a match early-on in a tree can lead to a large
@@ -3952,7 +3961,7 @@
        (beginning-of-line 1)
        (when (and (looking-at org-table-line-regexp)
                   ;; Exclude tables in src/example/verbatim/clocktable blocks
-                  (not (org-in-block-p '("src" "example"))))
+                  (not (org-in-block-p '("src" "example" "verbatim" 
"clocktable"))))
          (save-excursion (funcall function))
          (or (looking-at org-table-line-regexp)
              (forward-char 1)))
@@ -5007,13 +5016,15 @@
 (defun org-find-invisible-foreground ()
   (let ((candidates (remove
                     "unspecified-bg"
-                    (list
-                     (face-background 'default)
-                     (face-background 'org-default)
-                     (cdr (assoc 'background-color default-frame-alist))
-                     (cdr (assoc 'background-color initial-frame-alist))
-                     (cdr (assoc 'background-color 
window-system-default-frame-alist))
-                     (face-foreground 'org-hide)))))
+                    (nconc
+                     (list (face-background 'default)
+                           (face-background 'org-default))
+                     (mapcar
+                      (lambda (alist)
+                        (when (boundp alist)
+                          (cdr (assoc 'background-color (symbol-value 
alist)))))
+                      '(default-frame-alist initial-frame-alist 
window-system-default-frame-alist))
+                     (list (face-foreground 'org-hide))))))
     (car (remove nil candidates))))
 
 (defun org-current-time ()
@@ -5284,7 +5295,7 @@
     (and move (backward-char 1))))
 
 (defconst org-nonsticky-props
-  '(mouse-face highlight keymap invisible intangible help-echo 
org-linked-text))
+  '(mouse-face highlight keymap invisible intangible help-echo org-linked-text 
htmlize-link))
 
 (defsubst org-rear-nonsticky-at (pos)
   (add-text-properties (1- pos) pos (list 'rear-nonsticky 
org-nonsticky-props)))
@@ -5293,12 +5304,13 @@
   "Run through the buffer and add overlays to links."
   (catch 'exit
     (let (f)
-      (when (re-search-forward (concat org-plain-link-re) limit t)
+      (when (and (re-search-forward (concat org-plain-link-re) limit t)
+                (not (org-in-src-block-p)))
        (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
        (setq f (get-text-property (match-beginning 0) 'face))
-       (if (or (eq f 'org-tag)
-               (and (listp f) (memq 'org-tag f)))
-           nil
+       (unless (or (org-in-src-block-p)
+                   (eq f 'org-tag)
+                   (and (listp f) (memq 'org-tag f)))
          (add-text-properties (match-beginning 0) (match-end 0)
                               (list 'mouse-face 'highlight
                                     'face 'org-link
@@ -5410,9 +5422,9 @@
                 '(font-lock-fontified t invisible t)
               '(font-lock-fontified t face org-document-info-keyword)))
            (add-text-properties
-            (match-beginning 6) (match-end 6)
+            (match-beginning 6) (1+ (match-end 6))
             (if (string-equal dc1 "+title:")
-                '(font-lock-fontified t face org-document-title)
+                '(font-lock-fontified t face org-document-title)
               '(font-lock-fontified t face org-document-info))))
           ((or (equal dc1 "+results")
                (member dc1 '("+begin:" "+end:" "+caption:" "+label:"
@@ -5437,7 +5449,8 @@
 
 (defun org-activate-angle-links (limit)
   "Run through the buffer and add overlays to links."
-  (if (re-search-forward org-angle-link-re limit t)
+  (if (and (re-search-forward org-angle-link-re limit t)
+          (not (org-in-src-block-p)))
       (progn
        (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
        (add-text-properties (match-beginning 0) (match-end 0)
@@ -5465,7 +5478,8 @@
 
 (defun org-activate-bracket-links (limit)
   "Run through the buffer and add overlays to bracketed links."
-  (if (re-search-forward org-bracket-link-regexp limit t)
+  (if (and (re-search-forward org-bracket-link-regexp limit t)
+          (not (org-in-src-block-p)))
       (let* ((help (concat "LINK: "
                           (org-match-string-no-properties 1)))
             ;; FIXME: above we should remove the escapes.
@@ -6254,11 +6268,7 @@
            (setq has-children (org-list-has-child-p (point) struct)))
        (org-back-to-heading)
        (setq eoh (save-excursion (outline-end-of-heading) (point)))
-       (setq eos (save-excursion
-                   (org-end-of-subtree t)
-                   (unless (eobp)
-                     (skip-chars-forward " \t\n"))
-                   (if (eobp) (point) (1- (point)))))
+       (setq eos (save-excursion (1- (org-end-of-subtree t t))))
        (setq has-children
              (or (save-excursion
                    (let ((level (funcall outline-level)))
@@ -6283,7 +6293,8 @@
     (cond
      ((= eos eoh)
       ;; Nothing is hidden behind this heading
-      (run-hook-with-args 'org-pre-cycle-hook 'empty)
+      (unless (org-before-first-heading-p)
+       (run-hook-with-args 'org-pre-cycle-hook 'empty))
       (message "EMPTY ENTRY")
       (setq org-cycle-subtree-status nil)
       (save-excursion
@@ -6296,7 +6307,8 @@
               (not (setq children-skipped
                          org-cycle-skip-children-state-if-no-children))))
       ;; Entire subtree is hidden in one line: children view
-      (run-hook-with-args 'org-pre-cycle-hook 'children)
+      (unless (org-before-first-heading-p)
+       (run-hook-with-args 'org-pre-cycle-hook 'children))
       (if (org-at-item-p)
          (org-list-set-item-visibility (point-at-bol) struct 'children)
        (org-show-entry)
@@ -6324,24 +6336,28 @@
        (outline-next-heading)
        (if (outline-invisible-p) (org-flag-heading nil)))
       (setq org-cycle-subtree-status 'children)
-      (run-hook-with-args 'org-cycle-hook 'children))
+      (unless (org-before-first-heading-p)
+       (run-hook-with-args 'org-cycle-hook 'children)))
      ((or children-skipped
          (and (eq last-command this-command)
               (eq org-cycle-subtree-status 'children)))
       ;; We just showed the children, or no children are there,
       ;; now show everything.
-      (run-hook-with-args 'org-pre-cycle-hook 'subtree)
+      (unless (org-before-first-heading-p)
+       (run-hook-with-args 'org-pre-cycle-hook 'subtree))
       (outline-flag-region eoh eos nil)
       (message (if children-skipped "SUBTREE (NO CHILDREN)" "SUBTREE"))
       (setq org-cycle-subtree-status 'subtree)
-      (run-hook-with-args 'org-cycle-hook 'subtree))
+      (unless (org-before-first-heading-p)
+       (run-hook-with-args 'org-cycle-hook 'subtree)))
      (t
       ;; Default action: hide the subtree.
       (run-hook-with-args 'org-pre-cycle-hook 'folded)
       (outline-flag-region eoh eos t)
       (message "FOLDED")
       (setq org-cycle-subtree-status 'folded)
-      (run-hook-with-args 'org-cycle-hook 'folded)))))
+      (unless (org-before-first-heading-p)
+       (run-hook-with-args 'org-cycle-hook 'folded))))))
 
 ;;;###autoload
 (defun org-global-cycle (&optional arg)
@@ -6745,42 +6761,47 @@
 
 (defvar org-goto-window-configuration nil)
 (defvar org-goto-marker nil)
-(defvar org-goto-map
-  (let ((map (make-sparse-keymap)))
-    (let ((cmds '(isearch-forward isearch-backward kill-ring-save 
set-mark-command mouse-drag-region universal-argument org-occur)) cmd)
-      (while (setq cmd (pop cmds))
-       (substitute-key-definition cmd cmd map global-map)))
-    (suppress-keymap map)
-    (org-defkey map "\C-m"     'org-goto-ret)
-    (org-defkey map [(return)] 'org-goto-ret)
-    (org-defkey map [(left)]   'org-goto-left)
-    (org-defkey map [(right)]  'org-goto-right)
-    (org-defkey map [(control ?g)] 'org-goto-quit)
-    (org-defkey map "\C-i" 'org-cycle)
-    (org-defkey map [(tab)] 'org-cycle)
-    (org-defkey map [(down)] 'outline-next-visible-heading)
-    (org-defkey map [(up)] 'outline-previous-visible-heading)
-    (if org-goto-auto-isearch
-       (if (fboundp 'define-key-after)
-           (define-key-after map [t] 'org-goto-local-auto-isearch)
-         nil)
-      (org-defkey map "q" 'org-goto-quit)
-      (org-defkey map "n" 'outline-next-visible-heading)
-      (org-defkey map "p" 'outline-previous-visible-heading)
-      (org-defkey map "f" 'outline-forward-same-level)
-      (org-defkey map "b" 'outline-backward-same-level)
-      (org-defkey map "u" 'outline-up-heading))
-    (org-defkey map "/" 'org-occur)
-    (org-defkey map "\C-c\C-n" 'outline-next-visible-heading)
-    (org-defkey map "\C-c\C-p" 'outline-previous-visible-heading)
-    (org-defkey map "\C-c\C-f" 'outline-forward-same-level)
-    (org-defkey map "\C-c\C-b" 'outline-backward-same-level)
-    (org-defkey map "\C-c\C-u" 'outline-up-heading)
-    map))
+(defvar org-goto-map)
+(defun org-goto-map ()
+  "Set the keymap `org-goto'."
+  (setq org-goto-map
+       (let ((map (make-sparse-keymap)))
+         (let ((cmds '(isearch-forward isearch-backward kill-ring-save 
set-mark-command
+                                       mouse-drag-region universal-argument 
org-occur))
+               cmd)
+           (while (setq cmd (pop cmds))
+             (substitute-key-definition cmd cmd map global-map)))
+         (suppress-keymap map)
+         (org-defkey map "\C-m"     'org-goto-ret)
+         (org-defkey map [(return)] 'org-goto-ret)
+         (org-defkey map [(left)]   'org-goto-left)
+         (org-defkey map [(right)]  'org-goto-right)
+         (org-defkey map [(control ?g)] 'org-goto-quit)
+         (org-defkey map "\C-i" 'org-cycle)
+         (org-defkey map [(tab)] 'org-cycle)
+         (org-defkey map [(down)] 'outline-next-visible-heading)
+         (org-defkey map [(up)] 'outline-previous-visible-heading)
+         (if org-goto-auto-isearch
+             (if (fboundp 'define-key-after)
+                 (define-key-after map [t] 'org-goto-local-auto-isearch)
+               nil)
+           (org-defkey map "q" 'org-goto-quit)
+           (org-defkey map "n" 'outline-next-visible-heading)
+           (org-defkey map "p" 'outline-previous-visible-heading)
+           (org-defkey map "f" 'outline-forward-same-level)
+           (org-defkey map "b" 'outline-backward-same-level)
+           (org-defkey map "u" 'outline-up-heading))
+         (org-defkey map "/" 'org-occur)
+         (org-defkey map "\C-c\C-n" 'outline-next-visible-heading)
+         (org-defkey map "\C-c\C-p" 'outline-previous-visible-heading)
+         (org-defkey map "\C-c\C-f" 'outline-forward-same-level)
+         (org-defkey map "\C-c\C-b" 'outline-backward-same-level)
+         (org-defkey map "\C-c\C-u" 'outline-up-heading)
+         map)))
 
 (defconst org-goto-help
-  "Browse buffer copy, to find location or copy text.  Just type for 
auto-isearch.
-RET=jump to location             [Q]uit and return to previous location
+  "Browse buffer copy, to find location or copy text.%s
+RET=jump to location             C-g=quit and return to previous location
 \[Up]/[Down]=next/prev headline   TAB=cycle visibility   [/] org-occur")
 
 (defvar org-goto-start-pos) ; dynamically scoped parameter
@@ -6806,6 +6827,7 @@
 With a prefix argument, use the alternative interface: e.g. if
 `org-goto-interface' is 'outline use 'outline-path-completion."
   (interactive "P")
+  (org-goto-map)
   (let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level))))
         (org-refile-use-outline-path t)
         (org-refile-target-verify-function nil)
@@ -6838,48 +6860,46 @@
   "Let the user select a location in the Org-mode buffer BUF.
 This function uses a recursive edit.  It returns the selected position
 or nil."
-  (let ((isearch-mode-map org-goto-local-auto-isearch-map)
-       (isearch-hide-immediately nil)
-       (isearch-search-fun-function
-        (lambda () 'org-goto-local-search-headings))
-       (org-goto-selected-point org-goto-exit-command)
-       (pop-up-frames nil)
-       (special-display-buffer-names nil)
-       (special-display-regexps nil)
-       (special-display-function nil))
-    (save-excursion
-      (save-window-excursion
-       (delete-other-windows)
-       (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
-       (org-pop-to-buffer-same-window
-        (condition-case nil
-            (make-indirect-buffer (current-buffer) "*org-goto*")
-          (error (make-indirect-buffer (current-buffer) "*org-goto*"))))
-       (with-output-to-temp-buffer "*Help*"
-         (princ help))
-       (org-fit-window-to-buffer (get-buffer-window "*Help*"))
-       (setq buffer-read-only nil)
-       (let ((org-startup-truncated t)
-             (org-startup-folded nil)
-             (org-startup-align-all-tables nil))
-         (org-mode)
-         (org-overview))
-       (setq buffer-read-only t)
-       (if (and (boundp 'org-goto-start-pos)
-                (integer-or-marker-p org-goto-start-pos))
-           (let ((org-show-hierarchy-above t)
-                 (org-show-siblings t)
-                 (org-show-following-heading t))
-             (goto-char org-goto-start-pos)
-             (and (outline-invisible-p) (org-show-context)))
-         (goto-char (point-min)))
-       (let (org-special-ctrl-a/e) (org-beginning-of-line))
-       (message "Select location and press RET")
-       (use-local-map org-goto-map)
-       (recursive-edit)
-       ))
-    (kill-buffer "*org-goto*")
-    (cons org-goto-selected-point org-goto-exit-command)))
+  (org-no-popups
+   (let ((isearch-mode-map org-goto-local-auto-isearch-map)
+        (isearch-hide-immediately nil)
+        (isearch-search-fun-function
+         (lambda () 'org-goto-local-search-headings))
+        (org-goto-selected-point org-goto-exit-command))
+     (save-excursion
+       (save-window-excursion
+        (delete-other-windows)
+        (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
+        (org-pop-to-buffer-same-window
+         (condition-case nil
+             (make-indirect-buffer (current-buffer) "*org-goto*")
+           (error (make-indirect-buffer (current-buffer) "*org-goto*"))))
+        (with-output-to-temp-buffer "*Org Help*"
+          (princ (format help (if org-goto-auto-isearch
+                                  "  Just type for auto-isearch."
+                                "  n/p/f/b/u to navigate, q to quit."))))
+        (org-fit-window-to-buffer (get-buffer-window "*Org Help*"))
+        (setq buffer-read-only nil)
+        (let ((org-startup-truncated t)
+              (org-startup-folded nil)
+              (org-startup-align-all-tables nil))
+          (org-mode)
+          (org-overview))
+        (setq buffer-read-only t)
+        (if (and (boundp 'org-goto-start-pos)
+                 (integer-or-marker-p org-goto-start-pos))
+            (let ((org-show-hierarchy-above t)
+                  (org-show-siblings t)
+                  (org-show-following-heading t))
+              (goto-char org-goto-start-pos)
+              (and (outline-invisible-p) (org-show-context)))
+          (goto-char (point-min)))
+        (let (org-special-ctrl-a/e) (org-beginning-of-line))
+        (message "Select location and press RET")
+        (use-local-map org-goto-map)
+        (recursive-edit)))
+     (kill-buffer "*org-goto*")
+     (cons org-goto-selected-point org-goto-exit-command))))
 
 (defvar org-goto-local-auto-isearch-map (make-sparse-keymap))
 (set-keymap-parent org-goto-local-auto-isearch-map isearch-mode-map)
@@ -7382,12 +7402,7 @@
            ((< change 0) (max 1 (1+ (* 2 (/ (+ level (* 2 change)) 2))))))
     (max 1 (+ level (or change 0)))))
 
-(if (boundp 'define-obsolete-function-alias)
-    (if (or (featurep 'xemacs) (< emacs-major-version 23))
-       (define-obsolete-function-alias 'org-get-legal-level
-         'org-get-valid-level)
-      (define-obsolete-function-alias 'org-get-legal-level
-       'org-get-valid-level "23.1")))
+(org-define-obsolete-function-alias 'org-get-legal-level 'org-get-valid-level 
"23.1")
 
 (defvar org-called-with-limited-levels nil) ;; Dynamically bound in
 ;; ̀org-with-limited-levels'
@@ -7672,7 +7687,6 @@
     (if (org-called-interactively-p 'any)
        (org-back-to-heading nil) ; take what looks like a subtree
       (org-back-to-heading t)) ; take what is really there
-    (org-back-over-empty-lines)
     (setq beg (point))
     (skip-chars-forward " \t\r\n")
     (save-match-data
@@ -7682,7 +7696,6 @@
          (org-forward-heading-same-level (1- n) t)
        (error nil))
       (org-end-of-subtree t t))
-    (org-back-over-empty-lines)
     (setq end (point))
     (goto-char beg0)
     (when (> end beg)
@@ -7773,7 +7786,6 @@
         (delete-region (point-at-bol) (point)))
      ;; Paste
      (beginning-of-line (if (bolp) 1 2))
-     (unless for-yank (org-back-over-empty-lines))
      (setq beg (point))
      (and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt))
      (insert-before-markers txt)
@@ -8630,6 +8642,24 @@
           (put-text-property beg end 'org-category-position beg)
           (goto-char pos)))))))
 
+(defun org-refresh-properties (dprop tprop)
+  "Refresh buffer text properties.
+DPROP is the drawer property and TPROP is the corresponding text
+property to set."
+  (let ((case-fold-search t)
+       (inhibit-read-only t) p)
+    (org-unmodified
+     (save-excursion
+       (save-restriction
+        (widen)
+        (goto-char (point-min))
+        (while (re-search-forward (concat "^[ \t]*:" dprop ": +\\(.*\\)[ 
\t]*$") nil t)
+          (setq p (org-match-string-no-properties 1))
+          (save-excursion
+            (org-back-to-heading t)
+            (put-text-property
+             (point-at-bol) (point-at-eol) tprop p))))))))
+
 
 ;;;; Link Stuff
 
@@ -8723,7 +8753,7 @@
     (push (list type follow export) org-link-protocols)))
 
 (defvar org-agenda-buffer-name) ; Defined in org-agenda.el
-(defvar org-link-to-org-use-id) ; Defined in org-id.el
+(defvar org-id-link-to-org-use-id) ; Defined in org-id.el
 
 ;;;###autoload
 (defun org-store-link (arg)
@@ -8839,13 +8869,13 @@
                       "::" (match-string 1))
               link cpltxt))
        ((and (featurep 'org-id)
-             (or (eq org-link-to-org-use-id t)
+             (or (eq org-id-link-to-org-use-id t)
                  (and (org-called-interactively-p 'any)
-                      (or (eq org-link-to-org-use-id 'create-if-interactive)
-                          (and (eq org-link-to-org-use-id
+                      (or (eq org-id-link-to-org-use-id 'create-if-interactive)
+                          (and (eq org-id-link-to-org-use-id
                                    'create-if-interactive-and-no-custom-id)
                                (not custom-id))))
-                 (and org-link-to-org-use-id (org-entry-get nil "ID"))))
+                 (and org-id-link-to-org-use-id (org-entry-get nil "ID"))))
         ;; We can make a link using the ID.
         (setq link (condition-case nil
                        (prog1 (org-id-store-link)
@@ -9318,10 +9348,11 @@
        ;; URL-like link, normalize the use of angular brackets.
        (setq link (org-remove-angle-brackets link)))
 
-    ;; Check if we are linking to the current file with a search option
-    ;; If yes, simplify the link by using only the search option.
+    ;; Check if we are linking to the current file with a search
+    ;; option If yes, simplify the link by using only the search
+    ;; option.
     (when (and buffer-file-name
-              (string-match "^file:\\(.+?\\)::\\([^>]+\\)" link))
+              (string-match "^file:\\(.+?\\)::\\(.+\\)" link))
       (let* ((path (match-string 1 link))
             (case-fold-search nil)
             (search (match-string 2 link)))
@@ -9652,7 +9683,13 @@
                         org-angle-link-re "\\|"
                         "[ \t]:[^ \t\n]+:[ \t]*$")))
           (not (get-text-property (point) 'org-linked-text)))
-      (or (org-offer-links-in-entry arg)
+      (or (let* ((lkall (org-offer-links-in-entry (current-buffer) (point) 
arg))
+                (lk (car lkall))
+                (lkend (cdr lkall)))
+           (when lk
+             (prog1 (search-forward lk nil lkend)
+               (goto-char (match-beginning 0))
+               (org-open-at-point))))
          (progn (require 'org-attach) (org-attach-reveal 'if-exists))))
      ((run-hook-with-args-until-success 'org-open-at-point-functions))
      ((and (org-at-timestamp-p t)
@@ -9695,12 +9732,13 @@
            (throw 'match t))
 
          (save-excursion
-           (when (or (org-in-regexp org-angle-link-re)
-                     (and (goto-char (car (org-in-regexp org-plain-link-re)))
-                          (save-match-data (not (looking-back "\\[\\[")))))
-             (setq type (match-string 1)
-                   path (org-link-unescape (match-string 2)))
-             (throw 'match t)))
+           (let ((plinkpos (org-in-regexp org-plain-link-re)))
+             (when (or (org-in-regexp org-angle-link-re)
+                       (and plinkpos (goto-char (car plinkpos))
+                            (save-match-data (not (looking-back "\\[\\[")))))
+               (setq type (match-string 1)
+                     path (org-link-unescape (match-string 2)))
+               (throw 'match t))))
          (save-excursion
            (when (org-in-regexp (org-re "\\(:[[:alnum:address@hidden:]+\\):[ 
\t]*$"))
              (setq type "tags"
@@ -9713,7 +9751,7 @@
                  path (match-string 1))
            (throw 'match t)))
        (unless path
-         (error "No link found"))
+         (user-error "No link found"))
 
        ;; switch back to reference buffer
        ;; needed when if called in a temporary buffer through
@@ -9847,68 +9885,67 @@
     (move-marker org-open-link-marker nil)
     (run-hook-with-args 'org-follow-link-hook)))
 
-(defun org-offer-links-in-entry (&optional nth zero)
-  "Offer links in the current entry and follow the selected link.
-If there is only one link, follow it immediately as well.
-If NTH is an integer, immediately pick the NTH link found.
+(defun org-offer-links-in-entry (buffer marker &optional nth zero)
+  "Offer links in the current entry and return the selected link.
+If there is only one link, return it.
+If NTH is an integer, return the NTH link found.
 If ZERO is a string, check also this string for a link, and if
-there is one, offer it as link number zero."
-  (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|"
-                   "\\(" org-angle-link-re "\\)\\|"
-                   "\\(" org-plain-link-re "\\)"))
-       (cnt ?0)
-       (in-emacs (if (integerp nth) nil nth))
-       have-zero end links link c)
-    (when (and (stringp zero) (string-match org-bracket-link-regexp zero))
-      (push (match-string 0 zero) links)
-      (setq cnt (1- cnt) have-zero t))
+there is one, return it."
+  (with-current-buffer buffer
     (save-excursion
-      (org-back-to-heading t)
-      (setq end (save-excursion (outline-next-heading) (point)))
-      (while (re-search-forward re end t)
-       (push (match-string 0) links))
-      (setq links (org-uniquify (reverse links))))
-
-    (cond
-     ((null links)
-      (message "No links"))
-     ((equal (length links) 1)
-      (setq link (list (car links))))
-     ((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth)))
-      (setq link (list (nth (if have-zero nth (1- nth)) links))))
-     (t ; we have to select a link
-      (save-excursion
-       (save-window-excursion
-         (delete-other-windows)
-         (with-output-to-temp-buffer "*Select Link*"
-           (mapc (lambda (l)
-                   (if (not (string-match org-bracket-link-regexp l))
-                       (princ (format "[%c]  %s\n" (incf cnt)
-                                      (org-remove-angle-brackets l)))
-                     (if (match-end 3)
-                         (princ (format "[%c]  %s (%s)\n" (incf cnt)
-                                        (match-string 3 l) (match-string 1 l)))
-                       (princ (format "[%c]  %s\n" (incf cnt)
-                                      (match-string 1 l))))))
-                 links))
-         (org-fit-window-to-buffer (get-buffer-window "*Select Link*"))
-         (message "Select link to open, RET to open all:")
-         (setq c (read-char-exclusive))
-         (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*"))))
-      (when (equal c ?q) (error "Abort"))
-      (if (equal c ?\C-m)
-         (setq link links)
-       (setq nth (- c ?0))
-       (if have-zero (setq nth (1+ nth)))
-       (unless (and (integerp nth) (>= (length links) nth))
-         (error "Invalid link selection"))
-       (setq link (list (nth (1- nth) links))))))
-    (if link
-       (let ((buf (current-buffer)))
-         (dolist (l link)
-           (org-open-link-from-string l in-emacs buf))
-         t)
-      nil)))
+      (save-restriction
+       (widen)
+       (goto-char marker)
+       (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|"
+                         "\\(" org-angle-link-re "\\)\\|"
+                         "\\(" org-plain-link-re "\\)"))
+             (cnt ?0)
+             (in-emacs (if (integerp nth) nil nth))
+             have-zero end links link c)
+         (when (and (stringp zero) (string-match org-bracket-link-regexp zero))
+           (push (match-string 0 zero) links)
+           (setq cnt (1- cnt) have-zero t))
+         (save-excursion
+           (org-back-to-heading t)
+           (setq end (save-excursion (outline-next-heading) (point)))
+           (while (re-search-forward re end t)
+             (push (match-string 0) links))
+           (setq links (org-uniquify (reverse links))))
+         (cond
+          ((null links)
+           (message "No links"))
+          ((equal (length links) 1)
+           (setq link (car links)))
+          ((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth)))
+           (setq link (nth (if have-zero nth (1- nth)) links)))
+          (t ; we have to select a link
+           (save-excursion
+             (save-window-excursion
+               (delete-other-windows)
+               (with-output-to-temp-buffer "*Select Link*"
+                 (mapc (lambda (l)
+                         (if (not (string-match org-bracket-link-regexp l))
+                             (princ (format "[%c]  %s\n" (incf cnt)
+                                            (org-remove-angle-brackets l)))
+                           (if (match-end 3)
+                               (princ (format "[%c]  %s (%s)\n" (incf cnt)
+                                              (match-string 3 l) (match-string 
1 l)))
+                             (princ (format "[%c]  %s\n" (incf cnt)
+                                            (match-string 1 l))))))
+                       links))
+               (org-fit-window-to-buffer (get-buffer-window "*Select Link*"))
+               (message "Select link to open, RET to open all:")
+               (setq c (read-char-exclusive))
+               (and (get-buffer "*Select Link*") (kill-buffer "*Select 
Link*"))))
+           (when (equal c ?q) (error "Abort"))
+           (if (equal c ?\C-m)
+               (setq link links)
+             (setq nth (- c ?0))
+             (if have-zero (setq nth (1+ nth)))
+             (unless (and (integerp nth) (>= (length links) nth))
+               (error "Invalid link selection"))
+             (setq link (nth (1- nth) links)))))
+         (cons link end))))))
 
 ;; Add special file links that specify the way of opening
 
@@ -9930,12 +9967,6 @@
   '(add-hook 'org-export-preprocess-before-normalizing-links-hook
             'org-remove-file-link-modifiers))
 
-;;;; Time estimates
-
-(defun org-get-effort (&optional pom)
-  "Get the effort estimate for the current entry."
-  (org-entry-get pom org-effort-property))
-
 ;;; File search
 
 (defvar org-create-file-search-functions nil
@@ -11259,8 +11290,7 @@
     " +" t)))
 
 (defcustom org-structure-template-alist
-  '(
-    ("s" "#+BEGIN_SRC ?\n\n#+END_SRC"
+  '(("s" "#+BEGIN_SRC ?\n\n#+END_SRC"
      "<src lang=\"?\">\n\n</src>")
     ("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE"
      "<example>\n?\n</example>")
@@ -11268,6 +11298,8 @@
      "<quote>\n?\n</quote>")
     ("v" "#+BEGIN_VERSE\n?\n#+END_VERSE"
      "<verse>\n?\n</verse>")
+    ("V" "#+BEGIN_VERBATIM\n?\n#+END_VERBATIM"
+     "<verbatim>\n?\n</verbatim>")
     ("c" "#+BEGIN_CENTER\n?\n#+END_CENTER"
      "<center>\n?\n</center>")
     ("l" "#+BEGIN_LaTeX\n?\n#+END_LaTeX"
@@ -11283,8 +11315,7 @@
     ("i" "#+INDEX: ?"
      "#+INDEX: ?")
     ("I" "#+INCLUDE: %file ?"
-     "<include file=%file markup=\"?\">")
-    )
+     "<include file=%file markup=\"?\">"))
   "Structure completion elements.
 This is a list of abbreviation keys and values.  The value gets inserted
 if you type `<' followed by the key and then press the completion key,
@@ -11439,7 +11470,8 @@
         cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
     (if (equal arg '(16)) (setq arg 'nextset))
     (let ((org-blocker-hook org-blocker-hook)
-         (case-fold-search nil))
+         commentp
+         case-fold-search)
       (when (equal arg '(64))
        (setq arg nil org-blocker-hook nil))
       (when (and org-blocker-hook
@@ -11449,6 +11481,9 @@
       (save-excursion
        (catch 'exit
          (org-back-to-heading t)
+         (when (looking-at (concat "^\\*+ " org-comment-string))
+           (org-toggle-comment)
+           (setq commentp t))
          (if (looking-at org-outline-regexp) (goto-char (1- (match-end 0))))
          (or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)"))
              (looking-at "\\(?: *\\|[ \t]*$\\)"))
@@ -11624,7 +11659,8 @@
                  (and (looking-at " ") (just-one-space))))
            (when org-trigger-hook
              (save-excursion
-               (run-hook-with-args 'org-trigger-hook change-plist)))))))))
+               (run-hook-with-args 'org-trigger-hook change-plist)))
+           (when commentp (org-toggle-comment))))))))
 
 (defun org-block-todo-from-children-or-siblings-or-parent (change-plist)
   "Block turning an entry into a TODO, using the hierarchy.
@@ -11765,15 +11801,16 @@
 
 (defun org-entry-blocked-p ()
   "Is the current entry blocked?"
-  (if (org-entry-get nil "NOBLOCKING")
-      nil ;; Never block this entry
-    (not
-     (run-hook-with-args-until-failure
-      'org-blocker-hook
-      (list :type 'todo-state-change
-           :position (point)
-           :from 'todo
-           :to 'done)))))
+  (org-with-buffer-modified-unmodified
+   (if (org-entry-get nil "NOBLOCKING")
+       nil ;; Never block this entry
+     (not
+      (run-hook-with-args-until-failure
+       'org-blocker-hook
+       (list :type 'todo-state-change
+            :position (point)
+            :from 'todo
+            :to 'done))))))
 
 (defun org-update-statistics-cookies (all)
   "Update the statistics cookie, either from TODO or from checkboxes.
@@ -11785,7 +11822,7 @@
        (org-map-entries 'org-update-parent-todo-statistics))
     (if (not (org-at-heading-p))
        (org-update-checkbox-count)
-      (let ((pos (move-marker (make-marker) (point)))
+      (let ((pos (point-marker))
            end l1 l2)
        (ignore-errors (org-back-to-heading t))
        (if (not (org-at-heading-p))
@@ -12666,7 +12703,7 @@
   (let (ans kwd value ts-type)
     (setq type (or type org-sparse-tree-default-date-type))
     (setq org-ts-type type)
-    (message "Sparse tree: [r]egexp [/]regexp [t]odo [T]odo-kwd [m]atch 
[p]roperty\n             [d]eadlines [b]efore-date [a]fter-date [D]ates range\n 
            [c]ycle through date types: %s"
+    (message "Sparse tree: [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty\n    
         [d]eadlines [b]efore-date [a]fter-date [D]ates range\n             
[c]ycle through date types: %s"
             (cond ((eq type 'all) "all timestamps")
                   ((eq type 'scheduled) "only scheduled")
                   ((eq type 'deadline) "only deadline")
@@ -12981,9 +13018,9 @@
 
 (defun org-get-priority (s)
   "Find priority cookie and return priority."
-  (if (functionp org-get-priority-function)
-      (funcall org-get-priority-function)
-    (save-match-data
+  (save-match-data
+    (if (functionp org-get-priority-function)
+       (funcall org-get-priority-function)
       (if (not (string-match org-priority-regexp s))
          (* 1000 (- org-lowest-priority org-default-priority))
        (* 1000 (- org-lowest-priority
@@ -13113,18 +13150,9 @@
                 (or (not todo-only)
                     (and (member todo org-not-done-keywords)
                          (or (not org-agenda-tags-todo-honor-ignore-options)
-                             (not 
(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)))))
-
-                ;; Extra check for the archive tag
-                ;; FIXME: Does the skipper already do this????
-                (or
-                 (not (member org-archive-tag tags-list))
-                 ;; we have an archive tag, should we use this anyway?
-                 (or (not org-agenda-skip-archived-trees)
-                     (and (eq action 'agenda) org-agenda-archives-mode))))
+                             (not 
(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))))))
 
            ;; select this headline
-
            (cond
             ((eq action 'sparse-tree)
              (and org-highlight-sparse-tree-matches
@@ -14276,6 +14304,9 @@
                   existing nil nil "" nil cur))))))
     (unless (equal (org-entry-get nil prop) val)
       (org-entry-put nil prop val))
+    (save-excursion
+      (org-back-to-heading t)
+      (put-text-property (point-at-bol) (point-at-eol) 'org-effort val))
     (message "%s is now %s" prop val)))
 
 (defun org-at-property-p ()
@@ -14454,26 +14485,27 @@
          ;; We need a special property.  Use `org-entry-properties' to
          ;; retrieve it, but specify the wanted property
          (cdr (assoc property (org-entry-properties nil 'special property)))
-       (let* ((range (org-get-property-block))
-              (props (list (or (assoc property org-file-properties)
-                               (assoc property org-global-properties)
-                               (assoc property org-global-properties-fixed))))
-              (ap (lambda (key)
-                    (when (re-search-forward
-                           (org-re-property key) (cdr range) t)
-                      (setq props
-                            (org-update-property-plist
-                             key
-                             (if (match-end 1)
-                                 (org-match-string-no-properties 1) "")
-                             props)))))
-              val)
-         (when (and range (goto-char (car range)))
-           (funcall ap property)
-           (goto-char (car range))
-           (while (funcall ap (concat property "+")))
-           (setq val (cdr (assoc property props)))
-           (when val (if literal-nil val (org-not-nil val)))))))))
+       (let ((range (org-get-property-block)))
+         (when (and range (not (eq (car range) (cdr range))))
+           (let* ((props (list (or (assoc property org-file-properties)
+                                   (assoc property org-global-properties)
+                                   (assoc property 
org-global-properties-fixed))))
+                  (ap (lambda (key)
+                        (when (re-search-forward
+                               (org-re-property key) (cdr range) t)
+                          (setq props
+                                (org-update-property-plist
+                                 key
+                                 (if (match-end 1)
+                                     (org-match-string-no-properties 1) "")
+                                 props)))))
+                  val)
+             (goto-char (car range))
+             (funcall ap property)
+             (goto-char (car range))
+             (while (funcall ap (concat property "+")))
+             (setq val (cdr (assoc property props)))
+             (when val (if literal-nil val (org-not-nil val))))))))))
 
 (defun org-property-or-variable-value (var &optional inherit)
   "Check if there is a property fixing the value of VAR.
@@ -14996,7 +15028,8 @@
   (interactive)
   (unless (org-at-property-p)
     (error "Not at a property"))
-  (let* ((key (match-string 2))
+  (let* ((prop (car (save-match-data (org-split-string (match-string 1) ":"))))
+        (key (match-string 2))
         (value (match-string 3))
         (allowed (or (org-property-get-allowed-values (point) key)
                      (and (member value  '("[ ]" "[-]" "[X]"))
@@ -15015,6 +15048,10 @@
     (org-indent-line)
     (beginning-of-line 1)
     (skip-chars-forward " \t")
+    (when (equal prop org-effort-property)
+      (save-excursion
+       (org-back-to-heading t)
+       (put-text-property (point-at-bol) (point-at-eol) 'org-effort nval)))
     (run-hook-with-args 'org-property-changed-functions key nval)))
 
 (defun org-find-olp (path &optional this-buffer)
@@ -15060,7 +15097,7 @@
            (setq lmin (1+ flevel) lmax (+ lmin (if org-odd-levels-only 1 0)))
            (setq end (save-excursion (org-end-of-subtree t t))))
          (when (org-at-heading-p)
-           (move-marker (make-marker) (point))))))))
+           (point-marker)))))))
 
 (defun org-find-exact-headline-in-buffer (heading &optional buffer pos-only)
   "Find node HEADING in BUFFER.
@@ -15307,6 +15344,7 @@
                    (setcar (nthcdr 1 org-defdecode) 59)
                    (setq org-def (apply 'encode-time org-defdecode)
                          org-defdecode (decode-time org-def)))))
+        (mouse-autoselect-window nil) ; Don't let the mouse jump
         (calendar-frame-setup nil)
         (calendar-setup nil)
         (calendar-move-hook nil)
@@ -16966,6 +17004,8 @@
            (widen)
            (setq bmp (buffer-modified-p))
            (org-refresh-category-properties)
+           (org-refresh-properties org-effort-property 'org-effort)
+           (org-refresh-properties "APPT_WARNTIME" 'org-appt-warntime)
            (setq org-todo-keywords-for-agenda
                  (append org-todo-keywords-for-agenda org-todo-keywords-1))
            (setq org-done-keywords-for-agenda
@@ -17758,7 +17798,7 @@
                             (list 'org-display-inline-remove-overlay))
                (push ov org-inline-image-overlays)))))))))
 
-(define-obsolete-function-alias
+(org-define-obsolete-function-alias
   'org-display-inline-modification-hook 'org-display-inline-remove-overlay 
"24.3")
 
 (defun org-display-inline-remove-overlay (ov after beg end &optional len)
@@ -18053,7 +18093,7 @@
     ("c" . org-cycle)
     ("C" . org-shifttab)
     (" " . org-display-outline-path)
-    (":" . org-columns)
+    ("=" . org-columns)
     ("Outline Structure Editing")
     ("U" . org-shiftmetaup)
     ("D" . org-shiftmetadown)
@@ -18078,7 +18118,7 @@
     ("1" . (org-priority ?A))
     ("2" . (org-priority ?B))
     ("3" . (org-priority ?C))
-    (";" . org-set-tags-command)
+    (":" . org-set-tags-command)
     ("e" . org-set-effort)
     ("E" . org-inc-effort)
     ("W" . (lambda(m) (interactive "sMinutes before warning: ")
@@ -18138,7 +18178,7 @@
 (defvar org-table-auto-blank-field) ; defined in org-table.el
 (defvar org-speed-command nil)
 
-(define-obsolete-function-alias
+(org-define-obsolete-function-alias
   'org-speed-command-default-hook 'org-speed-command-activate "24.3")
 
 (defun org-speed-command-activate (keys)
@@ -18151,7 +18191,7 @@
     (cdr (assoc keys (append org-speed-commands-user
                             org-speed-commands-default)))))
 
-(define-obsolete-function-alias
+(org-define-obsolete-function-alias
   'org-babel-speed-command-hook 'org-babel-speed-command-activate "24.3")
 
 (defun org-babel-speed-command-activate (keys)
@@ -18296,25 +18336,26 @@
 still be marked for re-alignment if the field did fill the entire column,
 because, in this case the deletion might narrow the column."
   (interactive "p")
-  (org-check-before-invisible-edit 'delete-backward)
-  (if (and (org-table-p)
-          (eq N 1)
-          (string-match "|" (buffer-substring (point-at-bol) (point)))
-          (looking-at ".*?|"))
-      (let ((pos (point))
-           (noalign (looking-at "[^|\n\r]*  |"))
-           (c org-table-may-need-update))
-       (backward-delete-char N)
-       (if (not overwrite-mode)
-           (progn
-             (skip-chars-forward "^|")
-             (insert " ")
-             (goto-char (1- pos))))
-       ;; noalign: if there were two spaces at the end, this field
-       ;; does not determine the width of the column.
-       (if noalign (setq org-table-may-need-update c)))
-    (backward-delete-char N)
-    (org-fix-tags-on-the-fly)))
+  (save-match-data
+    (org-check-before-invisible-edit 'delete-backward)
+    (if (and (org-table-p)
+            (eq N 1)
+            (string-match "|" (buffer-substring (point-at-bol) (point)))
+            (looking-at ".*?|"))
+       (let ((pos (point))
+             (noalign (looking-at "[^|\n\r]*  |"))
+             (c org-table-may-need-update))
+         (backward-delete-char N)
+         (if (not overwrite-mode)
+             (progn
+               (skip-chars-forward "^|")
+               (insert " ")
+               (goto-char (1- pos))))
+         ;; noalign: if there were two spaces at the end, this field
+         ;; does not determine the width of the column.
+         (if noalign (setq org-table-may-need-update c)))
+      (backward-delete-char N)
+      (org-fix-tags-on-the-fly))))
 
 (defun org-delete-char (N)
   "Like `delete-char', but insert whitespace at field end in tables.
@@ -18323,25 +18364,26 @@
 still be marked for re-alignment if the field did fill the entire column,
 because, in this case the deletion might narrow the column."
   (interactive "p")
-  (org-check-before-invisible-edit 'delete)
-  (if (and (org-table-p)
-          (not (bolp))
-          (not (= (char-after) ?|))
-          (eq N 1))
-      (if (looking-at ".*?|")
-         (let ((pos (point))
-               (noalign (looking-at "[^|\n\r]*  |"))
-               (c org-table-may-need-update))
-           (replace-match (concat
-                           (substring (match-string 0) 1 -1)
-                           " |"))
-           (goto-char pos)
-           ;; noalign: if there were two spaces at the end, this field
-           ;; does not determine the width of the column.
-           (if noalign (setq org-table-may-need-update c)))
-       (delete-char N))
-    (delete-char N)
-    (org-fix-tags-on-the-fly)))
+  (save-match-data
+    (org-check-before-invisible-edit 'delete)
+    (if (and (org-table-p)
+            (not (bolp))
+            (not (= (char-after) ?|))
+            (eq N 1))
+       (if (looking-at ".*?|")
+           (let ((pos (point))
+                 (noalign (looking-at "[^|\n\r]*  |"))
+                 (c org-table-may-need-update))
+             (replace-match (concat
+                             (substring (match-string 0) 1 -1)
+                             " |"))
+             (goto-char pos)
+             ;; noalign: if there were two spaces at the end, this field
+             ;; does not determine the width of the column.
+             (if noalign (setq org-table-may-need-update c)))
+         (delete-char N))
+      (delete-char N)
+      (org-fix-tags-on-the-fly))))
 
 ;; Make `delete-selection-mode' work with org-mode and orgtbl-mode
 (put 'org-self-insert-command 'delete-selection t)
@@ -18956,15 +18998,22 @@
       (org-table-paste-rectangle)
     (org-paste-subtree arg)))
 
+(defsubst org-in-fixed-width-region-p ()
+  "Is point in a fixed-width region?"
+  (save-match-data
+    (eq 'fixed-width (org-element-type (org-element-at-point)))))
+
 (defun org-edit-special (&optional arg)
   "Call a special editor for the stuff at point.
 When at a table, call the formula editor with `org-table-edit-formulas'.
-When at the first line of an src example, call `org-edit-src-code'.
-When in an #+include line, visit the include file.  Otherwise call
-`ffap' to visit the file at point."
+When in a source code block, call `org-edit-src-code'.
+When in a fixed-width region, call `org-edit-fixed-width-region'.
+When in an #+include line, visit the included file.
+On a link, call `ffap' to visit the link at point.
+Otherwise, return a user error."
   (interactive)
   ;; possibly prep session before editing source
-  (when arg
+  (when (and (org-in-src-block-p) arg)
     (let* ((info (org-babel-get-src-block-info))
            (lang (nth 0 info))
            (params (nth 2 info))
@@ -18977,16 +19026,17 @@
       (beginning-of-line 1)
       (looking-at "\\(?:#\\+\\(?:setupfile\\|include\\):?[ \t]+\"?\\|[ 
\t]*<include\\>.*?file=\"\\)\\([^\"\n>]+\\)"))
     (find-file (org-trim (match-string 1))))
-   ((org-edit-src-code))
-   ((org-edit-fixed-width-region))
-   ((org-at-table.el-p)
-    (org-edit-src-code))
    ((or (org-at-table-p)
        (save-excursion
          (beginning-of-line 1)
          (let ((case-fold-search )) (looking-at "[ \t]*#\\+tblfm:"))))
     (call-interactively 'org-table-edit-formulas))
-   (t (call-interactively 'ffap))))
+   ((or (org-in-block-p '("src" "example" "latex" "html"))
+       (org-at-table.el-p))
+    (org-edit-src-code))
+   ((org-in-fixed-width-region-p) (org-edit-fixed-width-region))
+   ((org-at-regexp-p org-any-link-re) (call-interactively 'ffap))
+   (t (user-error "No special environment to edit here"))))
 
 (defvar org-table-coordinate-overlays) ; defined in org-table.el
 (defun org-ctrl-c-ctrl-c (&optional arg)
@@ -19103,8 +19153,10 @@
          (org-list-struct-fix-ind struct parents)
          (setq block-item
                (org-list-struct-fix-box struct parents prevs orderedp)))
-       (org-list-struct-apply-struct struct old-struct)
-       (org-update-checkbox-count-maybe)
+       (if (equal struct old-struct)
+           (user-error "Cannot toggle this checkbox (unchecked subitems?)")
+         (org-list-struct-apply-struct struct old-struct)
+         (org-update-checkbox-count-maybe))
        (when block-item
          (message
           "Checkboxes were removed due to unchecked box at line %d"
@@ -20238,13 +20290,19 @@
   "Is S an ID created by UUIDGEN?"
   (string-match 
"\\`[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}\\'"
 (downcase s)))
 
-(defun org-in-src-block-p nil
-  "Whether point is in a code source block."
-  (let (ov)
-    (when (setq ov (overlays-at (point)))
-      (memq 'org-block-background
-           (overlay-properties
-            (car ov))))))
+(defun org-in-src-block-p (&optional inside)
+  "Whether point is in a code source block.
+When INSIDE is non-nil, don't consider we are within a src block
+when point is at #+BEGIN_SRC or #+END_SRC."
+  (let ((case-fold-search t) ov)
+    (or (and (setq ov (overlays-at (point)))
+            (memq 'org-block-background
+                  (overlay-properties (car ov))))
+       (and (not inside)
+            (save-match-data
+              (save-excursion
+                (beginning-of-line)
+                (looking-at ".*#\\+\\(begin\\|end\\)_src")))))))
 
 (defun org-context ()
   "Return a list of contexts of the current cursor position.
@@ -20587,9 +20645,8 @@
   "Switch to buffer in a second window on the current frame.
 In particular, do not allow pop-up frames.
 Returns the newly created buffer."
-  (let (pop-up-frames special-display-buffer-names special-display-regexps
-                     special-display-function)
-    (apply 'switch-to-buffer-other-window args)))
+  (org-no-popups
+   (apply 'switch-to-buffer-other-window args)))
 
 (defun org-combine-plists (&rest plists)
   "Create a single property list from all plists in PLISTS.
@@ -20768,6 +20825,7 @@
        (t
        (beginning-of-line 0)
        (while (and (not (bobp))
+                   (not (looking-at org-table-line-regexp))
                    (not (looking-at org-drawer-regexp))
                    ;; When point started in an inline task, do not move
                    ;; above task starting line.
@@ -20898,6 +20956,7 @@
              '(org-fill-paragraph-separate-nobreak-p
                org-fill-line-break-nobreak-p)))))
   (org-set-local 'fill-paragraph-function 'org-fill-paragraph)
+  (org-set-local 'auto-fill-inhibit-regexp nil)
   (org-set-local 'adaptive-fill-function 'org-adaptive-fill-function)
   (org-set-local 'normal-auto-fill-function 'org-auto-fill-function)
   (org-set-local 'comment-line-break-function 
'org-comment-line-break-function))
@@ -20920,48 +20979,54 @@
   "Compute a fill prefix for the current line.
 Return fill prefix, as a string, or nil if current line isn't
 meant to be filled."
-  (org-with-wide-buffer
-   (unless (and (derived-mode-p 'message-mode) (not (message-in-body-p)))
-     ;; FIXME: This is really the job of orgstruct++-mode
-     (let* ((p (line-beginning-position))
-           (element (save-excursion (beginning-of-line)
-                                    (org-element-at-point)))
-           (type (org-element-type element))
-           (post-affiliated
-            (save-excursion
-              (goto-char (org-element-property :begin element))
-              (while (looking-at org-element--affiliated-re) (forward-line))
-              (point))))
-       (unless (< p post-affiliated)
-        (case type
-          (comment (looking-at "[ \t]*# ?") (match-string 0))
-          (footnote-definition "")
-          ((item plain-list)
-           (make-string (org-list-item-body-column post-affiliated) ? ))
-          (paragraph
-           ;; Fill prefix is usually the same as the current line,
-           ;; except if the paragraph is at the beginning of an item.
-           (let ((parent (org-element-property :parent element)))
-             (cond ((eq (org-element-type parent) 'item)
-                    (make-string (org-list-item-body-column
-                                  (org-element-property :begin parent))
-                                 ? ))
-                   ((save-excursion (beginning-of-line) (looking-at "[ \t]+"))
-                    (match-string 0))
-                   (t  ""))))
-          (comment-block
-           ;; Only fill contents if P is within block boundaries.
-           (let* ((cbeg (save-excursion (goto-char post-affiliated)
-                                        (forward-line)
-                                        (point)))
-                  (cend (save-excursion
-                          (goto-char (org-element-property :end element))
-                          (skip-chars-backward " \r\t\n")
-                          (line-beginning-position))))
-             (when (and (>= p cbeg) (< p cend))
-               (if (save-excursion (beginning-of-line) (looking-at "[ \t]+"))
-                   (match-string 0)
-                 ""))))))))))
+  (let (prefix)
+    (when (and (derived-mode-p 'message-mode) (message-in-body-p))
+      (save-excursion
+       (beginning-of-line)
+       (cond ((looking-at message-cite-prefix-regexp)
+              (setq prefix (match-string-no-properties 0)))
+             ((looking-at org-outline-regexp)
+              (setq prefix "")))))
+    (or prefix
+       (org-with-wide-buffer
+        (let* ((p (line-beginning-position))
+               (element (save-excursion (beginning-of-line) 
(org-element-at-point)))
+               (type (org-element-type element))
+               (post-affiliated
+                (save-excursion
+                  (goto-char (org-element-property :begin element))
+                  (while (looking-at org-element--affiliated-re) 
(forward-line))
+                  (point))))
+          (unless (< p post-affiliated)
+            (case type
+              (comment (looking-at "[ \t]*# ?") (match-string 0))
+              (footnote-definition "")
+              ((item plain-list)
+               (make-string (org-list-item-body-column post-affiliated) ? ))
+              (paragraph
+               ;; Fill prefix is usually the same as the current line,
+               ;; except if the paragraph is at the beginning of an item.
+               (let ((parent (org-element-property :parent element)))
+                 (cond ((eq (org-element-type parent) 'item)
+                        (make-string (org-list-item-body-column
+                                      (org-element-property :begin parent))
+                                     ? ))
+                       ((save-excursion (beginning-of-line) (looking-at "[ 
\t]+"))
+                        (match-string 0))
+                       (t  ""))))
+              (comment-block
+               ;; Only fill contents if P is within block boundaries.
+               (let* ((cbeg (save-excursion (goto-char post-affiliated)
+                                            (forward-line)
+                                            (point)))
+                      (cend (save-excursion
+                              (goto-char (org-element-property :end element))
+                              (skip-chars-backward " \r\t\n")
+                              (line-beginning-position))))
+                 (when (and (>= p cbeg) (< p cend))
+                   (if (save-excursion (beginning-of-line) (looking-at "[ 
\t]+"))
+                       (match-string 0)
+                     "")))))))))))
 
 (declare-function message-goto-body "message" ())
 (defvar message-cite-prefix-regexp)    ; From message.el
@@ -20981,12 +21046,12 @@
 
 For convenience, when point is at a plain list, an item or
 a footnote definition, try to fill the first paragraph within."
-  ;; Falls back on message-fill-paragraph when necessary
   (interactive)
   (if (and (derived-mode-p 'message-mode)
           (or (not (message-in-body-p))
               (save-excursion (move-beginning-of-line 1)
                               (looking-at message-cite-prefix-regexp))))
+      ;; First ensure filling is correct in message-mode.
       (let ((fill-paragraph-function
             (cadadr (assoc 'fill-paragraph-function org-fb-vars)))
            (fill-prefix (cadadr (assoc 'fill-prefix org-fb-vars)))
@@ -21003,6 +21068,8 @@
        ;; the buffer.  In that case, ignore filling.
        (if (< (point) (org-element-property :begin element)) t
          (case (org-element-type element)
+           ;; Use major mode filling function is src blocks.
+           (src-block (org-babel-do-key-sequence-in-edit-buffer (kbd "M-q")))
            ;; Align Org tables, leave table.el tables as-is.
            (table-row (org-table-align) t)
            (table

=== modified file 'lisp/progmodes/compile.el'
--- a/lisp/progmodes/compile.el 2013-01-02 16:13:04 +0000
+++ b/lisp/progmodes/compile.el 2013-01-09 08:30:21 +0000
@@ -1280,7 +1280,7 @@
       ;; whether or not omake's own error messages are recognized.
       (cond
        ((not (memq 'omake compilation-error-regexp-alist)) nil)
-       ((string-match "\\`\\([^^]\\|^\\( \\*\\|\\[\\)\\)" pat)
+       ((string-match "\\`\\([^^]\\|\\^\\( \\*\\|\\[\\)\\)" pat)
         nil) ;; Not anchored or anchored but already allows empty spaces.
        (t (setq pat (concat "^ *" (substring pat 1)))))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]