Function: calendar-dlet
calendar-dlet is a macro defined in calendar.el.gz.
Signature
(calendar-dlet BINDERS &rest BODY)
Documentation
Like dlet but without warnings about non-prefixed var names.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/calendar.el.gz
;; Calendar has historically relied heavily on dynamic scoping.
;; Concretely, this manifests in the use of references to let-bound variables
;; in Custom vars as well as code in diary files.
;; 'eval' is hence the core of the culprit. It's used on:
;; - calendar-date-display-form
;; - calendar-time-display-form
;; - calendar-chinese-time-zone
;; - in cal-dst's there are various calls to 'eval' but they seem not to refer
;; to let-bound variables, surprisingly.
;; - calendar-date-echo-text
;; - calendar-mode-line-format
;; - cal-tex-daily-string
;; - diary-date-forms
;; - diary-remind-message
;; - calendar-holidays
;; - calendar-location-name
;; - whatever is passed to calendar-string-spread
;; - whatever is passed to calendar-insert-at-column
;; - whatever is passed to diary-sexp-entry
;; - whatever is passed to diary-remind
(defmacro calendar-dlet (binders &rest body)
"Like `dlet' but without warnings about non-prefixed var names."
(declare (indent 1) (debug let))
(let ((vars (mapcar (lambda (binder)
(if (consp binder) (car binder) binder))
binders)))
`(with-suppressed-warnings ((lexical ,@vars))
(dlet ,binders ,@body))))