[Top][All Lists]

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

Re: Anything.el for Windows

From: Tassilo Horn
Subject: Re: Anything.el for Windows
Date: Tue, 19 Feb 2008 15:08:09 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux)

Sébastien Vauban <address@hidden> 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 "")
          (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))

            (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)
                    (push candidate newmatches)

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

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

                (if exit

        (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
          (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.

Some people wear Superman pajamas. Superman wears Chuck Norris pajamas. 

reply via email to

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