[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/excorporate 644d66c 1/5: Relocate time zone defcustom a
From: |
Thomas Fitzsimmons |
Subject: |
[elpa] externals/excorporate 644d66c 1/5: Relocate time zone defcustom and defun |
Date: |
Wed, 7 Apr 2021 21:54:13 -0400 (EDT) |
branch: externals/excorporate
commit 644d66cbff088b82f282bbc0b99d84c0bff09576
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Relocate time zone defcustom and defun
* excorporate.el (excorporate-time-zone)
(excorporate-customize-time-zone): Move to
excorporate-time-zones.el.
---
excorporate-time-zones.el | 25 +++++++++++++++++++++++++
excorporate.el | 24 ------------------------
2 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/excorporate-time-zones.el b/excorporate-time-zones.el
index 0a17be9..6c78081 100644
--- a/excorporate-time-zones.el
+++ b/excorporate-time-zones.el
@@ -833,6 +833,31 @@
(concat "A hash table mapping `current-time-zone' values to"
" IANA/Olson time zone names."))
+(defcustom excorporate-time-zone nil
+ "The server-style time zone.
+If this variable is nil, Excorporate will compute a time zone
+automatically based on `current-time-zone'. If that doesn't
+work, or you want to specify the time zone directly, run
+`excorporate-customize-time-zone' to customize this variable from
+a list of valid values."
+ :type '(choice :menu-tag "Server-style time zone"
+ :tag "Server-style time zone"
+ (const :tag "Compute from Emacs time zone" nil)
+ string)
+ :group 'excorporate)
+
+(defun excorporate-customize-time-zone ()
+ "Prompt for a server-style time zone from a list of valid values."
+ (interactive)
+ (let ((zone (completing-read
+ "Excorporate time zone: "
+ (cons "Emacs Built-in"
+ (hash-table-values exco--time-zone-olson-to-server))
+ nil t)))
+ (unless (equal zone "")
+ (customize-save-variable 'excorporate-time-zone
+ (if (equal zone "Emacs Built-in") nil zone)))))
+
(defun exco-time-zone (&optional emacs-time-zone)
"Return server style time zone string.
Return `excorporate-time-zone' if it is non-nil, or look up the
diff --git a/excorporate.el b/excorporate.el
index 88a5658..d40cc17 100644
--- a/excorporate.el
+++ b/excorporate.el
@@ -140,18 +140,6 @@ interactive functions, `excorporate-diary-disable' and
`excorporate-diary-enable'."
:type 'boolean)
-(defcustom excorporate-time-zone nil
- "The server-style time zone.
-If this variable is nil, Excorporate will compute a time zone
-automatically based on `current-time-zone'. If that doesn't
-work, or you want to specify the time zone directly, run
-`excorporate-customize-time-zone' to customize this variable from
-a list of valid values."
- :type '(choice :menu-tag "Server-style time zone"
- :tag "Server-style time zone"
- (const :tag "Compute from Emacs time zone" nil)
- string))
-
;; For Office 365, URLs containing autodiscover-s.outlook.com do not
;; seem to work properly (the returned XML gives ErrorCode 600).
(defconst exco--autodiscovery-templates
@@ -1254,18 +1242,6 @@ ARGUMENT is the prefix argument."
(t
(error "Excorporate: Invalid configuration"))))
-(defun excorporate-customize-time-zone ()
- "Prompt for a server-style time zone from a list of valid values."
- (interactive)
- (let ((zone (completing-read
- "Excorporate time zone: "
- (cons "Emacs Built-in"
- (hash-table-values exco--time-zone-olson-to-server))
- nil t)))
- (unless (equal zone "")
- (customize-save-variable 'excorporate-time-zone
- (if (equal zone "Emacs Built-in") nil zone)))))
-
(defun excorporate-disconnect ()
"Disconnect a server connection."
(interactive)