diff --git a/ChangeLog b/ChangeLog index f10bb0297..a39786742 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-04-03 Carsten Dominik + + * lisp/org-exp.el (org-export-html-handle-js-options): New function. + (org-export-html-infojs-setup): New option. + (org-export-as-html): Call `org-export-html-handle-js-options'. + + * lisp/org.el (org-auto-repeat-maybe): Make sure that a note can + be enforces if `org-log-repeat' is `note'. 2008-04-01 Carsten Dominik diff --git a/lisp/org-exp.el b/lisp/org-exp.el index c7c988cc5..38f34bdff 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -405,7 +405,7 @@ Org-mode file." :group 'org-export) (defcustom org-export-html-coding-system nil - "" + "FIXME" :group 'org-export-html :type 'coding-system) @@ -463,6 +463,17 @@ you can \"misuse\" it to add arbitrary text to the header." :group 'org-export-html :type 'string) +(defcustom org-export-html-infojs-setup + " +" + "The template for the export style additions when org-info.js is used. +Option settings will replace the %MANAGER-OPTIONS cookie." + :group 'org-export-html + :type 'string) (defcustom org-export-html-title-format "

%s

\n" "Format for typesetting the document title in HTML export." @@ -652,8 +663,9 @@ The text will be inserted into the DESCRIPTION field." (widen) (goto-char 0) (let ((re (org-make-options-regexp - '("TITLE" "AUTHOR" "DATE" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE"))) - p key val text options) + '("TITLE" "AUTHOR" "DATE" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE" + "INFOJS_UP" "INFOJS_HOME" "INFOJS_OPT"))) + p key val text options js-up js-main js-css js-opt) (while (re-search-forward re nil t) (setq key (org-match-string-no-properties 1) val (org-match-string-no-properties 2)) @@ -665,7 +677,13 @@ The text will be inserted into the DESCRIPTION field." ((string-equal key "LANGUAGE") (setq p (plist-put p :language val))) ((string-equal key "TEXT") (setq text (if text (concat text "\n" val) val))) - ((string-equal key "OPTIONS") (setq options val)))) + ((string-equal key "OPTIONS") (setq options val)) + ((string-equal key "INFOJS_UP") + (setq p (plist-put p :infojs-up val))) + ((string-equal key "INFOJS_HOME") + (setq p (plist-put p :infojs-home val))) + ((string-equal key "INFOJS_OPT") + (setq p (plist-put p :infojs-opt val))))) (setq p (plist-put p :text text)) (when options (let ((op '(("H" . :headline-levels) @@ -703,6 +721,52 @@ The text will be inserted into the DESCRIPTION field." val))) dir)) +(defun org-export-html-handle-js-options (exp-plist) + "Analyze JavaScript options in INFO-PLIST and modify EXP-PLIST accordingly. +Both P and PJ are property lists." + (let (p1 (s "") p v a1 tmp) + (setq p1 (plist-put p1 'TOC (if (not (plist-get exp-plist + :table-of-contents)) + "0" "1"))) + (when (setq v (plist-get exp-plist :infojs-opt)) + (when (string-match "\\ (length s) 0) + (and (string-match "%MANAGER-OPTIONS" org-export-html-infojs-setup) + (setq s (replace-match s t t org-export-html-infojs-setup)) + (setq exp-plist + (plist-put + exp-plist :style + (concat (or (plist-get exp-plist :style) "") "\n" s))))) + exp-plist)) + ;;;###autoload (defun org-export (&optional arg) "Export dispatcher for Org-mode." @@ -1999,9 +2063,11 @@ PUB-DIR is set, use this as the publishing directory." (setq-default org-deadline-line-regexp org-deadline-line-regexp) (setq-default org-done-keywords org-done-keywords) (setq-default org-maybe-keyword-time-regexp org-maybe-keyword-time-regexp) - (let* ((opt-plist (org-combine-plists (org-default-export-plist) - ext-plist - (org-infile-export-plist))) + (let* ((opt-plist + (org-export-html-handle-js-options + (org-combine-plists (org-default-export-plist) + ext-plist + (org-infile-export-plist)))) (style (plist-get opt-plist :style)) (html-extension (plist-get opt-plist :html-extension)) diff --git a/lisp/org.el b/lisp/org.el index a92df5b4b..e2c901f1a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8679,13 +8679,16 @@ This function is run automatically after each state change to a DONE state." (when repeat (if (eq org-log-repeat t) (setq org-log-repeat 'state)) (org-todo (if (eq interpret 'type) last-state head)) - (when (and org-log-repeat - (or (not (memq 'org-add-log-note - (default-value 'post-command-hook))) - (eq org-log-note-purpose 'done))) - ;; Make sure a note is taken; - (org-add-log-setup 'state (or done-word (car org-done-keywords)) - 'findpos org-log-repeat)) + (when org-log-repeat + (if (or (memq 'org-add-log-note (default-value 'post-command-hook)) + (memq 'org-add-log-note post-command-hook)) + ;; OK, we are already setup for some record + (if (eq org-log-repeat 'note) + ;; make sure we take a note, not only a time stamp + (setq org-log-note-how 'note)) + ;; Set up for taking a record + (org-add-log-setup 'state (or done-word (car org-done-keywords)) + 'findpos org-log-repeat))) (org-back-to-heading t) (org-add-planning-info nil nil 'closed) (setq re (concat "\\(" org-scheduled-time-regexp "\\)\\|\\(" @@ -13067,7 +13070,7 @@ the currently selected interval size." (when (looking-at "#\\+BEGIN: clocktable\\>.*?:block[ \t]+\\(\\S-+\\)") (let* ((b (match-beginning 1)) (e (match-end 1)) (s (match-string 1)) - block shift ins y mw d date) + block shift ins y mw d date wp m) (cond ((string-match "^\\(today\\|thisweek\\|thismonth\\|thisyear\\)\\([-+][0-9]+\\)?$" s) (setq block (match-string 1 s)