From: Ihor Radchenko <yantar92@posteo.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: Saving some kitten, plus some questions along the way
Date: Mon, 20 May 2024 11:10:12 +0000 [thread overview]
Message-ID: <87msokrb6z.fsf@localhost> (raw)
In-Reply-To: <jwvcyphjy30.fsf-monnier+emacs@gnu.org>
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>
next prev parent reply other threads:[~2024-05-20 11:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2024-06-15 14:32 ` Ihor Radchenko
2024-05-21 10:55 ` Max Nikulin
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=87msokrb6z.fsf@localhost \
--to=yantar92@posteo.net \
--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).