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.
This commit is contained in:
Paul Eggert 2019-08-01 15:34:35 -07:00
parent 24b60b75ea
commit fbd2ea1f73
3 changed files with 8 additions and 20 deletions

View file

@ -36,7 +36,6 @@
(require 'nnoo)
(require 'netrc)
(require 'utf7)
(require 'parse-time)
(require 'nnmail)
(autoload 'auth-source-forget+ "auth-source")
@ -1097,12 +1096,8 @@ textual parts.")
(let ((result
(nnimap-command
"UID SEARCH SENTBEFORE %s"
(format-time-string
(format "%%d-%s-%%Y"
(upcase
(car (rassoc (decoded-time-month (decode-time cutoff))
parse-time-months))))
cutoff))))
(let ((system-time-locale "C"))
(upcase (format-time-string "%d-%b-%Y" cutoff))))))
(and (car result)
(delete 0 (mapcar #'string-to-number
(cdr (assoc "SEARCH" (cdr result)))))))))))

View file

@ -35,7 +35,6 @@
(eval-when-compile (require 'cl-lib))
(require 'mail-utils)
(defvar parse-time-months)
(defgroup pop3 nil
"Post Office Protocol."
@ -609,18 +608,9 @@ Return the response string if optional second argument is non-nil."
(defun pop3-make-date (&optional now)
"Make a valid date header.
If NOW, use that time instead."
(require 'parse-time)
(let* ((now (or now (current-time)))
(zone (decoded-time-zone (decode-time now))))
(when (< zone 0)
(setq zone (- zone)))
(concat
(format-time-string "%d" now)
;; The month name of the %b spec is locale-specific. Pfff.
(format " %s "
(capitalize (car (rassoc (decoded-time-month (decode-time now))
parse-time-months))))
(format-time-string "%Y %H:%M:%S %z" now))))
;; The month name of the %b spec is locale-specific. Pfff.
(let ((system-time-locale "C"))
(format-time-string "%d %b %Y %T %z" now)))
(defun pop3-munge-message-separator (start end)
"Check to see if a message separator exists. If not, generate one."

View file

@ -1814,6 +1814,9 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
(if (and sec min hour day month year)
(encode-time
sec min hour day
;; FIXME: Won't this fail if parse-time-months is configured
;; by the user? See "The date/time prompt" in the Org manual.
;; If the code is OK as-is, perhaps explain why in a comment.
(cdr (assoc (downcase month) parse-time-months))
year)
tramp-time-dont-know))