emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Cannot use org-mode and remember templates


From: Nick Dokos
Subject: Re: [Orgmode] Cannot use org-mode and remember templates
Date: Fri, 17 Jul 2009 11:26:35 -0400

Frank Rust <address@hidden> wrote:

> Thanks to all for the hints so far but unfortunately the setting for 
> "org-time-stamp-rounding-minutes" did not solve my problem.
> 

What does

 C-h v org-time-stamp-rounding-minutes <RET>

say?

In fact, it might be better to evaluate it in the backtrace buffer
itself: when you get the error, go to the backtrace buffer, type `e'
which should give you an ``Eval: '' prompt in the echo area and then type
``org-time-stamp-rounding-minutes<RET>''.

You see, the function that gets the error, org-current-time,
is very short and simple:

,----
| (defun org-current-time ()
|   "Current time, possibly rounded to `org-time-stamp-rounding-minutes'."
|   (if (> (car org-time-stamp-rounding-minutes) 1)
|       (let ((r (car org-time-stamp-rounding-minutes))
|           (time (decode-time)))
|       (apply 'encode-time
|              (append (list 0 (* r (floor (+ .5 (/ (float (nth 1 time)) r)))))
|                      (nthcdr 2 time))))
|     (current-time)))
`----

so there is not that much that can go wrong: the error message pretty
much says we are trying to apply a function that takes a list as
argument to something that is not a list: car is one such
function. That's why I still think that the
org-time-stamp-rounding-minutes variable is at fault. Are you setting it
like this:

(setq org-time-stamp-rounding-minutes '(0 5))

in your .emacs?

BTW, what version of orgmode are you using?

Thanks,
Nick

> Here is an actual backtrace:
> 
> Debugger entered--Lisp error: (wrong-type-argument listp 5)
>   org-current-time()
>   (or org-overriding-default-time (org-current-time))
>   (let* ((entry ...) (ct ...) (dct ...) (ct1 ...) (tpl ...) (plist-p ...) 
> (file ...) (headline ...) (v-c ...) (v-x ...) (v-t ...) (v-T ...) (v-u ...)
> (v-U ...) (v-i ...) (v-a ...) (clipboards ...) (v-A ...) (v-n user-full-name) 
> (v-k ...) (v-K ...) v-I (org-startup-folded nil) (org-inhibit-startup t)
> org-time-was-given org-end-time-was-given x prompt completions char time pos 
> default histvar) (when (functionp file) (setq file ...)) (when (and file
> ...) (setq file ...)) (setq org-store-link-plist (append ... 
> org-store-link-plist)) (unless tpl (setq tpl "") (message "No template") 
> (ding) (sit-for
> 1)) (erase-buffer) (insert (substitute-command-keys ...)) (insert tpl) 
> (goto-char (point-min)) (while (re-search-forward "%\\([tTuUaiAcxkKI]\\)" nil 
> t)
> (when ... ...) (replace-match ... t t)) (goto-char (point-min)) (while 
> (re-search-forward "%\\[\\(.+\\)\\]" nil t) (let ... ... ... ...)) (goto-char
> (point-min)) (while (re-search-forward "%\\((.+)\\)" nil t) (goto-char ...) 
> (let ... ... ...)) (when plist-p (goto-char ...) (while ... ...)) (let (...)
> (org-mode) (org-remember-mode 1)) (if (and file ... ...) (org-set-local ... 
> file)) (if headline (org-set-local ... headline)) (goto-char (point-min))
> (while (re-search-forward "%^\\({\\([^}]*\\)}\\)?\\([gGtTuUCLp]\\)?" nil t) 
> (setq char ... prompt ...) (goto-char ...) (replace-match "") (setq
> completions nil default nil) (when prompt ...) (cond ... ... ... ... ... 
> ...)) (goto-char (point-min)) (if (re-search-forward "%\\?" nil t)
> (replace-match "") (and ... ...)))
>   (if org-remember-templates (let* (... ... ... ... ... ... ... ... ... ... 
> ... ... ... ... ... ... ... ... ... ... ... v-I ... ... org-time-was-given
> org-end-time-was-given x prompt completions char time pos default histvar) 
> (when ... ...) (when ... ...) (setq org-store-link-plist ...) (unless tpl ...
> ... ... ...) (erase-buffer) (insert ...) (insert tpl) (goto-char ...) (while 
> ... ... ...) (goto-char ...) (while ... ...) (goto-char ...) (while ... ...
> ...) (when plist-p ... ...) (let ... ... ...) (if ... ...) (if headline ...) 
> (goto-char ...) (while ... ... ... ... ... ... ...) (goto-char ...) (if ...
> ... ...)) (let (...) (org-mode) (org-remember-mode 1)))
>   org-remember-apply-template()
>   run-hooks(text-mode-hook remember-mode-hook)
>   apply(run-hooks (text-mode-hook remember-mode-hook))
>   run-mode-hooks(remember-mode-hook)
>   remember-mode()
>   remember(nil)
>   call-interactively(remember nil nil)
> 
> I hope this helps.
> 
> Thanks and regards,
> Frank
> 
> On Thu, Jul 16, 2009 at 7:07 PM, Nick Dokos <address@hidden> wrote:
> 
>     Frank Rust <address@hidden> wrote:
>    
>     > Debugger entered--Lisp error: (wrong-type-argument listp 5)
>     >   org-current-time()
>     >   org-remember-apply-template()
>     >   run-hooks(text-mode-hook remember-mode-hook)
>     >   apply(run-hooks (text-mode-hook remember-mode-hook))
>     >   run-mode-hooks(remember-mode-hook)
>     >   remember-mode()
>     >   remember(nil)
>     >   call-interactively(remember nil nil)
>     >
>     >  
>     >
>     > Debugger entered--Lisp error: (wrong-type-argument listp 5)
>     >   org-current-time()
>     >
>     > ...
>     >
>     > I hope this helps.
>     > p
>    
>     In this case, no, because Seb Vauban nailed the cause (he must have
>     recently polished his crystal ball, so he did not need a backtrace at
>     all): org-time-stamp-rounding-minutes should be a list of two numbers.
>    
>     In general, however, a bug report with a backtrace and uncompiled code
>     makes things much easier: from your backtrace, anybody (with some
>     knowledge of lisp) can see what the problem is - no crystal ball
>     required.
>    
>     Thanks,
>     Nick
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

[Prev in Thread] Current Thread [Next in Thread]