;;; libxml-doc.el - look up libxml-symbols and start browser on documentation ;; Author: Felix Natter ;; Created: Jun 21 2000 ;; Keywords: libxml documentation ;; 2001-05-31: Adapted by Geert Kloosterman ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; Commentary / README ;; these functions allow you to browse the libxml documentation ;; (using lynx within emacs by default; ;; ----- Installing ;; 1. add the following to ~/.emacs (adapt path and remove comments !) ;; (load ~/elisp/libxml-doc.el) ;; you can also load this conditionally in a c-mode-hook (preferred) ;; ;;(add-hook 'c-mode-hook (lambda() ;; (load-file "~/elisp/libxml-doc.el"))) ;; ;; or you can use this if you are using libxml2 ;;(add-hook 'c-mode-hook (lambda() ;; (save-excursion ;; (if (search-forward "#include ]*href[ \t\n]*=[ \t\n]*\"\\([^=>]*\\)\"[^>]*>" nil t nil) (setq uri (concat "file://" (expand-file-name (match-string 1) libxmldoc-root))) (if (not (re-search-forward "\\([^<]*\\)<" nil t nil)) ; GJK: no '*' (error "regexp error while finding libxml-symbols..")) (setq symbol (match-string 1)) (setq case-fold-search nil) (if (or nofilter (null (string-match libxmldoc-filter-regexp symbol))) (add-to-list 'symbols (cons symbol uri))) (setq case-fold-search t) ) (kill-buffer (current-buffer)) (setq files (cdr files))) symbols)) ;;; libxml-doc.el ends here ;;; Local Variables: ;;; indent-tabs-mode: nil ;;; End: