[Top][All Lists]

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

Re: Bug: org-agenda-highlight-todo: Symbol’s function definition is void

From: Tim Cross
Subject: Re: Bug: org-agenda-highlight-todo: Symbol’s function definition is void: string-empty-p [9.4.6 (9.4.6-11-g1ee52c-elpa @ /home/vmg/.emacs.d/elpa/org-20210726/)]
Date: Wed, 04 Aug 2021 11:41:43 +1000
User-agent: mu4e 1.6.1; emacs 28.0.50

Вячеслав Гришин <w201403@ya.ru> writes:

> Remember to cover the basics, that is, what you expected to happen and
> what in fact did happen.  You don't know how to make a good report?  See
>      https://orgmode.org/manual/Feedback.html#Feedback
> Your bug report will be posted to the Org mailing list.
> ------------------------------------------------------------------------
>       1.
>  I updated orgmode package and trying to org-agenda-list, as usual. But 
> failed with mistake  — org-agenda-list was empty.
>  After investigation, I took advice to put this:
>       ;; NB If you want to use this library, it's almost always correct to 
> use:
>       (eval-when-compile (require 'subr-x))
>  in the beginning of .emacs. And it worked. Org-agenda-list was fine.

I suspect that adding that line has actually hidden a larger problem.
The above line is essentially telling emacs to load the subr-x package
when your compiling an emacs-lisp file. However, your not compiling your
.emacs file, so this will not have any effect unless your compiling your
.emacs file. It is rarely worthwhile compiling your init file. Far
better off to keep your init file relatively small and pushing
complex/large configuration stuff into separate files which can be
compiled. There are a number of complications you often need to deal
with when compiling your init file and dealing with these often adds
enough complexity to outweigh the any benefits to startup time, which
are typically very small anyway.  

The symptoms you are seeing are frequently seen with a broken org
install. This can easily happen if you attempt to upgrade org when you
already have org functions loaded. Basic problem is that you end up with
a broken mixed installation with parts from the old version and parts
from the upgraded version.

Note that if the issue was as you described, many people would be
experiencing this bug, but they aren't. This suggests the problem is
local to your setup.  

I would remove the upgraded org package and try re-installing. However,
it is really important to make sure your .emacs does not call any org
functions because this will load org during startup and then when you
attempt to upgrade the package, you will get the same issue. This may
require some re-organisation of your .emacs file - possibly wrapping org
related code in an eval-after-load or using something like use-package

An easy way to verify which avoids large refactoring of your init file
would be to comment out any org related configuration from your init
file, restart emacs. upgrade org, uncomment what you commented and then
restart emacs. 

>  The org-agenda-highlight-todo function (org-agenda.el file) uses the
>  string-empty-p function from the emacs-lisp/subr-x.el module, but
>  somewhere is not done (require ' subr-x), so when calling the
>  org-agenda-highlight-todo function, string-empty-p is not defined,
>  which leads to an error — org-agenda-highlight-todo: Symbol’s function
>  definition is void: string-empty-p
>       2.
>  For checking I called the emacs -Q and put in it scratch:
>       (string-empty-p "test")
>       (require 'subr-x)
>  Then I executed the command
>       C-x C-e
>  on
>       (require 'subr-x)
>  output was
>       Debugger entered--Lisp error: (void-function string-empty-p)
>       (string-empty-p "test")

When you did C-x C-e, either you evaluated the first sexp or it tried to
evaluate all sexps in the scratch buffer, calling string-empty-p first
and before require 'subr-x, so the library was not yet loaded and the
function was not found. the require needs to be before functions from
the required library are called. 

reply via email to

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