bastibe / org-journal

A simple org-mode based journaling mode
BSD 3-Clause "New" or "Revised" License
1.25k stars 124 forks source link

key sequence i j starts with non-prefix key i #270

Closed flyingns closed 4 years ago

flyingns commented 4 years ago

When I update to commit d8f2273.

Describe the bug When trying to open emacs calendar dependent functions in org-mode, with shortcut C-c . or C-c C-s or C-c C-d etc. for instance , calendar doesnt comes up front, and user receives the warning on the mini-buffer: "key sequence i j starts with non-prefix key i"

To Reproduce Try to use calendar based functions in org-mode.

Expected behavior Calendar should get properly displayed.

Debugger entered

Debugger entered--Lisp error: (error "Key sequence i j starts with non-prefix key i")
  define-key((keymap #^[nil nil keymap 
#^^[3 0 calendar-set-mark calendar-beginning-of-week calendar-backward-day (keymap (12 . calendar-redraw)) nil calendar-end-of-week calendar-forward-day nil nil nil org-journal-display-entry nil nil nil calendar-forward-week nil calendar-backward-week nil nil nil nil nil calendar-scroll-left-three-months nil (keymap (24 . calendar-exchange-point-and-mark) (93 . calendar-forward-year) (91 . calendar-backward-year) (62 . calendar-scroll-left) (60 . calendar-scroll-right)) nil nil (keymap (61 . calendar-count-days-region) (62 . calendar-end-of-year) (60 . calendar-beginning-of-year) (101 . calendar-end-of-month) (97 . calendar-beginning-of-month) (125 . calendar-forward-month) (123 . calendar-backward-month) (118 . calendar-scroll-right-three-months)) nil nil nil nil scroll-other-window nil nil nil nil nil nil nil nil nil nil nil nil negative-argument calendar-goto-today nil digit-argument ...] #^^[1 0 #^^[2 0 
#^^[3 0 calendar-set-mark calendar-beginning-of-week calendar-backward-day (keymap (12 . calendar-redraw)) nil calendar-end-of-week calendar-forward-day nil nil nil org-journal-display-entry nil nil nil calendar-forward-week nil calendar-backward-week nil nil nil nil nil calendar-scroll-left-three-months nil (keymap (24 . calendar-exchange-point-and-mark) (93 . calendar-forward-year) (91 . calendar-backward-year) (62 . calendar-scroll-left) (60 . calendar-scroll-right)) nil nil (keymap (61 . calendar-count-days-region) (62 . calendar-end-of-year) (60 . calendar-beginning-of-year) (101 . calendar-end-of-month) (97 . calendar-beginning-of-month) (125 . calendar-forward-month) (123 . calendar-backward-month) (118 . calendar-scroll-right-three-months)) nil nil nil nil scroll-other-window nil nil nil nil nil nil nil nil nil nil nil nil negative-argument calendar-goto-today nil digit-argument ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (normal-state keymap "Auxiliary keymap for Normal state" (90 keymap (90 . calendar-exit) (81 . evil-quit)) (113 . calendar-exit) (63 . calendar-goto-info-node) (114 . calendar-cursor-holidays) (120 . calendar-mark-holidays) (117 . calendar-unmark) (115 . diary-show-all-entries) (109 . diary-mark-entries) (100 . diary-view-entries) (68 . diary-view-other-diary-entries) (46 . calendar-goto-today) (118 . calendar-set-mark) (103 keymap (63 . calendar-goto-info-node) (99 . org-calendar-goto-agenda) (104 . calendar-list-holidays) (115 . calendar-sunrise-sunset) (109 . calendar-lunar-phases) (106 . calendar-forward-month) (107 . calendar-backward-month)) (10 . calendar-forward-month) (11 . calendar-backward-month) (125 . calendar-forward-month) (123 . calendar-backward-month) (6 . calendar-scroll-left-three-months) (2 . calendar-scroll-right-three-months) (62 . calendar-scroll-left) (60 . calendar-scroll-right) (delete . scroll-other-window-down) (33554464 . scroll-other-window-down) (41 . calendar-end-of-month) (40 . calendar-beginning-of-month) (27 keymap (61 . calendar-count-days-region) (62 . calendar-end-of-year) (60 . calendar-beginning-of-year)) (93 keymap (93 . calendar-forward-year)) (91 keymap (91 . calendar-backward-year)) (36 . calendar-end-of-week) (94 . calendar-beginning-of-week) (48 . calendar-beginning-of-week) (108 . calendar-forward-day) (107 . calendar-backward-week) (106 . calendar-forward-week) (104 . calendar-backward-day)) (vertical-scroll-bar keymap (mouse-1 . calendar-scroll-toolkit-scroll)) (down-mouse-2 menu-item "Calendar" (keymap "Calendar" (Scroll\ forward menu-item "Scroll forward" calendar-scroll-left-three-months) (Scroll\ backward menu-item "Scroll backward" calendar-scroll-right-three-months) (Mark\ diary\ entries menu-item "Mark diary entries" diary-mark-entries) (List\ holidays menu-item "List holidays" calendar-list-holidays) (Mark\ holidays menu-item "Mark holidays" calendar-mark-holidays) (Unmark menu-item "Unmark" calendar-unmark) (Lunar\ phases menu-item "Lunar phases" calendar-lunar-phases) (Sunrise\ times\ for\ month menu-item "Sunrise times for month" calendar-sunrise-sunset-month) (Show\ diary menu-item "Show diary" diary-show-all-entries) (Exit\ calendar menu-item "Exit calendar" calendar-exit))) (down-mouse-3 menu-item "" ("--" ["Holidays" calendar-cursor-holidays] ["Mark date" calendar-set-mark] ["Sunrise/sunset" calendar-sunrise-sunset] ["Other calendars" calendar-print-other-dates] ("Prepare LaTeX buffer" ["Daily (1 page)" cal-tex-cursor-day] ["Weekly (1 page, with hours)" cal-tex-cursor-week] ["Weekly (2 pages, with hours)" cal-tex-cursor-week2] ["Weekly (1 page, no hours)" cal-tex-cursor-week-iso] ["Weekly (1 page, with hours, different style)" cal-tex-cursor-week-monday] ["Weekly (2 pages, no hours)" cal-tex-cursor-week2-summary] ["Monthly" cal-tex-cursor-month] ["Monthly (landscape)" cal-tex-cursor-month-landscape] ["Yearly" cal-tex-cursor-year] ["Yearly (landscape)" cal-tex-cursor-year-landscape] ("Filofax styles" ["Filofax Daily (one-day-per-page)" cal-tex-cursor-filofax-daily] ["Filofax Weekly (2-weeks-at-a-glance)" cal-tex-cursor-filofax-2week] ["Filofax Weekly (week-at-a-glance)" cal-tex-cursor-filofax-week] ["Filofax Yearly" cal-tex-cursor-filofax-year])) ("Write HTML calendar" ["For selected month" cal-html-cursor-month] ["For selected year" cal-html-cursor-year]) ["Diary entries" calendar-mouse-view-diary-entries :keys "d"] ["Insert diary entry" diary-insert-entry] ["Other diary file entries" calendar-mouse-view-other-diary-entries :keys "D"]) :filter #f(compiled-function (menu) #<bytecode 0x439ea80d>)) (menu-bar keymap (Scroll menu-item "Scroll" (keymap "Scroll" (Scroll\ Commands menu-item "Scroll Commands" nil :help "Commands that scroll the visible window") (Forward\ 1\ Month menu-item "Forward 1 Month" calendar-scroll-left) (Forward\ 3\ Months menu-item "Forward 3 Months" calendar-scroll-left-three-months) (Forward\ 1\ Year menu-item "Forward 1 Year" menu-function-13 :keys "4 C-v") (Backward\ 1\ Month menu-item "Backward 1 Month" calendar-scroll-right) (Backward\ 3\ Months menu-item "Backward 3 Months" calendar-scroll-right-three-months) (Backward\ 1\ Year menu-item "Backward 1 Year" menu-function-14 :keys "4 M-v") (nil menu-item "--") (Motion\ Commands menu-item "Motion Commands" nil :help "Commands that move point") (Forward\ 1\ Day menu-item "Forward 1 Day" calendar-forward-day) (Forward\ 1\ Week menu-item "Forward 1 Week" calendar-forward-week) (Forward\ 1\ Month-11 menu-item "Forward 1 Month" calendar-forward-month) (Forward\ 1\ Year-12 menu-item "Forward 1 Year" calendar-forward-year) (Backward\ 1\ Day menu-item "Backward 1 Day" calendar-backward-day) (Backward\ 1\ Week menu-item "Backward 1 Week" calendar-backward-week) (Backward\ 1\ Month-15 menu-item "Backward 1 Month" calendar-backward-month) (Backward\ 1\ Year-16 menu-item "Backward 1 Year" calendar-backward-year))) (Goto menu-item "Goto" (keymap "Goto" (Today menu-item "Today" calendar-goto-today) (Beginning\ of\ Week menu-item "Beginning of Week" calendar-beginning-of-week) (End\ of\ Week menu-item "End of Week" calendar-end-of-week) (Beginning\ of\ Month menu-item "Beginning of Month" calendar-beginning-of-month) (End\ of\ Month menu-item "End of Month" calendar-end-of-month) (Beginning\ of\ Year menu-item "Beginning of Year" calendar-beginning-of-year) (End\ of\ Year menu-item "End of Year" calendar-end-of-year) (Other\ Date menu-item "Other Date" calendar-goto-date) (Day\ of\ Year menu-item "Day of Year" calendar-goto-day-of-year) (ISO\ Week menu-item "ISO Week" calendar-iso-goto-week) (ISO\ Date menu-item "ISO Date" calendar-iso-goto-date) (Astronomical\ Date menu-item "Astronomical Date" calendar-astro-goto-day-number) (Hebrew\ Date menu-item "Hebrew Date" calendar-hebrew-goto-date) (Persian\ Date menu-item "Persian Date" calendar-persian-goto-date) (Bahá’í\ Date menu-item "Bahá’í Date" calendar-bahai-goto-date) (Islamic\ Date menu-item "Islamic Date" calendar-islamic-goto-date) (Julian\ Date menu-item "Julian Date" calendar-julian-goto-date) (Chinese\ Date menu-item "Chinese Date" calendar-chinese-goto-date) (Coptic\ Date menu-item "Coptic Date" calendar-coptic-goto-date) (Ethiopic\ Date menu-item "Ethiopic Date" calendar-ethiopic-goto-date) (Mayan\ Date menu-item "Mayan Date" (keymap "Mayan Date" (Next\ Tzolkin menu-item "Next Tzolkin" calendar-mayan-next-tzolkin-date) (Previous\ Tzolkin menu-item "Previous Tzolkin" calendar-mayan-previous-tzolkin-date) (Next\ Haab menu-item "Next Haab" calendar-mayan-next-haab-date) (Previous\ Haab menu-item "Previous Haab" calendar-mayan-previous-haab-date) (Next\ Round menu-item "Next Round" calendar-mayan-next-round-date) (Previous\ Round menu-item "Previous Round" calendar-mayan-previous-round-date))) (French\ Date menu-item "French Date" calendar-french-goto-date))) (Holidays menu-item "Holidays" (keymap "Holidays" (For\ Cursor\ Date\ - menu-item (concat "For Cursor Date - " (calendar-date-string ... t t)) calendar-cursor-holidays :visible (calendar-cursor-to-date)) (For\ Window\ - menu-item (concat "For Window - " (cal-menu-holiday-window-suffix)) calendar-list-holidays) (For\ Today\ - menu-item (concat "For Today - " (calendar-date-string ... t t)) menu-function-1 :key-sequence nil) (nil menu-item "--") (hol-year-0 menu-item (format "For Year %d" (+ displayed-year -5)) menu-function-2 :key-sequence nil) (hol-year-1 menu-item (format "For Year %d" (+ displayed-year -4)) menu-function-3 :key-sequence nil) (hol-year-2 menu-item (format "For Year %d" (+ displayed-year -3)) menu-function-4 :key-sequence nil) (hol-year-3 menu-item (format "For Year %d" (+ displayed-year -2)) menu-function-5 :key-sequence nil) (hol-year-4 menu-item (format "For Year %d" (+ displayed-year -1)) menu-function-6 :key-sequence nil) (hol-year-5 menu-item (format "For Year %d" (+ displayed-year 0)) menu-function-7 :key-sequence nil) (hol-year-6 menu-item (format "For Year %d" (+ displayed-year 1)) menu-function-8 :key-sequence nil) (hol-year-7 menu-item (format "For Year %d" (+ displayed-year 2)) menu-function-9 :key-sequence nil) (hol-year-8 menu-item (format "For Year %d" (+ displayed-year 3)) menu-function-10 :key-sequence nil) (hol-year-9 menu-item (format "For Year %d" (+ displayed-year 4)) menu-function-11 :key-sequence nil) (hol-year-10 menu-item (format "For Year %d" (+ displayed-year 5)) menu-function-12 :key-sequence nil) (nil-15 menu-item "--") (Unmark\ Calendar menu-item "Unmark Calendar" calendar-unmark) (Mark\ Holidays menu-item "Mark Holidays" calendar-mark-holidays))) (Diary menu-item "Diary" (keymap "Diary" (Other\ File menu-item "Other File" diary-view-other-diary-entries) (Cursor\ Date menu-item "Cursor Date" diary-view-entries) (Mark\ All menu-item "Mark All" diary-mark-entries) (Show\ All menu-item "Show All" diary-show-all-entries) (Insert\ Diary\ Entry menu-item "Insert Diary Entry" diary-insert-entry) (Insert\ Weekly menu-item "Insert Weekly" diary-insert-weekly-entry) (Insert\ Monthly menu-item "Insert Monthly" diary-insert-monthly-entry) (Insert\ Yearly menu-item "Insert Yearly" diary-insert-yearly-entry) (Insert\ Anniversary menu-item "Insert Anniversary" diary-insert-anniversary-entry) (Insert\ Block menu-item "Insert Block" diary-insert-block-entry) (Insert\ Cyclic menu-item "Insert Cyclic" diary-insert-cyclic-entry) (Insert\ Bahá’í menu-item "Insert Bahá’í" (keymap "Insert Bahá’í" (One\ time menu-item "One time" diary-bahai-insert-entry) (Monthly menu-item "Monthly" diary-bahai-insert-monthly-entry) (Yearly menu-item "Yearly" diary-bahai-insert-yearly-entry))) (Insert\ Chinese menu-item "Insert Chinese" (keymap "Insert Chinese" (One\ time menu-item "One time" diary-chinese-insert-entry) (Monthly menu-item "Monthly" diary-chinese-insert-monthly-entry) (Yearly menu-item "Yearly" diary-chinese-insert-yearly-entry) (Anniversary menu-item "Anniversary" diary-chinese-insert-anniversary-entry))) (Insert\ Islamic menu-item "Insert Islamic" (keymap "Insert Islamic" (One\ time menu-item "One time" diary-islamic-insert-entry) (Monthly menu-item "Monthly" diary-islamic-insert-monthly-entry) (Yearly menu-item "Yearly" diary-islamic-insert-yearly-entry))) (Insert\ Hebrew menu-item "Insert Hebrew" (keymap "Insert Hebrew" (One\ time menu-item "One time" diary-hebrew-insert-entry) (Monthly menu-item "Monthly" diary-hebrew-insert-monthly-entry) (Yearly menu-item "Yearly" diary-hebrew-insert-yearly-entry))))) (Sun/Moon menu-item "Sun/Moon" (keymap "Sun/Moon" (Lunar\ Phases menu-item "Lunar Phases" calendar-lunar-phases) (Sunrise/sunset\ for\ cursor\ date menu-item "Sunrise/sunset for cursor date" calendar-sunrise-sunset) (Sunrise/sunset\ for\ cursor\ month menu-item "Sunrise/sunset for cursor month" calendar-sunrise-sunset-month))) (search . undefined) (edit . undefined)) (33554464 . scroll-other-window-down) (67108896 . calendar-set-mark) (down . calendar-forward-week) (right . calendar-forward-day) (up . calendar-backward-week) (left . calendar-backward-day) (next . calendar-scroll-left-three-months) (prior . calendar-scroll-right-three-months) (remap keymap (write-region . calendar-not-implemented) (capitalize-region . calendar-not-implemented) (copy-region-as-kill . calendar-not-implemented) (kill-region . calendar-not-implemented) (upcase-region . calendar-not-implemented) (downcase-region . calendar-not-implemented) (mark-page . calendar-not-implemented) (mark-whole-buffer . calendar-not-implemented) (mark-defun . calendar-not-implemented) (mark-paragraph . calendar-not-implemented) (mark-sexp . calendar-not-implemented) (mark-word . calendar-not-implemented) (narrow-to-region . calendar-not-implemented) (self-insert-command . undefined))) "ij" org-journal-new-date-entry)
  #f(compiled-function () #<bytecode 0x43a3ea71>)()
  eval-after-load("calendar" #f(compiled-function () #<bytecode 0x43a3ea71>))
  byte-code("\301\302\303\304#\210\305\302\303\304#\210\301\306\307\304#\210\305\306\307\304#\210\310\010\311\303#\210\310\010\312\307#\210\310\010\313\314#\210\310\010\315\316#\210\317\320\321\"\210\322\313\314\"\207" [org-journal-mode-map defalias org-journal-open-next-entry org-journal-next-entry nil make-obsolete org-journal-open-previous-entry org-journal-previous-entry define-key "\003\006" "\003\002" "\003\n" org-journal-new-entry "\003\023" org-journal-search eval-after-load "calendar" #f(compiled-function () #<bytecode 0x43a3ea71>) global-set-key] 4)
  org-journal-mark-entries()
  run-hooks(calendar-today-visible-hook)
  #f(compiled-function () #<bytecode 0x44cb1ee5>)()
  calendar-generate-window(7 2020)
  calendar-basic-setup(nil)
  calendar()
  org-read-date(nil to-time nil "SCHEDULED" nil nil)
  org-add-planning-info(scheduled nil closed)
  #f(compiled-function () #<bytecode 0x40d6bd79>)()
  org--deadline-or-schedule(nil scheduled nil)
  org-schedule(nil)
  funcall-interactively(org-schedule nil)
  call-interactively(org-schedule nil nil)
  command-execute(org-schedule)

Desktop (please complete the following information):

flyingns commented 4 years ago

The same problem, issues #268 has been closed, I also encountered this problem, and tried to solve it, but without success.

flyingns commented 4 years ago

When I went back to the previous commit 24b5879, the problem was still not solved. A few days ago, I was sure that it was working properly. During this period, I updated some packages through doom sync (sorry I didn’t notice which packages were updated ).

tnira commented 4 years ago

I faced the same problem a few days ago. I'm using Emacs 26.3 on Spacemacs. I added (require 'org-journal) in configuration file. This has not occurred since then. I hope this helps in some way.

casch-at commented 4 years ago

I was able to reproduce it. There must be something wrong with the autoloads.

flyingns commented 4 years ago

@tnira Aha, that is indeed the case, which is strange. I tried (require'org-journal) and it did solve the problem.

casch-at commented 4 years ago

@flyingns @tnira Should be fixed.

casch-at commented 4 years ago

The reason was that org-compat was adding a key binding i for org-agenda-diary-entry, see org-calendar-insert-diary-entry-key in org-compat. The simplest solution would have been to always unset the key binding i first (https://github.com/bastibe/org-journal/commit/b9289931d0eb3fe0f7b3a30f6f727f26d4ce95b3) . Anyway, org-journal has now it's own prefix key j inside calendar-mode-map.

tnira commented 4 years ago

@cslux Thank you for your work.

casch-at commented 4 years ago

My pleasure!

OrcsBR commented 4 years ago

It works, thanks! Those shortcuts are mentioned on readme.org, someone should change that when possible. Thank you again.

flyingns commented 4 years ago

Thanks for your work, it works very well. @cslux

casch-at commented 4 years ago

Those shortcuts are mentioned on readme.org, someone should change that when possible.

Thanks, done!