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: address@hidden
Subject: Re: ;;; anything.el --- open anything
Date: Mon, 23 Jul 2007 10:51:48 -0000
User-agent: G2/1.0

Here's a source for Imenu for jumping to functions in the current
buffer. It was just a sudden idea, not sure how useful it is, but here
it is if anyone's interested:

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



reply via email to

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