emacs-calfw icon indicating copy to clipboard operation
emacs-calfw copied to clipboard

No display for multi-day Org events

Open mankoff opened this issue 10 years ago • 12 comments

I updated calfw from elpa yesterday (to calfw-20150831.1847) and lost some functionality.

The previous version displayed multi-day Org events as a block. The current version does not.

This may be related to #11, #60, and #63.

mankoff avatar Sep 02 '15 20:09 mankoff

Thank you for your bug report! Hmm, I have checked the displaying block event at #60. But, because I'm not a heavy user for orgmode, I might miss an another bug. Will you show the small sample org file which can reproduce the bug?

kiwanami avatar Sep 07 '15 04:09 kiwanami

Here is how I can reproduce the bug.

  1. My test.el init file.

(add-to-list 'load-path "~/local/src/org-mode/lisp")
(add-to-list 'load-path "~/local/src/org-mode/contrib" t)
(require 'org)
(setq org-agenda-files '("test.org"))

(add-to-list 'load-path "~/.emacs.d/elpa/calfw-20150831.1847")
(add-to-list 'load-path "~/.emacs.d/elpa/calfw-20150824.2347")

(require 'calfw)
(require 'calfw-org)
(cfw:open-org-calendar)

I am opening with emacs -Q test.el, and evaluating only one of add-to-list calfw lines. Date ranges are shown as a range in the elpa 0824 version, and not the elpa 0831 version.

  1. My test.org file:

* TODO Test Item
  <2015-09-07 Lun>--<2015-09-10 Jeu>
  1. Here are two screenshots. The first from version 0824, shows a date range. The second does not.
capture d ecran 2015-09-07 a 11 20 18 -04 00 capture d ecran 2015-09-07 a 11 16 47 -04 00

mankoff avatar Sep 07 '15 15:09 mankoff

@mankoff Thank you for your detailed report! I'll check it.

kiwanami avatar Sep 24 '15 02:09 kiwanami

@kiwanami This issue might be able to get fixed as follows: in the cfw:org-get-timerange function (calfw-org.el):

from (if (string-match "(\\([0-9]+)/\\([0-9]+\\)): " extra) to (if (string-match "(\\([ 0-9]+)/\\([ 0-9]+\\)): " extra)

I hope this fix is applied to the main branch (and melpa as well) as soon as possible.

kiwonum avatar Jun 03 '16 21:06 kiwonum

Fixed in elpa version 20170320.506

mankoff avatar Mar 21 '17 01:03 mankoff

@mankoff I just tested; but, this has not been solved yet in the version you mentioned.

kiwonum avatar Mar 31 '17 14:03 kiwonum

Weird. It does for me. Here is my DEBUG.el

(require 'org)
(setq org-agenda-files '("test.org"))

(add-to-list 'load-path "~/.emacs.d/elpa/calfw-20170320.506")

(require 'calfw)
(require 'calfw-org)
(cfw:open-org-calendar)

Here is test.org

* TODO Test Item
<2017-03-31 Fri>--<2017-04-03 Mon>

I launch emacs (OS X, v 25.2.2) with /Applications/Emacs.app/Content/MacOS/Emacs -Q DEBUG.el and then manually evaluate (C-x C-e) each line, then T for two-week view.

And here is what the calendar looks like:

screen shot 2017-03-31 at 10 24 53

If you can't replicate this, we should probably re-open the bug and figure out why.

mankoff avatar Mar 31 '17 14:03 mankoff

Interesting... I quickly tested your scripts; it works with Org-mode version 8.2.10 but doesn't work with Org mode version 9.0.5 (the current melpa version). From an additional test, I found the patch I posted above works for both.

kiwonum avatar Mar 31 '17 14:03 kiwonum

This is getting complicated. I first noticed it worked in my default config, which is Org 9.0.5. The MWE example above uses the Emacs version, which is older (not sure what version). So... on my computer, I have it working (as above) with current calfw and old Org, but also current calfw and Org 9.0.5 but also my large and complicated init.el...

mankoff avatar Mar 31 '17 14:03 mankoff

I just added (add-to-list 'load-path "~/.emacs.d/elpa/org-20170210") to the DEBUG.el (and load it before (require 'org)) and it works on my system. Latest calfw and Org from elpa.

mankoff avatar Mar 31 '17 14:03 mankoff

Hm... it seems a problem on my side. I retested and it works for both. I need to figure out the problem. Thank you for your time.

kiwonum avatar Mar 31 '17 15:03 kiwonum

I got it. This is because of the string format of an agenda entry.

For example, if the multiple-day entry looks like "(1/4): TODO Test Item", it perfectly works. But, I use a different setting for org-agenda-timerange-leaders (e.g., "" "(%3d/%-3d): "), which shows the same entry differently like "( 1/4 ): TODO Test Item"; here, there exist some spaces in the entry.

This is the reason why my patch works for my case.

kiwonum avatar Mar 31 '17 15:03 kiwonum