From 99572d93b26e24045e60a9d5016942bbae6ea17a Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 28 Oct 2008 09:52:52 +0100 Subject: [PATCH] Bug fixes. --- lisp/org-clock.el | 15 +++++++++------ lisp/org.el | 48 +++++++++++++++++++++++------------------------ 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 6fc7b15dc..afabd344f 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -33,6 +33,7 @@ (require 'calendar)) (declare-function calendar-absolute-from-iso "cal-iso" (&optional date)) +(defvar org-time-stamp-formats) (defgroup org-clock nil "Options concerning clocking working time in Org-mode." @@ -1018,7 +1019,7 @@ the currently selected interval size." ;;Store clock (insert (format ";; org-persist.el - %s at %s\n" system-name (format-time-string - (cdr (org-time-stamp-formats))))) + (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 (" @@ -1065,11 +1066,13 @@ a stored clock" ;; resume clock (if (and (boundp 'resume-clock) org-clock-persist (or (not org-clock-persist-query-resume) - (y-or-n-p "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))) ")"))) + (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))))) diff --git a/lisp/org.el b/lisp/org.el index e94550b9e..d59706b4c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -13915,30 +13915,30 @@ org-yank-adjusted-subtrees \[1] Basically, the test checks if the first non-white line is a heading and if there are no other headings with fewer stars." (interactive) - (if org-yank-folded-subtrees - (let ((beg (point)) - (subtreep (org-kill-is-subtree-p)) - end) - (if (and subtreep org-yank-adjusted-subtrees) - (org-paste-subtree nil nil 'for-yank) - (call-interactively 'yank)) - (setq end (point)) - (goto-char beg) - (when (and (bolp) subtreep) - (or (looking-at outline-regexp) - (re-search-forward (concat "^" outline-regexp) end t)) - (while (and (< (point) end) (looking-at outline-regexp)) - (hide-subtree) - (org-cycle-show-empty-lines 'folded) - (condition-case nil - (outline-forward-same-level 1) - (error (goto-char end))))) - (goto-char end) - (skip-chars-forward " \t\n\r")) - (if (and subtreep org-yank-adjusted-subtrees) - (org-paste-subtree nil nil 'for-yank) - (call-interactively 'yank)))) - + (let ((subtreep (org-kill-is-subtree-p))) + (if org-yank-folded-subtrees + (let ((beg (point)) + end) + (if (and subtreep org-yank-adjusted-subtrees) + (org-paste-subtree nil nil 'for-yank) + (call-interactively 'yank)) + (setq end (point)) + (goto-char beg) + (when (and (bolp) subtreep) + (or (looking-at outline-regexp) + (re-search-forward (concat "^" outline-regexp) end t)) + (while (and (< (point) end) (looking-at outline-regexp)) + (hide-subtree) + (org-cycle-show-empty-lines 'folded) + (condition-case nil + (outline-forward-same-level 1) + (error (goto-char end))))) + (goto-char end) + (skip-chars-forward " \t\n\r")) + (if (and subtreep org-yank-adjusted-subtrees) + (org-paste-subtree nil nil 'for-yank) + (call-interactively 'yank))))) + (define-key org-mode-map "\C-y" 'org-yank) (defun org-invisible-p ()