emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Cache must be active error
@ 2023-07-02 16:13 Colin Baxter
  2023-07-02 16:25 ` Ihor Radchenko
  0 siblings, 1 reply; 11+ messages in thread
From: Colin Baxter @ 2023-07-02 16:13 UTC (permalink / raw)
  To: emacs-orgmode


I now find that when I enter `m' to match an agenda TAG/PROP/TODO, I get
an error telling me that the "cache must be active". This error is new
today and I assume the result of commit 948c89644.

I have

(setq org-element-use-cache nil)
(setq org-element-cache-persistent nil)

Is there a solution for those of us who do not wish to use org cache
(and org-persist)?

Colin Baxter.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Cache must be active error
  2023-07-02 16:13 Cache must be active error Colin Baxter
@ 2023-07-02 16:25 ` Ihor Radchenko
  2023-07-02 17:21   ` Colin Baxter
  0 siblings, 1 reply; 11+ messages in thread
From: Ihor Radchenko @ 2023-07-02 16:25 UTC (permalink / raw)
  To: m43cap; +Cc: emacs-orgmode

Colin Baxter <m43cap@yandex.com> writes:

> I now find that when I enter `m' to match an agenda TAG/PROP/TODO, I get
> an error telling me that the "cache must be active". This error is new
> today and I assume the result of commit 948c89644.
>
> I have
>
> (setq org-element-use-cache nil)
> (setq org-element-cache-persistent nil)

This should not matter and should not cause the error.
Please provide more details.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Cache must be active error
  2023-07-02 16:25 ` Ihor Radchenko
@ 2023-07-02 17:21   ` Colin Baxter
  2023-07-02 17:29     ` Ihor Radchenko
  0 siblings, 1 reply; 11+ messages in thread
From: Colin Baxter @ 2023-07-02 17:21 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

>>>>> Ihor Radchenko <yantar92@posteo.net> writes:

    > Colin Baxter <m43cap@yandex.com> writes:
    >> I now find that when I enter `m' to match an agenda
    >> TAG/PROP/TODO, I get an error telling me that the "cache must be
    >> active". This error is new today and I assume the result of
    >> commit 948c89644.
    >> 
    >> I have
    >> 
    >> (setq org-element-use-cache nil) (setq
    >> org-element-cache-persistent nil)

    > This should not matter and should not cause the error.  Please
    > provide more details.

The debugger output on the error is:

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (error "Cache must be active.")
  (signal error ("Cache must be active."))
  (error "Cache must be active.")
  (org-element-cache-map #f(compiled-function (el) #<bytecode 0xb3290e9>))
  (org-get-buffer-tags)
  (org-make-tags-matcher nil)
  (org-tags-view nil)
  (funcall-interactively org-tags-view nil)
  (call-interactively org-tags-view)
  (org-agenda nil)
  (funcall-interactively org-agenda nil)
  (call-interactively org-agenda nil nil)
  (command-execute org-agenda)
--8<---------------cut here---------------end--------------->8---

There is an odd feature. If I reload org-mode on a org buffer,
using "C- C-x !" then the error vanishes on using "C-c C-a m". If I
launch a new emacs (28.2 or 30.50.0) then the error returns and only
vanishes if I reload org-mode again.

Colin Baxter.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Cache must be active error
  2023-07-02 17:21   ` Colin Baxter
@ 2023-07-02 17:29     ` Ihor Radchenko
  2023-07-02 17:44       ` Colin Baxter
  0 siblings, 1 reply; 11+ messages in thread
From: Ihor Radchenko @ 2023-07-02 17:29 UTC (permalink / raw)
  To: m43cap; +Cc: emacs-orgmode

Colin Baxter <m43cap@yandex.com> writes:

>     > This should not matter and should not cause the error.  Please
>     > provide more details.
>
> The debugger output on the error is:
>
> --8<---------------cut here---------------start------------->8---
> Debugger entered--Lisp error: (error "Cache must be active.")
>   (signal error ("Cache must be active."))
>   (error "Cache must be active.")
>   (org-element-cache-map #f(compiled-function (el) #<bytecode 0xb3290e9>))

Just for context, the new version `org-element-cache-map' uses a new
macro `org-element-with-enabled-cache' that temporarily enabled cache
for the duration of `org-element-cache-map'. 

> There is an odd feature. If I reload org-mode on a org buffer,
> using "C- C-x !" then the error vanishes on using "C-c C-a m". If I
> launch a new emacs (28.2 or 30.50.0) then the error returns and only
> vanishes if I reload org-mode again.

This sounds like you got mixed Org installation or org-element.el from
built-in Org. If it is the case, you may need to check your config.

You can also try WIP branch feature/shadowcheck that tries more to fight
mixed version issue:
https://git.sr.ht/~yantar92/org-mode/tree/feature/shadowcheck

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Cache must be active error
  2023-07-02 17:29     ` Ihor Radchenko
@ 2023-07-02 17:44       ` Colin Baxter
  2023-07-03  3:08         ` Max Nikulin
  0 siblings, 1 reply; 11+ messages in thread
From: Colin Baxter @ 2023-07-02 17:44 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

>>>>> Ihor Radchenko <yantar92@posteo.net> writes:

    > Colin Baxter <m43cap@yandex.com> writes:
    >> > This should not matter and should not cause the error.  Please
    >> > provide more details.
    >> 
    >> The debugger output on the error is:
    >> 
    >> --8<---------------cut here---------------start------------->8---
    >> Debugger entered--Lisp error: (error "Cache must be active.")
    >> (signal error ("Cache must be active."))  (error "Cache must be
    >> active.")  (org-element-cache-map #f(compiled-function (el)
    >> #<bytecode 0xb3290e9>))

    > Just for context, the new version `org-element-cache-map' uses a
    > new macro `org-element-with-enabled-cache' that temporarily
    > enabled cache for the duration of `org-element-cache-map'.

    >> There is an odd feature. If I reload org-mode on a org buffer,
    >> using "C- C-x !" then the error vanishes on using "C-c C-a m". If
    >> I launch a new emacs (28.2 or 30.50.0) then the error returns and
    >> only vanishes if I reload org-mode again.

    > This sounds like you got mixed Org installation or org-element.el
    > from built-in Org. If it is the case, you may need to check your
    > config.

    > You can also try WIP branch feature/shadowcheck that tries more to
    > fight mixed version issue:
    > https://git.sr.ht/~yantar92/org-mode/tree/feature/shadowcheck

    > -- Ihor Radchenko // yantar92, Org mode contributor, Learn more
    > about Org mode at <https://orgmode.org/>.  Support Org development
    > at <https://liberapay.com/org-mode>, or support my work at
    > <https://liberapay.com/yantar92>

I add org-mode (from git) early to the load-path in order to compile new
org-mode versions on the fly without closes emacs.

I'll first experiment by moving

--8<---------------cut here---------------start------------->8---
(add-to-list 'load-path (expand-file-name "/path/to/git/org-mode/lisp"))
--8<---------------cut here---------------end--------------->8---

to different points in my ~/.emacs to see if that solves the issue.

Colin Baxter.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Cache must be active error
  2023-07-02 17:44       ` Colin Baxter
@ 2023-07-03  3:08         ` Max Nikulin
  2023-07-03  7:03           ` Colin Baxter
  0 siblings, 1 reply; 11+ messages in thread
From: Max Nikulin @ 2023-07-03  3:08 UTC (permalink / raw)
  To: emacs-orgmode

On 03/07/2023 00:44, Colin Baxter wrote:
>>>>>> Ihor Radchenko writes:
>      > Just for context, the new version `org-element-cache-map' uses a
>      > new macro `org-element-with-enabled-cache' that temporarily
>      > enabled cache for the duration of `org-element-cache-map'.

> I add org-mode (from git) early to the load-path in order to compile new
> org-mode versions on the fly without closes emacs.

You may try to add

(message "org? %S" (featurep 'org))

before the line adding Org to load path. Check the *Messages* buffer 
that it reports "nil" to ensure that Org is not loaded through some 
dependencies.

When pulled commits includes changes related to macros, .elc files 
affected by macro expansions must be removed before compilation. 
*Incremental* builds may result in inconsistent code. Emacs developers 
prefer fast, but sometimes incorrect builds and they are rather 
skeptical in relation to proper support of incremental builds.

Without removing *.elc files functions like `byte-recompile-directory' 
and `batch-byte-compile' may produce files that uses old macro versions.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Cache must be active error
  2023-07-03  3:08         ` Max Nikulin
@ 2023-07-03  7:03           ` Colin Baxter
  2023-07-03  7:30             ` Max Nikulin
  0 siblings, 1 reply; 11+ messages in thread
From: Colin Baxter @ 2023-07-03  7:03 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

>>>>> Max Nikulin <manikulin@gmail.com> writes:

    > On 03/07/2023 00:44, Colin Baxter wrote:
    >>>>>>> Ihor Radchenko writes:
    >> > Just for context, the new version `org-element-cache-map' uses
    >> a > new macro `org-element-with-enabled-cache' that temporarily >
    >> enabled cache for the duration of `org-element-cache-map'.

    >> I add org-mode (from git) early to the load-path in order to
    >> compile new org-mode versions on the fly without closes emacs.

    > You may try to add

    > (message "org? %S" (featurep 'org))

Thanks for this tip. It reports `nil'.


    > before the line adding Org to load path. Check the *Messages*
    > buffer that it reports "nil" to ensure that Org is not loaded
    > through some dependencies.

    > When pulled commits includes changes related to macros, .elc files
    > affected by macro expansions must be removed before
    > compilation. *Incremental* builds may result in inconsistent
    > code. Emacs developers prefer fast, but sometimes incorrect builds
    > and they are rather skeptical in relation to proper support of
    > incremental builds.

    > Without removing *.elc files functions like
    > `byte-recompile-directory' and `batch-byte-compile' may produce
    > files that uses old macro versions.

I've tried removing the .elc files but that doesn't seem to be the
issue.

1. Forcing emacs (emacs-30.50.0) to use only its built-in org-mode then
I see no error

2. If I remove all the org files from my emacs-30.50.0 and thereby force
emacs to use only org-mode from git then I see the error.

3. I suspect some other org-mode library I use is causing the
problem. So far, I've not found the culprit, even though it is only "m"
- search for TAGS/PROPS/KEYWORDS - that gives the error.

Thank you for your help.

Colin Baxter.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Cache must be active error
  2023-07-03  7:03           ` Colin Baxter
@ 2023-07-03  7:30             ` Max Nikulin
  2023-07-03 12:23               ` Colin Baxter
  0 siblings, 1 reply; 11+ messages in thread
From: Max Nikulin @ 2023-07-03  7:30 UTC (permalink / raw)
  To: emacs-orgmode

On 03/07/2023 14:03, Colin Baxter wrote:
> 2. If I remove all the org files from my emacs-30.50.0 and thereby force
> emacs to use only org-mode from git then I see the error.

Have you tried to recompile Org from git or to load it uncompiled?

Concerning mixed-version loading. M-x org-version when read with 
attention may contain a hint. Other tools are `list-load-path-shadows' and

(ignore (pp (mapcar (lambda (x) (list (car x))) load-history)))

and search for "org"



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Cache must be active error
  2023-07-03  7:30             ` Max Nikulin
@ 2023-07-03 12:23               ` Colin Baxter
  2023-07-03 12:32                 ` Ihor Radchenko
  0 siblings, 1 reply; 11+ messages in thread
From: Colin Baxter @ 2023-07-03 12:23 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

>>>>> Max Nikulin <manikulin@gmail.com> writes:

    > On 03/07/2023 14:03, Colin Baxter wrote:
    >> 2. If I remove all the org files from my emacs-30.50.0 and
    >> thereby force emacs to use only org-mode from git then I see the
    >> error.

    > Have you tried to recompile Org from git or to load it uncompiled?

    > Concerning mixed-version loading. M-x org-version when read with
    > attention may contain a hint. Other tools are
    > `list-load-path-shadows' and

    > (ignore (pp (mapcar (lambda (x) (list (car x))) load-history)))

    > and search for "org"

I now a recipe:

Either with emacs-28.2 or emacs-30.0.50 do:

1. emacs -q <RET>
2. M-x org-agenda <RET>
3. Enter m
4. "Match:" appears in echo area

However:

1. emacs -q <RET>
2. eval in scratch buffer
   (add-to-list 'load-path (expand-file-name "~/path/to/git/org-mode/lisp"))
3. M-x org-agenda <RET>
4. Enter m
5. "Cache must be active" now appears in echo area

Am I seeing a new git/org-mode feature or a bug? The lisp files in
git/org-mode/lisp were not byte-compiled.

Colin Baxter.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Cache must be active error
  2023-07-03 12:23               ` Colin Baxter
@ 2023-07-03 12:32                 ` Ihor Radchenko
  2023-07-03 14:18                   ` Colin Baxter
  0 siblings, 1 reply; 11+ messages in thread
From: Ihor Radchenko @ 2023-07-03 12:32 UTC (permalink / raw)
  To: m43cap; +Cc: Max Nikulin, emacs-orgmode

Colin Baxter <m43cap@yandex.com> writes:

> 1. emacs -q <RET>
> 2. eval in scratch buffer
>    (add-to-list 'load-path (expand-file-name "~/path/to/git/org-mode/lisp"))
> 3. M-x org-agenda <RET>
> 4. Enter m
> 5. "Cache must be active" now appears in echo area
>
> Am I seeing a new git/org-mode feature or a bug?

A can reproduce.
Fixed, on main.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Cache must be active error
  2023-07-03 12:32                 ` Ihor Radchenko
@ 2023-07-03 14:18                   ` Colin Baxter
  0 siblings, 0 replies; 11+ messages in thread
From: Colin Baxter @ 2023-07-03 14:18 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Max Nikulin, emacs-orgmode

>>>>> Ihor Radchenko <yantar92@posteo.net> writes:

    > Colin Baxter <m43cap@yandex.com> writes:
    >> 1. emacs -q <RET> 2. eval in scratch buffer (add-to-list
    >> 'load-path (expand-file-name "~/path/to/git/org-mode/lisp"))
    >> 3. M-x org-agenda <RET> 4. Enter m 5. "Cache must be active" now
    >> appears in echo area
    >> 
    >> Am I seeing a new git/org-mode feature or a bug?

    > A can reproduce.  Fixed, on main.

Confirmed. Thank you very much for this.

Colin Baxter.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-07-03 14:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-02 16:13 Cache must be active error Colin Baxter
2023-07-02 16:25 ` Ihor Radchenko
2023-07-02 17:21   ` Colin Baxter
2023-07-02 17:29     ` Ihor Radchenko
2023-07-02 17:44       ` Colin Baxter
2023-07-03  3:08         ` Max Nikulin
2023-07-03  7:03           ` Colin Baxter
2023-07-03  7:30             ` Max Nikulin
2023-07-03 12:23               ` Colin Baxter
2023-07-03 12:32                 ` Ihor Radchenko
2023-07-03 14:18                   ` Colin Baxter

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).