My various dotfiles

get-gcl-info.el 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. ;;(autoload 'get-gcl-info "get-gcl-info" "Get gcl info for ANSI common lisp functions" t)
  2. (defvar gcl-completion-alist nil)
  3. (defun make-gcl-completion-alist()
  4. (let ((tem all-nodes)
  5. ans x)
  6. (while tem
  7. (setq x (car tem))
  8. (cond ((and (string-match ";" x)
  9. (not (string-match "; and" x)))
  10. (let ((y x)(i 0) j (lim (length x)))
  11. (while (< i lim)
  12. (setq j (string-match "[;][ ]*" x i))
  13. (setq ans (cons (cons (substring x i j) x) ans))
  14. (setq i (match-end 0))
  15. (or j (setq i lim))))))
  16. (setq ans (cons (cons x x) ans))
  17. (setq tem (cdr tem))
  18. )
  19. (setq gcl-completion-alist (nreverse ans))))
  20. ;(make-gcl-completion-alist)
  21. (defun get-gcl-info ()
  22. (interactive)
  23. (let (a(completion-ignore-case t))
  24. (setq a (completing-read "Doc on: " gcl-completion-alist nil t nil nil))
  25. (setq a (assoc a gcl-completion-alist))
  26. (Info-goto-node (concat "(gcl.info)" (or (cdr a) (car a))))))
  27. (define-key (current-global-map) "\M-?" 'get-gcl-info)
  28. (defun get-gcl-nodes-from-tags ()
  29. (let ((tem Info-directory-list) buf y all)
  30. (save-excursion
  31. (while tem
  32. (cond
  33. ((file-exists-p (concat (car tem) "gcl.info"))
  34. (setq buf (find-file-noselect (concat (car tem) "gcl.info")))
  35. (set-buffer buf)
  36. (setq gcl-completion-alist nil)
  37. (setq all nil)
  38. (widen)
  39. (goto-char (point-min))
  40. (setq tem nil)
  41. (search-forward "Tag Table:")
  42. (search-forward "Node:")
  43. (beginning-of-line)
  44. (while (looking-at "Node: \\([^\n]*\\)")
  45. (setq all
  46. (cons (cons (setq y (buffer-substring (match-beginning 1)
  47. (match-end 1)))
  48. y)
  49. all
  50. ))
  51. (forward-line 1)
  52. )
  53. ))
  54. (setq tem (cdr tem))))
  55. all
  56. ))
  57. ;(require 'all-gcl-nodes)
  58. ;(setq gcl-completion-alist(mapcar '(lambda (x) (cons x x)) all-nodes))
  59. ;(setq gcl-completion-alist (get-gcl-nodes-from-tags))
  60. (setq gcl-completion-alist (get-gcl-nodes-from-tags))
  61. (provide 'get-gcl-info)