[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using lexical-binding
From: |
Stefan Monnier |
Subject: |
Re: Using lexical-binding |
Date: |
Tue, 09 Mar 2021 09:09:30 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi Kyle,
>> Subject: [PATCH] * lisp/org-agenda.el: Use lexical-binding
> [...]
>> + (pcase type
>> + ('agenda
>> + (org-agenda-list current-prefix-arg))
>
> Unfortunately Org's minimum Emacs version is still Emacs 24.3.
Sorry 'bout that. I keep forgetting about this detail of `pcase` past.
Any chance you could put this in the `Package-Requires:`?
>> + (let* ((gprops (nth 1 series))
>> + (gvars (mapcar #'car gprops))
>> + (gvals (mapcar (lambda (binding) (eval (cadr binding) t)) gprops)))
>> + (cl-progv gvars gvals (org-agenda-prepare name))
>> + ;; We need to reset agenda markers here, because when constructing a
>> + ;; block agenda, the individual blocks do not do that.
>> + (org-agenda-reset-markers)
>> + (with-suppressed-warnings ((lexical match))
>
> ... I believe with-suppressed-warnings isn't available until Emacs 27.1,
> right?
Ooh, right, and that is not just a little detail, I very much know
about that. I don't have any excuse for this one (it's just
a careless copy&paste).
> Any objections to me squashing the below changes into your patch?
Of course not.
> +(if (fboundp 'with-suppressed-warnings) ; Introduced in Emacs 27.1.
> + (defalias 'org-with-suppressed-warnings 'with-suppressed-warnings)
> + (defmacro org-with-suppressed-warnings (_warnings &rest body)
> + (declare (debug (sexp &optional body)) (indent 1))
> + `(progn ,@body)))
Note that all the uses I introduced of `with-suppressed-warnings` only
wrap a very small amount of code, so you could also replace them with
`with-no-warnings` (added back in Emacs-22).
Stefan
- Re: Using lexical-binding, Kyle Meyer, 2021/03/04
- Re: Using lexical-binding, Marco Wahl, 2021/03/04
- Re: Using lexical-binding, Stefan Monnier, 2021/03/06
- Re: Using lexical-binding, Kyle Meyer, 2021/03/06
- Re: Using lexical-binding, Stefan Monnier, 2021/03/06
- Re: Using lexical-binding, Kyle Meyer, 2021/03/09
- Re: Using lexical-binding,
Stefan Monnier <=
- Re: Using lexical-binding, Kyle Meyer, 2021/03/09
- Re: Using lexical-binding, Stefan Monnier, 2021/03/10
- Re: Using lexical-binding, Greg Minshall, 2021/03/19
- Re: Using lexical-binding, Greg Minshall, 2021/03/19
- Re: Using lexical-binding, Kyle Meyer, 2021/03/20
- Re: Using lexical-binding, Greg Minshall, 2021/03/20
- Re: Using lexical-binding, Kyle Meyer, 2021/03/21
- Re: Using lexical-binding, Greg Minshall, 2021/03/21