(completion-auto-help): Move from C code.
(minibuffer--maybe-completion-help): Remove.
(minibuffer--bitset): New function.
(minibuffer--do-completion): Rename from minibuffer-do-completion.
Renumber a bit. Really complete on string *before* point.
Add argument used for word-completion.
Join trailing / in completion with following text, as done in
minibuffer-complete-word.
Handle new value `lazy' for completion-auto-help.
(minibuffer-try-word-completion): New function extracted from
minibuffer-complete-word.
(minibuffer-complete-word): Use minibuffer--do-completion.
(minibuffer--insert-strings): Rename from
minibuffer-complete-insert-strings.
(exit-minibuffer): Fix typo.
* cus-edit.el (minibuffer): Move group to minibuffer.el.
* cus-start.el: Remove completion-auto-help.
* minibuf.c (Vcompletion_auto_help): Move to minibuffer.el.
(syms_of_minibuf): Remove its initialization.
Access date elements directly rather than using calendar functions.
(org-read-date, org-goto-calendar, org-agenda-goto-calendar):
Also set calendar-view-diary-initially-flag,
calendar-view-holidays-initially-flag
(org-get-entries-from-diary): Also set diary-fancy-buffer.
(org-agenda-execute-calendar-command): No need to set displayed-day.
(timer_check): Run it.
(syms_of_keyboard): Initialize it.
* terminal.c (Qrun_hook_with_args, Qdelete_terminal_functions)
(Vdelete_terminal_functions): New vars.
(syms_of_terminal): Initialize them.
(Fdelete_terminal): Run delete-terminal-functions.
* xdisp.c (safe_eval): Rewrite.
(safe_call2): New fun.
* frame.c (Qdelete_frame_functions): New var.
(syms_of_frame): Initialize it.
(Fdelete_frame): Use it and use safe_call2 and pending_funcalls.
* lisp.h (safe_call2, pending_funcalls): Declare.
* dispextern.h (struct image): Add `dependencies' field.
(clear_image_caches): Change arg to Lisp_Object.
* image.c (make_image): Initialize `dependencies' field.
(clear_image_cache): Change arg to allow fine-grained flushing.
Perform the flush even if image-cache-eviction-delay is nil.
(clear_image_caches): Change arg to Lisp_Object.
(Fclear_image_cache): Expand meaning of the argument.
(mark_image): Mark `dependencies' field.
* xfaces.c (clear_face_cache): Adapt arg to call to clear_image_caches.
(lface_hash): Use XHASH rather than XFASTINT.
(face_at_buffer_position): Fix int -> EMACS_INT position.
* xdisp.c (next_overlay_change): Fix int -> EMACS_INT position.
(select_frame_for_redisplay): Remove code duplication.
(redisplay_internal): Adapt arg to call to clear_image_caches.