kiwanami / emacs-calfw

A calendar framework for Emacs
1.16k stars 100 forks source link

Cannot use calfw with emacs 30 #159

Closed slyfr closed 1 year ago

slyfr commented 1 year ago

I get an error when trying to open a calendar.

Using the following code (taken from the documentation):

(defun sample-data1 (b e)
  '(
    ((1  7 2023) . ("item1"))
    ((5  7 2023) . ("item2-1" "item2-2"))
    ))

(cfw:open-calendar-buffer
 :date (cfw:date 1 7 2023)
 :contents-sources
 (list 
  (make-cfw:source
   :name "test1" :data 'sample-data1)))

I obtain the following trace:

Debugger entered--Lisp error: (void-function \(setf\ internal--with-suppressed-warnings\))
  \(setf\ internal--with-suppressed-warnings\)(nil ((lexical cl-x)) nil)
  cfw:dest-ol-selection-clear(#s(cfw:dest :type buffer :buffer #<buffer *cfw-calendar*> :min-func point-min :max-func point-max :width 211 :height 56 :clear-func (lambda (&rest --cl-rest--) (apply #'#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_149> '--dest-- '--window-- '--buffer-- --cl-rest--)) :before-update-func nil :after-update-func nil :select-ol nil :today-ol nil))
  cfw:cp-update(#s(cfw:component :dest #s(cfw:dest :type buffer :buffer #<buffer *cfw-calendar*> :min-func point-min :max-func point-max :width 211 :height 56 :clear-func (lambda (&rest --cl-rest--) (apply #'#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_149> '--dest-- '--window-- '--buffer-- --cl-rest--)) :before-update-func nil :after-update-func nil :select-ol nil :today-ol nil) :model ((init-date 1 7 2023) (contents-sources #s(cfw:source :name "test1" :data sample-data1 :update nil :color nil :period-bgcolor nil :period-fgcolor nil :opt-face nil :opt-period-face nil)) (annotation-sources) (sorter . string-lessp)) :selected (1 7 2023) :view month :update-hooks nil :selection-change-hooks nil :click-hooks nil))
  cfw:cp-new(#s(cfw:dest :type buffer :buffer #<buffer *cfw-calendar*> :min-func point-min :max-func point-max :width 211 :height 56 :clear-func (lambda (&rest --cl-rest--) (apply #'#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_149> '--dest-- '--window-- '--buffer-- --cl-rest--)) :before-update-func nil :after-update-func nil :select-ol nil :today-ol nil) ((init-date 1 7 2023) (contents-sources #s(cfw:source :name "test1" :data sample-data1 :update nil :color nil :period-bgcolor nil :period-fgcolor nil :opt-face nil :opt-period-face nil)) (annotation-sources) (sorter . string-lessp)) nil (1 7 2023))
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_321>(nil)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_322>(nil)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_323>(nil)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_324>((#s(cfw:source :name "test1" :data sample-data1 :update nil :color nil :period-bgcolor nil :period-fgcolor nil :opt-face nil :opt-period-face nil)))
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_325>(nil)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_326>(nil)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_327>((1 7 2023))
  cfw:create-calendar-component-buffer(:date (1 7 2023) :buffer nil :custom-map nil :contents-sources (#s(cfw:source :name "test1" :data sample-data1 :update nil :color nil :period-bgcolor nil :period-fgcolor nil :opt-face nil :opt-period-face nil)) :annotation-sources nil :view nil :sorter nil)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_312>(nil)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_313>(nil)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_314>(nil)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_315>((#s(cfw:source :name "test1" :data sample-data1 :update nil :color nil :period-bgcolor nil :period-fgcolor nil :opt-face nil :opt-period-face nil)))
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_316>(nil)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_317>(nil)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_318>((1 7 2023))
  cfw:open-calendar-buffer(:date (1 7 2023) :contents-sources (#s(cfw:source :name "test1" :data sample-data1 :update nil :color nil :period-bgcolor nil :period-fgcolor nil :opt-face nil :opt-period-face nil)))
  elisp--eval-last-sexp(nil)
  #<subr eval-last-sexp>(nil)
  #f(compiled-function (&rest _it) #<bytecode 0x19c3618ab37a>)()
  eval-sexp-fu-flash-doit-simple(#f(compiled-function (&rest _it) #<bytecode 0x19c3618ab37a>) #f(compiled-function (&rest args2) #<bytecode 0x7b7f2737c5d3b47>) #f(compiled-function (&rest args2) #<bytecode 0x7a6e436e267bb47>))
  eval-sexp-fu-flash-doit(#f(compiled-function (&rest _it) #<bytecode 0x19c3618ab37a>) #f(compiled-function (&rest args2) #<bytecode 0x7b7f2737c5d3b47>) #f(compiled-function (&rest args2) #<bytecode 0x7a6e436e267bb47>))
  esf-flash-doit(#f(compiled-function (&rest _it) #<bytecode 0x19c3618ab37a>) #f(compiled-function (&rest args2) #<bytecode 0x7b7f2737c5d3b47>) #f(compiled-function (&rest args2) #<bytecode 0x7a6e436e267bb47>) #f(compiled-function (&rest args2) #<bytecode 0x1c762517520c7b50>))
  ad-Advice-eval-last-sexp(#<subr eval-last-sexp> nil)
  apply(ad-Advice-eval-last-sexp #<subr eval-last-sexp> nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  command-execute(eval-last-sexp)

Here is the information about my version of emacs: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2023-06-26

cdeleuze commented 1 year ago

The example works for me, M-x version: GNU Emacs 30.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2023-03-13. What's this esf-flash-doit thing?

slyfr commented 1 year ago

Sorry, I dug into the problem. It was actually a byte code compiler problem of the emacs version I was using. I updated my emacs version and it now works. Sorry for the noise