Bill Clementson <[EMAIL PROTECTED]> writes:
> Hi Tamas/Tassilo,
Yes, Hi :) anything and anything-config are awesome! Thanks!
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
>
>> Hi,,
>>
>> On Aug 23, 9:58 pm, Tassilo Horn <[EMAIL PROTECTED]> wrote:
>>>
>>> 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!
>
> Interestingly, I tried the same thing a few days ago (for much the
> same reason - I wanted to have a "trimmed-down" anything configuration
> for "normal" use and a "heavy-weight" anything configuration for
> "special" searches).
...
>> You can try setting anything-source-filter manually and start Anything
>> after that.
>
> It doesn't work if an anything buffer doesn't exist.
Hmm. Maybe this is the same reason I couldn't create a key on
anything-map that switches to a specific buffer. I figured I just
didn't understand anything.el well enough yet. Is it me or anything.el
that's lacking? :)
A friend of mine wants to be able to press the "anything key" twice in a
row to swap between the two most recent buffers. This should be easy
but my solution is convoluted.
I have anything bound to C-^ so the goal is to make C-^ C-^ swap between
the last two buffers that anything has visited. I started out just
worrying about buffers that were chosen via the 'buffer' source. My
solution is below but it's so clunky! It involves faking a user press
of TAB (via self-insert-command).
(defvar anything-previous-buffer nil
"Second to last buffer anything visted.")
(defvar anything-current-buffer nil
"Last buffer anything visted.")
(defvar anything-source-buffers-plus-last
(buffer . (("Switch to Buffer"
. (lambda (buffer)
(if anything-current-buffer
(setq anything-previous-buffer anything-current-buffer))
(setq anything-current-buffer buffer)
(switch-to-buffer buffer)))
("Switch to Last Buffer" . anything-switch-to-last-buffer)
("Pop to Buffer" . pop-to-buffer)
("Display Buffer" . display-buffer)
("Kill Buffer" . kill-buffer)))))
(defun anything-switch-to-last-buffer (&optional junk)
(interactive)
(if anything-previous-buffer
(let ((switch-to anything-previous-buffer))
(setq anything-current-buffer anything-previous-buffer)
(setq anything-previous-buffer (buffer-name (current-buffer)))
(switch-to-buffer switch-to))
(message "Anything has not visited enough buffers yet.")))
(defun anything-fake-switch-to-last-buffer ()
(interactive)
;; 9 = TAB on a terminal anyhow
(self-insert-command 9)
(anything-next-line)
(anything-exit-minibuffer))
(define-key anything-map "\C-^" 'anything-fake-switch-to-last-buffer)
_______________________________________________
gnu-emacs-sources mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources