[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/excorporate 47d2698 32/93: packages/excorporate: Suppor
From: |
Stefan Monnier |
Subject: |
[elpa] externals/excorporate 47d2698 32/93: packages/excorporate: Support diary on Emacs 24.1, 24.2, 24.3 |
Date: |
Sun, 29 Nov 2020 15:43:03 -0500 (EST) |
branch: externals/excorporate
commit 47d26988e9619cd0a6e1b0a6900724d7235d63ec
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
packages/excorporate: Support diary on Emacs 24.1, 24.2, 24.3
* packages/excorporate/excorporate.el: Update copyright year.
Unbump Emacs version requirement to 24.1. Add nadvice 0.2
requirement.
(exco-calendar-item-with-details-iterate): Do not pass identifier
to finalizer.
* packages/excorporate/excorporate-diary.el: Require nadvice.
(exco-diary-icalendar--add-diary-entry-around): Port defadvice to
nadvice.
(exco-diary-initialize): Move retrieval message to
exco-diary-diary-advice.
(exco-diary-diary-advice): Add retrieval message from
exco-diary-initialize. Explicitly return nil.
(excorporate-diary-enable): Create excorporate diary directory and
blank files. Sharp quote and reorder diary hooks.
(excorporate-diary-disable): Remove autoload cookie.
---
excorporate-diary.el | 32 ++++++++++++++++++++++----------
excorporate.el | 10 +++++++---
2 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/excorporate-diary.el b/excorporate-diary.el
index dcd6cc2..c4c94e1 100644
--- a/excorporate-diary.el
+++ b/excorporate-diary.el
@@ -31,7 +31,9 @@
(require 'icalendar)
(require 'appt)
(require 'excorporate)
+(require 'nadvice)
+;; FIXME: Add something like this to diary-lib.el.
(defun exco-diary-diary-make-entry (string &optional nonmarking file)
"Insert a diary entry STRING which may be NONMARKING in FILE.
If omitted, NONMARKING defaults to nil and FILE defaults to
@@ -53,9 +55,9 @@ If omitted, NONMARKING defaults to nil and FILE defaults to
(if nonmarking diary-nonmarking-symbol "")
string)))
-(defadvice icalendar--add-diary-entry (around
- exco-diary-icalendar--add-diary-entry
- activate)
+;; FIXME: Have icalendar--add-diary-entry use the new diary-lib
+;; function instead of diary-make-entry.
+(defun exco-diary-icalendar--add-diary-entry-around (original &rest arguments)
"Prevent whitespace workaround from selecting diary buffer.
Also prevent `diary-make-entry' from putting the diary file
where (other-buffer (current-buffer)) will return it."
@@ -65,7 +67,9 @@ where (other-buffer (current-buffer)) will return it."
;; and buffer manipulations.
((symbol-function #'diary-make-entry)
(symbol-function #'exco-diary-diary-make-entry)))
- ad-do-it))
+ (apply original arguments)))
+(advice-add #'icalendar--add-diary-entry :around
+ #'exco-diary-icalendar--add-diary-entry-around)
(defvar excorporate-diary-today-file
"~/.emacs.d/excorporate/diary-excorporate-today"
@@ -83,7 +87,6 @@ This file will be #include'd in `diary-file' by
"Initialize diary files used by Excorporate.
Run before retrieving diary entries from servers. TODAY is t to
initialize for today's date, nil otherwise."
- (message "Retrieving diary entries via Excorporate...")
;; Keep today's entries if running on a day other than today. If
;; retrieving results for today, delete results from days other than
;; today, in case the transient file (having been filled in on a
@@ -149,6 +152,7 @@ the arguments to the advisee."
;; `diary-view-entries' are ignored.
(exco-connection-iterate
(lambda ()
+ (message "Retrieving diary entries via Excorporate...")
(exco-diary-initialize (calendar-date-equal today date)))
(lambda (identifier callback)
(cl-destructuring-bind (month day year) date
@@ -166,7 +170,13 @@ the arguments to the advisee."
(let ((appt-display-diary nil))
(appt-check t))
(message "Done retrieving diary entries via Excorporate."))
- t))
+ t)
+ ;; Just return nil from this advice. We eventually run the advisee
+ ;; asynchronously so there is no way of providing the same return
+ ;; value as the unadvised `diary' and `diary-view-entries'
+ ;; functions. Luckily they seem to only be used interactively, at
+ ;; least within Emacs itself.
+ nil)
(defun exco-diary-diary-around (original-diary &rest arguments)
"Call `diary' asynchronously.
@@ -192,7 +202,10 @@ ARGUMENTS are the arguments to `diary-view-entries'."
(defun excorporate-diary-enable ()
"Enable Excorporate diary support."
(interactive)
- ;; Remove these first so that `diary' will not be run by any save
+ ;; Create the directory for Excorporate diary files if it doesn't
+ ;; already exist.
+ (exco-diary-initialize t)
+ ;; Remove advice first so that `diary' will not be run by any save
;; hooks.
(advice-remove #'diary #'exco-diary-diary-around)
(advice-remove #'diary-view-entries #'exco-diary-diary-view-entries-override)
@@ -209,12 +222,11 @@ ARGUMENTS are the arguments to `diary-view-entries'."
(advice-add #'diary :around #'exco-diary-diary-around)
(advice-add #'diary-view-entries :override
#'exco-diary-diary-view-entries-override)
- (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)
- (add-hook 'diary-list-entries-hook 'diary-sort-entries)
+ (add-hook 'diary-list-entries-hook #'diary-sort-entries)
+ (add-hook 'diary-list-entries-hook #'diary-include-other-diary-files)
(appt-activate 1)
(message "Excorporate diary support enabled."))
-;;;###autoload
(defun excorporate-diary-disable ()
"Disable Excorporate diary support."
(interactive)
diff --git a/excorporate.el b/excorporate.el
index e458028..0b0120e 100644
--- a/excorporate.el
+++ b/excorporate.el
@@ -1,6 +1,6 @@
;;; excorporate.el --- Exchange integration -*- lexical-binding: t
-*-
-;; Copyright (C) 2014-2016 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2018 Free Software Foundation, Inc.
;; Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org>
@@ -8,7 +8,7 @@
;; Version: 0.7.7
;; Keywords: calendar
;; Homepage: https://www.fitzsim.org/blog/
-;; Package-Requires: ((emacs "24.4") (fsm "0.2") (soap-client "3.1.4")
(url-http-ntlm "2.0.3"))
+;; Package-Requires: ((emacs "24.1") (fsm "0.2") (soap-client "3.1.4")
(url-http-ntlm "2.0.3") (nadvice "0.2"))
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -102,6 +102,10 @@
;; Fabio Leimgruber <fabio.leimgruber@web.de> tested NTLM
;; authentication against a challenging server configuration.
+;; Stefan Monnier <monnier@iro.umontreal.ca> wrote a variant of
+;; nadvice.el for GNU ELPA so that Excorporate could continue
+;; supporting Emacs versions 24.1, 24.2 and 24.3.
+
;;; Code:
;; Implementation-visible functions and variables.
@@ -728,7 +732,7 @@ processing is done."
(when (equal countdown 0)
(apply finalize arguments)))))
(if (equal countdown 0)
- (funcall finalize identifier)
+ (funcall finalize)
(exco--calendar-item-dolist
calendar-item items
(exco-calendar-item-get-details
- [elpa] externals/excorporate ebbf99a 78/93: Excorporate: Document new interactive functions, (continued)
- [elpa] externals/excorporate ebbf99a 78/93: Excorporate: Document new interactive functions, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate ff4e272 74/93: Excorporate: Simplify organizer handling in Org backend, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 0d014c7 64/93: Excorporate: Support appointment creation, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate de50497 75/93: Excorporate: Support replying to meeting requests in Org buffer, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate ebf91e4 50/93: excorporate-diary: Update warning message, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 5bd2608 59/93: Excorporate: Support appointment deletion, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 064e34d 57/93: packages/excorporate/excorporate.el: Adjust case in example URL, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 6487138 70/93: Excorporate: Adjust some documentation strings, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate da3898b 85/93: Excorporate: Rename a function, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 96a76cd 90/93: Excorporate: Adjust some URLs in the manual, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 47d2698 32/93: packages/excorporate: Support diary on Emacs 24.1, 24.2, 24.3,
Stefan Monnier <=
- [elpa] externals/excorporate 77030b3 37/93: packages/excorporate: Fix generated whitespace issue, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 7849d8f 42/93: excorporate-diary: Add feature idea comment, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate f3888e1 77/93: Excorporate: Require Org 9.0 or newer, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 2f76f57 71/93: Excorporate: Change organizer representation, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 30cc0bd 63/93: Excorporate: Add appointment deletion in Org buffer, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 538e908 68/93: Excorporate: Support cancelling meetings in Org buffer, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 8e7779a 81/93: Excorporate: Expand responses in API usage examples, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 5f81163 88/93: Excorporate: Fix a byte-compilation warning, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 34827cc 06/93: packages/excorporate: Retrieve Services.wsdl directly, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate da2b980 08/93: packages/excorporate: Improve exco-get-meetings-for-day, Stefan Monnier, 2020/11/29