[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/excorporate fd9a7bb 25/93: excorporate-calfw.el: Enable

From: Stefan Monnier
Subject: [elpa] externals/excorporate fd9a7bb 25/93: excorporate-calfw.el: Enable clean byte-compiling in GNU ELPA
Date: Sun, 29 Nov 2020 15:43:01 -0500 (EST)

branch: externals/excorporate
commit fd9a7bbdd58d7cf44fb857fb001bf9302007447f
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>

    excorporate-calfw.el: Enable clean byte-compiling in GNU ELPA
    * excorporate/excorporate-calfw.el: Specify NOERROR when
    require'ing calfw.
    (cfw:component-model, cfw:cp-add-selection-change-hook)
    (cfw:create-calendar-component-buffer, cfw:cursor-to-nearest-date)
    (cfw:date, cfw:model-set-contents-sources)
    (cfw:refresh-calendar-buffer, make-cfw:event, make-cfw:source):
    Declare functions.
    (cfw:component): Declare variable.
    (cfw:cp-set-contents-sources): Override to fix a bug.
    * excorporate/excorporate-calfw.el (exco-calfw-add-meetings)
    (exco-calfw-finalize-buffer): Do not declare cfw:component
    * copyright_exceptions: Add exception for description of calfw's
    copyright situation in excorporate-calfw.el.
 excorporate-calfw.el | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/excorporate-calfw.el b/excorporate-calfw.el
index 11bdfe8..5eda6e4 100644
--- a/excorporate-calfw.el
+++ b/excorporate-calfw.el
@@ -31,7 +31,32 @@
 ;;; Code:
-(require 'calfw)
+;; calfw is not FSF-assigned yet so it is not in GNU ELPA.  The
+;; following workarounds allow excorporate-calfw.elc to be built
+;; regardless.
+(require 'calfw nil t)
+(declare-function cfw:component-model "ext:calfw" t)
+(declare-function cfw:cp-add-selection-change-hook "ext:calfw" t)
+(declare-function cfw:cp-get-contents-sources "ext:calfw" t)
+(declare-function cfw:create-calendar-component-buffer "ext:calfw" t)
+(declare-function cfw:cursor-to-nearest-date "ext:calfw" t)
+(declare-function cfw:date "ext:calfw" t)
+(declare-function cfw:model-set-contents-sources "ext:calfw" t)
+(declare-function cfw:refresh-calendar-buffer "ext:calfw" t)
+(declare-function make-cfw:event "ext:calfw" t)
+(declare-function make-cfw:source "ext:calfw" t)
+(defvar cfw:component)
+;; Fix a bad bug in calfw.  See:
+;; https://github.com/kiwanami/emacs-calfw/pull/79
+(defun cfw:cp-set-contents-sources (component sources)
+  "Set content SOURCES for COMPONENT.
+SOURCES is a list of content sources."
+  (cfw:model-set-contents-sources
+   sources (cfw:component-model component)))
 (require 'excorporate)
 (defvar excorporate-calfw-buffer-name "*Excorporate*"
@@ -85,7 +110,6 @@ are the requested participants."
   (let ((event-list (exco-calendar-item-iterate response
     (with-current-buffer (get-buffer-create excorporate-calfw-buffer-name)
-      (declare (special cfw:component))
       (let* ((new-source (make-cfw:source
                          :name (format "%S (as of %s)"
@@ -99,7 +123,6 @@ are the requested participants."
 (defun exco-calfw-finalize-buffer ()
   "Finalize the Calfw widget after retrievals have completed."
   (with-current-buffer (get-buffer-create excorporate-calfw-buffer-name)
-    (declare (special cfw:component))
     (let ((sources (cfw:cp-get-contents-sources cfw:component))
          (status-source (make-cfw:source :name "Done."
                                          :data (lambda (_b _e) nil))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]