diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2012-06-09 14:24:22 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2012-06-09 14:24:22 +0200 |
commit | d50d191e6e9fdb3d4f4521ea85edd426124f9797 (patch) | |
tree | da786d0e40a6f75c5653c86fd74b9ee586245393 /elisp/geiser-guile.el | |
parent | 30231d54fb2801f4c10a952ab5e257cdd5205491 (diff) | |
download | geiser-chez-d50d191e6e9fdb3d4f4521ea85edd426124f9797.tar.gz geiser-chez-d50d191e6e9fdb3d4f4521ea85edd426124f9797.tar.bz2 |
Support for user-defined Guile info nodes
In my debian machine, the info nodes for guile live in the "guile-2.0"
node, rather than plain "guile". A new customizable variable,
geiser-guile-manual-lookup-nodes, lets now specify additional names,
and we only add indexes to the info-lookup mode definition when the
node actually exists.
Diffstat (limited to 'elisp/geiser-guile.el')
-rw-r--r-- | elisp/geiser-guile.el | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el index da14b4e..54443b8 100644 --- a/elisp/geiser-guile.el +++ b/elisp/geiser-guile.el @@ -1,6 +1,6 @@ ;; geiser-guile.el -- guile's implementation of the geiser protocols -;; Copyright (C) 2009, 2010, 2011 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2011, 2012 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -109,6 +109,11 @@ effect on new REPLs. For existing ones, use the command :type 'boolean :group 'geiser-guile) +(geiser-custom--defcustom geiser-guile-manual-lookup-nodes '("Guile" "guile-2.0") + "List of info nodes that, when present, are used for manual lookups" + :type '(repeat string) + :group 'geiser-guile) + ;;; REPL support: @@ -302,14 +307,22 @@ it spawn a server thread." ;;; Manual lookup + +(defun geiser-guile--info-spec (&optional nodes) + (let* ((nrx "^[ ]+-+ [^:]+:[ ]*") + (drx "\\b") + (res (when (Info-find-file "r5rs" t) `(("(r5rs)Index" nil ,nrx ,drx))))) + (dolist (node (or nodes geiser-guile-manual-lookup-nodes) res) + (when (Info-find-file node t) + (mapc (lambda (idx) + (add-to-list 'res (list (format "(%s)%s" node idx) nil nrx drx))) + '("Variable Index" "Procedure Index" "R5RS Index")))))) + + (info-lookup-add-help :topic 'symbol :mode 'geiser-guile-mode :ignore-case nil :regexp "[^()`',\" \n]+" - :doc-spec - '(("(r5rs)Index" nil "^[ ]+-+ [^:]+:[ ]*" "\\b") - ("(Guile)R5RS Index" nil "^ - [^:]+: " "\\b") - ("(Guile)Procedure Index" nil "^ - [^:]+: " "\\b") - ("(Guile)Variable Index" nil "^ - [^:]+: " "\\b"))) + :doc-spec (geiser-guile--info-spec)) (defun guile--manual-look-up (id mod) (let ((info-lookup-other-window-flag |