* Saving some kitten, plus some questions along the way
@ 2024-05-18 15:22 Stefan Monnier
2024-05-19 11:56 ` Ihor Radchenko
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2024-05-18 15:22 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/markdown, Size: 414 bytes --]
The patch below replaces a use of `eval` with `apply`, but along the way
I wondered about some of the details of `org-eval-in-calendar` (see the
FIXMEs), the most important of them being: why doesn't it use
`with-selected-window`?
Assuming the change from `eval` to `apply` is OK, I'll upgrade my patch
with an appropriate commit message, but I'd first like to understand
better what's at stake.
Stefan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org.patch --]
[-- Type: text/x-diff, Size: 6935 bytes --]
diff --git a/lisp/org-keys.el b/lisp/org-keys.el
index 50e05efa1b..fc5fd53aa8 100644
--- a/lisp/org-keys.el
+++ b/lisp/org-keys.el
@@ -89,7 +89,6 @@
(declare-function org-emphasize "org" (&optional char))
(declare-function org-end-of-line "org" (&optional n))
(declare-function org-entry-put "org" (pom property value))
-(declare-function org-eval-in-calendar "org" (form &optional keepdate))
(declare-function org-calendar-goto-today-or-insert-dot "org" ())
(declare-function org-calendar-goto-today "org" ())
(declare-function org-calendar-backward-month "org" ())
@@ -390,9 +389,9 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names."
;;; Global bindings
;;;; Outline functions
-(define-key org-mode-map [menu-bar headings] 'undefined)
-(define-key org-mode-map [menu-bar hide] 'undefined)
-(define-key org-mode-map [menu-bar show] 'undefined)
+(define-key org-mode-map [menu-bar headings] #'undefined)
+(define-key org-mode-map [menu-bar hide] #'undefined)
+(define-key org-mode-map [menu-bar show] #'undefined)
(define-key org-mode-map [remap outline-mark-subtree] #'org-mark-subtree)
(define-key org-mode-map [remap outline-show-subtree] #'org-fold-show-subtree)
diff --git a/lisp/org.el b/lisp/org.el
index 4342ddd735..a95a67b829 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14009,13 +14009,15 @@ user."
(setq cal-frame
(window-frame (get-buffer-window calendar-buffer 'visible)))
(select-frame cal-frame))
- (org-eval-in-calendar '(setq cursor-type nil) t)
+ ;; FIXME: Could we use `with-current-buffer' or do we really
+ ;; need the `move-overlay' that's in `org-funcall-in-calendar'?
+ (org-funcall-in-calendar (lambda () (setq cursor-type nil)) t)
(unwind-protect
(progn
(calendar-forward-day (- (time-to-days org-def)
(calendar-absolute-from-gregorian
(calendar-current-date))))
- (org-eval-in-calendar nil t)
+ (org-funcall-in-calendar #'ignore t)
(let* ((old-map (current-local-map))
(map (copy-keymap calendar-mode-map))
(minibuffer-local-map
@@ -14398,13 +14400,14 @@ user function argument order change dependent on argument order."
(`european (list arg2 arg1 arg3))
(`iso (list arg2 arg3 arg1))))
-(defun org-eval-in-calendar (form &optional keepdate)
- "Eval FORM in the calendar window and return to current window.
+(defun org-funcall-in-calendar (func &optional keepdate &rest args)
+ "Call FUNC in the calendar window and return to current window.
Unless KEEPDATE is non-nil, update `org-ans2' to the cursor date."
(let ((sf (selected-frame))
(sw (selected-window)))
+ ;; FIXME: Use `with-selected-window'?
(select-window (get-buffer-window calendar-buffer t))
- (eval form t)
+ (apply func args)
(when (and (not keepdate) (calendar-cursor-to-date))
(let* ((date (calendar-cursor-to-date))
(time (org-encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
@@ -14413,6 +14416,10 @@ Unless KEEPDATE is non-nil, update `org-ans2' to the cursor date."
(select-window sw)
(select-frame-set-input-focus sf)))
+(defun org-eval-in-calendar (func &optional keepdate)
+ (declare (obsolete org-funcall-in-calendar "2024"))
+ (org-funcall-in-calendar (lambda () (eval form t)) keepdate))
+
(defun org-calendar-goto-today-or-insert-dot ()
"Go to the current date, or insert a dot.
@@ -14423,81 +14430,81 @@ insert \".\"."
(if (looking-back "^[^:]+: "
(let ((inhibit-field-text-motion t))
(line-beginning-position)))
- (org-eval-in-calendar '(calendar-goto-today))
+ (org-funcall-in-calendar #'calendar-goto-today)
(insert ".")))
(defun org-calendar-goto-today ()
"Reposition the calendar window so the current date is visible."
(interactive)
- (org-eval-in-calendar '(calendar-goto-today)))
+ (org-funcall-in-calendar #'calendar-goto-today))
(defun org-calendar-backward-month ()
"Move the cursor backward by one month."
(interactive)
- (org-eval-in-calendar '(calendar-backward-month 1)))
+ (org-funcall-in-calendar #'calendar-backward-month nil 1))
(defun org-calendar-forward-month ()
"Move the cursor forward by one month."
(interactive)
- (org-eval-in-calendar '(calendar-forward-month 1)))
+ (org-funcall-in-calendar #'calendar-forward-month nil 1))
(defun org-calendar-backward-year ()
"Move the cursor backward by one year."
(interactive)
- (org-eval-in-calendar '(calendar-backward-year 1)))
+ (org-funcall-in-calendar #'calendar-backward-year nil 1))
(defun org-calendar-forward-year ()
"Move the cursor forward by one year."
(interactive)
- (org-eval-in-calendar '(calendar-forward-year 1)))
+ (org-funcall-in-calendar #'calendar-forward-year nil 1))
(defun org-calendar-backward-week ()
"Move the cursor backward by one week."
(interactive)
- (org-eval-in-calendar '(calendar-backward-week 1)))
+ (org-funcall-in-calendar #'calendar-backward-week nil 1))
(defun org-calendar-forward-week ()
"Move the cursor forward by one week."
(interactive)
- (org-eval-in-calendar '(calendar-forward-week 1)))
+ (org-funcall-in-calendar #'calendar-forward-week nil 1))
(defun org-calendar-backward-day ()
"Move the cursor backward by one day."
(interactive)
- (org-eval-in-calendar '(calendar-backward-day 1)))
+ (org-funcall-in-calendar #'calendar-backward-day nil 1))
(defun org-calendar-forward-day ()
"Move the cursor forward by one day."
(interactive)
- (org-eval-in-calendar '(calendar-forward-day 1)))
+ (org-funcall-in-calendar #'calendar-forward-day nil 1))
(defun org-calendar-view-entries ()
"Prepare and display a buffer with diary entries."
(interactive)
- (org-eval-in-calendar '(diary-view-entries))
+ (org-funcall-in-calendar #'diary-view-entries)
(message ""))
(defun org-calendar-scroll-month-left ()
"Scroll the displayed calendar left by one month."
(interactive)
- (org-eval-in-calendar '(calendar-scroll-left 1)))
+ (org-funcall-in-calendar #'calendar-scroll-left nil 1))
(defun org-calendar-scroll-month-right ()
"Scroll the displayed calendar right by one month."
(interactive)
- (org-eval-in-calendar '(calendar-scroll-right 1)))
+ (org-funcall-in-calendar #'calendar-scroll-right nil 1))
(defun org-calendar-scroll-three-months-left ()
"Scroll the displayed calendar left by three months."
(interactive)
- (org-eval-in-calendar
- '(calendar-scroll-left-three-months 1)))
+ (org-funcall-in-calendar
+ #'calendar-scroll-left-three-months nil 1))
(defun org-calendar-scroll-three-months-right ()
"Scroll the displayed calendar right by three months."
(interactive)
- (org-eval-in-calendar
- '(calendar-scroll-right-three-months 1)))
+ (org-funcall-in-calendar
+ #'calendar-scroll-right-three-months nil 1))
(defun org-calendar-select ()
"Return to `org-read-date' with the date currently selected.
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: Saving some kitten, plus some questions along the way
2024-05-18 15:22 Saving some kitten, plus some questions along the way Stefan Monnier
@ 2024-05-19 11:56 ` Ihor Radchenko
2024-05-19 14:40 ` Stefan Monnier
0 siblings, 1 reply; 8+ messages in thread
From: Ihor Radchenko @ 2024-05-19 11:56 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-orgmode
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> The patch below replaces a use of `eval` with `apply`, but along the way
> I wondered about some of the details of `org-eval-in-calendar` (see the
> FIXMEs), the most important of them being: why doesn't it use
> `with-selected-window`?
Thanks!
I do not see any clear reason. Just old code from early days of Org mode.
> - (org-eval-in-calendar '(setq cursor-type nil) t)
> + ;; FIXME: Could we use `with-current-buffer' or do we really
> + ;; need the `move-overlay' that's in `org-funcall-in-calendar'?
> + (org-funcall-in-calendar (lambda () (setq cursor-type nil)) t)
`move-overlay' is important - this is additional decoration that Org
mode uses to indicate "current" date in the calendar while the focus is
on other window and the cursor may not be clearly visible.
> -(defun org-eval-in-calendar (form &optional keepdate)
> - "Eval FORM in the calendar window and return to current window.
> +(defun org-funcall-in-calendar (func &optional keepdate &rest args)
> + "Call FUNC in the calendar window and return to current window.
Why not a macro? Having to write lambda may be awkward.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Saving some kitten, plus some questions along the way
2024-05-19 11:56 ` Ihor Radchenko
@ 2024-05-19 14:40 ` Stefan Monnier
2024-05-19 14:45 ` Ihor Radchenko
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2024-05-19 14:40 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode
>> - (org-eval-in-calendar '(setq cursor-type nil) t)
>> + ;; FIXME: Could we use `with-current-buffer' or do we really
>> + ;; need the `move-overlay' that's in `org-funcall-in-calendar'?
>> + (org-funcall-in-calendar (lambda () (setq cursor-type nil)) t)
>
> `move-overlay' is important - this is additional decoration that Org
> mode uses to indicate "current" date in the calendar while the focus is
> on other window and the cursor may not be clearly visible.
I understand it's important in general, but the question is for this
specific use of `org-funcall-in-calendar` where all we do (apparently)
is to set `cursor-type` which shouldn't require any change to the
overlay (nor does it require to `select-window`), or should it?
Along the same lines, maybe:
(progn
(calendar-forward-day (- (time-to-days org-def)
(calendar-absolute-from-gregorian
(calendar-current-date))))
(org-funcall-in-calendar #'ignore t)
(let* ((old-map (current-local-map))
(map (copy-keymap calendar-mode-map))
(minibuffer-local-map
should turn into something like:
(let ((days (- (time-to-days org-def)
(calendar-absolute-from-gregorian
(calendar-current-date)))))
(org-funcall-in-calendar #'calendar-forward-day t days)
(let* ((old-map (current-local-map))
(map (copy-keymap calendar-mode-map))
(minibuffer-local-map
so it's clear why we need to use `org-funcall-in-calendar`?
>> -(defun org-eval-in-calendar (form &optional keepdate)
>> - "Eval FORM in the calendar window and return to current window.
>> +(defun org-funcall-in-calendar (func &optional keepdate &rest args)
>> + "Call FUNC in the calendar window and return to current window.
> Why not a macro? Having to write lambda may be awkward.
[ Hmm... in my book, writing `lambda` should not be considered awkward. ]
So far there are only two uses of `org-funcall-in-calendar` which go
through `lambda`, one of them is quoted and discussed above and the
other is the backward compatibility wrapper `org-eval-in-calendar`, so
I'm not sure it's worth the trouble. But if you want, I can include
a macro for it, of course.
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Saving some kitten, plus some questions along the way
2024-05-19 14:40 ` Stefan Monnier
@ 2024-05-19 14:45 ` Ihor Radchenko
2024-05-19 21:24 ` Stefan Monnier
0 siblings, 1 reply; 8+ messages in thread
From: Ihor Radchenko @ 2024-05-19 14:45 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-orgmode
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> - (org-eval-in-calendar '(setq cursor-type nil) t)
>>> + ;; FIXME: Could we use `with-current-buffer' or do we really
>>> + ;; need the `move-overlay' that's in `org-funcall-in-calendar'?
>>> + (org-funcall-in-calendar (lambda () (setq cursor-type nil)) t)
>>
>> `move-overlay' is important - this is additional decoration that Org
>> mode uses to indicate "current" date in the calendar while the focus is
>> on other window and the cursor may not be clearly visible.
>
> I understand it's important in general, but the question is for this
> specific use of `org-funcall-in-calendar` where all we do (apparently)
> is to set `cursor-type` which shouldn't require any change to the
> overlay (nor does it require to `select-window`), or should it?
No, it should not, and it does not require `select-window'.
> Along the same lines, maybe:
>
> (progn
> (calendar-forward-day (- (time-to-days org-def)
> (calendar-absolute-from-gregorian
> (calendar-current-date))))
> (org-funcall-in-calendar #'ignore t)
> (let* ((old-map (current-local-map))
> (map (copy-keymap calendar-mode-map))
> (minibuffer-local-map
>
> should turn into something like:
>
> (let ((days (- (time-to-days org-def)
> (calendar-absolute-from-gregorian
> (calendar-current-date)))))
> (org-funcall-in-calendar #'calendar-forward-day t days)
> (let* ((old-map (current-local-map))
> (map (copy-keymap calendar-mode-map))
> (minibuffer-local-map
>
> so it's clear why we need to use `org-funcall-in-calendar`?
Yes. Looks reasonable.
>>> -(defun org-eval-in-calendar (form &optional keepdate)
>>> - "Eval FORM in the calendar window and return to current window.
>>> +(defun org-funcall-in-calendar (func &optional keepdate &rest args)
>>> + "Call FUNC in the calendar window and return to current window.
>> Why not a macro? Having to write lambda may be awkward.
>
> [ Hmm... in my book, writing `lambda` should not be considered awkward. ]
>
> So far there are only two uses of `org-funcall-in-calendar` which go
> through `lambda`, one of them is quoted and discussed above and the
> other is the backward compatibility wrapper `org-eval-in-calendar`, so
> I'm not sure it's worth the trouble. But if you want, I can include
> a macro for it, of course.
Not necessary. Lambda is also ok, I just slightly prefer macro.
The only reason why I call lambda "awkward" is because it is more
typing.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Saving some kitten, plus some questions along the way
2024-05-19 14:45 ` Ihor Radchenko
@ 2024-05-19 21:24 ` Stefan Monnier
2024-05-20 11:10 ` Ihor Radchenko
2024-05-21 10:55 ` Max Nikulin
0 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2024-05-19 21:24 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 565 bytes --]
>> I understand it's important in general, but the question is for this
>> specific use of `org-funcall-in-calendar` where all we do (apparently)
>> is to set `cursor-type` which shouldn't require any change to the
>> overlay (nor does it require to `select-window`), or should it?
> No, it should not, and it does not require `select-window'.
OK, changed it to `with-current-buffer`.
I pushed the resulting patch (along with three other patches resulting
from running the tests) to `scratch/org` on `elpa.git`.
You can also find them attached,
Stefan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-in-calendar-Prefer-apply-to-eval.patch --]
[-- Type: text/x-diff, Size: 8209 bytes --]
From 30f64453a570004524de07aa352f7c631414df7c Mon Sep 17 00:00:00 2001
From: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Sun, 19 May 2024 17:12:36 -0400
Subject: [PATCH 1/4] (org-*-in-calendar): Prefer `apply` to `eval
* lisp/org.el (org-funcall-in-calendar): Rename from `org-eval-in-calendar`.
Use `apply` rather than `eval`. Use `with-selected-window` rather than
cooking our own version of it. Update all callers.
(org-read-date): Use `with-current-buffer` to set `cursor-type` since
it's not affected by the selected window.
Move the `calendar-forward-day` call to `org-funcall-in-calendar` to
clarify the need to update `org-date-ovl`.
(org-eval-in-calendar): New backward compatibility function.
* lisp/org-keys.el (org-eval-in-calendar): Remove unused declaration.
---
lisp/org-keys.el | 7 +++--
lisp/org.el | 66 +++++++++++++++++++++++++-----------------------
2 files changed, 37 insertions(+), 36 deletions(-)
diff --git a/lisp/org-keys.el b/lisp/org-keys.el
index 50e05efa1b..fc5fd53aa8 100644
--- a/lisp/org-keys.el
+++ b/lisp/org-keys.el
@@ -89,7 +89,6 @@
(declare-function org-emphasize "org" (&optional char))
(declare-function org-end-of-line "org" (&optional n))
(declare-function org-entry-put "org" (pom property value))
-(declare-function org-eval-in-calendar "org" (form &optional keepdate))
(declare-function org-calendar-goto-today-or-insert-dot "org" ())
(declare-function org-calendar-goto-today "org" ())
(declare-function org-calendar-backward-month "org" ())
@@ -390,9 +389,9 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names."
;;; Global bindings
;;;; Outline functions
-(define-key org-mode-map [menu-bar headings] 'undefined)
-(define-key org-mode-map [menu-bar hide] 'undefined)
-(define-key org-mode-map [menu-bar show] 'undefined)
+(define-key org-mode-map [menu-bar headings] #'undefined)
+(define-key org-mode-map [menu-bar hide] #'undefined)
+(define-key org-mode-map [menu-bar show] #'undefined)
(define-key org-mode-map [remap outline-mark-subtree] #'org-mark-subtree)
(define-key org-mode-map [remap outline-show-subtree] #'org-fold-show-subtree)
diff --git a/lisp/org.el b/lisp/org.el
index 4342ddd735..9604887623 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14009,13 +14009,15 @@ user."
(setq cal-frame
(window-frame (get-buffer-window calendar-buffer 'visible)))
(select-frame cal-frame))
- (org-eval-in-calendar '(setq cursor-type nil) t)
+ ;; FIXME: Not sure we need `with-current-buffer' but I couldn't
+ ;; convince myself that we're always in `calendar-buffer' after
+ ;; the call to `calendar'.
+ (with-current-buffer calendar-buffer (setq cursor-type nil))
(unwind-protect
- (progn
- (calendar-forward-day (- (time-to-days org-def)
- (calendar-absolute-from-gregorian
- (calendar-current-date))))
- (org-eval-in-calendar nil t)
+ (let ((days (- (time-to-days org-def)
+ (calendar-absolute-from-gregorian
+ (calendar-current-date)))))
+ (org-funcall-in-calendar #'calendar-forward-day t days)
(let* ((old-map (current-local-map))
(map (copy-keymap calendar-mode-map))
(minibuffer-local-map
@@ -14398,20 +14400,20 @@ user function argument order change dependent on argument order."
(`european (list arg2 arg1 arg3))
(`iso (list arg2 arg3 arg1))))
-(defun org-eval-in-calendar (form &optional keepdate)
- "Eval FORM in the calendar window and return to current window.
+(defun org-funcall-in-calendar (func &optional keepdate &rest args)
+ "Call FUNC in the calendar window and return to current window.
Unless KEEPDATE is non-nil, update `org-ans2' to the cursor date."
- (let ((sf (selected-frame))
- (sw (selected-window)))
- (select-window (get-buffer-window calendar-buffer t))
- (eval form t)
+ (with-selected-window (get-buffer-window calendar-buffer t)
+ (apply func args)
(when (and (not keepdate) (calendar-cursor-to-date))
(let* ((date (calendar-cursor-to-date))
(time (org-encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
(setq org-ans2 (format-time-string "%Y-%m-%d" time))))
- (move-overlay org-date-ovl (1- (point)) (1+ (point)) (current-buffer))
- (select-window sw)
- (select-frame-set-input-focus sf)))
+ (move-overlay org-date-ovl (1- (point)) (1+ (point)) (current-buffer))))
+
+(defun org-eval-in-calendar (form &optional keepdate)
+ (declare (obsolete org-funcall-in-calendar "2024"))
+ (org-funcall-in-calendar (lambda () (eval form t)) keepdate))
(defun org-calendar-goto-today-or-insert-dot ()
"Go to the current date, or insert a dot.
@@ -14423,81 +14425,81 @@ insert \".\"."
(if (looking-back "^[^:]+: "
(let ((inhibit-field-text-motion t))
(line-beginning-position)))
- (org-eval-in-calendar '(calendar-goto-today))
+ (org-funcall-in-calendar #'calendar-goto-today)
(insert ".")))
(defun org-calendar-goto-today ()
"Reposition the calendar window so the current date is visible."
(interactive)
- (org-eval-in-calendar '(calendar-goto-today)))
+ (org-funcall-in-calendar #'calendar-goto-today))
(defun org-calendar-backward-month ()
"Move the cursor backward by one month."
(interactive)
- (org-eval-in-calendar '(calendar-backward-month 1)))
+ (org-funcall-in-calendar #'calendar-backward-month nil 1))
(defun org-calendar-forward-month ()
"Move the cursor forward by one month."
(interactive)
- (org-eval-in-calendar '(calendar-forward-month 1)))
+ (org-funcall-in-calendar #'calendar-forward-month nil 1))
(defun org-calendar-backward-year ()
"Move the cursor backward by one year."
(interactive)
- (org-eval-in-calendar '(calendar-backward-year 1)))
+ (org-funcall-in-calendar #'calendar-backward-year nil 1))
(defun org-calendar-forward-year ()
"Move the cursor forward by one year."
(interactive)
- (org-eval-in-calendar '(calendar-forward-year 1)))
+ (org-funcall-in-calendar #'calendar-forward-year nil 1))
(defun org-calendar-backward-week ()
"Move the cursor backward by one week."
(interactive)
- (org-eval-in-calendar '(calendar-backward-week 1)))
+ (org-funcall-in-calendar #'calendar-backward-week nil 1))
(defun org-calendar-forward-week ()
"Move the cursor forward by one week."
(interactive)
- (org-eval-in-calendar '(calendar-forward-week 1)))
+ (org-funcall-in-calendar #'calendar-forward-week nil 1))
(defun org-calendar-backward-day ()
"Move the cursor backward by one day."
(interactive)
- (org-eval-in-calendar '(calendar-backward-day 1)))
+ (org-funcall-in-calendar #'calendar-backward-day nil 1))
(defun org-calendar-forward-day ()
"Move the cursor forward by one day."
(interactive)
- (org-eval-in-calendar '(calendar-forward-day 1)))
+ (org-funcall-in-calendar #'calendar-forward-day nil 1))
(defun org-calendar-view-entries ()
"Prepare and display a buffer with diary entries."
(interactive)
- (org-eval-in-calendar '(diary-view-entries))
+ (org-funcall-in-calendar #'diary-view-entries)
(message ""))
(defun org-calendar-scroll-month-left ()
"Scroll the displayed calendar left by one month."
(interactive)
- (org-eval-in-calendar '(calendar-scroll-left 1)))
+ (org-funcall-in-calendar #'calendar-scroll-left nil 1))
(defun org-calendar-scroll-month-right ()
"Scroll the displayed calendar right by one month."
(interactive)
- (org-eval-in-calendar '(calendar-scroll-right 1)))
+ (org-funcall-in-calendar #'calendar-scroll-right nil 1))
(defun org-calendar-scroll-three-months-left ()
"Scroll the displayed calendar left by three months."
(interactive)
- (org-eval-in-calendar
- '(calendar-scroll-left-three-months 1)))
+ (org-funcall-in-calendar
+ #'calendar-scroll-left-three-months nil 1))
(defun org-calendar-scroll-three-months-right ()
"Scroll the displayed calendar right by three months."
(interactive)
- (org-eval-in-calendar
- '(calendar-scroll-right-three-months 1)))
+ (org-funcall-in-calendar
+ #'calendar-scroll-right-three-months nil 1))
(defun org-calendar-select ()
"Return to `org-read-date' with the date currently selected.
--
2.39.2
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-mk-default.mk-BTEST-Remove-l-cl.patch --]
[-- Type: text/x-diff, Size: 1876 bytes --]
From 3bb14f3c7065c42b310a7d761be3a0d369cda334 Mon Sep 17 00:00:00 2001
From: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Sun, 19 May 2024 17:15:21 -0400
Subject: [PATCH 2/4] mk/default.mk (BTEST): Remove `-l cl`
The CL library is deprecated and it's not needed here any more.
I suspect other `-l` could be removed here since `org-test` loads
those libraries anyway.
---
mk/default.mk | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/mk/default.mk b/mk/default.mk
index 979a6c07e6..4690ef035b 100644
--- a/mk/default.mk
+++ b/mk/default.mk
@@ -78,20 +78,20 @@ BTEST_LOAD = \
--eval '(add-to-list `load-path (concat default-directory "testing"))'
BTEST_INIT = $(BTEST_PRE) $(BTEST_LOAD) $(BTEST_POST)
-BTEST = $(BATCH) $(BTEST_INIT) \
- -l org-batch-test-init \
- --eval '(setq \
- org-batch-test t \
- org-babel-load-languages \
- (quote ($(foreach ob-lang,\
- $(BTEST_OB_LANGUAGES) emacs-lisp shell org,\
- $(lst-ob-lang)))) \
- org-test-select-re "$(BTEST_RE)" \
- )' \
- -l org-loaddefs.el \
- -l cl -l testing/org-test.el \
- -l ert -l org -l ox -l ol \
- $(foreach req,$(BTEST_EXTRA),$(req-extra)) \
+BTEST = $(BATCH) $(BTEST_INIT) \
+ -l org-batch-test-init \
+ --eval '(setq \
+ org-batch-test t \
+ org-babel-load-languages \
+ (quote ($(foreach ob-lang, \
+ $(BTEST_OB_LANGUAGES) emacs-lisp shell org, \
+ $(lst-ob-lang)))) \
+ org-test-select-re "$(BTEST_RE)" \
+ )' \
+ -l org-loaddefs.el \
+ -l testing/org-test.el \
+ -l ert -l org -l ox -l ol \
+ $(foreach req,$(BTEST_EXTRA),$(req-extra)) \
--eval '(org-test-run-batch-tests org-test-select-re)'
# Running a plain emacs with no config and this Org mode loaded. This
--
2.39.2
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-testing-org-test.el-toplevel-Remove-dead-code.patch --]
[-- Type: text/x-diff, Size: 1835 bytes --]
From f471f5b16c4ebf2f079779e5691e38aae9a6b705 Mon Sep 17 00:00:00 2001
From: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Sun, 19 May 2024 17:18:08 -0400
Subject: [PATCH 3/4] testing/org-test.el (<toplevel>): Remove dead code
(featurep 'org) is always non-nil here since we have a (require 'org)
further up. I suspect other `require`s nearby could be removed or
moved to toplevel.
---
testing/org-test.el | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
diff --git a/testing/org-test.el b/testing/org-test.el
index d9fe33284c..8060e1d210 100644
--- a/testing/org-test.el
+++ b/testing/org-test.el
@@ -48,25 +48,16 @@
(file-name-directory
(or load-file-name buffer-file-name))))
(org-lisp-dir (expand-file-name
- (concat org-test-dir "../lisp"))))
-
- (unless (featurep 'org)
- (setq load-path (cons org-lisp-dir load-path))
- (require 'org)
- (require 'org-id)
- (require 'ox)
- (org-babel-do-load-languages
- 'org-babel-load-languages '((shell . t) (org . t))))
-
- (let ((load-path (cons org-test-dir
- (cons (expand-file-name "jump" org-test-dir)
- load-path))))
- (require 'cl-lib)
- (require 'ert)
- (require 'ert-x)
- (when (file-exists-p (expand-file-name "jump/jump.el" org-test-dir))
- (require 'jump)
- (require 'which-func)))))
+ (concat org-test-dir "../lisp")))
+ (load-path (cons org-test-dir
+ (cons (expand-file-name "jump" org-test-dir)
+ load-path))))
+ (require 'cl-lib)
+ (require 'ert)
+ (require 'ert-x)
+ (when (file-exists-p (expand-file-name "jump/jump.el" org-test-dir))
+ (require 'jump)
+ (require 'which-func))))
(defconst org-test-default-test-file-name "tests.el"
"For each defun a separate file with tests may be defined.
--
2.39.2
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0004-testing-lisp-.el-Fix-second-arg-to-signal.patch --]
[-- Type: text/x-diff, Size: 15484 bytes --]
From dc62e4a1f943f7ca49b3075d9160dc19856fae7b Mon Sep 17 00:00:00 2001
From: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Sun, 19 May 2024 17:19:51 -0400
Subject: [PATCH 4/4] testing/lisp/*.el: Fix second arg to `signal`
The second argument to `signal` should be a list, as explained in its
docstring. Fix `missing-test-dependency` signals accordingly.
---
testing/lisp/test-ob-C.el | 2 +-
testing/lisp/test-ob-R.el | 4 ++--
testing/lisp/test-ob-awk.el | 2 +-
testing/lisp/test-ob-calc.el | 2 +-
testing/lisp/test-ob-clojure.el | 2 +-
testing/lisp/test-ob-eshell.el | 2 +-
testing/lisp/test-ob-fortran.el | 2 +-
testing/lisp/test-ob-haskell-ghci.el | 4 ++--
testing/lisp/test-ob-java.el | 2 +-
testing/lisp/test-ob-julia.el | 4 ++--
testing/lisp/test-ob-lua.el | 2 +-
testing/lisp/test-ob-maxima.el | 2 +-
testing/lisp/test-ob-octave.el | 2 +-
testing/lisp/test-ob-perl.el | 2 +-
testing/lisp/test-ob-python.el | 2 +-
testing/lisp/test-ob-ruby.el | 4 ++--
testing/lisp/test-ob-scheme.el | 6 +++---
testing/lisp/test-ob-sed.el | 2 +-
testing/lisp/test-ob-shell.el | 2 +-
testing/lisp/test-ob-sql.el | 2 +-
testing/lisp/test-ob-sqlite.el | 2 +-
testing/lisp/test-org-ctags.el | 2 +-
testing/lisp/test-org-tempo.el | 2 +-
testing/lisp/test-ox-ascii.el | 2 +-
testing/lisp/test-ox-beamer.el | 2 +-
testing/lisp/test-ox-latex.el | 2 +-
testing/lisp/test-ox-texinfo.el | 2 +-
27 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/testing/lisp/test-ob-C.el b/testing/lisp/test-ob-C.el
index c70534a51f..5399aed122 100644
--- a/testing/lisp/test-ob-C.el
+++ b/testing/lisp/test-ob-C.el
@@ -20,7 +20,7 @@
;;; Code:
(unless (featurep 'ob-C)
- (signal 'missing-test-dependency "Support for C code blocks"))
+ (signal 'missing-test-dependency '("Support for C code blocks")))
(ert-deftest ob-C/simple-program ()
"Hello world program."
diff --git a/testing/lisp/test-ob-R.el b/testing/lisp/test-ob-R.el
index 9ffbf3afd9..0d291bf543 100644
--- a/testing/lisp/test-ob-R.el
+++ b/testing/lisp/test-ob-R.el
@@ -22,7 +22,7 @@
(org-test-for-executable "R")
(require 'ob-core)
(unless (featurep 'ess)
- (signal 'missing-test-dependency "ESS"))
+ (signal 'missing-test-dependency '("ESS")))
(defvar ess-ask-for-ess-directory)
(defvar ess-history-file)
(defvar ess-r-post-run-hook)
@@ -32,7 +32,7 @@
(declare-function ess-calculate-width "ext:ess-inf" (opt))
(unless (featurep 'ob-R)
- (signal 'missing-test-dependency "Support for R code blocks"))
+ (signal 'missing-test-dependency '("Support for R code blocks")))
(ert-deftest test-ob-R/simple-session ()
(let (ess-ask-for-ess-directory ess-history-file)
diff --git a/testing/lisp/test-ob-awk.el b/testing/lisp/test-ob-awk.el
index 874d2c0268..b3a2a50fce 100644
--- a/testing/lisp/test-ob-awk.el
+++ b/testing/lisp/test-ob-awk.el
@@ -21,7 +21,7 @@
;;; Code:
(org-test-for-executable "awk")
(unless (featurep 'ob-awk)
- (signal 'missing-test-dependency "Support for Awk code blocks"))
+ (signal 'missing-test-dependency '("Support for Awk code blocks")))
(ert-deftest ob-awk/input-none ()
"Test with no input file"
diff --git a/testing/lisp/test-ob-calc.el b/testing/lisp/test-ob-calc.el
index 12f97279f6..f6e8a5a2fd 100644
--- a/testing/lisp/test-ob-calc.el
+++ b/testing/lisp/test-ob-calc.el
@@ -21,7 +21,7 @@
(require 'ob-calc)
(unless (featurep 'ob-calc)
- (signal 'missing-test-dependency "Support for Calc code blocks"))
+ (signal 'missing-test-dependency '("Support for Calc code blocks")))
(ert-deftest ob-calc/simple-program-mult ()
"Test of simple multiplication."
diff --git a/testing/lisp/test-ob-clojure.el b/testing/lisp/test-ob-clojure.el
index 33052c98c9..4836917b3a 100644
--- a/testing/lisp/test-ob-clojure.el
+++ b/testing/lisp/test-ob-clojure.el
@@ -25,7 +25,7 @@
;;; Code:
(unless (featurep 'ob-clojure)
- (signal 'missing-test-dependency "Support for Clojure code blocks"))
+ (signal 'missing-test-dependency '("Support for Clojure code blocks")))
;; FIXME: The old tests where totally off. We need to write new tests.
diff --git a/testing/lisp/test-ob-eshell.el b/testing/lisp/test-ob-eshell.el
index 0d704b16a3..5d0da8d991 100644
--- a/testing/lisp/test-ob-eshell.el
+++ b/testing/lisp/test-ob-eshell.el
@@ -24,7 +24,7 @@
;;; Code:
(unless (featurep 'ob-eshell)
- (signal 'missing-test-dependency "Support for Eshell code blocks"))
+ (signal 'missing-test-dependency '("Support for Eshell code blocks")))
(ert-deftest ob-eshell/execute ()
"Test ob-eshell execute."
diff --git a/testing/lisp/test-ob-fortran.el b/testing/lisp/test-ob-fortran.el
index 4947d142b7..209a966b16 100644
--- a/testing/lisp/test-ob-fortran.el
+++ b/testing/lisp/test-ob-fortran.el
@@ -21,7 +21,7 @@
;;; Code:
(org-test-for-executable "gfortran")
(unless (featurep 'ob-fortran)
- (signal 'missing-test-dependency "Support for Fortran code blocks"))
+ (signal 'missing-test-dependency '("Support for Fortran code blocks")))
(ert-deftest ob-fortran/simple-program ()
"Test of hello world program."
diff --git a/testing/lisp/test-ob-haskell-ghci.el b/testing/lisp/test-ob-haskell-ghci.el
index 990addcd44..6eca0a141a 100644
--- a/testing/lisp/test-ob-haskell-ghci.el
+++ b/testing/lisp/test-ob-haskell-ghci.el
@@ -32,9 +32,9 @@
(require 'org-test "../testing/org-test")
(org-test-for-executable "ghci")
(unless (featurep 'haskell-mode)
- (signal 'missing-test-dependency "haskell-mode"))
+ (signal 'missing-test-dependency '("haskell-mode")))
(unless (featurep 'haskell)
- (signal 'missing-test-dependency "haskell"))
+ (signal 'missing-test-dependency '("haskell")))
;;; Helpers
diff --git a/testing/lisp/test-ob-java.el b/testing/lisp/test-ob-java.el
index e0c19fe03c..5f00917e51 100644
--- a/testing/lisp/test-ob-java.el
+++ b/testing/lisp/test-ob-java.el
@@ -27,7 +27,7 @@
;; ob-java is needed for linter tests as well. org-lint relies on
;; default header arg value.
(unless (featurep 'ob-java)
- (signal 'missing-test-dependency "Support for java code blocks"))
+ (signal 'missing-test-dependency '("Support for java code blocks")))
;;; No Java required
diff --git a/testing/lisp/test-ob-julia.el b/testing/lisp/test-ob-julia.el
index 4472972624..c0d21fbd85 100644
--- a/testing/lisp/test-ob-julia.el
+++ b/testing/lisp/test-ob-julia.el
@@ -23,9 +23,9 @@
(org-test-for-executable "julia")
(require 'ob-core)
(unless (featurep 'ob-julia)
- (signal 'missing-test-dependency "Support for julia code blocks"))
+ (signal 'missing-test-dependency '("Support for julia code blocks")))
(unless (featurep 'ess)
- (signal 'missing-test-dependency "ESS"))
+ (signal 'missing-test-dependency '("ESS")))
(ert-deftest test-ob-julia/colnames-yes-header-argument ()
(should
diff --git a/testing/lisp/test-ob-lua.el b/testing/lisp/test-ob-lua.el
index 0a60c68caf..864d5107a3 100644
--- a/testing/lisp/test-ob-lua.el
+++ b/testing/lisp/test-ob-lua.el
@@ -20,7 +20,7 @@
;;; Code:
(unless (featurep 'ob-lua)
- (signal 'missing-test-dependency "Support for Lua code blocks"))
+ (signal 'missing-test-dependency '("Support for Lua code blocks")))
(ert-deftest test-ob-lua/simple-value ()
"Test associative array return by value."
diff --git a/testing/lisp/test-ob-maxima.el b/testing/lisp/test-ob-maxima.el
index 653ed40417..4320c46137 100644
--- a/testing/lisp/test-ob-maxima.el
+++ b/testing/lisp/test-ob-maxima.el
@@ -20,7 +20,7 @@
(org-test-for-executable "maxima")
(unless (featurep 'ob-maxima)
- (signal 'missing-test-dependency "Support for Maxima code blocks"))
+ (signal 'missing-test-dependency '("Support for Maxima code blocks")))
(ert-deftest ob-maxima/integer-input ()
"Test of integer input"
diff --git a/testing/lisp/test-ob-octave.el b/testing/lisp/test-ob-octave.el
index dfcfc01906..3c58fad741 100644
--- a/testing/lisp/test-ob-octave.el
+++ b/testing/lisp/test-ob-octave.el
@@ -20,7 +20,7 @@
(org-test-for-executable "octave")
(unless (featurep 'ob-octave)
- (signal 'missing-test-dependency "Support for Octave code blocks"))
+ (signal 'missing-test-dependency '("Support for Octave code blocks")))
(ert-deftest ob-octave/input-none ()
"Number output"
diff --git a/testing/lisp/test-ob-perl.el b/testing/lisp/test-ob-perl.el
index 5826e8cca2..e079d09d9b 100644
--- a/testing/lisp/test-ob-perl.el
+++ b/testing/lisp/test-ob-perl.el
@@ -21,7 +21,7 @@
;;; Code:
(org-test-for-executable "perl")
(unless (featurep 'ob-perl)
- (signal 'missing-test-dependency "Support for perl code blocks"))
+ (signal 'missing-test-dependency '("Support for perl code blocks")))
(ert-deftest test-ob-perl/simple-output ()
(org-test-with-temp-text "
diff --git a/testing/lisp/test-ob-python.el b/testing/lisp/test-ob-python.el
index e3c6a40096..9ee76f2a8d 100644
--- a/testing/lisp/test-ob-python.el
+++ b/testing/lisp/test-ob-python.el
@@ -22,7 +22,7 @@
(org-test-for-executable "python")
(require 'ob-core)
(unless (featurep 'ob-python)
- (signal 'missing-test-dependency "Support for Python code blocks"))
+ (signal 'missing-test-dependency '("Support for Python code blocks")))
(ert-deftest test-ob-python/colnames-yes-header-argument ()
(should
diff --git a/testing/lisp/test-ob-ruby.el b/testing/lisp/test-ob-ruby.el
index 2e4cd020be..27f96f6da3 100644
--- a/testing/lisp/test-ob-ruby.el
+++ b/testing/lisp/test-ob-ruby.el
@@ -19,9 +19,9 @@
;;; Code:
(org-test-for-executable "ruby")
(unless (featurep 'ob-ruby)
- (signal 'missing-test-dependency "Support for Ruby code blocks"))
+ (signal 'missing-test-dependency '("Support for Ruby code blocks")))
(unless (featurep 'inf-ruby)
- (signal 'missing-test-dependency "inf-ruby"))
+ (signal 'missing-test-dependency '("inf-ruby")))
(ert-deftest test-ob-ruby/session-output-1 ()
(should (equal (org-test-with-temp-text "#+begin_src ruby :session org-test-ruby :results output
diff --git a/testing/lisp/test-ob-scheme.el b/testing/lisp/test-ob-scheme.el
index 3e9a4707c1..79ce2b4537 100644
--- a/testing/lisp/test-ob-scheme.el
+++ b/testing/lisp/test-ob-scheme.el
@@ -24,11 +24,11 @@
;;; Code:
(unless (featurep 'ob-scheme)
- (signal 'missing-test-dependency "Support for Scheme code blocks"))
+ (signal 'missing-test-dependency '("Support for Scheme code blocks")))
(unless (featurep 'geiser)
- (signal 'missing-test-dependency "geiser"))
+ (signal 'missing-test-dependency '("geiser")))
(unless (version<= "27.1" emacs-version)
- (signal 'missing-test-dependency "Geiser required for Scheme code blocks needs Emacs >=27.1"))
+ (signal 'missing-test-dependency '("Geiser required for Scheme code blocks needs Emacs >=27.1")))
(ert-deftest test-ob-scheme/tables ()
"Test table output."
diff --git a/testing/lisp/test-ob-sed.el b/testing/lisp/test-ob-sed.el
index a91aa54cce..c57c798994 100644
--- a/testing/lisp/test-ob-sed.el
+++ b/testing/lisp/test-ob-sed.el
@@ -23,7 +23,7 @@
(require 'ob-sed)
(org-test-for-executable "sed")
(unless (featurep 'ob-sed)
- (signal 'missing-test-dependency "Support for Sed code blocks"))
+ (signal 'missing-test-dependency '("Support for Sed code blocks")))
(ert-deftest ob-sed-test/simple-execution-of-script ()
"Test simple execution of script."
diff --git a/testing/lisp/test-ob-shell.el b/testing/lisp/test-ob-shell.el
index b760031b4e..9addd045bb 100644
--- a/testing/lisp/test-ob-shell.el
+++ b/testing/lisp/test-ob-shell.el
@@ -30,7 +30,7 @@
(require 'org-macs)
(unless (featurep 'ob-shell)
- (signal 'missing-test-dependency "Support for Shell code blocks"))
+ (signal 'missing-test-dependency '("Support for Shell code blocks")))
(org-test-for-executable "sh")
diff --git a/testing/lisp/test-ob-sql.el b/testing/lisp/test-ob-sql.el
index 919741571f..ac8a1ccb22 100644
--- a/testing/lisp/test-ob-sql.el
+++ b/testing/lisp/test-ob-sql.el
@@ -21,7 +21,7 @@
;;; Code:
(unless (featurep 'ob-sql)
- (signal 'missing-test-dependency "Support for sql code blocks"))
+ (signal 'missing-test-dependency '("Support for sql code blocks")))
(defmacro ob-sql/command (&rest body)
"Execute body and return the command that would have been executed."
diff --git a/testing/lisp/test-ob-sqlite.el b/testing/lisp/test-ob-sqlite.el
index 621a11b0b8..0d04643cf3 100644
--- a/testing/lisp/test-ob-sqlite.el
+++ b/testing/lisp/test-ob-sqlite.el
@@ -21,7 +21,7 @@
;;; Code:
(org-test-for-executable "sqlite3")
(unless (featurep 'ob-sqlite)
- (signal 'missing-test-dependency "Support for sqlite code blocks"))
+ (signal 'missing-test-dependency '("Support for sqlite code blocks")))
(ert-deftest ob-sqlite/table-variables-with-commas ()
"Test of a table variable that contains commas. This guarantees that this code path results in a valid CSV."
diff --git a/testing/lisp/test-org-ctags.el b/testing/lisp/test-org-ctags.el
index b8e3e4d223..4e0ee37ffe 100644
--- a/testing/lisp/test-org-ctags.el
+++ b/testing/lisp/test-org-ctags.el
@@ -23,7 +23,7 @@
;; Alternative implementation for `test-org-ctags/mock-command'
;; is required for cmd.exe.
(unless (string-equal "-c" shell-command-switch)
- (signal 'missing-test-dependency "POSIX shell"))
+ (signal 'missing-test-dependency '("POSIX shell")))
(require 'org-ctags)
diff --git a/testing/lisp/test-org-tempo.el b/testing/lisp/test-org-tempo.el
index 0760d45326..7382b6dc42 100644
--- a/testing/lisp/test-org-tempo.el
+++ b/testing/lisp/test-org-tempo.el
@@ -24,7 +24,7 @@
(require 'org-tempo)
(unless (featurep 'org-tempo)
- (signal 'missing-test-dependency "org-tempo"))
+ (signal 'missing-test-dependency '("org-tempo")))
(ert-deftest test-org-tempo/completion ()
"Test that blocks and keywords are expanded correctly by org-tempo."
diff --git a/testing/lisp/test-ox-ascii.el b/testing/lisp/test-ox-ascii.el
index 2df1bd795a..0532b89ee1 100644
--- a/testing/lisp/test-ox-ascii.el
+++ b/testing/lisp/test-ox-ascii.el
@@ -25,7 +25,7 @@
(require 'ox-ascii nil t)
(unless (featurep 'ox-ascii)
- (signal 'missing-test-dependency "org-export-ascii"))
+ (signal 'missing-test-dependency '("org-export-ascii")))
\f
diff --git a/testing/lisp/test-ox-beamer.el b/testing/lisp/test-ox-beamer.el
index be83b12e03..f5743409f3 100644
--- a/testing/lisp/test-ox-beamer.el
+++ b/testing/lisp/test-ox-beamer.el
@@ -25,7 +25,7 @@
(require 'ox-beamer nil t)
(unless (featurep 'ox-beamer)
- (signal 'missing-test-dependency "org-export-beamer"))
+ (signal 'missing-test-dependency '("org-export-beamer")))
\f
diff --git a/testing/lisp/test-ox-latex.el b/testing/lisp/test-ox-latex.el
index d0be4e5a4c..892ac44374 100644
--- a/testing/lisp/test-ox-latex.el
+++ b/testing/lisp/test-ox-latex.el
@@ -25,7 +25,7 @@
(require 'ox-latex nil t)
(unless (featurep 'ox-latex)
- (signal 'missing-test-dependency "org-export-latex"))
+ (signal 'missing-test-dependency '("org-export-latex")))
\f
diff --git a/testing/lisp/test-ox-texinfo.el b/testing/lisp/test-ox-texinfo.el
index b67d2f4c17..b16a344e7e 100644
--- a/testing/lisp/test-ox-texinfo.el
+++ b/testing/lisp/test-ox-texinfo.el
@@ -27,7 +27,7 @@
(eval-when-compile (require 'subr-x))
(unless (featurep 'ox-texinfo)
- (signal 'missing-test-dependency "org-export-texinfo"))
+ (signal 'missing-test-dependency '("org-export-texinfo")))
\f
;;; TeX fragments
--
2.39.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: Saving some kitten, plus some questions along the way
2024-05-19 21:24 ` Stefan Monnier
@ 2024-05-20 11:10 ` Ihor Radchenko
2024-06-15 14:32 ` Ihor Radchenko
2024-05-21 10:55 ` Max Nikulin
1 sibling, 1 reply; 8+ messages in thread
From: Ihor Radchenko @ 2024-05-20 11:10 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-orgmode
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> OK, changed it to `with-current-buffer`.
>
> I pushed the resulting patch (along with three other patches resulting
> from running the tests) to `scratch/org` on `elpa.git`.
>
> You can also find them attached,
Thanks!
> Subject: [PATCH 1/4] (org-*-in-calendar): Prefer `apply` to `eval
Hmm... `...', not `...`. Convention is convention...
> - (org-eval-in-calendar '(setq cursor-type nil) t)
> + ;; FIXME: Not sure we need `with-current-buffer' but I couldn't
> + ;; convince myself that we're always in `calendar-buffer' after
> + ;; the call to `calendar'.
> + (with-current-buffer calendar-buffer (setq cursor-type nil))
Further ahead, the code uses `use-local-map'. So, if current buffer is
not `calendar-buffer', we are in trouble anyway. If you want to play safe,
just add an assertion after the call to `calendar', or wrap the whole
thing into `with-current-buffer'.
> -(defun org-eval-in-calendar (form &optional keepdate)
> - "Eval FORM in the calendar window and return to current window.
> +(defun org-funcall-in-calendar (func &optional keepdate &rest args)
> + "Call FUNC in the calendar window and return to current window.
> Unless KEEPDATE is non-nil, update `org-ans2' to the cursor date."
You still left `org-ans2' kitten struggling, didn't you? :)
> +(defun org-eval-in-calendar (form &optional keepdate)
> + (declare (obsolete org-funcall-in-calendar "2024"))
9.7, not 2024.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Saving some kitten, plus some questions along the way
2024-05-19 21:24 ` Stefan Monnier
2024-05-20 11:10 ` Ihor Radchenko
@ 2024-05-21 10:55 ` Max Nikulin
1 sibling, 0 replies; 8+ messages in thread
From: Max Nikulin @ 2024-05-21 10:55 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-orgmode
On 20/05/2024 04:24, Stefan Monnier wrote:
> Subject: [PATCH 3/4] testing/org-test.el (<toplevel>): Remove dead code
>
> (featurep 'org) is always non-nil here since we have a (require 'org)
> further up. I suspect other `require`s nearby could be removed or
> moved to toplevel.
Just a guess. Perhaps earlier there was intentionally no (require 'org)
to ensure that org-test.el loads Org from the sibling directory, not
from the version bundled with Emacs. Stefan, it was you who added
(require 'org) during switching to lexical binding.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Saving some kitten, plus some questions along the way
2024-05-20 11:10 ` Ihor Radchenko
@ 2024-06-15 14:32 ` Ihor Radchenko
0 siblings, 0 replies; 8+ messages in thread
From: Ihor Radchenko @ 2024-06-15 14:32 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-orgmode
Ihor Radchenko <yantar92@posteo.net> writes:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> OK, changed it to `with-current-buffer`.
>>
>> I pushed the resulting patch (along with three other patches resulting
>> from running the tests) to `scratch/org` on `elpa.git`.
>>
>> You can also find them attached,
>
> Thanks!
>
>> Subject: [PATCH 1/4] (org-*-in-calendar): Prefer `apply` to `eval
>
> Hmm... `...', not `...`. Convention is convention...
Applied, onto main, after adjusting the commit messages.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=4d4bc2086
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3fa18371e
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=cb758720f
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=96d149a66
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-06-15 14:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-18 15:22 Saving some kitten, plus some questions along the way Stefan Monnier
2024-05-19 11:56 ` Ihor Radchenko
2024-05-19 14:40 ` Stefan Monnier
2024-05-19 14:45 ` Ihor Radchenko
2024-05-19 21:24 ` Stefan Monnier
2024-05-20 11:10 ` Ihor Radchenko
2024-06-15 14:32 ` Ihor Radchenko
2024-05-21 10:55 ` Max Nikulin
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.