Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

casual-calendar org insert time-stamp #98

Open
rnadler opened this issue Dec 2, 2024 · 1 comment
Open

casual-calendar org insert time-stamp #98

rnadler opened this issue Dec 2, 2024 · 1 comment
Assignees
Labels

Comments

@rnadler
Copy link

rnadler commented Dec 2, 2024

I most often use the calendar to insert timestamps into org files.
E.g. C-c ! (org-time-stamp-inactive), C-c C-d (org-deadline), or C-c C-s (org-schedule).

These functions place you in the minibuffer, not the calendar buffer, so the calendar-mode-map C-o keymap does not work.

Below is a configuration that adds the custom minibuffer keymap in wrapper functions (only one included).

(defun my/org-minibuffer-keymap-setup ()
  (let ((map (current-local-map)))
    (when map
      (define-key map (kbd "C-o") 'casual-calendar))))

;; Wrapper functions
(defun my/org-deadline ()
  (interactive)
  (minibuffer-with-setup-hook 'my/org-minibuffer-keymap-setup
    (call-interactively 'org-deadline)))

;; Keymaps
(global-set-key (kbd "C-c C-d") 'my/org-deadline)

C-o brings up the casual-calendar menu, but the menu items do not work properly (as expected I guess).

Being able to use casual-calendar in these types of insert use cases would be great.
Thanks!

@kickingvegas kickingvegas self-assigned this Dec 2, 2024
@kickingvegas
Copy link
Owner

@rnadler Thanks much for using Casual and for bringing this to my attention.

On initial inspection, it seems that Org leverages/hijacks the calendar interface via the org-read-date command, coercing input to be done through the mini-buffer. Unfortunately this also subverts usage of a Transient menu as the mini-buffer is given the primary focus using the active keymap org-read-date-minibuffer-local-map defined in org-keys.el.

It is beyond my current understanding on how to make a Transient menu work while the mini-buffer has focus. I think it is an implementation artifact (or bug) that the menu can be raised while the mini-buffer is active.

While it would be nice if this all “just worked”, I do wonder what the specific use case for accessing Casual Calendar via org-read-date would be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants