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. 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") eval((string-empty-p "test") nil) elisp--eval-last-sexp(nil) eval-last-sexp(nil) funcall-interactively(eval-last-sexp nil) call-interactively(eval-last-sexp nil nil) command-execute(eval-last-sexp) Emacs : GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian Package: Org mode version 9.4.6 (9.4.6-11-g1ee52c-elpa @ /home/vmg/.emacs.d/elpa/org-20210726/) current state: ============== (setq org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-link-shell-confirm-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-agenda-files '("~/Общедоступные/Процесс/Обеспечение.org" "~/Общедоступные/Процесс/Механизатор.org" "~/Общедоступные/Процесс/Токарь.org") org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-all append local] 5] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-archive-hook '(org-attach-archive-delete-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-startup-with-inline-images t org-agenda-before-write-hook '(org-agenda-add-entry-text) org-metaup-hook '(org-babel-load-in-session-maybe) org-bibtex-headline-format-function #[257 "\300\x01\236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-babel-pre-tangle-hook '(save-buffer) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-log-done 'note org-agenda-loop-over-headlines-in-active-region nil org-occur-hook '(org-first-headline-recenter) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-todo-keywords '((sequence "ИСПОЛНИТЬ" "|" "ИСПОЛНЕНО" "ОТМЕНЕНО" "ОСТАНОВЛЕНО")) org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-display-remote-inline-images 'download org-export-before-parsing-hook '(org-attach-expand-links) org-confirm-shell-link-function 'yes-or-no-p org-link-parameters '(("attachment" :follow org-attach-follow :complete org-attach-complete-link) ("id" :follow org-id-open) ("eww" :follow org-eww-open :store org-eww-store-link) ("rmail" :follow org-rmail-open :store org-rmail-store-link) ("mhe" :follow org-mhe-open :store org-mhe-store-link) ("irc" :follow org-irc-visit :store org-irc-store-link :export org-irc-export) ("info" :follow org-info-open :export org-info-export :store org-info-store-link) ("gnus" :follow org-gnus-open :store org-gnus-store-link) ("docview" :follow org-docview-open :export org-docview-export :store org-docview-store-link) ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link) ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete org-bbdb-complete-link :store org-bbdb-store-link) ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell) ("news" :follow #[514 "\301\300\302\x04Q\x02\"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("mailto" :follow #[514 "\301\300\302\x04Q\x02\"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("https" :follow #[514 "\301\300\302\x04Q\x02\"\207" ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("http" :follow #[514 "\301\300\302\x04Q\x02\"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("ftp" :follow #[514 "\301\300\302\x04Q\x02\"\207" ["ftp" browse-url ":"] 6 "\n\n(fn URL ARG)"]) ("help" :follow org-link--open-help) ("file" :complete org-link-complete-file) ("elisp" :follow org-link--open-elisp) ("doi" :follow org-link--open-doi)) org-link-elisp-confirm-function 'yes-or-no-p org-todo-keyword-faces '(("ИСПОЛНИТЬ" :background "red1" :foreground "black" :weight bold :box (:line-width 2 :style released-button)) ("ИСПОЛНЕНО" :background "green" :foreground "black" :weight bold :box (:line-width 2 :style released-button)) ("ОТМЕНЕНО" :background "gray" :foreground "black" :weight bold :box (:line-width 2 :style released-button)) ("ОСТАНОВЛЕНО" :background "blue" :foreground "black" :weight bold :box (:line-width 2 :style released-button)) ) )
Вячеслав Гришин <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 etc. 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.
* lisp/org-agenda.el (org-agenda-highlight-todo): Do not use `string-empty-p'. Restore compatibility with Emacs-24.3. --- lisp/org-agenda.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index c3fbabc01..b6cd895bc 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -7080,7 +7080,7 @@ The optional argument TYPE tells the agenda type." (setq x (concat (substring x 0 (match-end 1)) - (unless (string-empty-p org-agenda-todo-keyword-format) + (unless (string= org-agenda-todo-keyword-format "") (format org-agenda-todo-keyword-format (match-string 2 x))) ;; Remove `display' property as the icon could leak -- 2.25.1
I am grateful to you for your explanations and patience with my inexperience.
I made several mistakes, the main one being haste. I should have checked my emacs first..
The fact is that, in addition to the built-in version of orgmode, for some reason I installed another one.
Your recommendation helped: when I removed the extra (newer) version of Orgmode and removed the extraneous code from .emacs, everything worked.
Thank you for helping me master emacs — it is incredibly useful and hardly replaceable.
> 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
> etc.
>
> 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.
>
Thank you very much, Maxim. Now I don't know if I need to do something extra, because the problem arose because of my mistake.
When I removed the second version of Org and the extra code from .emacs, everything worked. I don't know how to explain it, because I'm just starting to learn emacs and lisp
On 04.08.2021 18:20, Maxim Nikulin wrote:
> * lisp/org-agenda.el (org-agenda-highlight-todo): Do not use `string-empty-p'.
>
> Restore compatibility with Emacs-24.3.
> ---
> lisp/org-agenda.el | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index c3fbabc01..b6cd895bc 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -7080,7 +7080,7 @@ The optional argument TYPE tells the agenda type."
> (setq x
> (concat
> (substring x 0 (match-end 1))
> - (unless (string-empty-p org-agenda-todo-keyword-format)
> + (unless (string= org-agenda-todo-keyword-format "")
> (format org-agenda-todo-keyword-format
> (match-string 2 x)))
> ;; Remove `display' property as the icon could leak
>
Note that compatibility with 24.3 was not the cause of the OP original
issue (they were running 26.3).
Do we really want to maintain compatibility with Emacs 24.3? That
version was released over 8 years ago and I suspect there are other
areas of org which are not compatible with that version. Note also that
the subr-x and string-empty-p were introduced in Emacs 24.4. If we are
going to support Emacs 24, I think it is reasonable it be 24.4 rather
than aiming for all 24 releases.
I don't think this patch is required, especially since we have not had
any bug reported relating to that version.
Maxim Nikulin <manikulin@gmail.com> writes:
> * lisp/org-agenda.el (org-agenda-highlight-todo): Do not use `string-empty-p'.
>
> Restore compatibility with Emacs-24.3.
> ---
> lisp/org-agenda.el | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index c3fbabc01..b6cd895bc 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -7080,7 +7080,7 @@ The optional argument TYPE tells the agenda type."
> (setq x
> (concat
> (substring x 0 (match-end 1))
> - (unless (string-empty-p org-agenda-todo-keyword-format)
> + (unless (string= org-agenda-todo-keyword-format "")
> (format org-agenda-todo-keyword-format
> (match-string 2 x)))
> ;; Remove `display' property as the icon could leak
The patch is created for the maint branch. I have reordered some part of the quoted message. On 05/08/2021 05:11, Tim Cross wrote: > I don't think this patch is required, especially since we have not had > any bug reported relating to that version. org-agenda.el (and some other files) should be fixed anyway. make single ... Compiling single /home/ubuntu/org-mode/lisp/org-agenda.el... In end of data: org-agenda.el:10769:1:Warning: the function ‘string-empty-p’ is not known to be defined. (log for emacs-25.2.2) > Note that compatibility with 24.3 was not the cause of the OP original > issue (they were running 26.3). I just do not have enough experience with elisp to suggest a patch to explicitly notify users that they have mixed org install. On the other hand, particular symptom from the report can be easily mitigated. > Do we really want to maintain compatibility with Emacs 24.3? There is the only place in org where `string-empty-p' is used. There is no (require 'subr-x) in org-agenda.el. Notice lisp/org.el:10: ;; Package-Requires: ((emacs "24.3")) Till this line is updated, I suppose, patches should respect it, especially for the maint branch. Unfortunately new org cite feature recently merged to master relies on some rx features unavailable even in Emacs-26.3 (Ubuntu-20.04 LTS focal). > That > version was released over 8 years ago and I suspect there are other > areas of org which are not compatible with that version. Note also that > the subr-x and string-empty-p were introduced in Emacs 24.4. If we are > going to support Emacs 24, I think it is reasonable it be 24.4 rather > than aiming for all 24 releases. It seems, RedHat-7 and thus CentOS-7 were released with Emacs-24.3. I have no idea how many users run these flavors on desktops and are permitted to update Org to the latest version. Accordingly to https://wiki.centos.org/About/Product end of lifetime dates for CentOS-7 are 2020-08-06 for full updates and 2024-06-30 for maintenance updates.
[-- Attachment #1: Type: text/plain, Size: 186 bytes --] Hi Maxim, > Restore compatibility with Emacs-24.3. FYI Emacs 24 is no longer Org’s minimum version, from the next release onward it will be Emacs 25. All the best, Timothy
On 05/08/2021 04:41, Вячеслав Гришин wrote: > Now I don't know if I need to do something extra, because the > problem arose because of my mistake. Vyacheslav, you do not need to react to my patch, it is for Org maintainers. There is neither continuous integration server nor ready to use configuration (e.g. a set of docker containers) to verify commits in clean environment. As a result some files may have minor issues that are unnoticeable by most of users. However it is better to fix inconsistencies like missed `require', etc. > When I removed the second version of Org and the extra code from .emacs, > everything worked. I don't know how to explain it, because I'm just > starting to learn emacs and lisp Notice that you can have more than one org mode version installed. E.g. in Debian and Ubuntu in addition to the version bundled with Emacs, it is possible to install elpa-org deb package. The version however is anyway noticeably older than current stable Org release, so people often use various package managers for Emacs. The problem you have met is not uncommon, example of usual response: https://orgmode.org/list/87im5gszqs.fsf@kyleam.com/ Unfortunately symptoms are usually quite obscure, they may reveal another issue. I do not know if it is possible to implement a trap to explicitly notify user that parts of org are loaded from different directories. There are may be some pitfalls on the way to have newer org version: - You should not require any org modules before `load-path' is adjusted. - Do not forget to recompile after update of sources. It seems, Emacs do not have means to detect stale .elc file similar to e.g. Python. - Attempt to try alternative version without modification of init.el may result in unexpected result. Usually "-Q" or at least "-q" option is required to suppress initialization. "-L" option is processed after init.el. So "emacs -L ~/src/org-mode/lisp" can easily result in mixed install. E.g. "emacs -Q -L ~/src/org-mode/lisp -l ~/.emacs.d/init.el" mostly work but there are some edge cases since it is not full equivalent of real initialization. There is no way to specify custom init file through command line option, it is necessary to create a part of parallel universe and pass it as --user option argument, HOME or XDG_CONFIG_HOME (for latest emacs version) environment: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539#121 Do not be afraid by such complications too much. ELPA package is the recommended way to have latest stable version: https://orgmode.org/install.html Alternatively ensure that (add-to-list 'load-path "~/src/org-mode/lisp") is early enough in your init.el.
On 05/08/2021 19:59, Timothy wrote:
>
>> Restore compatibility with Emacs-24.3.
>
> FYI Emacs 24 is no longer Org’s minimum version, from the next release onward
> it will be Emacs 25.
Timothy, I have seen that discussion. For me it does not matter in which
way org-agenda.el will be fixed: by adding (require 'subr-x) or by using
string= instead of string-empty-p. Both variants work with Emacs-26.3.
The point is that "make single" should work without warnings and in the
case of mixed install users should not get confusing errors that
resemble real issues.
The only reason why I suggested namely to avoid string-empty-p is that
compatibility with Emacs-24.3 is still declared in Org sources.
[-- Attachment #1: Type: text/plain, Size: 778 bytes --] Hi Maxim, > Timothy, I have seen that discussion. For me it does not matter in which way > org-agenda.el will be fixed: by adding (require ’subr-x) or by using string= > instead of string-empty-p. Both variants work with Emacs-26.3. The point is that > “make single” should work without warnings and in the case of mixed install > users should not get confusing errors that resemble real issues. > > The only reason why I suggested namely to avoid string-empty-p is that > compatibility with Emacs-24.3 is still declared in Org sources. Ah, cool. I took your original email to indicate that this change was solely for Emacs 24.3 comparability, but I now see you simply used that as a reason to choose between two different fixes. All the best, Timothy