emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: Using lexical-binding
Date: Tue, 23 Feb 2021 19:26:24 -0500	[thread overview]
Message-ID: <87k0qywbtb.fsf@kyleam.com> (raw)
In-Reply-To: <jwvblcapl1p.fsf-monnier+emacs@gnu.org>

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).


  reply	other threads:[~2021-02-24  0:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 21:11 Using lexical-binding Stefan Monnier
2021-02-24  0:26 ` Kyle Meyer [this message]
2021-02-24  3:44   ` Kyle Meyer
2021-02-24  4:01     ` Samuel Wales
2021-02-24  4:33   ` Stefan Monnier
2021-02-25  5:42     ` Kyle Meyer
2021-02-25  5:41 ` Kyle Meyer
2021-03-04  6:03   ` Kyle Meyer
2021-03-04  9:11     ` Marco Wahl
2021-03-06 16:10     ` Stefan Monnier
2021-03-06 17:08       ` Kyle Meyer
2021-03-06 22:33         ` Stefan Monnier
2021-03-09  5:35           ` Kyle Meyer
2021-03-09 14:09             ` Stefan Monnier
2021-03-10  4:16               ` Kyle Meyer
2021-03-10 16:32                 ` Stefan Monnier
2021-03-19 16:23                 ` Greg Minshall
2021-03-20  3:34                   ` Greg Minshall
2021-03-20  4:48                   ` Kyle Meyer
2021-03-20  5:33                     ` Greg Minshall
2021-03-21 16:04                       ` Kyle Meyer
2021-03-21 17:14                         ` Greg Minshall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0qywbtb.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).