summaryrefslogtreecommitdiff
path: root/test/src/comp-resources/comp-test-45603.el
blob: f1c0dafb68da03ebba3e8389a6a93ea7b4e47a7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
;;; -*- lexical-binding: t; -*-

;; Reduced from ivy.el.

(defvar comp-test-45603-last)
(defvar comp-test-45603-mark-prefix)
(defvar comp-test-45603-directory)
(defvar comp-test-45603-marked-candidates)

(defun comp-test-45603--call-marked (action)
  (let* ((prefix-len (length comp-test-45603-mark-prefix))
         (marked-candidates
          (mapcar
           (lambda (s)
             (let ((cand (substring s prefix-len)))
               (if comp-test-45603-directory
                   (expand-file-name cand comp-test-45603-directory)
                 cand)))
           comp-test-45603-marked-candidates))
         (multi-action (comp-test-45603--get-multi-action comp-test-45603-last)))))

(defalias 'comp-test-45603--file-local-name
  (if (fboundp 'file-local-name)
      #'file-local-name
    (lambda (file)
      (or (file-remote-p file 'localname) file))))

(provide 'comp-test-45603)