[EMAIL PROTECTED] writes: > Hmm, that requires 2 more keystrokes than my command, so I think I'll > just keep it in my .emacs file as I use that action quite a > lot. Incidentally, I wrote a little helper macro that adds new actions > to the existing ones (I find the "standard" actions quite useful, so I > don't want to do a reassignment that just replicates what's already in > anything-config.el and I also I didn't want to have to clone the > variable assignment every time a new version of anything-config.el > came out with additional actions). You might want to add it to > anything-config.el if you think others might also find it useful: > > (defmacro anything-add-to-actions (var field action) > `(setq ,var (cons ',field > (append > (cdr ,var) > (list ',action))))) > > To add the two actions I sent in earlier, one would do the following: > > (anything-add-to-actions anything-actions-file > file > ("Open File with default Tool" . > (lambda (filename) > (call-process "/usr/bin/open" nil 0 nil > filename)))) > > (anything-add-to-actions anything-actions-function > function > ("Find Function" . > (lambda (command-name) > (find-function (intern command-name))))) >
Actually, the macro should be: (defmacro anything-add-to-actions (var action) `(setq ,var (cons (car ,var) (append (cdr ,var) (list ',action))))) And to add an action: (anything-add-to-actions anything-actions-file ("Open File with default Tool" . (lambda (filename) (call-process "/usr/bin/open" nil 0 nil filename)))) -- Bill Clementson _______________________________________________ gnu-emacs-sources mailing list gnu-emacs-sources@gnu.org http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources