Commit ce4fdcb9 authored by Carsten Dominik's avatar Carsten Dominik
Browse files

2008-11-23 Carsten Dominik <carsten.dominik@gmail.com>

	* org-clock.el (org-dblock-write:clocktable): Make sure the
	clocktable sees the first line.
	(org-clock-in): Warn if the clock cannot be resumed.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-open-at-point): Fix mixup about interactive and
	non-interactive elisp links.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-export-preprocess-string): Allow one comment
	line before the first headline to always be included.  This is
	to not miss a commented target.

	* org-mouse.el (org-mouse-insert-item): Call
	`org-indent-to-column' instead of `indent-to', for XEmacs
	compatibility.

	* org.el (org-refile-targets): Fix customize definition so
	that it works also in XEmacs.
	(org-fixup-indentation): Call `org-indent-to-column' instead
	of `indent-to', for XEmacs compatibility.

2008-11-23  Tokuya Kameshima  <kames@fa2.so-net.ne.jp>

	* org-mew.el (org-mew-store-link): Get the correct case folder
	for refiled messages.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-export-as-ascii): Remove the "\\" forced
	line break indicators.

	* org.el (org-ido-completing-read): Remove the "i:" prefix for
	ido-completion propts.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-remember.el (org-remember-apply-template): Use
	`org-substring-no-properties'.

	* org-compat.el (org-substring-no-properties): New function.

	* org-remember.el (org-remember-apply-template): Use
	`org-substring-no-properties' for compatibility.

	* org-list.el (org-list-two-spaces-after-bullet-regexp): New
	option.
	(org-fix-bullet-type): respect
	`org-list-two-spaces-after-bullet-regexp'.

	* org-clock.el (org-clock-load): Clean up the code.

	* org.el (org-adaptive-fill-function): Allow two spaces after
	"1." as a list bullet.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-clock.el (org-clock-save, org-clock-load): Check for
	live buffers, existing files, and buffer file names to ensure
	consistent information.
	(org-clock-persist): Make `clock' a special value of this
	variable, and improve docstring.

	* org-list.el (org-cycle-list-bullet, org-fix-bullet-type)
	(org-get-string-indentation): Adapt indentation when the bullet
	width changes.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-remember.el (org-remember-finalize): Make interactive.
	(org-remember-kill): New command.
	(org-remember-finish-immediately): Call `org-remember-finalize'
	directly.
	(org-remember-finalize): Make `org-remember-finalize' an interactive
	function.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-remember.el (org-remember-apply-template): No ido completion
	for free prompts in remember templates.
	(org-remember-before-finalize-hook): New hook.
	(org-remember-mode): New minor mode.
	(org-remember-apply-template): Turn on `org-remember-mode'.

	* org-id.el (org-id-add-location): Avoid error when no file is
	given.

	* org-remember.el (org-remember-apply-template): Fix the way how
	the list of allowed properties is retrieved from the target file.

	* org.el (org-insert-link): Improve file link matching.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-colview.el (org-columns-display-here): New argument
	DATELINE, to trigger using the new face.
	(org-agenda-colview-summarize): Call `org-columns-display-here'
	with the new argument.

	* org-faces.el (org-agenda-column-dateline): New face.

	* org-publish.el (org-publish-org-index): Use index-title at page
	title, not as section.

	* org-exp.el (org-export-html-format-desc): Respect the
	org-protect property.
	(org-export-as-html): Protect image specifiers that are in the
	description part of a link.

	* org.el (org-sort-entries-or-items, org-completing-read)
	(org-refile-get-location, org-olpath-completing-read, org-todo)
	(org-show-todo-tree, org-sparse-tree, org-make-tags-matcher)
	(org-set-tags, org-change-tag-in-region, org-fast-tag-selection)
	(org-set-property, org-delete-property)
	(org-delete-property-globally): Use `org-ido-completing-read'.

	* org-remember.el (org-remember-apply-template): Use
	`org-ido-completing-read'.

	* org-publish.el (org-publish): Use `org-ido-completing-read'.

	* org-colview.el (org-columns-edit-value, org-columns-new)
	(org-insert-columns-dblock): Use `org-ido-completing-read'.

	* org-colview-xemacs.el (org-columns-edit-value)
	(org-columns-new, org-insert-columns-dblock): Use
	`org-ido-completing-read'.

	* org-attach.el (org-attach-delete-one, org-attach-open): Use
	`org-ido-completing-read'.

	* org-agenda.el (org-todo-list, org-agenda-filter-by-tag): Use
	`org-ido-completing-read'.

	* org.el (org-time-today): New function.
	(org-matcher-time): Use `org-time-today'.  Add special treatment
	for "<tomorrow>" and "<yesterday>".
	(org-ido-completing-read): New function.
	(org-completion-use-ido): New option.

	* org-exp.el (org-export-format-source-code): Fix bug in require
	htmlize code.
	(org-export-target-internal-links): Fix bug in search for text
	property.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-export-latex.el (org-export-latex-subcontent): Interprete
	target aliases as additonal labels.

	* org-exp.el (org-export-target-aliases): New variable.
	(org-export-preprocess-string)
	(org-export-handle-invisible-targets): Fill the alias alist.
	(org-export-as-html): Remove the &nbsp; from the anchor, and also
	assign an id.
	(org-html-level-start): Insert the target aliases as additonal
	anchors.

	* org.el (org-edit-fixed-width-region): Fix bug when starting a new
	picture area.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-open-at-mouse): Ensure correct link abbreviations
	when following a link with the mouse from the agenda.

	* org-exp.el (org-export-as-html): Avoid lone </div> when no
	headlines are created.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-link-translation-function): New option.
	(org-open-at-point): Call `org-link-translation-function' if
	non-nil.
	(org-translate-link): New function.
	(org-translate-link-from-planner): New function.
	(org-open-at-point): Allow interactive commands in elisp links.

	* org-exp.el (org-icalendar-cleanup-string): Restore the old
	iCalendar quoting.  The new one seems to caus problems with
	applications.

	* org.el (org-yank): Set `this-command' to `yank', so that
	`yank-pop' will work.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-icalendar-cleanup-string): Improve RFC2455
	compliance as far as quoting is concerned.

	* org.el (org-link-expand-abbrev): Implement %h as an escape for a
	hexified version of the tag.

	* org-vm.el (org-vm-follow-link): Require `vm-search'.

	* org.el (org-up-heading-safe, org-forward-same-level): Always
	call `org-back-to-heading' instead of `outline-back-to-heading'.
	(org-back-to-heading): New wrapper around outline-back-to-heading,
	with a useful error message telling where the error happened.

	* org-list.el (org-update-checkbox-count): Always call
	`org-back-to-heading' instead of `outline-back-to-heading'.

	* org-exp.el (org-export-as-html): Make sure that each <img> tag
	has an `alt' attribute, to ensure XHTML validation.

2008-11-23  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-publish.el (org-publish-attachment): Allow publishing to
	overwrite attachment files.

	* org-agenda.el (org-agenda-timerange-leaders): New option.
	(org-agenda-get-blocks): Use `org-agenda-timerange-leaders'.

	* org.el (org-edit-src-exit): Untabify ASCII image before
	returning.
parent 770f39cf
2008-11-23 Carsten Dominik <dominik@science.uva.nl>
* org.texi (Setting up Remember): Document `org-remember-mode'.
(External links): Document that bbdb links can use a regular
expression.
(External links): Document that elisp links can contain interactive
commands.
2008-11-22 Michael Kifer <kifer@cs.stonybrook.edu>
* viper.texi (viper-translate-all-ESC-keysequences):
......
......@@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.12a
;; Version: 6.13
;;
;; This file is part of GNU Emacs.
;;
......@@ -878,6 +878,20 @@ to occupy a fixed space in the agenda display."
:group 'org-agenda-line-format
:type 'string)
(defcustom org-agenda-timerange-leaders '("" "(%d/%d): ")
"Text preceding timerange entries in the agenda view.
This is a list with two strings. The first applies when the range
is entirely on one day. The second applies if the range spans several days.
The strings may have two \"%d\" format specifiers which will be filled
with the sequence number of the days, and the total number of days in the
range, respectively."
:group 'org-agenda-line-format
:type '(list
(string :tag "Deadline today ")
(choice :tag "Deadline relative"
(string :tag "Format string")
(function))))
(defcustom org-agenda-scheduled-leaders '("Scheduled: " "Sched.%2dx: ")
"Text preceeding scheduled items in the agenda view.
This is a list with two strings. The first applies when the item is
......@@ -2722,7 +2736,7 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
rtn rtnall files file pos)
(when (equal arg '(4))
(setq org-select-this-todo-keyword
(completing-read "Keyword (or KWD1|K2D2|...): "
(org-ido-completing-read "Keyword (or KWD1|K2D2|...): "
(mapcar 'list kwds) nil nil)))
(and (equal 0 arg) (setq org-select-this-todo-keyword nil))
(org-set-local 'org-last-arg arg)
......@@ -3384,7 +3398,7 @@ the documentation of `org-diary'."
(push txt ee))))
(nreverse ee)))
(defalias 'org-get-closed 'org-agenda-get-progress)
(defalias 'org-get-closed 'org-get-progress)
(defun org-agenda-get-progress ()
"Return the logged TODO entries for agenda display."
(let* ((props (list 'mouse-face 'highlight
......@@ -3398,7 +3412,7 @@ the documentation of `org-diary'."
(items (if (consp org-agenda-show-log)
org-agenda-show-log
org-agenda-log-mode-items))
(parts
(parts
(delq nil
(list
(if (memq 'closed items) (concat "\\<" org-closed-string))
......@@ -3677,8 +3691,10 @@ FRACTION is what fraction of the head-warning time has passed."
(org-entry-is-done-p)
(throw :skip t))
(setq txt (org-format-agenda-item
(format (if (= d1 d2) "" "(%d/%d): ")
(1+ (- d0 d1)) (1+ (- d2 d1)))
(format
(nth (if (= d1 d2) 0 1)
org-agenda-timerange-leaders)
(1+ (- d0 d1)) (1+ (- d2 d1)))
head category tags
(if (= d0 d1) timestr))))
(setq txt org-agenda-no-heading-message))
......@@ -4255,7 +4271,7 @@ to switch to narrowing."
(org-set-local 'org-global-tags-completion-table
(org-global-tags-completion-table)))
(let ((completion-ignore-case t))
(setq tag (completing-read
(setq tag (org-ido-completing-read
"Tag: " org-global-tags-completion-table))))
(cond
((equal char ?/) (org-agenda-filter-by-tag-show-all))
......
......@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.12a
;; Version: 6.13
;;
;; This file is part of GNU Emacs.
;;
......
......@@ -4,7 +4,7 @@
;; Author: John Wiegley <johnw@newartisans.com>
;; Keywords: org data task
;; Version: 6.12a
;; Version: 6.13
;; This file is part of GNU Emacs.
;;
......@@ -153,6 +153,9 @@ D Delete all of a task's attachments. A safer way is
"Return the directory associated with the current entry.
If the directory does not exist and CREATE-IF-NOT-EXISTS-P is non-nil,
the directory and the corresponding ID will be created."
(when (and (not (buffer-file-name (buffer-base-buffer)))
(not (file-name-absolute-p org-attach-directory)))
(error "Need absolute `org-attach-directory' to attach in buffers without filename."))
(let ((uuid (org-id-get (point) create-if-not-exists-p)))
(when (or uuid create-if-not-exists-p)
(unless uuid
......@@ -245,7 +248,7 @@ The attachment is created as an Emacs buffer."
(let* ((attach-dir (org-attach-dir t))
(files (org-attach-file-list attach-dir))
(file (or file
(completing-read
(org-ido-completing-read
"Delete attachment: "
(mapcar (lambda (f)
(list (file-name-nondirectory f)))
......@@ -320,7 +323,7 @@ If IN-EMACS is non-nil, force opening in Emacs."
(files (org-attach-file-list attach-dir))
(file (if (= (length files) 1)
(car files)
(completing-read "Open attachment: "
(org-ido-completing-read "Open attachment: "
(mapcar 'list files) nil t))))
(org-open-file (expand-file-name file attach-dir) in-emacs)))
......
......@@ -6,7 +6,7 @@
;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.12a
;; Version: 6.13
;;
;; This file is part of GNU Emacs.
;;
......
......@@ -5,7 +5,7 @@
;; Author: Bastien Guerry <bzg at altern dot org>
;; Carsten Dominik <carsten dot dominik at gmail dot com>
;; Keywords: org, wp, remember
;; Version: 6.12a
;; Version: 6.13
;;
;; This file is part of GNU Emacs.
;;
......
......@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.12a
;; Version: 6.13
;;
;; This file is part of GNU Emacs.
;;
......@@ -104,9 +104,19 @@ has not been closed, resume the clock from that point"
(defcustom org-clock-persist nil
"When non-nil, save the running clock when emacs is closed, and
resume it next time emacs is started."
resume it next time emacs is started.
When this is t, both the running clock, and the entire clock
history are saved. When this is the symbol `clock', only the
running clock is saved.
When Emacs restarts with saved clock information, the file containing the
running clock as well as all files mentioned in the clock history will
be visited."
:group 'org-clock
:type 'boolean)
:type '(choice
(const :tag "Just the running clock" clock)
(const :tag "Clock and history" t)
(const :tag "No persistence" nil)))
(defcustom org-clock-persist-file "~/.emacs.d/org-clock-save.el"
"File to save clock data to"
......@@ -246,7 +256,7 @@ of a different task.")
'help-echo (concat help-text ": " org-clock-heading))
(org-propertize clock-string 'help-echo help-text)))
'local-map org-clock-mode-map
'mouse-face '(face mode-line-highlight)))
'mouse-face (if (featurep 'xemacs) 'highlight 'mode-line-highlight)))
(force-mode-line-update)))
(defvar org-clock-mode-line-entry nil
......@@ -260,88 +270,102 @@ clock into. When SELECT is `C-u C-u', clock into the current task and mark
is as the default task, a special task that will always be offered in
the clocking selection, associated with the letter `d'."
(interactive "P")
(let ((interrupting (marker-buffer org-clock-marker))
ts selected-task target-pos)
(when (equal select '(4))
(setq selected-task (org-clock-select-task "Clock-in on task: "))
(if selected-task
(setq selected-task (copy-marker selected-task))
(error "Abort")))
(when interrupting
;; We are interrupting the clocking of a differnt task.
;; Save a marker to this task, so that we can go back.
(move-marker org-clock-interrupted-task
(marker-position org-clock-marker)
(marker-buffer org-clock-marker))
(org-clock-out t))
(when (equal select '(16))
;; Mark as default clocking task
(save-excursion
(org-back-to-heading t)
(move-marker org-clock-default-task (point))))
(setq target-pos (point)) ;; we want to clock in at this location
(save-excursion
(when (and selected-task (marker-buffer selected-task))
;; There is a selected task, move to the correct buffer
;; and set the new target position.
(set-buffer (org-base-buffer (marker-buffer selected-task)))
(setq target-pos (marker-position selected-task))
(move-marker selected-task nil))
(save-excursion
(save-restriction
(widen)
(goto-char target-pos)
(catch 'abort
(let ((interrupting (marker-buffer org-clock-marker))
ts selected-task target-pos)
(when (equal select '(4))
(setq selected-task (org-clock-select-task "Clock-in on task: "))
(if selected-task
(setq selected-task (copy-marker selected-task))
(error "Abort")))
(when interrupting
;; We are interrupting the clocking of a differnt task.
;; Save a marker to this task, so that we can go back.
(move-marker org-clock-interrupted-task
(marker-position org-clock-marker)
(marker-buffer org-clock-marker))
(org-clock-out t))
(when (equal select '(16))
;; Mark as default clocking task
(save-excursion
(org-back-to-heading t)
(or interrupting (move-marker org-clock-interrupted-task nil))
(org-clock-history-push)
(cond ((functionp org-clock-in-switch-to-state)
(looking-at org-complex-heading-regexp)
(let ((newstate (funcall org-clock-in-switch-to-state (match-string 2))))
(if newstate (org-todo newstate))))
((and org-clock-in-switch-to-state
(not (looking-at (concat outline-regexp "[ \t]*"
org-clock-in-switch-to-state
"\\>"))))
(org-todo org-clock-in-switch-to-state)))
(setq org-clock-heading-for-remember
(and (looking-at org-complex-heading-regexp)
(match-end 4)
(org-trim (buffer-substring (match-end 1) (match-end 4)))))
(setq org-clock-heading
(cond ((and org-clock-heading-function
(functionp org-clock-heading-function))
(funcall org-clock-heading-function))
((looking-at org-complex-heading-regexp)
(match-string 4))
(t "???")))
(setq org-clock-heading (org-propertize org-clock-heading 'face nil))
(org-clock-find-position)
(if (and org-clock-in-resume
(looking-at (concat "^[ \\t]* " org-clock-string
" \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"
" +\\sw+ +[012][0-9]:[0-5][0-9]\\)\\]$")))
(progn (message "Matched %s" (match-string 1))
(setq ts (concat "[" (match-string 1) "]"))
(goto-char (match-end 1))
(setq org-clock-start-time
(apply 'encode-time (org-parse-time-string (match-string 1)))))
(progn
(move-marker org-clock-default-task (point))))
(setq target-pos (point)) ;; we want to clock in at this location
(save-excursion
(when (and selected-task (marker-buffer selected-task))
;; There is a selected task, move to the correct buffer
;; and set the new target position.
(set-buffer (org-base-buffer (marker-buffer selected-task)))
(setq target-pos (marker-position selected-task))
(move-marker selected-task nil))
(save-excursion
(save-restriction
(widen)
(goto-char target-pos)
(org-back-to-heading t)
(or interrupting (move-marker org-clock-interrupted-task nil))
(org-clock-history-push)
(cond ((functionp org-clock-in-switch-to-state)
(looking-at org-complex-heading-regexp)
(let ((newstate (funcall org-clock-in-switch-to-state
(match-string 2))))
(if newstate (org-todo newstate))))
((and org-clock-in-switch-to-state
(not (looking-at (concat outline-regexp "[ \t]*"
org-clock-in-switch-to-state
"\\>"))))
(org-todo org-clock-in-switch-to-state)))
(setq org-clock-heading-for-remember
(and (looking-at org-complex-heading-regexp)
(match-end 4)
(org-trim (buffer-substring (match-end 1)
(match-end 4)))))
(setq org-clock-heading
(cond ((and org-clock-heading-function
(functionp org-clock-heading-function))
(funcall org-clock-heading-function))
((looking-at org-complex-heading-regexp)
(match-string 4))
(t "???")))
(setq org-clock-heading (org-propertize org-clock-heading
'face nil))
(org-clock-find-position)
(cond
((and org-clock-in-resume
(looking-at
(concat "^[ \\t]* " org-clock-string
" \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"
" +\\sw+ +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")))
(message "Matched %s" (match-string 1))
(setq ts (concat "[" (match-string 1) "]"))
(goto-char (match-end 1))
(setq org-clock-start-time
(apply 'encode-time
(org-parse-time-string (match-string 1)))))
((eq org-clock-in-resume 'auto-restart)
;; called from org-clock-load during startup,
;; do not interrupt, but warn!
(message "Cannot restart clock because task does not contain unfinished clock")
(ding)
(sit-for 2)
(throw 'abort nil))
(t
(insert "\n") (backward-char 1)
(org-indent-line-function)
(insert org-clock-string " ")
(setq org-clock-start-time (current-time))
(setq ts (org-insert-time-stamp org-clock-start-time 'with-hm 'inactive))))
(move-marker org-clock-marker (point) (buffer-base-buffer))
(or global-mode-string (setq global-mode-string '("")))
(or (memq 'org-mode-line-string global-mode-string)
(setq global-mode-string
(append global-mode-string '(org-mode-line-string))))
(org-update-mode-line)
(setq org-mode-line-timer
(run-with-timer 60 60 'org-update-mode-line))
(message "Clock started at %s" ts))))))
(move-marker org-clock-marker (point) (buffer-base-buffer))
(or global-mode-string (setq global-mode-string '("")))
(or (memq 'org-mode-line-string global-mode-string)
(setq global-mode-string
(append global-mode-string '(org-mode-line-string))))
(org-update-mode-line)
(setq org-mode-line-timer
(run-with-timer 60 60 'org-update-mode-line))
(message "Clock started at %s" ts)))))))
(defun org-clock-find-position ()
"Find the location where the next clock line should be inserted."
......@@ -820,7 +844,7 @@ the currently selected interval size."
(block (plist-get params :block))
(link (plist-get params :link))
ipos time p level hlc hdl content recalc formula pcol
cc beg end pos tbl tbl1 range-text rm-file-column scope-is-list)
cc beg end pos tbl tbl1 range-text rm-file-column scope-is-list st)
(setq org-clock-file-total-minutes nil)
(when step
(unless (or block (and ts te))
......@@ -902,7 +926,11 @@ the currently selected interval size."
(unless scope-is-list
(org-clock-sum ts te)
(goto-char (point-min))
(while (setq p (next-single-property-change (point) :org-clock-minutes))
(setq st t)
(while (or (and (bobp) (prog1 st (setq st nil))
(get-text-property (point) :org-clock-minutes)
(setq p (point-min)))
(setq p (next-single-property-change (point) :org-clock-minutes)))
(goto-char p)
(when (setq time (get-text-property p :org-clock-minutes))
(save-excursion
......@@ -1062,71 +1090,92 @@ This function is made for clock tables."
0))))
(defun org-clock-save ()
"Persist various clock-related data to disk"
(with-current-buffer (find-file (expand-file-name org-clock-persist-file))
(progn (delete-region (point-min) (point-max))
;;Store clock
(insert (format ";; org-persist.el - %s at %s\n"
system-name (format-time-string
(cdr org-time-stamp-formats))))
(if (and org-clock-persist (marker-buffer org-clock-marker)
(or (not org-clock-persist-query-save)
(y-or-n-p (concat "Save current clock ("
(substring-no-properties org-clock-heading)
")"))))
(insert "(setq resume-clock '(\""
(buffer-file-name (marker-buffer org-clock-marker))
"\" . " (int-to-string (marker-position org-clock-marker))
"))\n"))
;;Store clocked task history. Tasks are stored reversed to make
;;reading simpler
(if org-clock-history
(insert "(setq stored-clock-history '("
(mapconcat
(lambda (m)
(when (marker-buffer m)
(concat "(\"" (buffer-file-name (marker-buffer m))
"\" . " (int-to-string (marker-position m))
")")))
(reverse org-clock-history) " ") "))\n"))
(save-buffer)
(kill-buffer (current-buffer)))))
(defvar org-clock-loaded nil)
"Persist various clock-related data to disk.
The details of what will be saved are regulated by the variable
`org-clock-persist'."
(when org-clock-persist
(let (b)
(with-current-buffer (find-file (expand-file-name org-clock-persist-file))
(progn
(delete-region (point-min) (point-max))
;;Store clock
(insert (format ";; org-persist.el - %s at %s\n"
system-name (format-time-string
(cdr org-time-stamp-formats))))
(if (and (setq b (marker-buffer org-clock-marker))
(setq b (or (buffer-base-buffer b) b))
(buffer-live-p b)
(buffer-file-name b)
(or (not org-clock-persist-query-save)
(y-or-n-p (concat "Save current clock ("
(substring-no-properties org-clock-heading)
") "))))
(insert "(setq resume-clock '(\""
(buffer-file-name (marker-buffer org-clock-marker))
"\" . " (int-to-string (marker-position org-clock-marker))
"))\n"))
;; Store clocked task history. Tasks are stored reversed to make
;; reading simpler
(when (and org-clock-history (eq org-clock-persist t))
(insert
"(setq stored-clock-history '("
(mapconcat
(lambda (m)
(when (and (setq b (marker-buffer m))
(setq b (or (buffer-base-buffer b) b))
(buffer-live-p b)
(buffer-file-name b))
(concat "(\"" (buffer-file-name b)
"\" . " (int-to-string (marker-position m))
")")))
(reverse org-clock-history) " ") "))\n"))
(save-buffer)
(kill-buffer (current-buffer)))))))
(defvar org-clock-loaded nil
"Was the clock file loaded?")
(defun org-clock-load ()
"Load various clock-related data from disk, optionally resuming
a stored clock"
(if (not org-clock-loaded)
(let ((filename (expand-file-name org-clock-persist-file))
(org-clock-in-resume t))
(if (file-readable-p filename)
(progn
(message "%s" "Restoring clock data")
(setq org-clock-loaded t)
(load-file filename)
;; load history
(if (boundp 'stored-clock-history)
(save-window-excursion
(mapc (lambda (task)
(org-clock-history-push (cdr task)
(find-file (car task))))
stored-clock-history)))
;; resume clock
(if (and (boundp 'resume-clock) org-clock-persist
(or (not org-clock-persist-query-resume)
(y-or-n-p
(concat
"Resume clock ("
(with-current-buffer (find-file (car resume-clock))
(progn (goto-char (cdr resume-clock))
(looking-at org-complex-heading-regexp)
(match-string 4))) ")"))))
(with-current-buffer (find-file (car resume-clock))
(progn (goto-char (cdr resume-clock))
(org-clock-in)))))
(when (and org-clock-persist (not org-clock-loaded))
(let ((filename (expand-file-name org-clock-persist-file))
(org-clock-in-resume 'auto-restart)
resume-clock stored-clock-history)
(if (not (file-readable-p filename))
(message "Not restoring clock data; %s not found"
org-clock-persist-file)))))
org-clock-persist-file)
(message "%s" "Restoring clock data")
(setq org-clock-loaded t)
(load-file filename)
;; load history
(when stored-clock-history
(save-window-excursion
(mapc (lambda (task)
(if (file-exists-p (car task))
(org-clock-history-push (cdr task)
(find-file (car task)))))
stored-clock-history)))
;; resume clock
(when (and resume-clock org-clock-persist
(file-exists-p (car resume-clock))
(or (not org-clock-persist-query-resume)
(y-or-n-p
(concat
"Resume clock ("
(with-current-buffer (find-file (car resume-clock))
(save-excursion
(goto-char (cdr resume-clock))
(org-back-to-heading t)
(and (looking-at org-complex-heading-regexp)
(match-string 4))))
") "))))
(when (file-exists-p (car resume-clock))
(with-current-buffer (find-file (car resume-clock))
(goto-char (cdr resume-clock))
(org-clock-in)
(if (org-invisible-p)
(org-show-context)))))))))
;;;###autoload
(defun org-clock-persistence-insinuate ()
......
......@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.12a
;; Version: 6.13
;;
;; This file is part of GNU Emacs.
;;
......@@ -130,7 +130,7 @@ This is the compiled version of the format.")
(push ov org-columns-overlays)
ov))
(defun org-columns-display-here (&optional props)
(defun org-columns-display-here (&optional props dateline)
"Overlay the current line with column display."
(interactive)
(let* ((fmt org-columns-current-fmt-compiled)
......@@ -145,6 +145,7 @@ This is the compiled version of the format.")
'default))
(color (list :foreground (face-attribute ref-face :foreground)))
(face (list color 'org-column ref-face))
(face1 (list color 'org-agenda-column-dateline ref-face))
(pl (or (get-text-property (point-at-bol) 'prefix-length) 0))
(cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
pom property ass width f string ov column val modval s1 s2 title)
......@@ -189,7 +190,7 @@ This is the compiled version of the format.")
;; Create the overlay
(org-unmodified
(setq ov (org-columns-new-overlay
beg (setq beg (1+ beg)) string face))
beg (setq beg (1+ beg)) string (if dateline face1 face)))
(org-overlay-put ov 'keymap org-columns-map)
(org-overlay-put ov 'org-columns-key property)
(org-overlay-put ov 'org-columns-value (cdr ass))
......@@ -425,7 +426,7 @@ Where possible, use the standard interface for changing this line."
(t
(setq allowed (org-property-get-allowed-values pom key 'table))
(if allowed
(setq nval (completing-read "Value: " allowed nil t))
(setq nval (org-ido-completing-read "Value: " allowed nil t))
(setq nval (read-string "Edit: " value)))
(setq nval (org-trim nval))
(when (not (equal nval value))
......@@ -675,7 +676,7 @@ around it."
(interactive)
(let ((editp (and prop (assoc prop org-columns-current-fmt-compiled)))
cell)
(setq prop (completing-read
(setq prop (org-ido-completing-read
"Property: " (mapcar 'list (org-buffer-property-keys t nil t))
nil nil prop))
(setq title (read-string (concat "Column title [" prop "]: ") (or title prop)))
......@@ -683,7 +684,7 @@ around it."
(if (string-match "\\S-" width)
(setq width (string-to-number width))
(setq width nil))
(setq fmt (completing-read "Summary [none]: "
(setq fmt (org-ido-completing-read "Summary [none]: "