From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: more on anything.el inclusion Date: Thu, 01 Jul 2010 09:50:30 +0200 Organization: ThierryVolpiatto Message-ID: <87hbkjhc8p.fsf@tux.homenetwork> References: <87y6dydn6q.fsf@tux.homenetwork> <87iq509yji.fsf@lifelogs.com> <87mxucxt8w.fsf@tux.homenetwork> <87tyok8guu.fsf_-_@lifelogs.com> <87hbkkxow6.fsf@tux.homenetwork> <87pqz721fd.fsf@tux.homenetwork> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1277972247 1744 80.91.229.12 (1 Jul 2010 08:17:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 1 Jul 2010 08:17:27 +0000 (UTC) Cc: rubikitch@ruby-lang.org, emacs-devel@gnu.org To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 01 10:17:22 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OUExV-0007vb-Hy for ged-emacs-devel@m.gmane.org; Thu, 01 Jul 2010 10:17:21 +0200 Original-Received: from localhost ([127.0.0.1]:59856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUErl-0005LI-Eq for ged-emacs-devel@m.gmane.org; Thu, 01 Jul 2010 04:11:25 -0400 Original-Received: from [140.186.70.92] (port=57192 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUEaZ-0005u5-Cr for emacs-devel@gnu.org; Thu, 01 Jul 2010 03:53:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUEaX-0002LO-OL for emacs-devel@gnu.org; Thu, 01 Jul 2010 03:53:39 -0400 Original-Received: from mail-ew0-f41.google.com ([209.85.215.41]:60148) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUEaX-0002LF-G4; Thu, 01 Jul 2010 03:53:37 -0400 Original-Received: by ewy28 with SMTP id 28so769672ewy.0 for ; Thu, 01 Jul 2010 00:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject :organization:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=/GWeACFT9CyeOYCNkfXG2s+opBC+zB0z+XZg7Lqbua4=; b=YlRqOttpU7/HSK3wtMy0aHP7wvxZbXJB1lMC+4pV6Wz4v0JAYZef2F63ENL6+nnVju JL2f7LaOOk/4IFH4MOAPTv2oMWo+5Tz0gKUvrOxxHI5RA5kStmJ6VIQTZvvJ/m3XxzIZ GyFV5F82XrPcJje0YDA82rKFemeWR+y8LXYSQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=BVNwuoxWF0ZvC5rUkB323j6IeYd/uLTiZL1D04Wq7HpnKgtO1+ig5Fk0VAhFzrCeau u/mQ5vLuGrm4Cvoo5GWH9vWI8zR62VJfKZkEZmLDuG/hXIx+EWZEA3tGmSG6zF3QR8Uc vEPvJ0nU4BS47ej/b2WlwnQYa/9PsM+bml4FE= Original-Received: by 10.213.112.212 with SMTP id x20mr4848812ebp.56.1277970815513; Thu, 01 Jul 2010 00:53:35 -0700 (PDT) Original-Received: from tux.homenetwork (207.211.85-79.rev.gaoland.net [79.85.211.207]) by mx.google.com with ESMTPS id v8sm5042347eeh.14.2010.07.01.00.53.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Jul 2010 00:53:34 -0700 (PDT) In-Reply-To: (Dan Nicolaescu's message of "Thu, 01 Jul 2010 02:48:30 -0400") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:126594 Archived-At: Dan Nicolaescu writes: > Thierry Volpiatto writes: > >> Dan Nicolaescu writes: >> >>>> Actually installing anything is easy and work out of the box with only: >>>> >>>> (require 'anything-config) >>>> (require 'anything-match-plugin) ; facultatif >>> >>> For packages included in emacs we try to avoid using require to >>> activate the package. [I don't know anything about this particular >>> package, so...] >> >> A lot of autoload cookies are missing in anything-config, however, >> >> (autoload 'anything-find-files "anything-config.el" "" t) >> >> is enough to enable anything. > > That's the same as using require. The preferred way is to do it with > a function call, or a mode. > >>>> Anything is now self documented both in mode-line and with C-h m or your >>>> usual help command, but yes a manual would be nice. >>> >>> Can you please add some brief description of what it actually does? >>> >>> ;;;; anything.el --- open anything / QuickSilver-like candidate-selection framework >>> >>> does not tell much... >> >> anything is a framework that allow to setup an interactive and >> incremental display to select candidate and provide diverses actions on >> it or many of them. >> >> Basically, you can see that as a big completing-read, but incremental >> with nice display, and providing differents action on candidate selected >> in collection. > > And how do you use it? On the user side, if you use anything-config.el, there is already build in sources ready for use, so you can use provided functions like any other emacs one (e.g M-x anything-xfonts). For the developper who want to write his own anything source the best actually is to look at the sources wrote in anything-config.el. Basically, you run anything like that: (anything 'source) source is an alist that you can write like that: (Where name, candidates, action are anything attributes. You have a lot of attributes, for full info, use: M-x anything-describe-anything-attribute) (defvar mysource '((name . "A simple example that open all file with extension .el") (candidates . (lambda () (loop for i in (directory-files default-directory) when (string= (file-name-extension i) "el") collect i))) (action . (("Open file" . find-file) ("Do something else" . (lambda (candidate) ;; Write here something more ;; useful than nil nil)))))) ;; [EVAL] (anything 'mysource) After evaluating line above to see if your new source work as expected, you can now define your new anything command: (defun my-new-anything-command () (interactive) (anything 'mysource)) > BTW, this might be obvious to you, but for people that have not used > the package is not. Adding a few lines of describing what it does and > how to use it is very helpful. [Please note that this has no relation > to getting this package included in emacs, this is just what a > potential user would like]. > -- Thierry Volpiatto Gpg key: http://pgp.mit.edu/