Browse Source

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

Eric Schulte 15 years ago
parent
commit
f7169697eb
8 changed files with 154 additions and 67 deletions
  1. 33 24
      doc/org.texi
  2. 2 4
      lisp/ob.el
  3. 1 0
      lisp/org-exp.el
  4. 19 1
      lisp/org-inlinetask.el
  5. 4 1
      lisp/org-latex.el
  6. 37 17
      lisp/org-mobile.el
  7. 24 3
      lisp/org-publish.el
  8. 34 17
      lisp/org.el

+ 33 - 24
doc/org.texi

@@ -3794,7 +3794,10 @@ The habit is a TODO, with a TODO keyword representing an open state.
 @item
 @item
 The property @code{STYLE} is set to the value @code{habit}.
 The property @code{STYLE} is set to the value @code{habit}.
 @item
 @item
-The TODO has a scheduled date, with a @code{.+} style repeat interval.
+The TODO has a scheduled date, usually with a @code{.+} style repeat
+interval.  A @code{++} style may be appropriate for habits with time
+constraints, e.g., must be done on weekends, or a @code{+} style for an
+unusual habit that can have a backlog, e.g., weekly reports.
 @item
 @item
 The TODO may also have minimum and maximum ranges specified by using the
 The TODO may also have minimum and maximum ranges specified by using the
 syntax @samp{.+2d/3d}, which says that you want to do the task at least every
 syntax @samp{.+2d/3d}, which says that you want to do the task at least every
@@ -10554,7 +10557,8 @@ variable, called @code{org-publish-project-alist}.  Each element of the list
 configures one project, and may be in one of the two following forms:
 configures one project, and may be in one of the two following forms:
 
 
 @lisp
 @lisp
-   ("project-name" :property value :property value ...)
+   ("project-name" :property value :property value ...) 
+     @r{i.e. a well-formed property list with alternating keys and values}
 @r{or}
 @r{or}
    ("project-name" :components ("project-name" "project-name" ...))
    ("project-name" :components ("project-name" "project-name" ...))
 
 
@@ -10630,20 +10634,20 @@ possibly transformed in the process.  The default transformation is to export
 Org files as HTML files, and this is done by the function
 Org files as HTML files, and this is done by the function
 @code{org-publish-org-to-html} which calls the HTML exporter (@pxref{HTML
 @code{org-publish-org-to-html} which calls the HTML exporter (@pxref{HTML
 export}).  But you also can publish your content as PDF files using
 export}).  But you also can publish your content as PDF files using
-@code{org-publish-org-to-pdf}.  If you want to publish the Org file itself,
-but with @i{archived}, @i{commented}, and @i{tag-excluded} trees removed, use
-@code{org-publish-org-to-org} and set the parameters @code{:plain-source}
-and/or @code{:htmlized-source}.  This will produce @file{file.org} and
-@file{file.org.html} in the publishing
+@code{org-publish-org-to-pdf}, or as @code{ascii}, @code{latin1} or
+@code{utf8} encoded files using the corresponding functions.  If you want to
+publish the Org file itself, but with @i{archived}, @i{commented}, and
+@i{tag-excluded} trees removed, use @code{org-publish-org-to-org} and set the
+parameters @code{:plain-source} and/or @code{:htmlized-source}.  This will
+produce @file{file.org} and @file{file.org.html} in the publishing
 directory@footnote{@file{file-source.org} and @file{file-source.org.html} if
 directory@footnote{@file{file-source.org} and @file{file-source.org.html} if
 source and publishing directories are equal.  Note that with this kind of
 source and publishing directories are equal.  Note that with this kind of
 setup, you need to add @code{:exclude "-source\\.org"} to the project
 setup, you need to add @code{:exclude "-source\\.org"} to the project
 definition in @code{org-publish-project-alist} to avoid that the published
 definition in @code{org-publish-project-alist} to avoid that the published
 source files will be considered as new org files the next time the project is
 source files will be considered as new org files the next time the project is
-published.}.  Other files like images only
-need to be copied to the publishing destination, for this you may use
-@code{org-publish-attachment}.  For non-Org files, you always need to
-specify the publishing function:
+published.}.  Other files like images only need to be copied to the
+publishing destination, for this you may use @code{org-publish-attachment}.
+For non-Org files, you always need to specify the publishing function:
 
 
 @multitable @columnfractions 0.3 0.7
 @multitable @columnfractions 0.3 0.7
 @item @code{:publishing-function}
 @item @code{:publishing-function}
@@ -14265,14 +14269,19 @@ in-buffer settings, but it will understand the logistics of TODO state
 @node Setting up the staging area, Pushing to MobileOrg, MobileOrg, MobileOrg
 @node Setting up the staging area, Pushing to MobileOrg, MobileOrg, MobileOrg
 @section Setting up the staging area
 @section Setting up the staging area
 
 
-MobileOrg needs to interact with Emacs through directory on a
-server@footnote{If you are using a public server, you might prefer to encrypt
-the files on the server.  This can be done with Org-mode 7.02 and with
-MobileOrg 1.5.  On the Emacs side, configure the variable
-@code{org-mobile-use-encryption}.  If you can safely store the password in
-your Emacs setup, you might also want to configure
+MobileOrg needs to interact with Emacs through directory on a server.  If you
+are using a public server, you should consider to encrypt the files that are
+uploaded to the server.  This can be done with Org-mode 7.02 and with
+@i{MobileOrg 1.5} (iPhone version), and you need an @file{openssl}
+installation on your system.  To turn on encryption, set a password in
+@i{MobileOrg} and, on the Emacs side, configure the variable
+@code{org-mobile-use-encryption}@footnote{If you can safely store the
+password in your Emacs setup, you might also want to configure
 @code{org-mobile-encryption-password}.  Please read the docstring of that
 @code{org-mobile-encryption-password}.  Please read the docstring of that
-variable.}.  The easiest way to create that directory is to use a free
+variable.  Note that encryption will apply only to the contents of the
+@file{.org} files.  The file names themselves will remain visible.}.
+
+The easiest way to create that directory is to use a free
 @uref{http://dropbox.com,Dropbox.com} account@footnote{If you cannot use
 @uref{http://dropbox.com,Dropbox.com} account@footnote{If you cannot use
 Dropbox, or if your version of MobileOrg does not support it, you can use a
 Dropbox, or if your version of MobileOrg does not support it, you can use a
 webdav server.  For more information, check out the the documentation of
 webdav server.  For more information, check out the the documentation of
@@ -14357,12 +14366,12 @@ this flagged entry is finished.
 
 
 @kindex C-c a ?
 @kindex C-c a ?
 If you are not able to process all flagged entries directly, you can always
 If you are not able to process all flagged entries directly, you can always
-return to this agenda view using @kbd{C-c a ?}.  Note, however, that there is
-a subtle difference.  The view created automatically by @kbd{M-x
-org-mobile-pull @key{RET}} is guaranteed to search all files that have been
-addressed by the last pull.  This might include a file that is not currently
-in your list of agenda files.  If you later use @kbd{C-c a ?} to regenerate
-the view, only the current agenda files will be searched.
+return to this agenda view@footnote{Note, however, that there is a subtle
+difference.  The view created automatically by @kbd{M-x org-mobile-pull
+@key{RET}} is guaranteed to search all files that have been addressed by the
+last pull.  This might include a file that is not currently in your list of
+agenda files.  If you later use @kbd{C-c a ?} to regenerate the view, only
+the current agenda files will be searched.} using @kbd{C-c a ?}.
 
 
 @node History and Acknowledgments, Main Index, MobileOrg, Top
 @node History and Acknowledgments, Main Index, MobileOrg, Top
 @appendix History and acknowledgments
 @appendix History and acknowledgments

+ 2 - 4
lisp/ob.el

@@ -781,7 +781,7 @@ may be specified in the properties of the current outline entry."
 				  (org-entry-get (point) header-arg t)
 				  (org-entry-get (point) header-arg t)
 				(error nil))
 				(error nil))
 			      (cdr (assoc header-arg org-file-properties))))
 			      (cdr (assoc header-arg org-file-properties))))
-		    (cons (intern (concat ":" header-arg)) val)))
+		    (cons (intern (concat ":" header-arg)) (org-babel-read val))))
 	     (mapcar
 	     (mapcar
 	      'symbol-name
 	      'symbol-name
 	      (append
 	      (append
@@ -858,9 +858,7 @@ may be specified at the top of the current buffer."
                     "\\([^ \f\t\n\r\v]+\\)[ \f\t\n\r\v]+\\([^ \f\t\n\r\v]+.*\\)"
                     "\\([^ \f\t\n\r\v]+\\)[ \f\t\n\r\v]+\\([^ \f\t\n\r\v]+.*\\)"
                     arg)
                     arg)
 		   (cons (intern (concat ":" (match-string 1 arg)))
 		   (cons (intern (concat ":" (match-string 1 arg)))
-                         (let ((raw (org-babel-chomp (match-string 2 arg))))
-                           (if (org-babel-number-p raw)
-                               raw (org-babel-read raw))))
+                         (org-babel-read (org-babel-chomp (match-string 2 arg))))
 		 (cons (intern (concat ":" arg)) nil)))
 		 (cons (intern (concat ":" arg)) nil)))
 	     (split-string (concat " " arg-string) "[ \f\t\n\r\v]+:" t)))))
 	     (split-string (concat " " arg-string) "[ \f\t\n\r\v]+:" t)))))
 
 

+ 1 - 0
lisp/org-exp.el

@@ -2211,6 +2211,7 @@ in the list) and remove property and value from the list in LISTVAR."
 (defvar org-export-latex-listings-w-names) ;; defined in org-latex.el
 (defvar org-export-latex-listings-w-names) ;; defined in org-latex.el
 (defvar org-export-latex-minted) ;; defined in org-latex.el
 (defvar org-export-latex-minted) ;; defined in org-latex.el
 (defvar org-export-latex-minted-langs) ;; defined in org-latex.el
 (defvar org-export-latex-minted-langs) ;; defined in org-latex.el
+(defvar org-export-latex-minted-with-line-numbers) ;; defined in org-latex.el
 
 
 (defun org-export-format-source-code-or-example
 (defun org-export-format-source-code-or-example
   (backend lang code &optional opts indent caption)
   (backend lang code &optional opts indent caption)

+ 19 - 1
lisp/org-inlinetask.el

@@ -90,7 +90,9 @@ or to a number smaller than this one.  In fact, when `org-cycle-max-level' is
 not set, it will be assumed to be one less than the value of smaller than
 not set, it will be assumed to be one less than the value of smaller than
 the value of this variable."
 the value of this variable."
   :group 'org-inlinetask
   :group 'org-inlinetask
-  :type 'boolean)
+  :type '(choice
+	  (const :tag "Off" nil)
+	  (integer)))
 
 
 (defcustom org-inlinetask-export t
 (defcustom org-inlinetask-export t
   "Non-nil means export inline tasks.
   "Non-nil means export inline tasks.
@@ -129,6 +131,22 @@ If prefix arg NO-STATE is set, ignore `org-inlinetask-defaut-state'."
   (end-of-line -1))
   (end-of-line -1))
 (define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task)
 (define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task)
 
 
+(defun org-inlinetask-in-task-p ()
+  "Return true if point is inside an inline task."
+  (save-excursion
+    (let* ((nstars (if org-odd-levels-only
+		       (1- (* 2 (or org-inlinetask-min-level 200)))
+		     (or org-inlinetask-min-level 200)))
+	   (stars-re (concat "^\\(?:\\*\\{"
+			     (format "%d" (- nstars 1))
+			     ",\\}\\)[ \t]+"))
+	   (task-beg-re (concat stars-re "\\(?:.*\\)"))
+	   (task-end-re (concat stars-re "\\(?:END\\|end\\)")))
+      (beginning-of-line)
+      (or (looking-at task-beg-re)
+	  (and (re-search-forward "^\\*+[ \t]+" nil t)
+	       (progn (beginning-of-line) (looking-at task-end-re)))))))
+
 (defvar htmlp)  ; dynamically scoped into the next function
 (defvar htmlp)  ; dynamically scoped into the next function
 (defvar latexp) ; dynamically scoped into the next function
 (defvar latexp) ; dynamically scoped into the next function
 (defun org-inlinetask-export-handler ()
 (defun org-inlinetask-export-handler ()

+ 4 - 1
lisp/org-latex.el

@@ -421,7 +421,8 @@ for example using customize, or with something like
   (require 'org-latex)
   (require 'org-latex)
   (add-to-list 'org-export-latex-packages-alist '(\"\" \"minted\"))
   (add-to-list 'org-export-latex-packages-alist '(\"\" \"minted\"))
 
 
-In addition, it is neccessary to configure
+In addition, it is neccessary to install
+pygments (http://pygments.org), and configure
 `org-latex-to-pdf-process' so that the -shell-escape option is
 `org-latex-to-pdf-process' so that the -shell-escape option is
 passed to pdflatex."
 passed to pdflatex."
   :group 'org-export-latex
   :group 'org-export-latex
@@ -546,6 +547,8 @@ This function should accept the file name as its single argument."
 		   "pdflatex -interaction nonstopmode -output-directory %o %f"))
 		   "pdflatex -interaction nonstopmode -output-directory %o %f"))
 	  (const :tag "texi2dvi"
 	  (const :tag "texi2dvi"
 		 '("texi2dvi -p -b -c -V %f"))
 		 '("texi2dvi -p -b -c -V %f"))
+	  (const :tag "rubber"
+		 '("rubber -d --into %o %f"))
 	  (function)))
 	  (function)))
 
 
 (defcustom org-export-pdf-logfiles
 (defcustom org-export-pdf-logfiles

+ 37 - 17
lisp/org-mobile.el

@@ -26,10 +26,11 @@
 ;;; Commentary:
 ;;; Commentary:
 ;;
 ;;
 ;; This file contains the code to interact with Richard Moreland's iPhone
 ;; This file contains the code to interact with Richard Moreland's iPhone
-;; application MobileOrg.  This code is documented in Appendix B of the
-;; Org-mode manual.  The code is not specific for the iPhone, however.
-;; Any external viewer/flagging/editing application that uses the same
-;; conventions could be used.
+;; application MobileOrg, as well as with the Android version by Matthew Jones.
+;; This code is documented in Appendix B of the Org-mode manual.  The code is
+;; not specific for the iPhone and Android - any external
+;; viewer/flagging/editing application that uses the same conventions could
+;; be used.
 
 
 (require 'org)
 (require 'org)
 (require 'org-agenda)
 (require 'org-agenda)
@@ -348,6 +349,7 @@ agenda view showing the flagged items."
 
 
 (defun org-mobile-check-setup ()
 (defun org-mobile-check-setup ()
   "Check if org-mobile-directory has been set up."
   "Check if org-mobile-directory has been set up."
+  (org-mobile-cleanup-encryption-tempfile)
   (unless (and org-directory
   (unless (and org-directory
 	       (stringp org-directory)
 	       (stringp org-directory)
 	       (string-match "\\S-" org-directory)
 	       (string-match "\\S-" org-directory)
@@ -388,6 +390,8 @@ agenda view showing the flagged items."
 			   (lambda (a b) (string< (cdr a) (cdr b)))))
 			   (lambda (a b) (string< (cdr a) (cdr b)))))
 	(def-todo (default-value 'org-todo-keywords))
 	(def-todo (default-value 'org-todo-keywords))
 	(def-tags (default-value 'org-tag-alist))
 	(def-tags (default-value 'org-tag-alist))
+	(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)
 	file link-name todo-kwds done-kwds tags drawers entry kwds dwds twds)
 
 
     (org-prepare-agenda-buffers (mapcar 'car files-alist))
     (org-prepare-agenda-buffers (mapcar 'car files-alist))
@@ -406,7 +410,9 @@ agenda view showing the flagged items."
 			       (t nil)))
 			       (t nil)))
 		       org-tag-alist-for-agenda))))
 		       org-tag-alist-for-agenda))))
     (with-temp-file
     (with-temp-file
-	(expand-file-name org-mobile-index-file org-mobile-directory)
+	(if org-mobile-use-encryption
+	    org-mobile-encryption-tempfile
+	  target-file)
       (while (setq entry (pop def-todo))
       (while (setq entry (pop def-todo))
 	(insert "#+READONLY\n")
 	(insert "#+READONLY\n")
 	(setq kwds (mapcar (lambda (x) (if (string-match "(" x)
 	(setq kwds (mapcar (lambda (x) (if (string-match "(" x)
@@ -447,7 +453,11 @@ agenda view showing the flagged items."
 	(insert (format "* [[file:%s][%s]]\n"
 	(insert (format "* [[file:%s][%s]]\n"
 			link-name link-name)))
 			link-name link-name)))
       (push (cons org-mobile-index-file (md5 (buffer-string)))
       (push (cons org-mobile-index-file (md5 (buffer-string)))
-	    org-mobile-checksum-files))))
+	    org-mobile-checksum-files))
+    (when org-mobile-use-encryption
+      (org-mobile-encrypt-and-move org-mobile-encryption-tempfile
+				   target-file)
+      (org-mobile-cleanup-encryption-tempfile))))
 
 
 (defun org-mobile-copy-agenda-files ()
 (defun org-mobile-copy-agenda-files ()
   "Copy all agenda files to the stage or WebDAV directory."
   "Copy all agenda files to the stage or WebDAV directory."
@@ -469,17 +479,20 @@ agenda view showing the flagged items."
 	(when (string-match "[a-fA-F0-9]\\{30,40\\}" check)
 	(when (string-match "[a-fA-F0-9]\\{30,40\\}" check)
 	  (push (cons link-name (match-string 0 check))
 	  (push (cons link-name (match-string 0 check))
 		org-mobile-checksum-files))))
 		org-mobile-checksum-files))))
+
     (setq file (expand-file-name org-mobile-capture-file
     (setq file (expand-file-name org-mobile-capture-file
 				 org-mobile-directory))
 				 org-mobile-directory))
     (save-excursion
     (save-excursion
       (setq buf (find-file file))
       (setq buf (find-file file))
-      (and (= (point-min) (point-max)) (insert "\n"))
-      (save-buffer)
+      (when (and (= (point-min) (point-max))) 
+	(insert "\n")
+	(save-buffer)
+	(when org-mobile-use-encryption
+	  (write-file org-mobile-encryption-tempfile)
+	  (org-mobile-encrypt-and-move org-mobile-encryption-tempfile file)))
       (push (cons org-mobile-capture-file (md5 (buffer-string)))
       (push (cons org-mobile-capture-file (md5 (buffer-string)))
-	    org-mobile-checksum-files)
-      (when org-mobile-use-encryption
-	(write-file org-mobile-encryption-tempfile)
-	(org-mobile-encrypt-and-move org-mobile-encryption-tempfile file)))
+	    org-mobile-checksum-files))
+    (org-mobile-cleanup-encryption-tempfile)
     (kill-buffer buf)))
     (kill-buffer buf)))
 
 
 (defun org-mobile-write-checksums ()
 (defun org-mobile-write-checksums ()
@@ -668,8 +681,9 @@ The table of checksums is written to the file mobile-checksums."
     (when sumo
     (when sumo
       (org-store-agenda-views))
       (org-store-agenda-views))
     (when org-mobile-use-encryption
     (when org-mobile-use-encryption
-      (org-mobile-encrypt-file file1 file)
-      (delete-file file1))))
+      (org-mobile-encrypt-and-move file1 file)
+      (delete-file file1)
+      (org-mobile-cleanup-encryption-tempfile))))
 
 
 (defun org-mobile-encrypt-and-move (infile outfile)
 (defun org-mobile-encrypt-and-move (infile outfile)
   "Encrypt INFILE locally to INFILE_enc, then move it to OUTFILE.
   "Encrypt INFILE locally to INFILE_enc, then move it to OUTFILE.
@@ -699,6 +713,12 @@ encryption program does not understand them."
 	   (shell-quote-argument (expand-file-name infile))
 	   (shell-quote-argument (expand-file-name infile))
 	   (shell-quote-argument (expand-file-name outfile)))))
 	   (shell-quote-argument (expand-file-name outfile)))))
 
 
+(defun org-mobile-cleanup-encryption-tempfile ()
+  "Remove the encryption tempfile if it exists."
+  (and (stringp org-mobile-encryption-tempfile)
+       (file-exists-p org-mobile-encryption-tempfile)
+       (delete-file org-mobile-encryption-tempfile)))
+
 (defun org-mobile-move-capture ()
 (defun org-mobile-move-capture ()
   "Move the contents of the capture file to the inbox file.
   "Move the contents of the capture file to the inbox file.
 Return a marker to the location where the new content has been added.
 Return a marker to the location where the new content has been added.
@@ -711,8 +731,7 @@ If nothing new has been added, return nil."
 	 (capture-buffer
 	 (capture-buffer
 	  (if (not org-mobile-use-encryption)
 	  (if (not org-mobile-use-encryption)
 	      (find-file-noselect capture-file)
 	      (find-file-noselect capture-file)
-	    (if (file-exists-p org-mobile-encryption-tempfile)
-		(delete-file org-mobile-encryption-tempfile))
+	    (org-mobile-cleanup-encryption-tempfile)
 	    (setq encfile (concat org-mobile-encryption-tempfile "_enc"))
 	    (setq encfile (concat org-mobile-encryption-tempfile "_enc"))
 	    (copy-file capture-file encfile)
 	    (copy-file capture-file encfile)
 	    (org-mobile-decrypt-file encfile org-mobile-encryption-tempfile)
 	    (org-mobile-decrypt-file encfile org-mobile-encryption-tempfile)
@@ -737,7 +756,8 @@ If nothing new has been added, return nil."
     (kill-buffer capture-buffer)
     (kill-buffer capture-buffer)
     (when org-mobile-use-encryption
     (when org-mobile-use-encryption
       (org-mobile-encrypt-and-move org-mobile-encryption-tempfile
       (org-mobile-encrypt-and-move org-mobile-encryption-tempfile
-				   capture-file))
+				   capture-file)
+      (org-mobile-cleanup-encryption-tempfile))
     (if not-empty insertion-point)))
     (if not-empty insertion-point)))
 
 
 (defun org-mobile-update-checksum-for-capture-file (buffer-string)
 (defun org-mobile-update-checksum-for-capture-file (buffer-string)

+ 24 - 3
lisp/org-publish.el

@@ -71,11 +71,14 @@ Each element of the alist is a publishing 'project.'  The CAR of
 each element is a string, uniquely identifying the project.  The
 each element is a string, uniquely identifying the project.  The
 CDR of each element is in one of the following forms:
 CDR of each element is in one of the following forms:
 
 
-  (:property value :property value ... )
+1. A well-formed property list with an even number of elements, alternating
+   keys and values, specifying parameters for the publishing process.
 
 
-OR,
+     (:property value :property value ... )
 
 
-  (:components (\"project-1\" \"project-2\" ...))
+2. A meta-project definition, specifying of a list of sub-projects:
+
+     (:components (\"project-1\" \"project-2\" ...))
 
 
 When the CDR of an element of org-publish-project-alist is in
 When the CDR of an element of org-publish-project-alist is in
 this second form, the elements of the list after :components are
 this second form, the elements of the list after :components are
@@ -574,6 +577,24 @@ See `org-publish-org-to' to the list of arguments."
 See `org-publish-org-to' to the list of arguments."
 See `org-publish-org-to' to the list of arguments."
   (org-publish-org-to "org" plist filename pub-dir))
   (org-publish-org-to "org" plist filename pub-dir))
 
 
+(defun org-publish-org-to-ascii (plist filename pub-dir)
+  "Publish an org file to ASCII.
+See `org-publish-org-to' to the list of arguments."
+  (org-publish-with-aux-preprocess-maybe
+    (org-publish-org-to "ascii" plist filename pub-dir)))
+
+(defun org-publish-org-to-latin1 (plist filename pub-dir)
+  "Publish an org file to Latin-1.
+See `org-publish-org-to' to the list of arguments."
+  (org-publish-with-aux-preprocess-maybe
+    (org-publish-org-to "latin1" plist filename pub-dir)))
+
+(defun org-publish-org-to-utf8 (plist filename pub-dir)
+  "Publish an org file to UTF-8.
+See `org-publish-org-to' to the list of arguments."
+  (org-publish-with-aux-preprocess-maybe
+    (org-publish-org-to "utf8" plist filename pub-dir)))
+
 (defun org-publish-attachment (plist filename pub-dir)
 (defun org-publish-attachment (plist filename pub-dir)
   "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."

+ 34 - 17
lisp/org.el

@@ -1274,7 +1274,7 @@ type.  In principle, it does not hurt to turn on most link types - there may
 be a small gain when turning off unused link types.  The types are:
 be a small gain when turning off unused link types.  The types are:
 
 
 bracket   The recommended [[link][description]] or [[link]] links with hiding.
 bracket   The recommended [[link][description]] or [[link]] links with hiding.
-angular   Links in angular brackets that may contain whitespace like
+angle     Links in angular brackets that may contain whitespace like
           <bbdb:Carsten Dominik>.
           <bbdb:Carsten Dominik>.
 plain     Plain links in normal text, no whitespace, like http://google.com.
 plain     Plain links in normal text, no whitespace, like http://google.com.
 radio     Text that is matched by a radio target, see manual for details.
 radio     Text that is matched by a radio target, see manual for details.
@@ -1285,8 +1285,8 @@ footnote  Footnote labels.
 Changing this variable requires a restart of Emacs to become effective."
 Changing this variable requires a restart of Emacs to become effective."
   :group 'org-link
   :group 'org-link
   :type '(set :greedy t
   :type '(set :greedy t
-	      (const :tag "Double bracket links (new style)" bracket)
-	      (const :tag "Angular bracket links (old style)" angular)
+	      (const :tag "Double bracket links" bracket)
+	      (const :tag "Angular bracket links" angle)
 	      (const :tag "Plain text links" plain)
 	      (const :tag "Plain text links" plain)
 	      (const :tag "Radio target matches" radio)
 	      (const :tag "Radio target matches" radio)
 	      (const :tag "Tags" tag)
 	      (const :tag "Tags" tag)
@@ -3538,6 +3538,7 @@ Normal means no org-mode-specific context."
 (declare-function org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
 (declare-function org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
 		  "org-agenda" (&optional end))
 		  "org-agenda" (&optional end))
 (declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
 (declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
+(declare-function org-inlinetask-in-task-p "org-inlinetask" ())
 (declare-function org-indent-mode "org-indent" (&optional arg))
 (declare-function org-indent-mode "org-indent" (&optional arg))
 (declare-function parse-time-string "parse-time" (string))
 (declare-function parse-time-string "parse-time" (string))
 (declare-function org-attach-reveal "org-attach" (&optional if-exists))
 (declare-function org-attach-reveal "org-attach" (&optional if-exists))
@@ -3729,7 +3730,6 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables."
 
 
 ;; Autoload org-clock.el
 ;; Autoload org-clock.el
 
 
-
 (declare-function org-clock-save-markers-for-cut-and-paste "org-clock"
 (declare-function org-clock-save-markers-for-cut-and-paste "org-clock"
 		  (beg end))
 		  (beg end))
 (declare-function org-clock-update-mode-line "org-clock" ())
 (declare-function org-clock-update-mode-line "org-clock" ())
@@ -6687,18 +6687,30 @@ When INVISIBLE-OK is set, stop at invisible headlines when going back.
 This is important for non-interactive uses of the command."
 This is important for non-interactive uses of the command."
   (interactive "P")
   (interactive "P")
   (if (or (= (buffer-size) 0)
   (if (or (= (buffer-size) 0)
-	  (and (not (save-excursion (and (ignore-errors (org-back-to-heading invisible-ok))
-					 (org-on-heading-p))))
+	  (and (not (save-excursion
+		      (and (ignore-errors (org-back-to-heading invisible-ok))
+			   (org-on-heading-p))))
 	       (not (org-in-item-p))))
 	       (not (org-in-item-p))))
       (progn
       (progn
 	(insert "\n* ")
 	(insert "\n* ")
 	(run-hooks 'org-insert-heading-hook))
 	(run-hooks 'org-insert-heading-hook))
     (when (or force-heading (not (org-insert-item)))
     (when (or force-heading (not (org-insert-item)))
       (let* ((empty-line-p nil)
       (let* ((empty-line-p nil)
+	     (level nil)
 	     (head (save-excursion
 	     (head (save-excursion
 		     (condition-case nil
 		     (condition-case nil
 			 (progn
 			 (progn
 			   (org-back-to-heading invisible-ok)
 			   (org-back-to-heading invisible-ok)
+			   (when (and (featurep 'org-inlinetask)
+				      (integerp org-inlinetask-min-level)
+				      (>= (length (match-string 0))
+					  org-inlinetask-min-level))
+			     ;; Find a heading level before the inline task
+			     (while (and (setq level (org-up-heading-safe))
+					 (>= level org-inlinetask-min-level)))
+			     (if (org-on-heading-p)
+				 (org-back-to-heading invisible-ok)
+			       (error "This should not happen")))
 			   (setq empty-line-p (org-previous-line-empty-p))
 			   (setq empty-line-p (org-previous-line-empty-p))
 			   (match-string 0))
 			   (match-string 0))
 		       (error "*"))))
 		       (error "*"))))
@@ -6736,6 +6748,12 @@ This is important for non-interactive uses of the command."
 	    (cond
 	    (cond
 	     (org-insert-heading-respect-content
 	     (org-insert-heading-respect-content
 	      (org-end-of-subtree nil t)
 	      (org-end-of-subtree nil t)
+	      (when (featurep 'org-inlinetask)
+		(while (and (not (eobp))
+			    (looking-at "\\(\\*+\\)[ \t]+")
+			    (>= (length (match-string 1))
+				org-inlinetask-min-level))
+		  (org-end-of-subtree nil t)))
 	      (or (bolp) (newline))
 	      (or (bolp) (newline))
 	      (or (org-previous-line-empty-p)
 	      (or (org-previous-line-empty-p)
 		  (and blank (newline)))
 		  (and blank (newline)))
@@ -18601,6 +18619,8 @@ which make use of the date at the cursor."
 	 (itemp (org-at-item-p))
 	 (itemp (org-at-item-p))
 	 (case-fold-search t)
 	 (case-fold-search t)
 	 (org-drawer-regexp (or org-drawer-regexp "\000"))
 	 (org-drawer-regexp (or org-drawer-regexp "\000"))
+	 (inline-task-p (and (featurep 'org-inlinetask)
+			     (org-inlinetask-in-task-p)))
 	 column bpos bcol tpos tcol bullet btype bullet-type)
 	 column bpos bcol tpos tcol bullet btype bullet-type)
     ;; Find the previous relevant line
     ;; Find the previous relevant line
     (beginning-of-line 1)
     (beginning-of-line 1)
@@ -18656,7 +18676,14 @@ which make use of the date at the cursor."
      ;; what to do.
      ;; what to do.
      (t
      (t
       (beginning-of-line 0)
       (beginning-of-line 0)
-      (while (and (not (bobp)) (looking-at "[ \t]*[\n:#|]")
+      (while (and (not (bobp))
+		  ;; skip comments, verbatim, empty lines, tables,
+		  ;; inline tasks
+		  (or (looking-at "[ \t]*[\n:#|]")
+		      (and (org-in-item-p) (goto-char (org-list-top-point)))
+		      (and (not inline-task-p)
+			   (featurep 'org-inlinetask)
+			   (org-inlinetask-in-task-p)))
       		  (not (looking-at "[ \t]*:END:"))
       		  (not (looking-at "[ \t]*:END:"))
       		  (not (looking-at org-drawer-regexp)))
       		  (not (looking-at org-drawer-regexp)))
       	(beginning-of-line 0))
       	(beginning-of-line 0))
@@ -18675,16 +18702,6 @@ which make use of the date at the cursor."
        ((looking-at "\\([ \t]*\\):END:")
        ((looking-at "\\([ \t]*\\):END:")
 	(goto-char (match-end 1))
 	(goto-char (match-end 1))
 	(setq column (current-column)))
 	(setq column (current-column)))
-       ;; There was a list that since ended: indent relatively to
-       ;; current heading.
-       ((org-in-item-p)
-	(outline-previous-heading)
-	(if (and org-adapt-indentation
-		 (looking-at "\\*+[ \t]+"))
-	    (progn
-	      (goto-char (match-end 0))
-	      (setq column (current-column)))
-	  (setq column 0)))
        ;; Else, nothing noticeable found: get indentation and go on.
        ;; Else, nothing noticeable found: get indentation and go on.
        (t (setq column (org-get-indentation))))))
        (t (setq column (org-get-indentation))))))
     (goto-char pos)
     (goto-char pos)