9

If you look a the screenshot the cursor is locked in the echo area. If want to select the date, I have to click on one with the mouse. Do I, or there is a way to do with the keyboard?

EDIT:

Also the navigation key bindings don't work as they're supposed to. If I do C-f, it does not move one day forward whether in conjunction with Shift or not.

Screenshot

  • 2
    The words "Date+time" come from the function `org-read-date` in the `org.el` library. I have added the tag `org-mode` to the question so people do not mistakenly think this is strictly relating to the `calendar` library. For anyone who wishes to work on this question, evaluate `(require 'org)` and then evaluate `(org-read-date)` .... – lawlist Nov 13 '19 at 19:11

3 Answers3

10

Hold down the shift key while you use the arrows. Shift-right and left will move by days, Shift-up and down by weeks. Alt-Shift right and left will move by months, and Alt-Shift up and down will move by years.

Daniel Doherty
  • 418
  • 4
  • 12
9

There is a lot of inputs you can give to specify a date or time. The whole overview is here. Just some notable examples:

  • Relative dates:
    • +1 or just +: tomorrow
    • +1w: next week
    • sat: next saturday
  • Absolute dates are a bit weird. It uses ISO YMD format by default: 3-2-5 expands to 2003-02-05. I prefer to use 23 jan 19 or 23 jan 2019 (equal to 19-1-23) to use a DMY format.
  • To add a time to any date selection use 11am or 11:00

Some Calendar movements also work. Shift+Arrows moves by days. > and < shift the months displayed, ... See Calendar motion and Scroll calendar of the Emacs Calendar manual.

Here's a screenshot where I select the monday in two weeks at 11am by entering +2mon 11am. The date prompt gets updated to indicate my selected date => <2019-11-25 Mon 11:00>. Press Enter to confirm and exit.

date selection example

fpiper
  • 451
  • 2
  • 2
  • About the Calendar motion: `g d Move point to specified date (calendar-goto-date). ` I don't know what key combo `g d` is. –  Nov 13 '19 at 19:57
  • Are you supposed to type `+1w` in the echo area? –  Nov 13 '19 at 19:59
  • Yes, just type it. The displayed date in the echo area should change and you can confirm with Enter. Commands like `C-a`, `C-f` or single letters do not work as they are intercepted by the minibuffer. – fpiper Nov 13 '19 at 20:03
  • OK, it worked. Is the minibuffer the same as the echo area? –  Nov 13 '19 at 20:15
  • Basically yes. See https://www.gnu.org/software/emacs/manual/html_node/emacs/Echo-Area.html – fpiper Nov 13 '19 at 20:16
  • 1
    They are completely different. The one thing they share is a *window*. That window displays *either* the minibuffer, *or* the echo area, depending on what is happening. The minibuffer is (per its name) a buffer you can type into. The echo area (per its name) just displays things. Sometimes something which is capturing keystrokes will echo them to the echo area as you type, however (`isearch` is a classic example), which can confuse matters. They are categorically *not* the same thing, though. – phils Nov 14 '19 at 11:06
2

@Daniel's answer should be the official solution. But I find you can still just C-x o to move the cursor to the calendar buffer, then move around as usual and hit RET to pick a date. Though you will not see the cursor because the org mode turns it off, you can get it back via M-x (setq cursor-type t).

xuchunyang
  • 14,302
  • 1
  • 18
  • 39
  • @xuchungyang `C-x o` switches to buffer from which I did `C-c C-s`, not the calendar, in my case. –  Nov 13 '19 at 19:48
  • @Erwann You probably have switched to the calendar buffer, though you don't notice since the cursor is hided as I explained in the last sentence. – xuchunyang Nov 13 '19 at 19:59
  • @xuchungyang, the whole sequence. 1) starting from "original buffer": `C-c C-s`, opens calendar, cursor in echo area. 2) `C-x o`, cursor flickers in original buffer. 3) `M-x` prompts: `command attempted to use minibuffer while in minibuffer`. –  Nov 13 '19 at 20:05
  • 2
    @Erwann `C-x o` runs `other-window`. In this case, there are at least THREE windows, that is, the minibuffer window, the org mode file buffer window and the calendar buffer window. So use `C-x o` to switch to the calendar buffer window. You might need to use `C-x o` more than once. – xuchunyang Nov 13 '19 at 20:35
  • @xuchunyang: you should porbably add your last comment into the answer. – NickD Nov 14 '19 at 15:57