     (persistent-action . anything-find-files-persistent-action)
     (volatile)
     (action . ,(delq nil `(("Find File" . find-file-at-point)
-                           ("Find file other window" . find-file-other-window)
                            ("Find file in Dired" . anything-c-point-file-in-dired)
                            ,(when (require 'elscreen nil t)
                                   '("Find file in Elscreen"  . elscreen-find-file))
+                           ("Complete at point" . anything-c-insert-file-name-completion-at-point)
+                           ("Delete File(s)" . anything-delete-marked-files)
                            ("Find file as root" . anything-find-file-as-root)
-                           ("Delete File(s)" . anything-delete-marked-files))))))
+                           ("Find file other window" . find-file-other-window)
+                           ("Find file other frame" . find-file-other-frame))))))
 
 ;; (anything 'anything-c-source-find-files)
 

              (require 'bookmark-extensions)
              (bookmark-maybe-load-default-file)))
    (candidates . anything-c-bookmark-ssh-files-setup-alist)
    (type . bookmark)))
;; (anything 'anything-c-source-bookmark-ssh-files&dirs)


when the user goes to the action list with TAB."
  (anything-c-adaptive-store-selection))

(defun anything-c-source-use-adaptative-p (&optional source-name)
  "Return current source only if it use adaptative history, nil otherwise."
  (let* ((source (or source-name (anything-get-current-source)))
         (adapt-source (or (assoc-default 'filtered-candidate-transformer
                                          (assoc (assoc-default 'type source)
                                                 anything-type-attributes))
                           (assoc-default 'candidate-transformer
                                          (assoc (assoc-default 'type source)
                                                 anything-type-attributes))
                           (assoc-default 'filtered-candidate-transformer source)
                           (assoc-default 'candidate-transformer source))))
    (if (listp adapt-source)
        (when (member 'anything-c-adaptive-sort adapt-source) source)
        (when (eq adapt-source 'anything-c-adaptive-sort) source))))

(defun anything-c-adaptive-store-selection ()
  "Store history information for the selected candidate."
  (unless anything-c-adaptive-done
    (setq anything-c-adaptive-done t)
    (let ((source (anything-c-source-use-adaptative-p)))
      (when source
        (let* ((source-name (or (assoc-default 'type source)
                                (assoc-default 'name source)))
               (source-info (or (assoc source-name anything-c-adaptive-history)
                                (progn
                                  (push (list source-name) anything-c-adaptive-history)
                                  (car anything-c-adaptive-history))))
               (selection (anything-get-selection))
               (selection-info (progn
                                 (setcdr source-info
                                         (cons
                                          (let ((found (assoc selection (cdr source-info))))
                                            (if (not found)
                                                ;; new entry
                                                (list selection)

                                                ;; move entry to the beginning of the
                                                ;; list, so that it doesn't get
                                                ;; trimmed when the history is
                                                ;; truncated
                                                (setcdr source-info
                                                        (delete found (cdr source-info)))
                                                found))
                                          (cdr source-info)))
                                 (cadr source-info)))
               (pattern-info (progn
                               (setcdr selection-info
                                       (cons
                                        (let ((found (assoc anything-pattern (cdr selection-info))))
                                          (if (not found)
                                              ;; new entry
                                              (cons anything-pattern 0)

                                              ;; move entry to the beginning of the
                                              ;; list, so if two patterns used the
                                              ;; same number of times then the one
                                              ;; used last appears first in the list
                                              (setcdr selection-info
                                                      (delete found (cdr selection-info)))
                                              found))
                                        (cdr selection-info)))
                               (cadr selection-info))))

          ;; increase usage count
          (setcdr pattern-info (1+ (cdr pattern-info)))

          ;; truncate history if needed
          (if (> (length (cdr selection-info)) anything-c-adaptive-history-length)
              (setcdr selection-info
                      (subseq (cdr selection-info) 0 anything-c-adaptive-history-length))))))))

(if (file-readable-p anything-c-adaptive-history-file)
    (load-file anything-c-adaptive-history-file))
