Function: diary-icalendar-y-or-n-or-edit-p
diary-icalendar-y-or-n-or-edit-p is a byte-compiled function defined
in diary-icalendar.el.gz.
Signature
(diary-icalendar-y-or-n-or-edit-p PROMPT)
Documentation
Like y-or-n-p, but with the option to enter a recursive edit.
Adds a message to current binding of help-form explaining how.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/diary-icalendar.el.gz
(defun di:y-or-n-or-edit-p (prompt)
"Like `y-or-n-p', but with the option to enter a recursive edit.
Adds a message to current binding of `help-form' explaining how."
(let* ((allow-edits-map
(let ((map (make-sparse-keymap)))
(define-key map [remap edit]
(lambda ()
(interactive)
(save-excursion
(save-window-excursion
(recursive-edit)))))
map))
(y-or-n-p-map (make-composed-keymap allow-edits-map
y-or-n-p-map))
(help-form
(concat (when (stringp help-form) (concat help-form "\n\n"))
;; FIXME: should use substitute-command-keys here, but
;; for some reason, even with \<y-or-n-p-map>, it
;; doesn't find the C-r and C-M-c bindings and only
;; suggests M-x ...
"Type C-r to enter recursive edit before answering "
"(C-M-c to exit).")))
(save-excursion
(save-restriction
(y-or-n-p prompt)))))