From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Goldman Subject: searchable refcard Date: Tue, 02 Dec 2008 09:09:28 -0600 Message-ID: <49354FA8.8080106@sift.info> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7Wsa-0004eQ-30 for emacs-orgmode@gnu.org; Tue, 02 Dec 2008 10:09:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7WsY-0004eE-BC for emacs-orgmode@gnu.org; Tue, 02 Dec 2008 10:09:35 -0500 Received: from [199.232.76.173] (port=37132 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7WsY-0004eB-8S for emacs-orgmode@gnu.org; Tue, 02 Dec 2008 10:09:34 -0500 Received: from outbound-mail-137.bluehost.com ([67.222.39.27]:38459) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1L7WsX-00028W-QW for emacs-orgmode@gnu.org; Tue, 02 Dec 2008 10:09:34 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org I tried it the stupid way, just to see it working: (defun org-context-help () "Context help for org-mode" (interactive) (if (org-at-table-p) (info "(org)tables") (if (org-at-timestamp-p) (info "(org)timestamps") (if (org-at-item-checkbox-p) (info "(org)Checkboxes") (if (org-at-item-p) (info "(org)plain lists") (if (org-at-heading-p) (info "(org)headlines") (if (org-at-property-p) (info "(org)Properties and Columns") ))))))) For this kind of multi-way branch, cond is easier to deal with: (cond ((org-at-table-p) (info "(org)tables")) ((org-at-timestamp-p) (info "(org)timestamps")) ((org-at-item-checkbox-p) (info "(org)Checkboxes")) ((org-at-item-p) (info "(org)plain lists")) ((org-at-heading-p) (info "(org)headlines")) ((org-at-property-p) (info "(org)Properties and Columns"))) Just for the fun of it. I tried to use a list like this: (setq org-context-help-map '(('org-at-item-checkbox-p "(org)Checkboxes" "(org)plain lists") ('org-at-item-p "(org)plain lists" "(org)Checkboxes") ('org-at-property-p "(org)Properties and Columns") ('org-at-timestamp-p "(org)timestamps" "(org)deadlines and scheduling") ('org-at-table-p "(org)tables") ('org-at-heading-p "(org)headlines"))) For this you need (require 'cl), but what about (let ((cell (find-if (lambda (lst) (eval `(,(first lst)))) org-context-help-map))) (when cell (eval `(,(second cell))))) The find avoids the need to do a non-local exit. Note that I don't understand what you're doing with having two info indices, so I ignored the second one... Alternatively (loop for (test info-entry info-entry2) in org-context-help-map when (eval `(,test)) return info-entry) using the loop macro... BTW, I don't think you want that quote inside your definition of org-context-help-map. You want '((org-at-item-checkbox-p ...)) not '(('org-at-item-checkbox-p ...)) The extra quote will be a nuisance. HTH, R