mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-07 06:43:02 +03:00
- doc/libxml-doc.el: Felix Natter provided anew version working
with XEmacs too Daniel
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
Sat Jul 7 21:09:55 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
|
|
||||||
|
* doc/libxml-doc.el: Felix Natter provided anew version working
|
||||||
|
with XEmacs too
|
||||||
|
|
||||||
Sat Jul 7 02:16:00 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
Sat Jul 7 02:16:00 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
|
|
||||||
* include/libxml/xpath.h: small cleanup
|
* include/libxml/xpath.h: small cleanup
|
||||||
|
@@ -21,7 +21,8 @@
|
|||||||
;;; Commentary / README
|
;;; Commentary / README
|
||||||
|
|
||||||
;; these functions allow you to browse the libxml documentation
|
;; these functions allow you to browse the libxml documentation
|
||||||
;; (using lynx within emacs by default;
|
;; (using lynx within emacs by default)
|
||||||
|
;;
|
||||||
;; ----- Installing
|
;; ----- Installing
|
||||||
;; 1. add the following to ~/.emacs (adapt path and remove comments !)
|
;; 1. add the following to ~/.emacs (adapt path and remove comments !)
|
||||||
;; (autoload 'libxmldoc-lookup-symbol "~/elisp/libxml-doc"
|
;; (autoload 'libxmldoc-lookup-symbol "~/elisp/libxml-doc"
|
||||||
@@ -29,12 +30,16 @@
|
|||||||
;; or put this file in load-path and use this:
|
;; or put this file in load-path and use this:
|
||||||
;; (autoload 'libxmldoc-lookup-symbol "libxml-doc"
|
;; (autoload 'libxmldoc-lookup-symbol "libxml-doc"
|
||||||
;; "Look up libxml-symbols and start browser on documentation." t)
|
;; "Look up libxml-symbols and start browser on documentation." t)
|
||||||
|
;;
|
||||||
;; 2. adapt libxmldoc-root:
|
;; 2. adapt libxmldoc-root:
|
||||||
;; i.e. (setq libxmldoc-root "~/libxml2-2.0.0/doc/html/")
|
;; i.e. (setq libxmldoc-root "~/libxml2-2.0.0/doc/html/")
|
||||||
|
;;
|
||||||
;; 3. change the filter-regex: by default, cpp-defines, callbacks and
|
;; 3. change the filter-regex: by default, cpp-defines, callbacks and
|
||||||
;; html-functions are excluded (C-h v libxmldoc-filter-regexp)
|
;; html-functions are excluded (C-h v libxmldoc-filter-regexp)
|
||||||
|
;;
|
||||||
;; 4. consider customizing libxmldoc-browse-url (lynx by default);
|
;; 4. consider customizing libxmldoc-browse-url (lynx by default);
|
||||||
;; cannot use Emacs/W3 4.0pre46 because it has problems with the html
|
;; cannot use Emacs/W3 4.0pre46 because it has problems with the html
|
||||||
|
;;
|
||||||
;; ----- Using
|
;; ----- Using
|
||||||
;; call M-x libxmldoc-lookup-symbol: this will prompt with completion and
|
;; call M-x libxmldoc-lookup-symbol: this will prompt with completion and
|
||||||
;; then open the browser showing the documentation. If the word around the
|
;; then open the browser showing the documentation. If the word around the
|
||||||
@@ -44,7 +49,7 @@
|
|||||||
;; Note:
|
;; Note:
|
||||||
;; an alternative to libxml-doc is emacs tags:
|
;; an alternative to libxml-doc is emacs tags:
|
||||||
;; $ cd libxml2-2.3.8
|
;; $ cd libxml2-2.3.8
|
||||||
;; $ etags *.c *.h
|
;; $ make TAGS
|
||||||
;; $ emacs
|
;; $ emacs
|
||||||
;; M-. (M-x find-tag) ... or
|
;; M-. (M-x find-tag) ... or
|
||||||
;; M-x tags-search ... RET M-, M-, ...
|
;; M-x tags-search ... RET M-, M-, ...
|
||||||
@@ -76,16 +81,20 @@
|
|||||||
;; Sat Jun 23 16:20:34 2001: update the docstrings
|
;; Sat Jun 23 16:20:34 2001: update the docstrings
|
||||||
;; Sat Jun 23 16:22:54 2001 (Geert Kloosterman <geertk@ai.rug.nl>):
|
;; Sat Jun 23 16:22:54 2001 (Geert Kloosterman <geertk@ai.rug.nl>):
|
||||||
;; update README: use autoload instead of load+c-mode-hook
|
;; update README: use autoload instead of load+c-mode-hook
|
||||||
|
;; Sat Jul 7 19:00:31 2001: fixed a problem with XEmacs: the
|
||||||
|
;; string-match of XEmacs when used in completing-read used the
|
||||||
|
;; minibuffer's value of case-fold-search, and not the one in the
|
||||||
|
;; c-mode buffer that we had set => so there's a new *-string-match-cs
|
||||||
|
;; (case sensitive) function which binds case-fold-search and runs string-match
|
||||||
|
|
||||||
;;; TODO:
|
;;; TODO:
|
||||||
;; - use command-execute for libxmldoc-browse-url
|
;; - use command-execute for libxmldoc-browse-url
|
||||||
;; - keep (match-string 1) in a variable (libxmldoc-get-list-of-symbols)
|
;; - keep (match-string 1) in a variable (libxmldoc-get-list-of-symbols)
|
||||||
|
;; (only if it improves performance)
|
||||||
;; - check the (require ..)-statements
|
;; - check the (require ..)-statements
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(provide 'libxmldoc)
|
|
||||||
|
|
||||||
(require 'browse-url)
|
(require 'browse-url)
|
||||||
(require 'term)
|
(require 'term)
|
||||||
|
|
||||||
@@ -114,48 +123,60 @@ the html (and would be too slow), so lynx-emacs is used by default.")
|
|||||||
|
|
||||||
(defun libxmldoc-lookup-symbol(&optional symbol)
|
(defun libxmldoc-lookup-symbol(&optional symbol)
|
||||||
"Look up xml-symbol." (interactive)
|
"Look up xml-symbol." (interactive)
|
||||||
(let
|
;; setting case-fold-search is now done in libxmldoc-string-match-cs
|
||||||
;; this is necessary so that filtering is done case-sensitively
|
|
||||||
((case-fold-search nil))
|
|
||||||
|
|
||||||
;; Build up a symbol list if neccesary
|
;; Build up a symbol list if neccesary
|
||||||
(if (null libxmldoc-symbols)
|
(if (null libxmldoc-symbols)
|
||||||
(setq libxmldoc-symbols (libxmldoc-get-list-of-symbols)))
|
(setq libxmldoc-symbols (libxmldoc-get-list-of-symbols)))
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
((not (null symbol)) ;; symbol is specified as argument
|
(symbol ;; symbol is specified as argument
|
||||||
(if (not (assoc symbol libxmldoc-symbols))
|
(if (not (assoc symbol libxmldoc-symbols))
|
||||||
(setq symbol nil)))
|
(setq symbol nil)))
|
||||||
((assoc (thing-at-point 'symbol) libxmldoc-symbols)
|
((assoc (thing-at-point 'symbol) libxmldoc-symbols)
|
||||||
(setq symbol (thing-at-point 'symbol)))
|
(setq symbol (thing-at-point 'symbol)))
|
||||||
;; this is needed to catch callbacks
|
;; this is needed to catch callbacks
|
||||||
;; note: this could be rewritten to use (thing-at-point 'word)
|
;; note: this could be rewritten to use (thing-at-point 'word)
|
||||||
((assoc (concat "*" (thing-at-point 'symbol)) libxmldoc-symbols)
|
((assoc (concat "*" (thing-at-point 'symbol)) libxmldoc-symbols)
|
||||||
(setq symbol (concat "*" (thing-at-point 'symbol))))
|
(setq symbol (concat "*" (thing-at-point 'symbol))))
|
||||||
)
|
)
|
||||||
|
|
||||||
;; omit "" t) from call to completing-read for the sake of xemacs
|
;; omit "" t) from call to completing-read for the sake of xemacs
|
||||||
(setq symbol
|
(setq symbol (completing-read
|
||||||
(completing-read "Libxml: " (if (or symbol
|
"Libxml: " libxmldoc-symbols
|
||||||
(null libxmldoc-filter-regexp))
|
(if (or symbol (null libxmldoc-filter-regexp))
|
||||||
libxmldoc-symbols
|
nil
|
||||||
(mapcar
|
'(lambda(key,value)
|
||||||
'(lambda(key,value)
|
(not (libxmldoc-string-match-cs libxmldoc-filter-regexp
|
||||||
(if (null (string-match
|
(car key,value)))))
|
||||||
libxmldoc-filter-regexp
|
t symbol
|
||||||
(car key,value)))
|
'libxmldoc-symbol-history))
|
||||||
key,value))
|
|
||||||
libxmldoc-symbols))
|
|
||||||
nil t symbol
|
|
||||||
'libxmldoc-symbol-history))
|
|
||||||
|
|
||||||
|
|
||||||
;; start browser
|
;; start browser
|
||||||
(apply libxmldoc-browse-url
|
(apply libxmldoc-browse-url
|
||||||
(list (cdr (assoc symbol libxmldoc-symbols))))))
|
(list (cdr (assoc symbol libxmldoc-symbols)))))
|
||||||
|
|
||||||
|
;; (if (or symbol
|
||||||
|
;; (null libxmldoc-filter-regexp))
|
||||||
|
;; libxmldoc-symbols
|
||||||
|
;; (mapcar
|
||||||
|
;; '(lambda(key,value)
|
||||||
|
;; (if (null (string-match
|
||||||
|
;; libxmldoc-filter-regexp
|
||||||
|
;; (car key,value)))
|
||||||
|
;; key,value))
|
||||||
|
;; libxmldoc-symbols))
|
||||||
|
|
||||||
|
|
||||||
;;;; internal
|
;;;; internal
|
||||||
|
|
||||||
|
(defun libxmldoc-string-match-cs(regexp str)
|
||||||
|
"This is needed because string-match in XEmacs uses the current-
|
||||||
|
buffer's value of case-fold-search (different from GNU Emacs)."
|
||||||
|
(let ((case-fold-search nil))
|
||||||
|
(string-match regexp str)))
|
||||||
|
|
||||||
(defun libxmldoc-get-list-of-symbols()
|
(defun libxmldoc-get-list-of-symbols()
|
||||||
"Get the list of html-links in the libxml-documentation."
|
"Get the list of html-links in the libxml-documentation."
|
||||||
(let ((files
|
(let ((files
|
||||||
@@ -183,13 +204,15 @@ the html (and would be too slow), so lynx-emacs is used by default.")
|
|||||||
;; this needs add-to-list because i.e. xmlChar appears often
|
;; this needs add-to-list because i.e. xmlChar appears often
|
||||||
(if (not (string-equal "" (match-string 1)))
|
(if (not (string-equal "" (match-string 1)))
|
||||||
(add-to-list 'symbols (cons (match-string 1) uri))))
|
(add-to-list 'symbols (cons (match-string 1) uri))))
|
||||||
;; (setq symbols (cons (cons (match-string 1) uri) symbols)))
|
;; (setq symbols (cons (cons (match-string 1) uri) symbols)))
|
||||||
)
|
)
|
||||||
(setq files (cdr files)))
|
(setq files (cdr files)))
|
||||||
symbols))
|
symbols))
|
||||||
|
|
||||||
|
(provide 'libxmldoc)
|
||||||
|
|
||||||
;;; libxml-doc.el ends here
|
;;; libxml-doc.el ends here
|
||||||
|
|
||||||
;;; Local Variables:
|
;;; Local Variables:
|
||||||
;;; indent-tabs-mode: nil
|
;;; indent-tabs-mode: nil
|
||||||
;;; End:
|
;;; End:
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* hash.c: chained hash tables
|
* hash.h: chained hash tables
|
||||||
*
|
*
|
||||||
* Copyright (C) 2000 Bjorn Reese and Daniel Veillard.
|
* Copyright (C) 2000 Bjorn Reese and Daniel Veillard.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user