Browse Source

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

Eric Schulte 14 years ago
parent
commit
59531de090
13 changed files with 83 additions and 78 deletions
  1. 1 1
      lisp/ob-comint.el
  2. 1 1
      lisp/ob-screen.el
  3. 1 1
      lisp/ob.el
  4. 7 2
      lisp/org-agenda.el
  5. 1 0
      lisp/org-exp.el
  6. 1 1
      lisp/org-feed.el
  7. 14 2
      lisp/org-icalendar.el
  8. 6 1
      lisp/org-latex.el
  9. 15 54
      lisp/org-list.el
  10. 1 1
      lisp/org-mhe.el
  11. 12 7
      lisp/org-publish.el
  12. 4 1
      lisp/org-src.el
  13. 19 6
      lisp/org.el

+ 1 - 1
lisp/ob-comint.el

@@ -45,7 +45,7 @@
 (defmacro org-babel-comint-in-buffer (buffer &rest body)
 (defmacro org-babel-comint-in-buffer (buffer &rest body)
   "Check BUFFER and execute BODY.
   "Check BUFFER and execute BODY.
 BUFFER is checked with `org-babel-comint-buffer-livep'.  BODY is
 BUFFER is checked with `org-babel-comint-buffer-livep'.  BODY is
-executed inside the protection of `save-window-excursion' and
+executed inside the protection of `save-excursion' and
 `save-match-data'."
 `save-match-data'."
   (declare (indent 1))
   (declare (indent 1))
   `(save-excursion
   `(save-excursion

+ 1 - 1
lisp/ob-screen.el

@@ -50,7 +50,7 @@ In case you want to use a different screen than one selected by your $PATH")
 
 
 (defun org-babel-execute:screen (body params)
 (defun org-babel-execute:screen (body params)
   "Send a block of code via screen to a terminal using Babel.
   "Send a block of code via screen to a terminal using Babel.
-\"default\" session is be used when none is specified."
+\"default\" session is used when none is specified."
   (message "Sending source code block to interactive terminal session...")
   (message "Sending source code block to interactive terminal session...")
   (save-window-excursion
   (save-window-excursion
     (let* ((processed-params (org-babel-process-params params))
     (let* ((processed-params (org-babel-process-params params))

+ 1 - 1
lisp/ob.el

@@ -1719,7 +1719,7 @@ Fixes a bug in `tramp-handle-call-process-region'."
 
 
 (defun org-babel-maybe-remote-file (file)
 (defun org-babel-maybe-remote-file (file)
   "Conditionally parse information on a remote connnection.
   "Conditionally parse information on a remote connnection.
-If FILE specifies a remove file, then parse the information on
+If FILE specifies a remote file, then parse the information on
 the remote connection."
 the remote connection."
   (if (file-remote-p default-directory)
   (if (file-remote-p default-directory)
       (let* ((vec (tramp-dissect-file-name default-directory))
       (let* ((vec (tramp-dissect-file-name default-directory))

+ 7 - 2
lisp/org-agenda.el

@@ -2829,7 +2829,11 @@ the global options and expect it to be applied to the entire view.")
 	(switch-to-buffer-other-frame abuf))
 	(switch-to-buffer-other-frame abuf))
        ((equal org-agenda-window-setup 'reorganize-frame)
        ((equal org-agenda-window-setup 'reorganize-frame)
 	(delete-other-windows)
 	(delete-other-windows)
-	(org-switch-to-buffer-other-window abuf))))
+	(org-switch-to-buffer-other-window abuf)))
+      ;; additional test in case agenda is invoked from within agenda
+      ;; buffer via elisp link
+      (unless (equal (current-buffer) abuf)
+	(switch-to-buffer abuf)))
     (setq buffer-read-only nil)
     (setq buffer-read-only nil)
     (let ((inhibit-read-only t)) (erase-buffer))
     (let ((inhibit-read-only t)) (erase-buffer))
     (org-agenda-mode)
     (org-agenda-mode)
@@ -7279,7 +7283,8 @@ the resulting entry will not be shown.  When TEXT is empty, switch to
       (let ((calendar-date-display-form
       (let ((calendar-date-display-form
 	     (if (if (boundp 'calendar-date-style)
 	     (if (if (boundp 'calendar-date-style)
 		     (eq calendar-date-style 'european)
 		     (eq calendar-date-style 'european)
-		   (org-bound-and-true-p european-calendar-style)) ; Emacs 22
+		   (with-no-warnings ;; european-calendar-style is obsolete as of version 23.1
+		     (org-bound-and-true-p european-calendar-style))) ; Emacs 22
 		 '(day " " month " " year)
 		 '(day " " month " " year)
 	       '(month " " day " " year))))
 	       '(month " " day " " year))))
 
 

+ 1 - 0
lisp/org-exp.el

@@ -771,6 +771,7 @@ modified) list.")
 	;; Add macro definitions
 	;; Add macro definitions
 	(setq p (plist-put p :macro-date "(eval (format-time-string \"$1\"))"))
 	(setq p (plist-put p :macro-date "(eval (format-time-string \"$1\"))"))
 	(setq p (plist-put p :macro-time "(eval (format-time-string \"$1\"))"))
 	(setq p (plist-put p :macro-time "(eval (format-time-string \"$1\"))"))
+	(setq p (plist-put p :macro-property "(eval (org-entry-get nil \"$1\" 'selective))"))
 	(setq p (plist-put
 	(setq p (plist-put
 		 p :macro-modification-time
 		 p :macro-modification-time
 		 (and (buffer-file-name)
 		 (and (buffer-file-name)

+ 1 - 1
lisp/org-feed.el

@@ -103,7 +103,7 @@
 
 
 (defgroup org-feed  nil
 (defgroup org-feed  nil
   "Options concerning RSS feeds as inputs for Org files."
   "Options concerning RSS feeds as inputs for Org files."
-  :tag "Org ID"
+  :tag "Org Feed"
   :group 'org)
   :group 'org)
 
 
 (defcustom org-feed-alist nil
 (defcustom org-feed-alist nil

+ 14 - 2
lisp/org-icalendar.el

@@ -194,6 +194,13 @@ When nil of the empty string, use the abbreviation retrieved from Emacs."
 	  (const :tag "Unspecified" nil)
 	  (const :tag "Unspecified" nil)
 	  (string :tag "Time zone")))
 	  (string :tag "Time zone")))
 
 
+(defcustom org-icalendar-use-UTC-date-time ()
+  "Non-nil force the use of the universal time for iCalendar DATE-TIME.
+The iCalendar DATE-TIME can be expressed with local time or universal Time,
+universal time could be more compatible with some external tools."
+  :group 'org-export-icalendar
+  :type 'boolean)
+
 ;;; iCalendar export
 ;;; iCalendar export
 
 
 ;;;###autoload
 ;;;###autoload
@@ -634,8 +641,13 @@ a time), or the day by one (if it does not contain a time)."
 		(setq h (+ 2 h)))
 		(setq h (+ 2 h)))
 	    (setq d (1+ d))))
 	    (setq d (1+ d))))
 	(setq time (encode-time s mi h d m y)))
 	(setq time (encode-time s mi h d m y)))
-      (setq fmt (if have-time ":%Y%m%dT%H%M%S" ";VALUE=DATE:%Y%m%d"))
-      (concat keyword (format-time-string fmt time)))))
+      (setq fmt (if have-time (if org-icalendar-use-UTC-date-time 
+				  ":%Y%m%dT%H%M%SZ"
+				  ":%Y%m%dT%H%M%S")
+		    ";VALUE=DATE:%Y%m%d"))
+      (concat keyword (format-time-string fmt time 
+					  (and org-icalendar-use-UTC-date-time 
+					       have-time))))))
 
 
 (provide 'org-icalendar)
 (provide 'org-icalendar)
 
 

+ 6 - 1
lisp/org-latex.el

@@ -280,6 +280,11 @@ markup defined, the first one in the association list will be used."
 		   (string :tag "Keyword")
 		   (string :tag "Keyword")
 		   (string :tag "Markup")))))
 		   (string :tag "Markup")))))
 
 
+(defcustom org-export-latex-tag-markup "\\textbf{%s}"
+  "Markup for tags, as a printf format."
+  :group 'org-export-latex
+  :type 'string)
+
 (defcustom org-export-latex-timestamp-markup "\\textit{%s}"
 (defcustom org-export-latex-timestamp-markup "\\textit{%s}"
   "A printf format string to be applied to time stamps."
   "A printf format string to be applied to time stamps."
   :group 'org-export-latex
   :group 'org-export-latex
@@ -1335,7 +1340,7 @@ links, keywords, lists, tables, fixed-width"
 	  (replace-match "")
 	  (replace-match "")
 	(replace-match
 	(replace-match
 	 (org-export-latex-protect-string
 	 (org-export-latex-protect-string
-	  (format "\\textbf{%s}"
+	  (format org-export-latex-tag-markup
 		  (save-match-data
 		  (save-match-data
 		    (replace-regexp-in-string
 		    (replace-regexp-in-string
 		     "_" "\\\\_" (match-string 0)))))
 		     "_" "\\\\_" (match-string 0)))))

+ 15 - 54
lisp/org-list.el

@@ -73,7 +73,6 @@
 
 
 (defcustom org-cycle-include-plain-lists t
 (defcustom org-cycle-include-plain-lists t
   "When t, make TAB cycle visibility on plain list items.
   "When t, make TAB cycle visibility on plain list items.
-
 Cycling plain lists works only when the cursor is on a plain list
 Cycling plain lists works only when the cursor is on a plain list
 item.  When the cursor is on an outline heading, plain lists are
 item.  When the cursor is on an outline heading, plain lists are
 treated as text.  This is the most stable way of handling this,
 treated as text.  This is the most stable way of handling this,
@@ -161,7 +160,6 @@ spaces instead of one after the bullet in each item of the list."
 
 
 (defcustom org-list-ending-method 'both
 (defcustom org-list-ending-method 'both
   "Determine where plain lists should end.
   "Determine where plain lists should end.
-
 Valid values are: `regexp', `indent' or `both'.
 Valid values are: `regexp', `indent' or `both'.
 
 
 When set to `regexp', Org will look into two variables,
 When set to `regexp', Org will look into two variables,
@@ -183,7 +181,6 @@ determine lists endings. This is the default method."
 
 
 (defcustom org-empty-line-terminates-plain-lists nil
 (defcustom org-empty-line-terminates-plain-lists nil
   "Non-nil means an empty line ends all plain list levels.
   "Non-nil means an empty line ends all plain list levels.
-
 This variable only makes sense if `org-list-ending-method' is set
 This variable only makes sense if `org-list-ending-method' is set
 to `regexp' or `both'. This is then equivalent to set
 to `regexp' or `both'. This is then equivalent to set
 `org-list-end-regexp' to \"^[ \\t]*$\"."
 `org-list-end-regexp' to \"^[ \\t]*$\"."
@@ -203,14 +200,12 @@ precedence over it."
 				      (indent . t)
 				      (indent . t)
 				      (insert . t))
 				      (insert . t))
   "Non-nil means apply set of rules when acting on lists.
   "Non-nil means apply set of rules when acting on lists.
-
 By default, automatic actions are taken when using
 By default, automatic actions are taken when using
-\\[org-shiftmetaup], \\[org-shiftmetadown], \\[org-meta-return],
-\\[org-metaright], \\[org-metaleft], \\[org-shiftmetaright],
-\\[org-shiftmetaleft], \\[org-ctrl-c-minus],
-\\[org-toggle-checkbox] or \\[org-insert-todo-heading].  You can
-disable individually these rules by setting them to nil.  Valid
-rules are:
+ \\[org-meta-return], \\[org-metaright], \\[org-metaleft],
+ \\[org-shiftmetaright], \\[org-shiftmetaleft],
+ \\[org-ctrl-c-minus], \\[org-toggle-checkbox] or
+ \\[org-insert-todo-heading]. You can disable individually these
+ 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
           column 0 to have * as a bullet and descriptions lists
           column 0 to have * as a bullet and descriptions lists
@@ -327,7 +322,6 @@ the end of the nearest terminator from MAX."
 
 
 (defun org-list-maybe-skip-block (search limit)
 (defun org-list-maybe-skip-block (search limit)
   "Return non-nil value if point is in a block, skipping it on the way.
   "Return non-nil value if point is in a block, skipping it on the way.
-
 It looks for the boundary of the block in SEARCH direction,
 It looks for the boundary of the block in SEARCH direction,
 stopping at LIMIT."
 stopping at LIMIT."
   (save-match-data
   (save-match-data
@@ -341,7 +335,6 @@ stopping at LIMIT."
 
 
 (defun org-list-search-unenclosed-generic (search re bound noerr)
 (defun org-list-search-unenclosed-generic (search re bound noerr)
   "Search a string outside blocks and protected places.
   "Search a string outside blocks and protected places.
-
 Arguments SEARCH, RE, BOUND and NOERR are similar to those in
 Arguments SEARCH, RE, BOUND and NOERR are similar to those in
 `search-forward', `search-backward', `re-search-forward' and
 `search-forward', `search-backward', `re-search-forward' and
 `re-search-backward'."
 `re-search-backward'."
@@ -360,7 +353,6 @@ Arguments SEARCH, RE, BOUND and NOERR are similar to those in
 
 
 (defun org-search-backward-unenclosed (regexp &optional bound noerror)
 (defun org-search-backward-unenclosed (regexp &optional bound noerror)
   "Like `re-search-backward' but don't stop inside blocks or protected places.
   "Like `re-search-backward' but don't stop inside blocks or protected places.
-
 Arguments REGEXP, BOUND and NOERROR are similar to those used in
 Arguments REGEXP, BOUND and NOERROR are similar to those used in
 `re-search-backward'."
 `re-search-backward'."
   (org-list-search-unenclosed-generic
   (org-list-search-unenclosed-generic
@@ -368,7 +360,6 @@ Arguments REGEXP, BOUND and NOERROR are similar to those used in
 
 
 (defun org-search-forward-unenclosed (regexp &optional bound noerror)
 (defun org-search-forward-unenclosed (regexp &optional bound noerror)
   "Like `re-search-forward' but don't stop inside blocks or protected places.
   "Like `re-search-forward' but don't stop inside blocks or protected places.
-
 Arguments REGEXP, BOUND and NOERROR are similar to those used in
 Arguments REGEXP, BOUND and NOERROR are similar to those used in
 `re-search-forward'."
 `re-search-forward'."
   (org-list-search-unenclosed-generic
   (org-list-search-unenclosed-generic
@@ -376,7 +367,6 @@ Arguments REGEXP, BOUND and NOERROR are similar to those used in
 
 
 (defun org-list-in-item-p-with-indent (limit)
 (defun org-list-in-item-p-with-indent (limit)
   "Is the cursor inside a plain list?
   "Is the cursor inside a plain list?
-
 Plain lists are considered ending when a non-blank line is less
 Plain lists are considered ending when a non-blank line is less
 indented than the previous item within LIMIT."
 indented than the previous item within LIMIT."
   (save-excursion
   (save-excursion
@@ -413,7 +403,6 @@ indented than the previous item within LIMIT."
 
 
 (defun org-list-in-item-p-with-regexp (limit)
 (defun org-list-in-item-p-with-regexp (limit)
   "Is the cursor inside a plain list?
   "Is the cursor inside a plain list?
-
 Plain lists end when `org-list-end-regexp' is matched, or at a
 Plain lists end when `org-list-end-regexp' is matched, or at a
 blank line if `org-empty-line-terminates-plain-lists' is true.
 blank line if `org-empty-line-terminates-plain-lists' is true.
 
 
@@ -434,7 +423,6 @@ Argument LIMIT specifies the upper-bound of the search."
 
 
 (defun org-list-top-point-with-regexp (limit)
 (defun org-list-top-point-with-regexp (limit)
   "Return point at the top level item in a list.
   "Return point at the top level item in a list.
-
 Argument LIMIT specifies the upper-bound of the search.
 Argument LIMIT specifies the upper-bound of the search.
 
 
 List ending is determined by regexp. See
 List ending is determined by regexp. See
@@ -450,7 +438,6 @@ List ending is determined by regexp. See
 
 
 (defun org-list-bottom-point-with-regexp (limit)
 (defun org-list-bottom-point-with-regexp (limit)
   "Return point just before list ending.
   "Return point just before list ending.
-
 Argument LIMIT specifies the lower-bound of the search.
 Argument LIMIT specifies the lower-bound of the search.
 
 
 List ending is determined by regexp. See
 List ending is determined by regexp. See
@@ -464,7 +451,6 @@ List ending is determined by regexp. See
 
 
 (defun org-list-top-point-with-indent (limit)
 (defun org-list-top-point-with-indent (limit)
   "Return point at the top level in a list.
   "Return point at the top level in a list.
-
 Argument LIMIT specifies the upper-bound of the search.
 Argument LIMIT specifies the upper-bound of the search.
 
 
 List ending is determined by indentation of text. See
 List ending is determined by indentation of text. See
@@ -501,7 +487,6 @@ List ending is determined by indentation of text. See
 
 
 (defun org-list-bottom-point-with-indent (limit)
 (defun org-list-bottom-point-with-indent (limit)
   "Return point just before list ending or nil if not in a list.
   "Return point just before list ending or nil if not in a list.
-
 Argument LIMIT specifies the lower-bound of the search.
 Argument LIMIT specifies the lower-bound of the search.
 
 
 List ending is determined by the indentation of text. See
 List ending is determined by the indentation of text. See
@@ -568,7 +553,6 @@ uses PRE-MOVE before search. Return nil if no item was found."
 
 
 (defun org-list-separating-blank-lines-number (pos top bottom)
 (defun org-list-separating-blank-lines-number (pos top bottom)
   "Return number of blank lines that should separate items in list.
   "Return number of blank lines that should separate items in list.
-
 POS is the position of point to be considered.
 POS is the position of point to be considered.
 
 
 TOP and BOTTOM are respectively position of list beginning and
 TOP and BOTTOM are respectively position of list beginning and
@@ -613,7 +597,6 @@ some heuristics to guess the result."
 
 
 (defun org-list-insert-item-generic (pos &optional checkbox after-bullet)
 (defun org-list-insert-item-generic (pos &optional checkbox after-bullet)
   "Insert a new list item at POS.
   "Insert a new list item at POS.
-
 If POS is before first character after bullet of the item, the
 If POS is before first character after bullet of the item, the
 new item will be created before the current one.
 new item will be created before the current one.
 
 
@@ -703,7 +686,6 @@ function ends."
 
 
 (defun org-list-indent-item-generic (arg no-subtree top bottom)
 (defun org-list-indent-item-generic (arg no-subtree top bottom)
   "Indent a local list item including its children.
   "Indent a local list item including its children.
-
 When number ARG is a negative, item will be outdented, otherwise
 When number ARG is a negative, item will be outdented, otherwise
 it will be indented.
 it will be indented.
 
 
@@ -876,8 +858,10 @@ A checkbox is blocked if all of the following conditions are fulfilled:
 ;; already in a list and doesn't compute list boundaries.
 ;; already in a list and doesn't compute list boundaries.
 
 
 ;; If you plan to use more than one org-list function is some code,
 ;; If you plan to use more than one org-list function is some code,
-;; you should therefore first compute list boundaries, and then make
-;; use of non-interactive forms.
+;; you should therefore first check if point is in a list with
+;; `org-in-item-p' or `org-at-item-p', then compute list boundaries
+;; with `org-list-top-point' and `org-list-bottom-point', and make use
+;; of non-interactive forms.
 
 
 (defun org-list-top-point ()
 (defun org-list-top-point ()
   "Return point at the top level in a list.
   "Return point at the top level in a list.
@@ -973,8 +957,8 @@ If the cursor in not in an item, throw an error."
 (defun org-get-end-of-item (bottom)
 (defun org-get-end-of-item (bottom)
   "Return position at the end of the current item.
   "Return position at the end of the current item.
 BOTTOM is the position at list ending."
 BOTTOM is the position at list ending."
-  (let* ((next-p (org-get-next-item (point) bottom)))
-    (or next-p (org-get-end-of-list bottom))))
+  (or (org-get-next-item (point) bottom)
+      (org-get-end-of-list bottom)))
 
 
 (defun org-end-of-item ()
 (defun org-end-of-item ()
   "Go to the end of the current hand-formatted item.
   "Go to the end of the current hand-formatted item.
@@ -1011,7 +995,6 @@ Stop searching at LIMIT. Return nil if no item is found."
 
 
 (defun org-previous-item ()
 (defun org-previous-item ()
   "Move to the beginning of the previous item.
   "Move to the beginning of the previous item.
-
 Item is at the same level in the current plain list. Error if not
 Item is at the same level in the current plain list. Error if not
 in a plain list, or if this is the first item in the list."
 in a plain list, or if this is the first item in the list."
   (interactive)
   (interactive)
@@ -1028,7 +1011,6 @@ Stop searching at LIMIT. Return nil if no item is found."
 
 
 (defun org-next-item ()
 (defun org-next-item ()
   "Move to the beginning of the next item.
   "Move to the beginning of the next item.
-
 Item is at the same level in the current plain list. Error if not
 Item is at the same level in the current plain list. Error if not
 in a plain list, or if this is the last item in the list."
 in a plain list, or if this is the last item in the list."
   (interactive)
   (interactive)
@@ -1041,7 +1023,6 @@ in a plain list, or if this is the last item in the list."
 
 
 (defun org-list-exchange-items (beg-A beg-B bottom)
 (defun org-list-exchange-items (beg-A beg-B bottom)
   "Swap item starting at BEG-A with item starting at BEG-B.
   "Swap item starting at BEG-A with item starting at BEG-B.
-
 Blank lines at the end of items are left in place. Assume BEG-A
 Blank lines at the end of items are left in place. Assume BEG-A
 is lesser than BEG-B.
 is lesser than BEG-B.
 
 
@@ -1062,7 +1043,6 @@ BOTTOM is the position at list ending."
 
 
 (defun org-move-item-down ()
 (defun org-move-item-down ()
   "Move the plain list item at point down, i.e. swap with following item.
   "Move the plain list item at point down, i.e. swap with following item.
-
 Subitems (items with larger indentation) are considered part of the item,
 Subitems (items with larger indentation) are considered part of the item,
 so this really moves item trees."
 so this really moves item trees."
   (interactive)
   (interactive)
@@ -1084,7 +1064,6 @@ so this really moves item trees."
 
 
 (defun org-move-item-up ()
 (defun org-move-item-up ()
   "Move the plain list item at point up, i.e. swap with previous item.
   "Move the plain list item at point up, i.e. swap with previous item.
-
 Subitems (items with larger indentation) are considered part of the item,
 Subitems (items with larger indentation) are considered part of the item,
 so this really moves item trees."
 so this really moves item trees."
   (interactive)
   (interactive)
@@ -1106,7 +1085,6 @@ so this really moves item trees."
 
 
 (defun org-insert-item (&optional checkbox)
 (defun org-insert-item (&optional checkbox)
   "Insert a new item at the current level.
   "Insert a new item at the current level.
-
 If cursor is before first character after bullet of the item, the
 If cursor is before first character after bullet of the item, the
 new item will be created before the current one.
 new item will be created before the current one.
 
 
@@ -1166,7 +1144,6 @@ bullet string and bullet counter, if any."
 
 
 (defun org-list-struct (begin end top bottom &optional outdent)
 (defun org-list-struct (begin end top bottom &optional outdent)
   "Return the structure containing the list between BEGIN and END.
   "Return the structure containing the list between BEGIN and END.
-
 A structure is an alist where key is point of item and values
 A structure is an alist where key is point of item and values
 are, in that order, indentation, bullet string and value of
 are, in that order, indentation, bullet string and value of
 counter, if any. A structure contains every list and sublist that
 counter, if any. A structure contains every list and sublist that
@@ -1232,7 +1209,6 @@ change is an outdent."
 
 
 (defun org-list-struct-origins (struct)
 (defun org-list-struct-origins (struct)
   "Return an alist where key is item's position and value parent's.
   "Return an alist where key is item's position and value parent's.
-
 STRUCT is the list's structure looked up."
 STRUCT is the list's structure looked up."
   (let* ((struct-rev (reverse struct))
   (let* ((struct-rev (reverse struct))
 	 (acc (list (cons (nth 1 (car struct)) 0)))
 	 (acc (list (cons (nth 1 (car struct)) 0)))
@@ -1263,7 +1239,6 @@ STRUCT is the list's structure looked up."
 
 
 (defun org-list-struct-get-parent (item struct origins)
 (defun org-list-struct-get-parent (item struct origins)
   "Return parent association of ITEM in STRUCT or nil.
   "Return parent association of ITEM in STRUCT or nil.
-
 ORIGINS is the alist of parents. See `org-list-struct-origins'."
 ORIGINS is the alist of parents. See `org-list-struct-origins'."
   (let* ((parent-pos (cdr (assq (car item) origins))))
   (let* ((parent-pos (cdr (assq (car item) origins))))
     (when (> parent-pos 0) (assq parent-pos struct))))
     (when (> parent-pos 0) (assq parent-pos struct))))
@@ -1276,7 +1251,6 @@ ORIGINS is the alist of parents. See `org-list-struct-origins'."
 
 
 (defun org-list-struct-fix-bul (struct origins)
 (defun org-list-struct-fix-bul (struct origins)
   "Verify and correct bullets for every association in STRUCT.
   "Verify and correct bullets for every association in STRUCT.
-
 ORIGINS is the alist of parents. See `org-list-struct-origins'.
 ORIGINS is the alist of parents. See `org-list-struct-origins'.
 
 
 This function modifies STRUCT."
 This function modifies STRUCT."
@@ -1317,7 +1291,6 @@ This function modifies STRUCT."
 
 
 (defun org-list-struct-fix-ind (struct origins)
 (defun org-list-struct-fix-ind (struct origins)
   "Verify and correct indentation for every association in STRUCT.
   "Verify and correct indentation for every association in STRUCT.
-
 ORIGINS is the alist of parents. See `org-list-struct-origins'.
 ORIGINS is the alist of parents. See `org-list-struct-origins'.
 
 
 This function modifies STRUCT."
 This function modifies STRUCT."
@@ -1337,7 +1310,6 @@ This function modifies STRUCT."
 
 
 (defun org-list-struct-fix-struct (struct origins)
 (defun org-list-struct-fix-struct (struct origins)
   "Return STRUCT with correct bullets and indentation.
   "Return STRUCT with correct bullets and indentation.
-
 ORIGINS is the alist of parents. See `org-list-struct-origins'.
 ORIGINS is the alist of parents. See `org-list-struct-origins'.
 
 
 Only elements of STRUCT that have changed are returned."
 Only elements of STRUCT that have changed are returned."
@@ -1348,7 +1320,6 @@ Only elements of STRUCT that have changed are returned."
 
 
 (defun org-list-struct-outdent (start end origins)
 (defun org-list-struct-outdent (start end origins)
   "Outdent items in a structure.
   "Outdent items in a structure.
-
 Items are indented when their key is between START, included, and
 Items are indented when their key is between START, included, and
 END, excluded.
 END, excluded.
 
 
@@ -1381,7 +1352,6 @@ STRUCT is the concerned structure."
 
 
 (defun org-list-struct-indent (start end origins struct)
 (defun org-list-struct-indent (start end origins struct)
   "Indent items in a structure.
   "Indent items in a structure.
-
 Items are indented when their key is between START, included, and
 Items are indented when their key is between START, included, and
 END, excluded.
 END, excluded.
 
 
@@ -1444,7 +1414,6 @@ END."
 
 
 (defun org-list-struct-apply-struct (struct bottom)
 (defun org-list-struct-apply-struct (struct bottom)
   "Apply modifications to list so it mirrors STRUCT.
   "Apply modifications to list so it mirrors STRUCT.
-
 BOTTOM is position at list ending.
 BOTTOM is position at list ending.
 
 
 Initial position is restored after the changes."
 Initial position is restored after the changes."
@@ -1517,7 +1486,6 @@ BOTTOM is position at list ending."
 
 
 (defun org-outdent-item ()
 (defun org-outdent-item ()
   "Outdent a local list item, but not its children.
   "Outdent a local list item, but not its children.
-
 If a region is active, all items inside will be moved."
 If a region is active, all items inside will be moved."
   (interactive)
   (interactive)
   (org-list-indent-item-generic
   (org-list-indent-item-generic
@@ -1525,7 +1493,6 @@ If a region is active, all items inside will be moved."
 
 
 (defun org-indent-item ()
 (defun org-indent-item ()
   "Indent a local list item, but not its children.
   "Indent a local list item, but not its children.
-
 If a region is active, all items inside will be moved."
 If a region is active, all items inside will be moved."
   (interactive)
   (interactive)
   (org-list-indent-item-generic
   (org-list-indent-item-generic
@@ -1533,7 +1500,6 @@ If a region is active, all items inside will be moved."
 
 
 (defun org-outdent-item-tree ()
 (defun org-outdent-item-tree ()
   "Outdent a local list item including its children.
   "Outdent a local list item including its children.
-
 If a region is active, all items inside will be moved."
 If a region is active, all items inside will be moved."
   (interactive)
   (interactive)
   (org-list-indent-item-generic
   (org-list-indent-item-generic
@@ -1541,7 +1507,6 @@ If a region is active, all items inside will be moved."
 
 
 (defun org-indent-item-tree ()
 (defun org-indent-item-tree ()
   "Indent a local list item including its children.
   "Indent a local list item including its children.
-
 If a region is active, all items inside will be moved."
 If a region is active, all items inside will be moved."
   (interactive)
   (interactive)
   (org-list-indent-item-generic
   (org-list-indent-item-generic
@@ -1550,9 +1515,8 @@ If a region is active, all items inside will be moved."
 (defvar org-tab-ind-state)
 (defvar org-tab-ind-state)
 (defun org-cycle-item-indentation ()
 (defun org-cycle-item-indentation ()
   "Cycle levels of indentation of an empty item.
   "Cycle levels of indentation of an empty item.
-
-The first run indent the item, if applicable. Subsequents runs
-outdent it at meaningful levels in the list. When done, item is
+The first run indent the item, if applicable.  Subsequents runs
+outdent it at meaningful levels in the list.  When done, item is
 put back at its original position with its original bullet.
 put back at its original position with its original bullet.
 
 
 Return t at each successful move."
 Return t at each successful move."
@@ -1699,7 +1663,6 @@ is an integer, 0 means `-', 1 means `+' etc. If WHICH is
 
 
 (defun org-toggle-checkbox (&optional toggle-presence)
 (defun org-toggle-checkbox (&optional toggle-presence)
   "Toggle the checkbox in the current line.
   "Toggle the checkbox in the current line.
-
 With prefix arg TOGGLE-PRESENCE, add or remove checkboxes.  With
 With prefix arg TOGGLE-PRESENCE, add or remove checkboxes.  With
 double prefix, set checkbox to [-].
 double prefix, set checkbox to [-].
 
 
@@ -1935,8 +1898,7 @@ Otherwise it will be `org-todo'."
 ;;; Misc Tools
 ;;; Misc Tools
 
 
 (defun org-apply-on-list (function init-value &rest args)
 (defun org-apply-on-list (function init-value &rest args)
-  "Call FUNCTION for each item of a the list under point.
-
+  "Call FUNCTION on each item of the list at point.
 FUNCTION must be called with at least one argument: INIT-VALUE,
 FUNCTION must be called with at least one argument: INIT-VALUE,
 that will contain the value returned by the function at the
 that will contain the value returned by the function at the
 previous item, plus ARGS extra arguments.
 previous item, plus ARGS extra arguments.
@@ -1944,7 +1906,7 @@ previous item, plus ARGS extra arguments.
 As an example, (org-apply-on-list (lambda (result) (1+ result)) 0)
 As an example, (org-apply-on-list (lambda (result) (1+ result)) 0)
 will return the number of items in the current list.
 will return the number of items in the current list.
 
 
-Sublists of the list are skipped. Cursor is always at the
+Sublists of the list are skipped.  Cursor is always at the
 beginning of the item."
 beginning of the item."
   (let* ((pos (copy-marker (point)))
   (let* ((pos (copy-marker (point)))
 	 (end (copy-marker (org-list-bottom-point)))
 	 (end (copy-marker (org-list-bottom-point)))
@@ -2189,7 +2151,6 @@ this list."
 
 
 (defun org-list-to-generic (list params)
 (defun org-list-to-generic (list params)
   "Convert a LIST parsed through `org-list-parse-list' to other formats.
   "Convert a LIST parsed through `org-list-parse-list' to other formats.
-
 Valid parameters PARAMS are
 Valid parameters PARAMS are
 
 
 :ustart	    String to start an unordered list
 :ustart	    String to start an unordered list

+ 1 - 1
lisp/org-mhe.el

@@ -181,7 +181,7 @@ you have a better idea of how to do this then please let us know."
     (if (equal major-mode 'mh-folder-mode)
     (if (equal major-mode 'mh-folder-mode)
 	(mh-show)
 	(mh-show)
       (mh-show-show))
       (mh-show-show))
-    header-field)))
+    (org-trim header-field))))
 
 
 (defun org-mhe-follow-link (folder article)
 (defun org-mhe-follow-link (folder article)
   "Follow an MH-E link to FOLDER and ARTICLE.
   "Follow an MH-E link to FOLDER and ARTICLE.

+ 12 - 7
lisp/org-publish.el

@@ -578,13 +578,18 @@ See `org-publish-org-to' to the list of arguments."
   "Publish a file with no transformation of any kind.
   "Publish a file with no transformation of any kind.
 See `org-publish-org-to' to the list of arguments."
 See `org-publish-org-to' to the list of arguments."
   ;; make sure eshell/cp code is loaded
   ;; make sure eshell/cp code is loaded
-  (unless (file-directory-p pub-dir)
-    (make-directory pub-dir t))
-  (or (equal (expand-file-name (file-name-directory filename))
-	     (file-name-as-directory (expand-file-name pub-dir)))
-      (copy-file filename
-		 (expand-file-name (file-name-nondirectory filename) pub-dir)
-		 t)))
+  (let* ((rel-dir
+	  (file-relative-name
+	   (file-name-directory filename)
+	   (plist-get plist :base-directory)))
+	 (pub-dir
+	  (expand-file-name
+	   (concat (file-name-as-directory pub-dir) rel-dir))))
+    (unless (file-directory-p pub-dir)
+      (make-directory pub-dir t))
+    (or (equal (expand-file-name (file-name-directory filename))
+	       (file-name-as-directory (expand-file-name pub-dir)))
+	(copy-file filename pub-dir t))))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Publishing files, sets of files, and indices
 ;;; Publishing files, sets of files, and indices

+ 4 - 1
lisp/org-src.el

@@ -276,7 +276,10 @@ buffer."
 	(unless preserve-indentation
 	(unless preserve-indentation
 	  (setq total-nindent (or (org-do-remove-indentation) 0)))
 	  (setq total-nindent (or (org-do-remove-indentation) 0)))
 	(let ((org-inhibit-startup t))
 	(let ((org-inhibit-startup t))
-	  (funcall lang-f))
+	  (condition-case e
+	      (funcall lang-f)
+	    (error
+	     (error "Language mode `%s' fails with: %S" lang-f (nth 1 e)))))
 	(set (make-local-variable 'org-edit-src-force-single-line) single)
 	(set (make-local-variable 'org-edit-src-force-single-line) single)
 	(set (make-local-variable 'org-edit-src-from-org-mode) org-mode-p)
 	(set (make-local-variable 'org-edit-src-from-org-mode) org-mode-p)
 	(set (make-local-variable 'org-edit-src-allow-write-back-p) allow-write-back-p)
 	(set (make-local-variable 'org-edit-src-allow-write-back-p) allow-write-back-p)

+ 19 - 6
lisp/org.el

@@ -6238,8 +6238,8 @@ Optional argument N means put the headline into the Nth line of the window."
 
 
 (defun org-outline-overlay-data (&optional use-markers)
 (defun org-outline-overlay-data (&optional use-markers)
   "Return a list of the locations of all outline overlays.
   "Return a list of the locations of all outline overlays.
-The are overlays with the `invisible' property value `outline'.
-The return values is a list of cons cells, with start and stop
+These are overlays with the `invisible' property value `outline'.
+The return value is a list of cons cells, with start and stop
 positions for each overlay.
 positions for each overlay.
 If USE-MARKERS is set, return the positions as markers."
 If USE-MARKERS is set, return the positions as markers."
   (let (beg end)
   (let (beg end)
@@ -14604,9 +14604,10 @@ user function argument order change dependent on argument order."
 	(list arg2 arg1 arg3))
 	(list arg2 arg1 arg3))
        ((eq calendar-date-style 'iso)
        ((eq calendar-date-style 'iso)
 	(list arg2 arg3 arg1)))
 	(list arg2 arg3 arg1)))
-    (if (org-bound-and-true-p european-calendar-style)
-	(list arg2 arg1 arg3)
-      (list arg1 arg2 arg3))))
+    (with-no-warnings ;; european-calendar-style is obsolete as of version 23.1
+      (if (org-bound-and-true-p european-calendar-style)
+	  (list arg2 arg1 arg3)
+	(list arg1 arg2 arg3)))))
 
 
 (defun org-eval-in-calendar (form &optional keepdate)
 (defun org-eval-in-calendar (form &optional keepdate)
   "Eval FORM in the calendar window and return to current window.
   "Eval FORM in the calendar window and return to current window.
@@ -18267,7 +18268,7 @@ really on, so that the block visually is on the match."
 	nil))))
 	nil))))
 
 
 (defun org-in-regexps-block-p (start-re end-re &optional bound)
 (defun org-in-regexps-block-p (start-re end-re &optional bound)
-  "Returns t if the current point is between matches of START-RE and END-RE.
+  "Return t if the current point is between matches of START-RE and END-RE.
 This will also return t if point is on one of the two matches or
 This will also return t if point is on one of the two matches or
 in an unfinished block. END-RE can be a string or a form
 in an unfinished block. END-RE can be a string or a form
 returning a string.
 returning a string.
@@ -19199,6 +19200,18 @@ move point."
     (while (org-goto-sibling 'previous)
     (while (org-goto-sibling 'previous)
       (org-flag-heading nil))))
       (org-flag-heading nil))))
 
 
+(defun org-goto-first-child ()
+  "Goto the first child, even if it is invisible.
+Return t when a child was found. Otherwise don't move point and
+return nil."
+  (let (level (pos (point)) (re (concat "^" outline-regexp)))
+    (when (condition-case nil (org-back-to-heading t) (error nil))
+      (setq level (outline-level))
+      (forward-char 1)
+      (if (and (re-search-forward re nil t) (> (outline-level) level))
+	  (progn (goto-char (match-beginning 0)) t)
+	(goto-char pos) nil))))
+
 (defun org-show-hidden-entry ()
 (defun org-show-hidden-entry ()
   "Show an entry where even the heading is hidden."
   "Show an entry where even the heading is hidden."
   (save-excursion
   (save-excursion