       (modi/imenu-list-hide))
     (bind-key "C-<return>"
               #'modi/imenu-list-goto-entry-and-hide
-              imenu-list-major-mode-map)))
+              imenu-list-major-mode-map)
+
+    (defun modi/imenu-auto-update (orig-fun &rest args)
+      "Auto update the *Ilist* buffer if visible."
+      (apply orig-fun args)
+      (when (modi/imenu-list-visible-p)
+        (imenu-list-update-safe))) ; update `imenu-list' buffer
+    (advice-add 'switch-to-buffer :around #'modi/imenu-auto-update)
+    (advice-add 'revert-buffer    :around #'modi/imenu-auto-update)))
 
 
 (provide 'setup-imenu-list)

      (switch-to-buffer-other-window imenu-list-buffer-name)
      (quit-window))

    (defun modi/imenu-list-display-toggle (noselect)
      "Toggle the display of Imenu-list buffer.

If NOSELECT is non-nil, do not select the imenu-list buffer."
      (interactive "P")
      (let ((imenu-list-visible))
        (dolist (win (window-list))
          (when (string-match-p "\\`\\*Ilist\\*\\'" (buffer-name (window-buffer win)))
            (setq imenu-list-visible t)))
        (if imenu-list-visible
            (modi/imenu-list-hide)
          (if noselect
              (imenu-list-noselect)
            (imenu-list)))))

    (defun modi/imenu-list-goto-entry-and-hide ()
      "Execute `imenu-list-goto-entry' and hide the imenu-list buffer."

;; Time-stamp: <2015-07-15 09:33:26 kmodi>

;; Imenu-list
;; https://github.com/bmag/imenu-list
