From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: getting help for your guile libraries in emacs Date: Sun, 25 Nov 2007 19:16:40 +0100 Message-ID: <87odditcl3.fsf@pobox.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196014626 2882 80.91.229.12 (25 Nov 2007 18:17:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2007 18:17:06 +0000 (UTC) To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Nov 25 19:17:12 2007 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IwM2Y-0006mK-CO for guile-user@m.gmane.org; Sun, 25 Nov 2007 19:17:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwM2J-0003wr-4Z for guile-user@m.gmane.org; Sun, 25 Nov 2007 13:16:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IwM2E-0003wh-Rd for guile-user@gnu.org; Sun, 25 Nov 2007 13:16:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IwM2C-0003w9-JU for guile-user@gnu.org; Sun, 25 Nov 2007 13:16:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwM2C-0003w6-Dx for guile-user@gnu.org; Sun, 25 Nov 2007 13:16:48 -0500 Original-Received: from ambient.dashsystems.com ([216.27.85.7] helo=kettle.ambient-hosting.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IwM2C-0000uV-4C for guile-user@gnu.org; Sun, 25 Nov 2007 13:16:48 -0500 Original-Received: from localhost.localdomain (ambient-hosting.net [10.1.6.1]) by kettle.ambient-hosting.net (Postfix) with ESMTP id D83A58808A for ; Sun, 25 Nov 2007 13:16:43 -0500 (EST) Original-Received: by localhost.localdomain (Postfix, from userid 1000) id E6C7A1182DA; Sun, 25 Nov 2007 19:16:40 +0100 (CET) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6296 Archived-At: Greets, I just discovered an emacs trick that many of you probably know about, but I figured it's work putting it out there. Perhaps you have heard of C-h S, which is info-lookup-symbol. It opens texinfo documentation for the symbol at point. However this isn't very useful for me for two reasons. The first reason is that the the info files that are installed in my system are outdated -- I would want docs for CVS guile rather than 1.6, for example. The second reason is that often I want docs for libraries that aren't a base part of Guile, for example g-wrap or guile-gnome-gtk. Fortunately both of these problems have solutions! In your .emacs: (setq scheme-mode-doc-specs nil) (setq Info-additional-directory-list (list "~/src/guile-1.8/doc/ref" "~/src/guile-1.8/doc/goops")) (setq scheme-mode-doc-specs '(("(guile)Procedure Index" nil "^ -+ .*: " " ") ("(guile)Variable Index" nil "^ -+ .*: " " ") ("(guile)R5RS Index" nil "^ -+ .*: " " ") ("(goops)Function and Variable Index" nil "^ -+ .*: " " "))) (info-lookup-add-help :mode 'scheme-mode :regexp "[^()`',\" \t\n]+" :ignore-case nil :doc-spec scheme-mode-doc-specs) This tells emacs that if it doesn't find an info file in the normal dirs (set via INFOPATH or via the standard install preferences, such as /usr/share/info), that it should look for info files in the Info-additional-directory-list. Then, it says that when programming in scheme-mode, to lookup help from the three indices in guile.info, and the one from goops.info. If you want to add other projects to this set, it is easy. For example, put the following in your .emacs before the info-lookup-add-help line to add info-lookup support for programming in guile-gnome: ;; Change this to nil if you use installed info files (setq guile-gnome-platform-dir "~/src/guile-gnome/platform/") (setq guile-gnome-platform-doc-paths '("glib/doc/gobject" "glib/doc/glib" "atk/doc" "pango/doc/pango" "pango/doc/pangocairo" "gtk/doc/gdk" "gtk/doc/gtk" "libglade/doc" "gnome-vfs/doc" "libgnome/doc" "libgnomeui/doc" "libgnomecanvas/doc" "gconf/doc")) (setq guile-gnome-platform-doc-names (mapcar (lambda (x) (string-match "^\\([a-z0-9-]+\\)/doc/?\\([a-z0-9-]+\\)?$" x) (or (match-string 2 x) (match-string 1 x))) guile-gnome-platform-doc-paths)) (if guile-gnome-platform-dir (nconc Info-additional-directory-list (mapcar (lambda (path) (concat guile-gnome-platform-dir path)) guile-gnome-platform-docs))) (nconc scheme-mode-doc-specs (mapcan (lambda (wrapset) (list (list (concat "(guile-gnome-" wrapset ")Type Index") nil "^ -+ .*: " " ") (list (concat "(guile-gnome-" wrapset ")Function Index") nil "^ -+ .*: " " "))) guile-gnome-platform-doc-names)) Pretty sweet. I hope this has helped someone, I know that it has helped me. If you have other nifty hacks, please reply with some code snippets! Peace, Andy. note: the index names of guile-gnome correspond to indices in as-yet unreleased versions of guile-gnome; change them to the name of the index nodes in the versions you have if you are interested in such things -- http://wingolog.org/ _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user