Просмотр исходного кода

Merge branch 'master' of orgmode.org:org-mode

Carsten Dominik 14 лет назад
Родитель
Сommit
be25be1c8d

+ 9 - 12
contrib/lisp/org-odt.el

@@ -1757,18 +1757,15 @@ visually."
 (defun org-odt-configure-outline-numbering (level)
 (defun org-odt-configure-outline-numbering (level)
   "Outline numbering is retained only upto LEVEL.
   "Outline numbering is retained only upto LEVEL.
 To disable outline numbering pass a LEVEL of 0."
 To disable outline numbering pass a LEVEL of 0."
-  (if (not (string= org-export-odt-factory-settings (sha1 (current-buffer))))
-      (org-lparse-warn
-       "org-odt: Using custom styles file? Consider tweaking styles.xml for better output. To suppress this warning update `org-export-odt-factory-settings'")
-    (goto-char (point-min))
-    (let ((regex
-	   "<text:outline-level-style\\(.*\\)text:level=\"\\(.*\\)\"\\(.*\\)>")
-	  (replacement
-	   "<text:outline-level-style\\1text:level=\"\\2\" style:num-format=\"\">"))
-      (while (re-search-forward regex nil t)
-	(when (> (string-to-number (match-string 1)) level)
-	  (replace-match replacement t nil))))
-    (save-buffer 0)))
+  (goto-char (point-min))
+  (let ((regex
+	 "<text:outline-level-style\\(.*\\)text:level=\"\\([^\"]*\\)\"\\(.*\\)>")
+	(replacement
+	 "<text:outline-level-style\\1text:level=\"\\2\" style:num-format=\"\">"))
+    (while (re-search-forward regex nil t)
+      (when (> (string-to-number (match-string 2)) level)
+	(replace-match replacement t nil))))
+  (save-buffer 0))
 
 
 (provide 'org-odt)
 (provide 'org-odt)
 
 

+ 1 - 2
doc/org.texi

@@ -265,8 +265,7 @@
 @copying
 @copying
 This manual is for Org version @value{VERSION}.
 This manual is for Org version @value{VERSION}.
 
 
-Copyright @copyright{} 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-Free Software Foundation, Inc.
+Copyright @copyright{} 2004-2011  Free Software Foundation, Inc.
 
 
 @quotation
 @quotation
 Permission is granted to copy, distribute and/or modify this document
 Permission is granted to copy, distribute and/or modify this document

+ 2 - 2
doc/orgcard.tex

@@ -17,8 +17,8 @@
 \pdflayout=(0l)
 \pdflayout=(0l)
 
 
 % Nothing else needs to be changed below this line.
 % Nothing else needs to be changed below this line.
-% Copyright (C) 1987, 1993, 1996, 1997, 2001, 2002, 2003, 2004, 2005,
-%   2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+% Copyright (C) 1987, 1993, 1996-1997, 2001-2011
+%   Free Software Foundation, Inc.
 
 
 % This file is part of GNU Emacs.
 % This file is part of GNU Emacs.
 
 

+ 2 - 1
lisp/ob-R.el

@@ -2,7 +2,8 @@
 
 
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 
 
-;; Author: Eric Schulte, Dan Davison
+;; Author: Eric Schulte
+;;	Dan Davison
 ;; Keywords: literate programming, reproducible research, R, statistics
 ;; Keywords: literate programming, reproducible research, R, statistics
 ;; Homepage: http://orgmode.org
 ;; Homepage: http://orgmode.org
 
 

+ 2 - 1
lisp/ob-clojure.el

@@ -2,7 +2,8 @@
 
 
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 
 
-;; Author: Joel Boehland, Eric Schulte
+;; Author: Joel Boehland
+;;	Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
 ;; Homepage: http://orgmode.org
 
 

+ 2 - 1
lisp/ob-exp.el

@@ -2,7 +2,8 @@
 
 
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 
 
-;; Author: Eric Schulte, Dan Davison
+;; Author: Eric Schulte
+;;	Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
 ;; Homepage: http://orgmode.org
 
 

+ 9 - 11
lisp/ob-js.el

@@ -6,22 +6,20 @@
 ;; Keywords: literate programming, reproducible research, js
 ;; Keywords: literate programming, reproducible research, js
 ;; Homepage: http://orgmode.org
 ;; Homepage: http://orgmode.org
 
 
-;;; License:
+;; This file is part of GNU Emacs.
 
 
-;; This program is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 ;; GNU General Public License for more details.
-;;
+
 ;; You should have received a copy of the GNU General Public License
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 
 ;;; Commentary:
 ;;; Commentary:
 
 
@@ -34,7 +32,7 @@
 
 
 ;; - a non-browser javascript engine such as node.js http://nodejs.org/
 ;; - a non-browser javascript engine such as node.js http://nodejs.org/
 ;;   or mozrepl http://wiki.github.com/bard/mozrepl/
 ;;   or mozrepl http://wiki.github.com/bard/mozrepl/
-;; 
+;;
 ;; - for session based evaluation mozrepl and moz.el are required see
 ;; - for session based evaluation mozrepl and moz.el are required see
 ;;   http://wiki.github.com/bard/mozrepl/emacs-integration for
 ;;   http://wiki.github.com/bard/mozrepl/emacs-integration for
 ;;   configuration instructions
 ;;   configuration instructions

+ 3 - 1
lisp/ob-lisp.el

@@ -2,7 +2,9 @@
 
 
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 
 
-;; Author: Joel Boehland, Eric Schulte, David T. O'Toole <dto@gnu.org>
+;; Author: Joel Boehland
+;;	Eric Schulte
+;;	David T. O'Toole <dto@gnu.org>
 ;; Keywords: literate programming, reproducible research
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
 ;; Homepage: http://orgmode.org
 
 

+ 2 - 1
lisp/ob-lob.el

@@ -2,7 +2,8 @@
 
 
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 
 
-;; Author: Eric Schulte, Dan Davison
+;; Author: Eric Schulte
+;;	Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
 ;; Homepage: http://orgmode.org
 
 

+ 2 - 1
lisp/ob-perl.el

@@ -2,7 +2,8 @@
 
 
 ;; Copyright (C) 2009-2011  Free Software Foundation
 ;; Copyright (C) 2009-2011  Free Software Foundation
 
 
-;; Author: Dan Davison, Eric Schulte
+;; Author: Dan Davison
+;;	Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
 ;; Homepage: http://orgmode.org
 
 

+ 2 - 1
lisp/ob-python.el

@@ -2,7 +2,8 @@
 
 
 ;; Copyright (C) 2009-2011  Free Software Foundation
 ;; Copyright (C) 2009-2011  Free Software Foundation
 
 
-;; Author: Eric Schulte, Dan Davison
+;; Author: Eric Schulte
+;;	Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
 ;; Homepage: http://orgmode.org
 
 

+ 2 - 1
lisp/ob-ref.el

@@ -2,7 +2,8 @@
 
 
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 
 
-;; Author: Eric Schulte, Dan Davison
+;; Author: Eric Schulte
+;;	Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
 ;; Homepage: http://orgmode.org
 
 

+ 9 - 11
lisp/ob-scheme.el

@@ -6,22 +6,20 @@
 ;; Keywords: literate programming, reproducible research, scheme
 ;; Keywords: literate programming, reproducible research, scheme
 ;; Homepage: http://orgmode.org
 ;; Homepage: http://orgmode.org
 
 
-;;; License:
+;; This file is part of GNU Emacs.
 
 
-;; This program is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 ;; GNU General Public License for more details.
-;;
+
 ;; You should have received a copy of the GNU General Public License
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 
 ;;; Commentary:
 ;;; Commentary:
 
 
@@ -34,7 +32,7 @@
 
 
 ;; - a working scheme implementation
 ;; - a working scheme implementation
 ;;   (e.g. guile http://www.gnu.org/software/guile/guile.html)
 ;;   (e.g. guile http://www.gnu.org/software/guile/guile.html)
-;;   
+;;
 ;; - for session based evaluation cmuscheme.el is required which is
 ;; - for session based evaluation cmuscheme.el is required which is
 ;;   included in Emacs
 ;;   included in Emacs
 
 

+ 2 - 1
lisp/ob.el

@@ -2,7 +2,8 @@
 
 
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 ;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 
 
-;; Author: Eric Schulte, Dan Davison
+;; Author: Eric Schulte
+;;	Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
 ;; Homepage: http://orgmode.org
 
 

+ 4 - 11
lisp/org-agenda.el

@@ -3198,17 +3198,9 @@ the global options and expect it to be applied to the entire view.")
 	(setq org-blocked-by-checkboxes nil invis1 invis)
 	(setq org-blocked-by-checkboxes nil invis1 invis)
 	(let ((marker (org-get-at-bol 'org-hd-marker)))
 	(let ((marker (org-get-at-bol 'org-hd-marker)))
 	  (when (and marker
 	  (when (and marker
-		     (not (with-current-buffer (marker-buffer marker)
-			    (save-excursion
-			      (goto-char marker)
-			      (if (org-entry-get nil "NOBLOCKING")
-				  t ;; Never block this entry
-				(run-hook-with-args-until-failure
-				 'org-blocker-hook
-				 (list :type 'todo-state-change
-				       :position marker
-				       :from 'todo
-				       :to 'done)))))))
+		     (with-current-buffer (marker-buffer marker)
+		       (save-excursion (goto-char marker)
+				       (org-entry-blocked-p))))
 	    (if org-blocked-by-checkboxes (setq invis1 nil))
 	    (if org-blocked-by-checkboxes (setq invis1 nil))
 	    (setq b (if invis1
 	    (setq b (if invis1
 			(max (point-min) (1- (point-at-bol)))
 			(max (point-min) (1- (point-at-bol)))
@@ -4607,6 +4599,7 @@ the documentation of `org-diary'."
 	(goto-char (match-beginning 1))
 	(goto-char (match-beginning 1))
 	(setq marker (org-agenda-new-marker (match-beginning 0))
 	(setq marker (org-agenda-new-marker (match-beginning 0))
 	      category (org-get-category)
 	      category (org-get-category)
+	      category-pos (get-text-property (point) 'org-category-position)
 	      txt (match-string 1)
 	      txt (match-string 1)
 	      tags (org-get-tags-at (point))
 	      tags (org-get-tags-at (point))
 	      txt (org-format-agenda-item "" txt category tags)
 	      txt (org-format-agenda-item "" txt category tags)

+ 5 - 2
lisp/org-bibtex.el

@@ -278,8 +278,11 @@ This variable is relevant only if `org-bibtex-export-tags-as-keywords` is t."
 ;;; Utility functions
 ;;; Utility functions
 (defun org-bibtex-get (property)
 (defun org-bibtex-get (property)
   ((lambda (it) (when it (org-babel-trim it)))
   ((lambda (it) (when it (org-babel-trim it)))
-   (or (org-entry-get (point) (upcase property))
-       (org-entry-get (point) (concat org-bibtex-prefix (upcase property))))))
+   (let ((org-special-properties
+	  (delete "FILE" (copy-sequence org-special-properties))))
+     (or
+      (org-entry-get (point) (upcase property))
+      (org-entry-get (point) (concat org-bibtex-prefix (upcase property)))))))
 
 
 (defun org-bibtex-put (property value)
 (defun org-bibtex-put (property value)
   (let ((prop (upcase (if (keywordp property)
   (let ((prop (upcase (if (keywordp property)

+ 10 - 6
lisp/org-footnote.el

@@ -415,8 +415,12 @@ and value definition."
 
 
 (defun org-footnote-unique-label (&optional current)
 (defun org-footnote-unique-label (&optional current)
   "Return a new unique footnote label.
   "Return a new unique footnote label.
+
 The function returns the first \"fn:N\" or \"N\" label that is
 The function returns the first \"fn:N\" or \"N\" label that is
-currently not used."
+currently not used.
+
+Optional argument CURRENT is the list of labels active in the
+buffer."
   (unless current (setq current (org-footnote-all-labels)))
   (unless current (setq current (org-footnote-all-labels)))
   (let ((fmt (if (eq org-footnote-auto-label 'plain) "%d" "fn:%d"))
   (let ((fmt (if (eq org-footnote-auto-label 'plain) "%d" "fn:%d"))
 	(cnt 1))
 	(cnt 1))
@@ -603,11 +607,11 @@ If Org is amidst an export process, EXPORT-PROPS will hold the
 export properties of the buffer.
 export properties of the buffer.
 
 
 When EXPORT-PROPS is non-nil, the default action is to insert
 When EXPORT-PROPS is non-nil, the default action is to insert
-normalized footnotes towards the end of the pre-processing buffer.
-Some exporters like docbook, odt, etc. expect that footnote
-definitions be available before any references to them.  Such
-exporters can let bind `org-footnote-insert-pos-for-preprocessor' to
-symbol 'point-min to achieve the desired behaviour.
+normalized footnotes towards the end of the pre-processing
+buffer.  Some exporters (docbook, odt...) expect footnote
+definitions to be available before any references to them.  Such
+exporters can let bind `org-footnote-insert-pos-for-preprocessor'
+to symbol `point-min' to achieve the desired behaviour.
 
 
 Additional note on `org-footnote-insert-pos-for-preprocessor':
 Additional note on `org-footnote-insert-pos-for-preprocessor':
 1. This variable has not effect when FOR-PREPROCESSOR is nil.
 1. This variable has not effect when FOR-PREPROCESSOR is nil.

+ 0 - 20
lisp/org-freemind.el

@@ -56,26 +56,6 @@
 ;;             Added y/n question before showing in FreeMind.
 ;;             Added y/n question before showing in FreeMind.
 ;; 2009-11-04: Added support for #+BEGIN_HTML.
 ;; 2009-11-04: Added support for #+BEGIN_HTML.
 ;;
 ;;
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2, or
-;; (at your option) any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;; General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
-;; Floor, Boston, MA 02110-1301, USA.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
 ;;; Code:
 ;;; Code:
 
 
 (require 'xml)
 (require 'xml)

+ 4 - 4
lisp/org-html.el

@@ -808,11 +808,11 @@ description.  See variables `org-export-html-inline-images' and
 			     may-inline-p)
 			     may-inline-p)
    "Make an HTML link.
    "Make an HTML link.
 OPT-PLIST is an options list.
 OPT-PLIST is an options list.
-TYPE is the device-type of the link (THIS://foo.html)
-PATH is the path of the link (http://THIS#locationx)
-FRAGMENT is the fragment part of the link, if any (foo.html#THIS)
+TYPE is the device-type of the link (THIS://foo.html).
+PATH is the path of the link (http://THIS#location).
+FRAGMENT is the fragment part of the link, if any (foo.html#THIS).
 DESC is the link description, if any.
 DESC is the link description, if any.
-ATTR is a string of other attributes of the a element.
+ATTR is a string of other attributes of the \"a\" element.
 MAY-INLINE-P allows inlining it as an image."
 MAY-INLINE-P allows inlining it as an image."
 
 
    (declare (special org-par-open))
    (declare (special org-par-open))

+ 2 - 3
lisp/org-indent.el

@@ -54,8 +54,7 @@
 (defconst org-indent-max 40
 (defconst org-indent-max 40
   "Maximum indentation in characters.")
   "Maximum indentation in characters.")
 (defconst org-indent-max-levels 20
 (defconst org-indent-max-levels 20
-  "Maximum added level through virtual indentation, in
-characters.
+  "Maximum added level through virtual indentation, in characters.
 
 
 It is computed by multiplying `org-indent-indentation-per-level'
 It is computed by multiplying `org-indent-indentation-per-level'
 minus one by actual level of the headline minus one.")
 minus one by actual level of the headline minus one.")
@@ -88,7 +87,7 @@ This is used locally in each buffer being initialized.")
 (defvar org-hide-leading-stars-before-indent-mode nil
 (defvar org-hide-leading-stars-before-indent-mode nil
   "Used locally.")
   "Used locally.")
 (defvar org-indent-modified-headline-flag nil
 (defvar org-indent-modified-headline-flag nil
-  "Non nil if the last deletion acted on an headline.
+  "Non-nil means the last deletion operated on an headline.
 It is modified by `org-indent-notify-modified-headline'.")
 It is modified by `org-indent-notify-modified-headline'.")
 
 
 
 

+ 8 - 2
lisp/org-inlinetask.el

@@ -405,8 +405,14 @@ Either remove headline and meta data, or do special formatting."
     (current-column)))
     (current-column)))
 
 
 (defvar org-indent-indentation-per-level) ; defined in org-indent.el
 (defvar org-indent-indentation-per-level) ; defined in org-indent.el
+
+(defface org-inlinetask
+  (org-compatible-face 'shadow '((t (:bold t))))
+  "Face for inlinetask headlines."
+  :group 'org-faces)
+
 (defun org-inlinetask-fontify (limit)
 (defun org-inlinetask-fontify (limit)
-  "Fontify the inline tasks."
+  "Fontify the inline tasks down to LIMIT."
   (let* ((nstars (if org-odd-levels-only
   (let* ((nstars (if org-odd-levels-only
 		     (1- (* 2 (or org-inlinetask-min-level 200)))
 		     (1- (* 2 (or org-inlinetask-min-level 200)))
 		   (or org-inlinetask-min-level 200)))
 		   (or org-inlinetask-min-level 200)))
@@ -425,7 +431,7 @@ Either remove headline and meta data, or do special formatting."
       (add-text-properties (match-beginning 2) (match-end 2)
       (add-text-properties (match-beginning 2) (match-end 2)
 			   '(face org-hide font-lock-fontified t))
 			   '(face org-hide font-lock-fontified t))
       (add-text-properties (match-beginning 3) (match-end 3)
       (add-text-properties (match-beginning 3) (match-end 3)
-			   '(face shadow font-lock-fontified t)))))
+			   '(face org-inlinetask font-lock-fontified t)))))
 
 
 (defun org-inlinetask-toggle-visibility ()
 (defun org-inlinetask-toggle-visibility ()
   "Toggle visibility of inline task at point."
   "Toggle visibility of inline task at point."

+ 45 - 31
lisp/org-list.el

@@ -27,30 +27,31 @@
 
 
 ;; This file contains the code dealing with plain lists in Org-mode.
 ;; This file contains the code dealing with plain lists in Org-mode.
 
 
-;; The fundamental idea behind lists work is to use structures.
-;; A structure is a snapshot of the list, in the shape of data tree
-;; (see `org-list-struct').
+;; The core concept behind lists is their structure.  A structure is
+;; a snapshot of the list, in the shape of a data tree (see
+;; `org-list-struct').
 
 
 ;; Once the list structure is stored, it is possible to make changes
 ;; Once the list structure is stored, it is possible to make changes
-;; directly on it or get useful information about the list, with the
-;; two helper functions, namely `org-list-parents-alist' and
-;; `org-list-prevs-alist', and using accessors or methods.
+;; on it that will be mirrored to the real list or to get information
+;; about the list, using accessors and methods provided in the
+;; library.  Most of them require the use of one or two helper
+;; functions, namely `org-list-parents-alist' and
+;; `org-list-prevs-alist'.
 
 
 ;; Structure is eventually applied to the buffer with
 ;; Structure is eventually applied to the buffer with
 ;; `org-list-write-struct'.  This function repairs (bullets,
 ;; `org-list-write-struct'.  This function repairs (bullets,
-;; indentation, checkboxes) the structure before applying it.  It
-;; should be called near the end of any function working on
-;; structures.
+;; indentation, checkboxes) the list in the process.  It should be
+;; called near the end of any function working on structures.
 
 
 ;; Thus, a function applying to lists should usually follow this
 ;; Thus, a function applying to lists should usually follow this
 ;; template:
 ;; template:
 
 
 ;; 1. Verify point is in a list and grab item beginning (with the same
 ;; 1. Verify point is in a list and grab item beginning (with the same
 ;;    function `org-in-item-p').  If the function requires the cursor
 ;;    function `org-in-item-p').  If the function requires the cursor
-;;    to be at item's bullet, `org-at-item-p' is more selective.  If
-;;    the cursor is amidst the buffer, it is possible to find the
-;;    closest item with `org-list-search-backward', or
-;;    `org-list-search-forward', applied to `org-item-beginning-re'.
+;;    to be at item's bullet, `org-at-item-p' is more selective.  It
+;;    is also possible to move point to the closest item with
+;;    `org-list-search-backward', or `org-list-search-forward',
+;;    applied to the function `org-item-beginning-re'.
 
 
 ;; 2. Get list structure with `org-list-struct'.
 ;; 2. Get list structure with `org-list-struct'.
 
 
@@ -61,13 +62,14 @@
 ;; 4. Proceed with the modifications, using methods and accessors.
 ;; 4. Proceed with the modifications, using methods and accessors.
 
 
 ;; 5. Verify and apply structure to buffer, using
 ;; 5. Verify and apply structure to buffer, using
-;;    `org-list-write-struct'.  Possibly use
-;;    `org-update-checkbox-count-maybe' if checkboxes might have been
-;;    modified.
+;;    `org-list-write-struct'.
 
 
-;; Computing a list structure can be a costly operation on huge lists
-;; (a few thousand lines long).  Thus, code should follow the rule :
-;; "collect once, use many".  As a corollary, it is usally a bad idea
+;; 6. If changes made to the list might have modified check-boxes,
+;;    call `org-update-checkbox-count-maybe'.
+
+;; Computing a structure can be a costly operation on huge lists (a
+;; few thousand lines long).  Thus, code should follow the rule:
+;; "collect once, use many".  As a corollary, it is usually a bad idea
 ;; to use directly an interactive function inside the code, as those,
 ;; to use directly an interactive function inside the code, as those,
 ;; being independant entities, read the whole list structure another
 ;; being independant entities, read the whole list structure another
 ;; time.
 ;; time.
@@ -126,6 +128,8 @@
 (declare-function outline-next-heading "outline" ())
 (declare-function outline-next-heading "outline" ())
 (declare-function outline-previous-heading "outline" ())
 (declare-function outline-previous-heading "outline" ())
 
 
+
+
 ;;; Configuration variables
 ;;; Configuration variables
 
 
 (defgroup org-plain-lists nil
 (defgroup org-plain-lists nil
@@ -269,7 +273,7 @@ By default, automatic actions are taken when using
  \\[org-meta-return], \\[org-metaright], \\[org-metaleft],
  \\[org-meta-return], \\[org-metaright], \\[org-metaleft],
  \\[org-shiftmetaright], \\[org-shiftmetaleft],
  \\[org-shiftmetaright], \\[org-shiftmetaleft],
  \\[org-ctrl-c-minus], \\[org-toggle-checkbox] or
  \\[org-ctrl-c-minus], \\[org-toggle-checkbox] or
- \\[org-insert-todo-heading]. You can disable individually these
+ \\[org-insert-todo-heading].  You can disable individually these
  rules by setting them to nil.  Valid rules are:
  rules by setting them to nil.  Valid rules are:
 
 
 bullet    when non-nil, cycling bullet do not allow lists at
 bullet    when non-nil, cycling bullet do not allow lists at
@@ -374,6 +378,7 @@ specifically, type `block' is determined by the variable
 `org-list-forbidden-blocks'.")
 `org-list-forbidden-blocks'.")
 
 
 
 
+
 ;;; Predicates and regexps
 ;;; Predicates and regexps
 
 
 (defconst org-list-end-re (if org-empty-line-terminates-plain-lists
 (defconst org-list-end-re (if org-empty-line-terminates-plain-lists
@@ -533,6 +538,7 @@ This checks `org-list-ending-method'."
        (match-string 2)))
        (match-string 2)))
 
 
 
 
+
 ;;; Structures and helper functions
 ;;; Structures and helper functions
 
 
 (defun org-list-context ()
 (defun org-list-context ()
@@ -873,6 +879,7 @@ This function modifies STRUCT."
 		  (cdr struct)))))
 		  (cdr struct)))))
 
 
 
 
+
 ;;; Accessors
 ;;; Accessors
 
 
 (defsubst org-list-get-nth (n key struct)
 (defsubst org-list-get-nth (n key struct)
@@ -990,8 +997,8 @@ items, as returned by `org-list-prevs-alist'."
 
 
 (defun org-list-get-children (item struct parents)
 (defun org-list-get-children (item struct parents)
   "List all children of ITEM, or nil.
   "List all children of ITEM, or nil.
-STRUCT is the list structure. PARENTS is the alist of parents, as
-returned by `org-list-parents-alist'."
+STRUCT is the list structure.  PARENTS is the alist of parents,
+as returned by `org-list-parents-alist'."
   (let (all child)
   (let (all child)
     (while (setq child (car (rassq item parents)))
     (while (setq child (car (rassq item parents)))
       (setq parents (cdr (member (assq child parents) parents)))
       (setq parents (cdr (member (assq child parents) parents)))
@@ -1050,6 +1057,7 @@ type is determined by the first item of the list."
      (t 'unordered))))
      (t 'unordered))))
 
 
 
 
+
 ;;; Searching
 ;;; Searching
 
 
 (defun org-list-search-generic (search re bound noerr)
 (defun org-list-search-generic (search re bound noerr)
@@ -1082,6 +1090,7 @@ Arguments REGEXP, BOUND and NOERROR are similar to those used in
 			   regexp (or bound (point-max)) noerror))
 			   regexp (or bound (point-max)) noerror))
 
 
 
 
+
 ;;; Methods on structures
 ;;; Methods on structures
 
 
 (defsubst org-list-bullet-string (bullet)
 (defsubst org-list-bullet-string (bullet)
@@ -1370,8 +1379,8 @@ If DEST is a buffer position, the function will assume it points
 to another item in the same list as ITEM, and will move the
 to another item in the same list as ITEM, and will move the
 latter just before the former.
 latter just before the former.
 
 
-If DEST is `begin' \(resp. `end'\), ITEM will be moved at the
-beginning \(resp. end\) of the list it belongs to.
+If DEST is `begin' \(respectively `end'\), ITEM will be moved at
+the beginning \(respectively end\) of the list it belongs to.
 
 
 If DEST is a string like \"N\", where N is an integer, ITEM will
 If DEST is a string like \"N\", where N is an integer, ITEM will
 be moved at the Nth position in the list.
 be moved at the Nth position in the list.
@@ -1549,12 +1558,13 @@ bullets between START and END."
     (mapcar ind parents)))
     (mapcar ind parents)))
 
 
 
 
+
 ;;; Repairing structures
 ;;; Repairing structures
 
 
 (defun org-list-use-alpha-bul-p (first struct prevs)
 (defun org-list-use-alpha-bul-p (first struct prevs)
   "Non-nil if list starting at FIRST can have alphabetical bullets.
   "Non-nil if list starting at FIRST can have alphabetical bullets.
 
 
-STRUCT is list structure. PREVS is the alist of previous items,
+STRUCT is list structure.  PREVS is the alist of previous items,
 as returned by `org-list-prevs-alist'."
 as returned by `org-list-prevs-alist'."
   (and org-alphabetical-lists
   (and org-alphabetical-lists
        (catch 'exit
        (catch 'exit
@@ -1753,14 +1763,14 @@ This function modifies STRUCT."
 	    (nth index all-items)))))))
 	    (nth index all-items)))))))
 
 
 (defun org-list-struct-apply-struct (struct old-struct)
 (defun org-list-struct-apply-struct (struct old-struct)
-  "Apply set-difference between STRUCT and OLD-STRUCT to the buffer.
+  "Apply set difference between STRUCT and OLD-STRUCT to the buffer.
 
 
 OLD-STRUCT is the structure before any modifications, and STRUCT
 OLD-STRUCT is the structure before any modifications, and STRUCT
 the structure to be applied.  The function will only modify parts
 the structure to be applied.  The function will only modify parts
 of the list which have changed.
 of the list which have changed.
 
 
 Initial position of cursor is restored after the changes."
 Initial position of cursor is restored after the changes."
-  (let* ((origin (copy-marker (point)))
+  (let* ((origin (point-marker))
 	 (inlinetask-re (and (featurep 'org-inlinetask)
 	 (inlinetask-re (and (featurep 'org-inlinetask)
 			     (org-inlinetask-outline-regexp)))
 			     (org-inlinetask-outline-regexp)))
 	 (item-re (org-item-re))
 	 (item-re (org-item-re))
@@ -1814,7 +1824,7 @@ Initial position of cursor is restored after the changes."
 		 (replace-match "" nil nil nil 1))
 		 (replace-match "" nil nil nil 1))
 		(t (let ((counterp (match-end 2)))
 		(t (let ((counterp (match-end 2)))
 		     (goto-char (if counterp (1+ counterp) (match-end 1)))
 		     (goto-char (if counterp (1+ counterp) (match-end 1)))
-		   (insert (concat new-box (unless counterp " "))))))
+		     (insert (concat new-box (unless counterp " "))))))
 	       ;; c. Indent item to appropriate column.
 	       ;; c. Indent item to appropriate column.
 	       (unless (= new-ind old-ind)
 	       (unless (= new-ind old-ind)
 		 (delete-region (goto-char (point-at-bol))
 		 (delete-region (goto-char (point-at-bol))
@@ -1920,6 +1930,7 @@ as returned by `org-list-parents-alist'."
   (org-list-struct-apply-struct struct old-struct)))
   (org-list-struct-apply-struct struct old-struct)))
 
 
 
 
+
 ;;; Misc Tools
 ;;; Misc Tools
 
 
 (defun org-apply-on-list (function init-value &rest args)
 (defun org-apply-on-list (function init-value &rest args)
@@ -1951,7 +1962,7 @@ beginning of the item."
 (defun org-list-set-item-visibility (item struct view)
 (defun org-list-set-item-visibility (item struct view)
   "Set visibility of ITEM in STRUCT to VIEW.
   "Set visibility of ITEM in STRUCT to VIEW.
 
 
-Possible values are: `folded', `children' or `subtree'. See
+Possible values are: `folded', `children' or `subtree'.  See
 `org-cycle' for more information."
 `org-cycle' for more information."
   (cond
   (cond
    ((eq view 'folded)
    ((eq view 'folded)
@@ -1987,6 +1998,7 @@ Possible values are: `folded', `children' or `subtree'. See
     tcol))
     tcol))
 
 
 
 
+
 ;;; Interactive functions
 ;;; Interactive functions
 
 
 (defalias 'org-list-get-item-begin 'org-in-item-p)
 (defalias 'org-list-get-item-begin 'org-in-item-p)
@@ -2495,7 +2507,8 @@ Otherwise it will be `org-todo'."
       'org-checkbox-statistics-todo)))
       'org-checkbox-statistics-todo)))
 
 
 (defun org-update-checkbox-count-maybe (&optional all)
 (defun org-update-checkbox-count-maybe (&optional all)
-  "Update checkbox statistics unless turned off by user."
+  "Update checkbox statistics unless turned off by user.
+With an optional argument ALL, update them in the whole buffer."
   (when (cdr (assq 'checkbox org-list-automatic-rules))
   (when (cdr (assq 'checkbox org-list-automatic-rules))
     (org-update-checkbox-count all))
     (org-update-checkbox-count all))
   (run-hooks 'org-checkbox-statistics-hook))
   (run-hooks 'org-checkbox-statistics-hook))
@@ -2715,7 +2728,7 @@ Capital letters will reverse the sort order.
 If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies
 If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies
 a function to be called with point at the beginning of the
 a function to be called with point at the beginning of the
 record.  It must return either a string or a number that should
 record.  It must return either a string or a number that should
-serve as the sorting key for that record. It will then use
+serve as the sorting key for that record.  It will then use
 COMPARE-FUNC to compare entries."
 COMPARE-FUNC to compare entries."
   (interactive "P")
   (interactive "P")
   (let* ((case-func (if with-case 'identity 'downcase))
   (let* ((case-func (if with-case 'identity 'downcase))
@@ -2790,6 +2803,7 @@ COMPARE-FUNC to compare entries."
 	(message "Sorting items...done")))))
 	(message "Sorting items...done")))))
 
 
 
 
+
 ;;; Send and receive lists
 ;;; Send and receive lists
 
 
 (defun org-list-parse-list (&optional delete)
 (defun org-list-parse-list (&optional delete)

+ 5 - 2
lisp/org.el

@@ -11367,8 +11367,11 @@ changes because there are unchecked boxes in this entry."
 	  (outline-next-heading)
 	  (outline-next-heading)
 	  (setq end (point))
 	  (setq end (point))
 	  (goto-char beg)
 	  (goto-char beg)
-	  (if (re-search-forward "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\)[ \t]+\\[[- ]\\]"
-				 end t)
+	  (if (org-list-search-forward
+	       (concat (org-item-beginning-re)
+		       "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ \t]*\\)?"
+		       "\\[[- ]\\]")
+	       end t)
 	      (progn
 	      (progn
 		(if (boundp 'org-blocked-by-checkboxes)
 		(if (boundp 'org-blocked-by-checkboxes)
 		    (setq org-blocked-by-checkboxes t))
 		    (setq org-blocked-by-checkboxes t))