Re: Anything.el for Windows
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Anything.el for Windows         

Group: gnu.emacs.help · Group Profile
Author: Tassilo Horn
Date: Feb 19, 2008 06:08

Sébastien Vauban spammotel.com> writes:

Hi Sébastien,
> delayed-sources = ((name . Tracker Search) (name . Locate))
>
> But I never saw any "Locate" results...

Ok, but at least the locate source should be processed.

Please eval the following defun and invoke anything. Then go to
*Messages* and see if there's an error message of the form

Error processing source: ...

--8<---------------cut here---------------start------------->8---
(defun anything-process-source (source)
"Display matches from SOURCE according to its settings."
(let (matches)
(if (equal anything-pattern "")
(progn
(setq matches (anything-get-cached-candidates source))
(if (> (length matches) anything-candidate-number-limit)
(setq matches
(subseq matches 0 anything-candidate-number-limit))))

(condition-case err-var
(let ((item-count 0)
(functions (assoc-default 'match source))
exit)

(unless functions
(setq functions
(list (lambda (candidate)
(string-match anything-pattern candidate)))))

(dolist (function functions)
(let (newmatches)
(dolist (candidate (anything-get-cached-candidates source))
(when (and (not (member candidate matches))
(funcall function (if (listp candidate)
(car candidate)
candidate)))
(push candidate newmatches)

(when anything-candidate-number-limit
(incf item-count)
(when (= item-count anything-candidate-number-limit)
(setq exit t)
(return)))))

(setq matches (append matches (reverse newmatches)))

(if exit
(return)))))

(invalid-regexp (setq matches nil))
(error (message "Error processing source %%s: %%s" source err-var))))

(let* ((transformer (assoc-default 'filtered-candidate-transformer source)))
(if transformer
(setq matches (funcall transformer matches source))))

(when matches
(anything-insert-header (assoc-default 'name source))

(dolist (match matches)
(when (and anything-enable-digit-shortcuts
(not (eq anything-digit-shortcut-count 9)))
(move-overlay (nth anything-digit-shortcut-count
anything-digit-overlays)
(line-beginning-position)
(line-beginning-position))
(incf anything-digit-shortcut-count))

(anything-insert-match match 'insert)))))
--8<---------------cut here---------------end--------------->8---

BTW: Do other sources that return files work for you, i.e. the file name
history source? If not, then the problem might be that a candidate
transformer for files doesn't work on windows.

Bye,
Tassilo
--
Some people wear Superman pajamas. Superman wears Chuck Norris pajamas.
no comments
diggit! del.icio.us! reddit!