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: Thu, 23 Aug 2007 21:58:00 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

"address@hidden" <address@hidden> writes:

Hi Tamas,

>> I need to look through your newes changes and see how I can make some
>> sane defaults for anything-config.  Especially the dynamic source
>> selection is cool.  Does it only suppress listing of source results
>> or does it suppress calculation, too?  The latter would be superb,
>> since I like so many sources that the calculations slow down emacs
>> considerably.
>
> If you mean anything-set-source-filter then only those sources are
> calculated which are in the filter.

Hey, I played a bit with them and they're great.  But I have another
suggestion: it would be mega-funky if you could ADD sources dynamically.
So you have a slick default anything-sources and if I don't find what
you're looking for, you hit a key and some very powerful but expensive
sources are added.

Oh, while I was typing those lines I realized that it's possible right
now!  Add every and each source to anything-sources and fire up anything
with

(defun th-anything ()
  (interactive)
  (anything-set-source-filter '(anything-c-source-foo
                                anything-c-source-bar
                                anything-c-source-baz))
  (anything))

Oh, doesn't work!  It errors!

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument window-live-p nil)
  ad-Orig-select-window(nil nil)
  select-window(nil)
  (progn (select-window (get-buffer-window anything-buffer ...)) (case unit 
(line ...) (page ...) (source ...) (t ...)) (while (anything-pos-header-line-p) 
(forward-line ...)) (if (eobp) (forward-line -1)) (anything-mark-current-line))
  (unwind-protect (progn (select-window ...) (case unit ... ... ... ...) (while 
... ...) (if ... ...) (anything-mark-current-line)) (dolist (elt 
save-selected-window-alist) (and ... ... ...)) (if (window-live-p 
save-selected-window-window) (select-window save-selected-window-window)))
  (save-current-buffer (unwind-protect (progn ... ... ... ... ...) (dolist ... 
...) (if ... ...)))
  (let ((save-selected-window-window ...) (save-selected-window-alist ...)) 
(save-current-buffer (unwind-protect ... ... ...)))
  (save-selected-window (select-window (get-buffer-window anything-buffer ...)) 
(case unit (line ...) (page ...) (source ...) (t ...)) (while 
(anything-pos-header-line-p) (forward-line ...)) (if (eobp) (forward-line -1)) 
(anything-mark-current-line))
  (if (= (buffer-size ...) 0) nil (save-selected-window (select-window ...) 
(case unit ... ... ... ...) (while ... ...) (if ... ...) 
(anything-mark-current-line)))
  (unless (= (buffer-size ...) 0) (save-selected-window (select-window ...) 
(case unit ... ... ... ...) (while ... ...) (if ... ...) 
(anything-mark-current-line)))
  anything-move-selection(line next)
  anything-next-line()
  (let (delayed-sources) (dolist (source ...) (if ... ...)) (goto-char 
(point-min)) (run-hooks (quote anything-update-hook)) (anything-next-line) 
(anything-maybe-fit-frame) (run-with-idle-timer (if ... 0.1 0) nil (quote 
anything-process-delayed-sources) delayed-sources))
  (save-current-buffer (set-buffer anything-buffer) (erase-buffer) (if 
anything-enable-digit-shortcuts (dolist ... ...)) (let (delayed-sources) 
(dolist ... ...) (goto-char ...) (run-hooks ...) (anything-next-line) 
(anything-maybe-fit-frame) (run-with-idle-timer ... nil ... delayed-sources)))
  (with-current-buffer anything-buffer (erase-buffer) (if 
anything-enable-digit-shortcuts (dolist ... ...)) (let (delayed-sources) 
(dolist ... ...) (goto-char ...) (run-hooks ...) (anything-next-line) 
(anything-maybe-fit-frame) (run-with-idle-timer ... nil ... delayed-sources)))
  anything-update()
  anything-set-source-filter(("Emacs Functions"))
  th-anything()
  call-interactively(th-anything)
  execute-extended-command(nil)
  call-interactively(execute-extended-command)
--8<---------------cut here---------------end--------------->8---

And the other way round it has no effect.

(defun th-anything ()
  (interactive)
  (anything)
  (anything-set-source-filter '(anything-c-source-foo
                                anything-c-source-bar
                                anything-c-source-baz)))

:-(

Could this be done somehow?  Now that I imagined how useful it is, I
cannot live without it anymore. ;-)

Bye,
Tassilo
-- 
      "DRM manages rights in the same way a jail manages freedom"





reply via email to

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