>>>>> Ralf Angeli <[EMAIL PROTECTED]> writes: > Occasionally I find myself opening an external shell for running > texdoc. I think it would be nice to have access to TeX-related > documentation from inside Emacs. We could start with something like
> (defun TeX-doc (name) > "Display documentation for NAME." > (interactive "sCommand or package: ") > (call-process "texdoc" nil 0 nil name)) > I'll have to check if MikTeX offers something similar. > Maybe this could be expanded later to include command references like > <URL:http://www.miwie.org/tex-refs/>. Also, etexshow for ConTeXt > could be hooked in. > Would that be nice? Yes that would be nice. I also often find myself having to look at the source of packages and classes [usually ones I have written myself when I can't remember what a command I wrote years ago does]. It is handy to have a command to look these up as well. I have a very crude thing that does this using kpsewhich: (defun jeho-latex-find-package-current-file () (interactive) (let ((packages '()) documentclass package) (save-excursion (goto-char (point-min)) (while (re-search-forward "\\(usepackage\\|documentclass\\)\\(?:\\[[^]]+\\]\\)?{\\([^}]+\\)}" nil t) (if (string= (match-string 1) "documentclass") (setq documentclass (cons (match-string 2) (concat (match-string 2) ".cls"))) (push (cons (match-string 2) (concat (match-string 2) ".sty")) packages)))) (when documentclass (push documentclass packages)) (setq package (cdr (assoc (completing-read "Package: " (if (or documentclass packages) (cons documentclass packages) '())) packages))) (when package (setq output (shell-command-to-string (concat "kpsewhich " package))) (cond ((string-match (format "\\(.+%s\\)\n" package) output) (if (file-exists-p (match-string 1 output)) (find-file (match-string 1 output)) (error "Can't find file: %s" (match-string 1 output)))) ((string= output "") (error "Can't find package %s" package)) (t (error "Kpsewhich error: %s" output)))))) Regards, -- Jim Ottaway _______________________________________________ auctex-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/auctex-devel
