Stefan Monnier writes: > As part of the on-going work to use lexical-binding in all the files > bundled with Emacs, I took a stab at converting org-agenda.el to > lexical-binding.
Thank you. > [...] > Anyway, here's my first cut (the patch is made against the head of > Org's `master` rather than Emacs's `master`, since I suspect that could > make things easier for you). The commit message is basically empty > because it's not intended to be installed yet. I'm instead hoping for > some feedback, such as "tried it, works" or "burps all over the place", With a quick test of a few main commands, burps in one of four. Contents /tmp/scratch.org: --8<---------------cut here---------------start------------->8--- * TODO a :t: SCHEDULED: <2021-02-23 Tue> foo * DONE b * TODO c DEADLINE: <2021-02-23 Tue> --8<---------------cut here---------------end--------------->8--- Running with emacs 27.1 and -Q: (require 'org-agenda) (setq org-agenda-files '("/tmp/scratch.org")) (global-set-key (kbd "C-c a") #'org-agenda) ;; Commands: ;; (org-todo-list) ; works ;; (org-search-view nil "foo") ; works ;; (org-tags-view nil "+t") ; works ;; (org-agenda-list) ; fails: void-variable date There are also some `make test' failures: 7 unexpected results: FAILED test-org-agenda/diary-inclusion FAILED test-org-agenda/empty FAILED test-org-agenda/one-line FAILED test-org-agenda/scheduled-non-todo FAILED test-org-agenda/set-priority FAILED test-org-agenda/sticky-agenda-name FAILED test-org-agenda/sticky-agenda-name-after-reload > or "pretends everything is fine but doesn't do the right thing any > more", or (even better) actual feedback about the code itself and the > approach(es) I chose to use. While I'm not sure I can provide any useful feedback about approaches, I'll see if I can tweak your patch to resolve the org-agenda-list failure or any of the above test failures. > - I believe I have quashed all the compiler warnings (some had nothing > to do with lexical scoping), Hmm, I wonder why I'm not seeing the ones unrelated to the lexical scoping change. `make compile' and `make single' are quiet for me on Org's current master (d21d200bc) with Emacs 27. If I use an Emacs built from a recent Emacs commit (6172454ff3), I see a couple of "docstring wider than 80 characters" warnings (will fix), but nothing in org-agenda.el. > except for a reference to the function `add-to-diary-list` which I > can't find anywhere (is it some old function that has disappeared, > maybe?). It looks like add-to-diary-list became an obsolete alias for diary-add-to-list in Emacs 23.1 and was removed in Emacs 25.1, specifically 3f65970414 (Remove calendar code obsolete since at least version 23.1, 2014-10-05).