1

I have org-capture-templates defined as below and until today could capture and log my runs fine, but as of today they've stopped working...

(setq org-capture-templates
    '(;; Computing
        ("c" "Computing")
        ("ce" "Emacs" entry (file+olp "~/org/computing.org" "Emacs")
        "* TODO %t %?\n" :prepend t)
        ;; Exercise
        ("e" "Exercise")
        ("er" "Logging a run" table-line (file+olp "~/org/training/training.org" "Running" "Log")
            "| %t | %? | km | min + s | | |" :prepend t)
        ("ec" "Logging a cycle" table-line (file+olp "~/org/training/training.org" "Cycling" "Log")
            "| %t | %? | km | min + s | | |" :prepend t)))

Snippet of my ~/org/training/training.org is...

* Running
** Log
#+NAME: running-log
#+CAPTION: Running Log
| Date             | Route             | Distance | Time         | Pace                          | Notes       |
|------------------+-------------------+----------+--------------+-------------------------------+-------------|
| <2021-01-03 Fri> | Shorter 12km run  | 12.25km  | 60min + 25s  | 4 min / km + 55.918367 s / km | Less icey!        |
| <2021-01-01 Fri> | Longer 16km run   | 16.22km  | 80min + 03s  | 4 min / km + 56.115906 s / km | Icey!            |

...and ~/org/computing.org is...

* Emacs
** TODO <2020-11-11 Wed> vterm only on non-work computers.

If I C-c c to start org-capture and select [c]... Computing... [e] Emacs I'm prompted for an entry under * Emacs in computing.org and until today [e]... Exercise... [r] Logging a run brought up a blank template like...

| <2021-01-03 | <cursor here to start entry> | km | min + s | | |

...and I could enter details distance and time, save it and the entry appeared in the ~/org/training/training.org with the pace calculated.

Now though I'm informed...

Capture abort: Symbol's function definition is void: assert

Debugging shows...

Debugger entered--Lisp error: (error "Capture abort: Symbol’s function definition is voi...")
  signal(error ("Capture abort: Symbol’s function definition is voi..."))
  error("Capture abort: %s" "Symbol’s function definition is void: assert")
  org-capture(nil)
  funcall-interactively(org-capture nil)
  call-interactively(org-capture nil nil)
  command-execute(org-capture)

...which doesn't mean much to me. If I look at the entry under [C] Customize org-capture-templates I have...

[INS] [DEL] Choice: [Value Menu] Multikey description:
            Keys       : e
            Description: Exercise
[INS] [DEL] Choice: [Value Menu] Template entry:
            Keys           : er
            Description    : Logging a run
            Capture Type   : [Value Menu] Table line
            Target location: [Value Menu] File & Outline path:
            Filename       : [Value Menu] Literal: ~/org/training/training.org
            Outline path:
            [INS] [DEL] Headline: Running
            [INS] [DEL] Headline: Log
            [INS]
            Template       : [Value Menu] String: | %t | %? | km | min + s | | |
            Plist:
            [X] Key: :prepend t
            [ ] Key: :immediate-finish t
            [ ] Key: :jump-to-captured t
            [ ] Key: :empty-lines 1
            [ ] Key: :empty-lines-before 1
            [ ] Key: :empty-lines-after 1
            [ ] Key: :clock-in t
            [ ] Key: :clock-keep t
            [ ] Key: :clock-resume t
            [ ] Key: :time-prompt t
            [ ] Key: :tree-type week
            [ ] Key: :unnarrowed t
            [ ] Key: :table-line-pos String: 
            [ ] Key: :kill-buffer t
            [INS]

Which looks fine to my untrained eye. Reading the C-h v org-capture-templates (see also here, I don't see that anything has changed since I first wrote this.

I'm running GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22) of 2020-11-29 (recent compile date is because its under Gentoo). I run Emacs as a daemon and connect a client to it and tried first re-evaluating my org-capture-template but with the same result. I then restarted the daemon and the error persisted.

I don't understand the debugging and why org-capture is being called interactively with nil nil arguments as I think I have defined the templates correctly and it worked fine until today. Any insight would be gratefully received.

EDIT (2021-01-03) :

After adding (require 'cl) as suggested it still errors with the following backtrace...

Debugger entered--Lisp error: (error "Capture abort: Invalid function: assert")
  signal(error ("Capture abort: Invalid function: assert"))
  error("Capture abort: %s" "Invalid function: assert")
  org-capture(nil)
  funcall-interactively(org-capture nil)
  call-interactively(org-capture nil nil)
  command-execute(org-capture)

EDIT (2020-01-04) :

I found things still worked on a laptop, but then updated packages and org-capture broke in the same way there. The packages updated don't seem related to org but I'm detailing them here for reference...

company-20201214.1620
ein-20201217.1508
flycheck-20201214.2154
forge-20201212.905
magit-20201212.929
org-ref-20201126.1924
pass-20190830.2017
projectile-20201214.839
python-mode-20201218.751
pyvenv-20201210.1509
auctex-12.3.1
dash-20201215.59
dash-functional-20201215.40
ess-20201217.1440
git-commit-20201115.2313
helm-20201215.1623
helm-core-20201202.907
ivy-20201217.1559
key-chord-20160227.1238
markdown-mode-20201211.329
mpdel-20201026.1123
transient-20201205.1610
8
  • assert is defined as an alias to cl-assert in cl.el. It's not clear who is trying to call it, but cl.el has been deprecated since emacs 27.1, so it may be that it used to be loaded but is not any longer. You can try (require 'cl) and see if the error goes away, but that is only a stop-gap measure.
    – NickD
    Jan 3, 2021 at 20:37
  • Thanks @NickD I've given that a whirl and it, obviously, reports that its deprecated on loading, trying to capture it errors with Capture abort: Invalid function: assert. I find cl.el under /usr/share/emacs/27.1/lisp/obsolete/cl.el, could there perhaps be a something under org-mode that relies on this and its worth reporting upstream? Found an old thread advising against use of cl.el.
    – slackline
    Jan 3, 2021 at 21:04
  • I also see Org 9.4.2 was released recently and has been merged with Emacs 27, and read elsewhere (a few weeks ago and can't recall where) that 27.2 release is in the offing, may give the new release a whirl.
    – slackline
    Jan 3, 2021 at 21:07
  • I have found custom org-agenda custom templates to be very temperamental over the years. I recommend you always make a backup copy of your .emacs file when you make changes to it. For this I would recommend xah-make-backup.
    – Edman
    Jan 4, 2021 at 9:24
  • Good to hear I'm not alone in experiencing this. I've kept key files with settings and configuration under Git version control in ~/.config/emacs/ for a few years now.
    – slackline
    Jan 4, 2021 at 11:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.