gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ;;; anything.el --- open anything


From: Tassilo Horn
Subject: Re: ;;; anything.el --- open anything
Date: Tue, 31 Jul 2007 15:41:03 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

address@hidden writes:

Hi Bill,

> (setq anything-transform-files-excludes (list "/Applications/cache/"
>                                             "/.backups"
>                                             "/.svn"
>                                             "/CVS"
>                                             "/.DS_Store"
>                                             "/.cvsignore"))
>
> (defun anything-transform-files (files)
>   "Transform file candidates."
>
>   (if anything-transform-files-excludes
>       (setq files (let ((filtered-files nil))
>                   (loop for file in files
>                         do (if (loop for regexp in 
> anything-transform-files-excludes
>                                      do (if (string-match regexp file) 
> (return nil))
>                                      finally (return file))
>                                (setq filtered-files (append (list file) 
> filtered-files)))
>                         finally (return filtered-files)))))
>
>   (let ((boring-file-regexp
>          (concat "\\(?:" (regexp-opt completion-ignored-extensions) "\
> \)\\'")))
>     (mapcar (lambda (file)
>               ;; Add shadow face property to boring files.
>               (let ((face (if (facep 'file-name-shadow)
>                               'file-name-shadow
>                             ;; fall back to default on XEmacs
>                             'default)))
>                 (if (string-match boring-file-regexp file)
>                     (setq file (propertize file 'face face))))
>
>               ;; replace path of HOME directory in paths with the
> string
>               ;; <home>
>               (let ((home (replace-regexp-in-string "\\\\" "/" ;
> stupid Windows...
>                                                     (getenv "HOME"))))
>                 (if (string-match home file)
>                     (cons (replace-match "<home>" nil nil file) file)
>                   file)))
>             files)))

Hey, that's nice. I'll integrate it in anything-config.el, but I'll
modify it a bit to have the same interface as the action transformers.

Bye,
Tassilo
-- 
The movie "Delta Force" was extremely  hard to make because Chuck had to
downplay his abilities. The first few cuts were completely unbelievable.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]