diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-06-23 07:39:56 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-06-23 07:39:56 +0200 |
commit | 19602fa56e1576042f625f2115d720e68367656c (patch) | |
tree | 887d714b07459c897ee7049e4ef37aaa5195159c | |
parent | 9f4452f43c5a68346dfadb6ac5b75872828d92bb (diff) | |
download | org-mode-19602fa56e1576042f625f2115d720e68367656c.tar.gz |
Fix minor bugs in org-capture.el, and keep byte-compiler happy
-rw-r--r-- | lisp/org-capture.el | 12 | ||||
-rw-r--r-- | lisp/org-mks.el | 7 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el index a39759b..1edfb08 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -53,6 +53,11 @@ (require 'org) (require 'org-mks) +(declare-function org-datetree-find-date-create "org-datetree" + (DATE &optional KEEP-RESTRICTION)) +(defvar org-remember-default-headline) +(defvar org-remember-templates) + (defvar org-capture-clock-was-started nil "Internal flag, noting if the clock was started.") @@ -451,8 +456,7 @@ already gone." (let ((pos (point)) (base (buffer-base-buffer (current-buffer)))) (org-capture-finalize) (save-window-excursion - (save-excursion - (set-buffer (or base (current-buffer))) + (with-current-buffer (or base (current-buffer)) (save-excursion (save-restriction (widen) @@ -522,6 +526,7 @@ already gone." (error "No match for target regexp in file %s" (nth 1 target)))) ((eq (car target) 'file+datetree) + (require 'org-datetree) (set-buffer (org-capture-target-buffer (nth 1 target))) ;; Make a date tree entry, with the current date (or yesterday, ;; if we are extending dates for a couple of hours) @@ -839,7 +844,7 @@ Lisp programs can force the template by setting KEYS to a string." (when org-capture-templates (if keys (or (assoc keys org-capture-templates) - (error "No capture template referred to by \"%s\" keys")) + (error "No capture template referred to by \"%s\" keys" keys)) (org-mks org-capture-templates "Select a capture template\n=========================" "Template key: " @@ -1087,6 +1092,7 @@ The template may still contain \"%?\" for cursor positioning." "Import old remember templates into org-capture-templates? ") (yes-or-no-p "Note that this will remove any templates currently defined in `org-capture-templates'. Do you still want to go ahead? ")) + (require 'org-remember) (setq org-capture-templates (mapcar (lambda (entry) diff --git a/lisp/org-mks.el b/lisp/org-mks.el index 59f6527..abf5e79 100644 --- a/lisp/org-mks.el +++ b/lisp/org-mks.el @@ -23,6 +23,10 @@ ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(require 'org) +(eval-when-compile + (require 'cl)) + (defun org-mks (table title &optional prompt specials) "Select a member of an alist with multiple keys. TABLE is the alist which should contain entries where the car is a string. @@ -49,7 +53,8 @@ also (\"key\" \"description\") entries. When they are selected, " (setq prompt (or prompt "Select: ")) - (let (tbl orig-table dkey ddesc des-keys allowed-keys current prefix rtn) + (let (tbl orig-table dkey ddesc des-keys allowed-keys + current prefix rtn re pressed) (save-window-excursion (org-switch-to-buffer-other-window "*Org Select*") (setq orig-table table) |