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: Fri, 20 Jul 2007 16:51:58 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

Hi,

this one adds the possibility to describe an emacs command to
`anything-source-emacs-commands'.

--8<---------------cut here---------------start------------->8---
diff -u /home/heimdall/elisp/anything.el.orig /home/heimdall/elisp/anything.el
--- /home/heimdall/elisp/anything.el.orig       2007-07-20 12:00:26.000000000 
+0200
+++ /home/heimdall/elisp/anything.el    2007-07-20 16:26:31.000000000 +0200
@@ -58,8 +58,7 @@
 ;; This is only an example. Customize it to your own taste!
 (defvar anything-sources `(((name . "Buffers")
                             (candidates . anything-buffer-list)
-                            (action . (("Switch to Buffer" . switch-to-buffer)
-                                       ("Kill Buffer" . kill-buffer))))
+                            (type . buffer))
 
                            ((name . "File Name History")
                             (candidates . file-name-history)
@@ -195,7 +194,11 @@
              ("Delete File" . (lambda (file)
                                 (if (y-or-n-p (format "Really delete file %s? "
                                                       file))
-                                    (delete-file file)))))))
+                                    (delete-file file))))))
+    (buffer . (("Switch to Buffer" . switch-to-buffer)
+               ("Pop to Buffer"    . pop-to-buffer)
+               ("Display Buffer"   . display-buffer)
+               ("Kill Buffer"      . kill-buffer))))
   "A list of (TYPE . ACTION) pairs specifying actions for sources
   which have no action defined. See the `action' attribute of
   `anything-sources' for possible action values.")
@@ -291,8 +294,12 @@
                                      (push (symbol-name a) 
                                            commands)))) 
                      (sort commands 'string-lessp))) 
-    (action . (lambda (command-name) 
-                (call-interactively (intern command-name)))))
+    (action . (("Execute Command" . (lambda (command-name) 
+                                      (call-interactively
+                                       (intern command-name))))
+               ("Describe Command" . (lambda (command-name)
+                                       (describe-function
+                                        (intern command-name)))))))
   "Source for completing and invoking Emacs commands.")
 
 

Diff finished.  Fri Jul 20 16:27:22 2007
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo
-- 
VI VI VI - The Roman Number Of The Beast





reply via email to

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