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: billclem
Subject: Re: ;;; anything.el --- open anything
Date: Sat, 28 Jul 2007 00:56:13 -0000
User-agent: G2/1.0

On Jul 27, 11:31 am, address@hidden wrote:
> Hi Tassilo,
>
> On Jul 27, 4:12 am, Tassilo Horn <address@hidden> wrote:
>
>
>
> > now there are the variables
>
> >     anything-action-transformers-file
> >     anything-action-transformers-buffer
> >     anything-action-transformers-function
> >     ...
>
> > which should be lists of functions with parameters ACTIONS (the list of
> > actions so far) and CANDIDATE (the selected file / buffer / function /
> > ...). Those functions may modify the list of actions somehow and return
> > it.
>
> > The function
>
> >     anything-transform-file-actions
>
> > calls each function in `anything-action-transformers-file' and builds
> > the list of actions then. It's the same for all other types.
>
> > So now you can easily write transformer function an add them to the
> > appropriate `anything-action-transformers-TYPE' list.
>
> Looks like a good idea; however, your latest anything-config.el
> changes have introduced a lot of breakage:
>
> 1. defparameter is used and should be changed to defvar
> 2. When anything is called and exited with C-g, some of the anything
>    results are pasted into the current buffer
> 3. When anything is called, the cursor is now positioned on the last
>    line rather than the first one
>
> Maybe you checked it in too quickly or you are using an older version
> of anything.el?

It looks like anything-source-imenu was the cause of problems #1, #2,
& #3. A #4 issue that occurs with the anything-source-imenu code in
anything-config.el is that it causes anything to not work if you call
anything in a dired buffer. I've commented out the definition in
anything-config.el and put the following replacement definition for
anything-source-imenu in my .emacs file - it works ok for me and
eliminates the 4 problems:

(setq anything-source-imenu
      '((name . "Imenu")
        (init-func . (lambda ()
                       (setq anything-imenu-current-buffer
                             (current-buffer))))
        (candidates . (lambda ()
                        (condition-case nil
                            (with-current-buffer anything-imenu-
current-buffer
                              (mapcar (lambda (x)
                                        (cons (car x) x))
                                      ;; leave only top level
completions
                                      ;; for simplicity (could be more
                                      ;; sophisticated)
                                      (remove-if-not (lambda (x)
                                                       (markerp (cdr
x)))
                                                     (imenu--make-
index-alist))))
                          (error nil))))
        (action . imenu)))

- Bill



reply via email to

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