diff options
| author | Paul Eggert | 2019-08-01 15:34:35 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-08-01 15:47:15 -0700 |
| commit | fbd2ea1f73f3262636efacfe77ad33dc8a4d826f (patch) | |
| tree | 53387c8bf1efe425dd0a0cc90330cebed405805d | |
| parent | 24b60b75ea544f0c2df740d40592c6665c123523 (diff) | |
| download | emacs-fbd2ea1f73f3262636efacfe77ad33dc8a4d826f.tar.gz emacs-fbd2ea1f73f3262636efacfe77ad33dc8a4d826f.zip | |
Fix two parse-time-months invalid assumptions
* lisp/gnus/nnimap.el: Do not require parse-time.
* lisp/gnus/nnimap.el (nnimap-find-expired-articles):
* lisp/net/pop3.el (pop3-make-date):
Just use system-time-locale and format-time-string; no need to
refer to parse-time-months.
* lisp/net/pop3.el (parse-time-months): Remove defvar.
* lisp/net/tramp-smb.el (tramp-smb-read-file-entry):
Add FIXME comment about this.
| -rw-r--r-- | lisp/gnus/nnimap.el | 9 | ||||
| -rw-r--r-- | lisp/net/pop3.el | 16 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 3 |
3 files changed, 8 insertions, 20 deletions
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index c6eaa54c692..0c5aaf32d42 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -36,7 +36,6 @@ | |||
| 36 | (require 'nnoo) | 36 | (require 'nnoo) |
| 37 | (require 'netrc) | 37 | (require 'netrc) |
| 38 | (require 'utf7) | 38 | (require 'utf7) |
| 39 | (require 'parse-time) | ||
| 40 | (require 'nnmail) | 39 | (require 'nnmail) |
| 41 | 40 | ||
| 42 | (autoload 'auth-source-forget+ "auth-source") | 41 | (autoload 'auth-source-forget+ "auth-source") |
| @@ -1097,12 +1096,8 @@ textual parts.") | |||
| 1097 | (let ((result | 1096 | (let ((result |
| 1098 | (nnimap-command | 1097 | (nnimap-command |
| 1099 | "UID SEARCH SENTBEFORE %s" | 1098 | "UID SEARCH SENTBEFORE %s" |
| 1100 | (format-time-string | 1099 | (let ((system-time-locale "C")) |
| 1101 | (format "%%d-%s-%%Y" | 1100 | (upcase (format-time-string "%d-%b-%Y" cutoff)))))) |
| 1102 | (upcase | ||
| 1103 | (car (rassoc (decoded-time-month (decode-time cutoff)) | ||
| 1104 | parse-time-months)))) | ||
| 1105 | cutoff)))) | ||
| 1106 | (and (car result) | 1101 | (and (car result) |
| 1107 | (delete 0 (mapcar #'string-to-number | 1102 | (delete 0 (mapcar #'string-to-number |
| 1108 | (cdr (assoc "SEARCH" (cdr result))))))))))) | 1103 | (cdr (assoc "SEARCH" (cdr result))))))))))) |
diff --git a/lisp/net/pop3.el b/lisp/net/pop3.el index ddb4139610e..4bf50c0d226 100644 --- a/lisp/net/pop3.el +++ b/lisp/net/pop3.el | |||
| @@ -35,7 +35,6 @@ | |||
| 35 | (eval-when-compile (require 'cl-lib)) | 35 | (eval-when-compile (require 'cl-lib)) |
| 36 | 36 | ||
| 37 | (require 'mail-utils) | 37 | (require 'mail-utils) |
| 38 | (defvar parse-time-months) | ||
| 39 | 38 | ||
| 40 | (defgroup pop3 nil | 39 | (defgroup pop3 nil |
| 41 | "Post Office Protocol." | 40 | "Post Office Protocol." |
| @@ -609,18 +608,9 @@ Return the response string if optional second argument is non-nil." | |||
| 609 | (defun pop3-make-date (&optional now) | 608 | (defun pop3-make-date (&optional now) |
| 610 | "Make a valid date header. | 609 | "Make a valid date header. |
| 611 | If NOW, use that time instead." | 610 | If NOW, use that time instead." |
| 612 | (require 'parse-time) | 611 | ;; The month name of the %b spec is locale-specific. Pfff. |
| 613 | (let* ((now (or now (current-time))) | 612 | (let ((system-time-locale "C")) |
| 614 | (zone (decoded-time-zone (decode-time now)))) | 613 | (format-time-string "%d %b %Y %T %z" now))) |
| 615 | (when (< zone 0) | ||
| 616 | (setq zone (- zone))) | ||
| 617 | (concat | ||
| 618 | (format-time-string "%d" now) | ||
| 619 | ;; The month name of the %b spec is locale-specific. Pfff. | ||
| 620 | (format " %s " | ||
| 621 | (capitalize (car (rassoc (decoded-time-month (decode-time now)) | ||
| 622 | parse-time-months)))) | ||
| 623 | (format-time-string "%Y %H:%M:%S %z" now)))) | ||
| 624 | 614 | ||
| 625 | (defun pop3-munge-message-separator (start end) | 615 | (defun pop3-munge-message-separator (start end) |
| 626 | "Check to see if a message separator exists. If not, generate one." | 616 | "Check to see if a message separator exists. If not, generate one." |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 9b87ed40cb0..568c6cb43aa 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -1814,6 +1814,9 @@ Result is the list (LOCALNAME MODE SIZE MTIME)." | |||
| 1814 | (if (and sec min hour day month year) | 1814 | (if (and sec min hour day month year) |
| 1815 | (encode-time | 1815 | (encode-time |
| 1816 | sec min hour day | 1816 | sec min hour day |
| 1817 | ;; FIXME: Won't this fail if parse-time-months is configured | ||
| 1818 | ;; by the user? See "The date/time prompt" in the Org manual. | ||
| 1819 | ;; If the code is OK as-is, perhaps explain why in a comment. | ||
| 1817 | (cdr (assoc (downcase month) parse-time-months)) | 1820 | (cdr (assoc (downcase month) parse-time-months)) |
| 1818 | year) | 1821 | year) |
| 1819 | tramp-time-dont-know)) | 1822 | tramp-time-dont-know)) |